repo-harness 0.16.2 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.es.md +5 -5
  2. package/README.fr.md +5 -5
  3. package/README.ja.md +5 -5
  4. package/README.md +5 -5
  5. package/README.zh-CN.md +5 -5
  6. package/agents/fleet/gatekeeper.md +1 -1
  7. package/assets/hooks/lib/workflow-state.sh +16 -2
  8. package/assets/reference-configs/external-tooling.md +3 -3
  9. package/assets/skill-version.json +7 -3
  10. package/assets/skills/repo-harness-chatgpt/SKILL.md +6 -2
  11. package/assets/skills/repo-harness-chatgpt/references/orchestrate.md +225 -0
  12. package/assets/skills/repo-harness-chatgpt/references/setup.md +66 -0
  13. package/assets/templates/helpers/contract-worktree.sh +90 -15
  14. package/assets/templates/helpers/install-agent-fleet.sh +8 -5
  15. package/assets/templates/helpers/prepare-handoff.sh +3 -2
  16. package/assets/templates/helpers/ship-worktrees.sh +240 -6
  17. package/assets/templates/helpers/sprint-backlog.sh +39 -20
  18. package/assets/templates/helpers/verify-contract.sh +123 -3
  19. package/dist/hook-entry.js +1383 -379
  20. package/docs/repo-harness-chatgpt-browser-engine.md +43 -0
  21. package/install.ps1 +1 -1
  22. package/install.sh +1 -1
  23. package/package.json +2 -2
  24. package/scripts/contract-worktree.sh +90 -15
  25. package/scripts/hook-dispatch-diet-report.ts +4 -1
  26. package/scripts/install-agent-fleet.sh +8 -5
  27. package/scripts/prepare-handoff.sh +3 -2
  28. package/scripts/ship-worktrees.sh +240 -6
  29. package/scripts/sprint-backlog.sh +39 -20
  30. package/scripts/verify-contract.sh +123 -3
  31. package/src/cli/chatgpt-skill/source.ts +1 -0
  32. package/src/cli/commands/fleet.ts +902 -0
  33. package/src/cli/commands/global-runtime.ts +8 -2
  34. package/src/cli/commands/publication.ts +474 -0
  35. package/src/cli/commands/sprint.ts +35 -781
  36. package/src/cli/commands/state.ts +1 -6
  37. package/src/cli/hook/handler-registry.ts +12 -0
  38. package/src/cli/hook/mutation-guard.ts +9 -1
  39. package/src/cli/hook/route-registry.ts +10 -0
  40. package/src/cli/hook/runtime.ts +1 -0
  41. package/src/cli/hook/task-inbox-handler.ts +137 -0
  42. package/src/cli/index.ts +19 -1
  43. package/src/cli/installer/managed-entries.ts +1 -0
  44. package/src/cli/mcp/fleet-tools.ts +545 -0
  45. package/src/cli/mcp/tools.ts +7 -0
  46. package/src/cli/runtime/helper-runner.ts +11 -0
  47. package/src/core/fleet/board.ts +293 -0
  48. package/src/core/fleet/task-message.ts +402 -0
  49. package/src/core/fleet/task-offer.ts +251 -0
  50. package/src/core/loop/loop-event-protocol.ts +4 -3
  51. package/src/core/publication/feedback.ts +941 -0
  52. package/src/core/publication/merge-readiness.ts +178 -0
  53. package/src/core/publication/publication-lifecycle.ts +246 -0
  54. package/src/core/publication/publication-receipt.ts +354 -0
  55. package/src/core/state/attempt-ledger.ts +11 -14
  56. package/src/core/state/command-outcome.ts +11 -0
  57. package/src/core/state/coordination-identity.ts +299 -12
  58. package/src/core/state/no-progress.ts +35 -0
  59. package/src/core/state/project-board.ts +38 -5
  60. package/src/core/state/types.ts +8 -0
  61. package/src/effects/fleet/acquire.ts +874 -0
  62. package/src/effects/fleet/board.ts +483 -0
  63. package/src/effects/fleet/task-inbox.ts +813 -0
  64. package/src/effects/publication/feedback-store.ts +648 -0
  65. package/src/effects/publication/feedback.ts +1588 -0
  66. package/src/effects/publication/merge-readiness.ts +688 -0
  67. package/src/effects/publication/publication-lifecycle.ts +941 -0
  68. package/src/effects/publication/publication-receipt.ts +690 -0
  69. package/src/effects/repo-registry.ts +170 -7
  70. package/src/effects/state/coordination-canonical-source.ts +219 -0
  71. package/src/effects/state/coordination-claim-token.ts +162 -4
  72. package/src/effects/state/coordination-lease-store.ts +4 -4
  73. package/src/effects/state/coordination-sprint.ts +838 -0
package/README.es.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/repo-harness.svg)](https://www.npmjs.com/package/repo-harness)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.1.35-black.svg)](https://bun.sh)
11
+ [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.4.0-black.svg)](https://bun.sh)
12
12
 
13
13
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [Français](README.fr.md) | [Español](README.es.md)
14
14
 
@@ -43,7 +43,7 @@ de agente tasks-first que mantiene alineados a Claude y Codex.
43
43
  ### 1. Instalar el CLI
44
44
 
45
45
  Prerrequisitos: un Git working tree, `bash` y `bun`; `jq` es opcional. No se
46
- necesita Node.js — el instalador usa Bun >= 1.1.35 como runtime, instalando o
46
+ necesita Node.js — el instalador usa Bun >= 1.4.0 como runtime, instalando o
47
47
  actualizando Bun primero si hace falta.
48
48
 
49
49
  ```bash
@@ -54,7 +54,7 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
54
54
  irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
55
55
  ```
56
56
 
57
- Si ya tienes Bun >= 1.1.35 en el PATH, omite el instalador de shell. Las
57
+ Si ya tienes Bun >= 1.4.0 en el PATH, omite el instalador de shell. Las
58
58
  instalaciones de Bun gestionadas por un gestor de paquetes fallan de forma
59
59
  cerrada (fail closed) con el comando de actualización correspondiente
60
60
  (`brew upgrade bun`), en lugar de sobrescribir archivos que pertenecen a ese
@@ -467,8 +467,8 @@ repositorio adopte la misma política.
467
467
 
468
468
  ## Versión actual
469
469
 
470
- - Paquete npm: `repo-harness@0.16.2`
471
- - Sello de workflow generado: `repo-harness@0.16.2+template@0.16.2`
470
+ - Paquete npm: `repo-harness@0.17.0`
471
+ - Sello de workflow generado: `repo-harness@0.17.0+template@0.17.0`
472
472
  - Repositorio de GitHub: `Ancienttwo/repo-harness`
473
473
  - Notas de versión e historial: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
474
474
 
package/README.fr.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/repo-harness.svg)](https://www.npmjs.com/package/repo-harness)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.1.35-black.svg)](https://bun.sh)
11
+ [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.4.0-black.svg)](https://bun.sh)
12
12
 
13
13
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [Français](README.fr.md) | [Español](README.es.md)
14
14
 
@@ -43,7 +43,7 @@ d'agent tasks-first qui maintient Claude et Codex alignés.
43
43
  ### 1. Installer le CLI
44
44
 
45
45
  Prérequis : un working tree Git, `bash` et `bun` ; `jq` est optionnel. Node.js
46
- n'est pas nécessaire — l'installateur utilise Bun >= 1.1.35 comme runtime, en
46
+ n'est pas nécessaire — l'installateur utilise Bun >= 1.4.0 comme runtime, en
47
47
  l'installant ou en le mettant à niveau d'abord si besoin.
48
48
 
49
49
  ```bash
@@ -54,7 +54,7 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
54
54
  irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
55
55
  ```
56
56
 
57
- Si Bun >= 1.1.35 est déjà sur le PATH, l'installateur shell peut être ignoré.
57
+ Si Bun >= 1.4.0 est déjà sur le PATH, l'installateur shell peut être ignoré.
58
58
  Les installations de Bun gérées par un package manager échouent en mode
59
59
  fail-closed avec la commande de mise à niveau correspondante (`brew upgrade
60
60
  bun`), plutôt que d'écraser les fichiers appartenant au manager.
@@ -462,8 +462,8 @@ adopte la même policy.
462
462
 
463
463
  ## Release actuelle
464
464
 
465
- - Package npm : `repo-harness@0.16.2`
466
- - Generated workflow stamp : `repo-harness@0.16.2+template@0.16.2`
465
+ - Package npm : `repo-harness@0.17.0`
466
+ - Generated workflow stamp : `repo-harness@0.17.0+template@0.17.0`
467
467
  - Dépôt GitHub : `Ancienttwo/repo-harness`
468
468
  - Notes et historique de release : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
469
469
 
package/README.ja.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/repo-harness.svg)](https://www.npmjs.com/package/repo-harness)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.1.35-black.svg)](https://bun.sh)
11
+ [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.4.0-black.svg)](https://bun.sh)
12
12
 
13
13
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [Français](README.fr.md) | [Español](README.es.md)
14
14
 
@@ -42,7 +42,7 @@
42
42
  ### 1. CLI をインストールする
43
43
 
44
44
  前提条件は Git working tree、`bash`、`bun` です。`jq` は任意です。Node.js は
45
- 不要です — installer は runtime として Bun >= 1.1.35 を使用し、必要であれば
45
+ 不要です — installer は runtime として Bun >= 1.4.0 を使用し、必要であれば
46
46
  先に Bun のインストールまたはアップグレードを行います。
47
47
 
48
48
  ```bash
@@ -53,7 +53,7 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
53
53
  irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
54
54
  ```
55
55
 
56
- Bun >= 1.1.35 がすでに PATH 上にある場合は、shell installer をスキップできます。
56
+ Bun >= 1.4.0 がすでに PATH 上にある場合は、shell installer をスキップできます。
57
57
  Package manager が所有する Bun のインストールでは、manager が管理するファイルを
58
58
  上書きする代わりに、対応する upgrade コマンド(`brew upgrade bun`)を伴って
59
59
  fail closed します。
@@ -470,8 +470,8 @@ commit script や hooks に組み込まないでください。
470
470
 
471
471
  ## 現在の Release
472
472
 
473
- - npm package:`repo-harness@0.16.2`
474
- - Generated workflow stamp:`repo-harness@0.16.2+template@0.16.2`
473
+ - npm package:`repo-harness@0.17.0`
474
+ - Generated workflow stamp:`repo-harness@0.17.0+template@0.17.0`
475
475
  - GitHub repository:`Ancienttwo/repo-harness`
476
476
  - Release notes and history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
477
477
 
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/repo-harness.svg)](https://www.npmjs.com/package/repo-harness)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.1.35-black.svg)](https://bun.sh)
11
+ [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.4.0-black.svg)](https://bun.sh)
12
12
 
13
13
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [Français](README.fr.md) | [Español](README.es.md)
14
14
 
@@ -44,7 +44,7 @@ with a tasks-first agent contract that keeps Claude and Codex aligned.
44
44
  Prerequisites: a Git working tree and `bun`; macOS/Linux also require `bash`,
45
45
  while Windows requires Git for Windows (including its Bash and `usr/bin`
46
46
  tools). `jq` is optional. No Node.js required — the installer uses Bun >=
47
- 1.1.35 as the runtime, installing or upgrading Bun first when needed.
47
+ 1.4.0 as the runtime, installing or upgrading Bun first when needed.
48
48
 
49
49
  ```bash
50
50
  # macOS / Linux
@@ -54,7 +54,7 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
54
54
  irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
55
55
  ```
56
56
 
57
- With Bun >= 1.1.35 already on PATH, skip the shell installer. Package-manager-owned
57
+ With Bun >= 1.4.0 already on PATH, skip the shell installer. Package-manager-owned
58
58
  Bun installs fail closed with the matching upgrade command (`brew upgrade bun`)
59
59
  instead of overwriting manager-owned files.
60
60
 
@@ -450,8 +450,8 @@ repo-harness commit scripts or hooks unless that repo adopts the same policy.
450
450
 
451
451
  ## Current Release
452
452
 
453
- - npm package: `repo-harness@0.16.2`
454
- - Generated workflow stamp: `repo-harness@0.16.2+template@0.16.2`
453
+ - npm package: `repo-harness@0.17.0`
454
+ - Generated workflow stamp: `repo-harness@0.17.0+template@0.17.0`
455
455
  - GitHub repository: `Ancienttwo/repo-harness`
456
456
  - Release notes and history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
457
457
 
package/README.zh-CN.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/repo-harness.svg)](https://www.npmjs.com/package/repo-harness)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.1.35-black.svg)](https://bun.sh)
11
+ [![Runtime: Bun](https://img.shields.io/badge/runtime-Bun%20%E2%89%A5%201.4.0-black.svg)](https://bun.sh)
12
12
 
13
13
  [English](README.md) | [简体中文](README.zh-CN.md) | [日本語](README.ja.md) | [Français](README.fr.md) | [Español](README.es.md)
14
14
 
@@ -43,7 +43,7 @@ checks 和 review evidence 写回项目文件,让下一个 agent 会话从文
43
43
 
44
44
  前置条件:一个 Git working tree 和 `bun`;macOS/Linux 还需要 `bash`,
45
45
  Windows 则需要 Git for Windows(包括其 Bash 与 `usr/bin` 工具)。`jq`
46
- 可选。不需要 Node.js——installer 使用 Bun >= 1.1.35 作为 runtime,需要时会
46
+ 可选。不需要 Node.js——installer 使用 Bun >= 1.4.0 作为 runtime,需要时会
47
47
  先安装或升级 Bun。
48
48
 
49
49
  ```bash
@@ -54,7 +54,7 @@ curl -fsSL https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/instal
54
54
  irm https://raw.githubusercontent.com/Ancienttwo/repo-harness/main/install.ps1 | iex
55
55
  ```
56
56
 
57
- 如果 Bun >= 1.1.35 已经在 PATH 上,可以跳过 shell installer。由包管理器
57
+ 如果 Bun >= 1.4.0 已经在 PATH 上,可以跳过 shell installer。由包管理器
58
58
  安装的 Bun 会 fail closed,并提示对应的升级命令(如 `brew upgrade bun`),
59
59
  而不是覆盖包管理器管理的文件。
60
60
 
@@ -457,8 +457,8 @@ policy。
457
457
 
458
458
  ## 当前 Release
459
459
 
460
- - npm package:`repo-harness@0.16.2`
461
- - Generated workflow stamp:`repo-harness@0.16.2+template@0.16.2`
460
+ - npm package:`repo-harness@0.17.0`
461
+ - Generated workflow stamp:`repo-harness@0.17.0+template@0.17.0`
462
462
  - GitHub repository:`Ancienttwo/repo-harness`
463
463
  - Release notes 和 history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
464
464
 
@@ -10,7 +10,7 @@ You are the read-only acceptance and ship gate. Execution workers deliver work;
10
10
 
11
11
  - **Verdict first.** Your opening line is exactly one of `VERDICT: PASS`, `VERDICT: FAIL`, `VERDICT: BLOCKED`. PASS means every gate is clean and you state the recommended next action without performing it. FAIL means blocking findings and nothing touched. BLOCKED means a precondition prevents judgment, such as no verification command, auth failure, merge conflict, moved HEAD, or missing goal manifest.
12
12
  - **Worktree safety.** Start with `git status --short --branch -uall` and record `git rev-parse HEAD`. Modified, staged, and untracked files are user work. Never switch branch, stash, reset, clean, discard, stage, or commit them. If HEAD moves or unknown commits appear during review, stop and return BLOCKED.
13
- - **Acceptance gates.** Scope: every changed file traces to the stated goal. Verification: run the project's real commands and report their actual output. Hard stops include unknown identifiers, version skew, stale generated output, surprise dependencies, hardcoded secrets, and sleeps standing in for a completion signal.
13
+ - **Acceptance gates.** Scope: every changed file traces to the stated goal. Verification: run the project's real commands and report their actual output. Hard stops include unknown identifiers, version skew, stale generated output, surprise dependencies, hardcoded secrets, sleeps standing in for a completion signal, near-duplicates of an existing canonical helper, special-case branches or one-off mode flags bolted into shared flows the goal does not cover, and pass-through wrappers or `any`/cast churn that obscure an existing contract without the goal requiring it.
14
14
  - **Decomposition is recommendation only.** Given a goal manifest, map changes to goals and propose file-granular commit or PR groups. A file entangling goals is a FAIL finding. Unmapped changes are user work and remain untouched. The orchestrator performs any approved split or ship action.
15
15
  - **Evidence before claim.** A test, CI result, or ship state counts only if checked in this turn. Before recommending merge, re-read PR and CI status; before recommending push, check local versus remote sync. Never recommend merge on red or stale evidence.
16
16
  - **FAIL returns findings, not fixes.** Each finding is `[CRITICAL|HIGH|MEDIUM] file:line — problem — concrete fix instruction — class(safe_auto|gated_auto|manual)`. You do not edit or patch through any tool.
@@ -1857,7 +1857,7 @@ workflow_contract_allows_path() {
1857
1857
  }
1858
1858
  workflow_write_handoff() {
1859
1859
  local reason="${1:-session-stop}"
1860
- local source_plan parent_run_id bun_bin
1860
+ local source_plan parent_run_id bun_bin helper_source recovery_view_cli
1861
1861
 
1862
1862
  # EPC-07: independent handoff/resume content assembly retired same-package
1863
1863
  # (Phase A/B: tasks/contracts/20260722-2246-epc-07-recovery-view-cutover.contract.md).
@@ -1871,7 +1871,21 @@ workflow_write_handoff() {
1871
1871
  # EPC-07's four named recovery views.
1872
1872
  workflow_ensure_harness_surface
1873
1873
  bun_bin="${REPO_HARNESS_BUN_BIN:-bun}"
1874
- "$bun_bin" "scripts/recovery-view-cli.ts" --reason "$reason" --quiet
1874
+ helper_source="${REPO_HARNESS_HELPER_SOURCE_PATH:-}"
1875
+ if [[ -n "$helper_source" ]]; then
1876
+ if [[ ! -f "$helper_source" || "$(basename "$helper_source")" != "prepare-handoff.sh" ]]; then
1877
+ echo "workflow_write_handoff: invalid REPO_HARNESS_HELPER_SOURCE_PATH for prepare-handoff" >&2
1878
+ return 1
1879
+ fi
1880
+ recovery_view_cli="$(cd "$(dirname "$helper_source")" && pwd)/recovery-view-cli.ts"
1881
+ else
1882
+ recovery_view_cli="scripts/recovery-view-cli.ts"
1883
+ fi
1884
+ if [[ ! -f "$recovery_view_cli" ]]; then
1885
+ echo "workflow_write_handoff: recovery materializer is missing: $recovery_view_cli" >&2
1886
+ return 1
1887
+ fi
1888
+ "$bun_bin" "$recovery_view_cli" --reason "$reason" --quiet
1875
1889
 
1876
1890
  source_plan="$(get_todo_source_plan || true)"
1877
1891
  if [[ "$source_plan" == "(none)" ]]; then
@@ -712,9 +712,9 @@ six source files before mutating any target; a missing, malformed, mismatched,
712
712
  or unmapped source makes the whole run fail closed and leaves installed files
713
713
  untouched.
714
714
 
715
- The installer requires Bun >= 1.1.35, matching repo-harness's package runtime
716
- contract and the first supported `Bun.TOML.parse` behavior for the generated
717
- multiline agent files.
715
+ The installer requires Bun >= 1.4.0, matching repo-harness's package runtime
716
+ contract and its verified subprocess environment-inheritance behavior.
717
+ The CLI entry rejects older or unparseable Bun runtimes before command dispatch.
718
718
  The top-level Unix and Windows bootstrap installers upgrade an older detected
719
719
  Bun before installing repo-harness, rather than relying on package-engine
720
720
  metadata that older Bun releases do not enforce.
@@ -1,11 +1,11 @@
1
1
  {
2
- "version": "0.16.2",
3
- "templateVersion": "0.16.2",
2
+ "version": "0.17.0",
3
+ "templateVersion": "0.17.0",
4
4
  "skillName": "repo-harness",
5
5
  "contractId": "tasks-first-harness-v1",
6
6
  "compatibility": {
7
7
  "minClaudeCodeVersion": "1.0.0",
8
- "minBunVersion": "1.0.0"
8
+ "minBunVersion": "1.4.0"
9
9
  },
10
10
  "breakingChanges": [
11
11
  {
@@ -263,6 +263,10 @@
263
263
  {
264
264
  "version": "0.16.2",
265
265
  "description": "Fixes MCP runtime issues from #204, binds MCP HTTP sessions to the startup profile with fail-closed config-flip handling, publishes the architecture queue lock owner record atomically via staged hard-link creation, requires and fail-closed-validates sandbox_mode in Codex custom-agent TOMLs with EXECUTION_BOUNDARY persona de-duplication, and adds artifact-hygiene rules (final-diff-only comments and PR text) to the global working rules and generated agent contracts"
266
+ },
267
+ {
268
+ "version": "0.17.0",
269
+ "description": "Adds the Git-backed Fleet control plane: immutable PublicationReceiptV1 identity and recovery, Lease protocol 2 reviewing/reopen/takeover lifecycle, fenced merge readiness and integration reconcile, deterministic cross-repo offers/acquire and FleetBoardSnapshotV1/watch, immutable provider feedback and task inbox delivery, GPT Pro advisory orchestration, Fleet MCP mirrors, and a Bun 1.4 runtime floor"
266
270
  }
267
271
  ],
268
272
  "generatedProjectStamp": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: repo-harness-chatgpt
3
- description: Canonical rule owner for repo-harness ChatGPT integration -- Oracle-first browser/GPT Pro consult and continuation, MCP Connector setup, MCP bridge planning handoff, and Connector invocation read-back evidence.
4
- when_to_use: "repo-harness-chatgpt, ChatGPT Web consult, GPT Pro consult, gptpro, browser GPT, ChatGPT MCP Connector, ChatGPT bridge, MCP read-back, GPT Pro delegate, delegate to ChatGPT, 外包给 GPT"
3
+ description: Canonical rule owner for repo-harness ChatGPT integration -- Oracle-first browser/GPT Pro consult and continuation, advisory orchestration, MCP Connector setup, MCP bridge planning handoff, and Connector invocation read-back evidence.
4
+ when_to_use: "repo-harness-chatgpt, ChatGPT Web consult, GPT Pro consult, GPT Pro orchestrate, gptpro, browser GPT, ChatGPT MCP Connector, ChatGPT bridge, MCP read-back, GPT Pro delegate, delegate to ChatGPT, 外包给 GPT"
5
5
  ---
6
6
 
7
7
  # repo-harness-chatgpt
@@ -15,6 +15,8 @@ mode protocol lives under `references/`.
15
15
  ## Mode Selection
16
16
 
17
17
  - First-time Oracle browser or MCP Connector configuration -> `references/setup.md`.
18
+ - Explicit GPT Pro orchestration -> read the setup lane in
19
+ `references/setup.md`, then `references/orchestrate.md`.
18
20
  - Start a new local -> ChatGPT Web browser consult -> `references/consult.md`.
19
21
  - Continue, read, or clean up a saved browser session -> `references/continue.md`.
20
22
  - Verify or accept a ChatGPT MCP tool call as real evidence -> `references/read-back.md`.
@@ -27,5 +29,7 @@ mode protocol lives under `references/`.
27
29
  - Never request or handle ChatGPT passwords, 2FA codes, cookies, browser storage, or session tokens; login/captcha/SSO stop and hand back to the user.
28
30
  - Setup, consult, and bridge modes share these safety rules by reference; none shares secrets, auth state, or tokens with another mode.
29
31
  - Consult stays planning/review/critique only, never the code-edit executor; delegate is the sole approved path for code deliverables, and GPT Pro still never executes edits.
32
+ - Orchestrate is explicit opt-in advisory planning/review; GPT Pro never owns
33
+ task, lease, writes, shell, or acceptance authority.
30
34
  - A missing or unreadable canonical reference fails the calling command closed; it never synthesizes replacement prose.
31
35
  - Do not enable remote CDP or an orchestrator dev runner unless the user explicitly asks and the boundary is documented.
@@ -0,0 +1,225 @@
1
+ # Orchestrate Mode: GPT Pro Advisory Chief Planner and Reviewer
2
+
3
+ Use this mode only after the user has explicitly enabled GPT Pro
4
+ orchestration for the current repository and task and the orchestration lane
5
+ in [`setup.md`](setup.md) has passed. It composes the existing ChatGPT Web
6
+ browser consult, session read-back, and follow-up capabilities. It does not
7
+ add a provider, runtime adapter, schema, fleet role, or second Skill.
8
+
9
+ GPT Pro is an external chief planner/reviewer. Local Codex is the accountable
10
+ coordinator and executor, including the Codex built-in browser (IAB) transport.
11
+ Repository artifacts, the effective-state resolver, task contract, lease,
12
+ allowed paths, real checks, and acceptance gate remain the only control-plane
13
+ and execution authority.
14
+
15
+ ## Authority Boundary
16
+
17
+ | Participant | May do | May not do |
18
+ | --- | --- | --- |
19
+ | GPT Pro Web | Read the exact context supplied to it, use the authorized GitHub Connector when visibly available, propose a plan, identify risks, and review the returned diff/evidence | Edit the local worktree, run local commands, create or change tasks, claim/release/steal a lease, widen `allowed_paths`, assert that local checks ran, or authorize commit/push/PR/merge/deploy |
20
+ | Local Codex | Resolve state, select the remote revision, build and secret-scan the local bundle, dispatch work through the normal task/lease path, run checks, and decide acceptance | Treat GPT Pro prose or a tool-use claim as permission or as proof of a local fact |
21
+ | GitHub Connector | Supply remote repository facts at an exact revision when its invocation is observable | Describe uncommitted local changes or replace the local repository source of truth |
22
+
23
+ This is an advisory planning/review loop, not a managed `agent-fleet` role.
24
+ Do not automatically spawn a local agent from GPT Pro's proposal. The
25
+ `delegate.md` protocol remains the sole path for a GPT Pro-produced code
26
+ deliverable; this mode receives advice and review only.
27
+
28
+ ## Readiness Gate
29
+
30
+ Before opening a real conversation, verify the explicit setup checklist and
31
+ all of the following:
32
+
33
+ - the canonical Skill is projected from a durable checkout;
34
+ - the selected browser session is signed in, visibly shows a Pro model, and
35
+ has no login, captcha, SSO, passkey, or workspace-picker interruption;
36
+ - the user's GitHub Connector is selected and authorized in ChatGPT Web;
37
+ - the target repository, ref, and exact remote commit SHA are recorded;
38
+ - the local base commit, tracked delta, and untracked-file manifest are
39
+ captured separately from the remote facts;
40
+ - the exact prompt and every local attachment pass the existing
41
+ `--dry-run --secret-scan` gate, and the saved prompt hash is unchanged.
42
+
43
+ If any item is missing, stale, or only asserted by the model, fail closed and
44
+ return to the setup guide. Do not switch providers, use an unbound browser
45
+ profile,
46
+ infer a remote fact from GitHub's default branch, or submit an unscanned
47
+ attachment.
48
+
49
+ ## Evidence Binding Without a New Schema
50
+
51
+ Keep these values as ordinary prompt and workflow evidence; do not invent a
52
+ typed orchestration binding or receipt in this mode:
53
+
54
+ ```text
55
+ remote.repository = <canonical owner/name>
56
+ remote.ref = <target branch/tag/ref>
57
+ remote.sha = <exact commit SHA>
58
+ local.base = <local base commit>
59
+ local.delta = <SHA-256 of the tracked-diff/untracked manifest bundle>
60
+ git.version = <exact stdout of `git --version`>
61
+ conversation = <same browser session/provider handle and URL>
62
+ prompt = <SHA-256 from the secret-scan receipt>
63
+ ```
64
+
65
+ The untracked-file manifest identity is the SHA-256 of a canonical JSON array
66
+ of `{path, sha256}` entries sorted by repo-relative path. Emit that manifest
67
+ as compact UTF-8 JSON with no BOM and exactly one final LF; keep object keys in
68
+ `path`, then `sha256`, order. The `local.delta` preimage is the exact tracked
69
+ diff bytes followed immediately by the exact canonical manifest bytes, in that
70
+ order: `sha256(trackedDiffBytes || manifestBytes)`. The framing adds no
71
+ delimiter, separator, wrapper, or newline of its own; preserve each input's
72
+ bytes exactly, including the tracked diff's own ending and the manifest's
73
+ final LF. Reordering entries is therefore stable, while adding, removing, or
74
+ changing an untracked file changes the identity; a tracked-diff hash alone is
75
+ insufficient.
76
+
77
+ Produce `trackedDiffBytes` from `local.base` with the following deterministic
78
+ read-only command. Comparing a commit to the worktree includes both staged and
79
+ unstaged changes to tracked files; untracked files are excluded here and enter
80
+ through the manifest above. Record the exact `git --version` output alongside
81
+ the resulting digest because Git versions can change patch rendering:
82
+
83
+ ```bash
84
+ LC_ALL=C git --version
85
+ LC_ALL=C git -c core.quotepath=false diff \
86
+ --binary --full-index --no-color --no-ext-diff --no-textconv \
87
+ --no-renames --no-indent-heuristic --diff-algorithm=myers \
88
+ --src-prefix=a/ --dst-prefix=b/ \
89
+ <local.base> --
90
+ ```
91
+
92
+ Treat the command's raw stdout bytes as `trackedDiffBytes`; do not decode,
93
+ normalize, add a delimiter, or reconstruct the diff before hashing. Pass the
94
+ resulting tracked diff and manifest only through the existing exact
95
+ `--dry-run --secret-scan` prompt/attachment gate.
96
+
97
+ Remote GitHub facts and local worktree state are different inputs. A GitHub
98
+ read cannot describe an uncommitted or untracked local file, and a local diff
99
+ cannot prove that a remote SHA was read through MCP.
100
+
101
+ For a branch code audit, GPT Pro must visibly invoke the GitHub Connector and
102
+ read the pushed branch head at its exact commit SHA. A review against an
103
+ unpublished worktree instead binds the exact remote base SHA plus the scanned
104
+ local-delta bundle and must be labeled `local-bundle review`; it is not a
105
+ GitHub branch audit. Never describe a branch name, model claim, or supplied
106
+ diff alone as proof that the pushed commit was read.
107
+
108
+ Classify GitHub Connector use from observable browser/tool evidence, not from
109
+ GPT Pro's wording:
110
+
111
+ - `verified`: the conversation/read-back exposes the GitHub MCP/Connector
112
+ invocation and the response binds the repository and exact SHA.
113
+ - `bundle_only`: no invocation is observable, but the
114
+ exact remote facts were supplied in the scanned bundle. This is honest
115
+ context classification, not proof of GitHub MCP usage.
116
+ - `unverified`: the invocation, repository, ref, or SHA is missing, stale, or
117
+ conflicts with the local record.
118
+
119
+ An end-to-end GitHub-backed canary or any adoption that depends on a live
120
+ Connector requires `verified`. `bundle_only` may be recorded for diagnosis but
121
+ does not upgrade itself into `verified`; `unverified` blocks the round.
122
+
123
+ ## Protocol
124
+
125
+ ### 1. Prepare and send the plan turn
126
+
127
+ 1. Confirm the current task contract, active plan, effective state, lease, and
128
+ allowed paths locally. Preserve unrelated dirty worktree state.
129
+ 2. Resolve and record the exact remote repository/ref/SHA. Do not let GPT Pro
130
+ choose a moving branch or silently substitute another revision.
131
+ 3. Snapshot the local base, tracked diff, and untracked manifest. Render the
132
+ orchestration brief and attachments through the existing policy-checked
133
+ prompt path. Run a dry-run with `--secret-scan`, then use the exact saved
134
+ `prompt.md`; do not reconstruct it in the browser.
135
+ 4. Open a new conversation for this independent task. Visually record the
136
+ selected Pro model and wait until a conversation URL or equivalent handle
137
+ appears before waiting for generation. Use the existing browser consult
138
+ path; this mode does not create a new transport.
139
+ 5. Ask GPT Pro for an advisory plan with: proposed task slices, affected
140
+ paths, assumptions and evidence, risks, required local checks, and explicit
141
+ `blocked`/`unverified` items. Require it to distinguish GitHub Connector
142
+ observations from the supplied bundle.
143
+
144
+ The local coordinator owns the session handle, prompt hash, remote SHA, and
145
+ local-delta identity. GPT Pro cannot amend any of them through its response.
146
+
147
+ ### 2. Recheck and execute locally
148
+
149
+ 1. Read the saved answer only after the browser session reports a complete
150
+ generation and the answer is available through the managed session/read-back
151
+ surface. A changed message count or model self-report is not completion
152
+ evidence.
153
+ 2. Classify GitHub evidence as `verified`, `bundle_only`, or `unverified`.
154
+ Recheck the proposed paths and assumptions against the current local
155
+ contract and effective state. If the remote SHA or local delta changed,
156
+ discard the proposal and rebuild the bundle.
157
+ 3. Treat the proposal as advisory input. The local coordinator may dispatch
158
+ only work already authorized by the task contract and lease. It runs edits
159
+ and real checks locally; GPT Pro never claims those results for it.
160
+ 4. Stop closed on stale state, missing evidence, path widening, a proposed
161
+ commit/push/PR/deploy, or any instruction that crosses the authority table.
162
+
163
+ ### 3. Review the implemented result in the same conversation
164
+
165
+ 1. Capture the actual local diff, untracked manifest, command output, and
166
+ check results after implementation. Secret-scan the exact review prompt and
167
+ attachments again; the review bundle must identify the same remote SHA and
168
+ the new local-delta hash.
169
+ 2. Continue the original session with the existing follow-up command/path
170
+ (`browser-followup` / the Codex built-in browser's same conversation). Do
171
+ not open a new conversation to hide a failed continuation or silently
172
+ switch transports.
173
+ 3. Ask GPT Pro to review the exact result for scope, correctness risks, and
174
+ missing tests. Require it to mark every claim that cannot be verified from
175
+ the supplied diff or visible Connector evidence.
176
+ 4. Confirm the same conversation handle, visible completion state, and final
177
+ answer. A continuation failure, incomplete generation, or missing
178
+ termination/read-back evidence blocks the orchestration round.
179
+ 5. The local gatekeeper reruns the task's real checks and decides acceptance.
180
+ Record GPT Pro's response as review evidence only; it cannot approve the
181
+ task, release a lease, or override a failed gate.
182
+
183
+ ## Required Canary Evidence
184
+
185
+ For a real Codex built-in-browser canary, retain ignored session/handoff
186
+ evidence and promote only durable conclusions into the owning workflow review
187
+ or notes. The evidence must make these values independently inspectable:
188
+
189
+ - exact secret-scanned prompt hash and attachment outcome;
190
+ - visible Pro model label and generation-complete state;
191
+ - conversation URL/handle for the plan turn and same-conversation review;
192
+ - canonical remote repository, ref, and exact SHA;
193
+ - observable GitHub Connector invocation classification and supporting
194
+ read-back evidence (`verified`, `bundle_only`, or `unverified`);
195
+ - local base commit and local-delta manifest identity;
196
+ - actual local implementation diff and command/check output;
197
+ - final local gatekeeper and acceptance outcome.
198
+
199
+ Do not create a new JSON contract just to hold these fields. Existing session
200
+ metadata, prompt receipts, ignored handoff artifacts, and tracked workflow
201
+ review/notes are the evidence surfaces for this first canary.
202
+
203
+ ## Failure Handling
204
+
205
+ Stop without inferred success when any of these occurs: setup is not explicitly
206
+ enabled, Pro model visibility is absent, login or manual verification is
207
+ needed, GitHub Connector selection is unavailable, the remote SHA is stale or
208
+ unverifiable, local content changes after scanning, a secret scan fails, an
209
+ attachment is blocked, generation is incomplete, the conversation handle is
210
+ missing, or same-session continuation fails. Preserve the dry-run/session
211
+ evidence and report the concrete stop reason.
212
+
213
+ Never ask for passwords, 2FA codes, cookies, browser storage, session tokens,
214
+ or GitHub credentials. Never retry through native/CDP or a different
215
+ conversation to manufacture a passing canary. Never turn GPT Pro's plan or
216
+ review into a task, lease, code edit, acceptance receipt, or publication
217
+ authority.
218
+
219
+ ## Existing References
220
+
221
+ - Setup and explicit enablement: [`setup.md`](setup.md)
222
+ - New consult transport: [`consult.md`](consult.md)
223
+ - Same-session follow-up and raw-evidence handling: [`continue.md`](continue.md)
224
+ - Connector invocation read-back: [`read-back.md`](read-back.md)
225
+ - Code-delivery delegation, if explicitly requested: [`delegate.md`](delegate.md)
@@ -13,6 +13,72 @@ source.
13
13
  - ChatGPT Pro Web access is not OpenAI API quota or an API key substitute;
14
14
  never create API keys or billing projects from a ChatGPT Pro subscription.
15
15
 
16
+ ## Advisory Orchestration Enablement (Explicit Opt-In)
17
+
18
+ Use this lane only after the user explicitly enables GPT Pro orchestration for
19
+ the current repository and task. Enablement is task-scoped guidance, not a new
20
+ install profile, managed fleet role, persistent schema, or grant of local
21
+ write/lease/acceptance authority. Do not start an orchestration conversation
22
+ until every prerequisite below is observable; a missing prerequisite returns
23
+ to this guide and stops closed.
24
+
25
+ 1. Project the canonical Skill from a durable checkout, if it is not already
26
+ discoverable:
27
+
28
+ ```bash
29
+ repo-harness chatgpt install-skill --target both
30
+ ```
31
+
32
+ Use `--dry-run` first when inspecting an unfamiliar host. A projection from
33
+ a contract worktree is verification-only because worktree cleanup can leave
34
+ a dangling symlink; re-project from the durable checkout before use.
35
+ 2. Check the selected ChatGPT Web browser path (including the Codex built-in
36
+ browser/IAB when that is the transport) and the visible Pro model. For
37
+ Oracle, run:
38
+
39
+ ```bash
40
+ repo-harness chatgpt browser-doctor --repo <repo> --provider oracle --json
41
+ ```
42
+
43
+ The user must resolve sign-in, captcha, SSO, or model-plan prompts in the
44
+ browser. Never request credentials or switch silently to native/CDP.
45
+ 3. If the orchestration prompt needs the repo-harness ChatGPT Connector,
46
+ configure and verify that local server separately:
47
+
48
+ ```bash
49
+ repo-harness mcp setup chatgpt --repo <repo> --server-name <name>
50
+ repo-harness mcp doctor --repo <repo> --json
51
+ ```
52
+
53
+ `chatgpt.serverNameConfigured:true` and the expected server name are
54
+ required before starting a sidecar. This local Connector is not a substitute
55
+ for the user's separately authorized GitHub Connector in ChatGPT Web.
56
+ 4. In ChatGPT Web, select the user's authorized GitHub Connector for the new
57
+ conversation. Record the canonical repository, target ref, and exact remote
58
+ commit SHA that the task is allowed to use. A model claim that it used
59
+ GitHub MCP is not invocation evidence; the orchestration protocol classifies
60
+ observable use as `verified`, exact supplied context as `bundle_only`, and
61
+ everything else as `unverified`.
62
+ 5. Snapshot the local worktree separately from the remote facts. Include the
63
+ current base commit, tracked diff, and hashed untracked-file manifest only
64
+ through the existing policy-checked bundle path; this is the local delta
65
+ identity used by the review loop. Before any real submission,
66
+ run the exact prompt through the fail-closed secret gate:
67
+
68
+ ```bash
69
+ repo-harness chatgpt browser-consult \
70
+ --repo <repo> --provider oracle --dry-run --secret-scan \
71
+ --prompt "<orchestration brief>" --file <safe-context-file>
72
+ ```
73
+
74
+ Compare the saved `prompt.md` hash with the scan receipt; do not add an
75
+ unscanned attachment or paste a changed local delta into the browser.
76
+ 6. Only after the checklist passes, read `references/orchestrate.md` and start
77
+ the plan/review loop. If the remote SHA, local-delta hash, Connector
78
+ visibility, Pro model, attachment, generation completion, or conversation
79
+ handle cannot be verified, stop without transport fallback or inferred
80
+ success.
81
+
16
82
  ## Host Skill Projection
17
83
 
18
84
  The canonical package remains under