Skip to content

Document embed.FS sync invariants as explicit review rules in AGENTS.md #262

Closed

Description

@fullsend-ai-retro

What happened

PR #256 updated 7 files under .opencode/ with new scaffold version markers but did not update the byte-identical copies under internal/scaffold/assets/. The fullsend review agent (run 34826753129, run 34853194485) reviewed all 3 commits and missed this drift entirely. The human reviewer (@gxmiranda) caught it as a [HIGH] finding with exact remediation commands. The repo already has TestEmbeddedAssetsMatchSource and TestEmbeddedPromptMatchesScaffold that enforce this invariant, but the sync relationship is not documented anywhere as an explicit rule — it is implicit in the test code.

What could go better

The review agent did not know about the .opencode/ → internal/scaffold/assets/ sync requirement. This relationship is critical (breaking it fails CI) but undocumented as a review invariant. The agent reviewed changes to .opencode/ files without recognizing they have mandatory corresponding changes elsewhere. The human reviewer caught it because they understood the embed.FS pattern and the test infrastructure. Confidence: high — the root cause is clearly a documentation gap, not an agent capability limitation. The agent reads AGENTS.md as context; adding this invariant would surface it during review.

Proposed change

Add a 'File Sync Invariants' subsection to the 'Key Patterns' section of AGENTS.md that explicitly documents which file groups must remain byte-identical:

### File Sync Invariants

The following file groups MUST remain byte-identical. Changing one without updating the other breaks CI:

| Source of Truth | Embedded Copy | Enforced By |
|----------------|---------------|-------------|
| `.opencode/{agents,commands,references}/*.md`, `.opencode/dcp.jsonc` | `internal/scaffold/assets/` (same relative paths) | `TestEmbeddedAssetsMatchSource` |
| `internal/scaffold/assets/agents/gaze-reporter.md` | `internal/aireport/assets/agents/gaze-reporter.md` | `TestEmbeddedPromptMatchesScaffold` |

This gives any reviewer — human, fullsend bot, or Divisor persona — an explicit lookup table. The Divisor Architect already asks 'Are generated or embedded assets kept in sync with their canonical sources?' but without this table, the question is unanswerable without code archaeology.

Validation criteria

On the next PR that modifies files under .opencode/ (e.g., a scaffold version bump or agent prompt update), the fullsend review agent should flag the sync requirement if corresponding internal/scaffold/assets/ files are not updated. Verify by checking whether the agent's findings mention the sync invariant or the affected embedded copies. Sample size: the next 3 PRs touching .opencode/ files.


Generated by retro agent from #256

Activity

  1. added
    ready-for-triage
    on Sep 15, 2026
  2. fullsend-ai-triage commented on Sep 15, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 10:04 AM UTC · Completed 10:08 AM UTC

    Commit: 0e64f36 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $0.91

  3. added
    documentation
    ready-to-code
    on Sep 15, 2026
  4. fullsend-ai-triage commented on Sep 15, 2026

    @fullsend-ai-triage

    Triage Summary

    The proposed change is well-scoped and actionable. The issue provides exact markdown content for the new subsection, including a table mapping source files to their embedded copies and enforcing tests.

    Related work:

    Implementation note: This is a documentation-only change to AGENTS.md — no production code, tests, or CI config are modified. The existing TestEmbeddedAssetsMatchSource and TestEmbeddedPromptMatchesScaffold tests already enforce the invariant; this change makes the rule visible to reviewers.

    // Proposed test case (conceptual):
    // After adding the File Sync Invariants table to AGENTS.md,
    // verify accuracy by confirming:
    // 1. TestEmbeddedAssetsMatchSource exists in internal/scaffold/scaffold_test.go
    // 2. TestEmbeddedPromptMatchesScaffold exists in internal/aireport/ test files
    // 3. Both tests cover the file paths listed in the new table
    // No new test code needed — validation is behavioral across future PRs.

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. fullsend-ai-coder commented on Sep 15, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 10:09 AM UTC · Completed 10:13 AM UTC

    Commit: 0e64f36 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.14

  6. added 2 commits that reference this issue on Sep 17, 2026
  7. added a commit that references this issue on Sep 22, 2026
  8. added a commit that references this issue on Sep 23, 2026
  9. added 2 commits that reference this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentationready-for-triageready-to-code

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions