repo-harness 0.19.4 → 0.20.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 +55 -118
- package/CLAUDE.md +54 -118
- package/README.es.md +40 -66
- package/README.fr.md +39 -65
- package/README.ja.md +40 -64
- package/README.md +100 -80
- package/README.zh-CN.md +41 -58
- package/SKILL.md +19 -23
- package/agents/fleet/explorer.md +2 -2
- package/agents/fleet/fast-worker.md +3 -3
- package/agents/fleet/gatekeeper.md +13 -10
- package/agents/fleet/harness-evaluator.md +2 -2
- package/agents/fleet/root-cause-prover.md +17 -11
- package/assets/AGENTS.md +0 -54
- package/assets/CLAUDE.md +0 -54
- package/assets/herdr/webhook-notify/herdr-plugin.toml +10 -0
- package/assets/herdr/webhook-notify/notify.mjs +103 -0
- package/assets/hooks/AGENTS.md +1 -39
- package/assets/hooks/CLAUDE.md +1 -39
- package/assets/hooks/lib/workflow-state.sh +22 -340
- package/assets/partials/03-philosophy.partial.md +1 -1
- package/assets/partials/04-project-structure.partial.md +1 -1
- package/assets/partials/05-workflow.partial.md +5 -6
- package/assets/partials/07-footer.partial.md +2 -2
- package/assets/partials/08-orchestration.partial.md +14 -16
- package/assets/partials-agents/02-operating-mode.partial.md +5 -6
- package/assets/partials-agents/03-orchestration.partial.md +11 -10
- package/assets/partials-agents/04-task-protocol.partial.md +11 -12
- package/assets/partials-agents/06-quality-safety.partial.md +3 -3
- package/assets/partials-agents/08-deep-docs.partial.md +1 -1
- package/assets/pipeline-record.v2.schema.json +1216 -0
- package/assets/reference-configs/agentic-development-flow.md +19 -115
- package/assets/reference-configs/evaluator-rubric.md +1 -1
- package/assets/reference-configs/external-tooling.md +108 -32
- package/assets/reference-configs/global-working-rules.md +4 -1
- package/assets/reference-configs/handoff-protocol.md +6 -36
- package/assets/reference-configs/harness-overview.md +18 -15
- package/assets/reference-configs/heartbeat-triage.md +1 -1
- package/assets/reference-configs/herdr-notify.md +119 -0
- package/assets/reference-configs/hook-operations.md +3 -4
- package/assets/reference-configs/host-invariants.md +72 -0
- package/assets/reference-configs/minimal-change-hooks.md +10 -6
- package/assets/reference-configs/sprint-contracts.md +19 -503
- package/assets/skill-commands/manifest.json +270 -104
- package/assets/skill-commands/repo-harness-architecture/SKILL.md +10 -87
- package/assets/skill-commands/repo-harness-architecture/references/worker.md +86 -0
- package/assets/skill-commands/repo-harness-check/SKILL.md +20 -36
- package/assets/skill-commands/repo-harness-check/references/create.md +17 -0
- package/assets/skill-commands/repo-harness-check/references/review.md +13 -0
- package/assets/skill-commands/repo-harness-ship/SKILL.md +14 -30
- package/assets/skill-commands/repo-harness-ship/agents/openai.yaml +2 -0
- package/assets/skill-commands/repo-harness-ship/references/worker.md +17 -0
- package/assets/skill-version.json +6 -2
- package/assets/skills/obsidian-memory/SKILL.md +19 -86
- package/assets/skills/obsidian-memory/agents/openai.yaml +2 -0
- package/assets/skills/obsidian-memory/references/worker.md +44 -0
- package/assets/skills/repo-harness-chatgpt/SKILL.md +3 -6
- package/assets/skills/repo-harness-chatgpt/references/bridge.md +12 -13
- package/assets/skills/repo-harness-chatgpt/references/continue.md +1 -1
- package/assets/skills/repo-harness-cross-review/SKILL.md +16 -26
- package/assets/skills/repo-harness-cross-review/references/codex-mode.md +15 -37
- package/assets/skills/repo-harness-cross-review/references/generic-review.md +93 -0
- package/assets/skills/repo-harness-product/SKILL.md +10 -17
- package/assets/skills/repo-harness-product/references/prd.md +2 -2
- package/assets/skills/repo-harness-product/references/sprint.md +5 -5
- package/assets/skills/repo-harness-setup/SKILL.md +7 -6
- package/assets/skills/repo-harness-setup/references/init.md +1 -1
- package/assets/skills/repo-harness-test/SKILL.md +11 -20
- package/assets/skills/repo-harness-test/references/authoring.md +10 -24
- package/assets/skills/repo-harness-test/references/running.md +9 -9
- package/assets/templates/contract.template.md +4 -5
- package/assets/templates/helpers/acceptance-receipt.ts +308 -207
- package/assets/templates/helpers/architecture-event.ts +3 -3
- package/assets/templates/helpers/architecture-queue.sh +1 -1
- package/assets/templates/helpers/archive-workflow.sh +63 -29
- package/assets/templates/helpers/capability-config.ts +0 -32
- package/assets/templates/helpers/capture-plan.sh +23 -481
- package/assets/templates/helpers/check-agent-tooling.sh +1 -156
- package/assets/templates/helpers/check-task-sync.sh +16 -385
- package/assets/templates/helpers/check-task-workflow.sh +19 -1427
- package/assets/templates/helpers/classify-historical-plans.ts +2 -2
- package/assets/templates/helpers/contract-run.ts +23 -162
- package/assets/templates/helpers/contract-worktree-runtime.ts +20 -0
- package/assets/templates/helpers/contract-worktree.sh +96 -387
- package/assets/templates/helpers/ensure-task-workflow.sh +8 -1443
- package/assets/templates/helpers/harness-trace-grade.sh +1 -1
- package/assets/templates/helpers/heartbeat-triage.sh +3 -3
- package/assets/templates/helpers/install-agent-fleet.sh +19 -142
- package/assets/templates/helpers/merge-gate.ts +76 -387
- package/assets/templates/helpers/new-plan.sh +2 -6
- package/assets/templates/helpers/plan-to-todo.sh +15 -986
- package/assets/templates/helpers/prepare-handoff.sh +0 -2
- package/assets/templates/helpers/recovery-view-cli.ts +2 -7
- package/assets/templates/helpers/refresh-current-status.sh +9 -13
- package/assets/templates/helpers/ship-worktrees.sh +173 -200
- package/assets/templates/helpers/sprint-backlog.sh +87 -158
- package/assets/templates/helpers/verification-plan.ts +1 -1
- package/assets/templates/helpers/verify-contract.sh +35 -1288
- package/assets/templates/helpers/verify-sprint.sh +28 -1518
- package/assets/templates/helpers/workflow-contract.ts +1 -1
- package/assets/templates/helpers/workstream-sync.sh +1 -16
- package/assets/templates/implementation-notes.template.md +1 -1
- package/assets/templates/plan.template.md +2 -6
- package/assets/templates/review.template.md +1 -1
- package/assets/templates/runtime.gitignore +1 -1
- package/assets/workflow-contract.v1.json +1977 -19
- package/dist/hook-entry.js +15047 -15890
- package/dist/oar-review-host.js +322 -0
- package/dist/operator-ui/assets/index-DfN4Jl7j.js +9 -0
- package/dist/operator-ui/assets/{index-BtBBFakS.css → index-DgLzv92A.css} +1 -1
- package/dist/operator-ui/index.html +2 -2
- package/docs/repo-harness-chatgpt-browser-engine.md +0 -4
- package/package.json +25 -21
- package/references/handoff.md +3 -2
- package/references/workflow-packaging-rubric.md +3 -6
- package/scripts/AGENTS.md +1 -47
- package/scripts/CLAUDE.md +1 -47
- package/scripts/acceptance-receipt.ts +308 -207
- package/scripts/architecture-event.ts +3 -3
- package/scripts/architecture-queue.sh +1 -1
- package/scripts/archive-workflow.sh +63 -29
- package/scripts/assemble-template.ts +1 -27
- package/scripts/axr5-archctx-clean-room.ts +1 -1
- package/scripts/capability-config.ts +0 -32
- package/scripts/capture-plan.sh +23 -481
- package/scripts/check-agent-tooling.sh +1 -156
- package/scripts/check-ci.sh +42 -20
- package/scripts/check-npm-release.sh +1 -1
- package/scripts/check-tarball-install-smoke.sh +16 -2
- package/scripts/check-task-sync.sh +16 -385
- package/scripts/check-task-workflow.sh +19 -1427
- package/scripts/ci-documentation-consumers.ts +4 -10
- package/scripts/classify-historical-plans.ts +2 -2
- package/scripts/contract-run.ts +23 -162
- package/scripts/contract-worktree-runtime.ts +20 -0
- package/scripts/contract-worktree.sh +96 -387
- package/scripts/create-project-dirs.sh +0 -1
- package/scripts/ensure-task-workflow.sh +8 -1443
- package/scripts/harness-trace-grade.sh +1 -1
- package/scripts/heartbeat-triage.sh +3 -3
- package/scripts/init-project.sh +0 -22
- package/scripts/initializer-question-pack.ts +3 -25
- package/scripts/install-agent-fleet.sh +19 -142
- package/scripts/lib/ci-run-tests.sh +78 -10
- package/scripts/lib/project-init-lib.sh +21 -31
- package/scripts/lib/test-home-isolation.d.mts +7 -0
- package/scripts/lib/test-home-isolation.mjs +105 -0
- package/scripts/me2b-runtime-admission-canary.ts +6 -4
- package/scripts/merge-gate.ts +76 -387
- package/scripts/new-plan.sh +2 -6
- package/scripts/plan-to-todo.sh +15 -986
- package/scripts/prepare-handoff.sh +0 -2
- package/scripts/recovery-view-cli.ts +2 -7
- package/scripts/refresh-current-status.sh +9 -13
- package/scripts/report-ci.ts +242 -0
- package/scripts/run-harness-profile-benchmark.ts +5 -3
- package/scripts/run-skill-evals.ts +46 -98
- package/scripts/run-skill-routing-eval.ts +7 -7
- package/scripts/select-ci-coverage.ts +121 -53
- package/scripts/select-test-suite.ts +49 -0
- package/scripts/ship-worktrees.sh +173 -200
- package/scripts/skill-surface-select.ts +19 -2
- package/scripts/sprint-backlog.sh +87 -158
- package/scripts/sync-codex-installed-copies.sh +44 -40
- package/scripts/test-file-durations.json +398 -0
- package/scripts/verification-plan.ts +1 -1
- package/scripts/verify-contract.sh +35 -1288
- package/scripts/verify-sprint.sh +28 -1518
- package/scripts/workflow-contract.ts +1 -1
- package/scripts/workstream-sync.sh +1 -16
- package/src/cli/commands/automation.ts +7 -7
- package/src/cli/commands/engineer.ts +15 -11
- package/src/cli/commands/fleet.ts +0 -2
- package/src/cli/commands/global-runtime.ts +65 -11
- package/src/cli/commands/herdr.ts +200 -0
- package/src/cli/commands/init-hook.ts +7 -0
- package/src/cli/commands/init.ts +4 -80
- package/src/cli/commands/mcp.ts +7 -7
- package/src/cli/commands/pipeline.ts +45 -0
- package/src/cli/commands/prompt-guard-decision.ts +1 -1
- package/src/cli/commands/publication.ts +0 -5
- package/src/cli/commands/refactor.ts +1 -1
- package/src/cli/commands/review.ts +43 -0
- package/src/cli/commands/run.ts +2 -2
- package/src/cli/commands/state.ts +9 -25
- package/src/cli/commands/task-agent.ts +59 -0
- package/src/cli/commands/upgrade.ts +421 -0
- package/src/cli/commands/validators.ts +1 -17
- package/src/cli/hook/circuit-breaker.ts +3 -3
- package/src/cli/hook/command-observed.ts +2 -2
- package/src/cli/hook/event-telemetry.ts +79 -5
- package/src/cli/hook/mutation-guard.ts +16 -470
- package/src/cli/hook/mutation-observed.ts +25 -242
- package/src/cli/hook/prompt-guard-decision.ts +1 -0
- package/src/cli/hook/prompt-handler.ts +25 -764
- package/src/cli/hook/prompt-intents.ts +2 -2
- package/src/cli/hook/session-context.ts +0 -3
- package/src/cli/hook/stop-handler.ts +44 -433
- package/src/cli/hook/subagent-handler.ts +25 -35
- package/src/cli/index.ts +38 -148
- package/src/cli/installer/install-profile.ts +160 -13
- package/src/cli/installer/shared.ts +7 -3
- package/src/cli/mcp/coding-workspaces.ts +26 -3
- package/src/cli/mcp/engineer-tools.ts +16 -3
- package/src/cli/mcp/fleet-tools.ts +0 -2
- package/src/cli/mcp/instructions.ts +2 -2
- package/src/cli/mcp/policy.ts +8 -11
- package/src/cli/mcp/server.ts +0 -2
- package/src/cli/mcp/setup.ts +37 -18
- package/src/cli/mcp/tools.ts +93 -59
- package/src/core/adoption/managed-hook-config.ts +7 -2
- package/src/core/adoption/standard-plan.ts +39 -127
- package/src/core/architecture/projection.ts +3 -3
- package/src/core/automation/budget.ts +35 -472
- package/src/core/automation/projection.ts +3 -17
- package/src/core/engineers/AGENTS.md +1 -43
- package/src/core/engineers/CLAUDE.md +1 -43
- package/src/core/engineers/agent-runtime-effect.ts +2 -2
- package/src/core/engineers/principal-claim.ts +2 -2
- package/src/core/evidence/checkpoint.ts +4 -4
- package/src/core/evidence/redaction.ts +16 -2
- package/src/core/evidence/verification-plan.ts +4 -1
- package/src/core/operator/automation-summary.ts +4 -19
- package/src/core/operator/notify-status.ts +57 -0
- package/src/core/pipeline/board.ts +43 -0
- package/src/core/pipeline/gates.ts +27 -0
- package/src/core/pipeline/projection.ts +63 -0
- package/src/core/pipeline/stage-machine.ts +46 -0
- package/src/core/pipeline/types.ts +108 -0
- package/src/core/publication/merge-readiness.ts +50 -53
- package/src/core/publication/publication-lifecycle.ts +3 -3
- package/src/core/publication/publication-receipt.ts +30 -29
- package/src/core/refactor/policy.ts +1 -1
- package/src/core/review/change-assessment.ts +1 -1
- package/src/core/review/generic-review.ts +52 -0
- package/src/core/skill-surface/catalog.ts +35 -1
- package/src/core/state/artifact-parsers.ts +14 -2
- package/src/core/state/project-continuation-envelope.ts +0 -11
- package/src/core/state/project-effective-state.ts +29 -104
- package/src/core/state/types.ts +2 -2
- package/src/core/upgrade/legacy-inventory.ts +578 -0
- package/src/core/workflow/artifact-requirement-policy.ts +14 -71
- package/src/core/workflow/operation-readiness.ts +6 -46
- package/src/core/workflow/profile.ts +19 -29
- package/src/effects/architecture/archctx-provider.ts +44 -2
- package/src/effects/architecture/refresh-consumer.ts +5 -58
- package/src/effects/automation/budget-store.ts +31 -1124
- package/src/effects/automation/clock.ts +1 -1
- package/src/effects/automation/grant-store.ts +31 -20
- package/src/effects/collaboration/handoff-store.ts +3 -3
- package/src/effects/collaboration/signal-store.ts +3 -3
- package/src/effects/engineers/agent-runtime-effect-store.ts +2 -86
- package/src/effects/engineers/agent-runtime-feature.ts +3 -6
- package/src/effects/engineers/dependency-authority.ts +4 -4
- package/src/effects/engineers/principal.ts +1 -1
- package/src/effects/engineers/scheduling-acquire-next.ts +417 -106
- package/src/effects/engineers/task-freeze-store.ts +23 -31
- package/src/effects/evidence/attested-import.ts +7 -6
- package/src/effects/evidence/post-bash-importer.ts +6 -5
- package/src/effects/evidence/recovery-materializer.ts +4 -9
- package/src/effects/evidence/verification-execution.ts +129 -30
- package/src/effects/expensive-run-lock.ts +101 -5
- package/src/effects/fleet/acquire.ts +12 -50
- package/src/effects/fs-transaction.ts +1 -1
- package/src/effects/locking/exclusive-directory-lock.ts +24 -14
- package/src/effects/operator/automation-summary.ts +4 -55
- package/src/effects/operator/notify-status.ts +153 -0
- package/src/effects/operator/pipeline-status.ts +18 -0
- package/src/effects/operator/server.ts +43 -620
- package/src/effects/pipeline/authority.ts +140 -0
- package/src/effects/pipeline/ingest.ts +82 -0
- package/src/effects/pipeline/ledger.ts +177 -0
- package/src/effects/pipeline/read.ts +40 -0
- package/src/effects/pipeline/store.ts +187 -0
- package/src/effects/process-supervisor.ts +27 -16
- package/src/effects/publication/feedback.ts +15 -18
- package/src/effects/publication/merge-readiness.ts +192 -211
- package/src/effects/publication/publication-lifecycle.ts +72 -78
- package/src/effects/publication/publication-receipt.ts +61 -35
- package/src/effects/review/change-assessment.ts +2 -2
- package/src/effects/review/generic-review.ts +343 -0
- package/src/effects/review/oar-review-host.ts +183 -0
- package/src/effects/review/review-isolation.ts +177 -0
- package/src/effects/run-summary-retention.ts +2 -2
- package/src/effects/runtime/helper-runner.ts +3 -1
- package/src/effects/skill-tree-integrity.ts +54 -1
- package/src/effects/state/resolve-effective-state.ts +85 -27
- package/src/effects/terminal/herdr.ts +42 -5
- package/src/effects/terminal/task-role-profiles.ts +115 -0
- package/src/effects/terminal/task-session.ts +863 -0
- package/src/effects/terminal/task-worktree.ts +25 -0
- package/src/operator-web/App.tsx +16 -574
- package/src/operator-web/AutomationSummary.tsx +0 -21
- package/src/operator-web/NotifyStatus.tsx +72 -0
- package/src/operator-web/PipelineBoard.tsx +357 -0
- package/src/operator-web/fixture.ts +1 -8
- package/src/operator-web/i18n.ts +276 -20
- package/src/operator-web/styles.css +26 -29
- package/src/operator-web/types.ts +2 -1
- package/assets/initializer-question-pack.v1.json +0 -132
- package/assets/initializer-question-pack.v1.schema.json +0 -46
- package/assets/initializer-question-pack.v2.json +0 -174
- package/assets/initializer-question-pack.v3.json +0 -206
- package/assets/initializer-question-pack.v3.schema.json +0 -92
- package/assets/skill-hooks.json +0 -41
- package/assets/skills/auto-campaign/SKILL.md +0 -75
- package/assets/skills/auto-campaign/references/execution.md +0 -93
- package/assets/skills/auto-campaign/references/standard.json +0 -36
- package/assets/skills/auto-campaign/scripts/prepare-grant.ts +0 -39
- package/assets/skills/claude-plan/SKILL.md +0 -271
- package/assets/skills/repo-harness-chatgpt/references/campaign-issues.md +0 -24
- package/assets/skills/repo-harness-cross-review/references/claude-mode.md +0 -56
- package/assets/skills/repo-harness-cross-review/references/codex-plugin-mode.md +0 -55
- package/assets/skills/repo-harness-plan/SKILL.md +0 -26
- package/assets/skills/repo-harness-plan/references/create.md +0 -35
- package/assets/skills/repo-harness-plan/references/review.md +0 -30
- package/assets/templates/helpers/context-contract-sync.sh +0 -540
- package/dist/operator-ui/assets/index-f7BlYVSB.js +0 -9
- package/scripts/akn00-native-execution-admission.ts +0 -196
- package/scripts/axr6-stop-host-cycle.ts +0 -331
- package/scripts/axr7-build-flow-repair-proposal.ts +0 -44
- package/scripts/axr7-build-model-proposal.ts +0 -150
- package/scripts/axr7-build-selector-repair-proposal.ts +0 -50
- package/scripts/axr7-consumer-e2e.ts +0 -334
- package/scripts/benchmark-general-repo-reader.ts +0 -259
- package/scripts/build-campaign-image.sh +0 -15
- package/scripts/c9-collaboration-canary.ts +0 -683
- package/scripts/canary-global-hook.sh +0 -263
- package/scripts/cleanup-campaign-container.ts +0 -13
- package/scripts/context-contract-sync.sh +0 -540
- package/scripts/emit-verify-evidence.ts +0 -159
- package/scripts/hook-dispatch-diet-report.ts +0 -480
- package/scripts/lib/AGENTS.md +0 -13
- package/scripts/lib/CLAUDE.md +0 -13
- package/scripts/loop-engine-cutover-gate.ts +0 -324
- package/scripts/mcp-observability-report.ts +0 -460
- package/scripts/route-nl-vs-ts-eval.ts +0 -1098
- package/scripts/run-bdd2-evals.ts +0 -1368
- package/scripts/run-campaign-preflight.ts +0 -38
- package/scripts/run-debug-ground-truth-eval.ts +0 -633
- package/scripts/run-skill-hook.ts +0 -259
- package/scripts/session-context-packet-panel.ts +0 -560
- package/scripts/setup-plugins.sh +0 -43
- package/src/cli/commands/campaign.ts +0 -387
- package/src/cli/commands/claude-review.ts +0 -44
- package/src/cli/commands/cross-review.ts +0 -185
- package/src/cli/hook/legacy-active-plan-migration.ts +0 -88
- package/src/core/adoption/workflow-contract-plan.ts +0 -31
- package/src/core/automation/campaign-authoring-budget.ts +0 -154
- package/src/core/automation/campaign-browser-session.ts +0 -118
- package/src/core/automation/campaign-closeout.ts +0 -138
- package/src/core/automation/campaign-containment.ts +0 -161
- package/src/core/automation/campaign-fresh-audit.ts +0 -223
- package/src/core/automation/campaign-planning.ts +0 -98
- package/src/core/automation/campaign-revision-evidence.ts +0 -140
- package/src/core/automation/campaign-revision-observation.ts +0 -80
- package/src/core/automation/campaign-runtime.ts +0 -97
- package/src/core/automation/connector-challenge.ts +0 -74
- package/src/core/automation/development-campaign.ts +0 -211
- package/src/core/automation/issue-batch-adoption.ts +0 -107
- package/src/core/automation/issue-batch-reconcile.ts +0 -251
- package/src/core/automation/issue-batch.ts +0 -222
- package/src/core/review/claude-review.ts +0 -105
- package/src/core/review/cross-review.ts +0 -212
- package/src/core/state/artifact-repair.ts +0 -40
- package/src/effects/automation/campaign-acquisition.ts +0 -147
- package/src/effects/automation/campaign-authoring-resume.ts +0 -299
- package/src/effects/automation/campaign-capability-registry.ts +0 -39
- package/src/effects/automation/campaign-capacity.ts +0 -55
- package/src/effects/automation/campaign-closeout-provider.ts +0 -216
- package/src/effects/automation/campaign-closeout.ts +0 -197
- package/src/effects/automation/campaign-container.ts +0 -362
- package/src/effects/automation/campaign-fresh-audit.ts +0 -385
- package/src/effects/automation/campaign-not-planned.ts +0 -100
- package/src/effects/automation/campaign-planning-proof.ts +0 -163
- package/src/effects/automation/campaign-planning-store.ts +0 -84
- package/src/effects/automation/campaign-planning.ts +0 -178
- package/src/effects/automation/campaign-protection.ts +0 -37
- package/src/effects/automation/campaign-provider-execution.ts +0 -48
- package/src/effects/automation/campaign-recovery.ts +0 -230
- package/src/effects/automation/campaign-revision-admission.ts +0 -53
- package/src/effects/automation/campaign-revision-observation.ts +0 -116
- package/src/effects/automation/campaign-runtime.ts +0 -195
- package/src/effects/automation/campaign-step.ts +0 -584
- package/src/effects/automation/campaign-worker.ts +0 -535
- package/src/effects/automation/development-campaign-policy.ts +0 -121
- package/src/effects/automation/development-campaign-store.ts +0 -427
- package/src/effects/automation/gpt-pro-issue-authoring.ts +0 -362
- package/src/effects/automation/issue-batch-adoption.ts +0 -308
- package/src/effects/automation/issue-batch-observer.ts +0 -191
- package/src/effects/automation/issue-batch-publication.ts +0 -133
- package/src/effects/automation/issue-batch-shadow-adoption.ts +0 -77
- package/src/effects/automation/issue-batch-store.ts +0 -249
- package/src/effects/engineers/agent-runtime-adapters/codex-app-thread.ts +0 -21
- package/src/effects/evidence/checks-materializer.ts +0 -287
- package/src/effects/evidence/verify-producer.ts +0 -361
- package/src/effects/fleet/task-message-request.ts +0 -230
- package/src/effects/operator/task-message-process.ts +0 -56
- package/src/effects/review/claude-review-host.ts +0 -165
- package/src/effects/review/claude-review-session.ts +0 -423
- package/src/effects/review/codex-plugin-provider.ts +0 -406
- package/src/effects/review/cross-review-runner.ts +0 -386
- package/src/effects/state/artifact-repair-store.ts +0 -46
package/AGENTS.md
CHANGED
|
@@ -1,120 +1,57 @@
|
|
|
1
|
-
# repo-harness
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- `.
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- `docs/architecture/index.md` for umbrella architecture status, drift requests, snapshots, and diagram links
|
|
20
|
-
- `docs/reference-configs/agentic-development-flow.md` for parent-agent/Waza routing and P1/P2/P3 rules
|
|
21
|
-
|
|
22
|
-
## Operating Rules
|
|
23
|
-
|
|
24
|
-
- Sync `tasks/` whenever substantive repo changes are made.
|
|
25
|
-
- Use `tasks/notes/<plan-stem>.notes.md` only for non-obvious slice decisions, deviations, tradeoffs, and open questions; `<plan-stem>` is the active plan filename without `plan-` and `.md` (for example `20260531-0045-governance-workflow`). Do not use notes as durable memory or a task log, and archive/promote them deliberately when the slice closes.
|
|
26
|
-
- Treat hook execution as typed and user-level: `~/.claude/settings.json` and `~/.codex/hooks.json` invoke `repo-harness-hook`, whose route registry selects exactly one in-process handler. `.ai/hooks/lib/workflow-state.sh` is an operator-helper library, never a host-event dispatcher.
|
|
27
|
-
- Keep the umbrella hierarchy explicit: architecture owns stable truth, capability contracts own local agent context, `tasks/workstreams/<domain>/<capability>/` owns durable progress, and `tasks/todos.md` owns only deferred medium/long-term goals with tradeoff and revisit trigger.
|
|
28
|
-
- Treat `.archcontext/model/nodes/*.yaml` as the source of truth for capability prefixes under `capability_source: "archcontext"`; `agent-context-blocks.txt` and nested agent files are initialization inputs only, never runtime resolver authority.
|
|
29
|
-
- Keep architecture drift handling split: `architecture-queue.sh` writes architecture requests/events, `workstream-sync.sh` maintains durable capability workstreams, and `context-contract-sync.sh` only updates controlled local `CLAUDE.md`/`AGENTS.md` architecture blocks.
|
|
30
|
-
- Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
|
|
31
|
-
- Keep `CLAUDE.md` and `AGENTS.md` short; put detailed guidance in `docs/reference-configs/`.
|
|
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. When a brain root is configured, a durable conclusion worth reusing across projects may additionally be projected into the vault through an explicit `obsidian-memory` persist call; the vault layer is optional and never a prerequisite for closing a workflow. `.rgignore` hides archived workflow artifacts and runtime evidence from default `rg` searches; use explicit paths or `rg -uu` for audits.
|
|
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/`.
|
|
36
|
-
- Treat `deploy/` as the trackable deployment and operations surface for runbooks, submission materials, release checklists, helper scripts, ordered SQL files, and env examples; follow `.ai/harness/policy.json#operations.deploy_sql` for configured SQL roots and naming modes, otherwise keep SQL directly under `deploy/sql/` with 4-digit ascending prefixes.
|
|
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/*`.
|
|
38
|
-
- Treat contract-level task execution as worktree-first: `repo-harness run plan-to-todo --plan <approved-plan>` starts `repo-harness run contract-worktree start --plan <approved-plan>` when policy enables it, and completed blocks finish through Waza `/check` plus `repo-harness run contract-worktree finish`.
|
|
39
|
-
- Treat the EXECUTION_BOUNDARY anti-extras clause as mandatory exactly once in each delegated runner's final rendered task packet: absent requirements are forbidden design space, not permission to improve, and unrequested extras fail closed. Each runner path names one injection owner and no other surface on that path may carry the clause — the Codex native-child path is owned by `SubagentStart.context` (contract- and writability-aware; generated personas and the delegation advisor carry none), the standalone contract worker path by its worker prompt, and the MCP path by the `codex-goal` document. Composed-path tests verify the count.
|
|
40
|
-
- After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `repo-harness run capture-plan --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 `repo-harness run plan-to-todo --plan <active-plan>`.
|
|
41
|
-
- 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.
|
|
42
|
-
- 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.
|
|
43
|
-
- Route product discovery and complex/design planning to the parent agent: use `geju` for pre-contract framing, complete P1/P2/P3 with the parent agent's own capabilities, and freeze the accepted direction into the plan and contract. Route daily small/medium planning, bug hunts, and checks to Waza `/think`, `/hunt`, and `/check`. Route a proactive multi-direction visual/UX choice mid-task to the design-options convention (`repo-harness docs show design-options`).
|
|
44
|
-
- Codex automation profile is runtime-referenced, not vendored: required skills are `health`, `check`, and `mermaid` from `~/.codex/skills`.
|
|
45
|
-
- Keep durable repo knowledge in `docs/researches/`, `tasks/lessons.md`, and the canonical workflow artifacts.
|
|
46
|
-
- Treat `.ai/harness/brain-manifest.json` and `repo-harness run sync-brain-docs` as explicit operator-invoked export surfaces only; hooks and workflow checks must not read, write, or gate on external brain-vault state.
|
|
47
|
-
- Treat Waza as Codex-first: `~/.codex/skills` is the Codex runtime source; `~/.agents/skills` is skills CLI staging/cache only. The managed skills are `think`, `hunt`, `check`, and `health`; stage upstream Waza, copy their complete skill directories and shared rules into Codex, and verify with `diff`/`cmp` as described in `docs/reference-configs/external-tooling.md`.
|
|
48
|
-
- Use `docs/reference-configs/external-tooling.md` and `bash scripts/check-agent-tooling.sh --host both --check-updates` for environment checks; this self-host repo vendors CodeGraph as a dev dependency while generated downstream repos keep the global MCP default unless local policy opts in.
|
|
49
|
-
- When changing adoption planner or transaction code, verify `repo-harness init --repo . --dry-run` and a fixture apply use the same TS operation model.
|
|
50
|
-
- Treat repo-local `.claude/settings.json` and `.codex/hooks.json` hook adapters as retired legacy config; migration may back them up locally, but they are not product deliverables.
|
|
1
|
+
# repo-harness
|
|
2
|
+
|
|
3
|
+
## Workflow
|
|
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
|
+
- Keep root CLAUDE.md and AGENTS.md as standalone regular files; repeat shared rules in both and keep host-specific guidance separate.
|
|
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
|
+
- 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
|
+
- 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
|
+
- Keep four hard boundaries: main publication, deletion, credentials/permissions, and release/production operations.
|
|
10
|
+
- 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. Tag authorized publication and record `git revert <squash-commit>` plus the daily report.
|
|
11
|
+
- 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.
|
|
12
|
+
- Use gatekeeper/cross-model review for large changes, security/permissions, or unresolved model uncertainty; ordinary steps record diagnostics without approval loops.
|
|
13
|
+
- Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/external-tooling.md#herdr-dispatch).
|
|
14
|
+
- 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.
|
|
15
|
+
- 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).
|
|
16
|
+
- `.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.
|
|
17
|
+
- Preserve `agents/fleet/`, release checklists and downstream `assets/templates` / `assets/partials*`. Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` aligned.
|
|
18
|
+
- `_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/`.
|
|
51
19
|
|
|
52
20
|
## Code Optimization Principles
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- Functional block: `src/effects/automation`
|
|
91
|
-
- Capability ID: `runtime-harness-automation-budget`
|
|
92
|
-
- Matched prefix: `src/effects/automation`
|
|
93
|
-
- Architecture domain: `runtime-harness`
|
|
94
|
-
- Architecture capability: `automation-budget`
|
|
95
|
-
- Architecture module: `docs/architecture/modules/runtime-harness/automation-budget.md`
|
|
96
|
-
- Last architecture event: 2026-09-08T05:10:12+0800
|
|
97
|
-
- Last changed path: `src/effects/automation/campaign-capability-registry.ts`
|
|
98
|
-
- Severity: low
|
|
99
|
-
- Change type: source-change
|
|
100
|
-
- Module responsibility: Keep this block aligned with the local boundary described by surrounding human-owned context.
|
|
101
|
-
- Entrypoints: `src/effects/automation`
|
|
102
|
-
- Allowed dependencies: Follow root `AGENTS.md` / `CLAUDE.md` and this local contract.
|
|
103
|
-
- Forbidden dependencies: Do not cross sibling app/service/package boundaries without an architecture snapshot or explicit plan.
|
|
104
|
-
- Runtime path: `src/effects/automation`
|
|
105
|
-
- LSP/tooling profile: `typescript-lsp`
|
|
106
|
-
- Verification: Use root required checks plus local commands recorded in this capability contract.
|
|
107
|
-
- Latest snapshot: `(none yet)`
|
|
108
|
-
- Semantic diagram source: `docs/architecture/modules/runtime-harness/automation-budget.md`
|
|
109
|
-
- Pending architecture request: `(none)`
|
|
110
|
-
|
|
111
|
-
## Active Workstreams
|
|
112
|
-
|
|
113
|
-
- (none yet)
|
|
114
|
-
|
|
115
|
-
## Current Session Projection
|
|
116
|
-
|
|
117
|
-
- Durable progress lives under `tasks/workstreams/runtime-harness/automation-budget`.
|
|
118
|
-
- `tasks/current.md` is the ignored local derived status read model; it is not a live lock or task source.
|
|
119
|
-
- `tasks/todos.md` is the deferred-goal ledger; current execution slices stay in the active plan's `## Task Breakdown`.
|
|
120
|
-
<!-- END ARCHITECTURE CONTRACT -->
|
|
21
|
+
- Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
|
|
22
|
+
- Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
|
|
23
|
+
- Do not add steady-state compatibility code, dual authority, semantic fallbacks, aliases or shadow parsers; one-shot migrations fail closed and remove the retired path.
|
|
24
|
+
- Share components only for observed reuse or a cross-module invariant. Use an existing workspace only for independently meaningful consumers; do not convert this single-package repo without that boundary.
|
|
25
|
+
- Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers.
|
|
26
|
+
- Never satisfy a requirement with a substitute that only looks compliant (mocks, hard-coded values, images posing as the real thing); say what cannot be done and flag the deviation in the PR.
|
|
27
|
+
- Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
|
|
28
|
+
|
|
29
|
+
## Testing
|
|
30
|
+
- Run `bun run check:type` plus tests covering the changed behavior once after the implementation is stable.
|
|
31
|
+
- Use `bun run test:files <affected tests> --timeout 60000 --max-concurrency 1`; extend existing coverage before creating a new test file.
|
|
32
|
+
- Select tests by observable risk and owning runtime boundary, including error/recovery paths when affected.
|
|
33
|
+
- Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting.
|
|
34
|
+
- Reviewers consume the recorded command, result, revision and environment; they do not rerun passing checks to claim ownership.
|
|
35
|
+
- Changed inputs or a new uncovered failure justify affected delta checks; an old pass is only historical evidence for its old subject.
|
|
36
|
+
- Run the full suite daily; a failure opens an automatic repair task and appears in the daily report.
|
|
37
|
+
- Isolate mutable HOME, repositories and process state; use real synchronization signals and preserve complete failure output.
|
|
38
|
+
- Report failed, timed-out, incomplete or omitted coverage explicitly; do not manufacture receipts, waiver files or pre-fix logs.
|
|
39
|
+
- Never modify or delete test assertions just to make tests pass; justify every necessary test change item by item in the PR description.
|
|
40
|
+
|
|
41
|
+
## Handoff
|
|
42
|
+
- Create a checkpoint only when context/session rollover or unresolved work needs it; ordinary completion stays in the PR description.
|
|
43
|
+
- Read files named in the current request before recovery context.
|
|
44
|
+
- Record the goal, branch/worktree/HEAD, decisions, touched files, verification results, blockers and one exact next command.
|
|
45
|
+
- Keep temporary checkpoints under ignored `.ai/harness/handoff/`; historical snapshots are not current execution authority.
|
|
46
|
+
- Include evidence paths and actual command outcomes; distinguish observed state from inference.
|
|
47
|
+
- Never include secrets, tokens or real environment files in handoff text.
|
|
48
|
+
- On resume, verify the live checkout and source artifacts before reusing a result; `tasks/current.md` is an optional local read model.
|
|
49
|
+
- Preserve dirty work and other workers' edits; hand back an ownership conflict instead of discarding their changes.
|
|
50
|
+
|
|
51
|
+
## Codex
|
|
52
|
+
- Own backend implementation and testing; Claude owns frontend implementation and interaction, and the parent coordinates scope and integration.
|
|
53
|
+
- User-level `~/.codex/hooks.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Repo-local hook adapters are retired; `.ai/hooks/lib/workflow-state.sh` is an operator helper.
|
|
54
|
+
- 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.
|
|
55
|
+
- The Codex automation profile requires runtime-provided `health`, `check` and `mermaid`; do not vendor their bodies.
|
|
56
|
+
- Treat auto-compact as a fallback; prepare ignored `.ai/harness/handoff/current.md` and `resume.md` when long-task rollover is needed.
|
|
57
|
+
- 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/CLAUDE.md
CHANGED
|
@@ -1,120 +1,56 @@
|
|
|
1
|
-
# repo-harness
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- `.
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- `docs/architecture/index.md` for umbrella architecture status, drift requests, snapshots, and diagram links
|
|
20
|
-
- `docs/reference-configs/agentic-development-flow.md` for parent-agent/Waza routing and P1/P2/P3 rules
|
|
21
|
-
|
|
22
|
-
## Operating Rules
|
|
23
|
-
|
|
24
|
-
- Sync `tasks/` whenever substantive repo changes are made.
|
|
25
|
-
- Use `tasks/notes/<plan-stem>.notes.md` only for non-obvious slice decisions, deviations, tradeoffs, and open questions; `<plan-stem>` is the active plan filename without `plan-` and `.md` (for example `20260531-0045-governance-workflow`). Do not use notes as durable memory or a task log, and archive/promote them deliberately when the slice closes.
|
|
26
|
-
- Treat hook execution as typed and user-level: `~/.claude/settings.json` and `~/.codex/hooks.json` invoke `repo-harness-hook`, whose route registry selects exactly one in-process handler. `.ai/hooks/lib/workflow-state.sh` is an operator-helper library, never a host-event dispatcher.
|
|
27
|
-
- Keep the umbrella hierarchy explicit: architecture owns stable truth, capability contracts own local agent context, `tasks/workstreams/<domain>/<capability>/` owns durable progress, and `tasks/todos.md` owns only deferred medium/long-term goals with tradeoff and revisit trigger.
|
|
28
|
-
- Treat `.archcontext/model/nodes/*.yaml` as the source of truth for capability prefixes under `capability_source: "archcontext"`; `agent-context-blocks.txt` and nested agent files are initialization inputs only, never runtime resolver authority.
|
|
29
|
-
- Keep architecture drift handling split: `architecture-queue.sh` writes architecture requests/events, `workstream-sync.sh` maintains durable capability workstreams, and `context-contract-sync.sh` only updates controlled local `CLAUDE.md`/`AGENTS.md` architecture blocks.
|
|
30
|
-
- Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` in sync.
|
|
31
|
-
- Keep `CLAUDE.md` and `AGENTS.md` short; put detailed guidance in `docs/reference-configs/`.
|
|
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. When a brain root is configured, a durable conclusion worth reusing across projects may additionally be projected into the vault through an explicit `obsidian-memory` persist call; the vault layer is optional and never a prerequisite for closing a workflow. `.rgignore` hides archived workflow artifacts and runtime evidence from default `rg` searches; use explicit paths or `rg -uu` for audits.
|
|
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/`.
|
|
36
|
-
- Treat `deploy/` as the trackable deployment and operations surface for runbooks, submission materials, release checklists, helper scripts, ordered SQL files, and env examples; follow `.ai/harness/policy.json#operations.deploy_sql` for configured SQL roots and naming modes, otherwise keep SQL directly under `deploy/sql/` with 4-digit ascending prefixes.
|
|
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/*`.
|
|
38
|
-
- Treat contract-level task execution as worktree-first: `repo-harness run plan-to-todo --plan <approved-plan>` starts `repo-harness run contract-worktree start --plan <approved-plan>` when policy enables it, and completed blocks finish through Waza `/check` plus `repo-harness run contract-worktree finish`.
|
|
39
|
-
- Treat the EXECUTION_BOUNDARY anti-extras clause as mandatory exactly once in each delegated runner's final rendered task packet: absent requirements are forbidden design space, not permission to improve, and unrequested extras fail closed. Each runner path names one injection owner and no other surface on that path may carry the clause — the Codex native-child path is owned by `SubagentStart.context` (contract- and writability-aware; generated personas and the delegation advisor carry none), the standalone contract worker path by its worker prompt, and the MCP path by the `codex-goal` document. Composed-path tests verify the count.
|
|
40
|
-
- After Codex Plan mode, Waza `/think`, or `repo-harness-plan` produces a decision-complete work-package plan, capture it with `repo-harness run capture-plan --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 `repo-harness run plan-to-todo --plan <active-plan>`.
|
|
41
|
-
- 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.
|
|
42
|
-
- 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.
|
|
43
|
-
- Route product discovery and complex/design planning to the parent agent: use `geju` for pre-contract framing, complete P1/P2/P3 with the parent agent's own capabilities, and freeze the accepted direction into the plan and contract. Route daily small/medium planning, bug hunts, and checks to Waza `/think`, `/hunt`, and `/check`. Route a proactive multi-direction visual/UX choice mid-task to the design-options convention (`repo-harness docs show design-options`).
|
|
44
|
-
- Codex automation profile is runtime-referenced, not vendored: required skills are `health`, `check`, and `mermaid` from `~/.codex/skills`.
|
|
45
|
-
- Keep durable repo knowledge in `docs/researches/`, `tasks/lessons.md`, and the canonical workflow artifacts.
|
|
46
|
-
- Treat `.ai/harness/brain-manifest.json` and `repo-harness run sync-brain-docs` as explicit operator-invoked export surfaces only; hooks and workflow checks must not read, write, or gate on external brain-vault state.
|
|
47
|
-
- Treat Waza as Codex-first: `~/.codex/skills` is the Codex runtime source; `~/.agents/skills` is skills CLI staging/cache only. The managed skills are `think`, `hunt`, `check`, and `health`; stage upstream Waza, copy their complete skill directories and shared rules into Codex, and verify with `diff`/`cmp` as described in `docs/reference-configs/external-tooling.md`.
|
|
48
|
-
- Use `docs/reference-configs/external-tooling.md` and `bash scripts/check-agent-tooling.sh --host both --check-updates` for environment checks; this self-host repo vendors CodeGraph as a dev dependency while generated downstream repos keep the global MCP default unless local policy opts in.
|
|
49
|
-
- When changing adoption planner or transaction code, verify `repo-harness init --repo . --dry-run` and a fixture apply use the same TS operation model.
|
|
50
|
-
- Treat repo-local `.claude/settings.json` and `.codex/hooks.json` hook adapters as retired legacy config; migration may back them up locally, but they are not product deliverables.
|
|
1
|
+
# repo-harness
|
|
2
|
+
|
|
3
|
+
## Workflow
|
|
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
|
+
- Keep root CLAUDE.md and AGENTS.md as standalone regular files; repeat shared rules in both and keep host-specific guidance separate.
|
|
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
|
+
- 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
|
+
- 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
|
+
- Keep four hard boundaries: main publication, deletion, credentials/permissions, and release/production operations.
|
|
10
|
+
- 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. Tag authorized publication and record `git revert <squash-commit>` plus the daily report.
|
|
11
|
+
- 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.
|
|
12
|
+
- Use gatekeeper/cross-model review for large changes, security/permissions, or unresolved model uncertainty; ordinary steps record diagnostics without approval loops.
|
|
13
|
+
- Model division and cross-model dispatch/review follow [Herdr Dispatch](docs/reference-configs/external-tooling.md#herdr-dispatch).
|
|
14
|
+
- 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.
|
|
15
|
+
- 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).
|
|
16
|
+
- `.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.
|
|
17
|
+
- Preserve `agents/fleet/`, release checklists and downstream `assets/templates` / `assets/partials*`. Keep `assets/workflow-contract.v1.json` and `.ai/harness/workflow-contract.json` aligned.
|
|
18
|
+
- `_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/`.
|
|
51
19
|
|
|
52
20
|
## Code Optimization Principles
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- Functional block: `src/effects/automation`
|
|
91
|
-
- Capability ID: `runtime-harness-automation-budget`
|
|
92
|
-
- Matched prefix: `src/effects/automation`
|
|
93
|
-
- Architecture domain: `runtime-harness`
|
|
94
|
-
- Architecture capability: `automation-budget`
|
|
95
|
-
- Architecture module: `docs/architecture/modules/runtime-harness/automation-budget.md`
|
|
96
|
-
- Last architecture event: 2026-09-08T05:10:12+0800
|
|
97
|
-
- Last changed path: `src/effects/automation/campaign-capability-registry.ts`
|
|
98
|
-
- Severity: low
|
|
99
|
-
- Change type: source-change
|
|
100
|
-
- Module responsibility: Keep this block aligned with the local boundary described by surrounding human-owned context.
|
|
101
|
-
- Entrypoints: `src/effects/automation`
|
|
102
|
-
- Allowed dependencies: Follow root `AGENTS.md` / `CLAUDE.md` and this local contract.
|
|
103
|
-
- Forbidden dependencies: Do not cross sibling app/service/package boundaries without an architecture snapshot or explicit plan.
|
|
104
|
-
- Runtime path: `src/effects/automation`
|
|
105
|
-
- LSP/tooling profile: `typescript-lsp`
|
|
106
|
-
- Verification: Use root required checks plus local commands recorded in this capability contract.
|
|
107
|
-
- Latest snapshot: `(none yet)`
|
|
108
|
-
- Semantic diagram source: `docs/architecture/modules/runtime-harness/automation-budget.md`
|
|
109
|
-
- Pending architecture request: `(none)`
|
|
110
|
-
|
|
111
|
-
## Active Workstreams
|
|
112
|
-
|
|
113
|
-
- (none yet)
|
|
114
|
-
|
|
115
|
-
## Current Session Projection
|
|
116
|
-
|
|
117
|
-
- Durable progress lives under `tasks/workstreams/runtime-harness/automation-budget`.
|
|
118
|
-
- `tasks/current.md` is the ignored local derived status read model; it is not a live lock or task source.
|
|
119
|
-
- `tasks/todos.md` is the deferred-goal ledger; current execution slices stay in the active plan's `## Task Breakdown`.
|
|
120
|
-
<!-- END ARCHITECTURE CONTRACT -->
|
|
21
|
+
- Identify observable conditions, controllable inputs, the invariant and the actual pressure point before changing structure.
|
|
22
|
+
- Keep one source of truth for each datum; other representations are deterministic projections with drift checks.
|
|
23
|
+
- Do not add steady-state compatibility code, dual authority, semantic fallbacks, aliases or shadow parsers; one-shot migrations fail closed and remove the retired path.
|
|
24
|
+
- Share components only for observed reuse or a cross-module invariant. Use an existing workspace only for independently meaningful consumers; do not convert this single-package repo without that boundary.
|
|
25
|
+
- Prefer platform/standard-library features, then installed dependencies, and the smallest direct implementation; shrink obsolete code before adding layers.
|
|
26
|
+
- Never satisfy a requirement with a substitute that only looks compliant (mocks, hard-coded values, images posing as the real thing); say what cannot be done and flag the deviation in the PR.
|
|
27
|
+
- Self-review before committing: remove dead code, empty branches and debug leftovers, and split functions by responsibility instead of one large block.
|
|
28
|
+
|
|
29
|
+
## Testing
|
|
30
|
+
- Run `bun run check:type` plus tests covering the changed behavior once after the implementation is stable.
|
|
31
|
+
- Use `bun run test:files <affected tests> --timeout 60000 --max-concurrency 1`; extend existing coverage before creating a new test file.
|
|
32
|
+
- Select tests by observable risk and owning runtime boundary, including error/recovery paths when affected.
|
|
33
|
+
- Mechanical prose changes need link/scope validation, not new product tests; do not test incidental formatting.
|
|
34
|
+
- Reviewers consume the recorded command, result, revision and environment; they do not rerun passing checks to claim ownership.
|
|
35
|
+
- Changed inputs or a new uncovered failure justify affected delta checks; an old pass is only historical evidence for its old subject.
|
|
36
|
+
- Run the full suite daily; a failure opens an automatic repair task and appears in the daily report.
|
|
37
|
+
- Isolate mutable HOME, repositories and process state; use real synchronization signals and preserve complete failure output.
|
|
38
|
+
- Report failed, timed-out, incomplete or omitted coverage explicitly; do not manufacture receipts, waiver files or pre-fix logs.
|
|
39
|
+
- Never modify or delete test assertions just to make tests pass; justify every necessary test change item by item in the PR description.
|
|
40
|
+
|
|
41
|
+
## Handoff
|
|
42
|
+
- Create a checkpoint only when context/session rollover or unresolved work needs it; ordinary completion stays in the PR description.
|
|
43
|
+
- Read files named in the current request before recovery context.
|
|
44
|
+
- Record the goal, branch/worktree/HEAD, decisions, touched files, verification results, blockers and one exact next command.
|
|
45
|
+
- Keep temporary checkpoints under ignored `.ai/harness/handoff/`; historical snapshots are not current execution authority.
|
|
46
|
+
- Include evidence paths and actual command outcomes; distinguish observed state from inference.
|
|
47
|
+
- Never include secrets, tokens or real environment files in handoff text.
|
|
48
|
+
- On resume, verify the live checkout and source artifacts before reusing a result; `tasks/current.md` is an optional local read model.
|
|
49
|
+
- Preserve dirty work and other workers' edits; hand back an ownership conflict instead of discarding their changes.
|
|
50
|
+
|
|
51
|
+
## Claude Code
|
|
52
|
+
- Own frontend implementation and interaction; Codex owns backend implementation and testing, and the parent coordinates scope and integration.
|
|
53
|
+
- Use Claude Code's available tools within granted permissions; changes to tool grants, hooks or confirmation bypass require approval of the exact change.
|
|
54
|
+
- User-level `~/.claude/settings.json` hooks invoke `repo-harness-hook`; its typed route registry selects one in-process handler. Repo-local hook adapters are retired; `.ai/hooks/lib/workflow-state.sh` is an operator helper.
|
|
55
|
+
- Write comments, commits and PR text from the final diff; comments explain non-obvious reasons, and PRs describe final behavior and material rationale.
|
|
56
|
+
- 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.
|