Trim PUB GATE — delegate consumer-grep to zlint unused-decls#17
Merged
Conversation
…decls The PUB GATE was enforcing two things that overlapped: (1) mechanical "every pub has a consumer" verification, which zlint's unused-decls:error already fails the build on, and (2) the design call — shape verdict (file-as-struct vs conventional) + no-inheritance (don't clone a sibling's justification). Overlap (1) is now delegated explicitly. The gate body keeps the design call, which is unique to the agent: zlint can't decide whether a new pub fn belongs on a struct or as a free fn, and it can't detect "I cloned the sibling's reasoning verbatim instead of doing my own grep + verdict". Per-edit proof block compresses from "consumers + shape + no-inheritance" to "shape verdict + no-inheritance" — roughly half the ceremony per pub. Changes: - AGENTS.md row 10 — gate description trimmed; consumer-grep moved to zlint. - docs/gates/pub-surface.md — pre-edit step 3 (consumer-grep loop) and step 4 (manual orphan sweep) replaced with "shape verdict per new surface, no inheritance"; required output drops the per-symbol consumer= field; self-audit notes the load-bearing make lint run. - AGENTS_INVARIANCE.md Q4.4 + Q4.4a — rephrased to match new contract; Q4.4b (per-edit proof-line) and Q4.4c (threshold-as-floor) unchanged. - docs/ZIG_RULES.md ZLint Policy — unused-decls:error marked load-bearing with the cross-reference back to PUB GATE so future ruleset trims don't silently bypass the gate. Size: 25548 / 25600 bytes (52 under). All 17 audit checks PASS. Reviewed surface: §10a code commit in M68 trigger-DX worktree uses the new trimmed proof format.
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
zlint'sunused-decls: errorrule. The PUB GATE body keeps the agent-only design call: shape verdict + no inheritance.unused-decls: erroris now marked load-bearing indocs/ZIG_RULES.mdso a future ruleset trim doesn't silently bypass the gate.Why
zlint already catches "pub fn with no consumer" mechanically — every
make lintrun fails on it. The gate's pre-edit consumer-grep loop was paying the same cost twice. What zlint can't decide:So the gate body retains those two design calls; the mechanical orphan-pub check moves to lint.
Changes
AGENTS.mdrow 10 — gate description trimmed; consumer-grep delegation made explicit.docs/gates/pub-surface.md— pre-edit step 3 (consumer-grep loop) and step 4 (manual orphan sweep) replaced with "own shape verdict per new surface, no inheritance"; required output drops the per-symbolconsumer=field; self-audit calls out the load-bearingmake lintrun.AGENTS_INVARIANCE.mdQ4.4 + Q4.4a — rephrased to match new contract; Q4.4b (per-edit proof-line) and Q4.4c (threshold-as-floor) unchanged.docs/ZIG_RULES.mdZLint Policy —unused-decls: errormarked load-bearing with a cross-reference to PUB GATE.Audit
Test plan
bash scripts/audit-agents-md.sh→ ALL CHECKS PASSED.agents-invariance-signoffusezombieM68 §10a code commit (next PR) cites the trimmed PUB GATE proofAGENTS.mdviabin/sync-agentsonce merged🤖 Generated with Claude Code