Skip to content

Trim PUB GATE — delegate consumer-grep to zlint unused-decls#17

Merged
indykish merged 1 commit into
masterfrom
chore/pub-gate-trim-consumer-grep
May 14, 2026
Merged

Trim PUB GATE — delegate consumer-grep to zlint unused-decls#17
indykish merged 1 commit into
masterfrom
chore/pub-gate-trim-consumer-grep

Conversation

@indykish

Copy link
Copy Markdown
Owner

Summary

  • Mechanical consumer-grep delegated to zlint's unused-decls: error rule. The PUB GATE body keeps the agent-only design call: shape verdict + no inheritance.
  • Per-edit proof block compresses from "consumers + shape + no-inheritance" → "shape verdict + no-inheritance". Roughly half the ceremony per new pub surface.
  • unused-decls: error is now marked load-bearing in docs/ZIG_RULES.md so a future ruleset trim doesn't silently bypass the gate.

Why

zlint already catches "pub fn with no consumer" mechanically — every make lint run fails on it. The gate's pre-edit consumer-grep loop was paying the same cost twice. What zlint can't decide:

  • Whether a new public symbol belongs on a struct as a method or as a free fn (file-as-struct vs conventional layout).
  • "I cloned the sibling's justification verbatim instead of doing my own grep + verdict" — a reasoning anti-pattern, not a syntactic one.

So the gate body retains those two design calls; the mechanical orphan-pub check moves to lint.

Changes

  • AGENTS.md row 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-symbol consumer= field; self-audit calls out 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 a cross-reference to PUB GATE.

Audit

✅ ALL CHECKS PASSED (17/17)
size 25548 bytes (limit 25600) — 52 bytes under
pre-push: ✅ AGENTS_INVARIANCE sign-off PASS for 00e426f (age 0 min)

Test plan

  • bash scripts/audit-agents-md.sh → ALL CHECKS PASSED
  • Pre-commit hook runs audit + commits
  • Pre-push hook validates fresh .agents-invariance-signoff
  • First real consumer of the new format: usezombie M68 §10a code commit (next PR) cites the trimmed PUB GATE proof
  • Project repos refresh AGENTS.md via bin/sync-agents once merged

🤖 Generated with Claude Code

…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.
@indykish indykish merged commit 00e426f into master May 14, 2026
1 check passed
@indykish indykish deleted the chore/pub-gate-trim-consumer-grep branch May 14, 2026 05:17
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