@hunter-harness/workflow-harness 0.2.78 → 0.2.80

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.
Files changed (146) hide show
  1. package/harness/bundles/general/claude-code/.harness-build.json +1 -1
  2. package/harness/bundles/general/claude-code/harness-archive/SKILL.md +28 -2
  3. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
  4. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  5. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
  6. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
  7. package/harness/bundles/general/claude-code/harness-pull/SKILL.md +1 -1
  8. package/harness/bundles/general/claude-code/harness-push/SKILL.md +30 -6
  9. package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
  10. package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
  11. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
  12. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
  13. package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
  14. package/harness/bundles/general/claude-code/protocols/sensitive-info-protocol.md +5 -0
  15. package/harness/bundles/general/claude-code/scripts/harness_archive.py +518 -46
  16. package/harness/bundles/general/claude-code/scripts/harness_runtime.py +6 -2
  17. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  18. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +28 -2
  19. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
  20. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  21. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  22. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
  23. package/harness/bundles/general/codebuddy/harness-pull/SKILL.md +1 -1
  24. package/harness/bundles/general/codebuddy/harness-push/SKILL.md +29 -5
  25. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
  26. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
  27. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
  28. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
  29. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
  30. package/harness/bundles/general/codebuddy/protocols/sensitive-info-protocol.md +5 -0
  31. package/harness/bundles/general/codebuddy/scripts/harness_archive.py +518 -46
  32. package/harness/bundles/general/codebuddy/scripts/harness_runtime.py +6 -2
  33. package/harness/bundles/general/codex/.harness-build.json +1 -1
  34. package/harness/bundles/general/codex/harness-archive/SKILL.md +28 -2
  35. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
  36. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
  37. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
  38. package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
  39. package/harness/bundles/general/codex/harness-pull/SKILL.md +1 -1
  40. package/harness/bundles/general/codex/harness-push/SKILL.md +29 -5
  41. package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
  42. package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
  43. package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
  44. package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
  45. package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
  46. package/harness/bundles/general/codex/protocols/sensitive-info-protocol.md +5 -0
  47. package/harness/bundles/general/codex/scripts/harness_archive.py +518 -46
  48. package/harness/bundles/general/codex/scripts/harness_runtime.py +6 -2
  49. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  50. package/harness/bundles/general/cursor/harness-archive/SKILL.md +28 -2
  51. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
  52. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  53. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
  54. package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
  55. package/harness/bundles/general/cursor/harness-pull/SKILL.md +1 -1
  56. package/harness/bundles/general/cursor/harness-push/SKILL.md +29 -5
  57. package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
  58. package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
  59. package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
  60. package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
  61. package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
  62. package/harness/bundles/general/cursor/protocols/sensitive-info-protocol.md +5 -0
  63. package/harness/bundles/general/cursor/scripts/harness_archive.py +518 -46
  64. package/harness/bundles/general/cursor/scripts/harness_runtime.py +6 -2
  65. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  66. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
  67. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +28 -2
  68. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
  69. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  70. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
  71. package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
  72. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
  73. package/harness/bundles/java/claude-code/harness-pull/SKILL.md +1 -1
  74. package/harness/bundles/java/claude-code/harness-push/SKILL.md +30 -6
  75. package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
  76. package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
  77. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
  78. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +1 -1
  79. package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
  80. package/harness/bundles/java/claude-code/protocols/sensitive-info-protocol.md +5 -0
  81. package/harness/bundles/java/claude-code/scripts/harness_archive.py +518 -46
  82. package/harness/bundles/java/claude-code/scripts/harness_runtime.py +6 -2
  83. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  84. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
  85. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +28 -2
  86. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
  87. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  88. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  89. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
  90. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
  91. package/harness/bundles/java/codebuddy/harness-pull/SKILL.md +1 -1
  92. package/harness/bundles/java/codebuddy/harness-push/SKILL.md +29 -5
  93. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
  94. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
  95. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
  96. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +1 -1
  97. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
  98. package/harness/bundles/java/codebuddy/protocols/sensitive-info-protocol.md +5 -0
  99. package/harness/bundles/java/codebuddy/scripts/harness_archive.py +518 -46
  100. package/harness/bundles/java/codebuddy/scripts/harness_runtime.py +6 -2
  101. package/harness/bundles/java/codex/.harness-build.json +1 -1
  102. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
  103. package/harness/bundles/java/codex/harness-archive/SKILL.md +28 -2
  104. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
  105. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
  106. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
  107. package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
  108. package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
  109. package/harness/bundles/java/codex/harness-pull/SKILL.md +1 -1
  110. package/harness/bundles/java/codex/harness-push/SKILL.md +29 -5
  111. package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
  112. package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
  113. package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
  114. package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
  115. package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
  116. package/harness/bundles/java/codex/protocols/sensitive-info-protocol.md +5 -0
  117. package/harness/bundles/java/codex/scripts/harness_archive.py +518 -46
  118. package/harness/bundles/java/codex/scripts/harness_runtime.py +6 -2
  119. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  120. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
  121. package/harness/bundles/java/cursor/harness-archive/SKILL.md +28 -2
  122. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
  123. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  124. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
  125. package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
  126. package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
  127. package/harness/bundles/java/cursor/harness-pull/SKILL.md +1 -1
  128. package/harness/bundles/java/cursor/harness-push/SKILL.md +29 -5
  129. package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
  130. package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
  131. package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
  132. package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
  133. package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
  134. package/harness/bundles/java/cursor/protocols/sensitive-info-protocol.md +5 -0
  135. package/harness/bundles/java/cursor/scripts/harness_archive.py +518 -46
  136. package/harness/bundles/java/cursor/scripts/harness_runtime.py +6 -2
  137. package/harness/manifests/general/claude-code.json +18 -18
  138. package/harness/manifests/general/codebuddy.json +18 -18
  139. package/harness/manifests/general/codex.json +18 -18
  140. package/harness/manifests/general/cursor.json +18 -18
  141. package/harness/manifests/java/claude-code.json +20 -20
  142. package/harness/manifests/java/codebuddy.json +20 -20
  143. package/harness/manifests/java/codex.json +20 -20
  144. package/harness/manifests/java/cursor.json +20 -20
  145. package/hunter-workflow-family.json +5 -5
  146. package/package.json +1 -1
@@ -2,5 +2,5 @@
2
2
  "schemaVersion": 1,
3
3
  "overlay": "none",
4
4
  "agent": "claude-code",
5
- "coreHash": "5fc6a7ba2a0556ad"
5
+ "coreHash": "5fadb6520fbfa2c3"
6
6
  }
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(awk *)
22
22
  - Bash(curl *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-archive — 变更归档
26
26
 
27
27
  ## Purpose
@@ -148,9 +148,35 @@ disallowed-tools:
148
148
 
149
149
  | 阻断 | 出路 |
150
150
  |------|------|
151
- | `SENSITIVE_EVIDENCE_UNQUARANTINED` | `python <skills-root>/scripts/harness_runtime.py quarantine-evidence --project . --change-dir ".harness/changes/<cn>" --file "<相对 change-dir 的路径>" --reason "<为什么是敏感证据>" --json`(`--file` 可重复)。私有根默认已与项目同盘、且在项目根之外——**不要**手工指定项目内的路径,归档的密钥扫描会以 `SECRET_SCAN_PRIVATE_PATH_IN_COPY_ROOT` 拒绝 |
151
+ | `SENSITIVE_EVIDENCE_UNQUARANTINED`(默认只告警,`HUNTER_HARNESS_SENSITIVE_SCAN=block` 时才阻断) | `python <skills-root>/scripts/harness_runtime.py quarantine-evidence --project . --change-dir ".harness/changes/<cn>" --file "<相对 change-dir 的路径>" --reason "<为什么是敏感证据>" --json`(`--file` 可重复)。私有根默认已与项目同盘、且在项目根之外——**不要**手工指定项目内的路径,归档的密钥扫描会以 `SECRET_SCAN_PRIVATE_PATH_IN_COPY_ROOT` 拒绝 |
152
152
  | `DIFF_ZERO_WITH_NONEMPTY_COMMIT`(提交范围非空但 filesChanged=0) | 契约缺 `ownership.productPaths`,全部改动被判为 `foreignPaths`。用 `python <skills-root>/scripts/harness_change.py declare-ownership --change <cn> --product-path "<目录前缀或精确文件>" --json` 按计划的实际改动范围声明(可重复;只收精确路径,不支持通配)。**不要**手改 `change-context.json` |
153
153
 
154
+ ### 二·B、归档补传(上传失败或历史归档缺条目)
155
+
156
+ 归档上传成功后 ZIP 与回执会被清理,旧版本产生的归档从未入 outbox——所以
157
+ `harness-push --scope archive` 找不到可复用的包属于正常状态,不是故障。补传从已封存的
158
+ 归档目录重建确定性包:
159
+
160
+ ```powershell
161
+ python <skills-root>/scripts/harness_archive.py republish --change <change-key> --dry-run --json # 只看包内容
162
+ python <skills-root>/scripts/harness_archive.py republish --change <change-key> --json # 重建并上传
163
+ ```
164
+
165
+ 脚本在 `<skills-root>/scripts/` 共享,**不在 `harness-archive/scripts/`**(见 read-protocol 第 0 条)。
166
+
167
+ 在项目根内任意目录直接跑即可,**不需要** `--project`。
168
+
169
+ 归档目录是封存的(after-manifest 覆盖其每个字节),因此 `republish` **不写回**归档目录:
170
+ 缺失的 `candidates/knowledge.json` 只在内存中按已归档 summary 生成并放进包里。平台的知识
171
+ 条目只来自这个包;`--scope all` 走的是 branch_file 通道,不进知识管道。
172
+
173
+ **服务端一个 change key 只存一个不可变包**,所以补传只适用于「从未成功上传」与「字节完全一致的
174
+ 重试」。已 durable 的 change 会在本地就判出结果:字节一致 → `ARCHIVE_ALREADY_PUBLISHED`
175
+ (exit 0,不重传);字节不同 → `ARCHIVE_REMOTE_IMMUTABLE_CONFLICT`(exit 1,**不发起上传**)。
176
+ **已发布归档无法从客户端补知识条目**——注入候选必然改变字节,服务端拒绝替换;要补需要平台侧
177
+ 提供重新索引或归档版本化能力。
178
+ 只想重试**同一个包**(例如知识索引失败)时加 `--no-knowledge-injection`,它按封存目录原样重建,字节与已存包一致。
179
+
154
180
  ### 三、文件移动只用内置工具或 PowerShell
155
181
 
156
182
  移动用 Read+Write+验证 或 PowerShell;**禁止 Bash mv/cp/rm**。移动失败时不删除原目录,报错退出让用户手动处理。
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-codebase-map — 代码库地图
25
25
 
26
26
  ## Purpose
@@ -8,7 +8,7 @@ disallowed-tools:
8
8
  - Bash(git *)
9
9
  - Bash(curl *)
10
10
  ---
11
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
11
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
12
12
  # harness-knowledge-ingest
13
13
 
14
14
  知识 ingest 完全由 Hunter Platform 负责。归档完成时,客户端生成一个确定性 ZIP;
@@ -8,7 +8,7 @@ disallowed-tools:
8
8
  - Bash(git *)
9
9
  - Bash(curl *)
10
10
  ---
11
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
11
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
12
12
  # harness-knowledge-query
13
13
 
14
14
  项目知识以 Hunter Platform 的服务端索引为唯一真源。客户端只提交查询并消费结果:
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(awk *)
22
22
  - Bash(curl *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-plan — 需求规划
26
26
 
27
27
  ## Purpose
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(awk *)
22
22
  - Bash(curl *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-pull — 从 Hunter Platform 下拉与恢复
26
26
 
27
27
  ## Purpose
@@ -2,7 +2,7 @@
2
2
  name: harness-push
3
3
  description: "上传本地配置/规则/架构/指令(及显式归档)到 Hunter Platform。仅当用户显式调用 /harness-push 或明确说'上传到平台'时使用;不得因存在本地修改就自动触发。"
4
4
  disable-model-invocation: true
5
- argument-hint: "[--scope config|rules|architecture|instructions|all] [--scope archive --change <change-key>]"
5
+ argument-hint: "[--scope config|rules|architecture|instructions|branch_files|all] [--scope archive --change <change-key>] [--allow-sensitive]"
6
6
  effort: medium
7
7
  allowed-tools: [Read, Glob, Grep, Edit, Write, Bash(powershell.exe:*)]
8
8
  disallowed-tools:
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(awk *)
22
22
  - Bash(curl *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-push — 上传到 Hunter Platform
26
26
 
27
27
  ## Purpose
@@ -35,29 +35,53 @@ disallowed-tools:
35
35
  ## 前置条件
36
36
 
37
37
  - 远端同步已配置:优先读环境变量 `HUNTER_REMOTE_SYNC_URL`、`HUNTER_REMOTE_SYNC_TOKEN`、`HUNTER_REMOTE_SYNC_ACTOR_ID`;缺失字段回退到 `hunter-harness connect` 写入的 `.harness/credentials.local.yaml`(含 actor_id;旧绑定缺该字段时 CLI 经 key-info 自动补全并写回)。两者都缺时 CLI 固定 fail closed(`PUSH_PULL_CLI_UNAVAILABLE`),**不得**改用旧 HTTP fallback 或手工 API 调用。
38
- - 归档上传只选择已写入 outbox 的确定性包(阶段 06 产物);不存在可复用包时提示先完成本地归档,**不得**在 Push 内隐式补做 finalize/重建 ZIP
38
+ - 归档有两条互斥入口,先判断走哪条,**不要**自己找目录或拼 ZIP
39
+ - **待发布包**(刚归档完、上传失败还没成功):`--scope archive --change <key>` 消费 outbox claim。claim 记录在 `.harness/state/local/archive-outbox/`,ZIP 在 `.harness/state/local/archive-packages/`——不存在 `.harness/outbox` 这个目录。
40
+ - **补传已封存归档**(上传早已成功、包被清理,或归档由旧版本产生从未入 outbox):走 `harness_archive.py republish`(见下)。上传成功后 ZIP 与回执按设计会被删除,所以"没有可复用包"是常态而非故障。
41
+ - 两条入口都**不得**在 Push 内隐式补做 finalize/重建归档目录。
39
42
 
40
43
  ## 交互流程
41
44
 
42
45
  1. **选择范围**:`config` / `rules` / `architecture` / `instructions` / `all`,或显式归档 `--scope archive --change <change-key>`。归档必须显式,避免误传历史包或无法确定目标 Change。
43
46
  2. **展示预览**:分支、提交、远端基线和实际变化文件;无变化时直接结束,不创建空版本。
44
- 3. **用户确认**:可覆盖风险(hard 敏感阻断除外)必须显式确认后才上传;确认只对本次 preview 有效。
47
+ 3. **用户确认**:敏感命中默认只打印不阻断(策略 `warn`),照常走正常确认流程;把 `HUNTER_HARNESS_SENSITIVE_SCAN` 设成 `block` 后,可覆盖项才需要显式确认(high 命中在该模式下不可逐条覆盖)。确认只对本次 preview 有效。
45
48
  4. **按内容分类报告**:成功、跳过、冲突和可重试项分开列出;冲突只投影机器决策,可附 `--resolve <path=keep-local|accept-remote|skip>` 逐项选择。
46
49
 
47
50
  ## 命令
48
51
 
49
52
  ```powershell
50
53
  npx hunter-harness harness-push --scope config,rules --json
54
+ # 待发布包(有 outbox claim 时)
51
55
  npx hunter-harness harness-push --scope archive --change <change-key> --json
56
+ # 补传已封存归档:重建确定性包并上传(--dry-run 只看包内容)
57
+ python <skills-root>/scripts/harness_archive.py republish --change <change-key> --json
52
58
  ```
53
59
 
60
+ `<skills-root>` 是已部署 skills 的根目录,实际形态是 `.codebuddy/skills/`(`.claude`、`.cursor`、
61
+ `.codex` 同理)。**脚本在它下面的 `scripts/` 里共享,不在 `harness-push/scripts/`** —— 已有四份
62
+ 执行日志先猜成后者、报 `No such file` 再回头找。
63
+
64
+ `--scope archive` 没有待发布 claim 时返回 `PUSH_PULL_ARCHIVE_NO_PENDING_CLAIM`(exit 5),
65
+ stderr 里直接给出上面的 republish 命令;`--dry-run` 会列出本地可补传的归档目录,不取租约。
66
+ `republish` 在项目根内任意目录直接跑即可,**不需要** `--project`。
67
+
68
+ **补传能做什么、不能做什么**:服务端对同一 change key 只保存**一个不可变包**。所以补传只适用于
69
+ 「从未成功上传」与「字节完全一致的重试」两种情况。若该 change 已是 durable,`republish` 会读
70
+ `.harness/state/local/archive-packages/<key>.remote.json` 在**本地就判定**并返回:
71
+ 字节一致 → `ARCHIVE_ALREADY_PUBLISHED`(exit 0,不重传);字节不同 →
72
+ `ARCHIVE_REMOTE_IMMUTABLE_CONFLICT`(exit 1,**不发起上传**)。
73
+ **已发布的归档无法从客户端补上知识条目**——注入 `candidates/knowledge.json` 必然改变字节,
74
+ 服务端拒绝替换。要让旧归档产生知识条目,需要平台侧提供重新索引或归档版本化能力。
75
+ 只想重试**同一个包**(例如知识索引失败)时加 `--no-knowledge-injection`,它按封存目录原样重建,字节与已存包一致。
76
+
54
77
  ## 关键规则
55
78
 
56
79
  | 规则 | 要点 |
57
80
  |------|------|
58
81
  | 无变化不上传 | 预览无变化时返回 `no_changes`,不创建确认、不调用执行入口 |
59
- | 敏感与凭据 | 不做内容遮盖;路径白名单、凭据文件排除、哈希校验保持启用;hard 敏感阻断不得生成确认 |
60
- | 归档边界 | 归档不进普通范围;`--scope archive` 必须带 `--change`;只消费已有 outbox claim |
82
+ | 敏感与凭据 | 不做内容遮盖;路径白名单、凭据文件排除、哈希校验保持启用。扫描默认 `warn`:命中项按 `路径:行 规则(严重度)` 打印后照常上传。`HUNTER_HARNESS_SENSITIVE_SCAN=block` 恢复阻断,`=off` 完全关闭。阻断态下可覆盖项加 `--allow-sensitive`(非交互需配合 `--yes`,原因用 `--sensitive-reason`);high 命中在 block 态仍不可逐条覆盖,要放行就改策略 |
83
+ | 归档边界 | 归档不进普通范围;`--scope archive` 必须带 `--change`;只消费已有 outbox claim,补传走 `harness_archive.py republish` |
84
+ | 知识条目 | 平台的知识条目只从归档包的 `candidates/knowledge.json` 产生。`--scope all` 把归档文档当 branch_file 上传,**不进**知识管道——要让页面出现条目必须走归档包 |
61
85
  | 失败语义 | `PUSH_PULL_RECEIPT_INVALID`/远端未确认 = 未上传,不得宣称成功;可重试项标注后交还用户 |
62
86
 
63
87
  ## P0 执行可信度规则
@@ -22,7 +22,7 @@ disallowed-tools:
22
22
  - Bash(curl *)
23
23
  - Bash(codegraph *)
24
24
  ---
25
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
25
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
26
26
  # harness-review — 代码审查
27
27
 
28
28
  ## Purpose
@@ -22,7 +22,7 @@ disallowed-tools:
22
22
  - Bash(curl *)
23
23
  - Bash(codegraph *)
24
24
  ---
25
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
25
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
26
26
  # harness-run — 需求编码
27
27
 
28
28
  ## Purpose
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(awk *)
22
22
  - Bash(curl *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-submit — 最终提交(含 worktree 合并)
26
26
 
27
27
  ## Purpose
@@ -19,7 +19,7 @@ disallowed-tools:
19
19
  - Bash(awk *)
20
20
  - Bash(curl *)
21
21
  ---
22
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
22
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
23
23
  # harness-sync
24
24
 
25
25
  ## Purpose
@@ -23,7 +23,7 @@ disallowed-tools:
23
23
  - Bash(node *)
24
24
  - Bash(codegraph *)
25
25
  ---
26
- <!-- generated by harness_deploy.py; core=5fc6a7ba2a0556ad; overlay=none; agent=claude-code; do not edit -->
26
+ <!-- generated by harness_deploy.py; core=5fadb6520fbfa2c3; overlay=none; agent=claude-code; do not edit -->
27
27
  # harness-test — 测试执行
28
28
 
29
29
  ## Purpose
@@ -93,6 +93,11 @@ spring:
93
93
 
94
94
  ## 6. profile / 规则 / Markdown 凭据扫描
95
95
 
96
+ > 本节讲的是**写入时**的内容卫生,与上传门禁是两回事。CLI 的发布扫描
97
+ > (`harness-push` / 归档)默认策略是 `warn`:命中项打印后照常上传,用
98
+ > `HUNTER_HARNESS_SENSITIVE_SCAN=block` 才恢复阻断、`=off` 完全关闭。
99
+ > 门禁放行不等于内容可以带明文凭据——本节的要求始终成立。
100
+
96
101
  profile `build-profile.json`、规则文档、Skill Markdown **不得包含凭据明文值**(spec §3.4 凭据边界:配置只含 env key、cache path、角色,不含值)。发布前用 `harness-test/scripts/runtime-helpers.mjs` 的 `findCredentialValues(text)` 扫描:
97
102
 
98
103
  - 命中 `password/token/secret/accessKey/Authorization: Bearer/jdbc password=` 等明文值 → ❌FAIL,必须改为占位符 `<*_REDACTED>` 或 env 引用 `${ENV}` / `$ENV`。