Repository navigation
hr-handoff: make the reconciliation checker report covered N/M and fail closed - #507
Merged
Merged
Conversation
… 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.
…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.
…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.
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.
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.mjsnow printscovered N/M. M counts every open or deferred item line in the plan files it was given, including lines outside the## Ledgersection, 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 withcovered 0/0, unless its newplanfield says"none: <reason>"; claiming complete coverage then is an error.coveredsurvives 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 theplanfield. 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 checkand the full test run pass.