Repository navigation
fix(decisions): measure staleness from the commit that landed a decision - #4357
Merged
Merged
Conversation
A decision recorded on a branch names the branch's commits, and the squash that lands them comes after the record is created, so every such record counted its own landing commit as a change to the files it governs and went stale by construction. Staleness, the decision show / get_why sentence and every reader of the stored score now count from the later of the record's birth and the first-parent commit that landed its evidence: the commit itself, or the one squash that names it (title or squash-body bullet) and changes its files. Unresolved evidence keeps the birth as the anchor. The Do next row for a drifting decision claims only what the score measures: its files changed since it was recorded.
…ing lookup into helpers
Member
Author
|
The two complex-method findings (compute_staleness, describe_decision_currency) are addressed in the latest push: the staleness anchor and the currency landing lookup each moved into a small helper. |
Coverage: 1 uncovered changed linePatch coverage 96.2% (26 of 27 changed executable lines covered)
1 changed file is not in the coverage report, so not counted
Report from this run for |
swati510
approved these changes
Oct 22, 2026
7 tasks done
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.
What
A decision recorded on a branch names that branch's commits, and the squash that lands them arrives after the record is created. Staleness counted every commit after
created_at, so the landing commit itself made the record stale by construction. On this repository 162 of 172 accepted decisions read as stale and filled 162 of 217 quarter rows inrepowise next.How
analysis/decisions/landing.pyplaces each record's evidence commits on HEAD's first-parent line. A commit there landed as itself. A branch commit landed in the one first-parent commit after it that names it (subject less(#N), or a* <subject>bullet in the squash body) and changes a file it changed. Anything else is unresolved and the record keepscreated_atas its anchor, so an unresolved commit never makes a record fresher.compute_stalenessmeasures from the later of the record's birth and that landing. Both rescore paths (index and update) pass the repo path.decision showand theget_why"still true" sentence count<landing>..HEADwith the same anchor. Every other reader (decision health,needs_review, Do next,stale_governance) reads the stored score.docs/layers/DECISIONS.mdstaleness bullet.Verification
Bar, written before measuring: on a copy of this repository's index, every decision that flips stale to fresh is listed. A blind judge with opaque ids reads the diffs of every commit after recording and must find 0 flipped rows with a later change to the decided behaviour. Rows flipping fresh to stale: expected 0. A held-out index with decisions is measured if one exists.
Results:
repowise next: 217 to 197.tests/unit/analysis/test_decision_landing.pyruns real git. A recompute wiring test was added, and the existing decision, currency, actions, why and persist suites pass.