repo-harness 0.22.1 → 0.23.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.
- package/AGENTS.md +20 -7
- package/CLAUDE.md +20 -7
- package/README.es.md +32 -45
- package/README.fr.md +32 -44
- package/README.ja.md +30 -43
- package/README.md +34 -93
- package/README.zh-CN.md +28 -61
- package/SKILL.md +5 -3
- package/agents/fleet/harness-evaluator.md +1 -1
- package/assets/partials/05-workflow.partial.md +1 -1
- package/assets/reference-configs/agentic-development-flow.md +45 -3
- package/assets/reference-configs/development-protocol.md +2 -4
- package/assets/reference-configs/external-tooling.md +131 -81
- package/assets/reference-configs/global-working-rules.md +4 -4
- package/assets/reference-configs/harness-overview.md +53 -25
- package/assets/reference-configs/herdr-notify.md +29 -1
- package/assets/reference-configs/hook-operations.md +177 -115
- package/assets/reference-configs/host-invariants.md +9 -12
- package/assets/reference-configs/minimal-change-hooks.md +25 -111
- package/assets/reference-configs/release-deploy.md +7 -4
- package/assets/skill-commands/AGENTS.md +0 -7
- package/assets/skill-commands/CLAUDE.md +0 -7
- package/assets/skill-commands/manifest.json +11 -13
- package/assets/skill-commands/repo-harness-architecture/SKILL.md +1 -0
- package/assets/skill-commands/repo-harness-architecture/agents/openai.yaml +2 -0
- package/assets/skill-commands/repo-harness-architecture/references/worker.md +98 -24
- package/assets/skill-commands/repo-harness-check/SKILL.md +2 -0
- package/assets/skill-commands/repo-harness-check/references/architecture-evidence.md +46 -15
- package/assets/skill-commands/repo-harness-check/references/deploy-readiness.md +0 -2
- package/assets/skill-commands/repo-harness-check/references/pr-verification.md +96 -0
- package/assets/skill-commands/repo-harness-check/references/review.md +0 -2
- package/assets/skill-commands/repo-harness-ship/SKILL.md +6 -0
- package/assets/skill-commands/repo-harness-ship/references/worker.md +3 -1
- package/assets/skill-version.json +2 -2
- package/assets/skills/repo-harness-chatgpt/SKILL.md +1 -1
- package/assets/skills/repo-harness-chatgpt/references/bridge.md +0 -8
- package/assets/skills/repo-harness-cross-review/SKILL.md +1 -2
- package/assets/skills/repo-harness-cross-review/references/generic-review.md +3 -43
- package/assets/skills/repo-harness-product/references/goal.md +0 -2
- package/assets/skills/repo-harness-product/references/prd.md +0 -2
- package/assets/skills/repo-harness-product/references/sprint.md +0 -2
- package/assets/skills/repo-harness-setup/references/capability.md +7 -2
- package/assets/skills/repo-harness-setup/references/init.md +0 -2
- package/assets/skills/repo-harness-setup/references/migrate.md +0 -5
- package/assets/skills/repo-harness-setup/references/repair.md +0 -2
- package/assets/skills/repo-harness-setup/references/scaffold.md +0 -2
- package/assets/skills/repo-harness-setup/references/upgrade.md +0 -2
- package/assets/skills/repo-harness-test/references/authoring.md +11 -3
- package/assets/skills/repo-harness-test/references/running.md +74 -25
- package/assets/skills/repo-harness-test/references/verification-plan.md +15 -13
- package/assets/templates/helpers/archive-workflow.sh +10 -16
- package/assets/templates/helpers/capability-resolver.ts +166 -58
- package/assets/templates/helpers/check-agent-tooling.sh +77 -16
- package/assets/templates/helpers/codex-handoff-resume.sh +4 -5
- package/assets/templates/helpers/contract-worktree-runtime.ts +18 -0
- package/assets/templates/helpers/contract-worktree.sh +38 -103
- package/assets/templates/helpers/evidence-gc.ts +103 -18
- package/assets/templates/helpers/install-agent-fleet.sh +2 -2
- package/assets/templates/helpers/prepare-codex-handoff.sh +3 -3
- package/assets/templates/helpers/prepare-handoff.sh +14 -21
- package/assets/templates/helpers/recovery-view-cli.ts +46 -783
- package/assets/templates/helpers/runtime-evidence-receipt.ts +6 -23
- package/assets/templates/helpers/select-agent-context-blocks.sh +72 -4
- package/assets/templates/helpers/ship-worktrees.sh +11 -209
- package/assets/templates/helpers/sprint-backlog.sh +11 -2
- package/assets/templates/helpers/summarize-failures.sh +16 -48
- package/assets/templates/helpers/workstream-sync.sh +5 -2
- package/assets/templates/helpers/worktree-merge-lib.sh +9 -9
- package/assets/templates/runtime.gitignore +4 -7
- package/assets/tool-catalog.v1.json +89 -0
- package/assets/workflow-contract.v1.json +13 -10
- package/dist/hook-entry.js +10319 -17414
- package/dist/oar-coding-host.js +193 -11
- package/dist/oar-review-host.js +197 -8
- package/dist/operator-ui/assets/ArchitectureWorkspace-CR9FiYz3.js +1 -0
- package/dist/operator-ui/assets/index-DY7Cw9qc.css +2 -0
- package/dist/operator-ui/assets/index-jrycyCyb.js +18 -0
- package/dist/operator-ui/index.html +2 -2
- package/package.json +6 -27
- package/references/bot-control.md +21 -25
- package/references/pm-operations.md +21 -1
- package/scripts/archive-workflow.sh +10 -16
- package/scripts/axr5-archctx-clean-room.ts +7 -3
- package/scripts/capability-resolver.ts +52 -14
- package/scripts/check-agent-tooling.sh +77 -16
- package/scripts/check-ci.sh +136 -39
- package/scripts/check-context-map.ts +15 -29
- package/scripts/check-npm-release.sh +6 -6
- package/scripts/check-release-published.sh +1 -2
- package/scripts/check-tarball-install-smoke.sh +7 -18
- package/scripts/ci-documentation-consumers.ts +31 -78
- package/scripts/ci-edge-audit.ts +102 -0
- package/scripts/ci-path-consumers.ts +111 -0
- package/scripts/codex-handoff-resume.sh +4 -5
- package/scripts/contract-worktree-runtime.ts +18 -0
- package/scripts/contract-worktree.sh +38 -103
- package/scripts/create-project-dirs.sh +2 -13
- package/scripts/evidence-gc.ts +103 -18
- package/scripts/init-project.sh +2 -13
- package/scripts/install-agent-fleet.sh +2 -2
- package/scripts/lib/ci-run-tests.sh +10 -0
- package/scripts/lib/path-values.ts +100 -0
- package/scripts/lib/project-init-lib.sh +29 -45
- package/scripts/prepare-codex-handoff.sh +3 -3
- package/scripts/prepare-handoff.sh +14 -21
- package/scripts/recovery-view-cli.ts +46 -758
- package/scripts/replay-ci-coverage.ts +120 -23
- package/scripts/report-ci.ts +97 -9
- package/scripts/run-harness-profile-benchmark.ts +62 -40
- package/scripts/runtime-evidence-receipt.ts +6 -23
- package/scripts/select-agent-context-blocks.sh +72 -4
- package/scripts/select-ci-coverage.ts +153 -34
- package/scripts/select-test-suite.ts +15 -0
- package/scripts/ship-worktrees.sh +11 -209
- package/scripts/sprint-backlog.sh +11 -2
- package/scripts/summarize-failures.sh +16 -48
- package/scripts/sync-helper-sources.ts +12 -27
- package/scripts/sync-reference-configs.ts +44 -4
- package/scripts/test-file-durations.json +0 -47
- package/scripts/workstream-sync.sh +5 -2
- package/scripts/worktree-merge-lib.sh +9 -9
- package/src/cli/chatgpt-browser/file-policy.ts +3 -6
- package/src/cli/commands/architecture-debt.ts +143 -0
- package/src/cli/commands/architecture-projection.ts +15 -12
- package/src/cli/commands/capability-context.ts +60 -28
- package/src/cli/commands/delegation.ts +1 -14
- package/src/cli/commands/docs.ts +0 -2
- package/src/cli/commands/doctor.ts +56 -27
- package/src/cli/commands/global-runtime.ts +62 -12
- package/src/cli/commands/init-hook.ts +23 -4
- package/src/cli/commands/init.ts +4 -3
- package/src/cli/commands/install.ts +18 -28
- package/src/cli/commands/mcp.ts +0 -20
- package/src/cli/commands/module.ts +22 -6
- package/src/cli/commands/refactor.ts +46 -19
- package/src/cli/commands/retention.ts +53 -0
- package/src/cli/commands/review.ts +1 -1
- package/src/cli/commands/security.ts +1 -1
- package/src/cli/commands/state.ts +0 -13
- package/src/cli/commands/status.ts +4 -3
- package/src/cli/commands/validators.ts +1 -1
- package/src/cli/hook/AGENTS.md +33 -0
- package/src/cli/hook/CLAUDE.md +33 -0
- package/src/cli/hook/board-slice-context.ts +11 -14
- package/src/cli/hook/circuit-breaker.ts +14 -36
- package/src/cli/hook/event-telemetry.ts +51 -387
- package/src/cli/hook/handler-contract.ts +24 -121
- package/src/cli/hook/handler-registry.ts +58 -156
- package/src/cli/hook/hook-input.ts +50 -206
- package/src/cli/hook/hook-protocol.ts +57 -0
- package/src/cli/hook/mutation-guard.ts +116 -820
- package/src/cli/hook/return-channel.ts +56 -0
- package/src/cli/hook/route-registry.ts +15 -67
- package/src/cli/hook/runtime.ts +125 -453
- package/src/cli/hook/session-context-budget.ts +28 -437
- package/src/cli/hook/session-context.ts +117 -1486
- package/src/cli/hook/stop-handler.ts +79 -421
- package/src/cli/hook/subagent-context.ts +485 -0
- package/src/cli/hook/task-inbox-handler.ts +23 -64
- package/src/cli/hook-entry.ts +21 -103
- package/src/cli/index.ts +23 -44
- package/src/cli/installer/configuration-ownership.ts +5 -1
- package/src/cli/installer/install-profile.ts +8 -7
- package/src/cli/installer/managed-entries.ts +8 -13
- package/src/cli/installer/targets/claude.ts +16 -28
- package/src/cli/installer/targets/codex.ts +16 -36
- package/src/cli/installer/types.ts +2 -7
- package/src/cli/installer/uninstall.ts +2 -2
- package/src/cli/mcp/auth.ts +0 -6
- package/src/cli/mcp/instructions.ts +0 -1
- package/src/cli/mcp/policy.ts +6 -22
- package/src/cli/mcp/server.ts +4 -42
- package/src/cli/mcp/setup.ts +2 -58
- package/src/cli/mcp/tools.ts +4 -148
- package/src/cli/mcp/transports/http.ts +11 -3
- package/src/cli/mcp/types.ts +0 -6
- package/src/core/adoption/managed-hook-config.ts +21 -16
- package/src/core/adoption/minimum-harness-version.ts +90 -0
- package/src/core/adoption/standard-plan.ts +22 -2
- package/src/core/adoption/workflow-contract-asset.ts +8 -2
- package/src/core/architecture/module-view.ts +52 -12
- package/src/core/architecture/projection.ts +55 -5
- package/src/core/capabilities/ownership-blocker.ts +69 -0
- package/src/core/capabilities/registry.ts +116 -43
- package/src/core/dev-activity/decode.ts +8 -37
- package/src/core/dev-activity/projection.ts +5 -131
- package/src/core/dev-activity/types.ts +9 -34
- package/src/core/engineers/delegation.ts +3 -9
- package/src/core/engineers/scheduling.ts +48 -5
- package/src/core/evidence/payload-cap.ts +2 -4
- package/src/core/operator/architecture.ts +10 -6
- package/src/core/operator/planning-snapshot.ts +2 -2
- package/src/core/operator/repository-snapshot.ts +14 -0
- package/src/core/refactor/provider-contract.ts +6 -2
- package/src/core/release/runtime-evidence.ts +5 -98
- package/src/core/review/module-review-prompt.ts +21 -3
- package/src/core/setup/projection.ts +2 -2
- package/src/core/setup/types.ts +4 -4
- package/src/core/skill-surface/catalog.ts +4 -7
- package/src/core/state/project-effective-state.ts +11 -3
- package/src/core/state/types.ts +26 -0
- package/src/core/tools/catalog.ts +101 -0
- package/src/core/upgrade/legacy-inventory.ts +3 -3
- package/src/effects/architecture/archctx-provider.ts +397 -177
- package/src/effects/architecture/model-reader.ts +265 -119
- package/src/effects/architecture/projection-apply.ts +18 -61
- package/src/effects/artifact-retention.ts +314 -0
- package/src/effects/capabilities/archcontext-owners.ts +43 -11
- package/src/effects/dev-activity/collector.ts +9 -74
- package/src/effects/engineers/delegated-run-store.ts +2 -40
- package/src/effects/engineers/profile-store.ts +7 -15
- package/src/effects/engineers/scheduling.ts +5 -5
- package/src/effects/evidence/recovery-materializer.ts +65 -85
- package/src/effects/locking/exclusive-directory-lock.ts +158 -79
- package/src/effects/loop/state-input-collector.ts +29 -118
- package/src/effects/operator/architecture.ts +3 -1
- package/src/effects/operator/{collaboration-worker.ts → repository-snapshot-worker.ts} +16 -16
- package/src/effects/operator/{collaboration.ts → repository-snapshot.ts} +40 -49
- package/src/effects/operator/runtime-service.ts +8 -59
- package/src/effects/operator/server.ts +146 -162
- package/src/effects/publication/feedback-store.ts +108 -58
- package/src/effects/publication/publication-receipt.ts +45 -0
- package/src/effects/refactor/archctx-provider.ts +14 -24
- package/src/effects/refactor/recommendations.ts +47 -26
- package/src/effects/release/runtime-evidence.ts +14 -53
- package/src/effects/review/diff-fingerprint.ts +21 -17
- package/src/effects/review/generic-review.ts +12 -9
- package/src/effects/review/oar-review-host.ts +16 -8
- package/src/effects/run-summary-retention.ts +44 -88
- package/src/effects/runtime/helper-runner.ts +2 -20
- package/src/effects/state/collect-board-inputs.ts +1 -2
- package/src/effects/state/coordination-claim-token.ts +9 -0
- package/src/effects/state/coordination-worktree-topology.ts +64 -37
- package/src/effects/state/owed-capabilities.ts +150 -0
- package/src/effects/state/resolve-effective-state.ts +286 -107
- package/src/effects/state/worktree-trash.ts +12 -4
- package/src/effects/terminal/coding-session.ts +3 -3
- package/src/effects/terminal/oar-coding-host.ts +10 -7
- package/src/effects/terminal/task-role-profiles.ts +14 -28
- package/src/effects/terminal/task-runtime-observation.ts +183 -0
- package/src/effects/terminal/task-session.ts +68 -107
- package/src/operator-web/App.tsx +42 -44
- package/src/operator-web/Board.tsx +9 -40
- package/src/operator-web/ItemDrawer.tsx +10 -41
- package/src/operator-web/ModuleGraph.tsx +1 -1
- package/src/operator-web/OrganizationSummary.tsx +3 -3
- package/src/operator-web/PlanningView.tsx +2 -2
- package/src/operator-web/RepositoryWorkspace.tsx +11 -234
- package/src/operator-web/RuntimeBadges.tsx +7 -60
- package/src/operator-web/SetupPages.tsx +1 -2
- package/src/operator-web/SystemPage.tsx +4 -8
- package/src/operator-web/ToolsPage.tsx +136 -0
- package/src/operator-web/app.css +11 -23
- package/src/operator-web/dev-activity.ts +13 -25
- package/src/operator-web/fixture.ts +7 -196
- package/src/operator-web/fixtures/dev-activity.ts +13 -30
- package/src/operator-web/fixtures/index.ts +5 -26
- package/src/operator-web/fixtures/setup.ts +17 -30
- package/src/operator-web/fleet-api.ts +20 -20
- package/src/operator-web/i18n.ts +90 -438
- package/src/operator-web/labels.ts +0 -9
- package/src/operator-web/types.ts +27 -200
- package/src/operator-web/workspace-location.ts +13 -2
- package/assets/hooks/AGENTS.md +0 -41
- package/assets/hooks/CLAUDE.md +0 -41
- package/assets/hooks/lib/workflow-state.sh +0 -1599
- package/assets/hooks/projection.json +0 -9
- package/assets/reference-configs/AGENTS.md +0 -13
- package/assets/reference-configs/CLAUDE.md +0 -13
- package/assets/skills/repo-harness-cross-review/references/codex-mode.md +0 -18
- package/dist/operator-ui/assets/ArchitectureWorkspace-D4OUgv7P.js +0 -1
- package/dist/operator-ui/assets/index-DAePh_VG.css +0 -2
- package/dist/operator-ui/assets/index-y71_oLs9.js +0 -18
- package/scripts/c9-collaboration-dispatch-runner.ts +0 -27
- package/scripts/check-pi-package-smoke.ts +0 -59
- package/scripts/sync-hook-sources.ts +0 -277
- package/scripts/sync-pi-package.ts +0 -27
- package/src/cli/commands/collaboration.ts +0 -297
- package/src/cli/commands/hook.ts +0 -44
- package/src/cli/commands/pipeline.ts +0 -46
- package/src/cli/commands/prompt-guard-decision.ts +0 -240
- package/src/cli/commands/task-agent.ts +0 -66
- package/src/cli/hook/command-observed.ts +0 -289
- package/src/cli/hook/delegation-state.ts +0 -315
- package/src/cli/hook/minimal-change-cli.ts +0 -130
- package/src/cli/hook/minimal-change-context.ts +0 -60
- package/src/cli/hook/minimal-change-policy.ts +0 -192
- package/src/cli/hook/minimal-change-signals.ts +0 -637
- package/src/cli/hook/mutation-observed.ts +0 -731
- package/src/cli/hook/prompt-guard-decision.ts +0 -248
- package/src/cli/hook/prompt-handler.ts +0 -41
- package/src/cli/hook/prompt-intents.ts +0 -580
- package/src/cli/hook/prompt-router.ts +0 -75
- package/src/cli/hook/review-rubric.ts +0 -78
- package/src/cli/hook/review-subject.ts +0 -45
- package/src/cli/hook/run-identity.ts +0 -173
- package/src/cli/hook/subagent-handler.ts +0 -909
- package/src/cli/hook/trace-observer.ts +0 -209
- package/src/cli/mcp/collaboration-tools.ts +0 -333
- package/src/core/collaboration/admission.ts +0 -245
- package/src/core/collaboration/adoption.ts +0 -154
- package/src/core/collaboration/common.ts +0 -396
- package/src/core/collaboration/context-packet.ts +0 -601
- package/src/core/collaboration/contribution.ts +0 -444
- package/src/core/collaboration/handoff.ts +0 -376
- package/src/core/collaboration/hotspot.ts +0 -146
- package/src/core/collaboration/run-binding.ts +0 -263
- package/src/core/collaboration/signal.ts +0 -174
- package/src/core/collaboration/thread-projection.ts +0 -390
- package/src/core/collaboration/work-exchange.ts +0 -531
- package/src/core/engineers/automation-attempt.ts +0 -93
- package/src/core/hook-work-budget.ts +0 -3
- package/src/core/loop/loop-event-protocol.ts +0 -248
- package/src/core/operator/collaboration-snapshot.ts +0 -304
- package/src/core/pipeline/board.ts +0 -43
- package/src/core/pipeline/gates.ts +0 -32
- package/src/core/pipeline/health.ts +0 -53
- package/src/core/pipeline/projection.ts +0 -63
- package/src/core/pipeline/stage-machine.ts +0 -47
- package/src/core/pipeline/types.ts +0 -108
- package/src/effects/collaboration/actor.ts +0 -167
- package/src/effects/collaboration/admission-bridge.ts +0 -410
- package/src/effects/collaboration/adoption-store.ts +0 -271
- package/src/effects/collaboration/agent-surface.ts +0 -547
- package/src/effects/collaboration/context-delivery.ts +0 -449
- package/src/effects/collaboration/contribution-collector.ts +0 -483
- package/src/effects/collaboration/contribution-store.ts +0 -118
- package/src/effects/collaboration/feature-flag.ts +0 -64
- package/src/effects/collaboration/handoff-store.ts +0 -260
- package/src/effects/collaboration/provider-output-adapter.ts +0 -281
- package/src/effects/collaboration/record-store.ts +0 -488
- package/src/effects/collaboration/signal-store.ts +0 -241
- package/src/effects/collaboration/succession.ts +0 -409
- package/src/effects/collaboration/work-exchange.ts +0 -410
- package/src/effects/engineers/automation-attempt-store.ts +0 -48
- package/src/effects/evidence/post-bash-importer.ts +0 -362
- package/src/effects/operator/pipeline-status.ts +0 -15
- package/src/effects/pipeline/authority.ts +0 -141
- package/src/effects/pipeline/ingest.ts +0 -91
- package/src/effects/pipeline/ledger.ts +0 -179
- package/src/effects/pipeline/read.ts +0 -93
- package/src/effects/pipeline/store.ts +0 -292
- package/src/effects/state/coordination-lease-reclaim.ts +0 -60
- package/src/effects/terminal/task-request-readback.ts +0 -79
- package/src/operator-web/PipelineBoard.tsx +0 -380
- package/src/pi/extension.ts +0 -214
- package/src/pi/hook-bridge.ts +0 -121
- package/src/pi/hook-protocol.ts +0 -37
package/AGENTS.md
CHANGED
|
@@ -4,23 +4,34 @@
|
|
|
4
4
|
- For non-trivial work, follow the global Progressive Due Diligence rule (P1 map, P2 trace, P3 decision) before design decisions or code edits.
|
|
5
5
|
- Keep root CLAUDE.md and AGENTS.md as standalone regular files; repeat shared rules in both and keep host-specific guidance separate.
|
|
6
6
|
- Read the current request and repo-local agent context, work on a branch, make bounded commits, verify once, then report the PR outcome.
|
|
7
|
+
- Read `tasks/lessons.md` at session start and apply its active lessons. Current repo state and evidence override a lesson.
|
|
8
|
+
- Finish the main task first. Fix a small problem found on the way directly. For a large problem, open a GitHub issue before you work on it.
|
|
7
9
|
- Write output text (docs, PR descriptions, commit messages, reports) in ASD-STE100 Simplified Technical English: short sentences, one idea per sentence, active voice, approved-dictionary words; write Chinese output the same way, with short sentences and one idea per sentence.
|
|
8
10
|
- Ordinary tasks use the PR description: goal, scope, changes, verification, risk and rollback. No mandatory plan/contract/review/notes chain; notes are only for non-obvious decisions.
|
|
9
11
|
- Keep four hard boundaries: main publication, deletion, credentials/permissions, and release/production operations.
|
|
10
12
|
- Only when the current task explicitly authorizes main publication may a model squash-merge after automated checks pass and GitHub has no outstanding change requests or unresolved review threads; an explicit no-merge instruction always wins. Push/tag still require task authorization; credentials/permissions, other deletion and release/production retain their separate approval boundaries. Record authorized publication, the provider-confirmed merge SHA and parent SHA, `git revert <squash-commit>`, and the daily report. Do not create rollback tags.
|
|
11
|
-
- Default
|
|
12
|
-
- Closeout
|
|
13
|
-
- `start` recovers only a real target directory registered by this clone on the expected branch, under the topology lock, with no lock or other owner. Recovery requires a current-user-owned checkout directory without group or other write access, a regular owned Git pointer, its matching admin backpointer, and the original directory identity saved by start. Git metadata can be group-writable but must not be other-writable. Start still creates a checkout when uid is unavailable; recovery then refuses. Exact removal retires the identity after Git readback. Missing identity or a replacement directory blocks recovery. Files, symlinks, unregistered paths and other branches are refused. Cleanup refuses a registered worktree whose branch is missing. MCP cleanup also refuses active markers and retained native verification evidence. Sweep reports name processed paths. Deferred entries are reported as counts. `kept` excludes deferred entries. A command timeout sends SIGTERM to the direct child only. A grandchild can briefly extend the deadline. No detached cleanup process starts. Herdr notifications accept registered default task worktrees and paths inside them. Other temporary paths and `rh-herdr-` labels stay filtered.
|
|
13
|
+
- Default worktrees are at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`). Commit or push before a reboot or a tmp cleanup.
|
|
14
|
+
- Closeout and sweep remove only merged, clean and unowned worktrees. To keep one, give it an unmerged commit, keep it dirty, or mark or lease it. Details: [agentic-development-flow](docs/reference-configs/agentic-development-flow.md).
|
|
14
15
|
- Automatically delete only merged, clean worktrees/branches; ask the user for every other deletion. Credentials/permissions (including confirmation bypass) and release/production operations require user approval.
|
|
15
16
|
- Use gatekeeper/cross-model review for large changes, security/permissions, or unresolved model uncertainty; ordinary steps record diagnostics without approval loops.
|
|
16
17
|
- When you delegate, investigate first, then split work by write ownership. Give each parallel writer its own worktree from a clean source. Implementation sub-agents edit only their scope. They do not run build, typecheck or tests. They commit early in their own worktree and return early. In a shared checkout they do not commit; the parent commits. Evidence roles run the named check that is their task and do not commit. The parent agent owns task management, conflict resolution, build, typecheck, tests and integration. After integration, the parent removes each sub-agent worktree and branch whose commits are in the task branch and whose checkout is clean. It also removes the intermediate build output and temporary files that the work created. Other deletion still needs the user.
|
|
17
|
-
- Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/
|
|
18
|
+
- Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/herdr-notify.md#herdr-dispatch).
|
|
18
19
|
- GitHub operations (PRs, reviews, merges, labels, releases, comments) go only through the gh/git CLI or the GitHub API. Never use simulated browser clicks on github.com: the account can be banned.
|
|
19
20
|
- When one PR changes both test assertions and implementation code, run one read-only review focused on tests bent to fit a bug (on-demand, not a restored gate; dispatch per the herdr guide).
|
|
20
21
|
- `.archcontext/model/` owns architecture boundaries; read `docs/architecture/` on demand and update only real responsibility changes. Architecture diagnostics do not block work or author nested agent instructions.
|
|
22
|
+
- When a branch changes a capability's responsibility, entrypoints, relations or flows, run `repo-harness architecture-projection check --json` before review and follow `repo-harness-architecture` (`assets/skill-commands/repo-harness-architecture/references/worker.md`).
|
|
21
23
|
- Preserve `agents/fleet/`, release checklists and downstream `assets/templates` / `assets/partials*`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract.
|
|
22
24
|
- `_ops/` is ignored private operations state: never commit or agent-edit it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
|
|
23
25
|
|
|
26
|
+
## GitHub Issue Claims
|
|
27
|
+
- Before an agent starts work on a GitHub issue, read its current state, assignees and all comments through `gh` or the GitHub API. Use pagination for comments. Check existing work claims, linked PRs and handoff notes.
|
|
28
|
+
- An active claim is an assignee other than the current task owner, an open PR that links the issue, or an active claim comment that no later status comment released. If another agent or person has an active claim, do not start duplicate work. Coordinate with that owner within the authorized task scope. Take over only after an explicit handoff or user instruction. Silence, an old timestamp or a disconnected session does not release a claim.
|
|
29
|
+
- When taking an unclaimed issue or an approved handoff, post a claim comment before edits, tests or worker dispatch. Use `gh issue comment <issue-url> --body-file <file>`. This rule authorizes claim and status comments for an issue within the user's task scope. It grants no other GitHub write authority.
|
|
30
|
+
- Start the comment with `repo-harness issue claim`. Include `Status: active`, the agent kind and unique session or task ID, the branch, the work scope and any prior claim comment URL for a handoff. Use this identity in later status comments. A shared GitHub login is not an agent identity. Do not include secrets or private host paths.
|
|
31
|
+
- Read the issue comments again after posting. Confirm the published comment URL and body. If a competing claim appeared, stop duplicate work and resolve ownership before continuing. For simultaneous claims without an explicit assignment or handoff, the earliest GitHub comment wins; break timestamp ties by comment ID. These comments coordinate agents; they are not an atomic lock and do not replace canonical task claims or leases.
|
|
32
|
+
- On resume, check the current claim before continuing. Reuse the same active claim instead of posting it again. If a read or post fails, or delivery is uncertain, stop and report the failure. Read back before retrying an uncertain post.
|
|
33
|
+
- Post a status comment that links the claim when the work is blocked, ready for review, complete or released. Keep a blocked or review-pending claim active. Include the PR or result when available. Release ownership explicitly on cancellation or handoff. Do not close the issue unless the task authorizes closure.
|
|
34
|
+
|
|
24
35
|
## Code Optimization Principles
|
|
25
36
|
- Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
|
|
26
37
|
- Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
|
|
@@ -31,10 +42,12 @@
|
|
|
31
42
|
- Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
|
|
32
43
|
|
|
33
44
|
## Testing
|
|
34
|
-
- Run `bun run check:type`
|
|
45
|
+
- Run `bun run check:type` for code changes and tests covering the changed behavior once after the implementation is stable. Development-time debugging can run focused checks before that final verification.
|
|
46
|
+
- For a bug fix, prefer a focused failing regression before the fix. Run only the reproducer during RED. Record a reproduction gap when the environment cannot produce it; ordinary tasks do not require RED artifacts.
|
|
47
|
+
- A diff's size, a new test file, a new agent or a rebase does not by itself require a full run.
|
|
35
48
|
- Use `bun run test:files <affected tests> --timeout 60000 --max-concurrency 1`; extend existing coverage before creating a new test file.
|
|
36
49
|
- Select tests by observable risk and owning runtime boundary, including error/recovery paths when affected.
|
|
37
|
-
- Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting.
|
|
50
|
+
- Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting or that deleted files stay deleted.
|
|
38
51
|
- Reviewers consume the recorded command, result, revision and environment; they do not rerun passing checks to claim ownership.
|
|
39
52
|
- Changed inputs or a new uncovered failure justify affected delta checks; an old pass is only historical evidence for its old subject.
|
|
40
53
|
- Run the full suite daily; a failure opens an automatic repair task and appears in the daily report.
|
|
@@ -54,7 +67,7 @@
|
|
|
54
67
|
|
|
55
68
|
## Codex
|
|
56
69
|
- Own backend implementation and testing; Claude owns frontend implementation and interaction, and the parent coordinates scope and integration.
|
|
57
|
-
- User-level `~/.codex/hooks.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler.
|
|
70
|
+
- User-level `~/.codex/hooks.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Operator helpers run from the package through `repo-harness run <helper>`.
|
|
58
71
|
- Use `~/.codex/skills` as the runtime skill source; `~/.agents/skills` is staging/cache only. Keep `think`, `hunt`, `check` and `health` updates verified before runtime use.
|
|
59
72
|
- The Codex automation profile requires runtime-provided `health`, `check` and `mermaid`; do not vendor their bodies.
|
|
60
73
|
- Treat auto-compact as a fallback; prepare ignored `.ai/harness/handoff/current.md` and `resume.md` when long-task rollover is needed.
|
package/CLAUDE.md
CHANGED
|
@@ -4,23 +4,34 @@
|
|
|
4
4
|
- For non-trivial work, follow the global Progressive Due Diligence rule (P1 map, P2 trace, P3 decision) before design decisions or code edits.
|
|
5
5
|
- Keep root CLAUDE.md and AGENTS.md as standalone regular files; repeat shared rules in both and keep host-specific guidance separate.
|
|
6
6
|
- Read the current request and repo-local agent context, work on a branch, make bounded commits, verify once, then report the PR outcome.
|
|
7
|
+
- Read `tasks/lessons.md` at session start and apply its active lessons. Current repo state and evidence override a lesson.
|
|
8
|
+
- Finish the main task first. Fix a small problem found on the way directly. For a large problem, open a GitHub issue before you work on it.
|
|
7
9
|
- Write output text (docs, PR descriptions, commit messages, reports) in ASD-STE100 Simplified Technical English: short sentences, one idea per sentence, active voice, approved-dictionary words; write Chinese output the same way, with short sentences and one idea per sentence.
|
|
8
10
|
- Ordinary tasks use the PR description: goal, scope, changes, verification, risk and rollback. No mandatory plan/contract/review/notes chain; notes are only for non-obvious decisions.
|
|
9
11
|
- Keep four hard boundaries: main publication, deletion, credentials/permissions, and release/production operations.
|
|
10
12
|
- Only when the current task explicitly authorizes main publication may a model squash-merge after automated checks pass and GitHub has no outstanding change requests or unresolved review threads; an explicit no-merge instruction always wins. Push/tag still require task authorization; credentials/permissions, other deletion and release/production retain their separate approval boundaries. Record authorized publication, the provider-confirmed merge SHA and parent SHA, `git revert <squash-commit>`, and the daily report. Do not create rollback tags.
|
|
11
|
-
- Default
|
|
12
|
-
- Closeout
|
|
13
|
-
- `start` recovers only a real target directory registered by this clone on the expected branch, under the topology lock, with no lock or other owner. Recovery requires a current-user-owned checkout directory without group or other write access, a regular owned Git pointer, its matching admin backpointer, and the original directory identity saved by start. Git metadata can be group-writable but must not be other-writable. Start still creates a checkout when uid is unavailable; recovery then refuses. Exact removal retires the identity after Git readback. Missing identity or a replacement directory blocks recovery. Files, symlinks, unregistered paths and other branches are refused. Cleanup refuses a registered worktree whose branch is missing. MCP cleanup also refuses active markers and retained native verification evidence. Sweep reports name processed paths. Deferred entries are reported as counts. `kept` excludes deferred entries. A command timeout sends SIGTERM to the direct child only. A grandchild can briefly extend the deadline. No detached cleanup process starts. Herdr notifications accept registered default task worktrees and paths inside them. Other temporary paths and `rh-herdr-` labels stay filtered.
|
|
13
|
+
- Default worktrees are at `/tmp/<repo>-wt-<slug>` (Windows: `os.tmpdir()`). Commit or push before a reboot or a tmp cleanup.
|
|
14
|
+
- Closeout and sweep remove only merged, clean and unowned worktrees. To keep one, give it an unmerged commit, keep it dirty, or mark or lease it. Details: [agentic-development-flow](docs/reference-configs/agentic-development-flow.md).
|
|
14
15
|
- Automatically delete only merged, clean worktrees/branches; ask the user for every other deletion. Credentials/permissions (including confirmation bypass) and release/production operations require user approval.
|
|
15
16
|
- Use gatekeeper/cross-model review for large changes, security/permissions, or unresolved model uncertainty; ordinary steps record diagnostics without approval loops.
|
|
16
17
|
- When you delegate, investigate first, then split work by write ownership. Give each parallel writer its own worktree from a clean source. Implementation sub-agents edit only their scope. They do not run build, typecheck or tests. They commit early in their own worktree and return early. In a shared checkout they do not commit; the parent commits. Evidence roles run the named check that is their task and do not commit. The parent agent owns task management, conflict resolution, build, typecheck, tests and integration. After integration, the parent removes each sub-agent worktree and branch whose commits are in the task branch and whose checkout is clean. It also removes the intermediate build output and temporary files that the work created. Other deletion still needs the user.
|
|
17
|
-
- Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/
|
|
18
|
+
- Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/herdr-notify.md#herdr-dispatch).
|
|
18
19
|
- GitHub operations (PRs, reviews, merges, labels, releases, comments) go only through the gh/git CLI or the GitHub API. Never use simulated browser clicks on github.com: the account can be banned.
|
|
19
20
|
- When one PR changes both test assertions and implementation code, run one read-only review focused on tests bent to fit a bug (on-demand, not a restored gate; dispatch per the herdr guide).
|
|
20
21
|
- `.archcontext/model/` owns architecture boundaries; read `docs/architecture/` on demand and update only real responsibility changes. Architecture diagnostics do not block work or author nested agent instructions.
|
|
22
|
+
- When a branch changes a capability's responsibility, entrypoints, relations or flows, run `repo-harness architecture-projection check --json` before review and follow `repo-harness-architecture` (`assets/skill-commands/repo-harness-architecture/references/worker.md`).
|
|
21
23
|
- Preserve `agents/fleet/`, release checklists and downstream `assets/templates` / `assets/partials*`. `.ai/harness/workflow-contract.json` is the opt-in marker. `assets/workflow-contract.v1.json` is the contract.
|
|
22
24
|
- `_ops/` is ignored private operations state: never commit or agent-edit it. `_ref/` is an ignored reference cache; cite influential revisions. Follow deploy SQL policy, otherwise use ascending 4-digit files under `deploy/sql/`.
|
|
23
25
|
|
|
26
|
+
## GitHub Issue Claims
|
|
27
|
+
- Before an agent starts work on a GitHub issue, read its current state, assignees and all comments through `gh` or the GitHub API. Use pagination for comments. Check existing work claims, linked PRs and handoff notes.
|
|
28
|
+
- An active claim is an assignee other than the current task owner, an open PR that links the issue, or an active claim comment that no later status comment released. If another agent or person has an active claim, do not start duplicate work. Coordinate with that owner within the authorized task scope. Take over only after an explicit handoff or user instruction. Silence, an old timestamp or a disconnected session does not release a claim.
|
|
29
|
+
- When taking an unclaimed issue or an approved handoff, post a claim comment before edits, tests or worker dispatch. Use `gh issue comment <issue-url> --body-file <file>`. This rule authorizes claim and status comments for an issue within the user's task scope. It grants no other GitHub write authority.
|
|
30
|
+
- Start the comment with `repo-harness issue claim`. Include `Status: active`, the agent kind and unique session or task ID, the branch, the work scope and any prior claim comment URL for a handoff. Use this identity in later status comments. A shared GitHub login is not an agent identity. Do not include secrets or private host paths.
|
|
31
|
+
- Read the issue comments again after posting. Confirm the published comment URL and body. If a competing claim appeared, stop duplicate work and resolve ownership before continuing. For simultaneous claims without an explicit assignment or handoff, the earliest GitHub comment wins; break timestamp ties by comment ID. These comments coordinate agents; they are not an atomic lock and do not replace canonical task claims or leases.
|
|
32
|
+
- On resume, check the current claim before continuing. Reuse the same active claim instead of posting it again. If a read or post fails, or delivery is uncertain, stop and report the failure. Read back before retrying an uncertain post.
|
|
33
|
+
- Post a status comment that links the claim when the work is blocked, ready for review, complete or released. Keep a blocked or review-pending claim active. Include the PR or result when available. Release ownership explicitly on cancellation or handoff. Do not close the issue unless the task authorizes closure.
|
|
34
|
+
|
|
24
35
|
## Code Optimization Principles
|
|
25
36
|
- Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
|
|
26
37
|
- Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
|
|
@@ -31,10 +42,12 @@
|
|
|
31
42
|
- Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
|
|
32
43
|
|
|
33
44
|
## Testing
|
|
34
|
-
- Run `bun run check:type`
|
|
45
|
+
- Run `bun run check:type` for code changes and tests covering the changed behavior once after the implementation is stable. Development-time debugging can run focused checks before that final verification.
|
|
46
|
+
- For a bug fix, prefer a focused failing regression before the fix. Run only the reproducer during RED. Record a reproduction gap when the environment cannot produce it; ordinary tasks do not require RED artifacts.
|
|
47
|
+
- A diff's size, a new test file, a new agent or a rebase does not by itself require a full run.
|
|
35
48
|
- Use `bun run test:files <affected tests> --timeout 60000 --max-concurrency 1`; extend existing coverage before creating a new test file.
|
|
36
49
|
- Select tests by observable risk and owning runtime boundary, including error/recovery paths when affected.
|
|
37
|
-
- Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting.
|
|
50
|
+
- Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting or that deleted files stay deleted.
|
|
38
51
|
- Reviewers consume the recorded command, result, revision and environment; they do not rerun passing checks to claim ownership.
|
|
39
52
|
- Changed inputs or a new uncovered failure justify affected delta checks; an old pass is only historical evidence for its old subject.
|
|
40
53
|
- Run the full suite daily; a failure opens an automatic repair task and appears in the daily report.
|
|
@@ -55,6 +68,6 @@
|
|
|
55
68
|
## Claude Code
|
|
56
69
|
- Own frontend implementation and interaction; Codex owns backend implementation and testing, and the parent coordinates scope and integration.
|
|
57
70
|
- Use Claude Code's available tools within granted permissions; changes to tool grants, hooks or confirmation bypass require approval of the exact change.
|
|
58
|
-
- User-level `~/.claude/settings.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler.
|
|
71
|
+
- User-level `~/.claude/settings.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Operator helpers run from the package through `repo-harness run <helper>`.
|
|
59
72
|
- Write comments, commits and PR text from the final diff; comments explain non-obvious reasons, and PRs describe final behavior and material rationale.
|
|
60
73
|
- Keep this file short; load [development flow](docs/reference-configs/agentic-development-flow.md) and [external tooling](docs/reference-configs/external-tooling.md) only when needed.
|
package/README.es.md
CHANGED
|
@@ -156,9 +156,8 @@ repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP serv
|
|
|
156
156
|
- **Sesiones respaldadas por archivos, no por historial de chat.** Las
|
|
157
157
|
sesiones separadas de Claude y Codex se mantienen coordinadas a través del
|
|
158
158
|
repositorio. `SessionStart` inyecta el resume packet de la sesión anterior,
|
|
159
|
-
`Stop` escribe el handoff
|
|
160
|
-
|
|
161
|
-
exactamente el próximo paso, los blockers y los archivos modificados, sin
|
|
159
|
+
y `Stop` escribe el handoff y el resume. Una sesión puede terminar a mitad
|
|
160
|
+
de tarea, y la siguiente retoma exactamente el próximo paso, los blockers y los archivos modificados, sin
|
|
162
161
|
tener que volver a inferirlos.
|
|
163
162
|
- **Ahorro de tokens por diseño.** En lugar de bucles de grep-and-read que
|
|
164
163
|
reescanean el repositorio en cada sesión, el harness se apoya en un índice
|
|
@@ -222,7 +221,7 @@ escrito un humano.
|
|
|
222
221
|
| | |
|
|
223
222
|
| --- | --- |
|
|
224
223
|
| **Sesiones respaldadas por archivos** | Plans, contracts, checks y handoffs viven en el repositorio, de modo que una sesión nueva retoma desde artefactos en vez de un hilo de chat |
|
|
225
|
-
| **Typed hook runtime** |
|
|
224
|
+
| **Typed hook runtime** | 6 routes públicas (Claude 5, Codex 5), cada una atada a exactamente un typed handler in-process, con guards fail-closed en el límite de edición |
|
|
226
225
|
| **Plan → Contract → Review** | Un solo ciclo de vida desde el plan aprobado hasta el contract proyectado, el worktree aislado, la evidencia estructurada y un closeout revisable |
|
|
227
226
|
| **Programas planificados por el Bot** | Programas de collaboration con task offers de engineer y leases renovables; el Bot planifica, repo-harness aporta herramientas y evidencia |
|
|
228
227
|
| **Carga de contexto progresiva** | Un root context estable de ~12KB más capability contracts de ~1KB que solo se cargan para los archivos que realmente se están tocando |
|
|
@@ -299,11 +298,11 @@ flowchart TD
|
|
|
299
298
|
CurrentTree --> Implement
|
|
300
299
|
ContractRun --> Changes
|
|
301
300
|
|
|
302
|
-
Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>
|
|
303
|
-
PreHooks -->|blocked| ScopeFix["Fix
|
|
301
|
+
Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>RepoScopeGuard, ExternalReferenceGuard, OpsPrivateGuard"]
|
|
302
|
+
PreHooks -->|blocked| ScopeFix["Fix the target path"]
|
|
304
303
|
ScopeFix --> Implement
|
|
305
304
|
PreHooks -->|allowed| Changes["Code, docs, tests, or config changes"]
|
|
306
|
-
Changes --> PostHooks["
|
|
305
|
+
Changes --> PostHooks["Bash observer and Stop hook<br/>repair circuit, owed architecture, handoff"]
|
|
307
306
|
PostHooks --> ArchUpdate["Explicit architecture update<br/>archctx ChangeSet when responsibilities change<br/>architecture-projection apply"]
|
|
308
307
|
ArchUpdate --> Verify["Run verification<br/>tests plus repo workflow checks"]
|
|
309
308
|
|
|
@@ -368,13 +367,13 @@ Campaign execution moved to the existing Bot skills on 2026-10-04. Use [repo-har
|
|
|
368
367
|
### Refactor recommendations
|
|
369
368
|
|
|
370
369
|
```bash
|
|
371
|
-
repo-harness refactor recommendations
|
|
372
|
-
repo-harness refactor decide <id> accept|defer|reject --reason "<text>"
|
|
370
|
+
repo-harness refactor recommendations [--import-node-limit <n>] # measured suggestions with evidence
|
|
371
|
+
repo-harness refactor decide <id> accept|defer|reject --reason "<text>" [--import-node-limit <n>]
|
|
373
372
|
```
|
|
374
373
|
|
|
375
374
|
ArchContext mide problemas estructurales como ciclos y violaciones de
|
|
376
|
-
dirección. repo-harness muestra cada sugerencia con sus métricas
|
|
377
|
-
estadísticas de sus módulos, y registra la decisión del usuario. Nunca ejecuta
|
|
375
|
+
dirección. repo-harness muestra cada sugerencia con sus métricas, su evidencia
|
|
376
|
+
acotada y las estadísticas de sus módulos, y registra la decisión del usuario. Nunca ejecuta
|
|
378
377
|
un refactor; una sugerencia aceptada sigue el flujo normal de plan y pull request.
|
|
379
378
|
|
|
380
379
|
### Plano de colaboración
|
|
@@ -421,26 +420,11 @@ Un task-agent fleet `deep-reasoner` persiste en un linked checkout dedicado y la
|
|
|
421
420
|
|
|
422
421
|
## Hooks
|
|
423
422
|
|
|
424
|
-
El adapter instalado
|
|
425
|
-
tuple `event + routeId + matcher` es el contract estable;
|
|
426
|
-
exactamente un typed handler in-process.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
| --- | --- | --- | --- |
|
|
430
|
-
| `SessionStart.default` | all sessions | `src/cli/hook/session-context.ts` (in-process builder) | Inyecta el handoff anterior, el estado del sprint, guía de minimal-change y hallazgos de config-security de solo lectura antes de que empiece el trabajo. |
|
|
431
|
-
| `PreToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-guard.ts` (in-process handler) | Aplica la worktree policy y la readiness de plan/contract antes de las ediciones de implementación. |
|
|
432
|
-
| `PreToolUse.subagent` | `Task\|Agent\|SendUserMessage` | `src/cli/hook/subagent-handler.ts` | Mantiene el trabajo delegado retornando a través de la sesión padre, en lugar de dejar escapar afirmaciones de finalización. |
|
|
433
|
-
| `PostToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-observed.ts` (in-process handler) | Escribe como máximo un pequeño evento de bitácora con dirty bits por cada edición calificada; la verificación del contract, el sync de architecture/context/capability y la evidencia de minimal-change se difieren a Stop en vez de ejecutarse por cada edición. |
|
|
434
|
-
| `PostToolUse.bash` | `Bash` | `src/cli/hook/command-observed.ts` | Observa los resultados de comandos y captura evidencia de verificación sin reemplazar el command runner. |
|
|
435
|
-
| `PostToolUse.always` | all tools | `src/cli/hook/trace-observer.ts` | Provee trace y runtime observation de bajo ruido y siempre activo. |
|
|
436
|
-
| `UserPromptSubmit.default` | all prompts | `src/cli/hook/prompt-handler.ts` | Clasifica la intención del prompt, enruta hints de planning/check y renderiza guía de workflow host-safe. |
|
|
437
|
-
| `Stop.default` | session stop | `src/cli/hook/stop-handler.ts` (in-process handler) | Finaliza el handoff y protege contra terminar con draft-plans sin resolver o vacíos de evidencia de completion. |
|
|
438
|
-
|
|
439
|
-
Codex también instala tres Codex-only bounded-delegation routes —
|
|
440
|
-
`UserPromptSubmit.delegation`, `SubagentStart.context`, y
|
|
441
|
-
`SubagentStop.quality`, todas atadas a `src/cli/hook/subagent-handler.ts`;
|
|
442
|
-
Claude solo conserva la route compartida de return-channel,
|
|
443
|
-
`PreToolUse.subagent`.
|
|
423
|
+
El adapter instalado ata 6 hook routes públicas: Claude instala 5 y Codex instala
|
|
424
|
+
5. El route tuple `event + routeId + matcher` es el contract estable;
|
|
425
|
+
cada tuple ata exactamente un typed handler in-process. La tabla de routes, con una
|
|
426
|
+
columna Host, está en
|
|
427
|
+
[`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md#hook-authority-map).
|
|
444
428
|
|
|
445
429
|
`repo-harness-hook` y su typed handler registry son el host-event runtime;
|
|
446
430
|
`~/.claude/settings.json` y `~/.codex/hooks.json` son los adapters a nivel de
|
|
@@ -449,13 +433,14 @@ esos hooks corran. `.claude/settings.json` y `.codex/hooks.json` repo-locales
|
|
|
449
433
|
son config legacy a retirar. Depura en este orden: adapter config ->
|
|
450
434
|
`repo-harness-hook` -> route registry -> typed handler.
|
|
451
435
|
|
|
452
|
-
Cuando un hook bloquea el trabajo, lee primero
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
436
|
+
Cuando un hook bloquea el trabajo, lee primero la salida del terminal: una
|
|
437
|
+
línea `[<Guard>] <reason>` y una línea `Fix:`. El registro durable en
|
|
438
|
+
`.ai/harness/failures/latest.jsonl` lleva `guard`, `reason`, `fix`,
|
|
439
|
+
`failure_class`, y `run_id`. `.ai/harness/runs/hook-events.jsonl` registra
|
|
440
|
+
cada evento de hook. Los edit guards son `RepoScopeGuard` (una ruta fuera del
|
|
441
|
+
repositorio), `ExternalReferenceGuard` (`_ref/`), `OpsPrivateGuard`
|
|
442
|
+
(`_ops/`), y `ApplyPatchScopeGuard` y `EditScopeGuard` (sin una ruta de
|
|
443
|
+
destino legible).
|
|
459
444
|
Playbook completo:
|
|
460
445
|
[`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md).
|
|
461
446
|
|
|
@@ -598,9 +583,11 @@ Ese checkout es la única fuente de verdad editable; las rutas locales de
|
|
|
598
583
|
skill de Claude/Codex son runtime entrypoints respaldados por symlinks,
|
|
599
584
|
reconstruidos por `scripts/sync-codex-installed-copies.sh`.
|
|
600
585
|
|
|
601
|
-
`bun run check:ci` es el único gate equivalente a CI
|
|
602
|
-
|
|
603
|
-
|
|
586
|
+
`bun run check:ci` es el único gate equivalente a CI. `bun run check:release`
|
|
587
|
+
añade el preflight de unpublished-version de npm y después ejecuta el lane
|
|
588
|
+
`release`: los tests protegidos por el gate de coste y el smoke de instalación
|
|
589
|
+
del tarball. No es una segunda suite completa ni el gate de CI; un release
|
|
590
|
+
depende de un CI en verde para el SHA del release.
|
|
604
591
|
Las pruebas afectadas cubren el routing del runtime. El antiguo gate de routing eval está retirado.
|
|
605
592
|
|
|
606
593
|
```bash
|
|
@@ -611,8 +598,8 @@ repo-harness docs show harness-overview
|
|
|
611
598
|
bun scripts/assemble-template.ts --plan C --name "MyProject"
|
|
612
599
|
```
|
|
613
600
|
|
|
614
|
-
Los cambios de hook
|
|
615
|
-
|
|
601
|
+
Los cambios de hook handler van a `src/cli/hook/`. Los operator helpers están en
|
|
602
|
+
`scripts/` y se ejecutan con `repo-harness run <helper>`. Los
|
|
616
603
|
reference docs son canónicos bajo `assets/reference-configs/` y se proyectan
|
|
617
604
|
en `docs/reference-configs/`; `bun run check:reference-configs` verifica esa
|
|
618
605
|
proyección.
|
|
@@ -649,8 +636,8 @@ repositorio adopte la misma política.
|
|
|
649
636
|
|
|
650
637
|
## Versión actual
|
|
651
638
|
|
|
652
|
-
- Paquete npm: `repo-harness@0.
|
|
653
|
-
- Sello de workflow generado: `repo-harness@0.
|
|
639
|
+
- Paquete npm: `repo-harness@0.23.0`
|
|
640
|
+
- Sello de workflow generado: `repo-harness@0.23.0+template@0.23.0`
|
|
654
641
|
- Repositorio de GitHub: `Ancienttwo/repo-harness`
|
|
655
642
|
- Notas de versión e historial: [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
656
643
|
|
package/README.fr.md
CHANGED
|
@@ -154,10 +154,9 @@ repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP serv
|
|
|
154
154
|
|
|
155
155
|
- **Des sessions file-backed, pas de mémoire de chat.** Les sessions Claude et
|
|
156
156
|
Codex séparées restent coordonnées via le dépôt. `SessionStart` injecte le
|
|
157
|
-
resume packet de la session précédente, `Stop` écrit le handoff
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
l'étape suivante exacte, avec les blockers et les fichiers modifiés, sans
|
|
157
|
+
resume packet de la session précédente, et `Stop` écrit le handoff et le
|
|
158
|
+
resume. Une session peut s'arrêter en plein milieu d'une tâche, et la
|
|
159
|
+
suivante reprend directement à l'étape suivante exacte, avec les blockers et les fichiers modifiés, sans
|
|
161
160
|
avoir à les redéduire.
|
|
162
161
|
- **Économe en tokens par conception.** Au lieu de boucles grep-and-read qui
|
|
163
162
|
rescannent le dépôt à chaque session, le harness s'appuie sur un index
|
|
@@ -220,7 +219,7 @@ humain aurait écrits.
|
|
|
220
219
|
| | |
|
|
221
220
|
| --- | --- |
|
|
222
221
|
| **Sessions file-backed** | Les plans, contracts, checks et handoffs vivent dans le dépôt, si bien qu'une nouvelle session reprend à partir des artifacts plutôt que d'un chat thread |
|
|
223
|
-
| **Runtime de hooks typés** |
|
|
222
|
+
| **Runtime de hooks typés** | 6 routes publiques (Claude 5, Codex 5), chacune liée à exactement un typed handler in-process, avec des guards fail-closed à la frontière d'édition |
|
|
224
223
|
| **Plan → Contract → Review** | Un seul lifecycle, du plan approuvé au contract projeté, en passant par le worktree isolé et l'evidence structurée, jusqu'à un closeout prêt pour la review |
|
|
225
224
|
| **Programmes ordonnancés par le Bot** | Programmes de collaboration avec des task offers d'engineer et des leases renouvelables ; le Bot ordonnance, repo-harness fournit les outils et les preuves |
|
|
226
225
|
| **Chargement de contexte progressif** | Un root context stable d'environ 12 Ko, plus des capability contracts d'environ 1 Ko chargés uniquement pour les fichiers réellement touchés |
|
|
@@ -297,11 +296,11 @@ flowchart TD
|
|
|
297
296
|
CurrentTree --> Implement
|
|
298
297
|
ContractRun --> Changes
|
|
299
298
|
|
|
300
|
-
Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>
|
|
301
|
-
PreHooks -->|blocked| ScopeFix["Fix
|
|
299
|
+
Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>RepoScopeGuard, ExternalReferenceGuard, OpsPrivateGuard"]
|
|
300
|
+
PreHooks -->|blocked| ScopeFix["Fix the target path"]
|
|
302
301
|
ScopeFix --> Implement
|
|
303
302
|
PreHooks -->|allowed| Changes["Code, docs, tests, or config changes"]
|
|
304
|
-
Changes --> PostHooks["
|
|
303
|
+
Changes --> PostHooks["Bash observer and Stop hook<br/>repair circuit, owed architecture, handoff"]
|
|
305
304
|
PostHooks --> ArchUpdate["Explicit architecture update<br/>archctx ChangeSet when responsibilities change<br/>architecture-projection apply"]
|
|
306
305
|
ArchUpdate --> Verify["Run verification<br/>tests plus repo workflow checks"]
|
|
307
306
|
|
|
@@ -366,13 +365,13 @@ Campaign execution moved to the existing Bot skills on 2026-10-04. Use [repo-har
|
|
|
366
365
|
### Refactor recommendations
|
|
367
366
|
|
|
368
367
|
```bash
|
|
369
|
-
repo-harness refactor recommendations
|
|
370
|
-
repo-harness refactor decide <id> accept|defer|reject --reason "<text>"
|
|
368
|
+
repo-harness refactor recommendations [--import-node-limit <n>] # measured suggestions with evidence
|
|
369
|
+
repo-harness refactor decide <id> accept|defer|reject --reason "<text>" [--import-node-limit <n>]
|
|
371
370
|
```
|
|
372
371
|
|
|
373
372
|
ArchContext mesure des problèmes structurels comme les cycles et les
|
|
374
373
|
violations de direction. repo-harness montre chaque suggestion avec ses
|
|
375
|
-
métriques et les statistiques de ses modules, et enregistre la décision de
|
|
374
|
+
métriques, ses preuves bornées et les statistiques de ses modules, et enregistre la décision de
|
|
376
375
|
l'utilisateur. Il n'exécute jamais de refactor ; une suggestion acceptée suit le
|
|
377
376
|
flux normal de plan et de pull request.
|
|
378
377
|
|
|
@@ -420,25 +419,11 @@ Un task-agent fleet `deep-reasoner` persiste dans un linked checkout dédié et
|
|
|
420
419
|
|
|
421
420
|
## Hooks
|
|
422
421
|
|
|
423
|
-
L'adapter installé
|
|
424
|
-
tuple de route `event + routeId + matcher` est
|
|
425
|
-
tuple lie exactement un typed handler in-process.
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
| --- | --- | --- | --- |
|
|
429
|
-
| `SessionStart.default` | all sessions | `src/cli/hook/session-context.ts` (in-process builder) | Injecte le handoff précédent, le statut sprint, la guidance minimal-change, et les findings config-security read-only avant le début du travail. |
|
|
430
|
-
| `PreToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-guard.ts` (in-process handler) | Impose la worktree policy et la readiness plan/contract avant les edits d'implémentation. |
|
|
431
|
-
| `PreToolUse.subagent` | `Task\|Agent\|SendUserMessage` | `src/cli/hook/subagent-handler.ts` | Garde le travail délégué qui revient via la session parent, au lieu de laisser fuiter des complétions prétendues. |
|
|
432
|
-
| `PostToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-observed.ts` (in-process handler) | Écrit au plus un petit événement de journal avec des dirty bits par edit qualifiant ; la contract verification, la sync architecture/context/capability, et l'evidence minimal-change sont différées jusqu'au Stop plutôt qu'exécutées à chaque edit. |
|
|
433
|
-
| `PostToolUse.bash` | `Bash` | `src/cli/hook/command-observed.ts` | Observe les résultats de commande et capture l'evidence de vérification sans remplacer le command runner. |
|
|
434
|
-
| `PostToolUse.always` | all tools | `src/cli/hook/trace-observer.ts` | Fournit une trace toujours active et à faible bruit, ainsi que l'observation runtime. |
|
|
435
|
-
| `UserPromptSubmit.default` | all prompts | `src/cli/hook/prompt-handler.ts` | Classifie l'intent du prompt, route les hints de planning/check, et rend une guidance de workflow host-safe. |
|
|
436
|
-
| `Stop.default` | session stop | `src/cli/hook/stop-handler.ts` (in-process handler) | Finalise le handoff et empêche de terminer avec un draft-plan non résolu ou des gaps d'evidence de complétion. |
|
|
437
|
-
|
|
438
|
-
Codex installe aussi trois routes de bounded-delegation réservées à Codex —
|
|
439
|
-
`UserPromptSubmit.delegation`, `SubagentStart.context` et
|
|
440
|
-
`SubagentStop.quality`, toutes liées à `src/cli/hook/subagent-handler.ts` ;
|
|
441
|
-
Claude ne garde que la route partagée `PreToolUse.subagent` return-channel.
|
|
422
|
+
L'adapter installé lie 6 routes de hook publiques : Claude en installe 5 et Codex en
|
|
423
|
+
installe 5. Le tuple de route `event + routeId + matcher` est
|
|
424
|
+
le contrat stable ; chaque tuple lie exactement un typed handler in-process. La table
|
|
425
|
+
des routes, avec une colonne Host, est dans
|
|
426
|
+
[`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md#hook-authority-map).
|
|
442
427
|
|
|
443
428
|
`repo-harness-hook` et son typed handler registry constituent le host-event
|
|
444
429
|
runtime ; `~/.claude/settings.json` et `~/.codex/hooks.json` sont les adapters
|
|
@@ -448,13 +433,14 @@ Settings avant que ces hooks ne s'exécutent. Les `.claude/settings.json` et
|
|
|
448
433
|
l'ordre : adapter config -> `repo-harness-hook` -> route registry -> typed
|
|
449
434
|
handler.
|
|
450
435
|
|
|
451
|
-
Quand un hook bloque le travail, lisez d'abord la sortie terminal
|
|
452
|
-
`
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
`
|
|
436
|
+
Quand un hook bloque le travail, lisez d'abord la sortie terminal : une ligne
|
|
437
|
+
`[<Guard>] <reason>` et une ligne `Fix:`. L'enregistrement durable dans
|
|
438
|
+
`.ai/harness/failures/latest.jsonl` contient `guard`, `reason`, `fix`,
|
|
439
|
+
`failure_class` et `run_id`. `.ai/harness/runs/hook-events.jsonl` enregistre
|
|
440
|
+
chaque événement de hook. Les edit guards sont `RepoScopeGuard` (un chemin
|
|
441
|
+
hors du dépôt), `ExternalReferenceGuard` (`_ref/`), `OpsPrivateGuard`
|
|
442
|
+
(`_ops/`), et `ApplyPatchScopeGuard` et `EditScopeGuard` (aucun chemin cible
|
|
443
|
+
lisible). Guide complet :
|
|
458
444
|
[`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md).
|
|
459
445
|
|
|
460
446
|
## Console de contrôle humaine locale
|
|
@@ -595,8 +581,11 @@ Ce checkout est l'unique source of truth éditable ; les chemins de skill
|
|
|
595
581
|
Claude/Codex locaux sont des runtime entrypoints adossés à des symlinks,
|
|
596
582
|
reconstruits par `scripts/sync-codex-installed-copies.sh`.
|
|
597
583
|
|
|
598
|
-
`bun run check:ci` est le gate unique équivalent CI
|
|
599
|
-
ajoute
|
|
584
|
+
`bun run check:ci` est le gate unique équivalent CI. `bun run check:release`
|
|
585
|
+
ajoute le preflight npm unpublished-version, puis exécute le lane `release` :
|
|
586
|
+
les tests protégés par le gate de coût et le smoke d'installation du tarball.
|
|
587
|
+
Ce n'est ni une deuxième suite complète ni le gate CI ; une release dépend d'un
|
|
588
|
+
CI vert pour le SHA de la release.
|
|
600
589
|
Les tests concernés vérifient le routing du runtime. Le gate de routing eval est retiré.
|
|
601
590
|
|
|
602
591
|
```bash
|
|
@@ -607,9 +596,8 @@ repo-harness docs show harness-overview
|
|
|
607
596
|
bun scripts/assemble-template.ts --plan C --name "MyProject"
|
|
608
597
|
```
|
|
609
598
|
|
|
610
|
-
Les changements de hook
|
|
611
|
-
|
|
612
|
-
vérification. Les reference docs sont canoniques sous
|
|
599
|
+
Les changements de hook handler vont dans `src/cli/hook/`. Les operator helpers sont dans
|
|
600
|
+
`scripts/` et s'exécutent avec `repo-harness run <helper>`. Les reference docs sont canoniques sous
|
|
613
601
|
`assets/reference-configs/` et projetées dans `docs/reference-configs/` ;
|
|
614
602
|
`bun run check:reference-configs` vérifie cette projection.
|
|
615
603
|
|
|
@@ -645,8 +633,8 @@ adopte la même policy.
|
|
|
645
633
|
|
|
646
634
|
## Release actuelle
|
|
647
635
|
|
|
648
|
-
- Package npm : `repo-harness@0.
|
|
649
|
-
- Generated workflow stamp : `repo-harness@0.
|
|
636
|
+
- Package npm : `repo-harness@0.23.0`
|
|
637
|
+
- Generated workflow stamp : `repo-harness@0.23.0+template@0.23.0`
|
|
650
638
|
- Dépôt GitHub : `Ancienttwo/repo-harness`
|
|
651
639
|
- Notes et historique de release : [`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
652
640
|
|
package/README.ja.md
CHANGED
|
@@ -157,7 +157,7 @@ repo-harness mcp uninstall --services-stopped # after stopping all MCP HTTP serv
|
|
|
157
157
|
- **セッションの状態はファイルに残り、チャット履歴には残らない。** 別々の
|
|
158
158
|
Claude セッションと Codex セッションは、リポジトリを介して同期を保ちます。
|
|
159
159
|
`SessionStart` が前回セッションの resume packet を注入し、`Stop` が handoff
|
|
160
|
-
|
|
160
|
+
と resume を書き出します。セッションはタスクの
|
|
161
161
|
途中で終了でき、次のセッションは正確な次の一手・blocker・変更ファイルを、
|
|
162
162
|
推測し直すことなくそのまま引き継ぎます。
|
|
163
163
|
- **設計上 token を節約する。** セッションのたびにリポジトリを grep-and-read
|
|
@@ -217,7 +217,7 @@ Layer 2 は Layer 1 を置き換えるものではありません。program の
|
|
|
217
217
|
| | |
|
|
218
218
|
| --- | --- |
|
|
219
219
|
| **File-backed sessions** | Plan、contract、check、handoff がリポジトリに残るので、新しいセッションはチャットスレッドではなく artifacts から再開します |
|
|
220
|
-
| **Typed hook runtime** |
|
|
220
|
+
| **Typed hook runtime** | 6 本の公開 route(Claude 5 本、Codex 5 本)があり、それぞれが exactly one の typed in-process handler に bind され、edit boundary で fail-closed な guard がかかります |
|
|
221
221
|
| **Plan → Contract → Review** | approved plan から投射された contract、隔離された worktree、構造化された evidence、review 可能な closeout までの 1 本の lifecycle |
|
|
222
222
|
| **Bot-scheduled programs** | engineer task offer と更新可能な lease を持つ collaboration program。Bot がスケジュールし、repo-harness が tools と evidence を提供します |
|
|
223
223
|
| **Progressive context loading** | 安定した約 12KB の root context に、実際に触れるファイルにだけ読み込まれる約 1KB の capability contract が加わります |
|
|
@@ -296,11 +296,11 @@ flowchart TD
|
|
|
296
296
|
CurrentTree --> Implement
|
|
297
297
|
ContractRun --> Changes
|
|
298
298
|
|
|
299
|
-
Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>
|
|
300
|
-
PreHooks -->|blocked| ScopeFix["Fix
|
|
299
|
+
Implement["Edit and run commands"] --> PreHooks["Pre-edit guards<br/>RepoScopeGuard, ExternalReferenceGuard, OpsPrivateGuard"]
|
|
300
|
+
PreHooks -->|blocked| ScopeFix["Fix the target path"]
|
|
301
301
|
ScopeFix --> Implement
|
|
302
302
|
PreHooks -->|allowed| Changes["Code, docs, tests, or config changes"]
|
|
303
|
-
Changes --> PostHooks["
|
|
303
|
+
Changes --> PostHooks["Bash observer and Stop hook<br/>repair circuit, owed architecture, handoff"]
|
|
304
304
|
PostHooks --> ArchUpdate["Explicit architecture update<br/>archctx ChangeSet when responsibilities change<br/>architecture-projection apply"]
|
|
305
305
|
ArchUpdate --> Verify["Run verification<br/>tests plus repo workflow checks"]
|
|
306
306
|
|
|
@@ -364,12 +364,12 @@ Campaign execution moved to the existing Bot skills on 2026-10-04. Use [repo-har
|
|
|
364
364
|
### Refactor recommendations
|
|
365
365
|
|
|
366
366
|
```bash
|
|
367
|
-
repo-harness refactor recommendations
|
|
368
|
-
repo-harness refactor decide <id> accept|defer|reject --reason "<text>"
|
|
367
|
+
repo-harness refactor recommendations [--import-node-limit <n>] # measured suggestions with evidence
|
|
368
|
+
repo-harness refactor decide <id> accept|defer|reject --reason "<text>" [--import-node-limit <n>]
|
|
369
369
|
```
|
|
370
370
|
|
|
371
371
|
ArchContext は循環や依存方向の違反などの構造上の問題を計測します。repo-harness は
|
|
372
|
-
|
|
372
|
+
各提案をその指標、上限付きの根拠、モジュール統計とともに表示し、ユーザーの判断を記録します。
|
|
373
373
|
リファクタリング自体は実行しません。受け入れた提案は通常の plan と pull request の
|
|
374
374
|
流れで進めます。
|
|
375
375
|
|
|
@@ -416,26 +416,11 @@ Herdr のない Claude デスクトップアプリでは `--launch app-terminal`
|
|
|
416
416
|
|
|
417
417
|
## Hooks
|
|
418
418
|
|
|
419
|
-
インストールされた adapter
|
|
420
|
-
|
|
421
|
-
exactly one の typed in-process
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
| --- | --- | --- | --- |
|
|
425
|
-
| `SessionStart.default` | all sessions | `src/cli/hook/session-context.ts` (in-process builder) | 作業開始前に、直前の handoff、sprint status、minimal-change guidance、read-only な config-security の findings を注入します。 |
|
|
426
|
-
| `PreToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-guard.ts` (in-process handler) | 実装編集の前に worktree policy と plan/contract の readiness を強制します。 |
|
|
427
|
-
| `PreToolUse.subagent` | `Task\|Agent\|SendUserMessage` | `src/cli/hook/subagent-handler.ts` | delegate された作業が completion claim を漏らさず、parent session を経由して戻るようにします。 |
|
|
428
|
-
| `PostToolUse.edit` | `Edit\|Write` | `src/cli/hook/mutation-observed.ts` (in-process handler) | 該当する編集ごとに、dirty bits を伴う小さな journal event を高々 1 件書き込みます。contract verification、architecture/context/capability sync、minimal-change evidence は編集ごとには実行されず、Stop まで遅延されます。 |
|
|
429
|
-
| `PostToolUse.bash` | `Bash` | `src/cli/hook/command-observed.ts` | command runner を置き換えることなく、command の結果を観測し verification evidence を取得します。 |
|
|
430
|
-
| `PostToolUse.always` | all tools | `src/cli/hook/trace-observer.ts` | low-noise で常時稼働する trace と runtime observation を提供します。 |
|
|
431
|
-
| `UserPromptSubmit.default` | all prompts | `src/cli/hook/prompt-handler.ts` | prompt の intent を分類し、planning/check の hint を route し、host-safe な workflow guidance を描画します。 |
|
|
432
|
-
| `Stop.default` | session stop | `src/cli/hook/stop-handler.ts` (in-process handler) | handoff を finalize し、未解決の draft-plan や completion evidence の gap を残したまま終了しないよう防ぎます。 |
|
|
433
|
-
|
|
434
|
-
Codex はさらに、3 本の Codex 専用 bounded-delegation route —
|
|
435
|
-
`UserPromptSubmit.delegation`、`SubagentStart.context`、`SubagentStop.quality`
|
|
436
|
-
— をインストールし、すべて `src/cli/hook/subagent-handler.ts` に bind
|
|
437
|
-
されます。Claude 側は共有の `PreToolUse.subagent` return-channel route だけを
|
|
438
|
-
保持します。
|
|
419
|
+
インストールされた adapter は 6 本の公開 hook route を bind します。Claude は 5 本、
|
|
420
|
+
Codex は 5 本をインストールします。`event + routeId + matcher` の
|
|
421
|
+
route tuple が安定した契約であり、各 tuple は exactly one の typed in-process
|
|
422
|
+
handler に bind されます。Host 列つきの route 表は
|
|
423
|
+
[`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md#hook-authority-map) にあります。
|
|
439
424
|
|
|
440
425
|
`repo-harness-hook` とその typed handler registry が host-event の runtime
|
|
441
426
|
です。`~/.claude/settings.json` と `~/.codex/hooks.json` が user-level の
|
|
@@ -445,13 +430,14 @@ adapter であり、Codex は hooks が動く前に Settings でそのファイ
|
|
|
445
430
|
adapter config -> `repo-harness-hook` -> route registry -> typed handler の
|
|
446
431
|
順に確認してください。
|
|
447
432
|
|
|
448
|
-
hook が作業を block
|
|
449
|
-
`reason
|
|
450
|
-
`.ai/harness/failures/latest.jsonl`
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
433
|
+
hook が作業を block したときは、まず terminal 出力を読んでください。
|
|
434
|
+
`[<Guard>] <reason>` の行と `Fix:` の行が 1 行ずつ出ます。持続的な記録は
|
|
435
|
+
`.ai/harness/failures/latest.jsonl` にあり、`guard`、`reason`、`fix`、
|
|
436
|
+
`failure_class`、`run_id` を持ちます。`.ai/harness/runs/hook-events.jsonl` は
|
|
437
|
+
各 hook event を記録します。edit guard は `RepoScopeGuard`(リポジトリ外の
|
|
438
|
+
パス)、`ExternalReferenceGuard`(`_ref/`)、`OpsPrivateGuard`(`_ops/`)、
|
|
439
|
+
そして `ApplyPatchScopeGuard` と `EditScopeGuard`(解析できる対象パスがない)
|
|
440
|
+
です。完全な playbook は
|
|
455
441
|
[`docs/reference-configs/hook-operations.md`](docs/reference-configs/hook-operations.md)
|
|
456
442
|
を参照してください。
|
|
457
443
|
|
|
@@ -594,9 +580,11 @@ cd ~/Projects/repo-harness && bun src/cli/index.ts update
|
|
|
594
580
|
Claude/Codex skill path は `scripts/sync-codex-installed-copies.sh` によって
|
|
595
581
|
再構築される、symlink に裏打ちされた runtime entrypoint です。
|
|
596
582
|
|
|
597
|
-
`bun run check:ci` が唯一の CI-equivalent gate
|
|
598
|
-
`bun run check:release`
|
|
599
|
-
|
|
583
|
+
`bun run check:ci` が唯一の CI-equivalent gate です。
|
|
584
|
+
`bun run check:release` は npm の unpublished-version preflight の後に
|
|
585
|
+
`release` lane を実行します。この lane は高コスト gate 付きのテストと
|
|
586
|
+
tarball install smoke だけを実行します。2 回目の full suite でも CI gate
|
|
587
|
+
でもありません。release はその release SHA の CI が green であることを前提にします。
|
|
600
588
|
Runtime routing の回帰テストは保持します。旧 routing eval gate は廃止しました。
|
|
601
589
|
|
|
602
590
|
```bash
|
|
@@ -607,9 +595,8 @@ repo-harness docs show harness-overview
|
|
|
607
595
|
bun scripts/assemble-template.ts --plan C --name "MyProject"
|
|
608
596
|
```
|
|
609
597
|
|
|
610
|
-
Hook
|
|
611
|
-
`
|
|
612
|
-
使います。Reference docs は `assets/reference-configs/` 配下が canonical であり、
|
|
598
|
+
Hook handler の変更は `src/cli/hook/` を編集します。Operator helper は `scripts/` にあり、
|
|
599
|
+
`repo-harness run <helper>` で実行します。Reference docs は `assets/reference-configs/` 配下が canonical であり、
|
|
613
600
|
`docs/reference-configs/` へ投射されます。`bun run check:reference-configs`
|
|
614
601
|
がその投射を検証します。
|
|
615
602
|
|
|
@@ -645,8 +632,8 @@ commit script や hooks に組み込まないでください。
|
|
|
645
632
|
|
|
646
633
|
## 現在の Release
|
|
647
634
|
|
|
648
|
-
- npm package:`repo-harness@0.
|
|
649
|
-
- Generated workflow stamp:`repo-harness@0.
|
|
635
|
+
- npm package:`repo-harness@0.23.0`
|
|
636
|
+
- Generated workflow stamp:`repo-harness@0.23.0+template@0.23.0`
|
|
650
637
|
- GitHub repository:`Ancienttwo/repo-harness`
|
|
651
638
|
- Release notes and history:[`docs/CHANGELOG.md`](docs/CHANGELOG.md)
|
|
652
639
|
|