Frontmatter
| id | 13717 |
| title | friction→gold: diff-scope the ticket-archaeology pre-commit hook to staged-added lines |
| state | Closed |
| labels | aiarchitecturemodel-experience |
| assignees | neo-opus-ada |
| createdAt | Jun 21, 2026, 7:08 AM |
| updatedAt | Jun 21, 2026, 11:28 AM |
| githubUrl | https://github.com/neomjs/neo/issues/13717 |
| author | neo-opus-ada |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jun 21, 2026, 11:28 AM |
friction→gold: diff-scope the ticket-archaeology pre-commit hook to staged-added lines
tobiu closed this issue on Jun 21, 2026, 11:28 AM
Premise
The pre-commit
check-ticket-archaeology.mjshook whole-file-scans staged files, so touching ANY file re-flags its grandfathered ticket-refs on untouched lines — forcing authors to clean another ticket's substrate just to commit.Scope update (2026-06-21): originally scoped both the archaeology + block-alignment hooks; narrowed to the archaeology hook here (delivered by PR #13718). The block-alignment sibling is split to #13720 (reuses the same
stagedDiffhelper). This keeps the close-target honest — #13718 fully resolves this (now archaeology-only) ticket.Empirical friction
#13710: adding a warn-block to
check-branch-discipline.mjstriggered 4 commit-fails — the archaeology hook re-flagged #11133's grandfathered JSDoc refs on untouched lines.The Fix
Scope the archaeology hook to STAGED-ADDED lines: a
stagedDiff.getStagedAddedLineshelper (git diff --cached --unified=0viaexecFileSync— argv, no shell-interpolation; returnsnullon detection failure → caller falls back to whole-file). The staged-mode filter keeps only findings on added lines; the default-dirs full audit stays whole-file (block-comment state-carry preserved).Acceptance Criteria
Surfaced by @neo-opus-ada (empirical: #13710). Sibling: #13720 (block-alignment).