Skip to content

feat(audit-ufs): add --staged pre-commit lens#20

Merged
indykish merged 1 commit into
masterfrom
feat/ufs-staged-mode
Jun 5, 2026
Merged

feat(audit-ufs): add --staged pre-commit lens#20
indykish merged 1 commit into
masterfrom
feat/ufs-staged-mode

Conversation

@indykish

@indykish indykish commented Jun 5, 2026

Copy link
Copy Markdown
Owner

What

audits/ufs.sh was the only full-codebase audit without a --staged mode. Its siblings (design-tokens, error-codes, logging, deinit-pairs, spec-template) and msid-ui already have one. This adds parity so a product repo's pre-commit harness can scope UFS to the commit instead of the whole tree.

Why

usezombie's make harness-verify (pre-commit) runs each gate full-codebase. With 410 pre-existing string-dup-file violations in untouched files, every commit that stages a code file is blocked — even when the staged files are clean. --staged lets the pre-commit lens judge only what's being committed; make lint / harness-verify-all keep canonical full-codebase enforcement.

How

  • --staged narrows the per-file checks (string-dup-file, numeric-suspect) to git diff --cached --name-only --diff-filter=ACMRT.
  • cross-runtime-orphan (ERR_* parity) stays full-codebase — it needs cross-runtime visibility to compare Zig ↔ TS/JS.
  • Full-codebase remains the default (--all alias unchanged) → invariants 22.1/22.2 hold, M70 semantics intact.
  • --diff stays retired (exit 2). --staged reads the index, so it is not blind to staged-but-uncommitted fixes — the exact concern M70 cited.

Verification

  • bash -n clean · 279 lines (< 350) · make audit RC=0 (dispatch evals 10/10)
  • Modes: --diff→exit 2 · --staged→exit 0 (nothing staged) · --all→full scan
  • Pre-existing shellcheck SC2221/SC2222 on line 64 (is_source test-pattern overlap) is not touched by this diff — out of scope.

Consumer

usezombie make/harness.mk calls audits/ufs.sh --staged (separate PR on its chore/dispatch-sync branch). This PR must merge for that symlink call to resolve permanently.

🤖 Generated with Claude Code

…dits)

ufs.sh was the lone full-codebase audit without a --staged mode; its siblings
(design-tokens, error-codes, logging, deinit-pairs, spec-template) and msid-ui
already have one. A pre-commit harness should judge what is being committed,
not the whole tree.

--staged narrows the per-file checks (string-dup-file, numeric-suspect) to
`git diff --cached`. cross-runtime-orphan (ERR_* parity) stays full-codebase —
it needs cross-runtime visibility. Full-codebase remains the default, so
`make lint` / harness-verify-all keep canonical enforcement; --diff stays
retired (exit 2). --staged reads the index, so it is not blind to staged-but-
uncommitted fixes — the exact concern M70 cited when it retired --diff.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@indykish indykish merged commit c169fd1 into master Jun 5, 2026
1 check passed
@indykish indykish deleted the feat/ufs-staged-mode branch June 5, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant