@antoneeo/agentic-sdlc-skill 1.32.0 → 1.33.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 +74 -0
- package/README.md +32 -2
- package/gemini-extension.json +6 -6
- package/package.json +51 -50
- package/scripts/lib.js +37 -3
- package/skills/agentic-sdlc-skill/ENFORCEMENT.md +10 -1
- package/skills/agentic-sdlc-skill/SKILL.md +283 -356
- package/skills/agentic-sdlc-skill/dispatch.md +39 -1
- package/skills/agentic-sdlc-skill/hybrid.md +106 -0
- package/skills/agentic-sdlc-skill/review.md +80 -3
- package/skills/agentic-sdlc-skill/scripts/sdlc_check.py +2 -2
- package/skills/agentic-sdlc-skill/scripts/sdlc_core.py +239 -1
- package/skills/agentic-sdlc-skill/templates.md +15 -8
|
@@ -45,12 +45,50 @@ below — so it needs no separate dispatch hook.)
|
|
|
45
45
|
|
|
46
46
|
## Model tiers (client-relative, no provider names)
|
|
47
47
|
|
|
48
|
-
- Default dispatch: **economy** implementer tier.
|
|
48
|
+
- Default dispatch: **economy** implementer tier. This is legal precisely
|
|
49
|
+
because a dispatched task carries `task.verify` — the threshold signal that
|
|
50
|
+
makes a wrong cheap answer visible. **The floor that governs every role, and
|
|
51
|
+
the rule that a tier may be lowered only where such a signal exists, is
|
|
52
|
+
`review.md` §The capability floor** — cited, never restated here.
|
|
49
53
|
- After **two** consecutive `verify_result: fail` on the same task: escalate
|
|
50
54
|
to the **deep** tier for the retry (ADR 2026-07-02). Do not escalate on the
|
|
51
55
|
first failure — a single fail is often a brief or environment issue, not a
|
|
52
56
|
capability gap.
|
|
53
57
|
|
|
58
|
+
## What may be delegated at all
|
|
59
|
+
|
|
60
|
+
The sections above govern the opt-in PLAN loop; **this one is family-wide** and
|
|
61
|
+
applies to any pass, at any level, dispatch or no dispatch. Delegation is not a
|
|
62
|
+
token-saving technique — a second context re-reads, re-briefs and reports back,
|
|
63
|
+
so the total spend goes UP. What it buys is a main context that stays clean, and
|
|
64
|
+
independence where independence is the point. Judge a pass on two axes:
|
|
65
|
+
|
|
66
|
+
| | output falsifiable cheaply (`file:line`, an assertion result, a diff) | output is judgement |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| **reads ≫ report** | **delegate** — the whole win lives here | **never**: the biggest apparent win is where plausible-but-wrong enters |
|
|
69
|
+
| **reads ≈ report** | keep it: the brief costs more than the pass | keep it |
|
|
70
|
+
|
|
71
|
+
- **Delegate**: locating and verifying (a pass that returns citable facts and
|
|
72
|
+
discards its exploration trace), executing a probe or battery and reporting
|
|
73
|
+
the assertion table, and every independent review — the last for correctness,
|
|
74
|
+
not economy, and it is mandatory regardless of what it costs.
|
|
75
|
+
- **Never delegate**: authoring a governed artifact (Vision, ANALYSIS/E-ISP,
|
|
76
|
+
threat model, use cases, the Interface Contract), the triage level and router
|
|
77
|
+
verdict, a reconciliation or scope decision, and any pass whose result the
|
|
78
|
+
orchestrator must hold across many later turns — delegating that one just
|
|
79
|
+
moves the reading into the main context via the report.
|
|
80
|
+
- **The delegability condition**: a task whose brief cannot be expressed as
|
|
81
|
+
**pointers** — paths, ids, a command — is **not delegable** yet; a brief that
|
|
82
|
+
must carry the content pays those tokens twice, once to write it and once to
|
|
83
|
+
read it. `plan brief` is this rule already realized for the PLAN loop (it
|
|
84
|
+
prints `guides` as paths, never pasted content); the condition generalizes it.
|
|
85
|
+
|
|
86
|
+
**Declared residual**, so the silence is not read as prohibition: this section
|
|
87
|
+
settles the CLASSIFICATION. *When* to reach for a delegated search or
|
|
88
|
+
orientation pass — the trigger, its brief format and its output contract — is a
|
|
89
|
+
separate unit and is not answered here; until it lands, reaching for one is the
|
|
90
|
+
orchestrator's judgement against the table above, not a rule.
|
|
91
|
+
|
|
54
92
|
## Review slots — one-shot, not iterative
|
|
55
93
|
|
|
56
94
|
Exactly three review touches per task, never a loop:
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# The Hybrid Seam — coexistence with devPNT
|
|
2
|
+
|
|
3
|
+
**For whom**: the agent working a project where the `devpnt_*` tools are available
|
|
4
|
+
and point at this project.
|
|
5
|
+
**Answers**: "which mode am I in, who owns what when both authorities are live,
|
|
6
|
+
and how do the two vocabularies map onto each other".
|
|
7
|
+
**Does not answer**: the process itself — triage, the phases, the gates and the
|
|
8
|
+
write triggers are `SKILL.md`'s, and they are identical in both modes.
|
|
9
|
+
|
|
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.
|
|
13
|
+
|
|
14
|
+
<!-- moved-block-sha256: f11e6d5b9cd4710849fa9d3701f16ff0da39f2d163e8ffdb8adbff6a119b3614 -->
|
|
15
|
+
### Hybrid in symbiosis with devPNT
|
|
16
|
+
|
|
17
|
+
Use this mode when the `devpnt_*` tools are available and point at the current project.
|
|
18
|
+
|
|
19
|
+
Authoritative hierarchy:
|
|
20
|
+
1. **devPNT M-VISION**: strategic beacon of the milestone. Before design or code, read it and verify benefits, success signals, scope-in and non-goals.
|
|
21
|
+
2. **devPNT Master Plan**: strategic roadmap and milestones.
|
|
22
|
+
3. **devPNT Action Plan**: current tactical work for the active goal.
|
|
23
|
+
4. **devPNT governed artifacts**: `D-UC`, `P-TM`, `E-ISP`, `E-TDD`, `E-TP`, ADR.
|
|
24
|
+
5. **Local `ai_docs/`**: readable context, Standalone fallback, local handoff or shadow/mirror when useful.
|
|
25
|
+
|
|
26
|
+
Hybrid rules:
|
|
27
|
+
- devPNT is the governed source for plans and artifacts; do not create a second truth in `ai_docs/`.
|
|
28
|
+
- The skill stays autonomous: if devPNT is not there, switch to Standalone without losing capability.
|
|
29
|
+
- If the user request, the local Vision and the M-VISION diverge, stop and make the conflict explicit.
|
|
30
|
+
- Do not create or modify milestones without respecting the M-VISION.
|
|
31
|
+
- Never auto-accept devPNT proposals: present the preview and wait for explicit confirmation.
|
|
32
|
+
- If the local devPNT protocol imposes stricter bootstrap, plans or gates, follow them.
|
|
33
|
+
|
|
34
|
+
## Coexistence with devPNT (the Hybrid seam)
|
|
35
|
+
|
|
36
|
+
This section is the single authoritative answer to "who owns what" when both the
|
|
37
|
+
skill and devPNT are active. The skill owns the **process** (triage, phases, Vision
|
|
38
|
+
Gate, lifecycle); devPNT owns the **machinery** (governed storage, versioned
|
|
39
|
+
proposals, semantic analysis, independent reviewers). devPNT strengthens the
|
|
40
|
+
process; it never replaces it.
|
|
41
|
+
|
|
42
|
+
### Ownership matrix
|
|
43
|
+
|
|
44
|
+
| Artifact | Standalone master | Hybrid master | Mirror rule |
|
|
45
|
+
|---|---|---|---|
|
|
46
|
+
| Product vision | `vision/project_vision.md` | `vision/project_vision.md` (product scope) | devPNT KL vision is regenerated from it, never edited independently |
|
|
47
|
+
| Milestone vision | `vision/roadmap.md` milestones | devPNT M-VISION | `roadmap.md` may reference the M-VISION key; it never restates its content |
|
|
48
|
+
| Feature design | `solutions/ANALYSIS_[feature].md` | devPNT E-ISP/E-TDD (+ D-UC/P-TM) | shadow exported from the ACCEPTED DB version as `SHADOW_[doc_key]_vX.Y.md`; on divergence the DB wins and the shadow is regenerated |
|
|
49
|
+
| Plans | `## Action Plan` inside the ANALYSIS | devPNT Master/Action Plan | none |
|
|
50
|
+
| Feature state | ANALYSIS frontmatter `status` | Action Plan node status | mapping table below; at closure both must move together |
|
|
51
|
+
| ADR | `architecture/` (canonical dir) | devPNT DB (`adr_YYYY-MM-DD_slug`) | optional filesystem shadow `SHADOW_adr_*` exported at closure for grep-ability |
|
|
52
|
+
| 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 | | |
|
|
55
|
+
| Review log | `audit/reviews/REVIEW_LOG.md` | devPNT `REVIEW_LOG.md` (same path) | always filesystem |
|
|
56
|
+
| 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
|
+
| Handoff | `audit/handoff.md` | `audit/handoff.md` | always filesystem |
|
|
58
|
+
|
|
59
|
+
### Triage equivalence (one threshold, two vocabularies)
|
|
60
|
+
|
|
61
|
+
devPNT's "significance threshold" and the skill's triage are the SAME test. Do not
|
|
62
|
+
run two classifications:
|
|
63
|
+
|
|
64
|
+
| Skill triage | devPNT equivalent | Governed artifacts |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| L1 Trivial | trivial exempt | none |
|
|
67
|
+
| L2 Small | localized obvious edit | none — but see escalation |
|
|
68
|
+
| L3 Significant | governed unit of change | D-UC/P-TM/E-ISP/E-TDD per the devPNT trigger policy |
|
|
69
|
+
| Spike | exempt (non-mergeable) | `SPIKE_[topic].md` only |
|
|
70
|
+
|
|
71
|
+
Escalation triggers (any one of these makes it L3, in BOTH vocabularies): touches
|
|
72
|
+
more than one module, changes a public API/contract/message format, changes a data
|
|
73
|
+
model or state machine, has a security surface, risks duplicating existing logic,
|
|
74
|
+
or the design choice is non-obvious. An L2 that trips one of these is not an L2.
|
|
75
|
+
|
|
76
|
+
### Feature state mapping
|
|
77
|
+
|
|
78
|
+
| ANALYSIS frontmatter | devPNT plan node |
|
|
79
|
+
|---|---|
|
|
80
|
+
| PLANNED | READY (or BLOCKED / ON_HOLD while waiting) |
|
|
81
|
+
| IN_PROGRESS | PROGRESS |
|
|
82
|
+
| COMPLETED | DONE |
|
|
83
|
+
| CANCELLED | CANCELLED |
|
|
84
|
+
|
|
85
|
+
Closure discipline: never mark the node DONE while the shadow/ANALYSIS still says
|
|
86
|
+
IN_PROGRESS, or vice versa. They move in the same closure step.
|
|
87
|
+
|
|
88
|
+
### Shadow discipline (Hybrid)
|
|
89
|
+
|
|
90
|
+
- Shadow filename: `SHADOW_[doc_key]_vX.Y.md`, first line
|
|
91
|
+
`<!-- SHADOW generated from devPNT (doc_key vX.Y) - do not edit by hand -->`.
|
|
92
|
+
Never save a shadow under an `ANALYSIS_*` name: that name means "authoritative
|
|
93
|
+
Standalone document" and the validator treats it as such.
|
|
94
|
+
- **Export the approved E-TDD shadow BEFORE implementation** (not only at closure).
|
|
95
|
+
It gives context-free subagents their design input, unlocks `gate --hybrid`, and
|
|
96
|
+
guarantees the filesystem fallback if devPNT becomes unavailable mid-feature.
|
|
97
|
+
- At closure, refresh all shadows from the accepted DB versions.
|
|
98
|
+
|
|
99
|
+
### Validator in Hybrid
|
|
100
|
+
|
|
101
|
+
Pass `--hybrid` explicitly (never auto-detected — an explicit flag beats a guessed
|
|
102
|
+
mode): `check --hybrid` and `stale --hybrid` skip audit-plan staleness (mapping is
|
|
103
|
+
delegated to devPNT/KL) — guide-drift checking still runs (`ai_docs/reference/`
|
|
104
|
+
is filesystem-first even in Hybrid, see the ownership matrix above); `gate --hybrid`
|
|
105
|
+
also unlocks on the presence of an E-TDD shadow in `solutions/` (the Hybrid design
|
|
106
|
+
gate) instead of requiring an IN_PROGRESS ANALYSIS.
|
|
@@ -82,15 +82,92 @@ its outcome. The trigger term "permission-gated" scopes the STOP; the row word
|
|
|
82
82
|
|
|
83
83
|
Use a different model from the author's where the client allows it.
|
|
84
84
|
|
|
85
|
+
**The capability floor — which tier may run this role.** Independence says the
|
|
86
|
+
reviewer must not be the author; it says nothing about whether the reviewer *can
|
|
87
|
+
do the job*. A gate run below the capability its judgement needs produces the
|
|
88
|
+
myopia the gate exists to catch, **while reporting as an independent review** —
|
|
89
|
+
worse than no gate, because it certifies. So each role carries a minimum tier.
|
|
90
|
+
Tiers are **client-relative capability levels, never provider names** (a name
|
|
91
|
+
rots at the next model release; the tier→model binding lives in the client's own
|
|
92
|
+
agent definition, never in this file):
|
|
93
|
+
|
|
94
|
+
| Role | Floor | Why there |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| **authoring a governed artifact** (Vision, the analysis/design, use cases, the Interface Contract, threat model — `dispatch.md`'s never-list owns the enumeration) | **deep** | the purest case of the rule below: the output is judgement, nothing scores it, and `dispatch.md`'s never-list forbids moving it elsewhere — so the session's own capability IS this work's capability |
|
|
97
|
+
| design review, closure review, any verdict on judgement | **deep** | the output is a judgement whose wrongness no check can see |
|
|
98
|
+
| a light conformance or consistency pass (schema, coverage, citation resolution) | **light** | the criterion is stated and mechanical |
|
|
99
|
+
| implementer dispatch, probe execution, anchor resolution, index regeneration | **economy** | a threshold signal catches a wrong cheap answer |
|
|
100
|
+
|
|
101
|
+
The rule underneath the table: **a tier may be lowered only where a threshold
|
|
102
|
+
signal exists** — `task.verify`, a test, a diff against a spec, an assertion
|
|
103
|
+
harness — because that is what makes a wrong cheap answer visible instead of
|
|
104
|
+
plausible. Where the output is judgement and nothing scores it, there is no
|
|
105
|
+
signal to lower against, and the floor is the whole policy.
|
|
106
|
+
|
|
107
|
+
**A session's floor is the highest floor among the roles it performs itself.** The
|
|
108
|
+
table above binds reviewers and dispatched subagents, chosen per call — but the
|
|
109
|
+
session doing the authoring was chosen by the USER before the agent existed, and
|
|
110
|
+
an agent cannot re-tier itself mid-session. So the rule that reaches it is not
|
|
111
|
+
routing, it is **disclosure**: where a session can determine that it is below the
|
|
112
|
+
floor for a role it performs itself, it says so **once per session, at the first
|
|
113
|
+
such role** — not once per unit — and the disclosure is repeated in the review
|
|
114
|
+
row's existing `reviewer` cell (Hybrid: `notes`), which is what makes the pair
|
|
115
|
+
below visible without adding a column.
|
|
116
|
+
|
|
117
|
+
**Say plainly how thin this reach is.** A session knows its model NAME; tiers here
|
|
118
|
+
are deliberately client-relative and this file maps no name to a tier, so the
|
|
119
|
+
antecedent is satisfiable only where a session can recognize its own tier — which
|
|
120
|
+
is also the session least likely to run the check. Where a session **cannot
|
|
121
|
+
determine its own tier**, it owes nothing: the rule binds what an agent can know
|
|
122
|
+
and say, never a capability it cannot acquire. **The reliably working half of this
|
|
123
|
+
rule is the one addressed to the user, not to the agent** — which is why the
|
|
124
|
+
package READMEs carry the tier-selection guidance, and why that is not a footnote.
|
|
125
|
+
|
|
126
|
+
**Never both below the floor on the same unit — except when nothing better
|
|
127
|
+
exists.** Where the authoring session ran below floor, the independent review's
|
|
128
|
+
floor becomes non-negotiable and the same unit should not ALSO run a below-floor
|
|
129
|
+
review. **The exception is the case *When independence and capability conflict*
|
|
130
|
+
governs below**: where no independent rung at or above the floor exists at all,
|
|
131
|
+
that rule wins, the review still runs, BOTH disclosures are recorded, and the
|
|
132
|
+
result is not a violation but the worst admissible state — honestly labelled.
|
|
133
|
+
Forbidding it outright would push the agent toward the abstention that rule
|
|
134
|
+
explicitly rejects.
|
|
135
|
+
|
|
136
|
+
**When independence and capability conflict, independence wins.** A client whose
|
|
137
|
+
only independent rung is bound below the floor (a single-model client, or a
|
|
138
|
+
subagent facility whose agent definition fixes a cheap model) still runs the
|
|
139
|
+
gate: a below-floor *independent* reviewer catches the class the author is
|
|
140
|
+
structurally blind to, while a self-pass catches none of it. What the floor then
|
|
141
|
+
requires is **disclosure, not abstention** — the row records the tier that
|
|
142
|
+
actually ran (`below floor: <reason>`), and that record IS the remedy. Where a
|
|
143
|
+
higher-capability path exists but is permission-gated, nothing new applies: *The
|
|
144
|
+
gated rung* above already governs, one question per gate per intact context.
|
|
145
|
+
Where the client exposes no capability choice at all, the row says
|
|
146
|
+
`single (client exposes no choice)` and the floor is satisfied by construction —
|
|
147
|
+
it is a routing rule, and a routing rule with one route is not a failure.
|
|
148
|
+
|
|
85
149
|
**Rounds are capped at 3.** FAIL → revise → re-review. If findings still stand
|
|
86
150
|
after the third, stop and surface them to the user with the artifact — a gate that
|
|
87
151
|
can block forever gets removed. **Log one row per completed review, PASS or FAIL**
|
|
88
152
|
— a FAIL surfaced to the user is the highest-value outcome the gate produces, and
|
|
89
153
|
logging only passes would erase exactly that evidence. The row goes in
|
|
90
154
|
`ai_docs/audit/reviews/REVIEW_LOG.md` (create it if absent — `templates.md`):
|
|
91
|
-
`| date | doc_key | tier | reviewer | findings_raised | findings_real | verdict | revise_rounds |`,
|
|
92
|
-
with `tier` = `design` or `closure` in Standalone.
|
|
93
|
-
|
|
155
|
+
`| date | doc_key | tier | model | reviewer | findings_raised | findings_real | verdict | revise_rounds |`,
|
|
156
|
+
with `tier` = `design` or `closure` in Standalone. **`model` records the capability
|
|
157
|
+
tier that actually ran** — `deep`, `light`, `economy`, `single (client exposes no
|
|
158
|
+
choice)`, or `below floor: <reason>` — never a provider name in doctrine (a project
|
|
159
|
+
may of course write its own model names in its own log). Without it the floor above
|
|
160
|
+
is a belief: the row would say a gate ran and never whether it could do its job, and
|
|
161
|
+
the correlation with `revise_rounds` and `findings_real` — the only evidence the
|
|
162
|
+
policy pays — could not be drawn.
|
|
163
|
+
|
|
164
|
+
**One schema for both modes**, meaning one required CORE plus each mode's own
|
|
165
|
+
**mode-specific** realization columns. The core is what both modes actually share: `date`, `doc_key`,
|
|
166
|
+
`tier`, `model`, `findings_raised`, `findings_real`, `verdict`, `revise_rounds`.
|
|
167
|
+
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"
|
|
169
|
+
was never true of the two modes. This costs nothing for the reason `templates.md`
|
|
170
|
+
§`ai_docs/audit/reviews/REVIEW_LOG.md` owns and states.
|
|
94
171
|
The log is how the gate's value is measured over time; skipping it makes the gate
|
|
95
172
|
unfalsifiable, the same defect as an unnamed EXISTS or a faked router verdict.
|
|
96
173
|
|
|
@@ -13,7 +13,7 @@ image, copy BOTH (`ENFORCEMENT.md` §2 has the recipe); copying this one alone
|
|
|
13
13
|
fails at import, loudly and immediately, which is the intended failure.
|
|
14
14
|
|
|
15
15
|
Usage is `sdlc_core.py`'s: check / validate / index / stale / mark / gate /
|
|
16
|
-
orient / plan.
|
|
16
|
+
orient / benefit / plan.
|
|
17
17
|
"""
|
|
18
18
|
import sys
|
|
19
19
|
from pathlib import Path
|
|
@@ -50,7 +50,7 @@ sdlc_core.set_profile(
|
|
|
50
50
|
unit_noun="feature",
|
|
51
51
|
support_files=("templates.md", "architect.md", "guides.md", "vision.md", "tdd.md",
|
|
52
52
|
"debugging.md", "elicitation.md", "review.md", "dispatch.md",
|
|
53
|
-
"routing.md", "ENFORCEMENT.md"),
|
|
53
|
+
"routing.md", "hybrid.md", "ENFORCEMENT.md"),
|
|
54
54
|
capabilities=(
|
|
55
55
|
# spine
|
|
56
56
|
"triage", "write_triggers", "workstream_registry", "vision_gate",
|
|
@@ -1320,7 +1320,7 @@ def cmd_validate(root, strict=False, hybrid=False):
|
|
|
1320
1320
|
# comment-stripped, anchored: a '<!-- TODO: the ## Capability Ledger -->'
|
|
1321
1321
|
# must not read as the section being present
|
|
1322
1322
|
# Hybrid: the design lives in devPNT and its §4.5 gate owns this slot
|
|
1323
|
-
# (
|
|
1323
|
+
# (the Hybrid ownership matrix: "run ONE of them, never both"), and its log
|
|
1324
1324
|
# rows are keyed on e_isp_/e_tdd_ doc_keys, not on this filename -- so
|
|
1325
1325
|
# firing here would be a permanent, unfixable false positive.
|
|
1326
1326
|
if not hybrid and design_review_due(meta) and not review_logged(root, p.name):
|
|
@@ -2052,6 +2052,237 @@ def cmd_plan(root, args):
|
|
|
2052
2052
|
return 0
|
|
2053
2053
|
|
|
2054
2054
|
|
|
2055
|
+
# --- F-050: the benefit report -------------------------------------------
|
|
2056
|
+
# The process's central claim is that it makes divergence visible BEFORE
|
|
2057
|
+
# implementation. That claim lived in prose for four months while the evidence
|
|
2058
|
+
# for it sat unread in REVIEW_LOG. This reads it.
|
|
2059
|
+
#
|
|
2060
|
+
# Columns are resolved BY HEADER NAME, never by width. `templates.md` states
|
|
2061
|
+
# that contract ("extra or reordered columns are fine -- but the header must
|
|
2062
|
+
# say `tier`") and three widths are legal today: the original 8, Standalone's 9
|
|
2063
|
+
# (F-048 added `model`), and Hybrid's 10 (`instrument` + `notes`, and no
|
|
2064
|
+
# `reviewer` at all). A width whitelist reads none of the last, and silently
|
|
2065
|
+
# reports a devPNT-governed project as having no data at all.
|
|
2066
|
+
#
|
|
2067
|
+
# Two honesty rules, both learned from this unit's own review: whatever cannot
|
|
2068
|
+
# be read is COUNTED and NAMED, at the row level AND at the cell level. A ratio
|
|
2069
|
+
# over a silently shrunken denominator is worse than no ratio.
|
|
2070
|
+
REVIEW_CORE = ("date", "doc_key", "tier", "findings_real", "verdict")
|
|
2071
|
+
REVIEW_POSITIONAL = {
|
|
2072
|
+
8: ("date", "doc_key", "tier", "reviewer", "findings_raised",
|
|
2073
|
+
"findings_real", "verdict", "revise_rounds"),
|
|
2074
|
+
9: ("date", "doc_key", "tier", "model", "reviewer", "findings_raised",
|
|
2075
|
+
"findings_real", "verdict", "revise_rounds"),
|
|
2076
|
+
10: ("date", "doc_key", "tier", "model", "instrument", "findings_raised",
|
|
2077
|
+
"findings_real", "verdict", "revise_rounds", "notes"),
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
|
|
2081
|
+
def _table_cells(line):
|
|
2082
|
+
"""Cells of a Markdown table row, or None when the line is not one.
|
|
2083
|
+
Separator rows (---, :---:, any alignment colons) are not data."""
|
|
2084
|
+
s = line.strip()
|
|
2085
|
+
if not s.startswith("|"):
|
|
2086
|
+
return None
|
|
2087
|
+
if set(s) <= set("|-: "):
|
|
2088
|
+
return None
|
|
2089
|
+
return [c.strip() for c in s.strip("|").split("|")]
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
def parse_review_log(text):
|
|
2093
|
+
"""-> (rows, unparsed). Columns come from the header when there is one.
|
|
2094
|
+
|
|
2095
|
+
Falls back to the positional maps only for a table with no header, so a
|
|
2096
|
+
hand-kept log still reads. A row whose cell count does not match the
|
|
2097
|
+
header's is unparsed and named -- never dropped."""
|
|
2098
|
+
rows, unparsed, names = [], [], None
|
|
2099
|
+
for n, line in enumerate(text.splitlines(), 1):
|
|
2100
|
+
cells = _table_cells(line)
|
|
2101
|
+
if cells is None:
|
|
2102
|
+
continue
|
|
2103
|
+
lowered = [c.lower() for c in cells]
|
|
2104
|
+
if names is None and "tier" in lowered and "verdict" in lowered:
|
|
2105
|
+
names = lowered # the header IS the column map
|
|
2106
|
+
continue
|
|
2107
|
+
# The header supplies the map -- that is what makes reordered and extra
|
|
2108
|
+
# columns readable. But a log legitimately carries MIXED widths (F-048
|
|
2109
|
+
# widened the schema and did not rewrite history), so a row that does
|
|
2110
|
+
# not match the header is read by the positional map for its own width
|
|
2111
|
+
# before it is given up on. Only a width no map knows is unparsed.
|
|
2112
|
+
if names is not None and len(cells) == len(names):
|
|
2113
|
+
row = dict(zip(names, cells))
|
|
2114
|
+
else:
|
|
2115
|
+
positional = REVIEW_POSITIONAL.get(len(cells))
|
|
2116
|
+
if positional is None:
|
|
2117
|
+
unparsed.append((n, "%d cells: %s" % (
|
|
2118
|
+
len(cells),
|
|
2119
|
+
"header declares %d and no positional map fits"
|
|
2120
|
+
% len(names) if names else "no header, and no map fits")))
|
|
2121
|
+
continue
|
|
2122
|
+
row = dict(zip(positional, cells))
|
|
2123
|
+
missing = [c for c in REVIEW_CORE if c not in row]
|
|
2124
|
+
if missing:
|
|
2125
|
+
unparsed.append((n, "no %s column" % "/".join(missing)))
|
|
2126
|
+
continue
|
|
2127
|
+
if not re.match(r"^\d{4}-\d{2}-\d{2}$", row["date"]):
|
|
2128
|
+
unparsed.append((n, "date cell %r is not a date" % row["date"][:24]))
|
|
2129
|
+
continue
|
|
2130
|
+
rows.append(row)
|
|
2131
|
+
return rows, unparsed
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
def review_findings(value):
|
|
2135
|
+
"""The count in a `findings_real` cell, or None when it states no number.
|
|
2136
|
+
|
|
2137
|
+
None is NOT zero. `all` and `VOID -- instrument error` appear in real logs,
|
|
2138
|
+
and counting them as zero findings silently deflates the one ratio this
|
|
2139
|
+
report exists to state. Anchored at the START of the cell so a prose cell
|
|
2140
|
+
like `R1 4 BLOCK + 8 WARN` does not yield a confident 4."""
|
|
2141
|
+
m = re.match(r"^(\d+)\b", (value or "").strip())
|
|
2142
|
+
return int(m.group(1)) if m else None
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
def _is_fail(verdict):
|
|
2146
|
+
"""FAIL as a WORD, so `PASS (no failures)` is not counted as a failure."""
|
|
2147
|
+
return re.search(r"\bFAIL\b", (verdict or "").upper()) is not None
|
|
2148
|
+
|
|
2149
|
+
|
|
2150
|
+
def _is_pass(verdict):
|
|
2151
|
+
return re.search(r"\bPASS\b", (verdict or "").upper()) is not None
|
|
2152
|
+
|
|
2153
|
+
|
|
2154
|
+
def _print_read_cost():
|
|
2155
|
+
"""The cost side, printed with the benefit and NEVER without it: a catch
|
|
2156
|
+
rate with no cost term justifies unbounded doctrine, and a cost term with
|
|
2157
|
+
no catch rate justifies deleting the process. When it cannot be measured
|
|
2158
|
+
the line still prints, saying so -- silence here IS the catch rate quoted
|
|
2159
|
+
alone, which is the thing this report exists to prevent."""
|
|
2160
|
+
skill_dir = Path(__file__).resolve().parent.parent
|
|
2161
|
+
contract = skill_dir / "SKILL.md"
|
|
2162
|
+
print()
|
|
2163
|
+
if not contract.is_file():
|
|
2164
|
+
print("Read cost: unavailable -- SKILL.md not found beside this "
|
|
2165
|
+
"validator (%s)" % skill_dir)
|
|
2166
|
+
return
|
|
2167
|
+
files = [p for p in sorted(skill_dir.glob("*.md")) if p.name != "SKILL.md"]
|
|
2168
|
+
support = sum(p.stat().st_size for p in files)
|
|
2169
|
+
head = contract.stat().st_size
|
|
2170
|
+
# The TOTAL, and the files itemised. Printing only the two terms lets the
|
|
2171
|
+
# one that fell be quoted while the one that grew stays lumped -- which is
|
|
2172
|
+
# exactly how a -7.8% headline coexisted with a read surface that grew.
|
|
2173
|
+
print("Read cost of %s: SKILL.md %d bytes (every session) + %d bytes "
|
|
2174
|
+
"across %d support files (read on trigger) = %d bytes total"
|
|
2175
|
+
% (skill_dir.name, head, support, len(files), head + support))
|
|
2176
|
+
for p in files:
|
|
2177
|
+
print(" %-24s %8d" % (p.name, p.stat().st_size))
|
|
2178
|
+
|
|
2179
|
+
|
|
2180
|
+
def cmd_benefit(root):
|
|
2181
|
+
"""Report what the process caught, beside what it costs to read.
|
|
2182
|
+
|
|
2183
|
+
ALWAYS exits 0 and emits no warning or advisory. This number is the
|
|
2184
|
+
criterion future units are judged by; a measurement that can fail a build
|
|
2185
|
+
becomes a target, and a targeted measurement stops measuring."""
|
|
2186
|
+
log = root / review_log_rel()
|
|
2187
|
+
print("=== benefit: what the process caught, and what it costs to read ===")
|
|
2188
|
+
if not log.is_file():
|
|
2189
|
+
print("[info] no %s yet: nothing to report. The number appears once "
|
|
2190
|
+
"reviews are logged." % review_log_rel())
|
|
2191
|
+
_print_read_cost()
|
|
2192
|
+
return 0
|
|
2193
|
+
rows, unparsed = parse_review_log(read_text(log))
|
|
2194
|
+
# `tier` carries the MOMENT in Standalone (design / closure) and the
|
|
2195
|
+
# reviewer WEIGHT in Hybrid (deep / light / code / guide / vision). A
|
|
2196
|
+
# Hybrid row is a real review whose moment this column does not state, so
|
|
2197
|
+
# it is counted and named, never folded into a moment by guesswork.
|
|
2198
|
+
moments = {"design": [], "closure": []}
|
|
2199
|
+
unstated = {}
|
|
2200
|
+
unstated_found = unstated_code = unstated_uncounted = 0
|
|
2201
|
+
for r in rows:
|
|
2202
|
+
tier = r["tier"].lower()
|
|
2203
|
+
if tier.startswith("design"):
|
|
2204
|
+
moments["design"].append(r)
|
|
2205
|
+
elif tier.startswith("closure"):
|
|
2206
|
+
moments["closure"].append(r)
|
|
2207
|
+
else:
|
|
2208
|
+
unstated[tier] = unstated.get(tier, 0) + 1
|
|
2209
|
+
n = review_findings(r["findings_real"])
|
|
2210
|
+
if n is None:
|
|
2211
|
+
unstated_uncounted += 1
|
|
2212
|
+
else:
|
|
2213
|
+
unstated_found += n
|
|
2214
|
+
if tier.startswith("code"):
|
|
2215
|
+
unstated_code += n
|
|
2216
|
+
classified = moments["design"] + moments["closure"]
|
|
2217
|
+
print("rows parsed: %d rows unparsed: %d%s"
|
|
2218
|
+
% (len(rows), len(unparsed),
|
|
2219
|
+
(" -> " + "; ".join("line %d: %s" % u for u in unparsed[:5]))
|
|
2220
|
+
if unparsed else ""))
|
|
2221
|
+
print("reviews with a stated moment: %d moment not stated by `tier`: %d%s"
|
|
2222
|
+
% (len(classified), sum(unstated.values()),
|
|
2223
|
+
(" (" + ", ".join("%s x%d" % (t, n) for t, n
|
|
2224
|
+
in sorted(unstated.items())) + ")")
|
|
2225
|
+
if unstated else ""))
|
|
2226
|
+
if not classified:
|
|
2227
|
+
_print_read_cost()
|
|
2228
|
+
return 0
|
|
2229
|
+
dates = sorted(r["date"] for r in classified)
|
|
2230
|
+
print("span of the reviews counted below: %s -> %s" % (dates[0], dates[-1]))
|
|
2231
|
+
|
|
2232
|
+
print()
|
|
2233
|
+
print("%-9s %6s %10s %11s %10s" % ("moment", "rows", "findings",
|
|
2234
|
+
"FAIL verdict", "per review"))
|
|
2235
|
+
totals, uncounted = {}, 0
|
|
2236
|
+
for m in ("design", "closure"):
|
|
2237
|
+
rs = moments[m]
|
|
2238
|
+
counts = [review_findings(r["findings_real"]) for r in rs]
|
|
2239
|
+
uncounted += sum(1 for c in counts if c is None)
|
|
2240
|
+
found = sum(c for c in counts if c is not None)
|
|
2241
|
+
failed = sum(1 for r in rs if _is_fail(r["verdict"]))
|
|
2242
|
+
totals[m] = found
|
|
2243
|
+
print("%-9s %6d %10d %11d %10.1f"
|
|
2244
|
+
% (m, len(rs), found, failed, (found / len(rs)) if rs else 0.0))
|
|
2245
|
+
total = sum(totals.values())
|
|
2246
|
+
if uncounted:
|
|
2247
|
+
print("findings cells stating no number: %d (counted as unknown, "
|
|
2248
|
+
"never as zero)" % uncounted)
|
|
2249
|
+
if total:
|
|
2250
|
+
print()
|
|
2251
|
+
print("Caught BEFORE the code existed: %d / %d findings = %.0f%%"
|
|
2252
|
+
% (totals["design"], total, 100.0 * totals["design"] / total))
|
|
2253
|
+
# The residue, stated as a BOUND rather than as a direction. The
|
|
2254
|
+
# sentence this replaces claimed the share was "a floor, not a
|
|
2255
|
+
# ceiling" because `code` rows are post-implementation -- which is
|
|
2256
|
+
# backwards, since folding them LOWERS the design share. But the fact
|
|
2257
|
+
# was right and only the direction wrong, so `code` findings sit on
|
|
2258
|
+
# the closure side of the upper bound instead of being discarded with
|
|
2259
|
+
# it. No direction is printed at all: the unstated set pushes both
|
|
2260
|
+
# ways, and only an interval is true of all of it.
|
|
2261
|
+
if unstated_found:
|
|
2262
|
+
denom = total + unstated_found
|
|
2263
|
+
print("Bounded by the %d findings in rows whose moment `tier` "
|
|
2264
|
+
"does not state: %.0f%%-%.0f%% (`code` rows are "
|
|
2265
|
+
"post-implementation by definition, so their findings sit "
|
|
2266
|
+
"on the closure side of the upper bound)"
|
|
2267
|
+
% (unstated_found, 100.0 * totals["design"] / denom,
|
|
2268
|
+
100.0 * (totals["design"] + unstated_found - unstated_code)
|
|
2269
|
+
/ denom))
|
|
2270
|
+
if unstated_uncounted:
|
|
2271
|
+
print("%d unstated rows state no findings count (`all`, `VOID`): "
|
|
2272
|
+
"neither zero nor countable, so they lie outside both "
|
|
2273
|
+
"bounds" % unstated_uncounted)
|
|
2274
|
+
failed_all = sum(1 for r in classified if _is_fail(r["verdict"]))
|
|
2275
|
+
inconclusive = sum(1 for r in classified if not _is_fail(r["verdict"])
|
|
2276
|
+
and not _is_pass(r["verdict"]))
|
|
2277
|
+
print("Reviews whose verdict contains FAIL: %d / %d = %.0f%%%s"
|
|
2278
|
+
% (failed_all, len(classified), 100.0 * failed_all / len(classified),
|
|
2279
|
+
(" (+%d inconclusive)" % inconclusive) if inconclusive else ""))
|
|
2280
|
+
print("(both figures are over the %d reviews whose moment `tier` states)"
|
|
2281
|
+
% len(classified))
|
|
2282
|
+
_print_read_cost()
|
|
2283
|
+
return 0
|
|
2284
|
+
|
|
2285
|
+
|
|
2055
2286
|
def cmd_orient(args):
|
|
2056
2287
|
"""SessionStart hook: emit a bounded, repo-sourced ai_docs/ orientation to
|
|
2057
2288
|
stdout and ALWAYS return 0 (fail-open, P-TM T8) -- a session hook must never
|
|
@@ -2315,6 +2546,11 @@ def main(argv=None):
|
|
|
2315
2546
|
gp.add_argument("--file", help="file path to evaluate (alternative to --hook)")
|
|
2316
2547
|
gp.add_argument("--protected", default="", help="protected prefixes separated by ';' (e.g. \"src/auth;src/crypto\")")
|
|
2317
2548
|
|
|
2549
|
+
sub.add_parser("benefit", parents=[common],
|
|
2550
|
+
help="report what the review gates caught (and what the "
|
|
2551
|
+
"doctrine costs to read) -- a report, never a gate: "
|
|
2552
|
+
"always exits 0")
|
|
2553
|
+
|
|
2318
2554
|
sub.add_parser("orient", parents=[common, hybrid_opt],
|
|
2319
2555
|
help="SessionStart hook: emit docs-root orientation to stdout (fail-open, zero-execution)")
|
|
2320
2556
|
|
|
@@ -2374,6 +2610,8 @@ def main(argv=None):
|
|
|
2374
2610
|
return cmd_stale(root, hybrid=args.hybrid)
|
|
2375
2611
|
if args.cmd == "mark":
|
|
2376
2612
|
return cmd_mark(root, args.paths)
|
|
2613
|
+
if args.cmd == "benefit":
|
|
2614
|
+
return cmd_benefit(root)
|
|
2377
2615
|
if args.cmd == "migrate":
|
|
2378
2616
|
return cmd_migrate(root, args)
|
|
2379
2617
|
if args.cmd == "plan":
|
|
@@ -499,16 +499,18 @@ Date: 2026-06-11 (UTC)
|
|
|
499
499
|
|
|
500
500
|
One row per completed review (`review.md` §When a review is due). Append-only; it
|
|
501
501
|
is the record that the gate ran and what it was worth. **One schema for both
|
|
502
|
-
modes** —
|
|
503
|
-
|
|
502
|
+
modes** — one required CORE (`date`, `doc_key`, `tier`, `model`, `findings_raised`,
|
|
503
|
+
`findings_real`, `verdict`, `revise_rounds`) plus each mode's own realization
|
|
504
|
+
columns: Standalone adds `reviewer`, a Hybrid devPNT row adds `instrument` and
|
|
505
|
+
`notes` and carries no `reviewer` at all. Both modes write this same file.
|
|
504
506
|
|
|
505
507
|
```markdown
|
|
506
508
|
# Independent Review Log
|
|
507
509
|
|
|
508
|
-
| date | doc_key | tier | reviewer | findings_raised | findings_real | verdict | revise_rounds |
|
|
509
|
-
|
|
510
|
-
| 2026-06-11 | ANALYSIS_login_sso.md | design | subagent (
|
|
511
|
-
| 2026-06-12 | diff feature/sso-login | closure | self-pass (declared; absent) | 2 | 2 | PASS with findings → corrections re-reviewed, PASS | 2 |
|
|
510
|
+
| date | doc_key | tier | model | reviewer | findings_raised | findings_real | verdict | revise_rounds |
|
|
511
|
+
|---|---|---|---|---|---|---|---|---|
|
|
512
|
+
| 2026-06-11 | ANALYSIS_login_sso.md | design | deep | subagent (fresh ctx) | 4 | 3 | FAIL → PASS | 2 |
|
|
513
|
+
| 2026-06-12 | diff feature/sso-login | closure | deep | self-pass (declared; absent) | 2 | 2 | PASS with findings → corrections re-reviewed, PASS | 2 |
|
|
512
514
|
|
|
513
515
|
## Notes
|
|
514
516
|
<!-- One short paragraph per review that found something worth remembering: what
|
|
@@ -520,9 +522,14 @@ adds values to the existing columns rather than a second table.
|
|
|
520
522
|
|
|
521
523
|
`tier` is the moment plus, in Hybrid, the reviewer weight: `design`, `design (late)`
|
|
522
524
|
and `closure` (Standalone); `deep`, `light`, `code`, `guide`, `vision` (devPNT gates
|
|
523
|
-
and the Vision blind check).
|
|
525
|
+
and the Vision blind check). `model` is a different question about the same review: `tier` says WHICH GATE ran,
|
|
526
|
+
`model` says WHAT CAPABILITY ran it (`deep`, `light`, `economy`,
|
|
527
|
+
`single (client exposes no choice)`, `below floor: <reason>` — the floor and its
|
|
528
|
+
arbitration are `review.md` §The capability floor). The two columns share the words
|
|
529
|
+
`deep`/`light` and mean different things by them, which is why they are read by
|
|
530
|
+
header and never by position. The validator reads this column by its header name, so
|
|
524
531
|
extra or reordered columns are fine — but the header must say `tier`. `reviewer`
|
|
525
|
-
records the realization actually used — fresh subagent, one-shot client run, or a
|
|
532
|
+
also carries the AUTHORING session's own below-floor disclosure where one is owed (the log has no column for the authoring tier, so `review.md` §The capability floor routes it here; Hybrid rows use `notes`). Otherwise it records the realization actually used — fresh subagent, one-shot client run, or a
|
|
526
533
|
**declared** self-pass — and, for any rung below rung 1, WHY the rung(s) above did
|
|
527
534
|
not run, in the ladder's reason words (`review.md`): `absent` — the client has no
|
|
528
535
|
such facility (a claim about the client, never about a policy); `gated, declined` —
|