Repository navigation
feat(metrics): widen the revert rule and add the escaped-defect count (T879a) - #199
Merged
Merged
Conversation
bketelsen
approved these changes
Nov 5, 2026
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.
Summary
ACMM scorecard (T879a, 2026-11-04), missing instruments 3 and 5 (G1 and G7): the spec's revert rule missed bketelsen/fleet#99 (
Revert #94: …, noRevertsline), and no rule or tool counted escaped defects.docs/specs/pr-acceptance-metric.md: new### Revert rule. A change (merged PR, or a default-branch commit that is no PR's own commit) reverts merged PR P by 1 of 3 rules: the quoted titleRevert "T"(T = P's title, or its squash subjectT (#P)); a revert word and a reference to P in the title, any order; a body line with a revert word and, after it, a reference to P. References:#N,owner/name#N, PR URL; they resolve only to merged PRs in the input. fleet#99 is the named vector. New### Escaped defects: cohort = PRs by the given authors (defaultfrostyard-machines) merged in[from, to); complete only whenas_of ≥ to + 7 days(no rate before); P escaped when a change merged in(P, P + 7 days]reverts P or names P as fixed: a fix word (closed list) and a reference to P with at most 3 words between, either order, no sentence end between, in the title or 1 body line. The## Definitionand## Rulesheadings stay (docs gate pin).scripts/lib/pr-outcomes.mjs: pure functions an audit can import:parseReferences,prCommitNumber,normalizeChanges,findReverts,namesAsFixed,escapedDefects. Each match carries its rule and the line that matched.scripts/pr-outcomes.mjs: read-only CLI,revertsandescaped, fromgh(gh pr list --search merged:…,gh api --paginate --slurp repos/R/commits) or from--input FILE(no network). 1000 PRs from 1 search is an error, never a silent partial count.\p{L},\p{N}); changes and the cohort are PRs merged into the default branch (the CLI reads it withgh api repos/R, keeps off-branch PRs only for their merge SHAs); both CLI modes apply the same--repoand window selection; fix-name matching is linear (4 tokens each way)..memory/corrections.jsonl: 3 lines (blocker to guard).test/pr-outcomes.test.mjs: 37 tests.docs/design/quality-loop.md: 1 line in Observe.For the audit (bketelsen/pi-pocket-team Q1, not changed here): call
findReverts(or runreverts --input) instead of the title-only rule; then Q1's "reverts its rule misses" note in the spec is no longer needed, so the spec now says Q1 reports the changes it matched.Risk tier
Risk tier: 1 — a metric spec, a read-only report and its tests. No workflow, authority, policy, or risk path; the report is not in
verify/check.Verification
node --test test/pr-outcomes.test.mjs: 37/37 pass.make ci: 313 tests pass, docs gate green (head95634fb).Vectors: fleet#99 → fleet#94 by rule "title"; the GitHub button form (rules 1 and 3, each alone);
Revert "X (#94)";revert: undo frostyard/updex#12across repositories; negatives (no reference, a number that is no merged PR, a revert before P, a self-reference,#94after a letter or&, a reference before the revert word in the body, a cross-repository#N); the spec's fix-name vectors (4 positive, 2 negative, exactly 3 and 4 words between); window bounds (P + 7 days counts, + 1 ms does not); cohort bounds and the author filter; incomplete cohort (to + 7 days − 1 ms); 2 fixing changes count once; a squash commit is no change, a direct revert commit is; the CLI with--input, text and JSON, and exit 2 on a usage error.Revert test (scratch worktree from the PR head, removed after): rule 2 (title) switched off, tests kept: 9 of 26 fail on assertions (at
bf7013b; 10 of 34 at the fix round), among themfleet#99 reverts fleet#94 by the title rule,fleet#94 is 1 escape over a complete cohort, …,rule 2 across repositories: revert: undo frostyard/updex#12.Real run, read-only:
node scripts/pr-outcomes.mjs reverts --repo bketelsen/fleet --repo frostyard/frostnotes --since 2026-10-04T00:00:00Z --until 2026-11-05T00:00:00Zfinds fleet#99 → fleet#94 (rule title).escaped --repo bketelsen/fleet --from 2026-10-28T00:00:00Z --to 2026-10-29T00:00:00Z: complete, merged 8, escaped 1 (fleet#94, by revert and by the fix linePR #94 broke the regexes). The baseline's other revert, frostnotes0ddd26e(10-19), is a direct commit that reverts a direct commit (docs: keep plan 0007 …, no PR with that title): no PR was reverted, so it is outside a PR metric, and the tool rightly reports none.Revert tests for the review fixes: each new test fails with its fix off (coder's check at
be391ed); in a scratch worktree with the code ofbe391edand the tests ofce5b261, the off-branch merge-commit and 2-page fetch tests fail, and with the tie-break clause removed the same-instant test fails too; with the95634fblib change stashed, the branch-duplicate test fails.Cross-review (reviewer
openai/gpt-6.1-sol; codersdeepseek/deepseek-flashfor code and tests,github-copilot/claude-opus-5.5for the spec and small fixes; base408ec56): initial review atbf7013b: Not ready, 6 blocking (identical titles in rule 1; squash commits by subject only; duplicate PRs inflate the denominator; ASCII boundaries vs "letters";--inputignored the selection; branch scope unstated) and 1 low (cubic matching), all accepted, fixed inbe391ed. Re-review 1 atbe391ed: Not ready, 2 blocking (an off-branch PR dropped before its merge SHA was read; tie-break not in the spec) and 1 low (fetch test lost its 2nd page), fixed ince5b261. Re-review 2 atce5b261: Not ready, 1 blocking (duplicate check ignored the branch fields), fixed in95634fb. Re-review 3 at95634fb: Ready, Blocking: none. Budget used: 1 review + 3 re-reviews.Base moved after the final review: core#198 merged into main (
99d37ee) while this PR was in review, and both PRs append to.memory/corrections.jsonl. Merge commit98c9374(no force-push) mergesorigin/mainand keeps feat(corrections-report): --ref reads each file at a ref, once per clone (T879a) #198's 2 lines before this PR's 3 (append-only check passes). The PR's changed lines against its new base are byte-for-byte the changed lines of the reviewed range408ec56..95634fb(checked withgit diff … | grep '^[+-]'on both ranges, the corrections file compared by added lines).make ciat98c9374: 321 tests pass; CI green. By the cross-review policy, a new base invalidates the final review and the budget was used; Brian authorized 1 more re-review (T881a). Re-review 4 (openai/gpt-6.1-sol) of the merge95634fb..98c9374, base and merge-base99d37ee: the metric files are byte-for-byte those of the Ready head, the corrections order is append-only with no line lost or duplicated, no adverse interaction with feat(corrections-report): --ref reads each file at a ref, once per clone (T879a) #198: Ready, Blocking: none.Docs housekeeping