@antoneeo/agentic-sdlc-skill 1.37.0 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  Tutte le modifiche significative a questa skill saranno documentate in questo file.
4
4
 
5
+ ## [1.38.0] - 2026-10-08
6
+
7
+ ### Changed
8
+ - F-065: every agent review request opens with a fixed REVIEW MANDATE block copied verbatim, which carries `review.md` itself to the reviewer in Standalone and Hybrid alike; §Requesting now lists every input its clauses check (Functional Spec, Interface Contract, Component Map, audit plan, probe harness, closure test evidence). devPNT performs no review: in Hybrid an agent review with verdict PASS precedes every proposal to devPNT, where the human reviews; after the round cap only the user's explicit decision sends an artifact on, with open findings attached.
9
+
10
+ ### Fixed
11
+ - **`memory/INDEX.md` no longer depends on the checkout's line endings.** The catalog
12
+ fingerprint hashed raw bytes, so an index regenerated on a `core.autocrlf=true`
13
+ checkout was "not aligned" on an LF one and vice versa. It is now LF-normalized,
14
+ like the guides' `source_hash`.
15
+ - **`check` prints its verdict after every check that can fail.** The knowledge
16
+ overlay ran memory/topic/corpus index validation, graph and corpus after the spine's
17
+ summary, so `check: CLEAN` could be followed by an `[ERROR]` and exit 1. Those checks
18
+ now ride `cmd_check` hooks (validate stage and own sections) and count in the summary.
19
+
5
20
  ## [1.37.0] - 2026-10-02
6
21
 
7
22
  ### Changed
package/README.md CHANGED
@@ -29,8 +29,8 @@ Vendoring requires all three files: the entry point, `sdlc_core.py`, `knowledge.
29
29
  - **Opt-in subagent execution**: an approved design projects into a validated executable plan an orchestrator can drive through subagents.
30
30
  - **Self-activating**: a SessionStart hook emits repo-sourced orientation; a deterministic self-eval battery guards the skill's own doctrine as the release gate.
31
31
  - **Standalone complete**: works fully with local `ai_docs/` without requiring devPNT.
32
- - **devPNT symbiosis**: when devPNT is available, Master Plan, Action Plan, M-VISION, and governed artifacts become the authoritative planning layer, with independent fresh-context reviews of technical artifacts and diffs.
33
- - **Independent review, twice**: the design is reviewed before it is implemented and the diff before the work is declared done — by somebody other than its author. Three rungs of independence (fresh-context subagent > one-shot run > a declared self-pass, legal only when no higher rung is usable: absent, or permission-gated and declined — a gated rung is asked about, never silently skipped, and the log says which), capped at 3 rounds, one log line per review, and a PASS is invalid on "found nothing" — it must state where each constraint is satisfied.
32
+ - **devPNT symbiosis**: when devPNT is available, Master Plan, Action Plan, M-VISION, and governed artifacts become the authoritative planning layer, and every governed artifact passes an independent agent review before it is proposed; devPNT itself performs no review — it is where you review and approve.
33
+ - **Independent review, twice**: the design is reviewed before it is implemented and the diff before the work is declared done — by somebody other than its author, who receives the whole review mandate in a fixed block copied verbatim, never a paraphrase of it. Three rungs of independence (fresh-context subagent > one-shot run > a declared self-pass, legal only when no higher rung is usable: absent, or permission-gated and declined — a gated rung is asked about, never silently skipped, and the log says which), capped at 3 rounds, one log line per review, and a PASS is invalid on "found nothing" — it must state where each constraint is satisfied.
34
34
  - **Question discipline**: a real doubt is asked when it emerges, before its answer is written into any document — grouped, with the pros and cons of each option. A choice whose pros clearly win is taken without asking, and the weighing is written next to it; a fact is settled by evidence or asked, never weighed. A question is legal only when the agent searched first, names the search with its result, and names the decision it unblocks — never a stream of "shall I proceed?".
35
35
  - **Installed support files**: Claude, Codex, Gemini, and Google Antigravity receive the full skill folder, including `templates.md`, `architect.md`, `guides.md`, `vision.md`, `tdd.md`, `debugging.md`, `elicitation.md`, `review.md`, `dispatch.md`, `routing.md`, `hybrid.md`, `ENFORCEMENT.md`, `memory.md`, and the validator's three files, `scripts/sdlc_check.py` + `scripts/sdlc_core.py` + `scripts/knowledge.py` — plus the `LICENSE` and `NOTICE` it ships under.
36
36
  - **Mechanical checks**: optional validator for document structure, generated feature history, stale audit areas, and protected-path gates — `check`, `validate`, `index`, `stale`, `mark`, `benefit`, `gate`, `plan`, `orient`, `migrate`. `benefit` reports what the review gates have already caught, beside what the doctrine costs to read — it always exits 0 and carries no verdict, because a measurement that can fail a build becomes a target.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-sdlc-skill",
3
- "version": "1.37.0",
3
+ "version": "1.38.0",
4
4
  "description": "Documentation-First SDLC protocol with triage, Vision governance and optional devPNT integration.",
5
5
  "author": "Antonio Pinto (https://github.com/Antoneeo)"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antoneeo/agentic-sdlc-skill",
3
- "version": "1.37.0",
3
+ "version": "1.38.0",
4
4
  "description": "Documentation-First SDLC protocol for Claude Code, Gemini CLI, Google Antigravity and Codex with risk triage, Vision governance, installed support files and optional devPNT integration.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agentic-sdlc
3
- version: 1.37.0
3
+ version: 1.38.0
4
4
  description: Documentation-First SDLC protocol with risk-proportional triage, Vision as a guide, a complete Standalone mode and optional symbiosis with devPNT. Use for features, significant bugs, refactors, audits and documented maintenance.
5
5
  author: Antonio Pinto (https://github.com/Antoneeo)
6
6
  copyright: (c) 2026 Antonio Pinto
@@ -188,7 +188,7 @@ Standalone L3:
188
188
  - Build the Impact/solution **on** the Vision, the use-cases/user-needs and the Security & Threat Model — read and trace to them first, and state the trace (which actor / use-case / threat / benefit each part serves) so the closure review (`review.md`) can verify conformance. Do not draft the Impact in isolation.
189
189
  - For a feature known to span multiple milestones, also create `ai_docs/vision/features/VISION_[feature].md`; the retroactive case (extract it when the SECOND `ANALYSIS_*` on a theme appears) is in Write Triggers.
190
190
 
191
- **Design review gate — the design is reviewed BEFORE any code (L3).** Close Phase 3 by handing the finished ANALYSIS to an *independent* reviewer: the procedure, the independence ladder, the round cap and the log row are `review.md` §When a review is due, moment 1 — follow it there, it is not restated here. Why the moment exists: the closure review can prove the code matches the design, never that the design was right, and the author is structurally blind to what their own design omitted. In Hybrid this slot belongs to devPNT's §4.5 gate on the `E-ISP`/`E-TDD` — run one, never both.
191
+ **Design review gate — the design is reviewed BEFORE any code (L3).** Close Phase 3 by handing the finished ANALYSIS to an *independent* reviewer: the procedure, the independence ladder, the round cap and the log row are `review.md` §When a review is due, moment 1 — follow it there, it is not restated here. Why the moment exists: the closure review can prove the code matches the design, never that the design was right, and the author is structurally blind to what their own design omitted. In Hybrid the same review runs on the `E-ISP`/`E-TDD`, by the client's agent, and its PASS precedes the proposal to devPNT, where the human reviews — `review.md` §When a review is due owns the order.
192
192
 
193
193
  Hybrid L3:
194
194
  - Restore the Master Plan, Action Plan and linked documents.
@@ -214,7 +214,7 @@ Hybrid L3:
214
214
 
215
215
  - Run the relevant tests/lint/smoke checks.
216
216
  - **Claim-to-evidence (fires at EVERY completion claim, any phase, any level).** Before stating or implying that anything passes, works, is fixed, is clean or is complete: name the claim, run the proof that establishes *that* claim **after the final relevant edit**, read the full result, and report the actual status with the evidence. Freshness: a check run before a later relevant change proves nothing about the current tree. Breadth: a narrower check never supports a broader claim — targeted tests ≠ full suite; lint ≠ build; "tests pass" ≠ "requirements complete" (that claim maps to the Functional Spec acceptance criteria where the artifact carries them; "gate clean" maps to a fresh gate run reporting clean). **Delegated work is verified on the diff/files, never on the agent's report** — "the subagent said success" is a claim, not evidence. If the environment cannot run the proof, say so and give the alternative evidence — never claim the unavailable result. Red flags that mean STOP and run the proof: "should", "probably", "seems to", "still passes", "just this once", any satisfaction expressed before verification.
217
- - For the review itself follow `review.md` (requesting and receiving findings) — the single definition, intended for reuse by the Hybrid review gates (devPNT-side wiring out of this unit's scope).
217
+ - For the review itself follow `review.md` (requesting and receiving findings) — the single definition, in Standalone and in Hybrid alike; open every request with its REVIEW MANDATE block.
218
218
  - Verify alignment with the local Vision or the devPNT M-VISION.
219
219
  - If the work was governed by user-provided indications and is reusable, **PROPOSE distilling a guide** (proactive trigger, `guides.md` §1) — a proposal for the user, never a silent write, never from model knowledge.
220
220
  - **Comprehension checkpoint** — the backstop for the Phase-3 question, when the signal only became visible while implementing: did this session force a model of a high-complexity component no CURRENT guide covers? If yes, WRITE the `source_kind: code` guide now (a duty, not a proposal) and say so in the closure. One closure later that model is gone.
@@ -99,8 +99,8 @@ Exactly three review touches per task, never a loop:
99
99
 
100
100
  1. Inline self-review by the implementer subagent before it reports done
101
101
  (the standard critical-review pass, not a separate call).
102
- 2. One reviewer pass per task (Hybrid: reuse the devPNT code-review gate;
103
- Standalone: the `review.md` discipline).
102
+ 2. One reviewer pass per task, under the `review.md` discipline in both modes
103
+ (Hybrid: against the accepted E-TDD).
104
104
  3. One broad final pass over the whole plan at closure, after all tasks are
105
105
  DONE — catches cross-task drift a per-task review cannot see.
106
106
 
@@ -135,6 +135,6 @@ have added.
135
135
  ## Hybrid note
136
136
 
137
137
  The plan's `derived-from` points at the accepted E-TDD document key. Per-task
138
- review reuses the devPNT independent reviewers (§4.6 code review gate) rather
139
- than restating review doctrine — see `review.md` for the single definition
140
- both modes share.
138
+ review is the closure review of `review.md` against that E-TDD, run by the
139
+ client's agent (devPNT doctrine §4.6 invokes the same review) — `review.md` is
140
+ the single definition both modes share.
@@ -8,10 +8,13 @@ and how do the two vocabularies map onto each other".
8
8
  write triggers are `SKILL.md`'s, and they are identical in both modes.
9
9
 
10
10
  Moved out of `SKILL.md` by F-051 so a Standalone session stops paying for a seam
11
- it cannot reach. **The content below is unchanged**: this file is a relocation,
12
- not a rewrite.
11
+ it cannot reach. **The content below is the relocated text, unchanged except
12
+ for one declared amendment**: F-065 rewrote the review rows (devPNT performs no
13
+ review; the agent review precedes the proposal — `ADR_2026-10-07_agent_review_precedes_human`).
14
+ The digest certifies the amended block, re-stamped only after the pre-edit
15
+ block matched the previous digest and the diff showed only those rows changed.
13
16
 
14
- <!-- moved-block-sha256: f11e6d5b9cd4710849fa9d3701f16ff0da39f2d163e8ffdb8adbff6a119b3614 -->
17
+ <!-- moved-block-sha256: b700966fdb47f85a794f883d38caab0a9d3443305d5800dbd186b0f0124d0681 -->
15
18
  ### Hybrid in symbiosis with devPNT
16
19
 
17
20
  Use this mode when the `devpnt_*` tools are available and point at the current project.
@@ -36,7 +39,8 @@ Hybrid rules:
36
39
  This section is the single authoritative answer to "who owns what" when both the
37
40
  skill and devPNT are active. The skill owns the **process** (triage, phases, Vision
38
41
  Gate, lifecycle); devPNT owns the **machinery** (governed storage, versioned
39
- proposals, semantic analysis, independent reviewers). devPNT strengthens the
42
+ proposals, semantic analysis, the human's review and approval surface). devPNT
43
+ performs no review: the agent review is the client's, under `review.md`. devPNT strengthens the
40
44
  process; it never replaces it.
41
45
 
42
46
  ### Ownership matrix
@@ -50,8 +54,8 @@ process; it never replaces it.
50
54
  | Feature state | ANALYSIS frontmatter `status` | Action Plan node status | mapping table below; at closure both must move together |
51
55
  | ADR | `architecture/` (canonical dir) | devPNT DB (`adr_YYYY-MM-DD_slug`) | optional filesystem shadow `SHADOW_adr_*` exported at closure for grep-ability |
52
56
  | Audit / freshness | `audit/audit_plan.md` + `stale`/`mark` | devPNT KL coverage + summary status | run `check --hybrid` (skips audit-plan staleness) |
53
- | Design review (pre-implementation) | `review.md` moment 1, on the ANALYSIS | devPNT §4.5 gate on `E-ISP`/`E-TDD` | same slot, richer backend — run ONE of them, never both |
54
- | *(mode is per unit of change, not per project)* | a Hybrid-capable project may work one feature Standalone: the slot follows the ARTIFACT the design lives in, and the mode is declared in that artifact. `validate --hybrid` suppresses the Standalone design-review backstop, since devPNT owns the slot there | | |
57
+ | Design review (pre-implementation) | `review.md` moment 1, on the ANALYSIS | `review.md` moment 1 on the `E-ISP`/`E-TDD`, by the client's agent | a sequence, not an alternative: agent review to PASS, then the proposal, then the human's review in devPNT (`review.md` §When a review is due) |
58
+ | *(mode is per unit of change, not per project)* | a Hybrid-capable project may work one feature Standalone: the slot follows the ARTIFACT the design lives in, and the mode is declared in that artifact. `validate --hybrid` suppresses the Standalone design-review backstop, since a Hybrid review row is keyed on the devPNT doc_key, not on an ANALYSIS filename, and the backstop could never match it | | |
55
59
  | Review log | `audit/reviews/REVIEW_LOG.md` | devPNT `REVIEW_LOG.md` (same path) | always filesystem |
56
60
  | Operative guides | `ai_docs/reference/` | `ai_docs/reference/` — **filesystem-first even in Hybrid** | devPNT bootstrap may point at their index; it never copies their content |
57
61
  | Handoff | `audit/handoff.md` | `audit/handoff.md` | always filesystem |
@@ -1,8 +1,11 @@
1
1
  # Review Discipline
2
2
 
3
- The single definition of how to request, receive, and perform a review. Other
4
- places that need review behavior point here instead of restating it (DRY) —
5
- including devPNT's §4.5/§4.6 gates and any future review step.
3
+ The single definition of how to request, receive, and perform an agent review,
4
+ in Standalone and in Hybrid alike. Other places that need review behavior point
5
+ here instead of restating it (DRY) — including devPNT doctrine §4.5/§4.6, which
6
+ invoke this same review, and any future review step. **devPNT performs no
7
+ review**: it hosts the governed artifacts and is where the human reviews and
8
+ approves them — after the agent review this file defines, never instead of it.
6
9
 
7
10
  ## When a review is due
8
11
 
@@ -14,6 +17,20 @@ Two moments, and they review different things:
14
17
  | **1b. Late arrival** | Work that became L3 *after* code existed — an L1/L2 reclassified mid-flight, or a design increment on a feature already implemented — runs moment 1 **now**, before any further implementation, logged `design (late)` | same | L3 |
15
18
  | **2. Closure review** | Phase 5, before DONE | the actual diff, against that approved design | L2 / L3 — the L2 closure review is optional; every review that runs logs its row |
16
19
 
20
+ **The agent review comes first, the human's after — never instead (Hybrid).**
21
+ No governed artifact that this file reviews — the design (`E-ISP`, `E-TDD`),
22
+ and whatever else the client's devPNT doctrine §4.5/§4.6 sends to review — is
23
+ proposed to devPNT before an agent review of it under this file has a final
24
+ verdict of PASS; the proposal's notes cite that
25
+ REVIEW_LOG row (date, doc_key, verdict), so the human sees which review it
26
+ passed. When the round cap is reached with findings still standing, the artifact
27
+ goes back to the user in chat with those findings, and it reaches devPNT only on
28
+ the user's explicit decision — with the open findings attached to the proposal
29
+ and the decision recorded. Where the client also follows devPNT doctrine
30
+ §4.5/§4.6, that invocation IS this review: one review, one REVIEW_LOG row in the
31
+ Hybrid realization below, and the doctrine's extra requirements add to this
32
+ mandate, never replace it.
33
+
17
34
  **Why the design review is its own moment, and not a nicety.** The closure review
18
35
  can only tell you the code matches the design; it cannot tell you the design was
19
36
  wrong. An omission in the design — an impacted file nobody listed, a threat with no
@@ -165,7 +182,7 @@ policy pays — could not be drawn.
165
182
  **mode-specific** realization columns. The core is what both modes actually share: `date`, `doc_key`,
166
183
  `tier`, `model`, `findings_raised`, `findings_real`, `verdict`, `revise_rounds`.
167
184
  Around it, Standalone adds `reviewer` and Hybrid adds `instrument` and `notes` —
168
- a devPNT row carries no `reviewer` column at all, so "one identical column list"
185
+ a Hybrid row carries no `reviewer` column at all, so "one identical column list"
169
186
  was never true of the two modes. This costs nothing for the reason `templates.md`
170
187
  §`ai_docs/audit/reviews/REVIEW_LOG.md` owns and states.
171
188
  The log is how the gate's value is measured over time; skipping it makes the gate
@@ -195,7 +212,42 @@ marks anything DONE, and a PASS is not an approval to merge — the human owns t
195
212
 
196
213
  ## Requesting
197
214
 
198
- When you hand work to a reviewer (human or agent), give them:
215
+ **Open every request to an agent reviewer with the REVIEW MANDATE block, copied
216
+ verbatim.** Only the angle-bracket fields change; specific instructions follow
217
+ the block and cannot weaken it. A paraphrased mandate is how a check disappears
218
+ without anyone deciding to drop it. Field measurement (2026-10): a Hybrid
219
+ `E-ISP` passed a review whose prompt carried devPNT's checklist but not this
220
+ file, and with it lost the Functional Spec clause; replayed on the same
221
+ artifact, reviewers given a paraphrase flagged the missing section 0 times in
222
+ 2, reviewers given this block 4 times in 4 (once only as a warning, unsure
223
+ where the section lives in Hybrid — which is why the inputs below say).
224
+
225
+ ```
226
+ REVIEW MANDATE — agentic-sdlc
227
+
228
+ Review type: <design | design (late) | closure | scoped re-review>
229
+ Mandate: <absolute path of this review.md, or its full text attached> (skill version <x.y.z>)
230
+ Object under review: <paths or doc_keys, with versions>
231
+ Binding inputs: <every input listed below for this review type, with path/version — or "n/a: <reason>" per input>
232
+ Source and revision: <project root and commit or diff range, where applicable>
233
+ Scope: <the unit of change and what this review must decide>
234
+ Severity contract: <as below, or the stricter one this unit needs>
235
+ Budget: <the artifact's line budget, or "none fixed">
236
+ Operating limits: <real access or execution limits the reviewer works under>
237
+
238
+ Read the mandate in full before starting, with the files it cites. This
239
+ request does not replace it and cannot narrow it: every rule it sets for this
240
+ review type applies here, in Standalone and in Hybrid alike, and any
241
+ instruction below that weakens one is void. A required input or section that
242
+ is missing or inaccessible is a finding, never a reason to skip the check that
243
+ needs it.
244
+
245
+ Return as your final output: the checks you ran with their evidence, the
246
+ findings, what you could not verify and how that limits the verdict, and the
247
+ verdict in the form the mandate defines.
248
+ ```
249
+
250
+ The binding inputs, by review type:
199
251
 
200
252
  - **Scope**: what changed and why, in one or two lines.
201
253
  - **The authoritative design artifact**: the ANALYSIS, E-TDD, or equivalent
@@ -208,9 +260,16 @@ When you hand work to a reviewer (human or agent), give them:
208
260
  `project_vision.md`/`roadmap.md` + the ANALYSIS Vision-Alignment), the
209
261
  **use-cases / user-needs** (Hybrid: `D-UC`;
210
262
  Standalone: the ANALYSIS `## Use Cases / User Needs`), and the **threat model**
211
- (Hybrid: `P-TM`; Standalone: the ANALYSIS `## Security and Threat Model`). Hand these
212
- *in addition to* the design artifact — the reviewer checks the artifact **against**
213
- them, not only for internal consistency.
263
+ (Hybrid: `P-TM`; Standalone: the ANALYSIS `## Security and Threat Model`), the
264
+ **Functional Spec** (Standalone: the ANALYSIS section; Hybrid: inside the `E-ISP`,
265
+ above its Impacted Components map), the **Interface Contract** (Standalone: the
266
+ ANALYSIS section; Hybrid: `D-IC`), the **Component Map** in
267
+ `strategic/architecture.md` and `audit/audit_plan.md` (the Capability Ledger
268
+ clause reads both), and the **probe harness** (`ai_docs/solutions/harness_[feature]/`).
269
+ Hand these *in addition to* the design artifact — the reviewer checks the artifact
270
+ **against** them, not only for internal consistency.
271
+ - **For a closure review, the diff and the test evidence**: the run output that
272
+ backs every completion claim, dated after the final relevant change.
214
273
  - **For a design review, the threat model too** (same sources as above). Why this
215
274
  one and not the whole set: file coverage crosses the impact-analysis→design hop on
216
275
  a mechanical gate (every impacted file needs a design block), so a dropped file is
@@ -368,7 +427,9 @@ When you are the reviewer:
368
427
  the section — the code lens today).** When the change adds or alters observable
369
428
  behavior (the trigger's owning definition is the code lens's `templates.md`
370
429
  `## Functional Spec` section comment — cite it, never restate it), **an L3
371
- artifact carrying NO `## Functional Spec` is itself a finding** — absence is
430
+ artifact carrying NO `## Functional Spec` is itself a finding** — in Hybrid the
431
+ section lives inside the `E-ISP`, above its Impacted Components map, so an
432
+ `E-ISP` without it is that finding. Absence is
372
433
  what a skipped spec looks like, not a reason to skip the check. When the spec
373
434
  is there, these findings live here: **a component, file or mechanism named
374
435
  inside it** — the spec is component-free by construction; that is
@@ -1491,16 +1491,17 @@ def memory_records(docs):
1491
1491
  paths.append(p)
1492
1492
  records = []
1493
1493
  for p in sorted(set(paths), key=lambda p: p.relative_to(docs).as_posix()):
1494
- raw = p.read_bytes()
1495
- text = raw.decode("utf-8", errors="replace")
1494
+ text = p.read_bytes().decode("utf-8", errors="replace")
1496
1495
  meta = sdlc_core.load_frontmatter(text.splitlines())
1497
1496
  title = next((line[2:].strip() for line in text.splitlines()
1498
1497
  if line.startswith("# ")), p.stem)
1498
+ # LF-normalized like the guides' source_hash: an autocrlf checkout must
1499
+ # regenerate the same catalog as an LF one.
1499
1500
  records.append((p.relative_to(docs).as_posix(),
1500
1501
  kb_unquote(meta.get("domain")) or default,
1501
1502
  ", ".join(_as_list(meta.get("topics", ""))),
1502
1503
  kb_unquote(meta.get("description")) or title,
1503
- hashlib.sha256(raw).hexdigest()))
1504
+ sdlc_core.sha256_file(p)))
1504
1505
  return records
1505
1506
 
1506
1507
 
@@ -1662,17 +1663,18 @@ def kb_cmd_validate(root, docs, strict=False, hybrid=False):
1662
1663
 
1663
1664
  def kb_cmd_check(root, docs, strict=False, hybrid=False):
1664
1665
  # The spine's check owns its banners and summary line: reuse it whole, so a
1665
- # tree with no kb surface gets byte-identical output. The kb checks run
1666
- # after, and only when the surface exists.
1667
- rc = sdlc_core.cmd_check(root, strict=strict, hybrid=hybrid)
1668
- rc = max(rc, _kb_extra_validate(docs), memory_validate(docs))
1666
+ # tree with no kb surface gets byte-identical output. The kb checks ride its
1667
+ # hooks -- index freshness in the validate stage, graph/corpus as sections
1668
+ # only when the surface exists -- so the summary is printed after all of them.
1669
+ sections = ()
1669
1670
  if (docs / "topics").is_dir() or (docs / "corpus").is_dir():
1670
1671
  cycle = kb_time_cycle(docs)
1671
- print("===== graph =====")
1672
- rc = max(rc, kb_cmd_graph(docs, cycle))
1673
- print("===== corpus =====")
1674
- rc = max(rc, kb_cmd_corpus(docs, cycle))
1675
- return rc
1672
+ sections = (("graph", lambda: kb_cmd_graph(docs, cycle)),
1673
+ ("corpus", lambda: kb_cmd_corpus(docs, cycle)))
1674
+ return sdlc_core.cmd_check(
1675
+ root, strict=strict, hybrid=hybrid,
1676
+ extra_validate=lambda: max(_kb_extra_validate(docs), memory_validate(docs)),
1677
+ extra_sections=sections)
1676
1678
 
1677
1679
 
1678
1680
  def kb_cmd_stale(root, docs, hybrid=False):
@@ -1354,10 +1354,10 @@ def cmd_validate(root, strict=False, hybrid=False):
1354
1354
  "doing the work it triggers")
1355
1355
  # comment-stripped, anchored: a '<!-- TODO: the ## Capability Ledger -->'
1356
1356
  # must not read as the section being present
1357
- # Hybrid: the design lives in devPNT and its §4.5 gate owns this slot
1358
- # (the Hybrid ownership matrix: "run ONE of them, never both"), and its log
1359
- # rows are keyed on e_isp_/e_tdd_ doc_keys, not on this filename -- so
1360
- # firing here would be a permanent, unfixable false positive.
1357
+ # Hybrid: the design lives in devPNT, and the agent review of it (the
1358
+ # same review.md review, run before the proposal) logs a row keyed on
1359
+ # its e_isp_/e_tdd_ doc_key, not on this filename -- so firing here
1360
+ # would be a permanent, unfixable false positive.
1361
1361
  if not hybrid and design_review_due(meta) and not review_logged(root, p.name):
1362
1362
  advisories.append(f"{rel}: L3 in implementation with no design-review row in "
1363
1363
  f"{review_log_rel()} -- the design was reviewed by nobody but its "
@@ -1869,15 +1869,26 @@ def print_orient_hook_note(root):
1869
1869
  pass # detection must never break check
1870
1870
 
1871
1871
 
1872
- def cmd_check(root, strict=False, hybrid=False):
1872
+ def cmd_check(root, strict=False, hybrid=False, extra_validate=None, extra_sections=()):
1873
+ """An overlay adds its checks through the two hooks, never after the call:
1874
+ the summary line is the verdict, so every check that can fail runs before
1875
+ it. `extra_validate()` folds into the validate stage; each
1876
+ (title, fn) in `extra_sections` gets its own banner and summary rc."""
1873
1877
  print("===== validate =====")
1874
1878
  rc_v = cmd_validate(root, strict=strict, hybrid=hybrid)
1879
+ if extra_validate is not None:
1880
+ rc_v = max(rc_v, extra_validate())
1875
1881
  print("\n===== stale =====")
1876
1882
  rc_s = cmd_stale(root, hybrid=hybrid)
1877
- print(f"\ncheck: {'CLEAN' if not (rc_v or rc_s) else 'NOT CLEAN'} "
1878
- f"(validate rc={rc_v}, stale rc={rc_s})")
1883
+ rcs = [("validate", rc_v), ("stale", rc_s)]
1884
+ for title, fn in extra_sections:
1885
+ print(f"\n===== {title} =====")
1886
+ rcs.append((title, fn()))
1887
+ failed = any(rc for _, rc in rcs)
1888
+ print(f"\ncheck: {'NOT CLEAN' if failed else 'CLEAN'} "
1889
+ f"({', '.join(f'{title} rc={rc}' for title, rc in rcs)})")
1879
1890
  print_orient_hook_note(root)
1880
- return 1 if (rc_v or rc_s) else 0
1891
+ return 1 if failed else 0
1881
1892
 
1882
1893
 
1883
1894
  # --------------------------------------------------------------------- gate
@@ -501,7 +501,7 @@ One row per completed review (`review.md` §When a review is due). Append-only;
501
501
  is the record that the gate ran and what it was worth. **One schema for both
502
502
  modes** — one required CORE (`date`, `doc_key`, `tier`, `model`, `findings_raised`,
503
503
  `findings_real`, `verdict`, `revise_rounds`) plus each mode's own realization
504
- columns: Standalone adds `reviewer`, a Hybrid devPNT row adds `instrument` and
504
+ columns: Standalone adds `reviewer`, a Hybrid row adds `instrument` and
505
505
  `notes` and carries no `reviewer` at all. Both modes write this same file.
506
506
 
507
507
  ```markdown