@antoneeo/course-creator 0.1.0-beta.20 → 0.1.0-beta.21
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 +10 -0
- package/README.md +3 -3
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/skills/course-creator/ENFORCEMENT.md +1 -1
- package/skills/course-creator/SKILL.md +3 -3
- package/skills/course-creator/dispatch.md +2 -2
- package/skills/course-creator/guides.md +33 -9
- package/skills/course-creator/scripts/sdlc_check.py +2 -1
- package/skills/course-creator/scripts/sdlc_core.py +101 -14
- package/skills/course-creator/scripts/shared_manifest.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [0.1.0-beta.21] - 2026-11-12
|
|
5
|
+
|
|
6
|
+
### What's new
|
|
7
|
+
|
|
8
|
+
**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).
|
|
9
|
+
|
|
10
|
+
#### What to do
|
|
11
|
+
|
|
12
|
+
Everyone who has this package installed: run `npm install -g @antoneeo/course-creator@latest`, then `course-creator-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/course-creator` and look for 0.1.0-beta.21.
|
|
13
|
+
|
|
4
14
|
## [0.1.0-beta.20] - 2026-11-08
|
|
5
15
|
|
|
6
16
|
### What's new
|
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ The package is the fourth lens of the Agentic SDLC family. It uses the shared `a
|
|
|
6
6
|
|
|
7
7
|
<!-- whats-new:begin -->
|
|
8
8
|
<!-- generated by scripts/whats_new.js from distributions/course-creator/CHANGELOG.md: edit the CHANGELOG, then run node scripts/whats_new.js --write -->
|
|
9
|
-
## What's new in 0.1.0-beta.
|
|
9
|
+
## What's new in 0.1.0-beta.21
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**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).
|
|
12
12
|
|
|
13
13
|
#### What to do
|
|
14
14
|
|
|
15
|
-
Everyone who has this package installed: run `npm install -g @antoneeo/course-creator@latest`, then `course-creator-install-skill`, and restart your agent sessions. The install step copies the updated validator into your skills directory
|
|
15
|
+
Everyone who has this package installed: run `npm install -g @antoneeo/course-creator@latest`, then `course-creator-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/course-creator` and look for 0.1.0-beta.21.
|
|
16
16
|
|
|
17
17
|
Full history: [CHANGELOG](https://github.com/Antoneeo/agentic-sdlc-skill/blob/main/distributions/course-creator/CHANGELOG.md)
|
|
18
18
|
<!-- whats-new:end -->
|
package/gemini-extension.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "course-creator",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.21",
|
|
4
4
|
"description": "Course creation for defined learners, with progressive explanations, sourced facts and diagnostic independent testing.",
|
|
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/course-creator",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.21",
|
|
4
4
|
"description": "Design sourced, progressive courses for a defined learner with Agentic SDLC governance and diagnostic learner simulations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -108,7 +108,7 @@ Semantics: exit code 2 + message on stderr ⇒ the write is blocked and the mess
|
|
|
108
108
|
|
|
109
109
|
`sdlc_check.py verdict --hook` refuses an Edit, Write, MultiEdit or NotebookEdit when the
|
|
110
110
|
session transcript shows no guide-router verdict (a line that opens with `router: …` or with the level, `Level: L2 · router: …`, `Level: Spike · router: …`; or one that opens with a level-1 declaration)
|
|
111
|
-
or a guide the verdict names was
|
|
111
|
+
or a guide the verdict names was not read WHOLE: the session's reads of it (Read spans, a literal `cat`/`Get-Content`, `get_file_content`) must cover its first to its last line; Grep, `head`, `sed` or a brief naming it read nothing (F-094); it is silent in projects without guides and
|
|
112
112
|
whenever it cannot tell. The code package (`agentic-sdlc`) wires it machine-wide on
|
|
113
113
|
Claude Code; this package does not. To wire it by hand, add a `PreToolUse` entry with
|
|
114
114
|
matcher `Edit|Write|MultiEdit|NotebookEdit` and command
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: course-creator
|
|
3
|
-
version: 0.1.0-beta.
|
|
3
|
+
version: 0.1.0-beta.21
|
|
4
4
|
description: Design and improve courses that teach a defined learner through sourced, progressive explanations. Use when the deliverable is instruction or a learning path; route corpus intake to kb-agentic and persuasive campaigns to marketing-agentic.
|
|
5
5
|
author: Antonio Pinto (https://github.com/Antoneeo)
|
|
6
6
|
copyright: (c) 2026 Antonio Pinto
|
|
@@ -20,7 +20,7 @@ It is what users mean by "docs site", "minisito", "documentation site" or "proje
|
|
|
20
20
|
|
|
21
21
|
If `agentic-sdlc`, `kb-agentic`, or `mkt-agentic-sdlc` is installed alongside this skill, consult `routing.md` for the owner of the **deliverable**, then declare the lens. L1 never reaches it. A course from supplied documents is course work; ingestion and verification of the corpus is a separate knowledge unit. A commercial campaign is marketing work. If the request contains distinct deliverables, split them before choosing a lens.
|
|
22
22
|
|
|
23
|
-
Declare the level and the guide-router verdict at the start of operational work: `Level: L3 · router: GUIDE_topic.md → read` or `router: no match`. First consult the guide router at `ai_docs/reference/INDEX.md` before saying no match. Use the question discipline in `elicitation.md` to ask a real doubt when it emerges, before writing its answer into an artifact.
|
|
23
|
+
Declare the level and the guide-router verdict at the start of operational work: `Level: L3 · router: GUIDE_topic.md → read` or `router: no match`. First consult the guide router at `ai_docs/reference/INDEX.md` before saying no match. A matched guide is read whole — every line, no offset or limit, no excerpt — and applied whole: a rule that does not fit is proposed as an amendment to the guide, never skipped in silence (`guides.md` §0). Use the question discipline in `elicitation.md` to ask a real doubt when it emerges, before writing its answer into an artifact.
|
|
24
24
|
|
|
25
25
|
| Level | Criteria | Process |
|
|
26
26
|
|---|---|---|
|
|
@@ -59,7 +59,7 @@ An operative guide is not a dumping ground. Follow `guides.md`: source provenanc
|
|
|
59
59
|
|
|
60
60
|
### 1. Orient and align
|
|
61
61
|
|
|
62
|
-
Read `ai_docs/README.md`, `ai_docs/INDEX.md`, and `ai_docs/reference/INDEX.md` (the guide router). Consult (before acting) the matched guide and project memory through `memory.md`/`recall`; state the router verdict. Read the project Vision and prior decisions. Inspect course artifacts already present. When the requester knows only the topic, infer an initial learner profile as a proposal and research candidate sources if the client can browse. Do not teach unverified factual claims. Ask only for decisions the available evidence cannot settle; `elicitation.md` owns this discipline.
|
|
62
|
+
Read `ai_docs/README.md`, `ai_docs/INDEX.md`, and `ai_docs/reference/INDEX.md` (the guide router). Consult (before acting) the matched guide, read whole and applied whole, and project memory through `memory.md`/`recall`; state the router verdict. Read the project Vision and prior decisions. Inspect course artifacts already present. When the requester knows only the topic, infer an initial learner profile as a proposal and research candidate sources if the client can browse. Do not teach unverified factual claims. Ask only for decisions the available evidence cannot settle; `elicitation.md` owns this discipline.
|
|
63
63
|
|
|
64
64
|
### 2. Vision Gate
|
|
65
65
|
|
|
@@ -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
|
|
45
|
-
|
|
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
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
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
|
|
236
|
-
|
|
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
|
|
@@ -23,7 +23,8 @@ sdlc_core.set_profile(
|
|
|
23
23
|
"question_discipline"),
|
|
24
24
|
design_gate_between=("### 3. Course Design", "### 4. Production and Testing"),
|
|
25
25
|
remind_line=("load course-creator when the deliverable teaches; declare triage and "
|
|
26
|
-
"guide-router verdict
|
|
26
|
+
"guide-router verdict; read a matched guide whole, apply it whole. Define "
|
|
27
|
+
"the learner profile and prerequisites before "
|
|
27
28
|
"writing explanations. Reopen sources for factual claims. A simulator is "
|
|
28
29
|
"diagnostic; real learning remains unverified until supported by feedback."),
|
|
29
30
|
)
|
|
@@ -2801,8 +2801,21 @@ def cmd_gate(args):
|
|
|
2801
2801
|
# 0) only on certainty; whatever it cannot tell resolves to silence. It never
|
|
2802
2802
|
# prints `allow` -- that would skip the user's permission prompt. Owner: block
|
|
2803
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.
|
|
2804
2815
|
|
|
2805
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
|
|
2806
2819
|
VERDICT_MAX_BYTES = 256 * 1024 * 1024 # a larger transcript: cannot afford to tell
|
|
2807
2820
|
VERDICT_LINE_MAX = 1024 * 1024 # assistant lines are small; skip the rest unparsed
|
|
2808
2821
|
# Markdown emphasis between the word and the colon ("**router**: no match") and
|
|
@@ -2886,6 +2899,13 @@ def hook_edits(payload):
|
|
|
2886
2899
|
|
|
2887
2900
|
def shell_read_paths(command, cwd, workdir=None):
|
|
2888
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."""
|
|
2889
2909
|
if not isinstance(command, str) or re.search(r"[$`\r\n;|&<>\x00]", command):
|
|
2890
2910
|
return None
|
|
2891
2911
|
token_re = re.compile(r"\s*(?:'([^']*)'|\"([^\"]*)\"|([^\s'\"]+))")
|
|
@@ -2899,7 +2919,7 @@ def shell_read_paths(command, cwd, workdir=None):
|
|
|
2899
2919
|
pos = match.end()
|
|
2900
2920
|
if not tokens or tokens[0].lower() not in ("get-content", "cat"):
|
|
2901
2921
|
return None
|
|
2902
|
-
paths, i = [], 1
|
|
2922
|
+
paths, i, count = [], 1, None
|
|
2903
2923
|
while i < len(tokens):
|
|
2904
2924
|
token = tokens[i]
|
|
2905
2925
|
if tokens[0].lower() == "get-content" and token.lower() in ("-literalpath", "-path", "-raw"):
|
|
@@ -2909,6 +2929,7 @@ def shell_read_paths(command, cwd, workdir=None):
|
|
|
2909
2929
|
i += 1
|
|
2910
2930
|
if i == len(tokens) or not tokens[i].isdigit():
|
|
2911
2931
|
return None
|
|
2932
|
+
count = int(tokens[i])
|
|
2912
2933
|
elif tokens[0] == "cat" and token == "--":
|
|
2913
2934
|
pass
|
|
2914
2935
|
elif token.startswith("-") or re.search(r"[*?\[\],]", token):
|
|
@@ -2920,7 +2941,7 @@ def shell_read_paths(command, cwd, workdir=None):
|
|
|
2920
2941
|
return None
|
|
2921
2942
|
paths.append(resolved)
|
|
2922
2943
|
i += 1
|
|
2923
|
-
return paths
|
|
2944
|
+
return (paths, count) if paths else None
|
|
2924
2945
|
|
|
2925
2946
|
|
|
2926
2947
|
def _codex_literal_calls(code):
|
|
@@ -3006,8 +3027,12 @@ def transcript_events(path):
|
|
|
3006
3027
|
for edit in hook_edits({"tool_input": {"command": command}, "cwd": cwd}) or []:
|
|
3007
3028
|
blocks.append({"type": "tool_use", "name": "Write", "input": {"file_path": edit["path"]}})
|
|
3008
3029
|
for args in calls:
|
|
3009
|
-
|
|
3010
|
-
|
|
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})
|
|
3011
3036
|
if blocks:
|
|
3012
3037
|
yield {"type": "assistant", "isSidechain": bool(entry.get("agent_id") or data.get("agent_id")),
|
|
3013
3038
|
"message": {"content": blocks}}
|
|
@@ -3020,9 +3045,9 @@ def transcript_facts(path):
|
|
|
3020
3045
|
Returns {"assistant": entries parsed, "sidechain": a subagent's own transcript
|
|
3021
3046
|
(Claude Code marks every entry of one `isSidechain`), "declared": a router verdict seen,
|
|
3022
3047
|
"trivial": a level-1 declaration seen (`Level: L1`, `E1`), "named": guides the verdicts name,
|
|
3023
|
-
"read": guide
|
|
3048
|
+
"read": guide name -> the line spans the session read of it (F-094, _read_spans)}."""
|
|
3024
3049
|
facts = {"assistant": 0, "sidechain": False, "declared": False, "trivial": False,
|
|
3025
|
-
"named": set(), "read":
|
|
3050
|
+
"named": set(), "read": {}}
|
|
3026
3051
|
try:
|
|
3027
3052
|
p = Path(path)
|
|
3028
3053
|
if not p.is_file() or p.stat().st_size > VERDICT_MAX_BYTES:
|
|
@@ -3049,15 +3074,75 @@ def transcript_facts(path):
|
|
|
3049
3074
|
facts["declared"] = True
|
|
3050
3075
|
if not _VERDICT_NONE_RE.match(m.group(1)):
|
|
3051
3076
|
facts["named"].update(_GUIDE_NAME_RE.findall(m.group(1)))
|
|
3052
|
-
elif
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
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)
|
|
3056
3081
|
except (OSError, ValueError, TypeError, AttributeError):
|
|
3057
3082
|
return None
|
|
3058
3083
|
return facts
|
|
3059
3084
|
|
|
3060
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
|
+
|
|
3061
3146
|
def verdict_reason(payload, root=None, docs_name=None):
|
|
3062
3147
|
"""The refusal line for this edit event, or None when the edit may proceed.
|
|
3063
3148
|
Without a root, the project is the one holding the edited file (hook_project)."""
|
|
@@ -3098,10 +3183,12 @@ def verdict_reason(payload, root=None, docs_name=None):
|
|
|
3098
3183
|
f"guides ({docs_dir()}/reference/INDEX.md). Declare it with the level, e.g. "
|
|
3099
3184
|
"\"Level: L2 · router: no match\" or \"router: GUIDE_x.md -> read\" "
|
|
3100
3185
|
"(L1: \"Level: L1\"), then retry.")
|
|
3101
|
-
unread = sorted(
|
|
3186
|
+
unread = sorted(g for g in facts["named"] & guides
|
|
3187
|
+
if not _read_whole(facts["read"].get(g), _guide_lines(ref / g)))
|
|
3102
3188
|
if unread:
|
|
3103
|
-
return (f"[sdlc verdict] The router verdict names {', '.join(unread)}, not read
|
|
3104
|
-
"this session. Read
|
|
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.")
|
|
3105
3192
|
return None
|
|
3106
3193
|
|
|
3107
3194
|
|
|
@@ -4197,7 +4284,7 @@ def cmd_orient(args):
|
|
|
4197
4284
|
left = share - len("\n".join(head + tail)) - 2
|
|
4198
4285
|
body = []
|
|
4199
4286
|
for rel, title, builder, cap in (
|
|
4200
|
-
(router_rel, "## Guide router (reference/INDEX.md) -- read
|
|
4287
|
+
(router_rel, "## Guide router (reference/INDEX.md) -- read a matching guide whole, every line, before acting",
|
|
4201
4288
|
_orient_router_lines, ORIENT_ROUTER_CHARS),
|
|
4202
4289
|
(handoff_rel, "## Workstream registry (audit/handoff.md)",
|
|
4203
4290
|
_orient_registry_lines, ORIENT_REGISTRY_CHARS),
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
"files": {
|
|
4
4
|
"LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
|
|
5
5
|
"NOTICE": "8414f424f7c1db19d89d74286fd2d6b1acdd9eedde910fa57a16d6835602e4bd",
|
|
6
|
-
"dispatch.md": "
|
|
6
|
+
"dispatch.md": "0828be0a30b91435ca68e04db48e4892d4d7f4ff1494fedc290cd9acb6c76d42",
|
|
7
7
|
"docs_site/app.js": "ce9ed4341f7d24b648dee7531700d09f4af07f7e9ffc4be90aff29ecc276f27f",
|
|
8
8
|
"docs_site/index.html": "2b64167470f754e46fa4bb4e73a3d2c34ee632d91fe2f17705a58d18b5018af5",
|
|
9
9
|
"docs_site/strings.js": "440c11830f87602152422766b6d5b84da904150c37b0b6347e2ad53a7fec62b8",
|
|
10
10
|
"docs_site/style.css": "1cbd71eb2e62bb9251ecb62796fe4cecf6a78eecf2f9a7493703290ae55d1244",
|
|
11
|
-
"guides.md": "
|
|
11
|
+
"guides.md": "de883eacefb55ede979907f9239abde4654724ad221bc24ec85d1bcacb3ac195",
|
|
12
12
|
"memory.md": "765c8cf34e9161143d6f8b982106251de0ac7f4f6f5d768336f3e4b4b150823e",
|
|
13
13
|
"review.md": "e7eb85f71d79db52e59415e6b3baed15fa9dae4004a6e882190547b3999c778e",
|
|
14
14
|
"routing.md": "5116e8dbd3b215919b897506f28917ac8f1c44cd91f8b64ec901048320e6c1f6",
|
|
15
15
|
"scripts/docs_site.py": "bfc7a521142251b85b229e1873ccf2e375bb5c7f1990cef574e1a78ef14f0091",
|
|
16
16
|
"scripts/entry_point.py": "4a560d4d41db989d3426182f1b24270cbb934b3db0f3246c700578a4ed93089b",
|
|
17
17
|
"scripts/knowledge.py": "6047deb7a2be4cf9ef2949cbcf8a52a8ea61500f4e12d203f1c58076540d50ab",
|
|
18
|
-
"scripts/sdlc_core.py": "
|
|
18
|
+
"scripts/sdlc_core.py": "7ed77231cd7b391172e35aa152ea2d1beeb3566c588c13b7810fa75214a9518f",
|
|
19
19
|
"scripts/shared_files.py": "d360c6018c602788dd96194bcc0f8e8409b140671857ae50ec15acee882eb51e",
|
|
20
20
|
"scripts/test_audit_refs.py": "5c207be46da566db47069b08373195e748fca19c047418f09cc2f78841dfd9a5",
|
|
21
21
|
"scripts/test_chronology.py": "cd595dcfa6d75b44c3b37483dec2c678c87dab9874ad3f6a60a28f9ec361cdc7",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"scripts/test_plan.py": "4c011a63aa834b55e9c5d13fb4ea76b131b742356001364b0a508435ba013e27",
|
|
32
32
|
"scripts/test_project_memory.py": "2cb85cef01161d881a11d84cfe9ebb72915104e8d1822e4de739f7d00ae6cd59",
|
|
33
33
|
"scripts/test_session_start.py": "d834e66adb3ccc26d8ef664be870e18ca41fd4c10dc4e5870827d24385f40abf",
|
|
34
|
-
"scripts/test_skill_invariants.py": "
|
|
35
|
-
"scripts/test_verdict.py": "
|
|
34
|
+
"scripts/test_skill_invariants.py": "0edf81bb36cf86f45d3c016e6317b3a7485a06f00e5bbcdb13759e2816202f3a",
|
|
35
|
+
"scripts/test_verdict.py": "24e33e6cdfe3f40f0c2735687ff7933564bf8c7846ec339d4dc22148df5a4935",
|
|
36
36
|
"vision.md": "a19a7d7d5044215b726b66f74e422c9cdedcc856c0a53151f20a6d9840b8f6c4"
|
|
37
37
|
}
|
|
38
38
|
}
|