@cyning/harness 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.0.2] - 2026-06-16
8
+
9
+ ### Fixed
10
+
11
+ - **`verify` 无 `--task`**:摘要不再误匹配闸表行 `❌ 拒 30`;多 task 阻塞时摘要列出 blocked task 名
12
+ - **`verify` BLOCKED**:exit 2 时不再打印空 `Error` stack trace
13
+
14
+ ## [1.0.1] - 2026-06-16
15
+
16
+ ### Added
17
+
18
+ - **业务仓 CLI 入口**:`npx @cyning/harness gate-check` · `verify` · `sync index`(读 `.cyning-harness/local.json`,无需 clone 产品包)
19
+ - **`verify` 聚合命令**:30 前一条命令跑 gate-check + audit D5 + S5 warn + 可选 `--graph`
20
+ - **`--help` / `--version` / `-V`**:全局与各子命令帮助
21
+ - **Node 仓可选 `--with-scripts`**:`init|upgrade --with-scripts [--pm pnpm|npm|yarn|auto]` 写入 `devDependencies` 与 `scripts`(merge 不覆盖)
22
+ - **业务仓 QUICKREF**:`harness/templates/QUICKREF_v1_zh.md`,install/upgrade 后写入 `.cyning-harness/QUICKREF.md`
23
+
24
+ ### Changed
25
+
26
+ - `lib/audit.js` 使用统一 `resolveHarnessRootForTarget`,修复无 `CYNING_HARNESS` 时的路径 bug
27
+ - `lib/cli.js` 子命令透传 `CYNING_HARNESS` 到 wizard 脚本
28
+ - `README.md` · `docs/ONBOARDING.md` · `docs/USER_GUIDE_v1.0_zh.md` · `wizard/README.md` · IDE 片段:同步 v1.0.1 CLI 与 `verify` 用法
29
+ - **`ontology.yaml`**:`product_semver: "1.0.1"`
30
+
31
+ ### Notes
32
+
33
+ - **HG-RELEASE**(tag v1.0.1 · npm publish)仍留维护者人闸
34
+ - `verify --graph` 硬挡规则与 `gate-check --graph` 一致
35
+
7
36
  ## [1.0.0] - 2026-06-16
8
37
 
9
38
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ```bash
4
4
  npx @cyning/harness@latest init --preset harness-only --ide cursor,agents
5
- npx @cyning/harness upgrade && npx @cyning/harness check
5
+ npx @cyning/harness verify
6
6
  ```
7
7
 
8
8
  可 clone、可嵌入业务仓库的 **Harness 纪律包**(无业务代码,无内置 LLM)· **MIT 开源**。
@@ -33,9 +33,10 @@ npx @cyning/harness upgrade && npx @cyning/harness check
33
33
 
34
34
  ---
35
35
 
36
- ## Quick Start(npx · v0.3+)
36
+ ## Quick Start(npx · v1.0)
37
37
 
38
- > 顶部三行即最小接入。须在 **目标业务仓根** 执行(勿在本产品仓根跑 `npx`,会报 `harness: command not found`)。
38
+ > 顶部三行即最小接入。须在 **目标业务仓根** 执行(勿在本产品仓根跑 `npx`,会报 `harness: command not found`)。
39
+ > **陌生人完整手册**:[`docs/USER_GUIDE_v1.0_zh.md`](docs/USER_GUIDE_v1.0_zh.md)
39
40
 
40
41
  **维护者 · 在本仓库根验证 CLI**(npm 不会为「当前包」链接 `bin`,`npx` 会报 `harness: command not found`):
41
42
 
@@ -64,33 +65,36 @@ git clone git@github.com:Cyning12/cyning-harness.git && cd cyning-harness
64
65
  ```text
65
66
  install / adopt → harness-sync plan/apply → @ task + prompts(10→22→30)
66
67
  ↑ 产品包 git pull 后 upgrade.sh
67
- 30 前:gate-check.sh · HG-AUDIT-R1 = approved
68
+ 30 前:npx @cyning/harness verify · HG-AUDIT-R1 = approved
68
69
  ```
69
70
 
70
71
  1. 阅读 [`docs/ONBOARDING.md`](docs/ONBOARDING.md)
71
- 2. [`wizard/install.sh`](wizard/install.sh) [`adopt-existing.sh`](wizard/adopt-existing.sh)
72
- 3. 产品包更新:[`wizard/upgrade.sh`](wizard/upgrade.sh) [`harness-sync.sh`](wizard/harness-sync.sh) `apply`
73
- 4. IDE `@` task + `docs/harness/prompts/`;30 前 [`gate-check.sh`](wizard/gate-check.sh)
72
+ 2. [`npx @cyning/harness init`](docs/USER_GUIDE_v1.0_zh.md) 或 [`wizard/install.sh`](wizard/install.sh) / [`adopt-existing.sh`](wizard/adopt-existing.sh)
73
+ 3. 产品包更新:`npx @cyning/harness upgrade` 或 [`wizard/upgrade.sh`](wizard/upgrade.sh) / [`harness-sync.sh`](wizard/harness-sync.sh) `apply`
74
+ 4. IDE `@` task + `docs/harness/prompts/`;30 前 `npx @cyning/harness verify` 或 `npx @cyning/harness gate-check`
74
75
 
75
76
  ---
76
77
 
77
78
  ## ICVO 机械审计(v1.0+)
78
79
 
79
- `harness audit` 在 30 执行前机械检查 ICVO 公理子集:
80
+ `npx @cyning/harness verify` 在 30 执行前聚合检查 ICVO 公理子集:
80
81
 
81
82
  ```bash
83
+ npx @cyning/harness verify --target /path/to/your-repo --task docs/tasks/active/task_xxx.md
84
+ npx @cyning/harness gate-check --target /path/to/your-repo --task docs/tasks/active/task_xxx.md
82
85
  npx @cyning/harness audit --target /path/to/your-repo --task docs/tasks/active/task_xxx.md
83
86
  npx @cyning/harness upgrade --gate-check # upgrade 前自动 audit
84
87
  ```
85
88
 
86
- - **D3**:`gate-check.sh` 真值唯一来源,HG-AUDIT-R1 / HG-GRAPH-MODULES pending 时拒 30
89
+ - **D3**:`gate-check` 真值唯一来源,HG-AUDIT-R1 / HG-GRAPH-MODULES pending 时拒 30
87
90
  - **D5**:`test_strategy=required` 任务须声明测试路径或 CI 引用
88
91
  - **S5**:dirty 工作区 warn,apply 须 `--force` 明示
89
92
 
90
- Inform 图谱闸:`wizard/gate-check.sh --graph --target /path/to/your-repo`
91
- Invoke 索引:`wizard/harness-sync.sh --index --target /path/to/your-repo`(不覆盖 S2 域)
93
+ Inform 图谱闸:`npx @cyning/harness gate-check --graph --target /path/to/your-repo`
94
+ Invoke 索引:`npx @cyning/harness sync index --target /path/to/your-repo`(不覆盖 S2 域)
92
95
 
93
- 详见 [`docs/ONBOARDING.md`](docs/ONBOARDING.md) §2.2。
96
+ Node 仓可选:`npx @cyning/harness init --with-scripts` → `pnpm harness:verify`。
97
+ 详见 [`docs/USER_GUIDE_v1.0_zh.md`](docs/USER_GUIDE_v1.0_zh.md) · [`docs/ONBOARDING.md`](docs/ONBOARDING.md) §2.2。
94
98
 
95
99
  ---
96
100
 
@@ -118,7 +122,7 @@ Invoke 索引:`wizard/harness-sync.sh --index --target /path/to/your-repo`(
118
122
  | --- | --- |
119
123
  | 覆盖 | S1–S4(D2 HumanGate · D3 gate-check · S2 sync 域) |
120
124
  | 结果 | **4/4 = 100%** |
121
- | 运行 | `./wizard/compliance-bench.sh --all` |
125
+ | 运行 | [`./wizard/compliance-bench.sh --all`](../wizard/compliance-bench.sh) · 说明 [`examples/compliance_bench/README.md`](../examples/compliance_bench/README.md) |
122
126
 
123
127
  **免责声明**:本表为 **小样本机制证据**,非胜率承诺;Part A 与 Terminal-Bench / SWE-bench **互补、不对标**。
124
128
 
@@ -163,9 +167,9 @@ cyning-harness/
163
167
 
164
168
  | 项 | 值 |
165
169
  |----|-----|
166
- | 当前 | **v0.4.0** — A3 public push 准备 · ontology.yaml · MIT · 脱敏金样 |
167
- | 上一档 | v0.3.xnpx CLI · Starter 四帽 · manifest · S5 |
168
- | 许可 | **MIT** · [`LICENSE`](LICENSE) · 战略 POINTER 见 [`methodology/pointers/STRATEGY_ONTOLOGY_v1_zh.md`](docs/methodology/pointers/STRATEGY_ONTOLOGY_v1_zh.md) |
170
+ | 当前 | **v1.0.0** — A4 stable · ICVO audit · invoke_index · gate-check --graph · B2 证据 |
171
+ | 上一档 | v0.4.0A3 public push · MIT · 脱敏金样 |
172
+ | 许可 | **MIT** · [`LICENSE`](LICENSE) · Release [`docs/RELEASE_v1.0.0.md`](docs/RELEASE_v1.0.0.md) |
169
173
 
170
174
  ---
171
175
 
@@ -175,7 +179,7 @@ cyning-harness/
175
179
  | --- | --- |
176
180
  | **总指引** | [`methodology/README.md`](docs/methodology/README.md) · [关系图](docs/methodology/DOCUMENT_MAP_v1_zh.md) · [路线 ROADMAP](docs/methodology/ROADMAP_v1_zh.md) |
177
181
  | **本体** | [DESIGN_ONTOLOGY v1.2](docs/methodology/product/DESIGN_ONTOLOGY_v1_zh.md) |
178
- | **落地** | [P0 差距](docs/methodology/execution/P0_V0.2_GAP.md) · [金样验收](examples/demo_checkout/ACCEPTANCE.md) · [ETCLOVG 映射](docs/ETCLOVG_MAPPING_v1_zh.md) |
182
+ | **使用** | [**USER_GUIDE v1.0**](docs/USER_GUIDE_v1.0_zh.md) · [P0 差距](docs/methodology/execution/P0_V0.2_GAP.md) · [金样验收](examples/demo_checkout/ACCEPTANCE.md) · [ETCLOVG 映射](docs/ETCLOVG_MAPPING_v1_zh.md) |
179
183
  | **远期** | [HGM 草案](docs/methodology/graph/HARNESS_GRAPH_MODEL_design_v0_zh.md) |
180
184
  | **接入** | [ONBOARDING](docs/ONBOARDING.md) · [ARCHITECTURE](docs/ARCHITECTURE.md) |
181
185
 
package/bin/harness.js CHANGED
@@ -2,6 +2,6 @@
2
2
  import { runCli } from '../lib/cli.js';
3
3
 
4
4
  runCli(process.argv.slice(2)).catch((err) => {
5
- console.error(err.message || err);
5
+ if (err.message) console.error(err.message);
6
6
  process.exit(typeof err.exitCode === 'number' ? err.exitCode : 1);
7
7
  });
@@ -42,28 +42,31 @@ cd your-project
42
42
 
43
43
  ## 2.2 ICVO 机械审计(v1.0+)
44
44
 
45
- `harness audit` 在 30 执行前扫描人工闸与测试声明,确保 ICVO 公理可机械检查:
45
+ `npx @cyning/harness verify` 在 30 执行前聚合扫描人工闸与测试声明,确保 ICVO 公理可机械检查:
46
46
 
47
47
  ```bash
48
- # 扫描 active task HG-AUDIT-R1 / HG-GRAPH-MODULES / HG-RELEASE
49
- npx @cyning/harness audit --target /path/to/your-repo
48
+ # 30 前聚合验证(gate-check + audit D5 + S5 warn + 可选 --graph)
49
+ npx @cyning/harness verify --target /path/to/your-repo
50
+ npx @cyning/harness verify --target /path/to/your-repo \
51
+ --task docs/tasks/active/task_xxx.md
52
+
53
+ # 仅人工闸
54
+ npx @cyning/harness gate-check --target /path/to/your-repo
55
+ npx @cyning/harness gate-check --graph --target /path/to/your-repo
50
56
 
51
- # 指定 task(D5 测试声明检查生效)
57
+ # 指定 task 的 ICVO 审计
52
58
  npx @cyning/harness audit --target /path/to/your-repo \
53
59
  --task docs/tasks/active/task_xxx.md
54
60
 
55
- # 查看 Inform 图谱审核摘要
56
- /path/to/cyning-harness/wizard/gate-check.sh --graph --target /path/to/your-repo
57
-
58
61
  # 生成 invoke 索引(只读聚合,不覆盖 S2 域)
59
- /path/to/cyning-harness/wizard/harness-sync.sh --index --target /path/to/your-repo
62
+ npx @cyning/harness sync index --target /path/to/your-repo
60
63
  ```
61
64
 
62
65
  | 公理 | 检查项 | 行为 |
63
66
  |------|--------|------|
64
- | **D3** | 30 前置人闸 | 复用 `gate-check.sh`,HG-AUDIT-R1 非 approved 时 audit 非 0 |
65
- | **D5** | 改码任务测试声明 | `test_strategy=required` 但无测试/CI 引用时 audit 非 0 |
66
- | **S5** | Git 工作区干净 | dirty 时 warn(不直接 fail audit,但 apply 须 `--force`) |
67
+ | **D3** | 30 前置人闸 | 复用 `gate-check.sh`,HG-AUDIT-R1 非 approved 时 verify 非 0 |
68
+ | **D5** | 改码任务测试声明 | `test_strategy=required` 但无测试/CI 引用时 verify 非 0 |
69
+ | **S5** | Git 工作区干净 | dirty 时 warn(不直接 fail verify,但 apply 须 `--force`) |
67
70
 
68
71
  Audit **不替代** 维护者最终判断;Agent 首输出仍须人工复核。
69
72
 
package/docs/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  | 项 | 内容 |
4
4
  | --- | --- |
5
5
  | **入口** | 本页 → **[方法论总指引](./methodology/README.md)** |
6
- | **接入** | [`ONBOARDING.md`](./ONBOARDING.md) · [`../wizard/README.md`](../wizard/README.md) |
6
+ | **接入** | [**USER_GUIDE v1.0**](./USER_GUIDE_v1.0_zh.md) · [`ONBOARDING.md`](./ONBOARDING.md) · [`../wizard/README.md`](../wizard/README.md) |
7
7
  | **架构** | [`ARCHITECTURE.md`](./ARCHITECTURE.md) |
8
8
 
9
9
  ---
@@ -12,7 +12,7 @@
12
12
 
13
13
  | 读者 | 先读 |
14
14
  | --- | --- |
15
- | **新接入** | ONBOARDINGwizard/install → [`methodology/execution/P0_V0.2_GAP.md`](./methodology/execution/P0_V0.2_GAP.md) |
15
+ | **新接入** | **USER_GUIDE v1.0** ONBOARDING → [`methodology/execution/P0_V0.2_GAP.md`](./methodology/execution/P0_V0.2_GAP.md) |
16
16
  | **实现 / 扩展** | [`methodology/product/DESIGN_ONTOLOGY_v1_zh.md`](./methodology/product/DESIGN_ONTOLOGY_v1_zh.md) |
17
17
  | **战略 / 开源** | [`methodology/pointers/`](./methodology/pointers/README.md) → 工作区 STRATEGY_* |
18
18
  | **HGM 远期** | [`methodology/graph/`](./methodology/graph/README.md) |
@@ -84,6 +84,7 @@ npx @cyning/harness audit --target . --task docs/tasks/active/task_xxx.md
84
84
 
85
85
  ## 链接
86
86
 
87
+ - **使用手册**:[`docs/USER_GUIDE_v1.0_zh.md`](./USER_GUIDE_v1.0_zh.md)
87
88
  - 文档索引:[`docs/README.md`](./README.md)
88
89
  - 接入:[`docs/ONBOARDING.md`](./ONBOARDING.md)
89
90
  - 路线:[`docs/methodology/ROADMAP_v1_zh.md`](./methodology/ROADMAP_v1_zh.md)
@@ -0,0 +1,87 @@
1
+ # Release v1.0.1 · A5 CLI verify(A+C+D)
2
+
3
+ > **包名**:`@cyning/harness@1.0.1`
4
+ > **许可**:MIT
5
+ > **日期**:2026-06-16
6
+ > **代号**:A5 · CLI verify patch(v1.0.0 → v1.0.1)
7
+
8
+ ---
9
+
10
+ ## 概要
11
+
12
+ v1.0.0 已能 `npx init/upgrade/audit`,但业务仓若无 clone 路径或 `CYNING_HARNESS` 环境变量,Agent/维护者须手拼路径。v1.0.1 让 **任意业务仓直接跑** `npx @cyning/harness verify` / `gate-check` / `sync index`,通过 `.cyning-harness/local.json` 自动定位产品包根;并新增 Node 仓可选 `--with-scripts` 把 harness 命令写入 `package.json`。
13
+
14
+ ---
15
+
16
+ ## Quick Start
17
+
18
+ 在 **目标业务仓根**:
19
+
20
+ ```bash
21
+ # 首次接入
22
+ npx @cyning/harness@1.0.1 init --preset harness-only --ide cursor,agents --yes
23
+
24
+ # 30 前验证 npx @cyning/harness verify --target . --task docs/tasks/active/task_xxx.md
25
+
26
+ # 升级
27
+ npx @cyning/harness@1.0.1 upgrade --target . --yes
28
+ ```
29
+
30
+ Node 仓可选 scripts 路径:
31
+
32
+ ```bash
33
+ npx @cyning/harness@1.0.1 upgrade --target . --yes --with-scripts --pm pnpm
34
+ pnpm install
35
+ pnpm harness:verify --task docs/tasks/active/task_xxx.md
36
+ ```
37
+
38
+ ---
39
+
40
+ ## 新增命令
41
+
42
+ | 命令 | 用途 |
43
+ | --- | --- |
44
+ | `npx @cyning/harness gate-check` | 业务仓人工闸(透传 `wizard/gate-check.sh`) |
45
+ | `npx @cyning/harness verify` | 30 前聚合:gate-check + audit D5 + S5 warn + 可选 `--graph` |
46
+ | `npx @cyning/harness sync index` | 生成 `.cyning-harness/invoke_index.json` |
47
+ | `npx @cyning/harness --version` / `-V` | 显示当前包版本 |
48
+
49
+ ## 新增 flag
50
+
51
+ | flag | 命令 | 说明 |
52
+ | --- | --- | --- |
53
+ | `--with-scripts` | `init` · `upgrade` | 写入 `devDependencies['@cyning/harness']` 与三 scripts |
54
+ | `--pm pnpm\|npm\|yarn\|auto` | `init` · `upgrade` | 仅用于提示与文档;scripts 值统一调用 `node_modules/.bin/harness` |
55
+
56
+ ---
57
+
58
+ ## 主要变更文件
59
+
60
+ - `lib/paths.js`:`resolveHarnessRootForTarget`
61
+ - `lib/audit.js`:使用统一根解析
62
+ - `lib/verify.js`:新增
63
+ - `lib/package-scripts.js`:新增
64
+ - `lib/cli.js`:子命令路由 + help/version
65
+ - `wizard/install.sh` · `wizard/upgrade.sh`:写 `QUICKREF.md`
66
+ - `harness/templates/QUICKREF_v1_zh.md`:新增
67
+ - `docs/USER_GUIDE_v1.0_zh.md` · `README.md` · `docs/ONBOARDING.md` · `wizard/README.md`
68
+ - IDE 片段:AGENTS / CLAUDE / Cursor
69
+
70
+ ---
71
+
72
+ ## 非范围
73
+
74
+ - `.cyning-harness/bin` stub 全套(方案 B)→ backlog
75
+ - 改 compliance-bench S1–S4 语义
76
+ - init 时自动 `pnpm install`
77
+ - 自动写 shell alias(~/.zshrc)
78
+
79
+ ---
80
+
81
+ ## HG-RELEASE
82
+
83
+ - [ ] git tag `v1.0.1`
84
+ - [ ] npm publish `@cyning/harness@1.0.1`
85
+ - [ ] 可选 GitHub Release v1.0.1
86
+
87
+ 由维护者执行。
@@ -0,0 +1,284 @@
1
+ # cyning-harness v1.0 · 使用手册
2
+
3
+ > **读者**:要在 **自己的业务仓库** 里落地 AI 辅助研发纪律的开发者(非 cyning-harness 维护者)。
4
+ > **版本**:[`@cyning/harness@1.0.1`](https://www.npmjs.com/package/@cyning/harness) · MIT
5
+ > **仓库**:<https://github.com/Cyning12/cyning-harness>
6
+ > **更短入口**:[`README.md`](../README.md) Quick Start · [`ONBOARDING.md`](./ONBOARDING.md) 接入细节
7
+ > **Release**:[`RELEASE_v1.0.1.md`](./RELEASE_v1.0.1.md) · [`CHANGELOG.md`](../CHANGELOG.md)
8
+
9
+ ---
10
+
11
+ ## 1. 这是什么 · 不是什么
12
+
13
+ **cyning-harness** 是一套可嵌入任意 Git 仓库的 **SDD 过程纪律包**:
14
+
15
+ - 提供:task 模板、审核 prompt、人工闸约定、同步脚本、CI 样例、架构图谱模板
16
+ - **不提供**:业务代码、LLM API、Agent 编排 SDK(与 LangChain 等 **互补**)
17
+
18
+ **v1.0 解决什么问题**:陌生人不仅能在空仓库 `npx init`,还能用 **`audit` / `gate-check` / `sync --index`** 机械检查「Inform / Constrain / Verify / Orchestrate(ICVO)」是否在仓库里就绪,而不是只靠口头约定。
19
+
20
+ ---
21
+
22
+ ## 2. 前置条件
23
+
24
+ | 项 | 要求 |
25
+ | --- | --- |
26
+ | Git | 目标业务仓已是 Git 仓库(或 `git init` 后使用) |
27
+ | Node.js | 能运行 `npx`(仅安装/升级 CLI 时需要) |
28
+ | IDE | 推荐带 Agent 的编辑器(Cursor、Claude Code 等) |
29
+ | 工程习惯 | 至少有 lint、test 或 build 之一(便于对齐 `ci/` 样例) |
30
+
31
+ ---
32
+
33
+ ## 3. 五分钟上手(推荐路径)
34
+
35
+ 在 **你的业务仓库根目录** 执行(**不要**在 clone 下来的 `cyning-harness` 产品仓根跑 `npx`,会报 `harness: command not found`):
36
+
37
+ ```bash
38
+ # 1. 首次安装(钉 preset 与 IDE 入口)
39
+ npx @cyning/harness@1.0.1 init --preset harness-only --ide cursor,agents --yes
40
+
41
+ # 2. 30 前验证(gate-check + audit D5 + S5 warn)
42
+ npx @cyning/harness verify --target . --task docs/tasks/active/task_xxx.md
43
+
44
+ # 3. 产品包升级时(拉取模板更新)
45
+ npx @cyning/harness upgrade --yes
46
+ ```
47
+
48
+ **安装后你会得到**(典型):
49
+
50
+ ```text
51
+ your-repo/
52
+ ├── .cyning-harness/
53
+ │ ├── manifest.json # 钉住的 harness 版本与 preset
54
+ │ └── profile.json # 同步轨道配置
55
+ ├── docs/
56
+ │ ├── tasks/active/ # 你的 task 单(Agent 不覆盖)
57
+ │ ├── tasks/done/ # 关账归档
58
+ │ ├── harness/prompts/ # Starter 四帽 10/22/30/40
59
+ │ ├── harness/invokes/ # 执行快照约定
60
+ │ ├── _tech_graph/ # 架构图谱(按需填写)
61
+ │ ├── coding_wiki/ # LLM 读序
62
+ │ └── standards/ # 编码规范模板
63
+ └── AGENTS.md 等 IDE 入口片段
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 4. 典型 SDD 工作流(Starter 四帽)
69
+
70
+ ```text
71
+ 10 需求/任务分析 → 22 任务审核 → gate-check → 30 执行编码 → 40 自检 → 关账
72
+ ↑ ↑ ↑
73
+ prompts/10 落盘 reviews/ HG-AUDIT-R1 = approved
74
+ ```
75
+
76
+ ### 4.1 新建一张 task
77
+
78
+ 1. 复制 [`docs/harness/templates/`](../harness/templates/) 或金样 [`task_demo_p0_golden_v1.md`](../examples/demo_checkout/task_demo_p0_golden_v1.md) 到 `docs/tasks/active/task_xxx.md`
79
+ 2. 填写:背景、范围、验收标准、`test_strategy`(`required` / `recommended` / `not_applicable`)
80
+ 3. 在 task 表填写 **人工闸**(至少 `HG-TASK-DRAFT`、`HG-AUDIT-R1`)
81
+
82
+ ### 4.2 在 IDE 里执行
83
+
84
+ 1. `@` 你的 task 文件 + `@docs/harness/prompts/10-requirements.md` → 产出需求/范围(帽说明见 [`harness/prompts/README.md`](../harness/prompts/README.md))
85
+ 2. `@` [`22-task-audit.md`](../harness/prompts/22-task-audit.md) → 审核员落盘 `docs/harness/reviews/` · 维护者签 **`HG-AUDIT-R1 = approved`**
86
+ 3. **30 之前** 跑 gate-check(见 §5)
87
+ 4. `@` [`30-execute-code.md`](../harness/prompts/30-execute-code.md) → 改代码
88
+ 5. `@` [`40-self-check.md`](../harness/prompts/40-self-check.md) → 命令证据 · 回填 task
89
+ 6. 关账:`git mv` task → `docs/tasks/done/<domain>/`(见 [`ONBOARDING.md`](./ONBOARDING.md) §6 · [`FRAGMENT_task_domain_infer`](../harness/templates/FRAGMENT_task_domain_infer_v1_zh.md))
90
+
91
+ ### 4.3 练手金样(零风险)
92
+
93
+ 不碰生产仓库时,在 `/tmp` 跑通一遍:
94
+
95
+ ```bash
96
+ mkdir -p /tmp/harness-demo && cd /tmp/harness-demo && git init -q
97
+ npx @cyning/harness@1.0.1 init --preset harness-only --ide cursor,agents --yes
98
+ # 30 前验证:npx @cyning/harness verify --target . --task docs/tasks/active/task_demo_p0_golden_v1.md
99
+ # 金样 task(二选一):
100
+ # · 已 clone 产品仓:cp /path/to/cyning-harness/examples/demo_checkout/task_demo_p0_golden_v1.md docs/tasks/active/
101
+ # · 仅 npx:从 GitHub 浏览 examples/demo_checkout/ 复制 task 内容
102
+ # 逐步验收:examples/demo_checkout/ACCEPTANCE.md(见下方链接)
103
+ ```
104
+
105
+ 分步勾选:[`examples/demo_checkout/README.md`](../examples/demo_checkout/README.md) · [`ACCEPTANCE.md`](../examples/demo_checkout/ACCEPTANCE.md) · 差距说明 [`P0_V0.2_GAP.md`](./methodology/execution/P0_V0.2_GAP.md)
106
+
107
+ ---
108
+
109
+ ## 5. 人工闸与 gate-check(30 前必做)
110
+
111
+ **原则**:Agent 可以写 task 和 review,**人工闸只有维护者能签**。
112
+
113
+ ```bash
114
+ # 30 前聚合验证(gate-check + audit D5 + S5 warn + 可选 --graph)
115
+ npx @cyning/harness verify --target . --task docs/tasks/active/task_xxx.md
116
+
117
+ # 仅人工闸
118
+ npx @cyning/harness gate-check --target . --task docs/tasks/active/task_xxx.md
119
+ npx @cyning/harness gate-check --graph --target . # Inform 图谱闸
120
+
121
+ # 等价底层脚本(离线 clone 产品仓路径 · 见 wizard/README)
122
+ /path/to/cyning-harness/wizard/gate-check.sh --target .
123
+ ```
124
+
125
+ 脚本说明:[`wizard/README.md`](../wizard/README.md) · [`wizard/gate-check.sh`](../wizard/gate-check.sh)
126
+
127
+ | 闸 ID | 含义 | 30 影响 |
128
+ | --- | --- | --- |
129
+ | `HG-AUDIT-R1` | 22 审核通过 | **非 approved → 拒 30** |
130
+ | `HG-TASK-DRAFT` | task 初稿维护者签 | pending 且 blocks 含 30 → 拒 30 |
131
+ | `HG-GRAPH-MODULES` | 架构模块表人签 | pending → 拒改码 30 |
132
+ | `HG-RELEASE` | 发版闸(产品仓) | 一般业务仓不涉及 |
133
+
134
+ **Inform 图谱闸(v1.0)**:改码类 task 前,确保 `docs/_tech_graph/` 模块表已维护者签 `HG-GRAPH-MODULES = approved`。存量大仓可按 [`ONBOARDING.md`](./ONBOARDING.md) §3 选 S0–S3 档位,**不必一次画完所有 Mermaid**。
135
+
136
+ ---
137
+
138
+ ## 6. v1.0 CLI 命令速查
139
+
140
+ | 命令 | 用途 |
141
+ | --- | --- |
142
+ | `npx @cyning/harness init` | 首次安装模板与 manifest(可选 `--with-scripts`) |
143
+ | `npx @cyning/harness upgrade` | 同步产品包更新(可加 `--gate-check` 先 audit) |
144
+ | `npx @cyning/harness check` | 检查是否有新版本 |
145
+ | `npx @cyning/harness verify` | 30 前聚合:gate-check + audit D5 + S5 warn + 可选 `--graph` |
146
+ | `npx @cyning/harness gate-check` | 仅人工闸(`--graph` / `--json`) |
147
+ | `npx @cyning/harness audit` | ICVO 机械审计(D3/D5/S5) |
148
+ | `npx @cyning/harness sync index` | 生成 `.cyning-harness/invoke_index.json` |
149
+ | [`harness-sync.sh`](../wizard/harness-sync.sh) `plan/apply` | 预览/应用模板同步 |
150
+
151
+ **ICVO audit 检查什么**:
152
+
153
+ | 公理 | 行为 |
154
+ | --- | --- |
155
+ | **D3** | 30 前人闸 · 同 gate-check |
156
+ | **D5** | `test_strategy=required` 须有测试路径或 CI 引用 |
157
+ | **S5** | 工作区 dirty 时 warn;`sync apply` 须 `--force` 明示 |
158
+
159
+ Audit **不替代** 维护者判断;22 内容质量仍须人读 review。详见 [`ONBOARDING.md`](./ONBOARDING.md) §2.2。
160
+
161
+ ### 6.1 SDD-Compliance bench(维护者 · 可选)
162
+
163
+ > **业务仓日常不必跑**;用于验证 `gate-check` / `sync` 公理行为,或对照 README「试点证据」中的 bench 数字。
164
+
165
+ 仅在 **clone 下来的 cyning-harness 产品仓根** 执行:
166
+
167
+ ```bash
168
+ cd /path/to/cyning-harness
169
+ ./wizard/compliance-bench.sh --all # 逐项解释 + 摘要(推荐人工看)
170
+ ./wizard/compliance-bench.sh --quiet --all # stdout 仅合规率数字;说明在 stderr
171
+ ```
172
+
173
+ | 输出 | 含义 |
174
+ | --- | --- |
175
+ | **`100`** | S1–S4 四个合成场景全 PASS · **不是** LLM 解题分数 |
176
+ | **`< 100`** | 有场景 FAIL · 见 `--all` 输出或 stderr 摘要表 |
177
+
178
+ 场景与公理解读:[`examples/compliance_bench/README.md`](../examples/compliance_bench/README.md) · 脚本 [`wizard/compliance-bench.sh`](../wizard/compliance-bench.sh)
179
+
180
+ ---
181
+
182
+ ## 7. 同步边界(重要 · S2)
183
+
184
+ `harness-sync` **不会覆盖** 你的业务数据:
185
+
186
+ - `docs/tasks/**`
187
+ - `docs/harness/reviews/**`
188
+ - `docs/harness/invokes/by-task/**`(按 task 域的执行快照)
189
+
190
+ 纪律层(prompts 模板、wizard 脚本引用)与业务 task **分离**。升级产品包前建议:
191
+
192
+ ```bash
193
+ git status # 应干净,或知晓 S5 warn
194
+ npx @cyning/harness upgrade --yes
195
+ ```
196
+
197
+ ---
198
+
199
+ ## 8. Preset 怎么选
200
+
201
+ | preset | 适合 |
202
+ | --- | --- |
203
+ | **`harness-only`**(默认) | 任意栈 · 只要 SDD 过程轨 + IDE 入口 |
204
+ | `fullstack-node-py` | Node 前端 + Python 后端全栈五轨 |
205
+ | `oss-fork-meta` | 个人 OSS fork · 过程轨与 upstream 双分支(见 [`examples/oss-fork/README.md`](../examples/oss-fork/README.md)) |
206
+
207
+ 交互式问卷:`wizard/install.sh`(离线 clone 路径)。
208
+
209
+ ---
210
+
211
+ ## 9. 离线 / 无 npx 环境
212
+
213
+ ```bash
214
+ git clone https://github.com/Cyning12/cyning-harness.git
215
+ cd your-project
216
+ /path/to/cyning-harness/wizard/install.sh --target . --preset harness-only --ide cursor,agents
217
+ /path/to/cyning-harness/wizard/harness-sync.sh apply --target .
218
+ ```
219
+
220
+ 维护者在 **产品仓根** 验证 CLI:
221
+
222
+ ```bash
223
+ npm run harness -- check --target /tmp/foo
224
+ # 或 node bin/harness.js audit --target /path/to/your-repo
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 10. 局限与诚实边界(v1.0)
230
+
231
+ | 项 | 说明 |
232
+ | --- | --- |
233
+ | 不是胜率工具 | [`README` 试点证据 B2](../README.md) · 完整表 [`PILOT_EVIDENCE_B2_v1_zh.md`](./methodology/execution/PILOT_EVIDENCE_B2_v1_zh.md) · **小样本机制证据**,不可外推 |
234
+ | bench `100` | [SDD-Compliance](../examples/compliance_bench/README.md) 四场景合规率 · 见上文 §6.1 |
235
+ | Extended 帽 | 00/50/链式 PROMPT 不在 Starter 默认包 · 见 [`harness/prompts/README.md`](../harness/prompts/README.md) |
236
+ | HGM / 图数据库 | **Track G · v2.0+ 提案**,v1.0 未实现 |
237
+ | Agent-shell | 研究轨 #9,非 npm 功能 |
238
+ | rejected→draft | bench S5 场景 v1 未纳入;gate-check 对非 approved 拒 30 |
239
+
240
+ ---
241
+
242
+ ## 11. 常见问题
243
+
244
+ **Q:Harness 会调用我的 LLM 吗?**
245
+ A:不会。LLM 在你使用的 IDE 里;Harness 只提供文件、脚本与约定。
246
+
247
+ **Q:必须用完 10→22→30→40 才能提交代码吗?**
248
+ A:团队自定。Starter 设计是 **改码前 22 审核 + gate-check**;小修可标 `test_strategy=not_applicable` 并写理由。
249
+
250
+ **Q:和 `.cursor/rules` 什么关系?**
251
+ A:`init --ide cursor` 会生成入口片段;Harness task + prompts 是 **任务级 SDD**,rules 是 **编辑器级约束**,可同时用。
252
+
253
+ **Q:升级后 task 会被覆盖吗?**
254
+ A:不会(S2 域)。若 prompts 模板有更新,apply 会更新 **模板侧**,不删你的 active task。
255
+
256
+ **Q:如何贡献或报 issue?**
257
+ A:GitHub [Cyning12/cyning-harness](https://github.com/Cyning12/cyning-harness) · MIT。
258
+
259
+ ---
260
+
261
+ ## 12. 进一步阅读
262
+
263
+ | 优先级 | 文档 |
264
+ | --- | --- |
265
+ | **本手册** | 你正在读 · 对外入口 [`docs/README.md`](./README.md) |
266
+ | **接入** | [`ONBOARDING.md`](./ONBOARDING.md) · [`wizard/README.md`](../wizard/README.md) · [`wizard/ONBOARDING_wizard_v1_zh.md`](../wizard/ONBOARDING_wizard_v1_zh.md) |
267
+ | **练手** | [`demo_checkout/README.md`](../examples/demo_checkout/README.md) · [`ACCEPTANCE.md`](../examples/demo_checkout/ACCEPTANCE.md) |
268
+ | **合规 bench** | [`examples/compliance_bench/README.md`](../examples/compliance_bench/README.md) |
269
+ | **理论** | [`methodology/README.md`](./methodology/README.md) · [`DESIGN_ONTOLOGY_v1_zh.md`](./methodology/product/DESIGN_ONTOLOGY_v1_zh.md) |
270
+ | **路线** | [`methodology/ROADMAP_v1_zh.md`](./methodology/ROADMAP_v1_zh.md) |
271
+ | **试点证据** | [`PILOT_EVIDENCE_B2_v1_zh.md`](./methodology/execution/PILOT_EVIDENCE_B2_v1_zh.md) |
272
+ | **ETCLOVG** | [`ETCLOVG_MAPPING_v1_zh.md`](./ETCLOVG_MAPPING_v1_zh.md) |
273
+ | **架构** | [`ARCHITECTURE.md`](./ARCHITECTURE.md) |
274
+ | **变更** | [`CHANGELOG.md`](../CHANGELOG.md) · [`RELEASE_v1.0.0.md`](./RELEASE_v1.0.0.md) |
275
+
276
+ ---
277
+
278
+ **修订记录**
279
+
280
+ | 日期 | 说明 |
281
+ | --- | --- |
282
+ | 2026-06-16 | v1.0 stable 首版使用手册 |
283
+ | 2026-06-16 | 补全相对链接 · §6.1 compliance-bench · §12 阅读索引 |
284
+ | 2026-06-16 | v1.0.1:verify / gate-check / sync index CLI · `--with-scripts` · QUICKREF |
@@ -117,7 +117,9 @@ Epic 与子 task 真值:`Projects/docs/harness/tasks/active/`
117
117
  | #6 A3 public push | v0.4.0 |
118
118
  | #7 A4 v1.0 | v1.0.0 · 引用 #8 |
119
119
  | **#8 B2 + bench** | Track B · **1+3 主证据** · P0 绿后优先 |
120
- | **#9 Agent-shell** | Track B · **2 并行** · 核实期 · 不挡 A3 |
120
+ | **#9 Agent-shell** | Track B · **后置** · HGM+agent 后 | deferred · §8 |
121
+ | **I-YAML** | Track A · v1.1+ Inform | [`task_y1`](../../../../docs/harness/tasks/active/task_cyning_harness_y1_yaml_inform_v19_v1.md) · YAML P0 后 |
122
+ | **Track G G1** | HGM v2.0 | [`task_g1`](../../../../docs/harness/tasks/active/task_cyning_harness_g1_hgm_v2_v1.md) · I-YAML + G0 后 |
121
123
 
122
124
  **证据策略(2026-06-15 锁定)**:
123
125
 
@@ -134,6 +136,24 @@ Epic 与子 task 真值:`Projects/docs/harness/tasks/active/`
134
136
 
135
137
  ---
136
138
 
139
+ ## 8. Post-v1.0 执行序(2026-06-16)
140
+
141
+ 维护者决策真值:工作区 [`POST_V1_0_SEQUENCE_v1_zh.md`](../../../../docs/harness/guides/POST_V1_0_SEQUENCE_v1_zh.md) · HGM 讨论 [`HGM_UPGRADE_OUTLINE_v1_zh.md`](./graph/HGM_UPGRADE_OUTLINE_v1_zh.md)
142
+
143
+ | 序 | 里程碑 | 阻塞 |
144
+ | --- | --- | --- |
145
+ | 0 | A5 @1.0.1 · Epic CLOSE · **v1.0 公众号本周发** | — |
146
+ | 1 | Ink 后端 Graph YAML P0 CLOSE | — |
147
+ | 2 | 产品 Inform-YAML **v1.1+**(2.0 前) | 1 |
148
+ | 3 | HGM G0 大纲讨论 + schema 冻结 | 1 |
149
+ | 4 | HGM G1 **v2.0** ingest | 2 + 3 |
150
+ | 5 | cyning-harness-agent 基础 | 4 · 待立项 |
151
+ | 6 | B9 Agent-shell findings | 5 |
152
+
153
+ **原则**:Inform YAML 在 v2.0 前并入主轨 · HGM 在后端 YAML 试点后启动 · B9 最后。
154
+
155
+ ---
156
+
137
157
  ## 7. 修订记录
138
158
 
139
159
  | 版本 | 日期 | 说明 |
@@ -146,3 +166,4 @@ Epic 与子 task 真值:`Projects/docs/harness/tasks/active/`
146
166
  | v1.3.2 | 2026-06-15 | P0 金样关账 · v0.2→v0.3 首闸满足 · A1 next |
147
167
  | v1.3.3 | 2026-06-15 | A1 实现关账 · A2 next · v0.3.0 表标注 |
148
168
  | v1.4 | 2026-06-15 | **SEM-02**:HGM Track G **v0.5/v0.6 → v2.x** · 增 §2.0 命名纪律 |
169
+ | v1.5 | 2026-06-16 | 增 §8 Post-v1.0 序 · I-YAML v1.1+ · B9 后置 · 链 HGM 大纲 |
@@ -9,6 +9,7 @@
9
9
  | **范围** | 过程轨 **实例** 的显式图 + 事件历史 + 公理可查询 |
10
10
  | **非范围** | 替代 Git/Markdown 真值 · 替代 LLM Runtime · `**GraphTrack` 架构图**(见 §0.3) |
11
11
  | **依赖** | [`../product/DESIGN_ONTOLOGY_v1_zh.md`](../product/DESIGN_ONTOLOGY_v1_zh.md) v1.2 · P0 金样路径已建(ACCEPTANCE 待绿)· v0.3 `ontology.yaml`(未实现)· v1.0 `gate-check --graph`(Inform · 未实现) |
12
+ | **升级大纲** | [`HGM_UPGRADE_OUTLINE_v1_zh.md`](./HGM_UPGRADE_OUTLINE_v1_zh.md) · G0 讨论入口(2026-06-16) |
12
13
  | **思想来源** | [`HARNESS_GRAPH_MODEL_dialogue_archive_v1_zh.md`](./HARNESS_GRAPH_MODEL_dialogue_archive_v1_zh.md) |
13
14
 
14
15