From 00e426fde9536c85535692c324ff68a4229a33ed Mon Sep 17 00:00:00 2001 From: Kishore Kumar Date: Thu, 14 May 2026 10:45:33 +0530 Subject: [PATCH] =?UTF-8?q?docs(agents):=20trim=20PUB=20GATE=20=E2=80=94?= =?UTF-8?q?=20delegate=20consumer-grep=20to=20zlint=20unused-decls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- AGENTS.md | 2 +- AGENTS_INVARIANCE.md | 4 ++-- docs/ZIG_RULES.md | 1 + docs/gates/pub-surface.md | 18 +++++++----------- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2b43c9e..379d463 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -105,7 +105,7 @@ Guards fire pre-hoc regardless of lifecycle stage. Override: `: SKIPPED pe | 7 | Milestone-ID Gate | `docs/gates/milestone-id.md` | Saving source / config outside `docs/`. Regex `M[0-9]+_[0-9]+`, `§X.Y`, `T7`, `dim N.M` · `MILESTONE ID ALLOWED per user override (reason: ...)` in preceding comment. | | 8 | Architecture Consult & Update Gate | `docs/gates/architecture.md` | Naming a stream/channel/Redis namespace/queue/RPC/Postgres schema; describing a flow; mid-task architecture question — grep relevant `docs/architecture/` · **no override** — doc wins until reconciled. | | 9 | ZIG GATE | `docs/gates/zig.md` | `*.zig` outside `vendor/`/`third_party/`/`.zig-cache/` (tests in scope) · `ZIG GATE: SKIPPED per user override (reason: ...)`. | -| 10 | Pub Surface & Struct-Shape Gate | `docs/gates/pub-surface.md` | New `*.zig` under `src/`; threshold-cross (first pub type / first method-on-pub-free-fn-dominant / last pub free fn removed); **any new `^pub` line in new-bytes** (threshold list is a floor, not a ceiling) · `PUB GATE: SKIPPED per user override (reason: ...)`. **`FILE SHAPE DECISION` skip needs user's explicit ask this turn — auto-mode does NOT cover.** **No inheritance:** each new pub surface requires its own consumer-grep + shape verdict; cloning a sibling's "Public for the integration test in …" comment does NOT discharge. **Per-edit proof-line mandatory** (full block OR one-line `PUB GATE: skipped — `); silent gate-clean edits are violations. | +| 10 | Pub Surface & Struct-Shape Gate | `docs/gates/pub-surface.md` | New `*.zig` under `src/`; threshold-cross (first pub type / first method-on-pub-free-fn-dominant / last pub free fn removed); **any new `^pub` line in new-bytes** (threshold list is a floor, not a ceiling) · `PUB GATE: SKIPPED per user override (reason: ...)`. **`FILE SHAPE DECISION` skip needs user's explicit ask this turn — auto-mode does NOT cover.** Consumer-grep delegated to `zlint`'s `unused-decls: error`; body enforces **shape verdict** + **no inheritance** (own verdict per surface; do not inherit sibling justifications). **Per-edit proof-line mandatory** (full block OR one-line `PUB GATE: skipped — `); silent gate-clean edits are violations. | | 11 | UI Component Substitution Gate | `docs/gates/ui-substitution.md` | `*.tsx`/`*.jsx` under `ui/packages/app/`. Raw HTML (`
`/`