feat(hr-what-next): list open lines a later done line already resolves
check-open-work.mjs now lists open or deferred ledger lines that a later done line probably resolves, in a new group "possibly resolved by a later done line".
Why. Until now one ledger line closed another only for offer IDs. An item waiting on a pull request, thread or commit stayed open when the result was written as a new done line, unless GitHub already showed the pull request merged (and then only with gh). Nothing compared the ledger's own lines. The chief-of-staff ledger-health script (scripts/ledger-health.ts, check 1) made this check for one plan; this moves the portable part here.
What it does. An open or deferred line is listed when its recheck: date has passed and a later - [x] line names the same pull request, issue (a bare number counts as --repo's), commit, mcp: thread id or offer ID of three or more parts. A token that more than 8 ledger lines name is too common to tie two lines together. The group reads only the plan text, so it also runs on a plan that fails its lint. Like "possibly finished" and "re-check due" it is a subset of open and does not change the exit code. Offer IDs also appear in "unanswered offers", which looks only at open [ ] lines without a recorded answer; the two groups answer different questions, so both can list a line.
Not changed. The other plan checkers (check-reconciliation.mjs, panel-plan.mjs) do not compare ledger lines with each other, so nothing else needed to move.
Proof. Three new tests in skills/hr-what-next/test/check-open-work.test.mjs fail on the old script (3 fail, 45 pass) and pass with the change (48 pass): the five token kinds, the four non-matches (an earlier done line, a future date, a common token, a different item) and a plan that fails its lint. Local runs, all exit 0: oxfmt@0.70.0 --check ., oxlint@1.85.0 . (one existing warning), node --test test/*.test.mjs (182 pass), bun test test/ (no failures), npm run check:package -- --bun, bun test skills/ (368 pass). SKILL.md and the changelog entry describe the group. No release, tag or publish.
Summary by cubic
Extends the hr-what-next open-work check with a "possibly resolved by a later done line" group, listing open or deferred items whose recheck: date has passed when a later done line names the same pull request, issue, commit, mcp: thread id, or offer ID — the result was probably logged as a new line instead of closing the old one.
Details
- A bare PR number counts as
--repo's, offer IDs need three or more parts, and a token named by more than 8 lines is too common to match. - Commits of only digits or only letters match after the word "commit" or "sha" so dates and counts are not mistaken for shas.
- The group reads only the plan text, so it runs on a plan that fails its lint, and is a subset of
openthat does not change the exit code.