fix: align intent Plan/ingest AC gate + clear audit placeholder (iss-67) - #35
Merged
Conversation
Three intent-lifecycle fidelity fixes: - C9: Plan accepted an Acceptance Criteria section with any non-blank line, but ingest counts only top-level -/* bullets — so a prose-only or numbered section planned, then dead-lettered every fidelity verdict forever (zero positional criteria). hasAcceptanceCriteria now delegates to countAcceptanceCriteria, so the Plan gate and the ingest gate agree on what 'has criteria' means. - seed3: appendToAuditNotes preserved the intent template's Audit Notes placeholder above the first real review block. It is now dropped when a block lands. The matcher tolerates both delimiter styles the templates have used (italic _Empty..._ and angle-bracket <Empty...>) so wording drift can't leave a placeholder behind; a real audit line never starts that way. Backfills the one already-shipped record that carried a stale placeholder (itd-80). - C10: ReEmitReview's doc claimed it 're-parks the OWED stub' but a terminal (INGESTED/DEAD_LETTER) receipt is not re-reviewed — it returns that status unchanged (the CLI surfaces it). Corrected the doc; behaviour was already right. Deferred (seed9): a DEAD_LETTER re-ingest of a byte-identical payload rewrites the same marker block. Purely cosmetic — the record is byte-identical either way, and short-circuiting it would thread a new status through the recovery path (a fixed payload must still move DEAD_LETTER -> INGESTED). No correctness impact. Reviewed: security PASS + ruthless SHIP; both review NICE-TO-HAVEs (broaden the placeholder matcher, backfill itd-80) applied. Assisted-by: Claude:claude-opus-4-8
Assisted-by: Claude:claude-opus-4-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves iss-67 (native ledger) — intent-lifecycle fidelity gaps from the sweep.
Fixes (
internal/core/intent)Planaccepted an## Acceptance Criteriasection with any non-blank line, but the ingest gate counts only top-level-/*bullets. So a prose-only or numbered section could be planned, then dead-lettered every fidelity verdict forever (zero positional criteria to map).hasAcceptanceCriterianow delegates tocountAcceptanceCriteria, so the Plan gate and the ingest gate agree on what "has criteria" means.appendToAuditNotesleft the template's Audit Notes placeholder (_Empty. Populated by…_) sitting above the first real review block. It's now dropped when a block lands. The matcher tolerates both delimiter styles the templates have used (italic_…_and the older angle-bracket<Empty until…>), so wording drift can't leave a placeholder behind — and a real audit line never starts that way, so it can't eat one. Backfills itd-80, the one already-shipped record carrying a stale placeholder.ReEmitReview's comment claimed it "re-parks the OWED stub," but a terminal (INGESTED/DEAD_LETTER) receipt is not re-reviewed — it returns that status unchanged (the CLI surfacesalready_ingested/already_dead_letter, so it was never truly silent). Corrected the doc; behaviour and status-reporting were already right.Tests (each watched fail on revert)
TestPlanRefusesBulletlessAcceptanceCriteria— a prose-only AC section is refused at Plan.TestFirstReviewBlockClearsPlaceholder— both placeholder styles are cleared when a review block lands.make preflight+make record-lintgreen (including the itd-80 backfill). Reviewed: security-reviewer PASS (the placeholder strip can't erase real content and doesn't touch the untrusted-verdict path or the receipt digest), ruthless-reviewer SHIP; both review NICE-TO-HAVEs (broaden the matcher, backfill itd-80) applied.Deferred (
seed9)A DEAD_LETTER re-ingest of a byte-identical payload rewrites the same marker block. Purely cosmetic — the committed record is identical either way, and short-circuiting it would thread a new "unchanged" status through the delicate recovery path where a fixed payload must still move DEAD_LETTER→INGESTED. No correctness impact.
Assisted-by: Claude:claude-opus-4-8