Skip to content

fix: catch a dispatch template that reaches its subagent with no grammar - #80

Merged
azevedo merged 9 commits into
mainfrom
fix/ba-review-plan-dispatch-drift
Aug 9, 2026
Merged

azevedo merged 9 commits into
mainfrom
fix/ba-review-plan-dispatch-drift

Conversation

@azevedo

@azevedo azevedo commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Risk: medium — 218 lines across 7 files; two prompt surfaces plus the CI check that pins them

Two of /ba-review-plan's three dispatch templates reached their subagent carrying neither the legal confidence-value set nor the protected-artifacts guard, and all three cited their instructions positionally — "the dispatch instructions in the section above", pointing at a document the subagent does not have. Both are general-purpose templates with no agent definition behind them, so the template text was their entire specification. Now each Task block carries the contract inline, and every apply-phrase cites its section by title.

rubric-mirror was green on that file throughout, which is the other half of the defect: it asserted the literal once per file, so a stripped template passed on the strength of a sibling's correct copy. The check now asserts per Task block. A mirror file with no Task block at all reads UNKNOWN rather than PASS, so deleting the templates cannot look like compliance.

While removing the positional phrasing, the same defect turned up in ba-review's three templates ("the standard format described above"), aimed at subagents with the same missing referent. Fixed there too — the file this change otherwise treats as the correct shape to copy.

Testing limitations

The two runtime criteria could not be verified from the authoring session: a running session executes the skill body it loaded at start, so it would exercise the cached plugin rather than the working tree. They were closed afterwards in two separate --plugin-dir sessions — one dispatching built-in agent reviewers, one dispatching general-purpose. Both confirmed the composed prompt carries the literal and the guard with no positional phrase surviving, across 30 raw confidence values with zero illegal.

Not covered: the severity-ladder wording and per-anchor confidence meanings remain hand-mirrored across the seven reviewer agents and unchecked. A green rubric-mirror still does not mean the agents agree.

Proof: automated — scripts/selfcheck-invariants.mjs (56 cases, up from 52)

Alternatives considered

Replacing the file-level zero-occurrence branch outright, rather than layering the per-block assertion on top. Rejected: the reviewer agents carry no Task blocks, so removing the file-level check would silently drop their missing-literal coverage.

azevedo-remote and others added 7 commits August 9, 2026 10:33
… merge

This plan was authored before the slice-2 PR landed. That PR inserted
loadSiteMirrorCheck into scripts/check-invariants.mjs and edited
skills/ba-review/SKILL.md, shifting four of the line numbers it cites at
the exact symbols it intends to modify.

  check-invariants.mjs  :493 -> :499  (rubricMirrorCheck)
  check-invariants.mjs  :532 -> :538  (per-file zero-occurrence branch)
  check-invariants.mjs  :102 -> :102  (RUBRIC_MIRROR_FILES, unchanged)
  ba-review/SKILL.md    :453 -> :463  (Dispatch instructions heading)
  ba-review/SKILL.md    :453-518 -> :463-539  (Step 3 preamble + templates)

Each verified to resolve to the named symbol on main @ 9694645. Symbols and
intent are unchanged; only the addresses moved. A provenance note records
the mapping and warns that nothing pins these, so they should be re-checked
before use.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two corrections to the dispatch-drift plan before executing it.

Unit anchors: #### U<n> -> ### U<n>, matching the grammar the U-ID
convention specifies and derive-state scans for. The plan minted them one
level deeper because the STANDARD template nests them under
"### Changes Required"; the anchor level is the machine-readable part, so
it wins over the visual nesting.

Citations: the previous pass matched only the `file:NNN` form and missed
the bare `:NNN` form, leaving six stale and one baseline wrong.

  ba-review/SKILL.md  Task blocks  :474/:492/:516 -> :484/:502/:526
  ba-review/SKILL.md  inline lit   :476/:494/:518 -> :486/:504/:528
  check-invariants    zero-occ     :532 -> :538
  selfcheck baseline               47 -> 52

AC6 required the selfcheck total to exceed 47. Slice 2 already took it to
52, so that threshold was tautologically satisfied before this plan does
anything. Re-anchored to 52 with the reason recorded inline.

All ten skills/ba-review-plan/SKILL.md citations were re-verified and are
unchanged: :302 and :321 (both general-purpose) still carry neither the
legal-value literal nor the protected-artifacts guard while :294 does, and
:289/:303/:322 still read "the section above". The defect this plan fixes
is live exactly as described.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e the contract

Deviation (U3): U3 enumerated only ba-review-plan edits, but AC5 forbids
"described above" repo-wide and ba-review's three Task templates still aimed
that phrase at subagents with no file to position against. Replaced with a
citation of `## Code-Anchor & Confidence Grammar`. Approved in-run.
@azevedo
azevedo merged commit bc842fa into main Aug 9, 2026
1 check passed
@azevedo
azevedo deleted the fix/ba-review-plan-dispatch-drift branch August 9, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants