repo-harness 0.8.0 → 0.8.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/.agents/skills/repo-harness-chatgpt-browser/SKILL.md +6 -11
- package/AGENTS.md +4 -1
- package/CLAUDE.md +4 -1
- package/README.es.md +3 -3
- package/README.fr.md +3 -3
- package/README.ja.md +3 -3
- package/README.md +82 -18
- package/README.zh-CN.md +3 -3
- package/assets/hooks/codex.hooks.template.json +3 -1
- package/assets/hooks/pre-edit-guard.sh +2 -2
- package/assets/hooks/prompt-guard.sh +6 -6
- package/assets/hooks/run-hook.sh +5 -5
- package/assets/hooks/session-start-context.sh +1 -1
- package/assets/hooks/settings.template.json +3 -1
- package/assets/hooks/stop-orchestrator.sh +46 -6
- package/assets/mcp/general-repo-reader-tools.v1.schema.json +1499 -0
- package/assets/partials/08-orchestration.partial.md +4 -2
- package/assets/partials-agents/02-operating-mode.partial.md +1 -1
- package/assets/partials-agents/03-orchestration.partial.md +1 -1
- package/assets/partials-agents/04-task-protocol.partial.md +5 -5
- package/assets/reference-configs/agentic-development-flow.md +8 -7
- package/assets/reference-configs/document-generation.md +1 -0
- package/assets/reference-configs/harness-overview.md +6 -4
- package/assets/reference-configs/hook-operations.md +2 -2
- package/assets/reference-configs/sprint-contracts.md +4 -1
- package/assets/reference-configs/workflow-orchestration.md +12 -0
- package/assets/skill-commands/manifest.json +1 -1
- package/assets/skill-commands/repo-harness-gptpro/SKILL.md +5 -4
- package/assets/skill-commands/repo-harness-gptpro-setup/SKILL.md +2 -9
- package/assets/skill-commands/repo-harness-sprint/SKILL.md +8 -7
- package/assets/skill-version.json +11 -3
- package/assets/templates/helpers/archive-workflow.sh +36 -0
- package/assets/templates/helpers/capture-plan.sh +159 -6
- package/assets/templates/helpers/check-agent-tooling.sh +24 -6
- package/assets/templates/helpers/check-task-workflow.sh +206 -0
- package/assets/templates/helpers/contract-worktree.sh +36 -1
- package/assets/templates/helpers/ensure-task-workflow.sh +16 -2
- package/assets/templates/helpers/new-plan.sh +13 -0
- package/assets/templates/helpers/plan-to-todo.sh +151 -0
- package/assets/templates/helpers/ship-worktrees.sh +36 -1
- package/assets/templates/helpers/sprint-backlog.sh +60 -40
- package/assets/templates/plan.template.md +13 -0
- package/assets/templates/sprint.template.md +3 -2
- package/docs/repo-harness-chatgpt-browser-engine.md +7 -30
- package/package.json +3 -2
- package/scripts/archive-workflow.sh +36 -0
- package/scripts/benchmark-general-repo-reader.ts +259 -0
- package/scripts/capture-plan.sh +159 -6
- package/scripts/check-agent-tooling.sh +24 -6
- package/scripts/check-task-workflow.sh +206 -0
- package/scripts/contract-worktree.sh +36 -1
- package/scripts/ensure-task-workflow.sh +16 -2
- package/scripts/lib/project-init-lib.sh +18 -3
- package/scripts/mcp-observability-report.ts +460 -0
- package/scripts/mcp-rollout-gate.ts +658 -0
- package/scripts/new-plan.sh +13 -0
- package/scripts/plan-to-todo.sh +151 -0
- package/scripts/repo-harness.sh +5 -3
- package/scripts/ship-worktrees.sh +36 -1
- package/scripts/sprint-backlog.sh +60 -40
- package/scripts/sync-codex-installed-copies.sh +2 -0
- package/src/cli/chatgpt-browser/binding.ts +0 -23
- package/src/cli/chatgpt-browser/engine.ts +14 -82
- package/src/cli/chatgpt-browser/file-policy.ts +0 -1
- package/src/cli/chatgpt-browser/native-provider.ts +3 -3
- package/src/cli/chatgpt-browser/types.ts +1 -1
- package/src/cli/commands/chatgpt.ts +4 -45
- package/src/cli/commands/global-runtime.ts +83 -3
- package/src/cli/commands/init.ts +48 -0
- package/src/cli/hook/runtime.ts +18 -4
- package/src/cli/mcp/auth.ts +10 -0
- package/src/cli/mcp/codegraph-adapter.ts +281 -0
- package/src/cli/mcp/general-repo-access.ts +3502 -0
- package/src/cli/mcp/policy.ts +25 -0
- package/src/cli/mcp/reader-tools.ts +61 -28
- package/src/cli/mcp/server.ts +19 -1
- package/src/cli/mcp/setup.ts +53 -13
- package/src/cli/mcp/tools.ts +138 -17
- package/src/cli/mcp/types.ts +24 -0
- package/src/core/adoption/gitignore-plan.ts +2 -1
- package/src/effects/repo-registry.ts +11 -3
- package/src/cli/chatgpt-browser/bind-server.ts +0 -503
- package/src/cli/chatgpt-browser/bridge-extension.ts +0 -221
- package/src/cli/chatgpt-browser/bridge-provider.ts +0 -268
|
@@ -33,7 +33,7 @@ repo-harness chatgpt browser-setup --repo . --profile-dir <user-selected-chrome-
|
|
|
33
33
|
repo-harness chatgpt browser-doctor --repo . --provider oracle --json
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
The Oracle path must fail closed rather than silently falling back to an unbound/default browser session.
|
|
36
|
+
The Oracle path must fail closed rather than silently falling back to an unbound/default browser session. Do not route through the removed Chrome extension provider or `browser-bind`.
|
|
37
37
|
9. Use browser consult for planning, review, critique, and goal generation. Do not use it as the executor for code edits.
|
|
38
38
|
10. Save useful results into repo-harness artifacts with repo-relative, timestamped `--write-output` paths such as:
|
|
39
39
|
|
|
@@ -53,7 +53,7 @@ repo-harness mcp serve --repo . --enable-chatgpt-browser
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
14. Do not rely on provider stdout `Artifact:` / `Output:` paths being imported. Browser engine session records save prompt, transcript, output, metadata, and trusted provider IDs; ordinary stdout paths are ignored.
|
|
56
|
-
15.
|
|
56
|
+
15. The native provider uses the current ChatGPT Web model selection. Do not pass `--model` or `--thinking` with `--provider native`; use Oracle when model selection is required.
|
|
57
57
|
|
|
58
58
|
## Common Commands
|
|
59
59
|
|
|
@@ -79,19 +79,14 @@ repo-harness chatgpt browser-consult \
|
|
|
79
79
|
--write-output ".ai/harness/handoff/chatgpt-review-${stamp}.md"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Native diagnostics for a non-default automation profile:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
repo-harness chatgpt browser-
|
|
86
|
-
repo-harness chatgpt browser-
|
|
87
|
-
repo-harness chatgpt browser-bind --repo . --open
|
|
88
|
-
repo-harness chatgpt browser-consult \
|
|
89
|
-
--repo . \
|
|
90
|
-
--provider bridge \
|
|
91
|
-
--prompt "Reply exactly OK"
|
|
85
|
+
repo-harness chatgpt browser-setup --repo . --profile-dir <non-default-automation-user-data-dir> --browser-channel chrome
|
|
86
|
+
repo-harness chatgpt browser-doctor --repo . --provider native --validate-session
|
|
92
87
|
```
|
|
93
88
|
|
|
94
|
-
Use
|
|
89
|
+
Use native only when the user is ready for a visible ChatGPT Web diagnostic run. If login is required, have the user complete it in the selected non-default browser profile; do not request or handle credentials.
|
|
95
90
|
|
|
96
91
|
Read the result:
|
|
97
92
|
|
package/AGENTS.md
CHANGED
|
@@ -30,11 +30,14 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
|
|
|
30
30
|
- Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
|
|
31
31
|
- Keep `CLAUDE.md` and `AGENTS.md` short; put detailed guidance in `docs/reference-configs/`.
|
|
32
32
|
- Treat Codex auto-compact as a fallback only; use `.ai/harness/handoff/current.md` and `.ai/harness/handoff/resume.md` for long-task rollover.
|
|
33
|
+
- Treat `.ai/harness/checks/*.latest.{json,md}` and `.ai/harness/runs/` as ignored runtime evidence cache; commit durable conclusions in `tasks/reviews/`, `tasks/contracts/`, `tasks/notes/`, or `docs/researches/` instead.
|
|
34
|
+
- Treat architecture/spec/research docs as the human reading entrypoint. Before closing a workflow, promote durable conclusions into `docs/architecture/`, `docs/researches/`, `docs/spec.md`, or `tasks/lessons.md`; then archive fulfilled plan/contract/review/notes/todo artifacts so root workflow surfaces represent active work only. `.rgignore` hides archived workflow artifacts and runtime evidence from default `rg` searches; use explicit paths or `rg -uu` for audits.
|
|
33
35
|
- Treat `_ref/` as an occasional ignored external reference checkout cache, not a commit surface or daily workflow. Agents may read or refresh it for comparison; when it influences a decision, cite the source repo plus commit/tag and path in `tasks/notes/` or `docs/researches/`.
|
|
34
36
|
- Treat `deploy/` as the trackable deployment and operations surface for runbooks, submission materials, release checklists, helper scripts, ordered SQL files under `deploy/sql/`, and env examples.
|
|
35
37
|
- Treat `_ops/` as ignored local operations state for secrets, real env files, provider state, artifacts, logs, and scratch files; do not commit or agent-edit `_ops/*`.
|
|
36
38
|
- Treat contract-level task execution as worktree-first: `scripts/plan-to-todo.sh --plan <approved-plan>` starts `scripts/contract-worktree.sh start --plan <approved-plan>` when policy enables it, and completed blocks finish through Waza `/check` plus `scripts/contract-worktree.sh finish`.
|
|
37
|
-
- After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete plan, capture it with `scripts/capture-plan.sh --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute
|
|
39
|
+
- After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `scripts/capture-plan.sh --artifact-level work-package --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>` or run `scripts/plan-to-todo.sh --plan <active-plan>`.
|
|
40
|
+
- Promote work into a top-level `plans/plan-*.md` only when `Artifact Level: work-package` is justified by a merge/PR unit, rollback surface, independent verification boundary, review/acceptance boundary, high-risk surface, or otherwise cannot remain a checklist item in the current active plan or sprint backlog. Inline sprint rows and checklist rows stay in the sprint backlog or active plan `## Task Breakdown`; contract rows may expand into plan -> contract -> review -> notes only through the work-package gate.
|
|
38
41
|
- If current repo state conflicts with the task, open an isolated `codex/<task-slug>` worktree, finish there, run Waza `/check`-style validation, then merge back to `main` without absorbing unrelated dirty changes.
|
|
39
42
|
- Route product discovery to gstack `office-hours`, complex engineering plans to gstack `plan-eng-review`, design plans to gstack `plan-design-review`, and daily small/medium planning, bug hunts, and checks to Waza `/think`, `/hunt`, and `/check`.
|
|
40
43
|
- Codex automation profile is runtime-referenced, not vendored: required skills are `health`, `check`, and `diagram-design` from `~/.codex/skills`.
|
package/CLAUDE.md
CHANGED
|
@@ -30,11 +30,14 @@ This repository self-hosts the `repo-harness` contract; the former `repo-harness
|
|
|
30
30
|
- Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
|
|
31
31
|
- Keep `CLAUDE.md` and `AGENTS.md` short; put detailed guidance in `docs/reference-configs/`.
|
|
32
32
|
- Treat Codex auto-compact as a fallback only; use `.ai/harness/handoff/current.md` and `.ai/harness/handoff/resume.md` for long-task rollover.
|
|
33
|
+
- Treat `.ai/harness/checks/*.latest.{json,md}` and `.ai/harness/runs/` as ignored runtime evidence cache; commit durable conclusions in `tasks/reviews/`, `tasks/contracts/`, `tasks/notes/`, or `docs/researches/` instead.
|
|
34
|
+
- Treat architecture/spec/research docs as the human reading entrypoint. Before closing a workflow, promote durable conclusions into `docs/architecture/`, `docs/researches/`, `docs/spec.md`, or `tasks/lessons.md`; then archive fulfilled plan/contract/review/notes/todo artifacts so root workflow surfaces represent active work only. `.rgignore` hides archived workflow artifacts and runtime evidence from default `rg` searches; use explicit paths or `rg -uu` for audits.
|
|
33
35
|
- Treat `_ref/` as an occasional ignored external reference checkout cache, not a commit surface or daily workflow. Agents may read or refresh it for comparison; when it influences a decision, cite the source repo plus commit/tag and path in `tasks/notes/` or `docs/researches/`.
|
|
34
36
|
- Treat `deploy/` as the trackable deployment and operations surface for runbooks, submission materials, release checklists, helper scripts, ordered SQL files under `deploy/sql/`, and env examples.
|
|
35
37
|
- Treat `_ops/` as ignored local operations state for secrets, real env files, provider state, artifacts, logs, and scratch files; do not commit or agent-edit `_ops/*`.
|
|
36
38
|
- Treat contract-level task execution as worktree-first: `scripts/plan-to-todo.sh --plan <approved-plan>` starts `scripts/contract-worktree.sh start --plan <approved-plan>` when policy enables it, and completed blocks finish through Waza `/check` plus `scripts/contract-worktree.sh finish`.
|
|
37
|
-
- After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete plan, capture it with `scripts/capture-plan.sh --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute
|
|
39
|
+
- After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `scripts/capture-plan.sh --artifact-level work-package --slug <slug> --title <title>` so `plans/` becomes the file-backed source of truth; if the user has already approved implementation, capture with `--status Approved --execute --promotion-reason <merge_boundary|rollback_boundary|verification_boundary|risk_boundary|human_decision_boundary|worktree_boundary>` or run `scripts/plan-to-todo.sh --plan <active-plan>`.
|
|
40
|
+
- Promote work into a top-level `plans/plan-*.md` only when `Artifact Level: work-package` is justified by a merge/PR unit, rollback surface, independent verification boundary, review/acceptance boundary, high-risk surface, or otherwise cannot remain a checklist item in the current active plan or sprint backlog. Inline sprint rows and checklist rows stay in the sprint backlog or active plan `## Task Breakdown`; contract rows may expand into plan -> contract -> review -> notes only through the work-package gate.
|
|
38
41
|
- If current repo state conflicts with the task, open an isolated `codex/<task-slug>` worktree, finish there, run Waza `/check`-style validation, then merge back to `main` without absorbing unrelated dirty changes.
|
|
39
42
|
- Route product discovery to gstack `office-hours`, complex engineering plans to gstack `plan-eng-review`, design plans to gstack `plan-design-review`, and daily small/medium planning, bug hunts, and checks to Waza `/think`, `/hunt`, and `/check`.
|
|
40
43
|
- Codex automation profile is runtime-referenced, not vendored: required skills are `health`, `check`, and `diagram-design` from `~/.codex/skills`.
|
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.8.
|
|
88
|
+
actual es `0.8.2`.
|
|
89
89
|
|
|
90
90
|
## Cómo funciona
|
|
91
91
|
|
|
@@ -419,8 +419,8 @@ Guards habituales:
|
|
|
419
419
|
|
|
420
420
|
## Release actual
|
|
421
421
|
|
|
422
|
-
- npm package: `repo-harness@0.8.
|
|
423
|
-
- Generated workflow stamp: `repo-harness@0.8.
|
|
422
|
+
- npm package: `repo-harness@0.8.2`
|
|
423
|
+
- Generated workflow stamp: `repo-harness@0.8.2+template@0.8.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.8.
|
|
88
|
+
ligne actuelle est `0.8.2`.
|
|
89
89
|
|
|
90
90
|
## Comment ça marche
|
|
91
91
|
|
|
@@ -424,8 +424,8 @@ Guards courants :
|
|
|
424
424
|
|
|
425
425
|
## Release actuelle
|
|
426
426
|
|
|
427
|
-
- npm package : `repo-harness@0.8.
|
|
428
|
-
- Generated workflow stamp : `repo-harness@0.8.
|
|
427
|
+
- npm package : `repo-harness@0.8.2`
|
|
428
|
+
- Generated workflow stamp : `repo-harness@0.8.2+template@0.8.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.8.
|
|
78
|
+
ラインは `0.8.2` です。
|
|
79
79
|
|
|
80
80
|
## 仕組み
|
|
81
81
|
|
|
@@ -398,8 +398,8 @@ hook がブロックしたときは、まず terminal の構造化された出
|
|
|
398
398
|
|
|
399
399
|
## 現在の Release
|
|
400
400
|
|
|
401
|
-
- npm package:`repo-harness@0.8.
|
|
402
|
-
- Generated workflow stamp:`repo-harness@0.8.
|
|
401
|
+
- npm package:`repo-harness@0.8.2`
|
|
402
|
+
- Generated workflow stamp:`repo-harness@0.8.2+template@0.8.2`
|
|
403
403
|
- GitHub repository:`Ancienttwo/repo-harness`
|
|
404
404
|
- Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
405
405
|
|
package/README.md
CHANGED
|
@@ -30,9 +30,10 @@ Repository: `https://github.com/Ancienttwo/repo-harness`
|
|
|
30
30
|
Codex, now and later — stay coordinated through the repo, not a thread.
|
|
31
31
|
`.ai/hooks/session-start-context.sh` injects the prior session's resume packet
|
|
32
32
|
(`.ai/harness/handoff/resume.md`, `tasks/current.md`) when a new session starts;
|
|
33
|
-
`
|
|
34
|
-
and after
|
|
35
|
-
step, blockers, and changed
|
|
33
|
+
`stop-orchestrator.sh` writes the stop handoff, while `post-edit-guard.sh`
|
|
34
|
+
refreshes edit-time traces and task status after changes. A session can end
|
|
35
|
+
mid-task and the next one resumes the exact next step, blockers, and changed
|
|
36
|
+
files without re-deriving them.
|
|
36
37
|
- **Token-lean by design.** Instead of grep-and-read loops that re-scan the repo every
|
|
37
38
|
session, the harness leans on a pre-built CodeGraph index for structural queries
|
|
38
39
|
(callers, callees, definitions) and on progressive context loading via
|
|
@@ -78,7 +79,7 @@ active plan, contract, review, checks, or handoff, the source artifacts win.
|
|
|
78
79
|
## What's New
|
|
79
80
|
|
|
80
81
|
Release notes live in [`docs/CHANGELOG.md`](docs/CHANGELOG.md). The current line
|
|
81
|
-
is `0.8.
|
|
82
|
+
is `0.8.2`.
|
|
82
83
|
|
|
83
84
|
## How It Works
|
|
84
85
|
|
|
@@ -348,16 +349,78 @@ before applying anything.
|
|
|
348
349
|
As an optional sidecar, `repo-harness mcp` exposes workflow artifacts to MCP
|
|
349
350
|
clients through the default `planner` profile. ChatGPT acts as a
|
|
350
351
|
planner/reviewer that reads state and moves an idea through PRD, checklist
|
|
351
|
-
Sprint, and Codex goal handoff artifacts — with no source-code write access,
|
|
352
|
+
Sprint, and Codex goal handoff artifacts — with no default source-code write access,
|
|
352
353
|
arbitrary shell execution, or default Codex runner. Codex remains the executor.
|
|
353
354
|
|
|
354
|
-
The same `planner` Connector also exposes
|
|
355
|
-
registered adopted repos. Use `discover_harness_repos` first, then
|
|
356
|
-
`
|
|
357
|
-
`
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
355
|
+
The same `planner` Connector also exposes general repo tools for
|
|
356
|
+
registered adopted repos. Use `discover_harness_repos` first, then call
|
|
357
|
+
`list_allowed_roots` to get the stable `repo_id`. General repo reads use
|
|
358
|
+
`repo_manifest`, `list_tree`, `stat_file`, `read_file`, `read_files`, and
|
|
359
|
+
`search_text`. The write surface currently exposes `write_file`, `apply_patch`,
|
|
360
|
+
`move_path`, `delete_path`, and `refresh_repo_index`, all rejected unless that
|
|
361
|
+
registered repo is explicitly configured as `read_write`.
|
|
362
|
+
`write_file` creates only with `must_not_exist: true`, replaces only with
|
|
363
|
+
`expected_sha256`, and reports `before`, `after`, `diff`, `mutation_id`, and
|
|
364
|
+
`index_state` after an atomic same-directory rename. `apply_patch` operates only
|
|
365
|
+
on existing text files, requires `expected_sha256`, and accepts either structured
|
|
366
|
+
`old_text`/`new_text` edits or guarded unified diff hunks. Patch precondition
|
|
367
|
+
misses and stale hashes return `REVISION_CONFLICT` without writing. Successful
|
|
368
|
+
file moves require a source `expected_sha256` plus `must_not_exist: true` for the
|
|
369
|
+
target. Deletes require `expected_sha256`; v1 deletes regular files only and
|
|
370
|
+
rejects directory or recursive deletes. Successful writes leave the index
|
|
371
|
+
pending and append an index invalidation event under
|
|
372
|
+
`.ai/harness/mcp/index-events.jsonl`; `refresh_repo_index` runs CodeGraph sync
|
|
373
|
+
for the repo, invalidates reader snapshots, records refresh success or
|
|
374
|
+
dead-letter failure in that same event log, and returns the new `snapshot_id`,
|
|
375
|
+
`index_revision`, `index_state`, refresh strategy, and optional mutation lag when
|
|
376
|
+
called with `mutation_id`. The CLI adapter reports `path_refresh_supported:false`
|
|
377
|
+
when it must use repo-level sync for requested paths. The MCP audit log records
|
|
378
|
+
actor/profile, repo id, operation, relative paths, hash summary, result, error
|
|
379
|
+
code, duration, and mutation/index event ids without storing file bodies or
|
|
380
|
+
patch text. The repo whitelist is the authorization boundary, `.ignore` is the
|
|
381
|
+
only content exclusion source, paths are repo-relative, and authorized file
|
|
382
|
+
content is not implicitly redacted. External non-repo local roots require
|
|
383
|
+
explicit `--allow-root` authorization.
|
|
384
|
+
|
|
385
|
+
When CodeGraph is initialized for a registered repo, the general reader merges
|
|
386
|
+
CodeGraph indexed-file metadata into manifest/stat/read/search responses while
|
|
387
|
+
keeping the filesystem walker as the complete manifest source of truth. Responses
|
|
388
|
+
carry `snapshot_id`, `index_revision`, `ignore_digest`, and `indexed` metadata;
|
|
389
|
+
stale client snapshots return `SNAPSHOT_STALE` instead of silently mixing
|
|
390
|
+
versions. Responses also expose `snapshot_state`, snapshot TTL/expiry, and a
|
|
391
|
+
bounded in-process snapshot cache marker. The public `snapshot_cache.key` is
|
|
392
|
+
scoped by tool and repo-relative path set, while `snapshot_cache.snapshot_key`
|
|
393
|
+
identifies the underlying repo snapshot. Entry metadata is cached separately by
|
|
394
|
+
repo, registry revision, `.ignore` digest, relative path, and current stat
|
|
395
|
+
signature, so unchanged warm manifest/stat/read calls avoid repeated file hash
|
|
396
|
+
and binary probes without hiding file, registry, or `.ignore` changes. Explicit
|
|
397
|
+
`snapshot_id` stat/read calls can reuse the cached snapshot and validate the
|
|
398
|
+
requested file hash instead of rebuilding the full repo snapshot. If CodeGraph
|
|
399
|
+
reports a now-missing indexed path or metadata that no longer matches the
|
|
400
|
+
filesystem, the snapshot becomes `index_lagging` while authorized read/stat
|
|
401
|
+
fallback stays available. Full-text search still falls back to the guarded
|
|
402
|
+
filesystem path when CodeGraph cannot provide complete repo-text search.
|
|
403
|
+
For large manifests, `repo_manifest` streams the visible tree and keeps only the
|
|
404
|
+
requested page of entries in memory. Returned page entries include exact content
|
|
405
|
+
hashes; non-page file content metadata is deferred and reported as
|
|
406
|
+
`counts.content_deferred` until a later manifest page, `stat_file`, `read_file`,
|
|
407
|
+
or `search_text` actually returns that content.
|
|
408
|
+
|
|
409
|
+
For large-repo reader baselines, run:
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
bun run benchmark:mcp-reader -- --entries 10000 --json
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
Use `--entries all` for the full 10k/100k/500k fixture sequence when the local
|
|
416
|
+
machine can spend the filesystem time.
|
|
417
|
+
|
|
418
|
+
For the full tool reference, JSON examples, repo administrator guidance,
|
|
419
|
+
privacy notes, migration guide, rollout flags, and known limits, see
|
|
420
|
+
[`docs/reference-configs/general-repo-mcp.md`](docs/reference-configs/general-repo-mcp.md).
|
|
421
|
+
For index stale, CodeGraph down, manifest incomplete, mutation conflict,
|
|
422
|
+
reindex dead-letter, and rollback operations, see
|
|
423
|
+
[`deploy/runbooks/general-repo-mcp-codegraph.md`](deploy/runbooks/general-repo-mcp-codegraph.md).
|
|
361
424
|
|
|
362
425
|
This sidecar assumes the CLI is already installed from
|
|
363
426
|
[First 5 Minutes](#first-5-minutes). Use it when you want ChatGPT to plan
|
|
@@ -454,10 +517,10 @@ implementation under `assets/hooks/` or a repo-pinned `.ai/hooks/` copy.
|
|
|
454
517
|
|
|
455
518
|
| Route | Matcher | Scripts | Function |
|
|
456
519
|
| --- | --- | --- | --- |
|
|
457
|
-
| `SessionStart.default` | all sessions | `session-start-context.sh`, `security-sentinel.sh` | Injects prior handoff, sprint status, and read-only config-security findings before work starts. |
|
|
520
|
+
| `SessionStart.default` | all sessions | `session-start-context.sh`, `minimal-change-context.sh`, `security-sentinel.sh` | Injects prior handoff, sprint status, minimal-change guidance, and read-only config-security findings before work starts. |
|
|
458
521
|
| `PreToolUse.edit` | `Edit|Write` | `worktree-guard.sh`, `pre-edit-guard.sh` | Enforces worktree policy and plan/contract readiness before implementation edits. |
|
|
459
522
|
| `PreToolUse.subagent` | `Task|Agent|SendUserMessage` | `subagent-return-channel-guard.sh` | Keeps delegated work returning through the parent session instead of leaking completion claims. |
|
|
460
|
-
| `PostToolUse.edit` | `Edit|Write` | `post-edit-guard.sh` | Records edit traces, refreshes handoff/task status,
|
|
523
|
+
| `PostToolUse.edit` | `Edit|Write` | `post-edit-guard.sh`, `minimal-change-observer.sh` | Records edit traces, refreshes handoff/task status, queues architecture drift, and writes bounded minimal-change evidence when controlled files change. |
|
|
461
524
|
| `PostToolUse.bash` | `Bash` | `post-bash.sh` | Observes command results and captures verification evidence without replacing the command runner. |
|
|
462
525
|
| `PostToolUse.always` | all tools | `post-tool-observer.sh` | Provides low-noise always-on trace and runtime observation; stale pinned copies soft-skip with a refresh hint. |
|
|
463
526
|
| `UserPromptSubmit.default` | all prompts | `prompt-guard.sh` | Classifies prompt intent, routes planning/check/hunt hints, and renders host-safe workflow guidance. |
|
|
@@ -468,7 +531,7 @@ Codex-only routes are `UserPromptSubmit.delegation`,
|
|
|
468
531
|
`PreToolUse.subagent` return-channel route and does not install those Codex
|
|
469
532
|
delegation lifecycle entries.
|
|
470
533
|
|
|
471
|
-
`SessionStart` resolves hooks central-first, then runs
|
|
534
|
+
`SessionStart` resolves hooks central-first, then runs three ordered scripts before
|
|
472
535
|
work begins:
|
|
473
536
|
|
|
474
537
|
```mermaid
|
|
@@ -480,7 +543,8 @@ flowchart LR
|
|
|
480
543
|
Source -->|repo policy pin| Repo["repo .ai/hooks<br/>self-host development"]
|
|
481
544
|
Central --> Ctx["session-start-context.sh<br/>resume + sprint + handoff context"]
|
|
482
545
|
Repo --> Ctx
|
|
483
|
-
Ctx -->
|
|
546
|
+
Ctx --> Min["minimal-change-context.sh<br/>advice-only scope pressure"]
|
|
547
|
+
Min --> Sec["security-sentinel.sh<br/>read-only config scan, fingerprint-gated"]
|
|
484
548
|
Sec --> SSOut["SessionStart additionalContext<br/>prior-session state + SecurityConfig findings"]
|
|
485
549
|
```
|
|
486
550
|
|
|
@@ -535,8 +599,8 @@ Most common guards:
|
|
|
535
599
|
|
|
536
600
|
## Current Release
|
|
537
601
|
|
|
538
|
-
- npm package: `repo-harness@0.8.
|
|
539
|
-
- Generated workflow stamp: `repo-harness@0.8.
|
|
602
|
+
- npm package: `repo-harness@0.8.2`
|
|
603
|
+
- Generated workflow stamp: `repo-harness@0.8.2+template@0.8.2`
|
|
540
604
|
- GitHub repository: `Ancienttwo/repo-harness`
|
|
541
605
|
- Release history: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
542
606
|
|
package/README.zh-CN.md
CHANGED
|
@@ -69,7 +69,7 @@ review、checks 或 handoff 冲突,以 source artifacts 为准。
|
|
|
69
69
|
|
|
70
70
|
## What's New
|
|
71
71
|
|
|
72
|
-
Release notes 见 [`docs/CHANGELOG.md`](docs/CHANGELOG.md),当前版本线是 `0.8.
|
|
72
|
+
Release notes 见 [`docs/CHANGELOG.md`](docs/CHANGELOG.md),当前版本线是 `0.8.2`。
|
|
73
73
|
|
|
74
74
|
## 工作原理
|
|
75
75
|
|
|
@@ -445,8 +445,8 @@ hook block 工作时,先看 terminal 里的结构化输出。核心字段是
|
|
|
445
445
|
|
|
446
446
|
## 当前 Release
|
|
447
447
|
|
|
448
|
-
- npm package:`repo-harness@0.8.
|
|
449
|
-
- Generated workflow stamp:`repo-harness@0.8.
|
|
448
|
+
- npm package:`repo-harness@0.8.2`
|
|
449
|
+
- Generated workflow stamp:`repo-harness@0.8.2+template@0.8.2`
|
|
450
450
|
- GitHub repository:`Ancienttwo/repo-harness`
|
|
451
451
|
- Release history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
452
452
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"hooks": [
|
|
6
6
|
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_HOST=codex HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" session-start-context.sh", "timeout": 30 },
|
|
7
|
+
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_HOST=codex HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" minimal-change-context.sh", "timeout": 30 },
|
|
7
8
|
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_HOST=codex HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" security-sentinel.sh", "timeout": 30 }
|
|
8
9
|
]
|
|
9
10
|
}
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
{
|
|
28
29
|
"matcher": "Edit|Write",
|
|
29
30
|
"hooks": [
|
|
30
|
-
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_HOST=codex HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" post-edit-guard.sh", "timeout": 30 }
|
|
31
|
+
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_HOST=codex HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" post-edit-guard.sh", "timeout": 30 },
|
|
32
|
+
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_HOST=codex HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" minimal-change-observer.sh", "timeout": 30 }
|
|
31
33
|
]
|
|
32
34
|
},
|
|
33
35
|
{
|
|
@@ -115,12 +115,12 @@ run_edit_plan_gate() {
|
|
|
115
115
|
if [[ -z "$gate_plan" || ! -f "$gate_plan" ]]; then
|
|
116
116
|
echo "[PlanStatusGuard] No active plan covers implementation edit: $FILE_PATH"
|
|
117
117
|
if [[ "$mode" == "advice" ]]; then
|
|
118
|
-
echo "[PlanStatusGuard] Advisory: capture the approved plan with bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute"
|
|
118
|
+
echo "[PlanStatusGuard] Advisory: capture the approved plan with bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --execute"
|
|
119
119
|
else
|
|
120
120
|
hook_structured_error \
|
|
121
121
|
"PlanStatusGuard" \
|
|
122
122
|
"Implementation edit to $FILE_PATH without an active plan." \
|
|
123
|
-
"Capture the approved planning output with bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute, or set policy .guards.edit_plan_gate to advice/off for this repo." \
|
|
123
|
+
"Capture the approved planning output with bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --execute, or set policy .guards.edit_plan_gate to advice/off for this repo." \
|
|
124
124
|
"missing_artifact"
|
|
125
125
|
exit 2
|
|
126
126
|
fi
|
|
@@ -530,8 +530,8 @@ emit_pending_orchestration_capture_gate() {
|
|
|
530
530
|
[[ -n "$source_ref" ]] && source_arg=" --source-ref <source-ref>"
|
|
531
531
|
echo "[PlanCaptureGate] Implementation requested while a pending plan/orchestration discussion has not been captured."
|
|
532
532
|
echo "[PlanCaptureGate] $(workflow_pending_orchestration_summary)"
|
|
533
|
-
echo "[PlanCaptureGate] Capture the final plan body first; if implementation is already approved, use --status Approved --execute:"
|
|
534
|
-
echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --source ${kind:-host-plan} --orchestration-kind ${kind:-host-plan} --route planning --execute${source_arg}"
|
|
533
|
+
echo "[PlanCaptureGate] Capture the final plan body first; if implementation is already approved, use --status Approved --execute with a work-package promotion reason:"
|
|
534
|
+
echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source ${kind:-host-plan} --orchestration-kind ${kind:-host-plan} --route planning --execute${source_arg}"
|
|
535
535
|
return 0
|
|
536
536
|
}
|
|
537
537
|
|
|
@@ -662,7 +662,7 @@ maybe_capture_embedded_approved_plan() {
|
|
|
662
662
|
fi
|
|
663
663
|
|
|
664
664
|
echo "[PlanCaptureGate] Embedded approved plan detected. Capturing and projecting before implementation."
|
|
665
|
-
if ! capture_output="$(printf '%s\n' "$body" | bash "scripts/capture-plan.sh" --slug "$slug" --title "$title" --status Approved --source user-approved-plan --route planning --execute 2>&1)"; then
|
|
665
|
+
if ! capture_output="$(printf '%s\n' "$body" | bash "scripts/capture-plan.sh" --slug "$slug" --title "$title" --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source user-approved-plan --route planning --execute 2>&1)"; then
|
|
666
666
|
printf '%s\n' "$capture_output"
|
|
667
667
|
hook_structured_error \
|
|
668
668
|
"PlanCaptureGate" \
|
|
@@ -906,18 +906,18 @@ render_prompt_guard_action() {
|
|
|
906
906
|
echo "[PlanCaptureGate] Approval detected before an active plan artifact exists."
|
|
907
907
|
echo "[PlanCaptureGate] Let the agent run the approved-plan capture path now:"
|
|
908
908
|
echo " git status --short --branch -uall"
|
|
909
|
-
echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --source waza-think --route planning --execute"
|
|
909
|
+
echo " printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source waza-think --route planning --execute"
|
|
910
910
|
exit 0
|
|
911
911
|
;;
|
|
912
912
|
plan_status_no_active_block)
|
|
913
913
|
echo "[PlanStatusGuard] Advisory: No active plan found in plans/. Implementation edits will be blocked at the edit layer until a plan is captured."
|
|
914
|
-
echo "[PlanStatusGuard] Capture the approved planning output with: bash scripts/capture-plan.sh --slug <slug> --title <title> --status Approved --execute"
|
|
914
|
+
echo "[PlanStatusGuard] Capture the approved planning output with: bash scripts/capture-plan.sh --slug <slug> --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --execute"
|
|
915
915
|
echo "[PlanStatusGuard] If there is no captured planning output yet, run: bash scripts/ensure-task-workflow.sh --slug <slug> --title <title>"
|
|
916
916
|
exit 0
|
|
917
917
|
;;
|
|
918
918
|
plan_capture_draft_advice)
|
|
919
919
|
echo "[PlanCaptureGate] Approval detected for $plan_status plan: $active_plan"
|
|
920
|
-
echo "[PlanCaptureGate] Recapture the exact approved plan body with --status Approved --execute, or mark this plan Approved and run:"
|
|
920
|
+
echo "[PlanCaptureGate] Recapture the exact approved plan body with --artifact-level work-package --promotion-reason <reason> --status Approved --execute, or mark this plan Approved and run:"
|
|
921
921
|
echo " bash scripts/plan-to-todo.sh --plan $active_plan"
|
|
922
922
|
exit 0
|
|
923
923
|
;;
|
package/assets/hooks/run-hook.sh
CHANGED
|
@@ -89,17 +89,17 @@ hook_stdout_is_json_kind() {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
# Codex swallows hook stdout differently from Claude: success stdout is
|
|
92
|
-
# dropped for ordinary hooks. Only context
|
|
93
|
-
# surfaced on success.
|
|
92
|
+
# dropped for ordinary hooks. Only context JSON and SubagentStop decision JSON
|
|
93
|
+
# for approved routes is surfaced on success. Stop decision JSON is deliberately
|
|
94
|
+
# suppressed because current Codex Desktop rejects it as an unsupported content
|
|
95
|
+
# type at turn finalization.
|
|
94
96
|
if [[ "${HOOK_HOST:-}" == "codex" && "$HOOK_NAME" != "session-start-context.sh" ]]; then
|
|
95
97
|
if ! tmp_stdout="$(mktemp)" || ! tmp_stderr="$(mktemp)"; then
|
|
96
98
|
# No temp space: run unfiltered rather than silently dropping the hook.
|
|
97
99
|
exec bash "$HOOK_PATH" "$@"
|
|
98
100
|
fi
|
|
99
101
|
if bash "$HOOK_PATH" "$@" >"$tmp_stdout" 2>"$tmp_stderr"; then
|
|
100
|
-
if [[ "$HOOK_NAME" == "stop-
|
|
101
|
-
cat "$tmp_stdout"
|
|
102
|
-
elif [[ "$HOOK_NAME" == "subagent-stop-quality.sh" ]] && hook_stdout_is_json_kind "$tmp_stdout" decision; then
|
|
102
|
+
if [[ "$HOOK_NAME" == "subagent-stop-quality.sh" ]] && hook_stdout_is_json_kind "$tmp_stdout" decision; then
|
|
103
103
|
cat "$tmp_stdout"
|
|
104
104
|
elif [[ "$HOOK_NAME" == "codex-delegation-advisor.sh" ]] && hook_stdout_is_json_kind "$tmp_stdout" user_prompt_context; then
|
|
105
105
|
cat "$tmp_stdout"
|
|
@@ -378,7 +378,7 @@ printf '%s\n' '<decision-complete plan body>' | bash ${capture_script} --slug ${
|
|
|
378
378
|
If the user has already approved implementation:
|
|
379
379
|
|
|
380
380
|
\`\`\`bash
|
|
381
|
-
printf '%s\n' '<approved plan body>' | bash ${capture_script} --slug ${prompt_slug:-<slug>} --title <title> --status Approved --source ${capture_source} --orchestration-kind ${capture_source} --route planning --execute${source_arg}
|
|
381
|
+
printf '%s\n' '<approved plan body>' | bash ${capture_script} --slug ${prompt_slug:-<slug>} --title <title> --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source ${capture_source} --orchestration-kind ${capture_source} --route planning --execute${source_arg}
|
|
382
382
|
\`\`\`
|
|
383
383
|
EOF_CONTEXT
|
|
384
384
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"hooks": [
|
|
6
6
|
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" session-start-context.sh", "timeout": 30 },
|
|
7
|
+
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" minimal-change-context.sh", "timeout": 30 },
|
|
7
8
|
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" security-sentinel.sh", "timeout": 30 }
|
|
8
9
|
]
|
|
9
10
|
}
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
{
|
|
28
29
|
"matcher": "Edit|Write",
|
|
29
30
|
"hooks": [
|
|
30
|
-
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" post-edit-guard.sh", "timeout": 30 }
|
|
31
|
+
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" post-edit-guard.sh", "timeout": 30 },
|
|
32
|
+
{ "type": "command", "command": "repo=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0; HOOK_REPO_ROOT=\"$repo\" bash \"$repo/.ai/hooks/run-hook.sh\" minimal-change-observer.sh", "timeout": 30 }
|
|
31
33
|
]
|
|
32
34
|
},
|
|
33
35
|
{
|
|
@@ -94,8 +94,46 @@ plan_completeness_shell_quote() {
|
|
|
94
94
|
printf '%q' "$1"
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
plan_completeness_runtime_summary() {
|
|
98
|
+
local kind host prompt_slug draft_path source_ref expected_artifact cwd
|
|
99
|
+
|
|
100
|
+
kind="$(workflow_pending_orchestration_field kind 2>/dev/null || true)"
|
|
101
|
+
host="$(workflow_pending_orchestration_field host 2>/dev/null || true)"
|
|
102
|
+
prompt_slug="$(workflow_pending_orchestration_field prompt_slug 2>/dev/null || true)"
|
|
103
|
+
draft_path="$(workflow_pending_orchestration_field draft_plan_path 2>/dev/null || true)"
|
|
104
|
+
source_ref="$(workflow_pending_orchestration_field source_ref 2>/dev/null || true)"
|
|
105
|
+
expected_artifact="$(workflow_pending_orchestration_field expected_artifact 2>/dev/null || true)"
|
|
106
|
+
cwd="$(workflow_pending_orchestration_field cwd 2>/dev/null || true)"
|
|
107
|
+
|
|
108
|
+
printf 'kind=%s host=%s expected=%s slug=%s' "${kind:-unknown}" "${host:-unknown}" "${expected_artifact:-plan}" "${prompt_slug:-planning}"
|
|
109
|
+
[[ -n "$draft_path" ]] && printf ' draft=%s' "$draft_path"
|
|
110
|
+
[[ -n "$source_ref" ]] && printf ' source_ref=<source-ref>'
|
|
111
|
+
[[ -n "$cwd" ]] && printf ' cwd=%s' "$cwd"
|
|
112
|
+
printf '\n'
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
plan_completeness_guidance_title_arg() {
|
|
116
|
+
case "$1" in
|
|
117
|
+
waza-think)
|
|
118
|
+
printf '"Waza think planning output"'
|
|
119
|
+
;;
|
|
120
|
+
dynamic-workflow)
|
|
121
|
+
printf '"Dynamic workflow planning output"'
|
|
122
|
+
;;
|
|
123
|
+
codex-plan)
|
|
124
|
+
printf '"Codex planning output"'
|
|
125
|
+
;;
|
|
126
|
+
repo-harness-plan)
|
|
127
|
+
printf '"repo-harness planning output"'
|
|
128
|
+
;;
|
|
129
|
+
*)
|
|
130
|
+
printf '"Planning output"'
|
|
131
|
+
;;
|
|
132
|
+
esac
|
|
133
|
+
}
|
|
134
|
+
|
|
97
135
|
plan_completeness_capture_guidance() {
|
|
98
|
-
local kind prompt_slug source_ref
|
|
136
|
+
local kind prompt_slug source_ref title_arg source_arg
|
|
99
137
|
|
|
100
138
|
kind="$(workflow_pending_orchestration_field kind 2>/dev/null || true)"
|
|
101
139
|
prompt_slug="$(workflow_pending_orchestration_field prompt_slug 2>/dev/null || true)"
|
|
@@ -103,18 +141,20 @@ plan_completeness_capture_guidance() {
|
|
|
103
141
|
|
|
104
142
|
kind="${kind:-host-plan}"
|
|
105
143
|
prompt_slug="${prompt_slug:-planning}"
|
|
106
|
-
|
|
144
|
+
title_arg="$(plan_completeness_guidance_title_arg "$kind")"
|
|
107
145
|
source_arg=""
|
|
108
146
|
if [[ -n "$source_ref" ]]; then
|
|
109
|
-
source_arg=
|
|
147
|
+
source_arg=' --source-ref "<source-ref>"'
|
|
110
148
|
fi
|
|
111
149
|
|
|
112
150
|
cat <<EOF_GUIDANCE
|
|
113
151
|
If the planning answer is decision-complete, capture the final plan body before stopping:
|
|
114
|
-
printf '%s\n' '<decision-complete plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title $
|
|
152
|
+
printf '%s\n' '<decision-complete plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title ${title_arg} --status Draft --source $(plan_completeness_shell_quote "$kind") --orchestration-kind $(plan_completeness_shell_quote "$kind") --route planning${source_arg}
|
|
115
153
|
|
|
116
154
|
If the user already approved implementation, use:
|
|
117
|
-
printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title $
|
|
155
|
+
printf '%s\n' '<approved plan body>' | bash scripts/capture-plan.sh --slug $(plan_completeness_shell_quote "$prompt_slug") --title ${title_arg} --artifact-level work-package --promotion-reason human_decision_boundary --status Approved --source $(plan_completeness_shell_quote "$kind") --orchestration-kind $(plan_completeness_shell_quote "$kind") --route planning --execute${source_arg}
|
|
156
|
+
|
|
157
|
+
Use a short English title/source-ref alias in these runtime instructions; do not paste non-ASCII prompt text into command arguments.
|
|
118
158
|
|
|
119
159
|
If the plan is not decision-complete, revise once for: goal/success criteria, scope/non-scope, constraints, P1/P2/P3, fragile assumption, rejected alternative, public API/config/file-interface changes, external dependency/API key requirements, tests, rollback/failure handling, phase independence, and no placeholders. Do not implement until capture succeeds.
|
|
120
160
|
EOF_GUIDANCE
|
|
@@ -400,7 +440,7 @@ if should_run_plan_completeness_gate "$stop_hook_active" "$last_assistant_messag
|
|
|
400
440
|
signature="$(plan_completeness_signature)"
|
|
401
441
|
if [[ "$(plan_completeness_last_signature 2>/dev/null || true)" != "$signature" ]]; then
|
|
402
442
|
plan_completeness_record_signature "$signature"
|
|
403
|
-
summary="$(
|
|
443
|
+
summary="$(plan_completeness_runtime_summary)"
|
|
404
444
|
guidance="$(plan_completeness_capture_guidance)"
|
|
405
445
|
emit_stop_block_json "[PlanCompletenessGate] A first planning answer was produced while pending orchestration is still open: ${summary}
|
|
406
446
|
|