@tea-agent/loop-agent 0.1.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 +121 -0
- package/CHANGELOG.md +37 -0
- package/README.md +144 -0
- package/bin/loop-agent.js +21 -0
- package/dist/adapters/aimax.js +91 -0
- package/dist/adapters/context.js +32 -0
- package/dist/adapters/index.js +28 -0
- package/dist/adapters/loop-agent.js +98 -0
- package/dist/adapters/types.js +1 -0
- package/dist/cli/catalog.js +259 -0
- package/dist/cli/help.js +55 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/program.js +505 -0
- package/dist/cli.js +12 -0
- package/dist/commands/closeout.js +13 -0
- package/dist/commands/coverage-audit.js +14 -0
- package/dist/commands/cursor-prompt.js +222 -0
- package/dist/commands/cursor-worker.js +43 -0
- package/dist/commands/dag-approve.js +102 -0
- package/dist/commands/dag-final-verification.js +76 -0
- package/dist/commands/dag-init-hybrid.js +56 -0
- package/dist/commands/dag-reconcile-tasks.js +51 -0
- package/dist/commands/dag-reject.js +91 -0
- package/dist/commands/dag-report.js +177 -0
- package/dist/commands/dag-resume.js +34 -0
- package/dist/commands/dag-run-task.js +470 -0
- package/dist/commands/dag-validate.js +186 -0
- package/dist/commands/dag-workflow-compile.js +91 -0
- package/dist/commands/dag-workflow-plan.js +130 -0
- package/dist/commands/dag-workflow-validate.js +66 -0
- package/dist/commands/delegate.js +132 -0
- package/dist/commands/docs-archive.js +5 -0
- package/dist/commands/docs-audit.js +5 -0
- package/dist/commands/doctor.js +50 -0
- package/dist/commands/goal.js +92 -0
- package/dist/commands/handoff-check.js +5 -0
- package/dist/commands/harvest.js +44 -0
- package/dist/commands/inspect.js +11 -0
- package/dist/commands/instructions.js +195 -0
- package/dist/commands/knowledge.js +64 -0
- package/dist/commands/loop-benchmark.js +72 -0
- package/dist/commands/loop.js +241 -0
- package/dist/commands/new-task.js +5 -0
- package/dist/commands/pi-prompt.js +181 -0
- package/dist/commands/pi-reuse-benchmark.js +153 -0
- package/dist/commands/plan-list.js +5 -0
- package/dist/commands/promote-run.js +29 -0
- package/dist/commands/reference-index.js +16 -0
- package/dist/commands/run-dag.js +184 -0
- package/dist/commands/spine.js +38 -0
- package/dist/commands/stats.js +84 -0
- package/dist/commands/status.js +56 -0
- package/dist/commands/study-init.js +192 -0
- package/dist/commands/workflow.js +259 -0
- package/dist/commands/worktree-create.js +31 -0
- package/dist/commands/worktree-list.js +5 -0
- package/dist/commands/worktree-remove.js +26 -0
- package/dist/cursor-worker-entry.js +8 -0
- package/dist/executors/config-core.js +55 -0
- package/dist/executors/config.js +2 -0
- package/dist/executors/cursor-artifacts.js +33 -0
- package/dist/executors/cursor-execution-log.js +81 -0
- package/dist/executors/cursor-executor-artifacts.js +135 -0
- package/dist/executors/cursor-executor.js +468 -0
- package/dist/executors/cursor-run.js +115 -0
- package/dist/executors/cursor-tool.js +94 -0
- package/dist/executors/cursor-worker-client.js +213 -0
- package/dist/executors/cursor-worker-protocol.js +18 -0
- package/dist/executors/cursor-worker-server.js +54 -0
- package/dist/executors/cursor-worker.js +3 -0
- package/dist/executors/cursor.js +6 -0
- package/dist/executors/dag-cursor-executor.js +88 -0
- package/dist/executors/dag-pi-executor.js +322 -0
- package/dist/executors/dag-static-executor.js +45 -0
- package/dist/executors/dag.js +4 -0
- package/dist/executors/index.js +8 -0
- package/dist/executors/model-routing.js +60 -0
- package/dist/executors/pi-event-serializer.js +43 -0
- package/dist/executors/pi-executor.js +606 -0
- package/dist/executors/pi-reuse-benchmark.js +316 -0
- package/dist/executors/pi-runtime-reuse.js +29 -0
- package/dist/executors/pi-sdk-executor.js +255 -0
- package/dist/executors/pi-sdk.js +1 -0
- package/dist/executors/pi.js +3 -0
- package/dist/executors/shell-executor.js +300 -0
- package/dist/executors/shell-presets.js +47 -0
- package/dist/executors/shell-verification.js +251 -0
- package/dist/executors/shell-write-guard.js +126 -0
- package/dist/executors/shell.js +3 -0
- package/dist/executors/static.js +1 -0
- package/dist/governance/checks.js +434 -0
- package/dist/governance/harness.js +9 -0
- package/dist/governance/index.js +3 -0
- package/dist/governance/manifest-types.js +128 -0
- package/dist/governance/manifest.js +2 -0
- package/dist/governance/path-guard.js +69 -0
- package/dist/governance/path-guards.js +2 -0
- package/dist/governance/profiles.js +3 -0
- package/dist/governance/requirement-coverage.js +425 -0
- package/dist/governance/skill-safety.js +135 -0
- package/dist/governance/spine-audit.js +152 -0
- package/dist/records/closeout.js +2 -0
- package/dist/records/harvest.js +236 -0
- package/dist/records/index.js +3 -0
- package/dist/records/one-shot-runs.js +421 -0
- package/dist/records/promotion.js +199 -0
- package/dist/shared/artifacts-core.js +88 -0
- package/dist/shared/artifacts.js +2 -0
- package/dist/shared/context-files.js +32 -0
- package/dist/shared/context.js +2 -0
- package/dist/shared/copy-dir.js +17 -0
- package/dist/shared/git-progress.js +165 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/logger.js +23 -0
- package/dist/shared/one-shot-prompt-args.js +98 -0
- package/dist/shared/path-refs.js +31 -0
- package/dist/shared/prompts.js +26 -0
- package/dist/shared/reference-context.js +238 -0
- package/dist/shared/timeout-policy.js +19 -0
- package/dist/shared/timeout.js +1 -0
- package/dist/shared/types.js +5 -0
- package/dist/task/config-types.js +97 -0
- package/dist/task/config.js +2 -0
- package/dist/task/delegate.js +220 -0
- package/dist/task/goal-audit.js +51 -0
- package/dist/task/goal-policy.js +8 -0
- package/dist/task/goal.js +3 -0
- package/dist/task/ids.js +1 -0
- package/dist/task/index.js +9 -0
- package/dist/task/lifecycle.js +1 -0
- package/dist/task/paths.js +1 -0
- package/dist/task/read-model.js +149 -0
- package/dist/task/runtime.js +699 -0
- package/dist/task/source-state.js +1 -0
- package/dist/task/state.js +55 -0
- package/dist/task/subagent-guidance.js +1 -0
- package/dist/task/workflow-state-types.js +92 -0
- package/dist/task/worktree-cleanup.js +140 -0
- package/dist/task/worktree.js +171 -0
- package/dist/workflows/dag/authoring.js +8 -0
- package/dist/workflows/dag/authority-surface.js +138 -0
- package/dist/workflows/dag/canvas-observer.js +474 -0
- package/dist/workflows/dag/decision-envelope.js +502 -0
- package/dist/workflows/dag/decision-evidence.js +153 -0
- package/dist/workflows/dag/decision-gates.js +1 -0
- package/dist/workflows/dag/executor-registry.js +25 -0
- package/dist/workflows/dag/facts.js +4 -0
- package/dist/workflows/dag/failure-category.js +111 -0
- package/dist/workflows/dag/final-verification.js +180 -0
- package/dist/workflows/dag/governance-constants.js +5 -0
- package/dist/workflows/dag/governance-profile.js +405 -0
- package/dist/workflows/dag/index.js +6 -0
- package/dist/workflows/dag/init-hybrid.js +855 -0
- package/dist/workflows/dag/knowledge-curator.js +162 -0
- package/dist/workflows/dag/lifecycle.js +484 -0
- package/dist/workflows/dag/prompt-source.js +88 -0
- package/dist/workflows/dag/prompt.js +130 -0
- package/dist/workflows/dag/reconcile-tasks.js +404 -0
- package/dist/workflows/dag/recovery-recommendation.js +226 -0
- package/dist/workflows/dag/repair-artifact.js +136 -0
- package/dist/workflows/dag/report.js +1019 -0
- package/dist/workflows/dag/runner.js +1677 -0
- package/dist/workflows/dag/runtime.js +5 -0
- package/dist/workflows/dag/skill-instructions.js +471 -0
- package/dist/workflows/dag/skills.js +41 -0
- package/dist/workflows/dag/spec.js +3 -0
- package/dist/workflows/dag/topo.js +30 -0
- package/dist/workflows/dag/types.js +275 -0
- package/dist/workflows/dag/upstream-artifacts.js +95 -0
- package/dist/workflows/dag/validate.js +527 -0
- package/dist/workflows/dynamic/artifacts.js +65 -0
- package/dist/workflows/dynamic/compile.js +360 -0
- package/dist/workflows/dynamic/compileTypes.js +1 -0
- package/dist/workflows/dynamic/errors.js +5 -0
- package/dist/workflows/dynamic/index.js +7 -0
- package/dist/workflows/dynamic/profiles.js +156 -0
- package/dist/workflows/dynamic/spec.js +114 -0
- package/dist/workflows/dynamic/validate.js +275 -0
- package/dist/workflows/loop/actions.js +1334 -0
- package/dist/workflows/loop/benchmark.js +510 -0
- package/dist/workflows/loop/closeout.js +134 -0
- package/dist/workflows/loop/context.js +48 -0
- package/dist/workflows/loop/events.js +25 -0
- package/dist/workflows/loop/hash.js +32 -0
- package/dist/workflows/loop/index.js +8 -0
- package/dist/workflows/loop/paths.js +17 -0
- package/dist/workflows/loop/rounds.js +81 -0
- package/dist/workflows/loop/signals.js +55 -0
- package/dist/workflows/loop/state.js +116 -0
- package/dist/workflows/loop/templates.js +54 -0
- package/dist/workflows/loop/types.js +28 -0
- package/docs/README.md +62 -0
- package/docs/agent-dag-recovery-playbook.md +158 -0
- package/docs/agent-dag-runner.md +40 -0
- package/docs/cursor-executor-usage.md +25 -0
- package/docs/decisions/README.md +3 -0
- package/docs/design/README.md +36 -0
- package/docs/development-principles.md +71 -0
- package/docs/dynamic-workflow-dag-engine-roadmap.md +1749 -0
- package/docs/exec-plans/README.md +6 -0
- package/docs/exec-plans/active/README.md +5 -0
- package/docs/exec-plans/completed/README.md +5 -0
- package/docs/feature-workflow.md +184 -0
- package/docs/harness-methodology-debugging.md +153 -0
- package/docs/harness-methodology-tdd.md +130 -0
- package/docs/harness-methodology-verification.md +27 -0
- package/docs/loop-agent-harness.md +42 -0
- package/docs/progress/README.md +3 -0
- package/docs/reports/README.md +3 -0
- package/docs/templates/adr.md +60 -0
- package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -0
- package/docs/templates/agent-dag-decision-envelope.schema.json +213 -0
- package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -0
- package/docs/templates/agent-dag-decision-gate.prompt.md +246 -0
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -0
- package/docs/templates/agent-dag-report.schema.json +423 -0
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -0
- package/docs/templates/agent-dag.base.json +195 -0
- package/docs/templates/agent-dag.final-verification.json +190 -0
- package/docs/templates/agent-dag.schema.json +316 -0
- package/docs/templates/agent-dag.supervised-implementation.json +500 -0
- package/docs/templates/exec-plan.md +64 -0
- package/docs/templates/feature-spec.md +53 -0
- package/docs/templates/hybrid-dag.json +193 -0
- package/docs/templates/progress-log.md +17 -0
- package/docs/templates/project-start-checklist.md +9 -0
- package/docs/templates/qa-report.md +42 -0
- package/docs/templates/sprint-contract.md +29 -0
- package/docs/verification-matrix.md +30 -0
- package/examples/decision-gate-agent-dag.json +123 -0
- package/examples/example-dag.json +51 -0
- package/examples/hybrid-loop-agent-dag.json +194 -0
- package/harness.json +92 -0
- package/package.json +61 -0
- package/skills/ai-engineering-context/SKILL.md +48 -0
- package/skills/loop-agent/SKILL.md +260 -0
- package/skills/loop-agent/references/README.md +63 -0
- package/skills/loop-agent/references/command-reference.md +315 -0
- package/skills/loop-agent/references/harness-policy.md +258 -0
- package/skills/loop-agent/references/hybrid-dag.md +216 -0
- package/skills/loop-agent/references/learned/README.md +21 -0
- package/skills/loop-agent/references/model-routing.md +36 -0
- package/skills/loop-agent/references/multi-worktree.md +54 -0
- package/skills/loop-agent/references/one-shot-runs.md +85 -0
- package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -0
- package/skills/loop-agent/references/pi-prompt.md +23 -0
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +83 -0
- package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -0
- package/skills/loop-agent/references/task-workflow.md +84 -0
- package/skills/loop-agent/references/verification-and-failure-handling.md +74 -0
- package/skills/requesting-code-review/SKILL.md +101 -0
- package/skills/requesting-code-review/code-reviewer.md +168 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +296 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/verification-before-completion/SKILL.md +154 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./agent-dag.schema.json",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Agent DAG supervised implementation template",
|
|
5
|
+
"objective": "Demonstrate a reusable supervised implementation DAG: contract → parallel scouts → plan → write-set audit → write-set gate → implement → soft verify → process supervisor → repair → hard verify → review verdict → review gate → decision gate → closeout. Write-set, process, and review verdict nodes emit first-line VERDICT for deterministic gates, reducing main-session intervention.",
|
|
6
|
+
"successCriteria": [
|
|
7
|
+
"contract-pi returns a read-only implementation contract with narrow write boundaries",
|
|
8
|
+
"scout-src and scout-tests run in parallel without write conflicts",
|
|
9
|
+
"plan-pi produces a writeSet coverage matrix with explicit exclusive owners",
|
|
10
|
+
"write-set-audit-pi validates coverage and returns VERDICT pass or request-revision",
|
|
11
|
+
"write-set-gate-shell blocks implement-pi unless write-set-audit-pi first-line VERDICT is pass",
|
|
12
|
+
"implement-pi and repair-pi write only inside declared writeSet",
|
|
13
|
+
"soft-verify-shell archives focused test exit codes before process supervision",
|
|
14
|
+
"process-supervisor-pi returns first-line VERDICT pass or request-revision",
|
|
15
|
+
"process-gate-shell deterministically accepts valid supervisor verdicts",
|
|
16
|
+
"hard-verify-shell archives lint/typecheck/focused tests with active-DAG governance when check-repo runs",
|
|
17
|
+
"review-pi returns first-line VERDICT using review verdict prompt invariants",
|
|
18
|
+
"review-gate-shell blocks downstream nodes unless review VERDICT is pass",
|
|
19
|
+
"decision-pi returns DECISION_ENVELOPE_JSON without pausing runtime by default",
|
|
20
|
+
"closeout-pi summarizes evidence without writing files"
|
|
21
|
+
],
|
|
22
|
+
"globalConstraints": [
|
|
23
|
+
"Replace every REPLACE/WITH/... placeholder with concrete repo paths before execution; do not leave template placeholders in production DAG JSON.",
|
|
24
|
+
"Do not commit from DAG nodes; main session inspects and commits after Decision Gate approval.",
|
|
25
|
+
"Use only existing executors: pi, shell, static; cursor is optional when explicitly enabled. Pi writer nodes must set toolProfile=write.",
|
|
26
|
+
"Read-only nodes must not write repository files, including root artifacts/**.",
|
|
27
|
+
"Exclusive writer nodes must stay within declared writeSet.",
|
|
28
|
+
"Do not implement automatic retry/resume or mutate historical completed facts.",
|
|
29
|
+
"Do not create executor: supervisor; supervisor is a role on executor=pi.",
|
|
30
|
+
"Do not create executor: human, executor: decision, or browser executor.",
|
|
31
|
+
"Shell governance inside active DAG must use HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh.",
|
|
32
|
+
"On Windows, Bash script commands must run through Git Bash or a configured compatible Bash; do not require WSL or POSIX filesystem paths.",
|
|
33
|
+
"Actual file operation paths must be macOS/Windows compatible; use / only for stable repo refs, JSON/Markdown evidence refs, and glob conventions.",
|
|
34
|
+
"Prompt templates must not ask main session to write artifacts; node output is the artifact and runner archives it under .harness/dag-runs/.",
|
|
35
|
+
"Every task must explicitly declare executor; defaults.executor is schema-only and not a runtime fallback.",
|
|
36
|
+
"Prefer same-rank parallel read-only scouts over serial chains when outputs are independent.",
|
|
37
|
+
"Same-rank exclusive writeSet entries must be disjoint.",
|
|
38
|
+
"Use executorModels for model routing; do not add defaults.model or legacy top-level models."
|
|
39
|
+
],
|
|
40
|
+
"defaults": {
|
|
41
|
+
"executor": "pi",
|
|
42
|
+
"contextProfile": "slim",
|
|
43
|
+
"skills": [
|
|
44
|
+
"ai-engineering-context"
|
|
45
|
+
],
|
|
46
|
+
"writePolicy": "read-only"
|
|
47
|
+
},
|
|
48
|
+
"skillsByRole": {
|
|
49
|
+
"planner": [
|
|
50
|
+
"loop-agent"
|
|
51
|
+
],
|
|
52
|
+
"scout": [
|
|
53
|
+
"ai-engineering-context"
|
|
54
|
+
],
|
|
55
|
+
"implementer": [
|
|
56
|
+
"verification-before-completion"
|
|
57
|
+
],
|
|
58
|
+
"reviewer": [
|
|
59
|
+
"requesting-code-review",
|
|
60
|
+
"verification-before-completion"
|
|
61
|
+
],
|
|
62
|
+
"supervisor": [
|
|
63
|
+
"verification-before-completion",
|
|
64
|
+
"loop-agent"
|
|
65
|
+
],
|
|
66
|
+
"verifier": [
|
|
67
|
+
"verification-before-completion",
|
|
68
|
+
"systematic-debugging"
|
|
69
|
+
],
|
|
70
|
+
"closeout": [
|
|
71
|
+
"loop-agent",
|
|
72
|
+
"verification-before-completion"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"executorModels": {
|
|
76
|
+
"cursor": {
|
|
77
|
+
"LOW": "composer-2.5",
|
|
78
|
+
"MED": "composer-2.5",
|
|
79
|
+
"HIGH": "composer-2.5"
|
|
80
|
+
},
|
|
81
|
+
"pi": {
|
|
82
|
+
"LOW": "gpt-5.3-codex-spark",
|
|
83
|
+
"MED": "glm-5.2",
|
|
84
|
+
"HIGH": "gpt-5.5"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"verifyStrategy": {
|
|
88
|
+
"intermediateQuota": "1",
|
|
89
|
+
"finalQuota": "full",
|
|
90
|
+
"focusedCommandSource": "adapter"
|
|
91
|
+
},
|
|
92
|
+
"tasks": [
|
|
93
|
+
{
|
|
94
|
+
"id": "contract-pi",
|
|
95
|
+
"depends_on": [],
|
|
96
|
+
"complexity": "MED",
|
|
97
|
+
"executor": "pi",
|
|
98
|
+
"role": "planner",
|
|
99
|
+
"writePolicy": "read-only",
|
|
100
|
+
"allowedPaths": [
|
|
101
|
+
"**"
|
|
102
|
+
],
|
|
103
|
+
"forbiddenPaths": [
|
|
104
|
+
".harness/**",
|
|
105
|
+
"artifacts/**"
|
|
106
|
+
],
|
|
107
|
+
"outputContract": "Plain Markdown implementation contract: scope, risks, parallel scout opportunities, verification expectations. No file writes.",
|
|
108
|
+
"subtask_prompt": "Read the DAG objective and success criteria. Return a concise implementation contract covering scope, narrow write boundaries, risks, and verification expectations. Do not edit files or write root artifacts/**."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "scout-src",
|
|
112
|
+
"depends_on": [
|
|
113
|
+
"contract-pi"
|
|
114
|
+
],
|
|
115
|
+
"complexity": "LOW",
|
|
116
|
+
"executor": "pi",
|
|
117
|
+
"role": "scout",
|
|
118
|
+
"writePolicy": "read-only",
|
|
119
|
+
"allowedPaths": [
|
|
120
|
+
"REPLACE/WITH/SOURCE/PATH/**"
|
|
121
|
+
],
|
|
122
|
+
"forbiddenPaths": [
|
|
123
|
+
".harness/**",
|
|
124
|
+
"artifacts/**"
|
|
125
|
+
],
|
|
126
|
+
"outputContract": "Plain Markdown source reconnaissance summary; no file writes.",
|
|
127
|
+
"subtask_prompt": "Perform read-only source reconnaissance under allowedPaths. List relevant files, patterns, and risks. Do not edit files."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "scout-tests",
|
|
131
|
+
"depends_on": [
|
|
132
|
+
"contract-pi"
|
|
133
|
+
],
|
|
134
|
+
"complexity": "LOW",
|
|
135
|
+
"executor": "pi",
|
|
136
|
+
"role": "scout",
|
|
137
|
+
"writePolicy": "read-only",
|
|
138
|
+
"allowedPaths": [
|
|
139
|
+
"REPLACE/WITH/TEST/PATH/**"
|
|
140
|
+
],
|
|
141
|
+
"forbiddenPaths": [
|
|
142
|
+
".harness/**",
|
|
143
|
+
"artifacts/**"
|
|
144
|
+
],
|
|
145
|
+
"outputContract": "Plain Markdown test coverage reconnaissance summary; no file writes.",
|
|
146
|
+
"subtask_prompt": "Perform read-only test reconnaissance under allowedPaths. List relevant tests, coverage gaps, and focused verification commands. Do not edit files."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "plan-pi",
|
|
150
|
+
"depends_on": [
|
|
151
|
+
"scout-src",
|
|
152
|
+
"scout-tests"
|
|
153
|
+
],
|
|
154
|
+
"complexity": "MED",
|
|
155
|
+
"executor": "pi",
|
|
156
|
+
"role": "planner",
|
|
157
|
+
"writePolicy": "read-only",
|
|
158
|
+
"allowedPaths": [
|
|
159
|
+
"**"
|
|
160
|
+
],
|
|
161
|
+
"forbiddenPaths": [
|
|
162
|
+
".harness/**",
|
|
163
|
+
"artifacts/**"
|
|
164
|
+
],
|
|
165
|
+
"outputContract": "Plain Markdown plan with WriteSet Coverage Matrix (file → owning exclusive node id). No file writes.",
|
|
166
|
+
"subtask_prompt": "Synthesize upstream scouts into an implementation plan. Include a WriteSet Coverage Matrix table mapping each file that must change to exactly one future exclusive implementer/repair node id. Flag parallel work and verification commands. Do not edit files."
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "write-set-audit-pi",
|
|
170
|
+
"depends_on": [
|
|
171
|
+
"plan-pi"
|
|
172
|
+
],
|
|
173
|
+
"complexity": "MED",
|
|
174
|
+
"executor": "pi",
|
|
175
|
+
"role": "reviewer",
|
|
176
|
+
"writePolicy": "read-only",
|
|
177
|
+
"allowedPaths": [
|
|
178
|
+
"**"
|
|
179
|
+
],
|
|
180
|
+
"forbiddenPaths": [
|
|
181
|
+
".harness/**",
|
|
182
|
+
"artifacts/**"
|
|
183
|
+
],
|
|
184
|
+
"outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; includes writeSet coverage findings. No file writes.",
|
|
185
|
+
"subtask_prompt": "Audit plan-pi WriteSet Coverage Matrix against the contract. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. List Critical/Important gaps when any required file lacks a single exclusive owner or overlaps forbidden paths. Do not edit files or write root artifacts/**."
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"id": "write-set-gate-shell",
|
|
189
|
+
"depends_on": [
|
|
190
|
+
"write-set-audit-pi"
|
|
191
|
+
],
|
|
192
|
+
"complexity": "LOW",
|
|
193
|
+
"executor": "shell",
|
|
194
|
+
"role": "verifier",
|
|
195
|
+
"writePolicy": "read-only",
|
|
196
|
+
"allowedPaths": [
|
|
197
|
+
"**"
|
|
198
|
+
],
|
|
199
|
+
"forbiddenPaths": [
|
|
200
|
+
".harness/**",
|
|
201
|
+
"artifacts/**"
|
|
202
|
+
],
|
|
203
|
+
"outputContract": "Deterministic write-set audit verdict gate: exit 0 only when write-set-audit-pi first non-empty assistant output line is pass.",
|
|
204
|
+
"subtask_prompt": "Deterministic gate: block implement-pi unless write-set-audit-pi emitted VERDICT: pass.",
|
|
205
|
+
"shell": {
|
|
206
|
+
"verdictGate": {
|
|
207
|
+
"fromNodeId": "write-set-audit-pi",
|
|
208
|
+
"accept": [
|
|
209
|
+
"VERDICT: pass"
|
|
210
|
+
],
|
|
211
|
+
"label": "write-set audit",
|
|
212
|
+
"lineMode": "first-verdict-line"
|
|
213
|
+
},
|
|
214
|
+
"cwd": ".",
|
|
215
|
+
"timeoutMs": 60000
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "implement-pi",
|
|
220
|
+
"depends_on": [
|
|
221
|
+
"write-set-gate-shell"
|
|
222
|
+
],
|
|
223
|
+
"complexity": "HIGH",
|
|
224
|
+
"executor": "pi",
|
|
225
|
+
"role": "implementer",
|
|
226
|
+
"writePolicy": "exclusive",
|
|
227
|
+
"writeSet": [
|
|
228
|
+
"REPLACE/WITH/IMPLEMENT/WRITESET/**"
|
|
229
|
+
],
|
|
230
|
+
"allowedPaths": [
|
|
231
|
+
"REPLACE/WITH/IMPLEMENT/**"
|
|
232
|
+
],
|
|
233
|
+
"forbiddenPaths": [
|
|
234
|
+
".harness/**",
|
|
235
|
+
"artifacts/**"
|
|
236
|
+
],
|
|
237
|
+
"outputContract": "Implementation summary with changed files, focused tests run, and risks. Must not ask main session to write artifacts.",
|
|
238
|
+
"subtask_prompt": "Implement the approved change within writeSet only after write-set-gate-shell passed (upstream VERDICT: pass). If write-set gate blocked, output blocked reason without editing files. Keep changes minimal and run focused tests inside allowedPaths when implementing.",
|
|
239
|
+
"toolProfile": "write"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "soft-verify-shell",
|
|
243
|
+
"depends_on": [
|
|
244
|
+
"implement-pi"
|
|
245
|
+
],
|
|
246
|
+
"complexity": "LOW",
|
|
247
|
+
"executor": "shell",
|
|
248
|
+
"role": "verifier",
|
|
249
|
+
"writePolicy": "read-only",
|
|
250
|
+
"allowedPaths": [
|
|
251
|
+
"REPLACE/WITH/IMPLEMENT/**",
|
|
252
|
+
"./**"
|
|
253
|
+
],
|
|
254
|
+
"forbiddenPaths": [
|
|
255
|
+
".harness/**",
|
|
256
|
+
"artifacts/**"
|
|
257
|
+
],
|
|
258
|
+
"outputContract": "Archived shell stdout/stderr with exit codes for focused verification; no worktree writes.",
|
|
259
|
+
"subtask_prompt": "Run focused soft verification before process supervision.",
|
|
260
|
+
"shell": {
|
|
261
|
+
"commands": [
|
|
262
|
+
"npx vitest run REPLACE/WITH/FOCUSED/TEST/GLOB.test.ts --reporter=dot"
|
|
263
|
+
],
|
|
264
|
+
"verifyEvidence": {
|
|
265
|
+
"phase": "intermediate",
|
|
266
|
+
"quota": "1",
|
|
267
|
+
"commandSource": "inline",
|
|
268
|
+
"commandCount": 1,
|
|
269
|
+
"commandLabels": [
|
|
270
|
+
"focused template verification"
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"cwd": ".",
|
|
274
|
+
"timeoutMs": 300000
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"id": "process-supervisor-pi",
|
|
279
|
+
"depends_on": [
|
|
280
|
+
"soft-verify-shell",
|
|
281
|
+
"implement-pi"
|
|
282
|
+
],
|
|
283
|
+
"complexity": "HIGH",
|
|
284
|
+
"executor": "pi",
|
|
285
|
+
"role": "supervisor",
|
|
286
|
+
"writePolicy": "read-only",
|
|
287
|
+
"allowedPaths": [
|
|
288
|
+
"**"
|
|
289
|
+
],
|
|
290
|
+
"forbiddenPaths": [
|
|
291
|
+
".harness/**",
|
|
292
|
+
"artifacts/**"
|
|
293
|
+
],
|
|
294
|
+
"outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision, followed by a REPAIR_ARTIFACT_JSON fenced block. Audit writeSet coverage, boundary drift, verification gaps, repair scope. No file writes.",
|
|
295
|
+
"subtask_prompt_markdown": "./agent-dag-process-supervisor.prompt.md"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"id": "process-gate-shell",
|
|
299
|
+
"depends_on": [
|
|
300
|
+
"process-supervisor-pi"
|
|
301
|
+
],
|
|
302
|
+
"complexity": "LOW",
|
|
303
|
+
"executor": "shell",
|
|
304
|
+
"role": "verifier",
|
|
305
|
+
"writePolicy": "read-only",
|
|
306
|
+
"allowedPaths": [
|
|
307
|
+
"**"
|
|
308
|
+
],
|
|
309
|
+
"forbiddenPaths": [
|
|
310
|
+
".harness/**",
|
|
311
|
+
"artifacts/**"
|
|
312
|
+
],
|
|
313
|
+
"outputContract": "Deterministic process supervisor verdict gate: exit 0 when first non-empty assistant output line is pass or request-revision; exit non-zero otherwise.",
|
|
314
|
+
"subtask_prompt": "Deterministic gate: validate process-supervisor-pi first-line VERDICT before repair/hard-verify.",
|
|
315
|
+
"shell": {
|
|
316
|
+
"verdictGate": {
|
|
317
|
+
"fromNodeId": "process-supervisor-pi",
|
|
318
|
+
"accept": [
|
|
319
|
+
"VERDICT: pass",
|
|
320
|
+
"VERDICT: request-revision"
|
|
321
|
+
],
|
|
322
|
+
"label": "process",
|
|
323
|
+
"lineMode": "first-verdict-line"
|
|
324
|
+
},
|
|
325
|
+
"repairArtifactGate": {
|
|
326
|
+
"fromNodeId": "process-supervisor-pi"
|
|
327
|
+
},
|
|
328
|
+
"cwd": ".",
|
|
329
|
+
"timeoutMs": 60000
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"id": "repair-pi",
|
|
334
|
+
"depends_on": [
|
|
335
|
+
"process-gate-shell",
|
|
336
|
+
"process-supervisor-pi"
|
|
337
|
+
],
|
|
338
|
+
"complexity": "HIGH",
|
|
339
|
+
"executor": "pi",
|
|
340
|
+
"role": "implementer",
|
|
341
|
+
"writePolicy": "exclusive",
|
|
342
|
+
"writeSet": [
|
|
343
|
+
"REPLACE/WITH/REPAIR/WRITESET/**",
|
|
344
|
+
"docs/templates/agent-dag.supervised-implementation.json",
|
|
345
|
+
"docs/templates/agent-dag-process-supervisor.prompt.md",
|
|
346
|
+
"docs/templates/agent-dag-review-verdict.prompt.md",
|
|
347
|
+
"docs/templates/agent-dag.schema.json",
|
|
348
|
+
"./src/workflows/dag/types.ts",
|
|
349
|
+
"./src/workflows/dag/skills.ts",
|
|
350
|
+
"./src/executors/dag-pi-executor.ts"
|
|
351
|
+
],
|
|
352
|
+
"allowedPaths": [
|
|
353
|
+
"REPLACE/WITH/REPAIR/**",
|
|
354
|
+
"docs/templates/**",
|
|
355
|
+
"./src/workflows/dag/**",
|
|
356
|
+
"./src/executors/**"
|
|
357
|
+
],
|
|
358
|
+
"forbiddenPaths": [
|
|
359
|
+
".harness/**",
|
|
360
|
+
"artifacts/**"
|
|
361
|
+
],
|
|
362
|
+
"outputContract": "Repair summary or explicit no-op when process supervisor passed; changed files and tests when revised. Must not ask main session to write artifacts.",
|
|
363
|
+
"subtask_prompt": "If process-supervisor-pi returned VERDICT: request-revision, apply bounded fixes within writeSet addressing REPAIR_ARTIFACT_JSON.fixScope and preserving REPAIR_ARTIFACT_JSON.invariant. Use REPAIR_ARTIFACT_JSON.failureClass and rootCause before raw logs; raw log is fallback evidence only when rawLogFallbackAllowed is true. If VERDICT: pass, return no-op with evidence. Re-run focused tests when you change code.",
|
|
364
|
+
"toolProfile": "write"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"id": "hard-verify-shell",
|
|
368
|
+
"depends_on": [
|
|
369
|
+
"repair-pi"
|
|
370
|
+
],
|
|
371
|
+
"complexity": "LOW",
|
|
372
|
+
"executor": "shell",
|
|
373
|
+
"role": "verifier",
|
|
374
|
+
"writePolicy": "read-only",
|
|
375
|
+
"allowedPaths": [
|
|
376
|
+
"./**",
|
|
377
|
+
"docs/**",
|
|
378
|
+
"scripts/**"
|
|
379
|
+
],
|
|
380
|
+
"forbiddenPaths": [
|
|
381
|
+
".harness/**",
|
|
382
|
+
"artifacts/**"
|
|
383
|
+
],
|
|
384
|
+
"outputContract": "Archived hard verification stdout/stderr with exit codes; no worktree writes.",
|
|
385
|
+
"subtask_prompt": "Run hard verification after repair round.",
|
|
386
|
+
"shell": {
|
|
387
|
+
"preset": "loop-agent-standard-verify",
|
|
388
|
+
"commands": [
|
|
389
|
+
"HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh"
|
|
390
|
+
],
|
|
391
|
+
"verifyEvidence": {
|
|
392
|
+
"phase": "final",
|
|
393
|
+
"quota": "full",
|
|
394
|
+
"commandSource": "inline",
|
|
395
|
+
"commandCount": 1,
|
|
396
|
+
"commandLabels": [
|
|
397
|
+
"active DAG repo governance checks"
|
|
398
|
+
],
|
|
399
|
+
"finalFullRequired": true
|
|
400
|
+
},
|
|
401
|
+
"cwd": ".",
|
|
402
|
+
"timeoutMs": 300000
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"id": "review-pi",
|
|
407
|
+
"depends_on": [
|
|
408
|
+
"hard-verify-shell"
|
|
409
|
+
],
|
|
410
|
+
"complexity": "HIGH",
|
|
411
|
+
"executor": "pi",
|
|
412
|
+
"role": "reviewer",
|
|
413
|
+
"writePolicy": "read-only",
|
|
414
|
+
"allowedPaths": [
|
|
415
|
+
"**"
|
|
416
|
+
],
|
|
417
|
+
"forbiddenPaths": [
|
|
418
|
+
".harness/**",
|
|
419
|
+
"artifacts/**"
|
|
420
|
+
],
|
|
421
|
+
"outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; Critical/Important findings force request-revision. No file writes.",
|
|
422
|
+
"subtask_prompt_markdown": "./agent-dag-review-verdict.prompt.md"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"id": "review-gate-shell",
|
|
426
|
+
"depends_on": [
|
|
427
|
+
"review-pi"
|
|
428
|
+
],
|
|
429
|
+
"complexity": "LOW",
|
|
430
|
+
"executor": "shell",
|
|
431
|
+
"role": "verifier",
|
|
432
|
+
"writePolicy": "read-only",
|
|
433
|
+
"allowedPaths": [
|
|
434
|
+
"**"
|
|
435
|
+
],
|
|
436
|
+
"forbiddenPaths": [
|
|
437
|
+
".harness/**",
|
|
438
|
+
"artifacts/**"
|
|
439
|
+
],
|
|
440
|
+
"outputContract": "Deterministic review verdict gate: exit 0 only when review-pi first non-empty assistant output line is pass.",
|
|
441
|
+
"subtask_prompt": "Deterministic gate: block decision gate unless review-pi emitted VERDICT: pass.",
|
|
442
|
+
"shell": {
|
|
443
|
+
"verdictGate": {
|
|
444
|
+
"fromNodeId": "review-pi",
|
|
445
|
+
"accept": [
|
|
446
|
+
"VERDICT: pass"
|
|
447
|
+
],
|
|
448
|
+
"label": "review",
|
|
449
|
+
"lineMode": "first-verdict-line"
|
|
450
|
+
},
|
|
451
|
+
"cwd": ".",
|
|
452
|
+
"timeoutMs": 60000
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"id": "decision-pi",
|
|
457
|
+
"depends_on": [
|
|
458
|
+
"review-gate-shell",
|
|
459
|
+
"hard-verify-shell"
|
|
460
|
+
],
|
|
461
|
+
"complexity": "HIGH",
|
|
462
|
+
"executor": "pi",
|
|
463
|
+
"role": "reviewer",
|
|
464
|
+
"writePolicy": "read-only",
|
|
465
|
+
"allowedPaths": [
|
|
466
|
+
"**"
|
|
467
|
+
],
|
|
468
|
+
"forbiddenPaths": [
|
|
469
|
+
".harness/**",
|
|
470
|
+
"artifacts/**"
|
|
471
|
+
],
|
|
472
|
+
"outputContract": "Markdown with exactly one DECISION_ENVELOPE_JSON fenced block plus evidence summary. No file writes.",
|
|
473
|
+
"subtask_prompt_markdown": "./agent-dag-decision-gate.prompt.md",
|
|
474
|
+
"decisionGate": {
|
|
475
|
+
"enabled": true,
|
|
476
|
+
"schemaVersion": 1,
|
|
477
|
+
"mode": "record-only"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"id": "closeout-pi",
|
|
482
|
+
"depends_on": [
|
|
483
|
+
"decision-pi"
|
|
484
|
+
],
|
|
485
|
+
"complexity": "MED",
|
|
486
|
+
"executor": "pi",
|
|
487
|
+
"role": "closeout",
|
|
488
|
+
"writePolicy": "read-only",
|
|
489
|
+
"allowedPaths": [
|
|
490
|
+
"**"
|
|
491
|
+
],
|
|
492
|
+
"forbiddenPaths": [
|
|
493
|
+
".harness/**",
|
|
494
|
+
"artifacts/**"
|
|
495
|
+
],
|
|
496
|
+
"outputContract": "Plain Markdown closeout referencing verification, supervisor/review verdicts, and decision envelope. No file writes.",
|
|
497
|
+
"subtask_prompt": "Summarize the supervised DAG outcome: contract, write-set audit, implement/repair, soft/hard verify, process supervisor and review verdicts, decision-pi envelope, and recommended main-session next step. Do not edit files or write root artifacts/**."
|
|
498
|
+
}
|
|
499
|
+
]
|
|
500
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 执行计划模板
|
|
2
|
+
|
|
3
|
+
## 标题
|
|
4
|
+
|
|
5
|
+
## 状态
|
|
6
|
+
|
|
7
|
+
- draft / active / blocked / completed
|
|
8
|
+
|
|
9
|
+
## 背景
|
|
10
|
+
|
|
11
|
+
- 当前问题或机会是什么:
|
|
12
|
+
- 为什么值得现在做:
|
|
13
|
+
|
|
14
|
+
## 目标(Objective)
|
|
15
|
+
|
|
16
|
+
- 本计划希望达成什么结果:
|
|
17
|
+
|
|
18
|
+
## 范围(Scope)
|
|
19
|
+
|
|
20
|
+
- 包含:
|
|
21
|
+
- 不包含:
|
|
22
|
+
|
|
23
|
+
## 约束(Constraints)
|
|
24
|
+
|
|
25
|
+
- 架构/契约约束:
|
|
26
|
+
- 时间/风险约束:
|
|
27
|
+
- 验证约束:
|
|
28
|
+
|
|
29
|
+
## 里程碑(Milestones)
|
|
30
|
+
|
|
31
|
+
| ID | Milestone | Status | Exit Criteria |
|
|
32
|
+
|----|-----------|--------|---------------|
|
|
33
|
+
| M1 | | todo | |
|
|
34
|
+
|
|
35
|
+
## 工作分解(Work Breakdown)
|
|
36
|
+
|
|
37
|
+
| ID | Work Item | Status | Notes |
|
|
38
|
+
|----|-----------|--------|-------|
|
|
39
|
+
| W1 | | todo | |
|
|
40
|
+
|
|
41
|
+
## 验证关口(Verification Gates)
|
|
42
|
+
|
|
43
|
+
- [ ] 文档/契约已同步
|
|
44
|
+
- [ ] 最低必要测试已通过
|
|
45
|
+
- [ ] 关键路径已验证
|
|
46
|
+
- [ ] 风险与未覆盖项已记录
|
|
47
|
+
|
|
48
|
+
## 风险 / 阻塞项
|
|
49
|
+
|
|
50
|
+
- 风险:
|
|
51
|
+
- 阻塞:
|
|
52
|
+
|
|
53
|
+
## 回退 / 恢复(Rollback / Recovery)
|
|
54
|
+
|
|
55
|
+
- 如何回退:
|
|
56
|
+
- 回退后如何恢复基线:
|
|
57
|
+
|
|
58
|
+
## Open Questions
|
|
59
|
+
|
|
60
|
+
-
|
|
61
|
+
|
|
62
|
+
## 推荐下一步
|
|
63
|
+
|
|
64
|
+
-
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Feature Spec 模板
|
|
2
|
+
|
|
3
|
+
## 标题
|
|
4
|
+
|
|
5
|
+
## 状态
|
|
6
|
+
|
|
7
|
+
- draft / active / completed
|
|
8
|
+
|
|
9
|
+
## 背景(Background)
|
|
10
|
+
|
|
11
|
+
- 问题背景:
|
|
12
|
+
- 用户/协作者痛点:
|
|
13
|
+
- 与现有系统的关系:
|
|
14
|
+
|
|
15
|
+
## 目标(Goal)
|
|
16
|
+
|
|
17
|
+
- 本 feature 要实现什么:
|
|
18
|
+
|
|
19
|
+
## 非目标(Non-goals)
|
|
20
|
+
|
|
21
|
+
- 明确本轮不做什么:
|
|
22
|
+
|
|
23
|
+
## 关键场景 / 用户路径
|
|
24
|
+
|
|
25
|
+
1.
|
|
26
|
+
2.
|
|
27
|
+
3.
|
|
28
|
+
|
|
29
|
+
## Feature List
|
|
30
|
+
|
|
31
|
+
| ID | Feature | Priority | Status | Acceptance | Notes |
|
|
32
|
+
|----|---------|----------|--------|------------|-------|
|
|
33
|
+
| F1 | | High | todo | | |
|
|
34
|
+
|
|
35
|
+
## 依赖(Dependencies)
|
|
36
|
+
|
|
37
|
+
- 上游依赖:
|
|
38
|
+
- 下游影响:
|
|
39
|
+
- 文档/契约依赖:
|
|
40
|
+
|
|
41
|
+
## 风险(Risks)
|
|
42
|
+
|
|
43
|
+
-
|
|
44
|
+
|
|
45
|
+
## 验证说明(Verification Notes)
|
|
46
|
+
|
|
47
|
+
- 最低建议验证:
|
|
48
|
+
- 加强验证:
|
|
49
|
+
- 关键手工路径:
|
|
50
|
+
|
|
51
|
+
## Open Questions
|
|
52
|
+
|
|
53
|
+
-
|