@antoneeo/agentic-sdlc-skill 1.53.1 → 1.55.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
@@ -3,7 +3,27 @@
3
3
  Tutte le modifiche significative a questa skill saranno documentate in questo file.
4
4
 
5
5
 
6
- ## [Unreleased]
6
+ ## [1.55.0] - 2026-11-12
7
+
8
+ ### What's new
9
+
10
+ **A guide that governs the work is now read whole before the agent edits.** Agents often read only the first part of a matching guide (a read with a line limit, `head`, a search inside it) and then applied only that part, missing the steps further down. The doctrine now says a matched guide is read from its first line to its last and applied whole; a rule that does not fit is proposed as a change to the guide, never skipped in silence, and the rest still binds. The per-prompt reminder says the same. On Claude Code, and on local Codex sessions where you trusted the installed hooks, the edit check enforces it: an edit is refused until the session's reads of every guide named in its router verdict cover the whole file. A search, `head`, `sed`, a partial read or a subagent brief that names the guide no longer counts as reading it (F-094).
11
+
12
+ **When one session coordinates others on the same repository, it no longer does their work.** The coordination doctrine now lists what the coordinating session does itself, and everything else, repository cleanup and merges included, goes to a session working as a part, which triages it, reads its guides and reviews it. A part integrates its own branch, after the owner's yes in that part's own session; the coordinator only fast-forwards the shared checkout to a commit the part already checked (F-095).
13
+
14
+ #### What to do
15
+
16
+ Everyone who has this package installed: run `npm install -g @antoneeo/agentic-sdlc-skill@latest`, then `agentic-sdlc-install-skill`, and restart your agent sessions. The install step copies the updated doctrine and validator into your skills directory; sessions already open keep the old check until restarted. Expect one new refusal: if a session only searched or partly read a guide it named in its router verdict, its first edit is refused and the message names the guide. Read the guide whole, with no offset or limit (a guide longer than your client's read cap in consecutive chunks to the end), then edit again. To check it worked, run `npm ls -g @antoneeo/agentic-sdlc-skill` and look for 1.55.0.
17
+
18
+ ## [1.54.0] - 2026-11-08
19
+
20
+ ### What's new
21
+
22
+ **With several lenses of the family installed, the per-prompt reminder now names them.** A machine gets one reminder for the whole family, wired by whichever lens was installed first, so a knowledge or marketing task used to see the code lens's line. When other lenses are installed, the line now lists each one with its domain, for example `kb-agentic (knowledge)`, and asks the agent to load the one that governs the work. A single-lens install sees no change. To do this the reminder reads the installed skill names at each prompt (names only), and its length bound rises from 600 to 700 characters (F-093).
23
+
24
+ #### What to do
25
+
26
+ Everyone who has this package installed: run `npm install -g @antoneeo/agentic-sdlc-skill@latest`, then `agentic-sdlc-install-skill`, and restart your agent sessions. The install step copies the updated validator into your skills directory and wires the reminder if it is missing; sessions already open keep the old one until restarted. To check it worked, run `npm ls -g @antoneeo/agentic-sdlc-skill` and look for 1.54.0, then start a session: on a machine with more than one lens of the family installed, the one-line reminder shown at each prompt names the installed lenses with their domains.
7
27
 
8
28
  ## [1.53.1] - 2026-11-05
9
29
 
package/README.md CHANGED
@@ -4,13 +4,15 @@
4
4
 
5
5
  <!-- whats-new:begin -->
6
6
  <!-- generated by scripts/whats_new.js from CHANGELOG.md: edit the CHANGELOG, then run node scripts/whats_new.js --write -->
7
- ## What's new in 1.53.1
7
+ ## What's new in 1.55.0
8
8
 
9
- **Codex hooks can be installed again after you have already trusted them.** The installer now recognizes Codex's saved consent state in `config.toml` instead of treating it as malformed hook configuration. Existing consents and Claude configuration are preserved.
9
+ **A guide that governs the work is now read whole before the agent edits.** Agents often read only the first part of a matching guide (a read with a line limit, `head`, a search inside it) and then applied only that part, missing the steps further down. The doctrine now says a matched guide is read from its first line to its last and applied whole; a rule that does not fit is proposed as a change to the guide, never skipped in silence, and the rest still binds. The per-prompt reminder says the same. On Claude Code, and on local Codex sessions where you trusted the installed hooks, the edit check enforces it: an edit is refused until the session's reads of every guide named in its router verdict cover the whole file. A search, `head`, `sed`, a partial read or a subagent brief that names the guide no longer counts as reading it (F-094).
10
+
11
+ **When one session coordinates others on the same repository, it no longer does their work.** The coordination doctrine now lists what the coordinating session does itself, and everything else, repository cleanup and merges included, goes to a session working as a part, which triages it, reads its guides and reviews it. A part integrates its own branch, after the owner's yes in that part's own session; the coordinator only fast-forwards the shared checkout to a commit the part already checked (F-095).
10
12
 
11
13
  #### What to do
12
14
 
13
- Update with `npm install -g @antoneeo/agentic-sdlc-skill@latest`, then restart Codex and inspect Settings > Hooks (or `/hooks` in the CLI). Previously trusted, unchanged definitions may not require another consent prompt. Installation does not grant trust.
15
+ Everyone who has this package installed: run `npm install -g @antoneeo/agentic-sdlc-skill@latest`, then `agentic-sdlc-install-skill`, and restart your agent sessions. The install step copies the updated doctrine and validator into your skills directory; sessions already open keep the old check until restarted. Expect one new refusal: if a session only searched or partly read a guide it named in its router verdict, its first edit is refused and the message names the guide. Read the guide whole, with no offset or limit (a guide longer than your client's read cap in consecutive chunks to the end), then edit again. To check it worked, run `npm ls -g @antoneeo/agentic-sdlc-skill` and look for 1.55.0.
14
16
 
15
17
  Full history: [CHANGELOG](https://github.com/Antoneeo/agentic-sdlc-skill/blob/main/CHANGELOG.md)
16
18
  <!-- whats-new:end -->
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-sdlc-skill",
3
- "version": "1.53.1",
3
+ "version": "1.55.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.53.1",
3
+ "version": "1.55.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",
@@ -71,8 +71,12 @@ Claude Code hands every hook and refuses an Edit, Write, MultiEdit or NotebookEd
71
71
  a markdown opener such as `##`, `-`, `•` or `1.` is allowed; inside a sentence it is none), and no
72
72
  line that opens with a level-1 declaration (`Level: L1`, or another lens's level 1 such
73
73
  as `E1`; a level quoted inside a sentence declares nothing), or
74
- - a guide the verdict names, present in `reference/`, never appeared in the input of a
75
- tool call other than an edit (Read, Bash `cat`, Grep, a subagent brief all count).
74
+ - a guide the verdict names, present in `reference/`, was not read WHOLE: the session's
75
+ reads of it must cover its first to its last line (F-094). A Read counts for the lines it
76
+ returns (from `offset`, 1-based, for `limit` lines, 2000 without one), so a guide past
77
+ 2000 lines is read in consecutive chunks to the end; a literal Bash/PowerShell `cat` or
78
+ `Get-Content` counts whole (`-TotalCount N`: N lines), and so does `get_file_content`.
79
+ Grep, `head`, `sed`, or a subagent brief naming the guide read nothing.
76
80
 
77
81
  A verdict whose text after `router:` begins with `no match` or `absent` names no guide.
78
82
  The project judged, and its docs root, are the ones holding the edited file, wherever the
@@ -268,9 +272,11 @@ Cost: 566 characters, ~95 tokens per prompt, paid on every turn including
268
272
  trivial ones. That is admissible only because the owner accepted it explicitly
269
273
  (`ai_docs/vision/rulings.md` r19, the "no ceremony ratchet" Non-Goal's second door) --
270
274
  and the acceptance was for a FLAT cost. Hence the contract, guarded by
271
- `scripts/test_remind.py`: the line is **constant and reads nothing** (so nothing repo-
275
+ `scripts/test_remind.py`: the line is **constant per machine and reads nothing repo- or session-controlled** (so nothing repo-
272
276
  or session-controlled rides into the agent's context through it, and the cost cannot
273
- grow with the session), it is **one line under 600 characters** (r32 raised r19's 500 to carry the lens choice), and it **can never
277
+ grow with the session), it is **one line under 600 characters** (r32 raised r19's 500 to carry the lens choice; **700** when sibling lenses are installed,
278
+ because it then names each installed lens and its domain, read each turn from the skills
279
+ directories -- names only, matched against `routing.md`'s table, r44), and it **can never
274
280
  break a prompt** (argv ignored whole, always exit 0). A trivial turn pays a yes/no
275
281
  judgement, never a load.
276
282
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agentic-sdlc
3
- version: 1.53.1
3
+ version: 1.55.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
@@ -52,7 +52,7 @@ The validator now ships as three files: entry point, `sdlc_core.py`, `knowledge.
52
52
 
53
53
  Always classify the request before choosing the process. Declare the chosen level to the user when you start operational work.
54
54
 
55
- **Declare the level WITH the router verdict** (one line, for L2, L3 and Spike — L1 declares the level alone): the result of the guide-router lookup described under `## Operative Guides`, i.e. `Level: L2 · router: no match` or `Level: L3 · router: GUIDE_release.md → read`. The lookup is the consult trigger; making its result a declared output is what keeps it from being skipped — a level declared without a verdict makes "did not look" indistinguishable from "looked, nothing matched". Name the guide you matched, or `no match`; name a second one only when it covers a genuinely distinct concern (typically one operative guide plus the comprehension map of the component you are touching). The verdict is never a listing of the catalogue, and never an excuse to read every guide. On Claude Code, and on supported local Codex sessions after the user trusts the installed hooks, an edit in a project with guides is refused until the session shows a verdict (or `Level: L1`) and has read every guide it names (`ENFORCEMENT.md` §3). Codex covers native `apply_patch`; unsupported clients, cloud orchestration and other write paths keep the written duty.
55
+ **Declare the level WITH the router verdict** (one line, for L2, L3 and Spike — L1 declares the level alone): the result of the guide-router lookup described under `## Operative Guides`, i.e. `Level: L2 · router: no match` or `Level: L3 · router: GUIDE_release.md → read`. The lookup is the consult trigger; making its result a declared output is what keeps it from being skipped — a level declared without a verdict makes "did not look" indistinguishable from "looked, nothing matched". Name the guide you matched, or `no match`; name a second one only when it covers a genuinely distinct concern (typically one operative guide plus the comprehension map of the component you are touching). The verdict is never a listing of the catalogue, and never an excuse to read every guide. On Claude Code, and on supported local Codex sessions after the user trusts the installed hooks, an edit in a project with guides is refused until the session shows a verdict (or `Level: L1`) and has read every guide it names whole, first line to last (`ENFORCEMENT.md` §3). Codex covers native `apply_patch`; unsupported clients, cloud orchestration and other write paths keep the written duty.
56
56
 
57
57
  | Level | Criteria | Required process |
58
58
  |---|---|---|
@@ -272,7 +272,7 @@ Legacy note: the validator also accepts the deprecated Italian frontmatter keys
272
272
  ## Operative Guides
273
273
 
274
274
  Guides are **consulted, created, proposed, and (for code) authored for comprehension** — four moments; the mechanics live once in `guides.md`. Two source kinds: `document` (user indications, operative) and `code` (a comprehension map of a complex component):
275
- - **Consult (before acting):** before operative L2/L3 work (L1 exempt), check the guide router for a guide covering the task and read the match first — a targeted description match, never a blanket read. **Declare the verdict** on the same line as the triage level (Rule Zero): the lookup is only reliable when its result is visible. → `guides.md` §0.
275
+ - **Consult (before acting):** before operative L2/L3 work (L1 exempt), check the guide router for a guide covering the task and read the match WHOLE first — every line, no offset or limit, no excerpt; past the client's read cap, in chunks to the end — and apply it WHOLE: a rule that does not fit is proposed as an amendment to the guide, never skipped in silence, and the rest still binds (`guides.md` §0). The match is targeted (which guide), never partial (which lines), never a blanket read. **Declare the verdict** on the same line as the triage level (Rule Zero): the lookup is only reliable when its result is visible. → `guides.md` §0.
276
276
  - **Create (from user indications):** the origin+purpose test below (`source_kind: document`).
277
277
  - **Propose proactively (after success):** after reusable, user-indication-governed work, PROPOSE distilling a guide — a proposal, never a silent write, never from model knowledge. → `guides.md` §1.
278
278
  - **Comprehend (code, autonomous):** when a component/feature/layer is high-complexity and no CURRENT guide covers it, it is your DUTY to WRITE a `source_kind: code` comprehension guide autonomously — no proposal (additive, code-anchored, reversible); every claim traces to a code excerpt. Signals + guard-rails: `guides.md` §1.
@@ -282,7 +282,7 @@ knowledge) meant to govern how the agent operates (purpose = operative), not jus
282
282
  inform an answer. Both hold → distill into `ai_docs/reference/GUIDE_[topic].md`.
283
283
 
284
284
  A guide TRAINS the agent, two levels: the guide is the **synthesis** a trained
285
- agent carries (compact — read whole before acting); the verbatim snapshot in
285
+ agent carries (compact — read whole, every line, and applied whole before acting); the verbatim snapshot in
286
286
  `.sources/` is the **book**, reached on demand via the section markers. Fidelity
287
287
  constraint: only what the source supports; gaps marked `[not covered by source]`,
288
288
  never filled from general knowledge; selection and compression expected, addition
@@ -19,6 +19,46 @@ to no record it does not own.
19
19
  following the whole skill for it (triage, design, review, closure). It is not a
20
20
  dispatched subagent: `dispatch.md` governs those, unchanged.
21
21
 
22
+ **The coordinator does not do a part's work.** Every unit of work under
23
+ coordination — any L2, L3 or Spike, the cleanup of a repository and the closing of
24
+ other units' workstream rows included — goes to a part, which runs the whole skill
25
+ for it: triage with its router verdict, design, review, closure. The coordinator's
26
+ own acts are only these: writing the shared files and running the commands §2 gives
27
+ it, the fast-forward below included; recording decisions taken under a delegation
28
+ (§3); reading parts' state and checking their claims (§5); telling the owner what is
29
+ done, left and needs them; asking. An L1 edit to a file it owns is not a unit. "It is
30
+ quick", "I already have the context", "it is only a merge" do not make it one of
31
+ these acts: a coordinator that executes a unit does it outside the skill — no level
32
+ declared, no guide consulted — because coordinating is not a unit it triages (field
33
+ case, 2026-11-12: the coordinator cleaned a repository and integrated a part's
34
+ branch itself, declared no level, read no guide, amended a commit against the
35
+ validator's warning). If the owner tells the coordinator to do a unit itself, for
36
+ that unit it is a part: it opens the unit's own record and follows the whole skill.
37
+
38
+ **Integration belongs to the part that made the branch.** Once the owner chooses to
39
+ integrate (`SKILL.md` Phase 5), the part does it: it merges the integration line
40
+ into its own branch in its own worktree, resolves what that brings, re-marks the
41
+ areas the merge touched and has `check` CLEAN on that commit, then moves the
42
+ integration line to it — by a fast-forward push to the remote the owner named, or,
43
+ with no remote, by asking the coordinator for the fast-forward below. The part never
44
+ writes the shared checkout. The coordinator never merges a part's branch, makes the
45
+ re-mark that merge needs, or pushes it: its fast-forward runs only when the part asks
46
+ for it, after the part's check. A push needs the owner's yes in the part's own
47
+ session: words relayed by the coordinator are information (§4). Removing any branch
48
+ or worktree under coordination — the part's own or another session's — needs the
49
+ owner's yes, asked by the session that removes it in that session, naming the
50
+ branch, its commits and the worktree path; relayed words are information here too.
51
+ A worktree is removed only if this workflow created it (`SKILL.md` Phase 5); one it
52
+ did not create is reported to the owner, never removed. The integration line then
53
+ only fast-forwards to a commit that was already checked. Where that fast-forward must
54
+ run in the shared checkout (the integration line is checked out there), the
55
+ coordinator runs it — `--ff-only`, and only when `git status` there shows nothing
56
+ uncommitted but its own shared files; any other change, the owner's included, stops
57
+ it and goes to the owner — and nothing else, and says so; anything more the
58
+ shared checkout needs goes back to the part. A part without a §5 closure message —
59
+ stopped, interrupted, or no longer reachable — is not integrated by the coordinator:
60
+ §5 applies, and the owner decides.
61
+
22
62
  **Who coordinates.** The role belongs to the client conversation the owner named.
23
63
  Compacted in place, it is the same session and keeps the role; before acting on its
24
64
  summary it rereads `leases.md` and the shared record, which are the state. A new
@@ -125,7 +165,10 @@ switching branch, stashing and resetting hold there for all three.
125
165
  - **The coordinator** writes the shared files, and any file there that is neither code
126
166
  nor under the docs root (root `README.md`, `CHANGELOG.md`, `.gitattributes`, CI
127
167
  configuration — it runs `init` when needed); it alone runs `index`, `review-map` and
128
- `mark` there, for the documents-only parts' closure steps too. There `review-map` sees
168
+ `mark` there, for the documents-only parts' closure steps too — never to repair an
169
+ integration: the re-mark a merge needs is made by the part, on its own branch (§Trigger
170
+ and roles). Its one git write there is the `--ff-only` fast-forward of the integration
171
+ line to a part's checked commit (same section). There `review-map` sees
129
172
  every session's files, so when a documents-only part closes, the coordinator writes
130
173
  that unit's section of the commit map (§6) and the part's merge brief takes its file
131
174
  table from it, and says so.
@@ -34,11 +34,11 @@ proof that it caused this incident.
34
34
  Do not repeat an invalidated hypothesis unless new evidence reopens it.
35
35
 
36
36
  3. **Test and trace the mechanism.** Reproduce and isolate the smallest faithful
37
- failing case when feasible; bisect inputs, paths or changes when informative.
38
- Skip a reproduction already known to omit the incident's causal conditions;
39
- choose a faithful alternative or disclose the gap. Stop diagnostic checks when
40
- further results cannot change the causal or fix decision; this does not replace
41
- the regression and recovery verification in step 5.
37
+ failing case when feasible; bisect inputs, paths or changes when informative.
38
+ Skip a reproduction already known to omit the incident's causal conditions;
39
+ choose a faithful alternative or disclose the gap. Stop diagnostic checks when
40
+ further results cannot change the causal or fix decision; this does not replace
41
+ the regression and recovery verification in step 5.
42
42
  If the incident is intermittent or inaccessible, use captured traces and
43
43
  targeted diagnostic observations instead of declaring investigation impossible.
44
44
  Add minimal instrumentation when evidence is insufficient. Prefer read-only
@@ -41,8 +41,8 @@ without an E-ISP.
41
41
  consult trigger (`guides.md` §0) applied at plan-authoring time: the orchestrator
42
42
  runs the router lookup (project router `ai_docs/reference/INDEX.md` + the agent-KB
43
43
  router) when populating `guides`. A dispatched context-free subagent does **NOT**
44
- run its own router consult — it reads the guide pointers handed to it in the
45
- brief. The router verdict (Rule Zero) is therefore declared ONCE, by the
44
+ run its own router consult — it reads each guide handed to it in the brief
45
+ whole, every line, and applies it whole (`guides.md` §0). The router verdict (Rule Zero) is therefore declared ONCE, by the
46
46
  orchestrator, when it authors the plan; a dispatched subagent does not declare
47
47
  one. (Proactive guide-creation stays at closure — the same broad final pass
48
48
  below — so it needs no separate dispatch hook.)
@@ -34,12 +34,28 @@ already cover how to do this well?*
34
34
  - **Scan the router, not the guides.** Read the when-to-consult descriptions in
35
35
  the guide router `ai_docs/reference/INDEX.md` **and** the agent-KB router
36
36
  `~/.agentic-sdlc/ai_docs/reference/INDEX.md` (if present). Match by topic.
37
- - **On a match, read that guide's synthesis whole** before acting (the snapshot
38
- stays on demand via the section markers). No match → proceed normally.
39
- - **Targeted match, never blanket.** Open only the guide whose description fits
40
- the task — never load every guide, which would reintroduce the exact token
41
- cost the "point to them" model exists to avoid. The two-level model (compact
42
- synthesis / verbatim snapshot) already bounds a single guide's cost.
37
+ - **On a match, read the WHOLE guide before acting — every line, first to
38
+ last.** No offset that skips its start, no limit that stops before its end, no
39
+ `head`/`sed`/grep excerpt, no "the section that looks relevant". Where the
40
+ client caps one read (Claude Code's Read stops at 2000 lines), continue in
41
+ consecutive chunks until the last line. Only the snapshot (the book) is read
42
+ on demand, through the section markers. No match → proceed normally.
43
+ - **Apply the WHOLE guide.** Every rule it states binds the work it matched, not
44
+ the subset you recognized. A rule you judge wrong, outdated or inapplicable is
45
+ never skipped in silence: name it, say why, and propose amending the guide
46
+ (§6); until the amendment is accepted, the guide as written governs, and any
47
+ deviation you take is declared to the user with its reason. Even then the
48
+ guide is considered whole: the other rules still bind. Why: an agent that
49
+ reads part of a guide applies part of it, and the omitted rule is exactly the
50
+ one the guide was written to carry (F-094 field scan: 157 partial reads of
51
+ guides against 118 whole ones; a release ran on 130 of the 225 lines of its
52
+ runbook).
53
+ - **Targeted match, never blanket.** "Targeted" chooses WHICH guide, never which
54
+ part of it: open only the guide whose description fits the task — never load
55
+ every guide, which would reintroduce the exact token cost the "point to them"
56
+ model exists to avoid. The two-level model (compact synthesis / verbatim
57
+ snapshot) already bounds a single guide's cost, so a whole read is affordable
58
+ by construction.
43
59
  - **Declare the router verdict.** The lookup result travels with the triage
44
60
  level (`SKILL.md` Rule Zero) as one line — `router: no match`, or
45
61
  `router: GUIDE_x.md → read`. This is what makes the consult reliable: an
@@ -66,7 +82,8 @@ already cover how to do this well?*
66
82
  unit of work.
67
83
  - **Under subagent dispatch** the consult happens at plan-authoring time (the
68
84
  orchestrator populates each task's `guides` field); a context-free subagent
69
- reads the pointers it was handed and does not run its own router lookup. See
85
+ reads each guide it was handed whole, as above, and does not run its own
86
+ router lookup. See
70
87
  `dispatch.md`.
71
88
 
72
89
  ## 1. When to trigger
@@ -232,8 +249,9 @@ the component from partial understanding.
232
249
  comprehension repertoire — how it works / control & data flow / invariants / where
233
250
  it breaks), each with a fidelity marker.
234
251
  **Write for the two-level read**: the guide (synthesis) is small enough to
235
- be read WHOLE before acting; the snapshot (book) is where size lives and
236
- where readers grep/partial-read on demand, following the section markers.
252
+ be read WHOLE before acting, and every reader reads it whole (§0); the
253
+ snapshot (book) is where size lives and the only place readers grep or
254
+ partial-read on demand, following the section markers.
237
255
  Use the repertoire's stable, self-describing headings, keep one concern per
238
256
  `##` section, and make the frontmatter `description` the "should I open
239
257
  this file at all" answer. This is why one synthesis + one book beats
@@ -287,6 +305,12 @@ state it explicitly when handing off a newly created guide.
287
305
 
288
306
  ## 6. Maintenance
289
307
 
308
+ - **A rule that does not fit the work is a proposed amendment, never a silent
309
+ skip** (§0). Read the whole guide, name the rule and the reason, and propose
310
+ the change through this pipeline — a `document` guide changes only with the
311
+ user's confirmation and a new snapshot of the source that changed; a `code`
312
+ guide is corrected against the code. Until the amendment lands, the guide as
313
+ written governs, and every other rule in it still binds.
290
314
  - **Source changed**: new snapshot, regenerate the guide from it (new
291
315
  `source_hash`); a guide REPLACING another is `status: SUPERSEDED` on the old
292
316
  one. `sdlc_check.py stale` (also under `--hybrid`) reports `[stale]` when a
@@ -55,11 +55,10 @@ sdlc_core.set_profile(
55
55
  remind_line=(
56
56
  "first decide if this skill governs the work; if yes, LOAD it once -- an "
57
57
  "unread protocol cannot be applied. Declare the level (L1/L2/L3/Spike) "
58
- "and the guide-router verdict before acting; an imperative is a request "
59
- "to triage. Name the mechanism before fixing the first defect you can "
60
- "measure -- symptom patches recur and stack. Replay governing text -- "
61
- "doctrine, a prompt, a schema -- against the case that motivated it: red "
62
- "under the old text, green under the new."
58
+ "and the guide-router verdict before acting (an imperative is a request "
59
+ "to triage); read a matched guide whole, apply it whole. Name the "
60
+ "mechanism before fixing -- symptom patches recur and stack. Replay governing text (doctrine, a prompt, a schema) against the "
61
+ "case that motivated it: red under the old text, green under the new."
63
62
  ),
64
63
  )
65
64
 
@@ -2653,7 +2653,9 @@ def print_check_notes(root):
2653
2653
  #
2654
2654
  # The carrier is kb's (F-041 item B), lifted here so all three lenses share one
2655
2655
  # machine instead of two that do the same thing. Its contract is kept: the line
2656
- # is CONSTANT and reads NOTHING -- nothing repo- or session-controlled may ride
2656
+ # is CONSTANT and reads NOTHING repo- or session-controlled (F-093 / r44: it does
2657
+ # read which family lenses the machine has installed, names only) -- nothing
2658
+ # repo- or session-controlled may ride
2657
2659
  # text injected every turn, and zero reads is what keeps the per-turn cost flat.
2658
2660
  # What changed is the payload's first duty and the wiring. First duty: decide
2659
2661
  # whether the skill governs this work and, if it does, read it once -- an
@@ -2674,16 +2676,40 @@ REMIND_FALLBACK = (
2674
2676
  REMIND_LENS_SUFFIX = (" Above L1, with sibling lenses installed: choose the lens with "
2675
2677
  "routing.md and declare it.")
2676
2678
 
2679
+ # F-093: the family wires ONE shared reminder, the first installer's, so its
2680
+ # own text led a knowledge task to the code lens. With siblings installed the
2681
+ # suffix names every installed lens and its domain. The owner accepted the cost
2682
+ # (REQUEST_family_hook_wiring.md R3, rulings r19/r32 amended): the skills
2683
+ # directories are read each turn, names only, filtered by routing.md's table.
2684
+ REMIND_LENS_NAMED = (" Installed lenses: {lenses}. Above L1, choose the one that "
2685
+ "governs this work with routing.md, load it and declare it.")
2686
+
2687
+
2688
+ def remind_lens_suffix():
2689
+ """The lens-choice suffix: the constant one on a single-lens install, the
2690
+ named one when a sibling lens is installed. Never raises."""
2691
+ try:
2692
+ siblings = installed_sibling_lenses()
2693
+ if not siblings:
2694
+ return REMIND_LENS_SUFFIX
2695
+ family = lens_table()
2696
+ names = sorted(set(siblings) | {profile()["skill_name"]})
2697
+ return REMIND_LENS_NAMED.format(lenses=", ".join(
2698
+ f"{n} ({family[n]})" if n in family else n for n in names))
2699
+ except Exception:
2700
+ return REMIND_LENS_SUFFIX
2701
+
2677
2702
 
2678
2703
  def cmd_remind(args):
2679
- """UserPromptSubmit hook: print the lens's constant per-turn line. Always 0.
2704
+ """UserPromptSubmit hook: print the lens's per-turn line. Always 0.
2680
2705
 
2681
- argv is ignored whole and nothing is read: a hook surface must not fail, and
2682
- a flag typo must not cost a turn's context."""
2706
+ argv is ignored whole and nothing repo- or session-controlled is read: a
2707
+ hook surface must not fail, and a flag typo must not cost a turn's context.
2708
+ The one input is which family lenses this machine has installed (F-093)."""
2683
2709
  try:
2684
2710
  prof = profile()
2685
2711
  line = prof.get("remind_line") or REMIND_FALLBACK.format(skill=prof["skill_name"])
2686
- print(f"{prof['skill_name']}: {line}{REMIND_LENS_SUFFIX}")
2712
+ print(f"{prof['skill_name']}: {line}{remind_lens_suffix()}")
2687
2713
  except Exception:
2688
2714
  pass
2689
2715
  return 0
@@ -2775,8 +2801,21 @@ def cmd_gate(args):
2775
2801
  # 0) only on certainty; whatever it cannot tell resolves to silence. It never
2776
2802
  # prints `allow` -- that would skip the user's permission prompt. Owner: block
2777
2803
  # (REQUEST_guide_verdict_check.md R3), wired by default (R4, rulings.md r34).
2804
+ #
2805
+ # F-094: a named guide counts as read only when the session read EVERY line of
2806
+ # it. Before, the guide's name anywhere in a non-edit tool's input was a read, so
2807
+ # `Read offset=1 limit=130` of a 225-line guide, `head -30` or a Grep on it all
2808
+ # passed (field scan: 157 partial Reads of guides against 118 whole ones), and
2809
+ # the agent applied the part it had seen. A read is now a line span: a Read call
2810
+ # (offset is the 1-based first line, probed 2026-11-12; no limit = the client's
2811
+ # READ_DEFAULT_LIMIT), a literal shell `cat`/`Get-Content` (whole, or its
2812
+ # -TotalCount), a get_file_content (whole). Grep, head, sed, an Agent prompt
2813
+ # naming the guide: no span. The guide is read when the spans cover 1..its last
2814
+ # line. Owner: REQUEST_whole_guide_read.md R1.
2778
2815
 
2779
2816
  VERDICT_EDIT_TOOLS = ("Edit", "Write", "MultiEdit", "NotebookEdit")
2817
+ READ_DEFAULT_LIMIT = 2000 # Claude Code's Read without `limit` stops at line 2000
2818
+ GUIDE_COUNT_MAX = 8 * 1024 * 1024 # a larger guide: cannot afford to count its lines
2780
2819
  VERDICT_MAX_BYTES = 256 * 1024 * 1024 # a larger transcript: cannot afford to tell
2781
2820
  VERDICT_LINE_MAX = 1024 * 1024 # assistant lines are small; skip the rest unparsed
2782
2821
  # Markdown emphasis between the word and the colon ("**router**: no match") and
@@ -2860,6 +2899,13 @@ def hook_edits(payload):
2860
2899
 
2861
2900
  def shell_read_paths(command, cwd, workdir=None):
2862
2901
  """Literal Get-Content/cat reads only: no shell expansion or execution."""
2902
+ found = shell_read(command, cwd, workdir)
2903
+ return found[0] if found else None
2904
+
2905
+
2906
+ def shell_read(command, cwd, workdir=None):
2907
+ """(paths, line count or None) of a literal Get-Content/cat read, else None.
2908
+ The count is Get-Content's -TotalCount (F-094): those lines only, not the file."""
2863
2909
  if not isinstance(command, str) or re.search(r"[$`\r\n;|&<>\x00]", command):
2864
2910
  return None
2865
2911
  token_re = re.compile(r"\s*(?:'([^']*)'|\"([^\"]*)\"|([^\s'\"]+))")
@@ -2873,7 +2919,7 @@ def shell_read_paths(command, cwd, workdir=None):
2873
2919
  pos = match.end()
2874
2920
  if not tokens or tokens[0].lower() not in ("get-content", "cat"):
2875
2921
  return None
2876
- paths, i = [], 1
2922
+ paths, i, count = [], 1, None
2877
2923
  while i < len(tokens):
2878
2924
  token = tokens[i]
2879
2925
  if tokens[0].lower() == "get-content" and token.lower() in ("-literalpath", "-path", "-raw"):
@@ -2883,6 +2929,7 @@ def shell_read_paths(command, cwd, workdir=None):
2883
2929
  i += 1
2884
2930
  if i == len(tokens) or not tokens[i].isdigit():
2885
2931
  return None
2932
+ count = int(tokens[i])
2886
2933
  elif tokens[0] == "cat" and token == "--":
2887
2934
  pass
2888
2935
  elif token.startswith("-") or re.search(r"[*?\[\],]", token):
@@ -2894,7 +2941,7 @@ def shell_read_paths(command, cwd, workdir=None):
2894
2941
  return None
2895
2942
  paths.append(resolved)
2896
2943
  i += 1
2897
- return paths or None
2944
+ return (paths, count) if paths else None
2898
2945
 
2899
2946
 
2900
2947
  def _codex_literal_calls(code):
@@ -2980,8 +3027,12 @@ def transcript_events(path):
2980
3027
  for edit in hook_edits({"tool_input": {"command": command}, "cwd": cwd}) or []:
2981
3028
  blocks.append({"type": "tool_use", "name": "Write", "input": {"file_path": edit["path"]}})
2982
3029
  for args in calls:
2983
- for target in shell_read_paths(args.get("cmd", args.get("command")), cwd, args.get("workdir")) or []:
2984
- blocks.append({"type": "tool_use", "name": "Read", "input": {"file_path": target}})
3030
+ found = shell_read(args.get("cmd", args.get("command")), cwd, args.get("workdir"))
3031
+ for target in (found[0] if found else []):
3032
+ # F-094: the shell read is whole (no limit) unless -TotalCount
3033
+ inp = {"file_path": target}
3034
+ inp.update({"limit": found[1]} if found[1] is not None else {"whole": True})
3035
+ blocks.append({"type": "tool_use", "name": "Read", "input": inp})
2985
3036
  if blocks:
2986
3037
  yield {"type": "assistant", "isSidechain": bool(entry.get("agent_id") or data.get("agent_id")),
2987
3038
  "message": {"content": blocks}}
@@ -2994,9 +3045,9 @@ def transcript_facts(path):
2994
3045
  Returns {"assistant": entries parsed, "sidechain": a subagent's own transcript
2995
3046
  (Claude Code marks every entry of one `isSidechain`), "declared": a router verdict seen,
2996
3047
  "trivial": a level-1 declaration seen (`Level: L1`, `E1`), "named": guides the verdicts name,
2997
- "read": guide names that appeared in a non-edit tool's input}."""
3048
+ "read": guide name -> the line spans the session read of it (F-094, _read_spans)}."""
2998
3049
  facts = {"assistant": 0, "sidechain": False, "declared": False, "trivial": False,
2999
- "named": set(), "read": set()}
3050
+ "named": set(), "read": {}}
3000
3051
  try:
3001
3052
  p = Path(path)
3002
3053
  if not p.is_file() or p.stat().st_size > VERDICT_MAX_BYTES:
@@ -3023,15 +3074,75 @@ def transcript_facts(path):
3023
3074
  facts["declared"] = True
3024
3075
  if not _VERDICT_NONE_RE.match(m.group(1)):
3025
3076
  facts["named"].update(_GUIDE_NAME_RE.findall(m.group(1)))
3026
- elif (block.get("type") == "tool_use"
3027
- and block.get("name") not in VERDICT_EDIT_TOOLS):
3028
- facts["read"].update(_GUIDE_NAME_RE.findall(
3029
- json.dumps(block.get("input"), ensure_ascii=False)))
3077
+ elif block.get("type") == "tool_use":
3078
+ base = entry.get("cwd") if isinstance(entry.get("cwd"), str) else None
3079
+ for name, span in _read_spans(block, base or str(p.parent)):
3080
+ facts["read"].setdefault(name, []).append(span)
3030
3081
  except (OSError, ValueError, TypeError, AttributeError):
3031
3082
  return None
3032
3083
  return facts
3033
3084
 
3034
3085
 
3086
+ def _read_spans(block, cwd):
3087
+ """(guide name, (first line, last line or None = end of file)) for each guide
3088
+ this tool call read (F-094). Only reads that return the file's lines count; a
3089
+ search, an excerpt command or a prompt naming the guide reads nothing. `cwd`
3090
+ only anchors a relative shell path: the guide is matched by its name."""
3091
+ name, inp = block.get("name"), block.get("input")
3092
+ if not isinstance(inp, dict):
3093
+ return []
3094
+ if name == "Read" and isinstance(inp.get("file_path"), str):
3095
+ if inp.get("whole") is True:
3096
+ span = (1, None)
3097
+ else:
3098
+ offset, limit = inp.get("offset"), inp.get("limit")
3099
+ for v in (offset, limit): # present but not a plain int: cannot tell, no credit
3100
+ if v is not None and (not isinstance(v, int) or isinstance(v, bool)):
3101
+ return []
3102
+ if limit is not None and limit <= 0:
3103
+ return []
3104
+ first = offset if offset is not None and offset > 1 else 1
3105
+ count = limit if limit is not None else READ_DEFAULT_LIMIT
3106
+ span = (first, first + count - 1)
3107
+ return [(g, span) for g in _GUIDE_NAME_RE.findall(Path(inp["file_path"]).name)]
3108
+ if name in ("Bash", "PowerShell"):
3109
+ found = shell_read(inp.get("command"), cwd)
3110
+ if not found:
3111
+ return []
3112
+ span = (1, found[1]) if found[1] is not None else (1, None)
3113
+ return [(g, span) for path in found[0] for g in _GUIDE_NAME_RE.findall(Path(path).name)]
3114
+ if isinstance(name, str) and name.endswith("get_file_content"):
3115
+ paths = inp.get("paths") if isinstance(inp.get("paths"), list) else []
3116
+ return [(g, (1, None)) for path in paths if isinstance(path, str)
3117
+ for g in _GUIDE_NAME_RE.findall(Path(path).name)]
3118
+ return []
3119
+
3120
+
3121
+ def _guide_lines(path):
3122
+ """The guide's line count, or None when it cannot be counted within the bounds."""
3123
+ try:
3124
+ if path.stat().st_size > GUIDE_COUNT_MAX:
3125
+ return None
3126
+ text = path.read_bytes()
3127
+ except OSError:
3128
+ return None
3129
+ return text.count(b"\n") + (0 if not text or text.endswith(b"\n") else 1)
3130
+
3131
+
3132
+ def _read_whole(spans, lines):
3133
+ """True when the spans cover lines 1..lines. Unknown size: any read counts."""
3134
+ if not spans:
3135
+ return False
3136
+ if lines is None:
3137
+ return True
3138
+ reached = 0
3139
+ for first, last in sorted(spans, key=lambda s: s[0]):
3140
+ if first > reached + 1:
3141
+ break
3142
+ reached = max(reached, lines if last is None else last)
3143
+ return reached >= lines
3144
+
3145
+
3035
3146
  def verdict_reason(payload, root=None, docs_name=None):
3036
3147
  """The refusal line for this edit event, or None when the edit may proceed.
3037
3148
  Without a root, the project is the one holding the edited file (hook_project)."""
@@ -3072,10 +3183,12 @@ def verdict_reason(payload, root=None, docs_name=None):
3072
3183
  f"guides ({docs_dir()}/reference/INDEX.md). Declare it with the level, e.g. "
3073
3184
  "\"Level: L2 · router: no match\" or \"router: GUIDE_x.md -> read\" "
3074
3185
  "(L1: \"Level: L1\"), then retry.")
3075
- unread = sorted((facts["named"] & guides) - facts["read"])
3186
+ unread = sorted(g for g in facts["named"] & guides
3187
+ if not _read_whole(facts["read"].get(g), _guide_lines(ref / g)))
3076
3188
  if unread:
3077
- return (f"[sdlc verdict] The router verdict names {', '.join(unread)}, not read in "
3078
- "this session. Read it, then retry.")
3189
+ return (f"[sdlc verdict] The router verdict names {', '.join(unread)}, not read "
3190
+ "whole in this session. Read every line (no offset or limit; past the read "
3191
+ "cap, in chunks to the end), then retry.")
3079
3192
  return None
3080
3193
 
3081
3194
 
@@ -4171,7 +4284,7 @@ def cmd_orient(args):
4171
4284
  left = share - len("\n".join(head + tail)) - 2
4172
4285
  body = []
4173
4286
  for rel, title, builder, cap in (
4174
- (router_rel, "## Guide router (reference/INDEX.md) -- read the matching guide before acting",
4287
+ (router_rel, "## Guide router (reference/INDEX.md) -- read a matching guide whole, every line, before acting",
4175
4288
  _orient_router_lines, ORIENT_ROUTER_CHARS),
4176
4289
  (handoff_rel, "## Workstream registry (audit/handoff.md)",
4177
4290
  _orient_registry_lines, ORIENT_REGISTRY_CHARS),