@hunter-harness/workflow-harness 0.2.41 → 0.2.42
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/harness/bundles/general/claude-code/.harness-build.json +1 -1
- package/harness/bundles/general/claude-code/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +42 -16
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/claude-code/harness-sync/reference.md +34 -14
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/codebuddy/harness-sync/reference.md +34 -14
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codex/.harness-build.json +1 -1
- package/harness/bundles/general/codex/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/general/codex/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/codex/harness-sync/reference.md +34 -14
- package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/cursor/.harness-build.json +1 -1
- package/harness/bundles/general/cursor/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/general/cursor/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/cursor/harness-sync/reference.md +34 -14
- package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/.harness-build.json +1 -1
- package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +42 -16
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/claude-code/harness-sync/reference.md +34 -14
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/codebuddy/harness-sync/reference.md +34 -14
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codex/.harness-build.json +1 -1
- package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/java/codex/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/codex/harness-sync/reference.md +34 -14
- package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/cursor/.harness-build.json +1 -1
- package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/java/cursor/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/cursor/harness-sync/reference.md +34 -14
- package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
- package/harness/manifests/general/claude-code.json +19 -19
- package/harness/manifests/general/codebuddy.json +19 -19
- package/harness/manifests/general/codex.json +19 -19
- package/harness/manifests/general/cursor.json +19 -19
- package/harness/manifests/java/claude-code.json +21 -21
- package/harness/manifests/java/codebuddy.json +21 -21
- package/harness/manifests/java/codex.json +21 -21
- package/harness/manifests/java/cursor.json +21 -21
- package/hunter-workflow-family.json +10 -10
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-knowledge-query
|
|
25
25
|
|
|
26
26
|
并行 change 中查询必须传 `--change <change-id>`;成功后以该 change 的 `meta/knowledge-context.json` 为稳定指针。全局 `context-packs/latest.json` 仅向后兼容,不得用于判断多个 active change 的上下文归属。
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-plan — 需求规划
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -21,7 +21,7 @@ disallowed-tools:
|
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
- Bash(codegraph *)
|
|
23
23
|
---
|
|
24
|
-
<!-- generated by harness_deploy.py; core=
|
|
24
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
25
25
|
# harness-review — 代码审查
|
|
26
26
|
|
|
27
27
|
## Purpose
|
|
@@ -21,7 +21,7 @@ disallowed-tools:
|
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
- Bash(codegraph *)
|
|
23
23
|
---
|
|
24
|
-
<!-- generated by harness_deploy.py; core=
|
|
24
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
25
25
|
# harness-run — 需求编码
|
|
26
26
|
|
|
27
27
|
## Purpose
|
|
@@ -20,7 +20,7 @@ disallowed-tools:
|
|
|
20
20
|
- Bash(awk *)
|
|
21
21
|
- Bash(curl *)
|
|
22
22
|
---
|
|
23
|
-
<!-- generated by harness_deploy.py; core=
|
|
23
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
24
24
|
# harness-submit — 最终提交(含 worktree 合并)
|
|
25
25
|
|
|
26
26
|
## Purpose
|
|
@@ -19,7 +19,7 @@ disallowed-tools:
|
|
|
19
19
|
- Bash(awk *)
|
|
20
20
|
- Bash(curl *)
|
|
21
21
|
---
|
|
22
|
-
<!-- generated by harness_deploy.py; core=
|
|
22
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
23
23
|
# harness-sync
|
|
24
24
|
|
|
25
25
|
## Purpose
|
|
@@ -28,13 +28,10 @@ disallowed-tools:
|
|
|
28
28
|
|
|
29
29
|
## Before running
|
|
30
30
|
|
|
31
|
-
读取 `reference.md
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
工作流要求 `sync@1`、`rules-sync@1`、`rules-review@1`、`knowledge-sync@2`。`BLOCKED_CAPABILITY_MISMATCH` 属环境阻塞,不得降级为手工拼接旧流程。
|
|
31
|
+
读取 `reference.md`。`sync` 自身会在任何重操作之前完成能力握手;不要另起一个
|
|
32
|
+
`capabilities` 进程。工作流要求 `sync@2`、`rules-sync@1`、`rules-review@1`、
|
|
33
|
+
`knowledge-sync@3`、`codegraph-status@2`。`BLOCKED_CAPABILITY_MISMATCH` 属环境阻塞,
|
|
34
|
+
不得降级为手工拼接旧流程。
|
|
38
35
|
|
|
39
36
|
## Run
|
|
40
37
|
|
|
@@ -44,17 +41,26 @@ npx hunter-harness sync --project <项目路径> --profile interactive --progres
|
|
|
44
41
|
|
|
45
42
|
CLI 负责 Python runtime 解析、投影事务、knowledge、rules、map、指令图、配置来源、change 状态及 CodeGraph 证据汇总。禁止直接调用内部 Python 脚本,禁止使用固定 `HEAD~5`,禁止自动全量重建 CodeGraph。
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
只读诊断使用 `--check`(`--dry-run` 为兼容别名);它不得写报告、receipt 或投影。
|
|
45
|
+
长阶段的 heartbeat 写 stderr;stdout 只保留紧凑摘要。完整报告写入摘要中的
|
|
46
|
+
`reportPath`,并带 `reportSha256`。需要组件级证据时显式加 `--verbose`,不得默认把完整
|
|
47
|
+
JSON 报告回显到对话。
|
|
48
|
+
|
|
49
|
+
摘要中的 `remediations[]` 是稳定修复契约。先用对应 `previewCommand` 预览;低风险修复用
|
|
50
|
+
`--apply safe`,指定修复用 `--fix <id>`。需覆盖受管投影的修复必须同时提供 `--yes`,
|
|
51
|
+
并依赖 refresh 事务留下的 before snapshot;不允许绕过确认或无备份覆盖。指定修复时,
|
|
52
|
+
无关组件只做只读评估,不得顺带写入。
|
|
48
53
|
|
|
49
54
|
## Interpret
|
|
50
55
|
|
|
51
56
|
- `OK`:所有可验证组件通过。
|
|
57
|
+
- `ADVISORY`:索引最新,但有待评审候选等非阻塞健康提示;退出码仍为 0。
|
|
52
58
|
- `WARN`:存在过期、冲突、待评审或 `UNKNOWN` 证据;按 `reportPath` 中的 `nextAction` 处理。
|
|
53
59
|
- `FAIL`:组件执行失败;不得宣称同步完成。
|
|
54
60
|
- `BLOCKED`:runtime、项目状态或能力契约阻塞;先修复阻塞条件。
|
|
55
61
|
- `UNKNOWN`:证据不足,不等于成功,也不触发无界重建。
|
|
56
62
|
|
|
57
|
-
非交互或 CI 使用 `--profile general --progress jsonl --json`,不得等待规则候选确认。交互式运行若报告规则待评审,再按 `reference.md` 的显式入口处理。
|
|
63
|
+
非交互或 CI 使用 `--check --profile general --progress jsonl --json`,不得等待规则候选确认。交互式运行若报告规则待评审,再按 `reference.md` 的显式入口处理。
|
|
58
64
|
|
|
59
65
|
## Safety
|
|
60
66
|
|
|
@@ -6,13 +6,8 @@ description: harness-sync 的能力契约、统一状态模型、报告收据和
|
|
|
6
6
|
|
|
7
7
|
## 1. 能力握手
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```powershell
|
|
12
|
-
npx hunter-harness capabilities --json
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
工作流 family manifest 声明 `minimumCliVersion` 和 `capabilities`。CLI 在任何高成本阶段之前核对版本与能力;缺失时返回:
|
|
9
|
+
工作流 family manifest 声明 `minimumCliVersion` 和 `capabilities`。`sync` 在任何高成本
|
|
10
|
+
阶段之前自行核对版本与能力;Skill 不要再运行独立的 `capabilities` 子进程。缺失时返回:
|
|
16
11
|
|
|
17
12
|
```json
|
|
18
13
|
{
|
|
@@ -47,22 +42,41 @@ npx hunter-harness sync --project <项目路径> --profile interactive --progres
|
|
|
47
42
|
CI/非交互式:
|
|
48
43
|
|
|
49
44
|
```powershell
|
|
50
|
-
npx hunter-harness sync --project <项目路径> --profile general --progress jsonl --json
|
|
45
|
+
npx hunter-harness sync --check --project <项目路径> --profile general --progress jsonl --json
|
|
51
46
|
```
|
|
52
47
|
|
|
53
|
-
`--dry-run`
|
|
48
|
+
`--check` 是严格只读检查;`--dry-run` 是兼容别名。两者都不生成持久报告、receipt 或
|
|
49
|
+
投影。每个长阶段通过 stderr 输出受限 heartbeat;stdout 默认只输出:
|
|
54
50
|
|
|
55
51
|
```json
|
|
56
52
|
{
|
|
57
53
|
"status": "WARN",
|
|
58
54
|
"runId": "<run-id>",
|
|
59
|
-
"components": {"ok": 7, "
|
|
55
|
+
"components": {"ok": 7, "advisory": 1, "warn": 0, "fail": 0, "blocked": 0, "unknown": 0},
|
|
56
|
+
"versions": {
|
|
57
|
+
"cliVersion": "0.0.0",
|
|
58
|
+
"workflowBundleVersion": "0.0.0",
|
|
59
|
+
"adapterBundleVersions": {}
|
|
60
|
+
},
|
|
61
|
+
"remediations": [],
|
|
60
62
|
"reportPath": ".harness/runtime/sync/<run-id>/reports/sync-report.json",
|
|
61
63
|
"reportSha256": "<sha256>"
|
|
62
64
|
}
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
只读检查的 `reportPath/reportSha256` 为 `null`。详细报告必须受大小限制,并包含每个组件
|
|
68
|
+
的 `status`、`reasonCode`、`observedAt`、`durationMs`、输入/输出 hash、证据、是否自动
|
|
69
|
+
修复及 `nextAction`;只有显式 `--verbose` 才把组件级详情写到 stdout。
|
|
70
|
+
|
|
71
|
+
### 结构化修复
|
|
72
|
+
|
|
73
|
+
- `remediations[]` 含稳定 `id`、风险、写入范围、备份/回滚说明、预计耗时、是否需确认、
|
|
74
|
+
`previewCommand` 与 `applyCommand`。
|
|
75
|
+
- `--apply safe` 只执行低风险、无需确认的修复。
|
|
76
|
+
- `--fix <id>` 只执行该项;需要覆盖受管 Adapter 时必须加 `--yes`。
|
|
77
|
+
- 指定修复时,其他组件仍参与诊断但保持只读。
|
|
78
|
+
- Adapter 覆盖由 refresh 事务执行,before snapshot 位于最新 committed refresh
|
|
79
|
+
transaction;事务失败会自动回滚。预览永远不得产生写入。
|
|
66
80
|
|
|
67
81
|
## 4. 组件状态
|
|
68
82
|
|
|
@@ -77,15 +91,21 @@ npx hunter-harness sync --project <项目路径> --profile general --progress js
|
|
|
77
91
|
| instruction graph | 入口、include 边、环、主题可达性 | 缺失引用或循环为 `FAIL` |
|
|
78
92
|
| config origins | canonical/projection 路径与 hash | 漂移 `WARN`,不静默覆盖 |
|
|
79
93
|
| changes | 五态分类及归档收据 | `INVALID`/`ORPHAN` 不自动删除 |
|
|
80
|
-
| CodeGraph |
|
|
94
|
+
| CodeGraph | `codegraph status --json` 的 pending、数据库观察时间、watcher 可达性 | 输出 `CURRENT/PENDING/STALE/INDEX_PRESENT_UNVERIFIED/MISSING/UNKNOWN`;日志 mtime 只证明 watcher 活动,不证明索引完成;不自动全量 reindex |
|
|
81
95
|
|
|
82
|
-
全局状态优先级:`BLOCKED` → `FAIL` → `WARN` → `OK`。任一 `UNKNOWN`
|
|
96
|
+
全局状态优先级:`BLOCKED` → `FAIL` → `WARN` → `ADVISORY` → `OK`。任一 `UNKNOWN`
|
|
97
|
+
至少使全局结果为 `WARN`。knowledge freshness 与 health 分开:索引一致但仍有待裁决候选时
|
|
98
|
+
为 `ADVISORY`,不得误报为过期。
|
|
83
99
|
|
|
84
100
|
## 5. Git 与 CodeGraph
|
|
85
101
|
|
|
86
102
|
增量基线来自上次成功 sync receipt 的 `headCommit`。首次运行或 receipt 不可用时,仅收集当前 HEAD 和有界文件统计;禁止固定 `HEAD~5`。
|
|
87
103
|
|
|
88
|
-
CodeGraph
|
|
104
|
+
CodeGraph 状态探测优先读取 `codegraph status --json` 的权威 pending 列表;只有该 API
|
|
105
|
+
不可用时才退回受限文件扫描,并把来源标成 `database-scan` 或 `unverified`。`.agents/`、
|
|
106
|
+
`.cursor/`、`.claude/` 等 Adapter 投影和 Markdown 文档不计入源码 pending。daemon log
|
|
107
|
+
mtime 只写入 `watcherObservedAt`,不能冒充 `indexObservedAt`。只有服务可达、watcher 已
|
|
108
|
+
启用且权威 `pendingFileCount=0` 时为 `CURRENT`。不要在 sync 内执行全量索引。
|
|
89
109
|
|
|
90
110
|
## 6. Instruction graph
|
|
91
111
|
|
|
@@ -22,7 +22,7 @@ disallowed-tools:
|
|
|
22
22
|
- Bash(node *)
|
|
23
23
|
- Bash(codegraph *)
|
|
24
24
|
---
|
|
25
|
-
<!-- generated by harness_deploy.py; core=
|
|
25
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=claude-code; do not edit -->
|
|
26
26
|
# harness-test — 测试执行
|
|
27
27
|
|
|
28
28
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-archive
|
|
|
3
3
|
description: 归档所有变更产出(计划/测试报告/审查/SQL/API文档)到
|
|
4
4
|
.harness/archive/,含归档元数据和可视化最终总结。使用场景:归档、完成归档、收尾、打包产出物
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-archive — 变更归档
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-codebase-map
|
|
|
3
3
|
description: 分析现有代码库并生成 .harness/codebase/map/
|
|
4
4
|
下的结构化代码库地图。用于陌生项目理解、重大改造前梳理、harness-sync 提示 map 过期后的人工刷新。
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-codebase-map — 代码库地图
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-knowledge-ingest
|
|
|
3
3
|
description: 从 .harness/archive 归档整理、同步和维护项目知识索引。适用场景:ingest knowledge、sync
|
|
4
4
|
knowledge、rebuild knowledge index、promote knowledge、确认知识条目、检查知识库是否过期。
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=433205be6e827dd9; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-knowledge-ingest
|
|
8
8
|
|
|
9
9
|
从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
|
|
@@ -47,10 +47,12 @@ description: 从 .harness/archive 归档整理、同步和维护项目知识索
|
|
|
47
47
|
.harness/knowledge/entries/superseded/*.json
|
|
48
48
|
.harness/knowledge/entries/conflicted/*.json
|
|
49
49
|
.harness/knowledge/cache/archive-entries/*.json
|
|
50
|
-
.harness/knowledge/reports/ingest-report
|
|
51
|
-
.harness/knowledge/reports/verification-report
|
|
52
|
-
.harness/knowledge/reports/
|
|
53
|
-
.harness/knowledge/reports/
|
|
50
|
+
.harness/knowledge/reports/ingest-report-*.md
|
|
51
|
+
.harness/knowledge/reports/verification-report-*.md
|
|
52
|
+
.harness/knowledge/reports/audit-report-*.md
|
|
53
|
+
.harness/knowledge/reports/judge-export-<content-sha256>.json
|
|
54
|
+
.harness/knowledge/reports/judgements-<content-sha256>.json
|
|
55
|
+
.harness/knowledge/reports/latest.json
|
|
54
56
|
.harness/knowledge/views/knowledge-dashboard.md
|
|
55
57
|
.harness/knowledge/views/by-file.md
|
|
56
58
|
.harness/knowledge/views/stale-items.md
|
|
@@ -67,14 +69,17 @@ description: 从 .harness/archive 归档整理、同步和维护项目知识索
|
|
|
67
69
|
|
|
68
70
|
| 命令 | 用途 |
|
|
69
71
|
|---|---|
|
|
70
|
-
| `auto` | 一键防腐:首建 config、sync --update、**默认**写回 validator 建议、verify、audit;随后由 **Agent** 执行 judge 闭环 |
|
|
72
|
+
| 无参数 / `auto` | 一键防腐:首建 config、sync --update、**默认**写回 validator 建议、verify、audit;随后由 **Agent** 执行 judge 闭环 |
|
|
73
|
+
| `status` | 严格只读地返回 freshness 与 health |
|
|
74
|
+
| `repair all` | 修复可证明的 legacy gate、归一化重复、冲突与报告保留;不确定项返回 `needsConfirmation` |
|
|
71
75
|
| `ingest` | 重建/刷新知识索引,抽取 candidate;`--no-incremental` 强制全量重抽取 |
|
|
72
|
-
| `sync` |
|
|
76
|
+
| `sync --check` | 只读检查 index 与 archive/HEAD 一致性;`--update` 自动刷新 |
|
|
73
77
|
| `promote` | candidate→active(显式 promote 或 autoPromote / judge 触发) |
|
|
74
78
|
| `demote` | active→stale/candidate(显式 demote 或自动降级策略触发) |
|
|
75
79
|
| `audit` | 生成 Candidate/Stale/Superseded/Conflict/Active Review 报告 |
|
|
76
80
|
| `verify` | 执行 entry validators,刷新 lifecycle.validation,生成 verification-report |
|
|
77
81
|
| `suggest-validators` | 生成 file_exists/file_contains validator 建议;`--apply` 写回 entry |
|
|
82
|
+
| `admin <旧命令>` | 旧管理命令兼容入口 |
|
|
78
83
|
| `mcp` | FastMCP stdio 入口,暴露 9 个工具(见 reference.md) |
|
|
79
84
|
|
|
80
85
|
config.json 配置项(autoPromote / confidence / activeLifecycle / knowledgeValidation)详见 `reference.md`「Commands 详细」。
|
|
@@ -109,11 +114,17 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' inges
|
|
|
109
114
|
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' auto --project '<project-root>'"
|
|
110
115
|
```
|
|
111
116
|
|
|
117
|
+
不传子命令时等价于 `auto`。`auto` 输出必须分别报告:
|
|
118
|
+
|
|
119
|
+
- `freshness`:archive、HEAD、manifest、entry、SQLite 是否一致。
|
|
120
|
+
- `health`:各 lifecycle、publication、validation 与待裁决工作量。
|
|
121
|
+
|
|
112
122
|
`auto` 默认会写回确定性 validator 建议(`--no-apply-suggestions` 可关闭)。JSON 返回含 `lifecycle` 摘要(validatorsApplied、autoPromote、pendingAgentJudge 等)。
|
|
113
123
|
|
|
114
124
|
### Phase 3:Agent judge 闭环(auto 之后必须执行)
|
|
115
125
|
|
|
116
|
-
当 `lifecycle.pendingAgentJudge > 0`、存在 `pending-judge` outbox,或 `judge export` 的
|
|
126
|
+
当 `lifecycle.pendingAgentJudge > 0`、存在 `pending-judge` outbox,或 `judge export` 的
|
|
127
|
+
`counts.requiredDecisionCount > 0` 时:
|
|
117
128
|
|
|
118
129
|
1. `judge export`(或读 maintain 产出的 pending judgements)
|
|
119
130
|
2. Agent 读取 export JSON,按 `reference.md`「Agent judge 启发式」批量写 `reports/judge-decisions-<ts>.json`
|
|
@@ -122,12 +133,15 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' auto
|
|
|
122
133
|
|
|
123
134
|
**禁止**默认输出「请人工确认 N 条 candidate」类五步待办清单。拿不准的 candidate 保持 `candidate` 状态留待下轮,记入 `skippedCandidates` 即可。
|
|
124
135
|
|
|
125
|
-
|
|
136
|
+
`pendingAgentJudge`/`requiredDecisionCount` 是完整待裁决总量;`previewCount` 才受
|
|
137
|
+
`config.judge.maxCandidatesPerRun`(默认 100)限制。已被 publication gate 阻断的条目
|
|
138
|
+
只进入 `quarantinedCount`,不得混入 judge export。`defer` 必须保存证据指纹;来源、
|
|
139
|
+
validator、冲突关系或 publication 证据变化后即使未到 `reviewAfter` 也重新进入裁决。
|
|
126
140
|
|
|
127
141
|
### Phase 4:同步检查(可选)
|
|
128
142
|
|
|
129
143
|
```powershell
|
|
130
|
-
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py'
|
|
144
|
+
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' status --project '<project-root>'"
|
|
131
145
|
```
|
|
132
146
|
|
|
133
147
|
当 `upToDate=false` 时,运行 `sync --update` 或重新 `auto`,再交给 `harness-knowledge-query` 查询。
|
|
@@ -136,7 +150,11 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
136
150
|
|
|
137
151
|
仅在用户点名单条、或 `manualReview=true` 需人工确认时使用 `promote` / `demote`。日常归档后不要逐条人工复核。
|
|
138
152
|
|
|
139
|
-
**发布门禁**:
|
|
153
|
+
**发布门禁**:knowledge publication 与 archive release status 独立。promote / judge apply /
|
|
154
|
+
autoPromote 校验 authoritative pointer/hash 与 `reportPipeline.sourceConsistency`;即使归档
|
|
155
|
+
最终状态为 WARN,只要知识来源一致也可发布,但保留 release advisory。旧归档只有在
|
|
156
|
+
summary/hash/source commit 可独立证明时才自动生成 attestation;否则保持 quarantined 并
|
|
157
|
+
返回 `needsConfirmation`(详见 `reference.md`「发布门禁」)。
|
|
140
158
|
|
|
141
159
|
### Phase 6:解释同步结果
|
|
142
160
|
|
|
@@ -146,10 +164,15 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
146
164
|
- 如需刷新,具体原因是 archive 增删、checksum 变化、sqlite 缺失,还是 HEAD 改变。
|
|
147
165
|
- 本次是否自动刷新。
|
|
148
166
|
- 当前 `active` / `candidate` / `stale` 的数量。
|
|
167
|
+
- 分别报告 `freshness` 与 `health`,不要用一个 `status` 覆盖
|
|
168
|
+
lifecycle/review/publication/validation 四个正交维度。
|
|
149
169
|
|
|
150
170
|
## Knowledge extraction rules
|
|
151
171
|
|
|
152
|
-
-
|
|
172
|
+
- 优先读取归档显式 `knowledgeCandidates[]`;维护流水线、测试计数等
|
|
173
|
+
`category=process-observation` 不进入长期知识。
|
|
174
|
+
- Duplicate content 使用 Unicode、空白、标点与大小写归一化指纹,并在全量重建时迁移。
|
|
175
|
+
- 冲突必须同时有相同实体、共享来源范围和双方证据;仅关键词相反不得判为冲突。
|
|
153
176
|
- Keep project-local entries excluded from any global index unless explicitly selected.
|
|
154
177
|
- Validate lifecycle relationships.
|
|
155
178
|
- Default generated entries are `candidate`; only config-gated `autoPromote` may promote high-confidence long-lived entries to `active`.
|
|
@@ -191,7 +214,7 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
191
214
|
本 skill 自带最小测试:
|
|
192
215
|
|
|
193
216
|
```powershell
|
|
194
|
-
powershell.exe -Command "python
|
|
217
|
+
powershell.exe -Command "python 'harness\scripts\harness_test_runner.py' unittest --profile safe --tests-dir '<skill-dir>\tests' --timeout-seconds 300 --verbosity 1"
|
|
195
218
|
```
|
|
196
219
|
|
|
197
220
|
完成脚本修改后必须至少运行该测试。若在真实项目中验证,还应运行:
|
|
@@ -221,13 +244,16 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
221
244
|
- `upToDate` 及 `reasons`(sync)或新增/覆盖条目数(ingest/promote)。
|
|
222
245
|
- 当前 `active` / `candidate` / `stale` 数量统计。
|
|
223
246
|
- 产物路径(`index.json`、`index.sqlite`、`views/`、`reports/`)。
|
|
224
|
-
- `lifecycle` 摘要:`validatorsApplied`、`candidateAutoPromoted
|
|
247
|
+
- `lifecycle` 摘要:`validatorsApplied`、`candidateAutoPromoted`、兼容整数
|
|
248
|
+
`pendingAgentJudge`,以及
|
|
249
|
+
`pendingAgentJudgeSummary.requiredDecisionCount/previewCount/quarantinedCount` 等。
|
|
250
|
+
- validator 摘要:`eligible/selected/applied/remaining/unavailable`,不得只报告本轮抽样数。
|
|
225
251
|
- **已处理报告**(auto + judge 后):promoted/dropped/superseded/kept/deferred/skipped 计数与 `reports/judge-decisions-*.json`、`judgements-*.json` 路径;人工判断还会追加到 `judgements/decisions.json`,后续 ingest 不得抹除。`defer` 必须带 `reviewAfter`,到期前不重复进入待判断清单。
|
|
226
252
|
- 仅当 `upToDate=false` 时建议 `sync --update`;查询历史 → `/harness-knowledge-query`。**禁止**默认列出「请人工确认 N 条 candidate」待办。
|
|
227
253
|
|
|
228
254
|
## 渐进披露
|
|
229
255
|
|
|
230
|
-
- **Read `reference.md`** 仅在执行命令或查阅 config.json 配置时 — 含 Commands
|
|
256
|
+
- **Read `reference.md`** 仅在执行命令或查阅 config.json 配置时 — 含 Commands 详细示例、config.json 配置与兼容说明。
|
|
231
257
|
|
|
232
258
|
## 交互白名单
|
|
233
259
|
|
|
@@ -16,6 +16,9 @@ description: harness-knowledge-ingest 的命令详细示例、config.json 配置
|
|
|
16
16
|
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' auto --project '<project-root>'"
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
省略子命令时也进入 `auto`;旧命令可放在 `admin` 后继续调用,例如
|
|
20
|
+
`admin audit --project <root>`。
|
|
21
|
+
|
|
19
22
|
`auto` 会按默认维护顺序执行:首建 `config.json`(若缺失)、`sync --update`、**默认写回** validator 建议、`verify`、`audit`。首次发现 `.harness/knowledge/config.json` 不存在时,会写入启用版 `autoPromote` + `activeLifecycle.autoDemote` + `knowledgeValidation.autoDemoteActive` + `judge.maxCandidatesPerRun` 配置。
|
|
20
23
|
|
|
21
24
|
关闭 validator 写回:
|
|
@@ -35,7 +38,11 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' auto
|
|
|
35
38
|
|
|
36
39
|
- **conflicted**:优先 `supersede` 较旧/较弱证据方;对称难判 → `keep-conflict` + reason
|
|
37
40
|
- **candidate**:`decision|api-contract|requirement|pitfall` 且 confidence 高 → `promote`;`implementation|test-evidence` 倾向 `drop` 或保持 candidate
|
|
38
|
-
-
|
|
41
|
+
- `requiredDecisionCount` 是完整总量,`previewCount` 才受
|
|
42
|
+
`judge.maxCandidatesPerRun`(默认 100)限制。
|
|
43
|
+
- publication gate 阻断项计入 `quarantinedCount`,不进入待裁决单位。
|
|
44
|
+
- 超出预览窗口的 candidate 计入 `deferredByLimitCount`,不能让
|
|
45
|
+
`pendingAgentJudge` 误报为窗口大小。
|
|
39
46
|
|
|
40
47
|
```powershell
|
|
41
48
|
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' judge --project '<project-root>' --export '<export.json>'"
|
|
@@ -65,15 +72,18 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' inges
|
|
|
65
72
|
### Sync knowledge
|
|
66
73
|
|
|
67
74
|
```powershell
|
|
68
|
-
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py'
|
|
75
|
+
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' status --project '<project-root>'"
|
|
69
76
|
```
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
严格只读地检查 `.harness/knowledge` 是否与 `.harness/archive` 和当前 HEAD 一致。也可用
|
|
79
|
+
兼容命令 `sync --check`。输出 JSON 包含:
|
|
72
80
|
|
|
73
81
|
- `upToDate`
|
|
74
82
|
- `reasons`
|
|
75
83
|
- `archiveCount`
|
|
76
84
|
- `paths`
|
|
85
|
+
- `freshness`
|
|
86
|
+
- `health`(lifecycle/review/publication/validation 四个独立维度)
|
|
77
87
|
|
|
78
88
|
如果希望发现过期后自动刷新:
|
|
79
89
|
|
|
@@ -87,6 +97,24 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
87
97
|
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync --project '<project-root>' --update --no-incremental"
|
|
88
98
|
```
|
|
89
99
|
|
|
100
|
+
### Repair
|
|
101
|
+
|
|
102
|
+
先诊断、不写入:
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' repair all --project '<project-root>' --no-apply"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
执行可证明的修复:
|
|
109
|
+
|
|
110
|
+
```powershell
|
|
111
|
+
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' repair all --project '<project-root>'"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
repair 处理归一化重复、冲突重算、旧 publication gate attestation 与报告保留。旧归档只有在
|
|
115
|
+
authoritative summary/hash 和 source commit 均可独立验证时自动修复;其余项进入
|
|
116
|
+
`needsConfirmation`,不得猜测或静默放行。
|
|
117
|
+
|
|
90
118
|
### Verify knowledge validators
|
|
91
119
|
|
|
92
120
|
```powershell
|
|
@@ -129,7 +157,10 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' verif
|
|
|
129
157
|
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' suggest-validators --project '<project-root>' --limit 20"
|
|
130
158
|
```
|
|
131
159
|
|
|
132
|
-
默认只生成建议和
|
|
160
|
+
默认只生成建议和 content-addressed report,不会改写 entries。结果分别报告
|
|
161
|
+
`eligible/selected/suggested/applied/remaining/unavailable`。建议来源是当前 entry 的
|
|
162
|
+
`scope.sourceFiles`、正文/标题/关键词中的稳定 token,以及项目文件中的实际内容。
|
|
163
|
+
当前只生成安全的 `file_exists` / `file_contains` 建议。
|
|
133
164
|
|
|
134
165
|
如需把建议写入 entry JSON:
|
|
135
166
|
|
|
@@ -145,12 +176,18 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sugge
|
|
|
145
176
|
powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' promote --project '<project-root>' --id '<entry-id>' --note '<人工确认说明>'"
|
|
146
177
|
```
|
|
147
178
|
|
|
148
|
-
**发布门禁(archive publication gate)**:promote / judge apply / autoPromote
|
|
179
|
+
**发布门禁(archive publication gate)**:promote / judge apply / autoPromote 只处理
|
|
180
|
+
knowledge publication 证据通过的条目。它与归档 release status 独立:归档为 WARN 但
|
|
181
|
+
source consistency 与 authoritative pointer/hash 均通过时,知识可以发布,同时保留
|
|
182
|
+
`archiveReleaseEligibility` advisory。以下来源归档会被阻断并在条目上标记
|
|
183
|
+
`lifecycle.publishBlocked`:
|
|
149
184
|
|
|
150
185
|
- 归档 summary 缺少 `reportPipeline.sourceConsistency`(source consistency 未运行)或 `ok=false`;
|
|
151
186
|
- `derived/authoritative.json` pointer 缺失、版本目录不可读,或 repair record / pointer 的 summary hash 不匹配(DEGRADED)。
|
|
152
187
|
|
|
153
|
-
|
|
188
|
+
修复路径:优先运行本 skill 的 `repair legacy-publication-gates`。只有 summary/hash/source
|
|
189
|
+
commit 都可证明时才生成 attestation;否则输出 `needsConfirmation`。也可由 archive repair
|
|
190
|
+
生成通过 validator 的新 derived version,再重新 ingest。
|
|
154
191
|
|
|
155
192
|
将一条 `candidate` 提升为 `active`,写入:
|
|
156
193
|
|
|
@@ -289,6 +326,20 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge_mcp.py'"
|
|
|
289
326
|
|
|
290
327
|
## 变更日志
|
|
291
328
|
|
|
329
|
+
## v1.15 补充能力(sync/knowledge retrospective hardening)
|
|
330
|
+
|
|
331
|
+
- 默认无参数进入 `auto`;新增严格只读 `status`、`sync --check`、`repair all` 与
|
|
332
|
+
`admin <legacy-command>` 兼容入口。
|
|
333
|
+
- 显式 `knowledgeCandidates[]` 为首选来源,process observation 不再进入长期知识。
|
|
334
|
+
- 内容去重改为归一化指纹;冲突要求共同实体、来源范围与双方 evidence。
|
|
335
|
+
- freshness 与 health 分离,health 按 lifecycle/review/publication/validation 正交报告。
|
|
336
|
+
- judge 输出完整 `requiredDecisionCount`、有界 `previewCount` 和 `quarantinedCount`;
|
|
337
|
+
blocked 条目不进入 judge;defer 绑定证据指纹。
|
|
338
|
+
- knowledge publication gate 与 archive release status 解耦,legacy gate 仅在可证明时修复。
|
|
339
|
+
- judge/rollback 等 JSON 报告采用 content-addressed 文件、`latest-*` 指针与有界保留;
|
|
340
|
+
rollback snapshot 使用 gzip。
|
|
341
|
+
- validator 建议输出 `eligible/selected/applied/remaining/unavailable`。
|
|
342
|
+
|
|
292
343
|
## v1.7 补充能力
|
|
293
344
|
|
|
294
345
|
当前脚本额外支持:
|