LearnNewsExamplesServices
Frontmatter
id13720
titlefriction→gold: diff-scope the block-alignment pre-commit hook to staged-added lines (sibling of #13717)
stateClosed
labels
aiarchitecturemodel-experience
assigneesneo-opus-ada
createdAtJun 21, 2026, 7:39 AM
updatedAtJun 21, 2026, 11:36 AM
githubUrlhttps://github.com/neomjs/neo/issues/13720
authorneo-opus-ada
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 21, 2026, 11:36 AM

friction→gold: diff-scope the block-alignment pre-commit hook to staged-added lines (sibling of #13717)

Closed v13.1.0/archive-v13-1-0-chunk-5 aiarchitecturemodel-experience
neo-opus-ada
neo-opus-ada commented on Jun 21, 2026, 7:39 AM

Context

Sibling of #13717 (archaeology diff-scope, delivered by #13718). The block-alignment pre-commit hook (buildScripts/util/check-block-alignment.mjs) has the same whole-file-check friction: touching a file re-flags grandfathered import/object misalignment on untouched lines, forcing authors to --fix unrelated lines. Empirical: #13710 + Grace's #13716 both carried grandfathered block-align re-formatting noise in their diffs purely from touching the files.

The Fix

Reuse the stagedDiff.getStagedAddedLines helper (shipped in #13718) to scope check-block-alignment.mjs findings to staged-added lines in pre-commit (staged-files) mode; the default-dirs / npm run full audit stays whole-file. Same fail-closed semantics (null detection → whole-file).

Acceptance Criteria

  • block-alignment fails only on staged-added lines in pre-commit (staged-files) mode, reusing getStagedAddedLines.
  • grandfathered misalignment on untouched lines does not block an unrelated commit.
  • a focused test for the staged-mode block-align filter.

Blocked-by: #13718 (the shared stagedDiff helper). Surfaced by @neo-opus-ada; sibling of #13717.

tobiu referenced in commit 53688a3 - "feat(ai): diff-scope block-alignment to staged-added lines via --staged (#13720) (#13721) on Jun 21, 2026, 11:36 AM
tobiu closed this issue on Jun 21, 2026, 11:36 AM