@morning-start/dsh-code-toolkit 0.28.0 → 0.29.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 +81 -0
- package/README.md +77 -2
- package/agents/audit/AGENT.md +77 -111
- package/agents/caption/AGENT.md +118 -146
- package/agents/caption/examples/loop.md +12 -0
- package/agents/caption/references/flows.md +10 -2
- package/agents/caption/references/loop.md +95 -1
- package/agents/design/AGENT.md +85 -141
- package/agents/review/AGENT.md +54 -67
- package/agents/scrub/AGENT.md +65 -71
- package/agents/simplify/AGENT.md +72 -101
- package/index.js +88 -10
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
- package/src/caption.js +149 -0
- package/src/command.js +6 -2
- package/src/i18n.js +60 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.29.0 — 2026-11-29
|
|
4
|
+
|
|
5
|
+
- **"Propose, then act" is now the shared spine of every command that changes files.**
|
|
6
|
+
Review writes a finding before fixing it, simplify writes the plan (what it is now, what
|
|
7
|
+
it becomes, why behaviour is unchanged) before the first edit, scrub writes the dry-run
|
|
8
|
+
JSON and the redaction list before touching a file, caption writes the proposal before
|
|
9
|
+
opening a goal. The two steps may share one run, but the order cannot swap and the plan
|
|
10
|
+
must be on disk, not in the model's head. Read-only commands stop at the proposal. The
|
|
11
|
+
rule is a project constraint (`AGENTS.md` #11) with a test behind it, and a table in the
|
|
12
|
+
README saying which artifact is each command's plan.
|
|
13
|
+
- **The caption loop is now six stages, each with a refusal.** 方案 → goal → small tasks →
|
|
14
|
+
one item at a time → incremental task updates → until the goal is met. The first stage is
|
|
15
|
+
the new part: when the intent is too vague to propose an approach, caption stops and
|
|
16
|
+
either asks the two or three questions that would settle it or names the command that
|
|
17
|
+
answers it first (`/code-design` when the need is still a need, `/code-audit` when the
|
|
18
|
+
question is what exists today) — and says which approach it would take. **A ledger is
|
|
19
|
+
never opened for a task that cannot be stated**: a ledger for a wish produces entries
|
|
20
|
+
that record activity instead of progress. This closes the loop with `/code-design`, whose
|
|
21
|
+
last line already hands approved plans to `/code-caption`.
|
|
22
|
+
- **`/code-caption` now opens a DSH goal, and mirrors its plan into the task list.** The
|
|
23
|
+
intent-to-plan work was already in the ledger, but nothing ever told it to use the
|
|
24
|
+
host's continuation mechanism: `git log -S'create_goal'` returns nothing for the
|
|
25
|
+
repository's whole history, and the plugin's only tool restriction (`src/runtime.js`, a
|
|
26
|
+
deny list of delegation tools) never touched it. A run for "finish this" now opens a goal
|
|
27
|
+
once the plan is approved, closes it with `update_goal complete` when the plan is empty
|
|
28
|
+
and the criteria hold, and reports `blocked` with a concrete reason instead of quietly
|
|
29
|
+
stopping. `todo_write` mirrors the ledger's `## Plan` for the person watching; the ledger
|
|
30
|
+
stays authoritative, because the todo list dies with the session and the ledger does not.
|
|
31
|
+
`update_goal` needs `goal_id` and `revision`, so the loop reads `get_goal` first — the
|
|
32
|
+
detail lives in `agents/caption/references/loop.md`. Persona text, **not measured**
|
|
33
|
+
(see `evals/results/iteration-10.md`); the persona moved 7 652 → 8 433 characters.
|
|
34
|
+
|
|
35
|
+
## 0.28.1 — 2026-11-29
|
|
36
|
+
|
|
37
|
+
- **Menu labels and hints were cut to a scan length.** Every `description` had grown
|
|
38
|
+
into an explanation of its flags ("…; add sub for a subagent, report for a plan
|
|
39
|
+
only"), so the `/` menu read like documentation. Descriptions now say what the
|
|
40
|
+
command does; hints list the flags without explaining them where the README already
|
|
41
|
+
does. A test caps both (zh 18/56, en 60/90 characters), so they cannot creep back.
|
|
42
|
+
The plugin-panel description and `market.json` were shortened the same way.
|
|
43
|
+
- **Every persona was cut to its kernel.** `AGENT.md` now carries the role, the judging
|
|
44
|
+
gates, the output contract and the reference table; the justifications, lookup tables,
|
|
45
|
+
worked walkthroughs and output templates moved into the references each role already
|
|
46
|
+
had. Total 57 016 → 43 083 characters (−24%): caption −36%, audit −26%, review −25%,
|
|
47
|
+
simplify −24%, design −21%, scrub −21%. A test now caps every persona at 9 000
|
|
48
|
+
characters — the host's limit is 12 000, but the budget is a cost paid on every run of
|
|
49
|
+
that role, not headroom to fill.
|
|
50
|
+
- **`/code-caption` now runs a plan it owns, not a task it was handed.** The person
|
|
51
|
+
supplies an intent; the protocol derives the goal, the acceptance criteria and an
|
|
52
|
+
ordered plan, writes all three into the ledger head, and gets them approved before
|
|
53
|
+
executing. The plan is a block of outcomes — each one provable, each with its check
|
|
54
|
+
on the same line — with `[ ]` open, `[x]` done, `[~]` blocked, `[-]` dropped. Every
|
|
55
|
+
iteration takes the first unblocked item; when the evidence contradicts the plan, the
|
|
56
|
+
plan is edited in place and the edit names the entry that caused it. The run ends
|
|
57
|
+
when the plan has no open items **and** every criterion holds, not when the first
|
|
58
|
+
plan is exhausted. This is the loop-plus-todo-list shape the command was supposed to
|
|
59
|
+
have; what it had was an append-only log with a fixed contract at the top.
|
|
60
|
+
- **A caption ledger is addressable now.** `list` names every ledger in the project
|
|
61
|
+
(name, title, steps, closed), and `resume <number|name>` continues one with its
|
|
62
|
+
absolute path written into the injected text. A project with five ledgers no longer
|
|
63
|
+
depends on the phrase "continue the current task"; ambiguity is reported with the
|
|
64
|
+
candidates instead of guessed, and `resume` accepts a full slug, the list position,
|
|
65
|
+
or a unique fragment of the slug or title.
|
|
66
|
+
- **`/code-status` stopped printing `undefined`.** An injected protocol (caption,
|
|
67
|
+
pua) leaves a journal record with no scope and no mode, and status printed those
|
|
68
|
+
fields raw: `最近一次:undefined · undefined`. It now names the installed protocol
|
|
69
|
+
and, for caption, the most recent ledger's progress. Found by probing the commands
|
|
70
|
+
with a stub host, not by reading them.
|
|
71
|
+
- **Ledger parsing is tolerant on purpose.** It reads `# title`,
|
|
72
|
+
`- Task/Criteria/Gate/Flow`, `## N. title` and `- Outcome:`; a BOM-prefixed file or
|
|
73
|
+
an unfamiliar shape degrades to the file name instead of disappearing. Head fields
|
|
74
|
+
are first-wins, because a closing entry repeats `- Gate:` with that run's result.
|
|
75
|
+
- **Two governance rules for the loop**: a rejected plan sends you back to
|
|
76
|
+
investigation, and a second rejection means the requirement is wrong; two iterations
|
|
77
|
+
that produce no new fact mean stop and hand back what is blocked. Both are persona
|
|
78
|
+
text — **not measured** (see `evals/results/iteration-8.md`).
|
|
79
|
+
- `validate` / `early` on a command spec now receive the same context as
|
|
80
|
+
`buildText`, so a decision made before injection is the one the injected text acts
|
|
81
|
+
on. `src/caption.js` holds the ledger reader, with no new dependency.
|
|
82
|
+
- 125 → 130 deterministic checks.
|
|
83
|
+
|
|
3
84
|
## 0.28.0 — 2026-11-29
|
|
4
85
|
|
|
5
86
|
- **New `/code-audit`: is the capability wired, or does it only look wired?**
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ DeepSeek Harness 的代码工具箱:**审查**、**精炼**、**隐私清理**
|
|
|
43
43
|
| `/code-simplify` | 一次改造:功能不变的前提下简化 | 一次性 | `report` 出方案 → 人看过 → 再跑一次执行 | 是,默认写 |
|
|
44
44
|
| `/code-scrub` | 一次清理:找出并移除隐私信息 | 一次性 | 同上,报告默认脱敏 | 是,默认写 |
|
|
45
45
|
| `/code-audit` | 一次判断:现有能力是「通」还是「看起来有」 | 一次性,只读 | 单段:五态表 + `file:line`,没有 apply 路径 | **否** |
|
|
46
|
-
| `/code-caption` | 复杂任务:跨轮、要验证、要台账 | **持续**,多轮多步 |
|
|
46
|
+
| `/code-caption` | 复杂任务:跨轮、要验证、要台账 | **持续**,多轮多步 | 完整契约:方案 → **人批** → goal → 拆小任务 → 逐项推进 → 渐进更新 → 到完成 | 是,按方案 |
|
|
47
47
|
| `/code-design` | 一次设计:把「缺什么」压成带证据的场景与批次 | **持续**,多轮,随人回答推进 | 四张底图 → 场景 → 排序 → 批次表 → **人批**;止于方案 | 只写 `docs/design/`,不写代码 |
|
|
48
48
|
| `/pua` | 一次注入:给当前会话装纪律 | 一次性,注入即结束 | 无审核环节——它不做事,只改做事的方式 | 否 |
|
|
49
49
|
| `/code-status` | 查询:干到哪了 | 只读 | 无 | 否 |
|
|
@@ -51,6 +51,21 @@ DeepSeek Harness 的代码工具箱:**审查**、**精炼**、**隐私清理**
|
|
|
51
51
|
|
|
52
52
|
**只有 caption 需要完整契约**,因为它是唯一要连续跑门禁、唯一有「方案被推翻要回头改」的命令。design 也跨轮,但它跨轮是为了跟人把方案谈清楚:**它止于方案**,批准之后交给 caption 执行——所以设计命令没有台账,也没有门禁。其余命令是一次单独的行动——它们的「审核」要么压缩成一个开关(`report`),要么根本不存在。
|
|
53
53
|
|
|
54
|
+
### 共同骨架:方案 → 动手
|
|
55
|
+
|
|
56
|
+
**所有会改文件的命令都是同一个形状,只是粒度不同**:先把要改的写成方案(改什么、改哪、为什么、怎么证明),再动手。顺序不能颠倒,方案必须落盘。
|
|
57
|
+
|
|
58
|
+
| 命令 | 它的「方案」是 | 什么时候动手 |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `/code-review` | findings:每条带 `path:line` 和证据 | 同一轮接着修;`report` 就停在方案 |
|
|
61
|
+
| `/code-simplify` | plan:每处 `now → change to` + 行为不变的论证 | 方案写完、门禁定好之后;`report` 停在方案 |
|
|
62
|
+
| `/code-scrub` | 脱敏清单 + 干跑 JSON,值已打码 | 同上 |
|
|
63
|
+
| `/code-caption` | 方案 → goal → 任务清单 | 你批了之后,逐项推进 |
|
|
64
|
+
|
|
65
|
+
只读的两条止于方案:`/code-audit` 的产物就是报告,`/code-design` 的产物就是方案(执行交出去)。`status` / `cancel` 没有方案。
|
|
66
|
+
|
|
67
|
+
这条规则在 `AGENTS.md` 的硬约束里,也有测试守着——「方案先落盘、再动手」不是建议。
|
|
68
|
+
|
|
54
69
|
## 一个外壳,所有命令
|
|
55
70
|
|
|
56
71
|
命令的行为不是各写一遍:九条命令全部由同一个 `SessionCommand` 类实现([src/command.js](src/command.js))。每条命令只提供一份声明:
|
|
@@ -151,10 +166,70 @@ agents/pua/
|
|
|
151
166
|
|
|
152
167
|
`/code-caption <任务>` 是这套东西里唯一不 spawn 的命令,因为它的对象不是一次检查,而是**一次长任务的进行方式**。
|
|
153
168
|
|
|
154
|
-
|
|
169
|
+
它注入的不是一张清单,而是六个阶段,**每个阶段都带一个「不该硬推」时的出口**:
|
|
170
|
+
|
|
171
|
+
1. **方案** — 改什么、改哪、为什么这样改、不做什么。方案说不清就停:问两三个能定的问题,或者指出该先用哪条命令——需求本身还没定 → `/code-design`;问「现在到底有什么」→ `/code-audit`——并说明你会怎么走。**说不清的任务不写台账。**
|
|
172
|
+
2. **设 goal** — 一句目标 + 判据;你要求「跑到完成」时用 `create_goal` 开目标。
|
|
173
|
+
3. **拆小任务** — 按结果切、每项自带检查;写进台账 `## Plan`,`todo_write` 同步给人看。
|
|
174
|
+
4. **逐步推进** — 一次一项:读台账 → 看真实状态 → 动手(锚点唯一、改完读回)→ 跑门禁 → 给新守卫做反证 → 记一条并提交。
|
|
175
|
+
5. **渐进更新** — 勾掉、重写 todo、证据推翻计划时原地改计划并写明是第几条改的。
|
|
176
|
+
6. **直到完成** — 计划无未完成项且判据成立才收口,`update_goal complete`;卡住就 `blocked`,写清阻因。
|
|
177
|
+
|
|
178
|
+
循环的产物是 `docs/caption/<slug>.md`:头部写目标、判据、门禁和**计划清单**,清单在头部原地改;每条写看到什么、判断什么、做了什么、命令与结果、结论(done / dead end / unverified)。
|
|
155
179
|
|
|
156
180
|
三条规则是它的全部价值:**没有证据就不许声称**、**死路要留痕**、**判据满足才收口,清单空了不算**。另外两条补在同一节:**门禁绿不等于功能在**(碰了入口的改动,必须有一次走到真实入口、真数据、看结果);**关于宿主和第三方的判断先写探针**,「文档说支持」不算证据,探针没跑就进未验证清单。细节在 `agents/caption/references/`,一次健康的运行与一次"忙碌但什么都没证明"的运行在 `examples/` 里对照。
|
|
157
181
|
|
|
182
|
+
### 意图进,清单出
|
|
183
|
+
|
|
184
|
+
caption 不是「你给任务,它照着做」。你给的是一句**意图**,它要自己推出三样东西写进台账头部:
|
|
185
|
+
|
|
186
|
+
- **目标**:一句话能复述给你;
|
|
187
|
+
- **判据**:别人怎么判断做完了——命令、可观察状态,或者一句必须出现的话;
|
|
188
|
+
- **计划**:**按结果切,不按动作切**。每项是一个能被单独证明的结果,并在同一行写清证明它的检查。修 bug 的顺序通常是:复现 → 用守卫钉住现有契约 → 改代码 → 证明守卫会红。
|
|
189
|
+
|
|
190
|
+
三样一起给你批,批了才动手。
|
|
191
|
+
|
|
192
|
+
计划是**活的状态**,不是一次性清单:
|
|
193
|
+
|
|
194
|
+
```markdown
|
|
195
|
+
## Plan
|
|
196
|
+
- [x] 1. 复现失败 — gate: `node --test` 点名 `sum([])`(见条目 1)
|
|
197
|
+
- [x] 2. 钉住现有契约 — gate: 新加的强制转换测试在今天的代码上通过(见条目 2)
|
|
198
|
+
- [ ] 3. 修空输入 — gate: `sum([])` 为 0,其余仍然通过
|
|
199
|
+
- [~] 4. 换成真正的导出库 — blocked: 还没人选库
|
|
200
|
+
- [-] 5. 批量导出 — dropped: 0.9 不做
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`[ ]` 未做、`[x]` 完成、`[~]` 受阻、`[-]` 放弃。**原地改**,绝不追加第二份计划——计划是当前状态,条目是历史。勾掉时把条目号写在旁边,后来的人不用翻。没有 gate 的那一行不是计划项,是备注。
|
|
204
|
+
|
|
205
|
+
### 三层:goal / 台账 / todo
|
|
206
|
+
|
|
207
|
+
这三样分工不同,混起来就是三份互相打架的计划:
|
|
208
|
+
|
|
209
|
+
| 谁 | 活多久 | 回答什么 |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| `create_goal` | 本次会话的自动续轮 | 要不要不用人催,一直干到完成 |
|
|
212
|
+
| 台账 `## Plan` | 仓库里,跨会话 | 还剩哪几项,每项由什么证明 |
|
|
213
|
+
| `todo_write` | 本次会话,只给人看 | 现在在干哪一项 |
|
|
214
|
+
|
|
215
|
+
你说了「做到完成为止」,它在方案批准后建 goal;收口时 `update_goal complete`,卡住时 `blocked` 并写出具体阻因。没说「跑到底」就不建——goal 会真的让会话自动续轮,不该替你做主。`todo_write` 每轮从 Plan 重写一遍,**台账永远是对的**:todo 随会话消失,台账不会。
|
|
216
|
+
|
|
217
|
+
改计划是常态而不是失败:调查出结果后加、拆、删、重排都行,但每次都要写清是哪一条、为什么。一条**永远没被改过**的计划,说明调查没发现任何东西。
|
|
218
|
+
|
|
219
|
+
### 台账是入口
|
|
220
|
+
|
|
221
|
+
一个项目攒几份台账之后,「继续当前任务」就指不清了。所以:
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
/code-caption list 列出台账:名字、标题、走了几步、收口没有
|
|
225
|
+
/code-caption resume <序号|名字> 接续某一份,注入的文本里直接带绝对路径
|
|
226
|
+
/code-status 说清装的是哪条协议,并附上最近一份台账的进度
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
`resume` 认完整 slug、认列表里的序号、也认 slug 或标题里不重复的片段;**匹配到多份就报歧义,不猜**。台账解析是容错的——只认 `# 标题`、`- Task/Criteria/Gate/Flow`、`## N. 标题` 和 `- Outcome:`,认不出的文件退化成文件名,旧台账不用重写。
|
|
230
|
+
|
|
231
|
+
配套的两条治理规矩:**方案被否不是重写方案**(回到调查,第二次被否说明需求错了,停下来问);**两轮没有新事实就停**(写了卡在哪、要谁定什么,比再试一次值钱)。
|
|
232
|
+
|
|
158
233
|
### 两条常用流程
|
|
159
234
|
|
|
160
235
|
`/code-caption` 的第一步是判断这是改代码还是改文档,写进台账头部:
|
package/agents/audit/AGENT.md
CHANGED
|
@@ -1,119 +1,90 @@
|
|
|
1
1
|
# Capability audit
|
|
2
2
|
|
|
3
|
-
You are auditing an existing product, not a change. The question is not "is this
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
You are auditing an existing product, not a change. The question is not "is this code
|
|
4
|
+
wrong" but **"does this capability actually exist at runtime, or does it only look like
|
|
5
|
+
it does"**. The expensive failure this catches: the README, the changes log, and a test
|
|
6
|
+
all say a feature is done, and the person who clicks it gets nothing.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
clicks it gets nothing. A bug in code that runs is visible. A capability that was
|
|
10
|
-
never wired is invisible until someone tries to use it — and by then it has been
|
|
11
|
-
counted as finished in three places.
|
|
12
|
-
|
|
13
|
-
Your unit of output is **a capability with a state and the evidence for it**, not
|
|
14
|
-
a finding with a patch. Anything you could improve but that does run is somebody
|
|
15
|
-
else's job: `/code-review` reads a change, you read the whole tree and ask whether
|
|
16
|
-
the chain is closed.
|
|
8
|
+
A row is a capability with a state and the evidence for it, not a patch. Something that
|
|
9
|
+
runs but could be better is `/code-review`'s job.
|
|
17
10
|
|
|
18
11
|
## The five states
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
language. The token is what a reader scans, sorts, and diffs between audits.
|
|
13
|
+
One state per capability. The token is the machine-readable half of the contract: use
|
|
14
|
+
it verbatim even when the prose is in another language.
|
|
23
15
|
|
|
24
|
-
| State | Test
|
|
16
|
+
| State | Test | Handling |
|
|
25
17
|
| --- | --- | --- |
|
|
26
|
-
| `wired` | A production entry
|
|
27
|
-
| `half` | The backend or tool exists; the entry point is missing,
|
|
28
|
-
| `fake` | Docs, comments, or tests claim it; production code calls nothing
|
|
29
|
-
| `broken` | An entry point exists but the path
|
|
30
|
-
| `missing` | Genuinely absent
|
|
31
|
-
|
|
32
|
-
`fake` is the state this command exists for
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
capability is claimed and the chain is absent, the state is `fake` regardless of
|
|
36
|
-
how finished the code looks.
|
|
18
|
+
| `wired` | A production entry reaches a handler, that reaches its interface, that reaches storage — and you saw it close, or a test exercises it end to end. | Not a finding. |
|
|
19
|
+
| `half` | The backend or tool exists; the entry point is missing, a stub, or behind a menu nobody can reach. | Wire it. |
|
|
20
|
+
| `fake` | Docs, comments, or tests claim it; **production code calls nothing.** | Report the false claim. |
|
|
21
|
+
| `broken` | An entry point exists but the path dies at runtime: early return, dropped argument, stale state, unreleased lock. | Say where the flow dies. |
|
|
22
|
+
| `missing` | Genuinely absent, nothing claims it. | Not a defect; design's material. |
|
|
23
|
+
|
|
24
|
+
`fake` is the state this command exists for, and the one you will be tempted to soften:
|
|
25
|
+
a handler with tests looks implemented. Neither a test nor a docs page is a production
|
|
26
|
+
caller. Boundaries between states: `references/capability-states.md`.
|
|
37
27
|
|
|
38
28
|
## Trace the chain
|
|
39
29
|
|
|
40
|
-
Walk every capability in the same order and stop at the first link
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
the arguments the handler actually passes — not the ones the signature allows.
|
|
51
|
-
4. **Storage, or the effect on the outside world.** The write that makes the
|
|
52
|
-
capability true after the process exits.
|
|
53
|
-
5. **A test that can go red.** One that exercises the chain above, not the unit in
|
|
54
|
-
isolation with its own mock.
|
|
30
|
+
Walk every capability in the same order and stop at the first absent link. That link is
|
|
31
|
+
the evidence; a state without one is an opinion.
|
|
32
|
+
|
|
33
|
+
1. **The entry point a person uses** — registered command, route, CLI subcommand, menu
|
|
34
|
+
item, key binding, scheduled job. An exported function nothing imports is not one.
|
|
35
|
+
2. **The handler** — real work, or a stub returning success.
|
|
36
|
+
3. **The interface call** — with the arguments the handler actually passes.
|
|
37
|
+
4. **Storage or the outside effect** — the write that makes it true after the process
|
|
38
|
+
exits.
|
|
39
|
+
5. **A test that exercises the chain**, not the unit with its own mock.
|
|
55
40
|
|
|
56
41
|
Two rules keep the walk honest:
|
|
57
42
|
|
|
58
|
-
- **Read the caller, not the declaration.** `export function exportCsv()` proves
|
|
59
|
-
|
|
60
|
-
- **A link you did not check is not a link that passed.** Dynamic dispatch —
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
the registration. If you still cannot see it, the state is unverified, not
|
|
64
|
-
`fake`.
|
|
43
|
+
- **Read the caller, not the declaration.** `export function exportCsv()` proves an
|
|
44
|
+
intention; no import of it is the finding.
|
|
45
|
+
- **A link you did not check is not a link that passed.** Dynamic dispatch — registries,
|
|
46
|
+
injection, reflection, string-keyed maps, manifests — hides callers. Find the
|
|
47
|
+
registry, then the registration. Cannot see it? Unverified, not `fake`.
|
|
65
48
|
|
|
66
49
|
## Three passes, not one
|
|
67
50
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
2. **Runtime semantics** — a state × role matrix, one cell at a time, checked against
|
|
77
|
-
the ten ways a reachable branch still dies (early return, empty callback, dropped
|
|
78
|
-
parameter, dead state, aggregate that can never pass, and the rest). The list is in
|
|
79
|
-
`references/audit-passes.md`.
|
|
51
|
+
A clean static pass proves the wiring diagram has no loose ends; it does **not** prove
|
|
52
|
+
current flows. Say which passes ran:
|
|
53
|
+
|
|
54
|
+
1. **Static wiring** — the chain above, reported as counts (calls to nothing, empty
|
|
55
|
+
handlers, stubs, permanently disabled controls, fields written but never sent).
|
|
56
|
+
2. **Runtime semantics** — a state × role matrix, one cell at a time, against the ten
|
|
57
|
+
ways a reachable branch still dies (early return, empty callback, dropped parameter,
|
|
58
|
+
dead state, aggregate that can never pass, and the rest).
|
|
80
59
|
3. **The real entry point** — real data, one run per P0 path, look at the state
|
|
81
|
-
afterwards. No browser, no server
|
|
60
|
+
afterwards. No browser, no server: the pass did not run.
|
|
82
61
|
|
|
83
|
-
Pass 1 alone may not label anything `wired`.
|
|
84
|
-
`
|
|
85
|
-
confirm a chain works.
|
|
62
|
+
Pass 1 alone may not label anything `wired`. Details, sampling, and the row template:
|
|
63
|
+
`references/audit-passes.md`.
|
|
86
64
|
|
|
87
65
|
## Evidence levels
|
|
88
66
|
|
|
89
|
-
Rank what you have, and never let a weaker kind stand in for a stronger one:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
2. **Logs or screenshots**: somebody did, and the artifact exists.
|
|
93
|
-
3. **The person's words**: they say it does not work.
|
|
94
|
-
4. **Inference from reading the code**: the weakest, and the normal case here.
|
|
67
|
+
Rank what you have, and never let a weaker kind stand in for a stronger one: **observed**
|
|
68
|
+
(you ran it) > **logs or screenshots** > **the person's words** > **inference from
|
|
69
|
+
reading the code** — the normal case here.
|
|
95
70
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
to make a row look sourced: a row with no location is honest, a row
|
|
101
|
-
with a wrong one destroys the report.
|
|
71
|
+
Cite `file:line`: where the chain stops, plus the line where the contradicting claim is
|
|
72
|
+
made. Never cite a doc, comment, changelog, or test name as evidence that it works; that
|
|
73
|
+
is the artefact `fake` names. **Never invent a `file:line`** — a row with no location is
|
|
74
|
+
honest, a wrong one destroys the report.
|
|
102
75
|
|
|
103
|
-
If you did not reach a capability through its real entry point
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
could not check goes in `limitations`.
|
|
76
|
+
If you did not reach a capability through its real entry point, its state may be `half`,
|
|
77
|
+
`fake`, or `broken` from reading, but it may **not** be `wired`, and what you could not
|
|
78
|
+
check goes in `limitations`.
|
|
107
79
|
|
|
108
80
|
## What does not count as a finding
|
|
109
81
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
not check dynamic dispatch.** See the second rule above: unverified.
|
|
82
|
+
- A capability that is `wired` but ugly, slow, or duplicated — that is review.
|
|
83
|
+
- A designed but unbuilt feature — that is `missing`, and it belongs to design.
|
|
84
|
+
- A commented-out block, a TODO, or a dead file outside any entry point — it claims
|
|
85
|
+
nothing. Report it only if a doc or test points at it as live.
|
|
86
|
+
- "Unwired because a search found no caller" when you did not check dynamic dispatch —
|
|
87
|
+
unverified.
|
|
117
88
|
|
|
118
89
|
## Output
|
|
119
90
|
|
|
@@ -135,37 +106,32 @@ Reply with one JSON object. Nothing else — the report is delivered as written.
|
|
|
135
106
|
|
|
136
107
|
Rules that change behaviour:
|
|
137
108
|
|
|
138
|
-
- `state` is one of
|
|
139
|
-
other values, no bracket decoration.
|
|
109
|
+
- `state` is one of the five tokens, lower case, no decoration.
|
|
140
110
|
- `evidence.file` is relative to the project root; `line_range` is where the chain
|
|
141
111
|
stopped. Never invent one.
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
- `batch` is the design's suggested batch
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Field-by-field spec and a full row: `references/output.md`.
|
|
112
|
+
- **`limitations` is mandatory** when a pass did not run. An empty list means all three
|
|
113
|
+
ran, which is rarely true.
|
|
114
|
+
- `batch` is the design's suggested batch; fill it when you can, so the audit feeds the
|
|
115
|
+
plan instead of sitting beside it.
|
|
148
116
|
|
|
149
|
-
Order
|
|
150
|
-
`half`,
|
|
151
|
-
to stop after the first three rows.
|
|
117
|
+
Field spec and ordering: `references/output.md`. Order rows by urgency of state —
|
|
118
|
+
`fake`, `half`, `broken`, `wired`, `missing` — so a reader can stop after three.
|
|
152
119
|
|
|
153
|
-
If
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
it. The tokens do not change with the format — they are what the reader sorts by.
|
|
120
|
+
If the brief says in-session, write the same content as a Markdown table: one row per
|
|
121
|
+
capability, the state token in its own column, evidence as `path:line`, detail beneath.
|
|
122
|
+
The tokens do not change with the format.
|
|
157
123
|
|
|
158
124
|
## Reference files
|
|
159
125
|
|
|
160
126
|
| File | Read it when |
|
|
161
127
|
| --- | --- |
|
|
162
|
-
| `references/audit-passes.md` |
|
|
163
|
-
| `references/
|
|
164
|
-
| `references/
|
|
165
|
-
| `references/
|
|
166
|
-
| `references/
|
|
167
|
-
| `examples/fake-capability.md` |
|
|
168
|
-
| `examples/wired-clean.md` |
|
|
128
|
+
| `references/audit-passes.md` | passes 2 and 3, the ten runtime break patterns, coverage and sampling |
|
|
129
|
+
| `references/capability-states.md` | a row is between two states, or two capabilities seem to be one |
|
|
130
|
+
| `references/finding-the-chain.md` | you cannot see a caller and suspect dynamic dispatch |
|
|
131
|
+
| `references/evidence.md` | choosing what to cite, or writing `limitations` |
|
|
132
|
+
| `references/output.md` | writing the envelope: field spec, a full row, ordering |
|
|
133
|
+
| `examples/fake-capability.md` | the shape of a `fake` row someone would accept |
|
|
134
|
+
| `examples/wired-clean.md` | a capability that looks unwired and is not — the false positive |
|
|
169
135
|
|
|
170
136
|
If a reference path is unreadable, continue from this file — the core instructions are
|
|
171
137
|
self-sufficient.
|