repo-harness 0.9.0 → 0.9.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/README.es.md +4 -4
- package/README.fr.md +4 -4
- package/README.ja.md +4 -4
- package/README.md +40 -19
- package/README.zh-CN.md +21 -14
- package/assets/AGENTS.md +1 -1
- package/assets/CLAUDE.md +1 -1
- package/assets/hooks/AGENTS.md +2 -2
- package/assets/hooks/CLAUDE.md +2 -2
- package/assets/hooks/codex-delegation-advisor.sh +30 -6
- package/assets/hooks/prompt-guard.sh +1 -1
- package/assets/reference-configs/external-tooling.md +19 -10
- package/assets/reference-configs/global-working-rules.md +6 -0
- package/assets/skill-version.json +10 -2
- package/assets/templates/helpers/architecture-event.ts +8 -1
- package/assets/templates/helpers/capability-resolver.ts +3 -3
- package/assets/templates/helpers/check-agent-tooling.sh +5 -5
- package/assets/templates/helpers/context-contract-sync.sh +15 -1
- package/assets/templates/helpers/install-agent-fleet.sh +24 -5
- package/docs/images/repo-harness-install-donkey-carrot.png +0 -0
- package/install.ps1 +9 -1
- package/install.sh +12 -1
- package/package.json +2 -1
- package/scripts/AGENTS.md +1 -1
- package/scripts/CLAUDE.md +1 -1
- package/scripts/architecture-event.ts +8 -1
- package/scripts/capability-resolver.ts +3 -3
- package/scripts/check-agent-tooling.sh +5 -5
- package/scripts/context-contract-sync.sh +15 -1
- package/scripts/init-project.sh +1 -0
- package/scripts/install-agent-fleet.sh +24 -5
- package/scripts/lib/project-init-lib.sh +10 -1
- package/scripts/migrate-project-template.sh +1 -0
- package/src/cli/commands/delegation-mode.ts +79 -0
- package/src/cli/commands/doctor.ts +65 -5
- package/src/cli/commands/global-runtime.ts +19 -3
- package/src/cli/commands/init-hook.ts +76 -0
- package/src/cli/commands/install.ts +15 -1
- package/src/cli/commands/validators.ts +15 -0
- package/src/cli/hook/prompt-intents.ts +38 -3
- package/src/cli/index.ts +74 -1
package/README.es.md
CHANGED
|
@@ -85,7 +85,7 @@ artifacts.
|
|
|
85
85
|
## Novedades
|
|
86
86
|
|
|
87
87
|
Las notas de versión viven en [`docs/CHANGELOG.md`](docs/CHANGELOG.md). La línea
|
|
88
|
-
actual es `0.9.
|
|
88
|
+
actual es `0.9.2`.
|
|
89
89
|
|
|
90
90
|
## Cómo funciona
|
|
91
91
|
|
|
@@ -220,7 +220,7 @@ bun add -g repo-harness
|
|
|
220
220
|
repo-harness install
|
|
221
221
|
|
|
222
222
|
# Fallback con npx, con Bun ya en PATH porque el CLI corre sobre Bun
|
|
223
|
-
npx -y repo-harness install
|
|
223
|
+
npx -y repo-harness@latest install
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
</details>
|
|
@@ -419,8 +419,8 @@ Guards habituales:
|
|
|
419
419
|
|
|
420
420
|
## Release actual
|
|
421
421
|
|
|
422
|
-
- npm package: `repo-harness@0.9.
|
|
423
|
-
- Generated workflow stamp: `repo-harness@0.9.
|
|
422
|
+
- npm package: `repo-harness@0.9.2`
|
|
423
|
+
- Generated workflow stamp: `repo-harness@0.9.2+template@0.9.2`
|
|
424
424
|
- GitHub repository: `Ancienttwo/repo-harness`
|
|
425
425
|
- Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
426
426
|
|
package/README.fr.md
CHANGED
|
@@ -85,7 +85,7 @@ l'emportent.
|
|
|
85
85
|
## Nouveautés
|
|
86
86
|
|
|
87
87
|
Les notes de version vivent dans [`docs/CHANGELOG.md`](docs/CHANGELOG.md). La
|
|
88
|
-
ligne actuelle est `0.9.
|
|
88
|
+
ligne actuelle est `0.9.2`.
|
|
89
89
|
|
|
90
90
|
## Comment ça marche
|
|
91
91
|
|
|
@@ -224,7 +224,7 @@ bun add -g repo-harness
|
|
|
224
224
|
repo-harness install
|
|
225
225
|
|
|
226
226
|
# Fallback npx, avec Bun déjà sur PATH car le CLI s'exécute sur Bun
|
|
227
|
-
npx -y repo-harness install
|
|
227
|
+
npx -y repo-harness@latest install
|
|
228
228
|
```
|
|
229
229
|
|
|
230
230
|
</details>
|
|
@@ -424,8 +424,8 @@ Guards courants :
|
|
|
424
424
|
|
|
425
425
|
## Release actuelle
|
|
426
426
|
|
|
427
|
-
- npm package : `repo-harness@0.9.
|
|
428
|
-
- Generated workflow stamp : `repo-harness@0.9.
|
|
427
|
+
- npm package : `repo-harness@0.9.2`
|
|
428
|
+
- Generated workflow stamp : `repo-harness@0.9.2+template@0.9.2`
|
|
429
429
|
- GitHub repository : `Ancienttwo/repo-harness`
|
|
430
430
|
- Release history : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
431
431
|
|
package/README.ja.md
CHANGED
|
@@ -75,7 +75,7 @@ review、checks、handoff と食い違う場合は、source artifacts を優先
|
|
|
75
75
|
## What's New
|
|
76
76
|
|
|
77
77
|
リリースノートは [`docs/CHANGELOG.md`](docs/CHANGELOG.md) にあります。現在の
|
|
78
|
-
ラインは `0.9.
|
|
78
|
+
ラインは `0.9.2` です。
|
|
79
79
|
|
|
80
80
|
## 仕組み
|
|
81
81
|
|
|
@@ -201,7 +201,7 @@ bun add -g repo-harness
|
|
|
201
201
|
repo-harness install
|
|
202
202
|
|
|
203
203
|
# npx fallback。CLI runtime は Bun なので、Bun が PATH 上に必要です。
|
|
204
|
-
npx -y repo-harness install
|
|
204
|
+
npx -y repo-harness@latest install
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
</details>
|
|
@@ -398,8 +398,8 @@ hook がブロックしたときは、まず terminal の構造化された出
|
|
|
398
398
|
|
|
399
399
|
## 現在の Release
|
|
400
400
|
|
|
401
|
-
- npm package:`repo-harness@0.9.
|
|
402
|
-
- Generated workflow stamp:`repo-harness@0.9.
|
|
401
|
+
- npm package:`repo-harness@0.9.2`
|
|
402
|
+
- Generated workflow stamp:`repo-harness@0.9.2+template@0.9.2`
|
|
403
403
|
- GitHub repository:`Ancienttwo/repo-harness`
|
|
404
404
|
- Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
405
405
|
|
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ active plan, contract, review, checks, or handoff, the source artifacts win.
|
|
|
85
85
|
## What's New
|
|
86
86
|
|
|
87
87
|
Release notes live in [`docs/CHANGELOG.md`](docs/CHANGELOG.md). The current line
|
|
88
|
-
is `0.9.
|
|
88
|
+
is `0.9.2`.
|
|
89
89
|
|
|
90
90
|
## How It Works
|
|
91
91
|
|
|
@@ -234,6 +234,10 @@ concrete sprint instead of reinterpreting the original chat.
|
|
|
234
234
|
|
|
235
235
|
## First 5 Minutes
|
|
236
236
|
|
|
237
|
+
<p align="center">
|
|
238
|
+
<img src="docs/images/repo-harness-install-donkey-carrot.png" alt="Pixel art donkey following a carrot for repo-harness installation" width="900">
|
|
239
|
+
</p>
|
|
240
|
+
|
|
237
241
|
This is the fastest path for an AI tooling owner evaluating whether the workflow is
|
|
238
242
|
safe to adopt in a real repo. It separates the machine-level runtime bootstrap
|
|
239
243
|
from the repo-local contract install, so a dry run can show exactly what will
|
|
@@ -256,20 +260,20 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
|
|
|
256
260
|
irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
|
|
257
261
|
```
|
|
258
262
|
|
|
259
|
-
|
|
260
|
-
<summary>Already have Bun? Use Bun directly, or npx as a fallback</summary>
|
|
263
|
+
If Bun is already on PATH, you can skip the shell installer:
|
|
261
264
|
|
|
262
265
|
```bash
|
|
263
|
-
# Bun
|
|
266
|
+
# Bun one-shot bootstrap
|
|
267
|
+
bunx repo-harness@latest install
|
|
268
|
+
|
|
269
|
+
# Or install the persistent CLI first
|
|
264
270
|
bun add -g repo-harness
|
|
265
271
|
repo-harness install
|
|
266
272
|
|
|
267
273
|
# npx fallback, with Bun already on PATH because the CLI runs on Bun
|
|
268
|
-
npx -y repo-harness install
|
|
274
|
+
npx -y repo-harness@latest install
|
|
269
275
|
```
|
|
270
276
|
|
|
271
|
-
</details>
|
|
272
|
-
|
|
273
277
|
### 2. Bootstrap the host runtime once
|
|
274
278
|
|
|
275
279
|
```bash
|
|
@@ -279,18 +283,24 @@ repo-harness install
|
|
|
279
283
|
`install` is the first-run global bootstrap path. It installs the current npm
|
|
280
284
|
package as the global CLI, refreshes repo-harness skill aliases, installs
|
|
281
285
|
user-level hook adapters, configures Waza runtime skills, persists a brain root
|
|
282
|
-
under `~/.repo-harness/config.json`, and configures CodeGraph MCP.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
under `~/.repo-harness/config.json`, and configures CodeGraph MCP. The command
|
|
287
|
+
is idempotent: when the CLI is already installed from Bun's global package
|
|
288
|
+
source, it skips the CLI reinstall and still refreshes the host runtime pieces.
|
|
289
|
+
In an interactive terminal it asks Y/n before installing the external skills
|
|
290
|
+
and CodeGraph pieces (Enter keeps today's default of installing both); non-TTY
|
|
291
|
+
runs and `--json` stay unprompted with the same default-on behavior. Passing
|
|
292
|
+
`--no-external-skills` or `--no-codegraph` explicitly also skips that item's
|
|
293
|
+
prompt unprompted, which is the escape hatch for PTY-allocating CI (for example
|
|
294
|
+
`docker run -t`). It does not apply repo-local workflow files to the current
|
|
295
|
+
directory. `repo-harness init` remains a compatibility alias for existing
|
|
296
|
+
scripts.
|
|
288
297
|
|
|
289
298
|
For an Agent-owned, read-only bootstrap audit, run `repo-harness setup check
|
|
290
|
-
--json` or add `--check-updates` for version
|
|
291
|
-
not a runtime hook: it does not write user-level
|
|
292
|
-
|
|
293
|
-
|
|
299
|
+
--json` or add `--check-updates` for version and adopted-repo refresh
|
|
300
|
+
advisories. `setup check` is not a runtime hook: it does not write user-level
|
|
301
|
+
files, install updates, run `adopt`, or register adapters. It emits
|
|
302
|
+
`agent_actions` with the reason, risk, target files, optional command, and
|
|
303
|
+
verification surface for the Agent to execute deliberately.
|
|
294
304
|
`repo-harness init-hook` remains a compatibility alias.
|
|
295
305
|
|
|
296
306
|
### Install and refresh examples
|
|
@@ -312,6 +322,17 @@ repo-harness update --check
|
|
|
312
322
|
repo-harness adopt --repo /path/to/repo
|
|
313
323
|
```
|
|
314
324
|
|
|
325
|
+
`repo-harness install --target codex|both --location global` also resolves and
|
|
326
|
+
persists the Codex delegation mode read by the delegation-advisor hook: pass
|
|
327
|
+
`--delegation-mode auto|explicit` for non-interactive use, or answer the
|
|
328
|
+
one-line interactive prompt shown in a TTY (Enter keeps the current choice,
|
|
329
|
+
defaulting to `explicit` when nothing is configured yet). The chosen mode is
|
|
330
|
+
written to `delegation.mode` in `~/.repo-harness/config.json`, merged with
|
|
331
|
+
existing keys such as `brainRoot`; this global value takes precedence over a
|
|
332
|
+
repo's `.ai/harness/policy.json` `delegation.mode`. The step never fires for
|
|
333
|
+
`--target claude`, and with no flag and no TTY it leaves the file untouched —
|
|
334
|
+
it never writes a silent default.
|
|
335
|
+
|
|
315
336
|
### 3. Preview the repo-local contract
|
|
316
337
|
|
|
317
338
|
```bash
|
|
@@ -612,8 +633,8 @@ Most common guards:
|
|
|
612
633
|
|
|
613
634
|
## Current Release
|
|
614
635
|
|
|
615
|
-
- npm package: `repo-harness@0.9.
|
|
616
|
-
- Generated workflow stamp: `repo-harness@0.9.
|
|
636
|
+
- npm package: `repo-harness@0.9.2`
|
|
637
|
+
- Generated workflow stamp: `repo-harness@0.9.2+template@0.9.2`
|
|
617
638
|
- GitHub repository: `Ancienttwo/repo-harness`
|
|
618
639
|
- Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
619
640
|
|
package/README.zh-CN.md
CHANGED
|
@@ -75,7 +75,7 @@ review、checks 或 handoff 冲突,以 source artifacts 为准。
|
|
|
75
75
|
|
|
76
76
|
## What's New
|
|
77
77
|
|
|
78
|
-
Release notes 见 [`docs/CHANGELOG.md`](docs/CHANGELOG.md),当前版本线是 `0.9.
|
|
78
|
+
Release notes 见 [`docs/CHANGELOG.md`](docs/CHANGELOG.md),当前版本线是 `0.9.2`。
|
|
79
79
|
|
|
80
80
|
## 工作原理
|
|
81
81
|
|
|
@@ -198,6 +198,10 @@ source of truth,Codex Goal mode 只围绕具体 sprint 恢复和推进,而
|
|
|
198
198
|
|
|
199
199
|
## 前 5 分钟
|
|
200
200
|
|
|
201
|
+
<p align="center">
|
|
202
|
+
<img src="docs/images/repo-harness-install-donkey-carrot.png" alt="repo-harness 安装引导的 pixel art 驴和萝卜 banner" width="900">
|
|
203
|
+
</p>
|
|
204
|
+
|
|
201
205
|
这是评估一个真实仓库是否适合接入该 workflow 的最快路径。它把机器级 runtime
|
|
202
206
|
bootstrap 和 repo-local contract install 分开,所以 dry-run 能先展示会改什么,
|
|
203
207
|
再决定是否应用。
|
|
@@ -218,20 +222,20 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
|
|
|
218
222
|
irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
|
|
219
223
|
```
|
|
220
224
|
|
|
221
|
-
|
|
222
|
-
<summary>已经有 Bun?优先直接用 Bun,也可以把 npx 作为备选</summary>
|
|
225
|
+
如果 Bun 已经在 `PATH` 上,可以跳过 shell installer:
|
|
223
226
|
|
|
224
227
|
```bash
|
|
225
|
-
# Bun
|
|
228
|
+
# Bun 一步 bootstrap
|
|
229
|
+
bunx repo-harness@latest install
|
|
230
|
+
|
|
231
|
+
# 或者先安装持久化 CLI
|
|
226
232
|
bun add -g repo-harness
|
|
227
233
|
repo-harness install
|
|
228
234
|
|
|
229
235
|
# npx 备选;仍要求 Bun 已在 PATH 上,因为 CLI runtime 是 Bun
|
|
230
|
-
npx -y repo-harness install
|
|
236
|
+
npx -y repo-harness@latest install
|
|
231
237
|
```
|
|
232
238
|
|
|
233
|
-
</details>
|
|
234
|
-
|
|
235
239
|
### 2. 先做一次 host runtime bootstrap
|
|
236
240
|
|
|
237
241
|
```bash
|
|
@@ -240,13 +244,16 @@ repo-harness install
|
|
|
240
244
|
|
|
241
245
|
`install` 是首次全局引导入口。它把当前 npm 包安装成全局 CLI,刷新 repo-harness
|
|
242
246
|
skill aliases,安装 user-level hook adapters,配置 Waza runtime skills,把 brain
|
|
243
|
-
root 持久化到 `~/.repo-harness/config.json`,并配置 CodeGraph MCP
|
|
244
|
-
|
|
247
|
+
root 持久化到 `~/.repo-harness/config.json`,并配置 CodeGraph MCP。这个命令是
|
|
248
|
+
幂等的:如果 CLI 已经来自 Bun global package source,它会跳过 CLI 重装,但仍继续
|
|
249
|
+
刷新 host runtime pieces。它不会把当前目录默认迁移成 repo-local workflow。
|
|
250
|
+
`repo-harness init` 保留为兼容 alias,给已有脚本用。
|
|
245
251
|
|
|
246
252
|
如果要让 Agent 做只读 bootstrap audit,运行 `repo-harness setup check
|
|
247
|
-
--json
|
|
248
|
-
|
|
249
|
-
targets、可选 command 和 verification 的
|
|
253
|
+
--json`;需要版本和已接入仓库刷新提示时加 `--check-updates`。`setup check`
|
|
254
|
+
不是 runtime hook:它不会写 user-level files、安装更新、执行 `adopt` 或注册
|
|
255
|
+
adapters,只输出带 reason、risk、targets、可选 command 和 verification 的
|
|
256
|
+
`agent_actions`,由 Agent 再显式执行。
|
|
250
257
|
`repo-harness init-hook` 保留为兼容 alias。
|
|
251
258
|
|
|
252
259
|
### 安装和刷新例子
|
|
@@ -451,8 +458,8 @@ hook block 工作时,先看 terminal 里的结构化输出。核心字段是
|
|
|
451
458
|
|
|
452
459
|
## 当前 Release
|
|
453
460
|
|
|
454
|
-
- npm package:`repo-harness@0.9.
|
|
455
|
-
- Generated workflow stamp:`repo-harness@0.9.
|
|
461
|
+
- npm package:`repo-harness@0.9.2`
|
|
462
|
+
- Generated workflow stamp:`repo-harness@0.9.2+template@0.9.2`
|
|
456
463
|
- GitHub repository:`Ancienttwo/repo-harness`
|
|
457
464
|
- Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
458
465
|
|
package/assets/AGENTS.md
CHANGED
|
@@ -37,7 +37,7 @@ Owns the workflow-engine-contract-assets capability boundary declared in .ai/con
|
|
|
37
37
|
- Architecture domain: `workflow-engine`
|
|
38
38
|
- Architecture capability: `contract-assets`
|
|
39
39
|
- Architecture module: `docs/architecture/modules/workflow-engine/contract-assets.md`
|
|
40
|
-
- Last architecture event: 2026-07-
|
|
40
|
+
- Last architecture event: 2026-07-06T13:54:27+0800
|
|
41
41
|
- Last changed path: `.ai/harness/policy.json`
|
|
42
42
|
- Severity: high
|
|
43
43
|
- Change type: workflow-surface
|
package/assets/CLAUDE.md
CHANGED
|
@@ -37,7 +37,7 @@ Owns the workflow-engine-contract-assets capability boundary declared in .ai/con
|
|
|
37
37
|
- Architecture domain: `workflow-engine`
|
|
38
38
|
- Architecture capability: `contract-assets`
|
|
39
39
|
- Architecture module: `docs/architecture/modules/workflow-engine/contract-assets.md`
|
|
40
|
-
- Last architecture event: 2026-07-
|
|
40
|
+
- Last architecture event: 2026-07-06T13:54:27+0800
|
|
41
41
|
- Last changed path: `.ai/harness/policy.json`
|
|
42
42
|
- Severity: high
|
|
43
43
|
- Change type: workflow-surface
|
package/assets/hooks/AGENTS.md
CHANGED
|
@@ -49,8 +49,8 @@ Owns the runtime-harness-hook-adapters capability boundary declared in .ai/conte
|
|
|
49
49
|
- Architecture domain: `runtime-harness`
|
|
50
50
|
- Architecture capability: `hook-adapters`
|
|
51
51
|
- Architecture module: `docs/architecture/modules/runtime-harness/hook-adapters.md`
|
|
52
|
-
- Last architecture event: 2026-07-
|
|
53
|
-
- Last changed path: `assets/hooks/
|
|
52
|
+
- Last architecture event: 2026-07-09T11:39:06+0800
|
|
53
|
+
- Last changed path: `assets/hooks/prompt-guard.sh`
|
|
54
54
|
- Severity: high
|
|
55
55
|
- Change type: workflow-surface
|
|
56
56
|
- Module responsibility: Keep this block aligned with the local boundary described by surrounding human-owned context.
|
package/assets/hooks/CLAUDE.md
CHANGED
|
@@ -49,8 +49,8 @@ Owns the runtime-harness-hook-adapters capability boundary declared in .ai/conte
|
|
|
49
49
|
- Architecture domain: `runtime-harness`
|
|
50
50
|
- Architecture capability: `hook-adapters`
|
|
51
51
|
- Architecture module: `docs/architecture/modules/runtime-harness/hook-adapters.md`
|
|
52
|
-
- Last architecture event: 2026-07-
|
|
53
|
-
- Last changed path: `assets/hooks/
|
|
52
|
+
- Last architecture event: 2026-07-09T11:39:06+0800
|
|
53
|
+
- Last changed path: `assets/hooks/prompt-guard.sh`
|
|
54
54
|
- Severity: high
|
|
55
55
|
- Change type: workflow-surface
|
|
56
56
|
- Module responsibility: Keep this block aligned with the local boundary described by surrounding human-owned context.
|
|
@@ -56,6 +56,19 @@ JSON_INPUT="$input" REPO_ROOT="${HOOK_REPO_ROOT:-$(pwd)}" bun -e '
|
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
function readGlobalDelegationMode() {
|
|
60
|
+
try {
|
|
61
|
+
const home = process.env.HOME;
|
|
62
|
+
if (!home) return null;
|
|
63
|
+
const raw = fs.readFileSync(path.join(home, ".repo-harness", "config.json"), "utf8");
|
|
64
|
+
const parsed = JSON.parse(raw);
|
|
65
|
+
const mode = parsed && parsed.delegation && parsed.delegation.mode;
|
|
66
|
+
return mode === "auto" || mode === "explicit" ? mode : null;
|
|
67
|
+
} catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
let input;
|
|
60
73
|
try {
|
|
61
74
|
input = JSON.parse(process.env.JSON_INPUT || "");
|
|
@@ -91,7 +104,6 @@ JSON_INPUT="$input" REPO_ROOT="${HOOK_REPO_ROOT:-$(pwd)}" bun -e '
|
|
|
91
104
|
{ name: "chinese-subagent", pattern: /交给\s*子代理|使用多个\s*(agent|代理)|并行(调查|研究|处理|执行|agent|代理)/i },
|
|
92
105
|
];
|
|
93
106
|
const trigger = triggers.find((entry) => entry.pattern.test(prompt) && !(entry.skipDiscussion && isDelegationDiscussion(prompt)));
|
|
94
|
-
if (!trigger) process.exit(0);
|
|
95
107
|
|
|
96
108
|
const repoRoot = process.env.REPO_ROOT || process.cwd();
|
|
97
109
|
|
|
@@ -102,6 +114,16 @@ JSON_INPUT="$input" REPO_ROOT="${HOOK_REPO_ROOT:-$(pwd)}" bun -e '
|
|
|
102
114
|
} catch {
|
|
103
115
|
policyDelegation = {};
|
|
104
116
|
}
|
|
117
|
+
|
|
118
|
+
const globalDelegationMode = readGlobalDelegationMode();
|
|
119
|
+
const effectiveDelegationMode = globalDelegationMode || (policyDelegation.mode === "auto" ? "auto" : "explicit");
|
|
120
|
+
|
|
121
|
+
const explicit = Boolean(trigger);
|
|
122
|
+
if (!explicit) {
|
|
123
|
+
if (effectiveDelegationMode !== "auto") process.exit(0);
|
|
124
|
+
if (isDelegationDiscussion(prompt)) process.exit(0);
|
|
125
|
+
}
|
|
126
|
+
|
|
105
127
|
const maxAgents = Number.isInteger(policyDelegation.max_agents) ? policyDelegation.max_agents : 3;
|
|
106
128
|
const maxDepth = Number.isInteger(policyDelegation.max_depth) ? policyDelegation.max_depth : 1;
|
|
107
129
|
const preferredRunners =
|
|
@@ -122,17 +144,17 @@ JSON_INPUT="$input" REPO_ROOT="${HOOK_REPO_ROOT:-$(pwd)}" bun -e '
|
|
|
122
144
|
const state = {
|
|
123
145
|
version: 1,
|
|
124
146
|
eligible: true,
|
|
125
|
-
explicit
|
|
147
|
+
explicit,
|
|
126
148
|
spawned: false,
|
|
127
149
|
fallback_used: false,
|
|
128
|
-
mode: "explicit",
|
|
150
|
+
mode: explicit ? "explicit" : "auto",
|
|
129
151
|
max_agents: maxAgents,
|
|
130
152
|
max_depth: maxDepth,
|
|
131
153
|
allow_parallel_writers: false,
|
|
132
|
-
stop_fallback:
|
|
154
|
+
stop_fallback: explicit,
|
|
133
155
|
preferred_runners: preferredRunners,
|
|
134
156
|
fallback_runner: fallbackRunner,
|
|
135
|
-
trigger: trigger.name,
|
|
157
|
+
trigger: explicit ? trigger.name : "auto-mode",
|
|
136
158
|
prompt_hash: crypto.createHash("sha1").update(prompt).digest("hex"),
|
|
137
159
|
scope_source: scope?.source || "unscoped",
|
|
138
160
|
scope_id: scope?.id || "",
|
|
@@ -151,7 +173,9 @@ JSON_INPUT="$input" REPO_ROOT="${HOOK_REPO_ROOT:-$(pwd)}" bun -e '
|
|
|
151
173
|
const context = [
|
|
152
174
|
"[repo-harness:delegation]",
|
|
153
175
|
"",
|
|
154
|
-
|
|
176
|
+
explicit
|
|
177
|
+
? "The current user prompt explicitly enabled bounded delegation."
|
|
178
|
+
: "Repo policy delegation.mode=auto is standing user authorization for bounded delegation, selected by the user at install time. This satisfies the user-authorization requirement for native subagents (spawn_agent) when the dispatch conditions below are met.",
|
|
155
179
|
"",
|
|
156
180
|
"Treat the active task contract (tasks/contracts/<active-plan-stem>.contract.md) as the authoritative execution brief: Goal, Scope, Allowed Paths, and Exit Criteria. Do not re-derive scope from this conversation.",
|
|
157
181
|
"",
|
|
@@ -1054,7 +1054,7 @@ prompt_guard_engine_call
|
|
|
1054
1054
|
if [[ "$PG_ENGINE_STATE" != "ok" ]]; then
|
|
1055
1055
|
if [[ "$PG_ENGINE_STATE" == "legacy" ]]; then
|
|
1056
1056
|
echo "[PromptGuard] Advisory: the installed repo-harness CLI predates the prompt-verdict protocol; prompt intent gates are degraded to advisory for this prompt."
|
|
1057
|
-
echo "[PromptGuard] Refresh the CLI with: bun add -g repo-harness@latest && repo-harness install. Fallback: npx -y repo-harness install."
|
|
1057
|
+
echo "[PromptGuard] Refresh the CLI with: bun add -g repo-harness@latest && repo-harness install. Fallback: npx -y repo-harness@latest install."
|
|
1058
1058
|
else
|
|
1059
1059
|
echo "[PromptGuard] Advisory: prompt-guard decision engine is unavailable (repo-harness CLI or bun not found); prompt intent gates are degraded to advisory for this prompt."
|
|
1060
1060
|
echo "[PromptGuard] Edit-layer guards still enforce plan and contract scope. Install the repo-harness CLI to restore prompt decisions."
|
|
@@ -41,7 +41,9 @@ brain config, package-manager globals, or user-authored sibling hook entries.
|
|
|
41
41
|
runtime by default. Third-party tooling and CodeGraph registration stay
|
|
42
42
|
readiness findings from `repo-harness setup check` unless the update command is
|
|
43
43
|
run with an explicit opt-in such as `--with-external-skills` or
|
|
44
|
-
`--configure-codegraph`.
|
|
44
|
+
`--configure-codegraph`. Repo-local workflow refresh stays on
|
|
45
|
+
`repo-harness adopt`; `setup check --check-updates` reports an Agent action when
|
|
46
|
+
the current adopted repo's dry-run adoption plan has pending operations.
|
|
45
47
|
|
|
46
48
|
The cross-review skills are **harness-owned and self-contained** — their source
|
|
47
49
|
lives in `assets/skills/<skill>/` and they wrap the peer CLI (`codex exec` /
|
|
@@ -121,13 +123,13 @@ cd ~/.claude/skills/gstack && ./setup --host codex
|
|
|
121
123
|
Both hosts:
|
|
122
124
|
|
|
123
125
|
```bash
|
|
124
|
-
|
|
126
|
+
bunx skills add tw93/Waza -g -a claude-code codex -s think hunt check health -y
|
|
125
127
|
```
|
|
126
128
|
|
|
127
129
|
Single host:
|
|
128
130
|
|
|
129
131
|
```bash
|
|
130
|
-
|
|
132
|
+
bunx skills add tw93/Waza -g -a claude-code -s think hunt check health -y
|
|
131
133
|
```
|
|
132
134
|
|
|
133
135
|
Replace `claude-code` with `codex` when installing for Codex only.
|
|
@@ -156,13 +158,13 @@ done
|
|
|
156
158
|
Both hosts:
|
|
157
159
|
|
|
158
160
|
```bash
|
|
159
|
-
|
|
161
|
+
bunx skills add hylarucoder/hai-stack -g -a claude-code codex -s geju -y
|
|
160
162
|
```
|
|
161
163
|
|
|
162
164
|
Single host:
|
|
163
165
|
|
|
164
166
|
```bash
|
|
165
|
-
|
|
167
|
+
bunx skills add hylarucoder/hai-stack -g -a claude-code -s geju -y
|
|
166
168
|
```
|
|
167
169
|
|
|
168
170
|
Replace `claude-code` with `codex` when installing for Codex only.
|
|
@@ -204,7 +206,9 @@ command directly unless local policy explicitly opts into vendoring.
|
|
|
204
206
|
### Runtime Ownership Boundary
|
|
205
207
|
|
|
206
208
|
`repo-harness setup check --target <host> --check-updates --json` reports the
|
|
207
|
-
execution base as separate `runtime.*` checks
|
|
209
|
+
execution base as separate `runtime.*` checks and reports repo-local adoption
|
|
210
|
+
refresh as `repo.adopt-refresh` when the current repo has opted in. Keep the
|
|
211
|
+
boundary explicit:
|
|
208
212
|
|
|
209
213
|
| Capability | Owner | Required for |
|
|
210
214
|
|---|---|---|
|
|
@@ -424,7 +428,7 @@ cd ~/.claude/skills/gstack && git pull && ./setup --host codex
|
|
|
424
428
|
### Waza
|
|
425
429
|
|
|
426
430
|
```bash
|
|
427
|
-
|
|
431
|
+
bunx skills update
|
|
428
432
|
for d in think hunt check health; do
|
|
429
433
|
rsync -a --delete ~/.agents/skills/$d/ ~/.codex/skills/$d/
|
|
430
434
|
done
|
|
@@ -443,7 +447,7 @@ done
|
|
|
443
447
|
### hai-stack
|
|
444
448
|
|
|
445
449
|
```bash
|
|
446
|
-
|
|
450
|
+
bunx skills update
|
|
447
451
|
rsync -a --delete ~/.agents/skills/geju/ ~/.codex/skills/geju/
|
|
448
452
|
diff -qr ~/.agents/skills/geju ~/.codex/skills/geju
|
|
449
453
|
```
|
|
@@ -491,10 +495,15 @@ guessed mapping.
|
|
|
491
495
|
|
|
492
496
|
| Upstream frontmatter | Codex TOML |
|
|
493
497
|
|---|---|
|
|
494
|
-
| `model: opus`, `effort: max` | `model = "gpt-5.
|
|
495
|
-
| `model: sonnet`, `effort: max` | `model = "gpt-5.
|
|
498
|
+
| `model: opus`, `effort: max` | `model = "gpt-5.6-sol"`, `model_reasoning_effort = "xhigh"` |
|
|
499
|
+
| `model: sonnet`, `effort: max` | `model = "gpt-5.6-terra"`, `model_reasoning_effort = "medium"` |
|
|
496
500
|
| `tools: [...]` present | `sandbox_mode = "read-only"` |
|
|
497
501
|
|
|
502
|
+
The Codex generator also rewrites the exact upstream provider label in the
|
|
503
|
+
description (`Opus 4.8 at max effort` or `Sonnet 5 at max effort`) to the
|
|
504
|
+
mapped GPT-5.6 model and reasoning level. A missing label fails closed so the
|
|
505
|
+
installed metadata cannot claim a different model from the TOML settings.
|
|
506
|
+
|
|
498
507
|
`developer_instructions` is the upstream `.md` body plus the canonical
|
|
499
508
|
EXECUTION_BOUNDARY anti-extras clause, kept byte-identical to the
|
|
500
509
|
`EXECUTION_BOUNDARY` constant in `scripts/contract-run.ts` so every generated
|
|
@@ -5,6 +5,12 @@ Use this content for user-level `~/.codex/AGENTS.md` and `~/.claude/CLAUDE.md` w
|
|
|
5
5
|
```md
|
|
6
6
|
# Global Working Rules
|
|
7
7
|
|
|
8
|
+
Rule 0: You may spend as much time as needed thinking. Do not send optional commentary progress messages. Use tools only when they are required. For tasks that do not require tools, complete the reasoning first, then answer in final.
|
|
9
|
+
|
|
10
|
+
Reasoning: Prefer first principles over pattern matching. Before solving, first identify the observable and controllable conditions. For quantitative logic problems, before the final answer, you must prove the strategy is sufficient in the worst case. Numeric answers must have their arithmetic rechecked.
|
|
11
|
+
|
|
12
|
+
Generality: These are general working rules. Do not tailor behavior to any specific evaluation or expected answer.
|
|
13
|
+
|
|
8
14
|
- Use Chinese by default for this user; keep technical terms in English. If the user writes in another language, mirror that language.
|
|
9
15
|
- Act as an engineering collaborator: finish the concrete task, verify it, then report conclusion, actual change, reason, verification, and residual risk.
|
|
10
16
|
- Prefer direct execution over repeated confirmation. Stop to ask only when continuing would likely produce output contrary to the user's intent.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.9.
|
|
3
|
-
"templateVersion": "0.9.
|
|
2
|
+
"version": "0.9.2",
|
|
3
|
+
"templateVersion": "0.9.2",
|
|
4
4
|
"skillName": "repo-harness",
|
|
5
5
|
"contractId": "tasks-first-harness-v1",
|
|
6
6
|
"compatibility": {
|
|
@@ -191,6 +191,14 @@
|
|
|
191
191
|
{
|
|
192
192
|
"version": "0.9.0",
|
|
193
193
|
"description": "Adds a bugfix task profile with root-cause evidence gating, distills contract-brief prompts and templates, makes the agent fleet and geju first-class dependencies, adds a frontend task profile and archcontext boundary bridge, and lands the EXECUTION_BOUNDARY anti-extras clause across delegated runners"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"version": "0.9.1",
|
|
197
|
+
"description": "Hardens the Bun-first installer and setup-check path with bunx skills probes, PATH readback hints, and explicit Codex delegation-mode selection"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"version": "0.9.2",
|
|
201
|
+
"description": "Hardens CLI environment diagnostics and hook execution intent while aligning the generated GPT-5.6 agent fleet with current Codex runtime guidance"
|
|
194
202
|
}
|
|
195
203
|
],
|
|
196
204
|
"generatedProjectStamp": {
|
|
@@ -645,6 +645,13 @@ function findLatestMatchingFile(dir: string, token: string, extension: string):
|
|
|
645
645
|
return files.at(-1) || "(none yet)";
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
+
function activePendingRequestFile(file: string): string {
|
|
649
|
+
if (!file || file === "unknown") return "(none)";
|
|
650
|
+
if (file.includes("/archive/")) return "(none)";
|
|
651
|
+
if (!existsSync(file)) return "(none)";
|
|
652
|
+
return isPendingRequest(file) ? file : "(none)";
|
|
653
|
+
}
|
|
654
|
+
|
|
648
655
|
function collectFiles(dir: string): string[] {
|
|
649
656
|
if (!existsSync(dir)) return [];
|
|
650
657
|
const files: string[] = [];
|
|
@@ -680,7 +687,7 @@ function renderContractBlock(args: Args): string {
|
|
|
680
687
|
const severity = args.options.severity || "unknown";
|
|
681
688
|
const changeType = args.options.changeType || "unknown";
|
|
682
689
|
const lspProfile = args.options.lspProfile || "typescript-lsp";
|
|
683
|
-
const requestFile = args.options.requestFile || "
|
|
690
|
+
const requestFile = activePendingRequestFile(args.options.requestFile || "");
|
|
684
691
|
|
|
685
692
|
return [
|
|
686
693
|
"<!-- BEGIN ARCHITECTURE CONTRACT -->",
|
|
@@ -27,9 +27,9 @@ export type CapabilityRegistry = {
|
|
|
27
27
|
|
|
28
28
|
// archcontext-boundaries-v1 is a deliberately narrow, read-only export of the
|
|
29
29
|
// capability registry shaped as a subset of ArchitectureNode (archcontext.node/v1).
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
30
|
+
// Tests derive the bridge subset from archctx-contracts' authoritative schema;
|
|
31
|
+
// docs/researches/20260705-archcontext-capability-filing-handover.md explains
|
|
32
|
+
// why this stays a read-only bridge with no archctx CLI/daemon runtime dependency.
|
|
33
33
|
export type ArchContextBoundaryNode = {
|
|
34
34
|
schemaVersion: "archcontext.node/v1";
|
|
35
35
|
id: string;
|
|
@@ -709,7 +709,7 @@ function inspectWazaSkill(host, skill, skillLock, skillItems, upstreamSkills) {
|
|
|
709
709
|
function detectWaza() {
|
|
710
710
|
const skillLockPath = path.join(HOME, ".agents", ".skill-lock.json");
|
|
711
711
|
const skillLock = readJson(skillLockPath);
|
|
712
|
-
const skillsResult = run("
|
|
712
|
+
const skillsResult = run("bunx", ["skills", "ls", "-g", "--json"], { timeoutMs: 1500 });
|
|
713
713
|
const skillItems = skillsResult.ok ? parseJson(skillsResult.stdout) || [] : [];
|
|
714
714
|
const wazaEntries = Object.entries(skillLock?.skills || {}).filter(([, meta]) => meta?.source === WAZA_SOURCE_REPO);
|
|
715
715
|
const upstream = fetchWazaUpstreamSkills();
|
|
@@ -815,7 +815,7 @@ function detectWaza() {
|
|
|
815
815
|
: "Local Waza SKILL.md and shared rule files match upstream GitHub raw content.";
|
|
816
816
|
|
|
817
817
|
const status = summarizeWazaStatus(hostStatuses);
|
|
818
|
-
const installCommand = `
|
|
818
|
+
const installCommand = `bunx skills add tw93/Waza -g -a ${
|
|
819
819
|
hostMode === "both" ? "claude-code codex" : hostMode === "claude" ? "claude-code" : "codex"
|
|
820
820
|
} -s think hunt check health -y`;
|
|
821
821
|
const syncCommand = SELECTED_HOSTS.map((host) => buildWazaHostSyncCommand(host)).join(" && ");
|
|
@@ -878,8 +878,8 @@ function detectRuntimeCapabilities(waza) {
|
|
|
878
878
|
),
|
|
879
879
|
npx: commandCapability(
|
|
880
880
|
"npx",
|
|
881
|
-
"
|
|
882
|
-
"
|
|
881
|
+
"no repo-harness usage; Skills CLI bootstrap/update for Waza and Mermaid runs through bunx instead",
|
|
882
|
+
"npm-registry",
|
|
883
883
|
false
|
|
884
884
|
),
|
|
885
885
|
skills_cli: {
|
|
@@ -889,7 +889,7 @@ function detectRuntimeCapabilities(waza) {
|
|
|
889
889
|
owner: "external-skills-cli",
|
|
890
890
|
required: false,
|
|
891
891
|
required_for: "Waza/Mermaid external skill bootstrap; repo-harness reports this as an explicit exception boundary",
|
|
892
|
-
command: "
|
|
892
|
+
command: "bunx skills ls -g --json",
|
|
893
893
|
},
|
|
894
894
|
bash: commandCapability(
|
|
895
895
|
"bash",
|
|
@@ -155,6 +155,19 @@ metadata_value() {
|
|
|
155
155
|
' "$file" 2>/dev/null
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
active_pending_request_file() {
|
|
159
|
+
local file="$1"
|
|
160
|
+
if [[ -z "$file" || "$file" == "unknown" || "$file" == *"/archive/"* || ! -f "$file" ]]; then
|
|
161
|
+
echo "(none)"
|
|
162
|
+
return 0
|
|
163
|
+
fi
|
|
164
|
+
if [[ "$(metadata_value "$file" "Status" | tr '[:upper:]' '[:lower:]')" == "pending" ]]; then
|
|
165
|
+
echo "$file"
|
|
166
|
+
else
|
|
167
|
+
echo "(none)"
|
|
168
|
+
fi
|
|
169
|
+
}
|
|
170
|
+
|
|
158
171
|
format_active_workstreams() {
|
|
159
172
|
local dir="$1"
|
|
160
173
|
local count=0
|
|
@@ -440,6 +453,7 @@ if [[ "$latest_snapshot" != "(none yet)" ]]; then
|
|
|
440
453
|
semantic_diagram_source="$latest_snapshot"
|
|
441
454
|
fi
|
|
442
455
|
active_workstreams="$(format_active_workstreams "$workstream_dir")"
|
|
456
|
+
pending_request_file="$(active_pending_request_file "${request_file:-}")"
|
|
443
457
|
|
|
444
458
|
block_tmp="$(mktemp)"
|
|
445
459
|
cat > "$block_tmp" <<EOF_BLOCK
|
|
@@ -466,7 +480,7 @@ cat > "$block_tmp" <<EOF_BLOCK
|
|
|
466
480
|
- Latest snapshot: \`${latest_snapshot}\`
|
|
467
481
|
- Semantic diagram source: \`${semantic_diagram_source}\`
|
|
468
482
|
- Latest human diagram: \`${latest_human_diagram}\`
|
|
469
|
-
- Pending architecture request: \`${
|
|
483
|
+
- Pending architecture request: \`${pending_request_file}\`
|
|
470
484
|
|
|
471
485
|
## Active Workstreams
|
|
472
486
|
|