@cyning/harness 2.9.0 → 2.11.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 +35 -0
- package/docs/ONBOARDING.md +15 -2
- package/docs/USER_GUIDE_v1.0_zh.md +8 -2
- package/docs/rethink/2026-07-mechanization-rate/03_coverage_matrix.md +4 -2
- package/docs/rethink/2026-07-mechanization-rate/04_next_steps.md +4 -3
- package/docs/spec/SPEC-discipline-coverage-yaml_v1.md +204 -0
- package/docs/spec/SPEC-discipline-show_v1.md +89 -0
- package/docs/spec/SPEC-lifecycle-engine-min_v1.md +246 -0
- package/docs/spec/SPEC-lifecycle-guard-expand_v1.md +100 -0
- package/docs/spec/SPEC-post-g4-debt-retro_v1.md +237 -0
- package/docs/spec/SPEC-verify-full-reviews-gate_v1.md +1 -1
- package/harness/discipline-coverage.yaml +289 -0
- package/harness/lifecycle.yaml +6 -3
- package/lib/audit.js +5 -1
- package/lib/cli.js +128 -20
- package/lib/discipline-coverage.js +148 -0
- package/lib/lifecycle.js +255 -0
- package/package.json +1 -1
- package/schema/discipline-coverage.v1.schema.json +55 -0
- package/schema/lifecycle.v1.schema.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [2.11.0] - 2026-07-25
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`discipline show [--json]`(Post-2.10 Epic E)**:只读展示 `harness/discipline-coverage.yaml`(镜像 `lifecycle show`)。**无** `audit --discipline` UI。
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **`lifecycle dry-run` 守卫扩面(Post-2.10 Epic A)**:`--task` + `to_30` 增接 `HG-TASK-DRAFT` · `audit_D5` · `task_lint`(与既有 `HG-AUDIT-R1` / `reviews_retention`)。`task_lint` 仍为 yaml **warn**;`--allow-lint-fail` 可将 fail 豁免为 warn。`close_*` 仍 `unevaluated`。**无** `--apply` / G7 / N2-C。
|
|
16
|
+
|
|
17
|
+
### Notes
|
|
18
|
+
|
|
19
|
+
- SPEC:`docs/spec/SPEC-lifecycle-guard-expand_v1.md` · `docs/spec/SPEC-discipline-show_v1.md`
|
|
20
|
+
- minor · `lifecycle show` / verify 硬闸语义不变
|
|
21
|
+
- `discipline-coverage.yaml` `as_of_package_version` → **2.11.0**
|
|
22
|
+
|
|
23
|
+
## [2.10.0] - 2026-07-25
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **`lifecycle dry-run`(方向二 · 转移引擎最小骨架 · Post-G4 Epic T2)**:消费 `harness/lifecycle.yaml` 做资格判定(结构 + 薄守卫 adapter)。
|
|
28
|
+
- CLI:`lifecycle dry-run --transition <id> --from <state> [--task PATH] [--json] [--allow-no-review]…`
|
|
29
|
+
- 本波接线(`--task` + `to_30`):`HG-AUDIT-R1` · `reviews_retention`;其余守卫显式 `unevaluated`
|
|
30
|
+
- exit:`0` 无 block fail(允许 unevaluated)· `2` 结构非法或 block fail · `1` 用法/yaml
|
|
31
|
+
- **旁路报告**:不替代 `verify` / gate-check 作为 30 硬闸;**无** `--apply` / runner / G7
|
|
32
|
+
- 语义护栏:yaml 头与 schema 注明「登记真值 · 由 dry-run 消费 · yaml ≠ 引擎」
|
|
33
|
+
- **`harness/discipline-coverage.yaml`(方向一 · 机械化率资产 · Post-G4 Epic T3)**:Starter 子集 statements + gaps;schema `discipline-coverage.v1`;`npm test` 锁形状。**无** `audit --discipline` UI。种子自 rethink 02/03 转录并刷新 G1–G4/N 闸状态;03 md 改为历史叙事,SoT=本 YAML。
|
|
34
|
+
|
|
35
|
+
### Notes
|
|
36
|
+
|
|
37
|
+
- SPEC:`docs/spec/SPEC-lifecycle-engine-min_v1.md` · `docs/spec/SPEC-discipline-coverage-yaml_v1.md`
|
|
38
|
+
- minor · `lifecycle show` 行为不变
|
|
39
|
+
- **已发布**:`@cyning/harness@2.10.0`(npm `latest` · 2026-07-25)· tag `v2.10.0` 已推送
|
|
40
|
+
|
|
7
41
|
## [2.9.0] - 2026-07-25
|
|
8
42
|
|
|
9
43
|
### Changed
|
|
@@ -18,6 +52,7 @@
|
|
|
18
52
|
- 全量模式仍**不**跑 task lint / audit D5(维持 N2)。
|
|
19
53
|
- SPEC:`docs/spec/SPEC-verify-full-reviews-gate_v1.md`
|
|
20
54
|
- minor · 行为更严 · 存量「闸表可 30 但无审查文」将被挡(可补审或 `--allow-no-review`)
|
|
55
|
+
- **已发布**:`@cyning/harness@2.9.0`(npm `latest` · 2026-07-25)· tag `v2.9.0` 已推送
|
|
21
56
|
|
|
22
57
|
## [2.8.0] - 2026-07-25
|
|
23
58
|
|
package/docs/ONBOARDING.md
CHANGED
|
@@ -59,9 +59,19 @@ npx @cyning/harness verify --spec docs/spec/SPEC-xxx_v1.md \
|
|
|
59
59
|
--workspace-root /path/to/Projects
|
|
60
60
|
# 豁免:--allow-no-spec-review · 或 SPEC track=bugfix / skip_spec_audit
|
|
61
61
|
|
|
62
|
-
# 只读生命周期登记(方向二 · 非引擎)
|
|
62
|
+
# 只读生命周期登记(方向二 · harness/lifecycle.yaml · 非引擎)
|
|
63
63
|
npx @cyning/harness lifecycle show
|
|
64
64
|
npx @cyning/harness lifecycle show --json
|
|
65
|
+
# 转移资格 dry-run(v2.10+ · 旁路报告 · 不替代 verify)
|
|
66
|
+
# v2.11+ to_30 已接线:HG-* · reviews · audit_D5 · task_lint(close_* 仍可 unevaluated)
|
|
67
|
+
npx @cyning/harness lifecycle dry-run --transition to_30 --from draft \
|
|
68
|
+
--task docs/tasks/active/task_xxx.md
|
|
69
|
+
# 无 --task:仅结构 + 守卫清单 unevaluated
|
|
70
|
+
npx @cyning/harness lifecycle dry-run --transition to_30 --from draft
|
|
71
|
+
|
|
72
|
+
# 机械化率资产只读(v2.11+ · SoT=discipline-coverage.yaml)
|
|
73
|
+
npx @cyning/harness discipline show
|
|
74
|
+
npx @cyning/harness discipline show --json
|
|
65
75
|
|
|
66
76
|
# 仅人工闸
|
|
67
77
|
npx @cyning/harness gate-check --target /path/to/your-repo
|
|
@@ -84,7 +94,10 @@ npx @cyning/harness sync index --target /path/to/your-repo
|
|
|
84
94
|
| **S5** | Git 工作区干净 | dirty 时 warn(不直接 fail verify,但 apply 须 `--force`) |
|
|
85
95
|
| **lint** | task 结构(仅 `--task`) | v2.7+ E 级 → `WARN: task lint`(不改 exit / `may_start_30`) |
|
|
86
96
|
|
|
87
|
-
生命周期真值:[`harness/lifecycle.yaml`](../harness/lifecycle.yaml)(`lifecycle show`
|
|
97
|
+
生命周期真值:[`harness/lifecycle.yaml`](../harness/lifecycle.yaml)(`lifecycle show` 只读 · `lifecycle dry-run` 资格判定 v2.10+)。
|
|
98
|
+
机械化率资产:[`harness/discipline-coverage.yaml`](../harness/discipline-coverage.yaml)(`discipline show` 只读 · v2.11+)。
|
|
99
|
+
|
|
100
|
+
机械化率覆盖资产(Starter):[`harness/discipline-coverage.yaml`](../harness/discipline-coverage.yaml)(SoT · 随版本改 statements/gaps;**无** audit UI)。
|
|
88
101
|
|
|
89
102
|
Audit **不替代** 维护者最终判断;Agent 首输出仍须人工复核。
|
|
90
103
|
|
|
@@ -130,8 +130,12 @@ npx @cyning/harness verify --target . \
|
|
|
130
130
|
[--json] [--agent-hint] \
|
|
131
131
|
[--workspace-root /path/to/Projects]
|
|
132
132
|
|
|
133
|
-
# 只读生命周期登记(方向二 · harness/lifecycle.yaml ·
|
|
133
|
+
# 只读生命周期登记(方向二 · harness/lifecycle.yaml · 登记真值)
|
|
134
134
|
npx @cyning/harness lifecycle show [--json]
|
|
135
|
+
# 转移资格 dry-run(v2.10+ · 引擎消费 yaml · 旁路报告 · 非 runner / 非 G7)
|
|
136
|
+
# v2.11+ to_30 已接线 HG-* / reviews / audit_D5 / task_lint(close_* 仍可 unevaluated)
|
|
137
|
+
npx @cyning/harness lifecycle dry-run --transition to_30 --from draft \
|
|
138
|
+
[--task docs/tasks/active/task_xxx.md] [--json] [--allow-no-review]
|
|
135
139
|
|
|
136
140
|
# 仅人工闸
|
|
137
141
|
npx @cyning/harness gate-check --target . --task docs/tasks/active/task_xxx.md
|
|
@@ -184,7 +188,9 @@ Schema:[`schema/verify_result.v1.schema.json`](../schema/verify_result.v1.sche
|
|
|
184
188
|
| `npx @cyning/harness upgrade` | 同步产品包更新(可加 `--gate-check` 先 audit) |
|
|
185
189
|
| `npx @cyning/harness check` | 检查是否有新版本 |
|
|
186
190
|
| `npx @cyning/harness verify` | 全量:双路径 + reviews(v2.9+);`--task`:30 前聚合;`--spec`:SPEC→00(v2.8+ · 互斥) |
|
|
187
|
-
| `npx @cyning/harness lifecycle show` | 只读展示 `harness/lifecycle.yaml
|
|
191
|
+
| `npx @cyning/harness lifecycle show` | 只读展示 `harness/lifecycle.yaml`(登记 · v2.7+) |
|
|
192
|
+
| `npx @cyning/harness lifecycle dry-run` | 转移资格判定(引擎消费 yaml · v2.10+ · 旁路 · 非 G7) |
|
|
193
|
+
| `npx @cyning/harness discipline show` | 只读展示 `harness/discipline-coverage.yaml`(v2.11+ · 非 audit UI) |
|
|
188
194
|
| `npx @cyning/harness gate-check` | 仅人工闸(`--graph` / `--json`) |
|
|
189
195
|
| `npx @cyning/harness audit` | ICVO 机械审计(D3/D5/S5) |
|
|
190
196
|
| `npx @cyning/harness sync index` | 生成 `.cyning-harness/invoke_index.json` |
|
|
@@ -57,5 +57,7 @@ description: 机械化率统计矩阵 + 缺口聚类 + 候选闸优先级排序
|
|
|
57
57
|
|
|
58
58
|
## 5. 数字的诚实边界
|
|
59
59
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
60
|
+
- **运行时真值(SoT)**:[`harness/discipline-coverage.yaml`](../../harness/discipline-coverage.yaml)(schema:[`schema/discipline-coverage.v1.schema.json`](../../schema/discipline-coverage.v1.schema.json) · 随 `@cyning/harness` 版本维护 · v2.10+)
|
|
61
|
+
- 下文 26 条统计表是 **2026-07-24 人工盘点快照**(历史/叙事);分类含主观成分。**勿再把本 md 表当唯一真值**——查覆盖请读 YAML(`as_of_package_version`)
|
|
62
|
+
- 「mechanical」只代表**存在**机制,不代表机制**有效**(如 D5 只探测测试文件存在)——预留 `mechanism_quality`;本轮不做质量审计
|
|
63
|
+
- SPEC:[`SPEC-discipline-coverage-yaml_v1.md`](../spec/SPEC-discipline-coverage-yaml_v1.md)
|
|
@@ -52,9 +52,10 @@ description: 结论与立项建议 · 缺口到 SPEC/task 的转化路径 + 与
|
|
|
52
52
|
|
|
53
53
|
## 4. 机械化率矩阵的资产化
|
|
54
54
|
|
|
55
|
-
-
|
|
56
|
-
- 每个新闸落地 =
|
|
57
|
-
- 远期可给 `harness audit` 加 `--discipline`
|
|
55
|
+
- ✅ **已落地(v2.10.0 · Epic T3)**:[`harness/discipline-coverage.yaml`](../../harness/discipline-coverage.yaml) + [`schema/discipline-coverage.v1.schema.json`](../../schema/discipline-coverage.v1.schema.json) · SPEC [`SPEC-discipline-coverage-yaml_v1.md`](../spec/SPEC-discipline-coverage-yaml_v1.md)
|
|
56
|
+
- 每个新闸落地 = 更新 YAML 对应 `statements[].status` / `gaps[]` / `as_of_package_version`
|
|
57
|
+
- 远期可给 `harness audit` 加 `--discipline` 视图(**本波不做** UI)
|
|
58
|
+
- 03 md 表保留为历史叙事;SoT = YAML
|
|
58
59
|
|
|
59
60
|
## 5. 不做什么(本轮明确排除)
|
|
60
61
|
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# SPEC:discipline-coverage.yaml 资产化(Post-G4 · T3)(v1)
|
|
2
|
+
|
|
3
|
+
> **状态**:`signed`(维护者签收 2026-07-25 · 对话「签收」)
|
|
4
|
+
> **track**:`feature`(docs-first · 可 docs-only 发版)
|
|
5
|
+
> **关联图谱**:无(纯 Harness 过程轨 / 机械化率资产)
|
|
6
|
+
> **上游**:Epic [`EPIC_post_g4_menu_serial_t1t2t3_v1_zh.md`](../../../docs/harness/guides/EPIC_post_g4_menu_serial_t1t2t3_v1_zh.md) · RETRO 点菜 #3 · rethink [`03_coverage_matrix`](../rethink/2026-07-mechanization-rate/03_coverage_matrix.md) / [`04_next_steps`](../rethink/2026-07-mechanization-rate/04_next_steps.md) §4
|
|
7
|
+
> **串行**:T1 CLOSE ✅ → T2 CLOSE ✅ → **本棒 T3** → 发版前复检
|
|
8
|
+
> **下游**:00 已起草 task(HG-TASK-DRAFT pending)→ 10-task(可选)→ 20-task-audit → HG-AUDIT-R1 → 30(Open Folder:`cyning-harness/`)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Harness 元信息
|
|
13
|
+
|
|
14
|
+
| 字段 | 值 |
|
|
15
|
+
|------|-----|
|
|
16
|
+
| **spec_slug** | `discipline-coverage-yaml` |
|
|
17
|
+
| **test_strategy** | `required` |
|
|
18
|
+
| **test_strategy_note** | schema 正反例 + 包内 YAML 必须通过 schema;无 CLI 时仍以 `npm test` 锁形状,避免静默漂移 |
|
|
19
|
+
| **entry_invoke_10_spec** | `Projects/docs/harness/invokes/by-task/cyning-harness-discipline-coverage-yaml/invoke_20260725_10_spec_discipline_coverage_yaml.md` |
|
|
20
|
+
| **entry_invoke_00_draft** | `Projects/docs/harness/invokes/by-task/cyning-harness-discipline-coverage-yaml/invoke_20260725_00_draft_discipline_coverage_yaml.md` |
|
|
21
|
+
| **拟发版窗口** | **`@cyning/harness@2.10.0`**(与 Epic T2 同窗;本棒无 CLI 亦可 docs/asset-only 记入同 CHANGELOG) |
|
|
22
|
+
| **Open Folder(实现)** | `cyning-harness/`(产品仓 · 资产 + schema + test + 文档) |
|
|
23
|
+
| **epic_serial** | T3(T1 dogfood → T2 lifecycle dry-run → **本棒**) |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 1. 背景与目标
|
|
28
|
+
|
|
29
|
+
机械化率审计(2026-07)把 Starter 子集 **26 条**规范语句聚成矩阵(rethink 03),并写明:矩阵应落盘为 YAML,随版本维护,使「每个新闸落地 = 一行 ❌→✅」成为可版本化资产(04 §4)。G1–G4 / N1–N4 已关账后,03 正文仍是 **人工快照 md**——数字与状态会相对 `@2.9.0` 现实漂移,且无法被 schema / CI 钉住。
|
|
30
|
+
|
|
31
|
+
**一句话目标**:把 rethink 03 矩阵 **资产化** 为包内 `discipline-coverage.yaml`(+ schema + 文档挂点),成为方向一「改进路线可版本化」的实体;**不**在本波做全量重盘周,**不**做 `audit --discipline` 大 UI。
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 2. 范围
|
|
36
|
+
|
|
37
|
+
### D1 · 真值 YAML(随包分发)
|
|
38
|
+
|
|
39
|
+
- 路径:**`harness/discipline-coverage.yaml`**(与 `harness/lifecycle.yaml` 同级 · 进 npm `files`)
|
|
40
|
+
- 内容至少含:
|
|
41
|
+
- `version`(资产 schema 版本,如 `"1"`)
|
|
42
|
+
- `as_of_package_version`(快照对齐的包版本,首发填拟发布版或基线 `2.9.0`→发版时改 `2.10.0`)
|
|
43
|
+
- `scope`:声明 **Starter 子集**(`harness/prompts/` · 与 rethink README 范围一致)
|
|
44
|
+
- `statements[]`:每条至少 `id` · `source`(prompt/模板文件名)· `summary` · `status`(`mechanical` \| `partial` \| `prompt-only`)· `mechanism`(可空 · M1–M10 等)· `gap`(可空 · G1/G2/…)· `notes`(可空)
|
|
45
|
+
- 预留字段:`mechanism_quality`(可空 · 本波不填实质审计)
|
|
46
|
+
- 可选:`gaps[]` 汇总(id / title / status open|closed|deferred / closed_in / note)——便于一眼看缺口进度;若省略则须能从 statements 推导
|
|
47
|
+
- **种子策略(非重盘)**:以 rethink **02 条目 + 03 聚合** 为转录源;对已落地闸(G1–G4 及 PLAN §0 已列项)**更新 status/mechanism/gap 为当前现实**(反映 `@2.9.0` 已关闭项),**不**重新通读全部 prompt 做第二轮人工盘点周
|
|
48
|
+
|
|
49
|
+
### D2 · Schema
|
|
50
|
+
|
|
51
|
+
- **`schema/discipline-coverage.v1.schema.json`**
|
|
52
|
+
- 非法 fixture(缺 `statements` / 非法 `status` / 缺 `id`)须可失败定位
|
|
53
|
+
|
|
54
|
+
### D3 · 测试(无 CLI 亦必有)
|
|
55
|
+
|
|
56
|
+
- `test/discipline-coverage*.test.js`(或等价):包内 YAML **通过** schema;至少 1 个非法 fixture **不通过**
|
|
57
|
+
- 建议轻断言:`statements.length >= 20`(防空文件)· 已知已关闭缺口(如 G1/G2)在 `gaps` 或 statements 映射中不为「仍 open 且无 closed_in」的自相矛盾(具体断言由 30 按 fixture 实现,SPEC 要求「不自相矛盾」可测)
|
|
58
|
+
|
|
59
|
+
### D4 · 文档挂点
|
|
60
|
+
|
|
61
|
+
- rethink **03** §5(或文首):标明矩阵**运行时真值** → `harness/discipline-coverage.yaml`;md 表保留为历史/叙事,不再假装 SoT
|
|
62
|
+
- rethink **04** §4:链到本 SPEC / YAML 路径
|
|
63
|
+
- 产品仓 README 或 ONBOARDING / USER_GUIDE **一小节**:「机械化率覆盖资产」· 如何读 YAML · 新闸落地时须改哪一行
|
|
64
|
+
- CHANGELOG:**2.10.0** 条目(可与 T2 合并叙述;本棒无 CLI 则写 asset + schema)
|
|
65
|
+
|
|
66
|
+
### D5 · 维护约定(写进文档,非另开 task)
|
|
67
|
+
|
|
68
|
+
- 新闸合入 → 同 PR 或同版本更新对应 `statements[].status`(及 `gaps[]` / `as_of_package_version`)
|
|
69
|
+
- **禁止**本波要求「每周全量重盘」流程
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 3. 非范围
|
|
74
|
+
|
|
75
|
+
| 项 | 说明 |
|
|
76
|
+
|----|------|
|
|
77
|
+
| **全量人工重盘周** | 不重跑 02 式通读;不扩盘工作区 Extended 帽(00/10-spec/20-*/50) |
|
|
78
|
+
| **`harness audit --discipline` 大 UI / 视图** | 04 远期;本波不做渲染与 CLI 子命令(见 R2) |
|
|
79
|
+
| **机制质量审计** | `mechanical ≠ effective`(如 D5 只探文件存在);仅预留 `mechanism_quality` |
|
|
80
|
+
| **改 `harness/prompts/` 纪律正文** | 非本棒;措辞随各闸 task |
|
|
81
|
+
| **T2 lifecycle 引擎 / G7 / G6 / N2-C** | 属其它棒或暂缓项 |
|
|
82
|
+
| **代发版 / 代签 human_gate** | Epic 级禁止 |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 4. 验收标准
|
|
87
|
+
|
|
88
|
+
- [ ] `harness/discipline-coverage.yaml` 存在且通过 `discipline-coverage.v1` schema
|
|
89
|
+
- [ ] 种子覆盖 Starter 盘点主表条目(与 02 的 A–F 编号可对照;允许合并对照组 G 节为 notes,不要求逐字复制 03 统计表)
|
|
90
|
+
- [ ] 已落地缺口(至少 **G1、G2、G4** 及 PLAN 已 ✅ 的文档闸)在资产中体现为 **非**「仍纯 prompt-only 且 gap 未关闭」的过时叙述(status/gap/closed_in 之一须反映已机械)
|
|
91
|
+
- [ ] 非法 YAML fixture → 测试失败且信息可定位
|
|
92
|
+
- [ ] 文档挂点:从 rethink 03(或 README)可链到 YAML;CHANGELOG 有 **2.10.0** 叙述
|
|
93
|
+
- [ ] `npm test` 全绿
|
|
94
|
+
- [ ] **无** `audit --discipline` UI;**无**强制重盘脚本/周程
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 5. failure_paths
|
|
99
|
+
|
|
100
|
+
| 触发条件 | 系统行为 | 可重试 |
|
|
101
|
+
|----------|----------|--------|
|
|
102
|
+
| YAML 不符 schema | 测试 /(若将来 CLI)校验 exit ≠0 · 指出路径/字段 | 修 YAML |
|
|
103
|
+
| 种子与 02 编号明显漏行(空或极少) | 验收失败(length / 抽样 id) | 补转录 |
|
|
104
|
+
| 文档仍把 03 md 表当唯一真值 | 验收挂点失败 | 改 03/README 指针 |
|
|
105
|
+
| 误把本波做成 audit UI | 超出非范围 · 20/40 拒收 | 回退 UI |
|
|
106
|
+
| T2 未 CLOSE 却开 T3 改码 | Epic 串行违纪 · 00/人闸拦截 | 等 T2 CLOSE |
|
|
107
|
+
| 仅改 docs、未进 `harness/` 包路径 | 资产不可随 npm 分发 · 验收失败 | 移入 `harness/` |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 6. 依赖与引用
|
|
112
|
+
|
|
113
|
+
- Epic:`docs/harness/guides/EPIC_post_g4_menu_serial_t1t2t3_v1_zh.md`
|
|
114
|
+
- RETRO 点菜 #3:`docs/harness/guides/RETRO_post_g4_n1n4_debt_v1_zh.md` §4
|
|
115
|
+
- rethink:`cyning-harness/docs/rethink/2026-07-mechanization-rate/{02,03,04,README}.md`
|
|
116
|
+
- 形态先例:`harness/lifecycle.yaml` + `schema/lifecycle.v1.schema.json`(本波 **可不**镜像 `lifecycle show` CLI)
|
|
117
|
+
- 机制编号:rethink README M1–M10
|
|
118
|
+
- 当前包版本基线:`@cyning/harness@2.9.0`
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 7. 思考轮(10-spec 回填 · R0–R5)
|
|
123
|
+
|
|
124
|
+
### R0 · 读入与约束
|
|
125
|
+
|
|
126
|
+
读入:Epic T3 行(`discipline-coverage.yaml` + 文档挂点)· RETRO #3 不做清单 · rethink 03 §5 / 04 §4 · PLAN closed 已落地表 · lifecycle 资产先例。
|
|
127
|
+
约束:串行 T3;发版窗 **2.10.0**;可为无 CLI;**early_stop=no**;禁止重盘周与 audit UI。
|
|
128
|
+
|
|
129
|
+
### R1 · 范围 / 非范围 / 场景
|
|
130
|
+
|
|
131
|
+
**场景**:
|
|
132
|
+
|
|
133
|
+
1. **S1 维护者**:发版前问「Starter 还有哪些 prompt-only?」→ 打开 YAML / 将来工具读同一文件。
|
|
134
|
+
2. **S2 补闸作者**:合入新闸 PR 时改一行 status(❌→✅),CHANGELOG 与矩阵同步。
|
|
135
|
+
3. **S3 Agent/评审**:验收「资产是否在包内且 schema 绿」,而非再开一周盘点。
|
|
136
|
+
|
|
137
|
+
**范围**:D1–D5(YAML + schema + test + 文档 + 维护约定)。
|
|
138
|
+
**非范围**:重盘 Extended、audit UI、机制质量、改 prompts、T2/G7 等。
|
|
139
|
+
|
|
140
|
+
### R2 · 方案对比
|
|
141
|
+
|
|
142
|
+
| 决策点 | 选项 | 裁定 | 理由 |
|
|
143
|
+
|--------|------|------|------|
|
|
144
|
+
| 落点 | 仅 rethink md 更新 / `docs/` 下 YAML / **`harness/` 包内 YAML** | **`harness/discipline-coverage.yaml`** | 与 lifecycle 同构;进 npm `files`;业务仓 upgrade 可见 |
|
|
145
|
+
| 消费者 | 无 / schema+test / + `discipline show` / + `audit --discipline` | **schema + npm test + 文档挂点** | 满足「资产化」与可测;CLI/UI 属膨胀;Lead 允许 docs-only |
|
|
146
|
+
| 种子方法 | 全量重盘周 / **转录 02+03 并刷新已落地状态** / 只写空壳 | **转录 + 状态刷新** | RETRO 禁止重盘;空壳无验收意义 |
|
|
147
|
+
| 与 03 md 关系 | 双真值并行 / **YAML=SoT·md 指针** / 删除 03 | **YAML SoT · 03 改指针** | 保留思考叙事;消漂移 |
|
|
148
|
+
| 发版 | 独立 patch / **同窗 2.10.0(T2)** | **2.10.0** | Epic 统一复检;无 CLI 亦不单开无意义版本号 |
|
|
149
|
+
| CLI show | 本波做 / **不做** | **不做(本波)** | 降低 T3 与 T2 抢实现带宽;预留下波 mirror lifecycle |
|
|
150
|
+
|
|
151
|
+
**弃选**:audit UI(Epic/RETRO 明文);仅 md 统计不加 YAML(违背 04 §4)。
|
|
152
|
+
|
|
153
|
+
### R3 · 边界 / 失败语义 / 安全
|
|
154
|
+
|
|
155
|
+
- **挂点**:资产在「新闸已存在之后」更新(合入闸的同版本)——符合 03 反模式「挂点晚于产物」。
|
|
156
|
+
- **误报**:schema 只锁形状与枚举,不锁「status 是否政治正确」;内容对错靠 20/人审与 dogfood。
|
|
157
|
+
- **泄压**:无 BLOCKING 运行时闸;坏 YAML 只挡本仓 `npm test` / 发版复检。
|
|
158
|
+
- **安全**:只读资产;不写用户仓;不含密钥。
|
|
159
|
+
- **串行**:T3 30 须 T2 CLOSE(Epic);SPEC/task 起草可先行,**改码合入**遵守串行。
|
|
160
|
+
- **兼容**:旧版包无此文件 · 行为不变。
|
|
161
|
+
|
|
162
|
+
### R4 · 验收 / 可测性 / test_strategy
|
|
163
|
+
|
|
164
|
+
`test_strategy: required`:schema 正反例 + 包内文件必过。
|
|
165
|
+
可观测:路径存在、校验绿、文档链接、CHANGELOG、无 UI 命令。
|
|
166
|
+
不要求:覆盖率百分比与 03 历史数字逐格相等(因已落地闸会改写占比——以 YAML 新快照为准,03 可保留旧数字并注明过时)。
|
|
167
|
+
|
|
168
|
+
### R5 · SPEC 签收就绪 · 是否可交 00 出 task
|
|
169
|
+
|
|
170
|
+
SPEC 自足:D 包清晰、R2 弃选写死、非范围与 Epic 对齐、发版窗 2.10.0。
|
|
171
|
+
**可交 00** 起草 task:`task_slug` 建议 `cyning-harness-discipline-coverage-yaml`;Open Folder `cyning-harness/`;`lightweight_task` 可由 00 裁量(投影清晰时可 yes + 10-task early_stop 理由)。
|
|
172
|
+
图谱无需 bootstrap。
|
|
173
|
+
**下一棒**:可选轻量 **20-spec-audit** → **HG-SPEC-SIGNOFF** → 00 draft task(若维护者直接签收可跳过书面审,链纪律上推荐轻量 20)。
|
|
174
|
+
|
|
175
|
+
### 思考轮控制
|
|
176
|
+
|
|
177
|
+
| 字段 | 值 |
|
|
178
|
+
|------|-----|
|
|
179
|
+
| `actual_last_round` | `R5` |
|
|
180
|
+
| `early_stop` | `no` |
|
|
181
|
+
| `early_stop_reason` | — |
|
|
182
|
+
| `residual_risks` | ① 转录时 status 刷新可能与个别 prompt 细读不一致(非重盘的诚实边界,03 §5 同类);② 无 CLI 时发现性弱,依赖文档挂点;③ 与 T2 同窗 2.10.0 时 CHANGELOG 合并叙述易漏写本资产——发版复检须勾;④ `gaps[]` 与 statements 双写可能漂移——30 宜单测一致性或只保留一层真值 |
|
|
183
|
+
| `round_extension_note` | — |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 8. 给 00 的 task 投影提示(非 task 正文)
|
|
188
|
+
|
|
189
|
+
| 项 | 建议 |
|
|
190
|
+
|----|------|
|
|
191
|
+
| task_slug | `cyning-harness-discipline-coverage-yaml` |
|
|
192
|
+
| Open Folder | `cyning-harness/` |
|
|
193
|
+
| 交付文件 | `harness/discipline-coverage.yaml` · `schema/discipline-coverage.v1.schema.json` · `test/…` · 文档指针 · CHANGELOG |
|
|
194
|
+
| 依赖 | Epic:T2 CLOSE 后方可本棒 30;SPEC 本文件 signed |
|
|
195
|
+
| 版本 | 记入 **2.10.0**(可与 T2 同 PR 或同 tag 窗口) |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 修订记录
|
|
200
|
+
|
|
201
|
+
| 日期 | 摘要 |
|
|
202
|
+
|------|------|
|
|
203
|
+
| 2026-07-25 | 10-spec R0–R5 · Post-G4 Epic T3 · early_stop=no · draft |
|
|
204
|
+
| 2026-07-25 | 维护者签收(对话「签收」)→ `signed` · 00 起草 task · N3 纸链审查文 |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# SPEC:discipline show CLI(Post-2.10 Epic E)(v1)
|
|
2
|
+
|
|
3
|
+
> **状态**:`signed`(维护者签收 2026-07-25 · 对话「签收 A+E」)
|
|
4
|
+
> **track**:`feature`
|
|
5
|
+
> **上游**:Epic [`EPIC_post_210_menu_serial_a_e_j_v1_zh.md`](../../../docs/harness/guides/EPIC_post_210_menu_serial_a_e_j_v1_zh.md) · RETRO 候选 **E** · T3 SPEC [`SPEC-discipline-coverage-yaml_v1.md`](./SPEC-discipline-coverage-yaml_v1.md)(资产已落地 · 本波补发现性)
|
|
6
|
+
> **前置**:`@cyning/harness@2.10.0` · Epic **A CLOSE** 后方可进本棒 30(串行)
|
|
7
|
+
> **下游**:人签 → 00 draft task(可与 A 签收同批起草,**30 仍串行**)→ … → 30
|
|
8
|
+
> **目标版本**:与 A 统一 **`2.11.0`**
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Harness 元信息
|
|
13
|
+
|
|
14
|
+
| 字段 | 值 |
|
|
15
|
+
|------|-----|
|
|
16
|
+
| **spec_slug** | `discipline-show` |
|
|
17
|
+
| **invoke_slug** | `cyning-harness-discipline-show` |
|
|
18
|
+
| **test_strategy** | `required` |
|
|
19
|
+
| **test_strategy_note** | show 人读/JSON · 非法 yaml exit · 与 loadDisciplineCoverage 同源;lifecycle show 回归 |
|
|
20
|
+
| **Open Folder(实现)** | `cyning-harness/` |
|
|
21
|
+
| **epic_serial** | E(J → A → **本棒**) |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. 背景与目标
|
|
26
|
+
|
|
27
|
+
T3 已落盘 `harness/discipline-coverage.yaml` + schema + `npm test`,但 **无 CLI**,发现性弱(T3 residual)。
|
|
28
|
+
|
|
29
|
+
**一句话目标**:提供 **`discipline show [--json]`**,镜像 `lifecycle show` 的只读体验,不引入 `audit --discipline` 大 UI。
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. 范围
|
|
34
|
+
|
|
35
|
+
### D1 · CLI
|
|
36
|
+
|
|
37
|
+
- `npx @cyning/harness discipline show [--json]`
|
|
38
|
+
- 人读:摘要 `version` · `as_of_package_version` · `scope` · statements 计数按 status · gaps 计数按 status;可选短表(id/status/summary 截断)
|
|
39
|
+
- `--json`:输出 `loadDisciplineCoverage` 校验后的数据对象(或稳定包装 `{ ok, data }`——30 选一并写进测试;**推荐直接 dump data** 对齐 lifecycle show)
|
|
40
|
+
- 非法 / 缺失 yaml → exit **1**(与 lifecycle 风格一致)
|
|
41
|
+
|
|
42
|
+
### D2 · 库
|
|
43
|
+
|
|
44
|
+
- 扩展 `lib/discipline-coverage.js`:`formatDisciplineShow(data)`(或等价)
|
|
45
|
+
- 复用既有 `loadDisciplineCoverage` / `validateDisciplineCoverage`;**不**改 schema 必填
|
|
46
|
+
|
|
47
|
+
### D3 · 文档 / 测试 / 版本
|
|
48
|
+
|
|
49
|
+
- help / USER_GUIDE / ONBOARDING 挂点;CHANGELOG **2.11.0**
|
|
50
|
+
- 单测:包内 yaml show 成功;损坏 fixture exit ≠0
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 3. 非范围
|
|
55
|
+
|
|
56
|
+
- `audit --discipline` 交互视图 / 过滤 UI / HTML
|
|
57
|
+
- 全量人工重盘周 / 改 statements 真值内容(除非 show 发现明显自相矛盾且 A 波已改——默认 **不**改矩阵正文)
|
|
58
|
+
- A 的守卫扩面(不得同未 CLOSE 的 A 抢 PR;本棒 30 在 A CLOSE 后)
|
|
59
|
+
- apply / G7 / N2-C
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 4. 验收清单
|
|
64
|
+
|
|
65
|
+
- [ ] `discipline show` 与 `discipline show --json` 对包内 yaml 成功
|
|
66
|
+
- [ ] 人读含 version / as_of / 计数;JSON 可被 `JSON.parse`
|
|
67
|
+
- [ ] help 列出 `discipline show`
|
|
68
|
+
- [ ] `npm test` 全绿 · lifecycle show 不回归
|
|
69
|
+
- [ ] 文档一句说明 SoT 仍为 yaml,show 只读
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 5. 思考轮控制表(摘要)
|
|
74
|
+
|
|
75
|
+
| 字段 | 值 |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `actual_last_round` | R1 |
|
|
78
|
+
| `early_stop` | yes |
|
|
79
|
+
| `early_stop_reason` | 与 lifecycle show 同构;T3 已预留「下波 mirror」 |
|
|
80
|
+
| `residual_risks` | ① 人读表格过长需截断;② 与 audit 子命令命名空间未来冲突——本波用顶级 `discipline`,不做 audit 子命令 |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 8. 下一棒 Prompt(人签后 · A CLOSE 后 30)
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
【30】cyning-harness-discipline-show · 实现 discipline show [--json]
|
|
88
|
+
约束:只读;无 audit UI;A 已 CLOSE;目标进 2.11.0 CHANGELOG
|
|
89
|
+
```
|