Skip to content

[WS9] Build .fork-features/ sync infrastructure #169

@randomm

Description

@randomm

Parent Epic

Part of #158 (Fork Realignment)

Objective

Create the .fork-features/ directory with manifest, verification tests, sync command, and report system — BEFORE merging any feature branches. This becomes the governance layer for all future upstream syncs.

Deliverables

1. .fork-features/manifest.json — Feature Registry

Declares all fork-specific features with:

  • status: active / upstream-absorbed / dropped
  • newFiles / modifiedFiles: File inventory per feature
  • criticalCode: Strings that MUST exist post-merge (grep gate)
  • tests: Feature-specific test paths to run
  • upstreamTracking.absorptionSignals: Patterns to detect when upstream absorbs our feature
  • upstreamTracking.relatedPRs/Issues: Links for context

Features declared: async-tasks, rg-tool, 1m-context

2. .fork-features/verify.ts — Standalone Verification Test

Standalone bun test (no preload dependency). Checks:

  • All newFiles exist on disk
  • All criticalCode strings found in source via grep
  • Runs each feature's tests via subprocess
  • Scans upstream for absorptionSignals — if triggered, auto-pause and ask user which version to keep
  • Runs full typecheck

3. .opencode/command/sync-upstream.md — AI-Executable Sync Command

Custom slash command that:

  • Pre-injects: upstream gap, manifest, last 3 sync reports
  • Instructs agent to: create sync branch → merge → resolve conflicts → run verify.ts → write report
  • On absorption signal: STOP and present diff to user for decision
  • Requires agent to write dated report to .fork-features/reports/
  • Tells agent to read last 3 reports before starting (institutional memory)

4. .fork-features/README.md — Human Documentation

Explains the system, how to add/drop features, how reports work.

5. .fork-features/reports/ — Sync Run History

Directory for dated markdown reports. Each run records:

  • What was merged (upstream commit range)
  • Conflicts and resolutions
  • Feature verification results
  • Absorption signal alerts
  • Decisions made, pain points, recommendations

Quality Gates

  • bun test .fork-features/verify.ts passes against current dev (baseline)
  • All 3 features verified: async-tasks, rg-tool, 1m-context
  • /sync-upstream command loads in opencode
  • Report template produces valid markdown

Sequencing

This issue MUST complete before merging ws1/ws3/ws4 branches.
After this, Phase 2 merges feature branches under governance of verify.ts.

Technical Notes

  • verify.ts is standalone — no dependency on test/preload.ts
  • manifest.json lives at .fork-features/manifest.json (NOT in .opencode/)
  • Absorption detection: auto-pause + ask user (never silently override)
  • CI: add bun test .fork-features/ step to .github/workflows/ci.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions