Skip to content

hr-handoff: make the reconciliation checker report covered N/M and fail closed - #507

Merged
bompus merged 4 commits into
mainfrom
feat/handoff-covered-nm
Oct 31, 2026
Merged

bompus merged 4 commits into
mainfrom
feat/handoff-covered-nm

Conversation

@bompus

@bompus bompus commented Oct 31, 2026

Copy link
Copy Markdown
Owner

A retrospective found the handoff reconciliation checker covering 16 of 101 plan item lines and still reporting complete: it accounted only for the records it was handed, and never asked whether it had been handed the plan.

check-reconciliation.mjs now prints covered N/M. M counts every open or deferred item line in the plan files it was given, including lines outside the ## Ledger section, checklist lines with a mark it cannot read, and table rows; N counts the ones mapped to an item. A short count is a gap (exit 2) or an error (exit 1), never a clean result. A ledger section that parses to no item lines is an error. A receipt that names no plan file is partial with covered 0/0, unless its new plan field says "none: <reason>"; claiming complete coverage then is an error. covered survives a later validation failure.

Checklist lines in + and numbered form are read like - [ ]; tables are recognized by header and separator, with or without leading pipes, and fenced examples are skipped. The example receipt gains the plan field. No existing handoff file or plan is changed, and the exit codes keep their meaning.

Checked: tests written first (six failed); a local review found five ways a plan line could still vanish from the total or the count reset, each now with a test. bun run check and the full test run pass.

… closed on a plan it did not read

The checker accounted only for the records it was given, so a receipt built from a hand-made snapshot could cover 16 of 101 plan item lines and still report complete. It now reports covered N/M: the open and deferred plan lines mapped to items over every such line in the plan files it was given, counting lines outside the ledger section and table rows it does not read as items. A ledger section with no item lines is an error, and a receipt that names no plan file is partial with covered 0/0 unless its plan field says none: <reason>. The example receipt gains that field.
… covered when a later check fails

Checklist lines in + and numbered form were invisible to the total; they are now read as items, and a checklist line with another mark counts as unread. Tables without leading pipes, and rows after a separator-like row, were skipped; a table is now recognized by its header and separator and every body row counts. A fenced table example is not unread work. A later validation failure no longer resets covered to 0/0.
@bompus bompus added the author:anthropic Pull request written by a anthropic model label Oct 31, 2026

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 4 finding(s).

…and keep checklist lines out of header detection

A table outside the ledger section, a table row written without pipes, a fence closed by a different delimiter and a checklist line that looks like a table header each let an open line drop out of covered. A table is now read wherever it is until a blank line, heading or list item; a fence closes only with the same character, at least as long, with nothing after it; and a checklist line is never taken for a header.

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 3 finding(s).

…match a mark outside the BMP

A one-column table whose header has no pipe, an inline code span at the start of a line that was read as a fence, and a checklist mark written as one emoji each let an open line drop out of covered. The header needs no pipe when the separator after it has one, a fence opens only with up to three spaces of indent and no backtick in the text after a backtick fence, and a checklist mark is matched as a whole character.

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Sol, xhigh reasoning): 0 finding(s).

Review 3: only high findings and above are posted from here on.

@bompus bompus closed this Oct 31, 2026
@bompus
bompus merged commit dcce9ff into main Oct 31, 2026
2 checks passed
@bompus
bompus deleted the feat/handoff-covered-nm branch October 31, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:anthropic Pull request written by a anthropic model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant