coding-agent-harness 1.0.2 → 1.0.4
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/CHANGELOG.md +25 -0
- package/CONTRIBUTING.md +98 -0
- package/README.md +211 -86
- package/README.zh-CN.md +54 -34
- package/SKILL.md +25 -18
- package/docs-release/README.md +9 -5
- package/docs-release/architecture/overview.md +17 -5
- package/docs-release/architecture/overview.zh-CN.md +9 -5
- package/docs-release/assets/dashboard-overview.png +0 -0
- package/docs-release/guides/agent-installation.en-US.md +31 -8
- package/docs-release/guides/agent-installation.md +34 -9
- package/docs-release/guides/contributing.md +100 -0
- package/docs-release/guides/contributing.zh-CN.md +99 -0
- package/docs-release/guides/document-audience-and-surfaces.en-US.md +3 -2
- package/docs-release/guides/document-audience-and-surfaces.md +3 -2
- package/docs-release/guides/full-legacy-migration-subagent-strategy.md +2 -2
- package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +2 -2
- package/docs-release/guides/legacy-migration-agent-prompt.md +0 -11
- package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +0 -11
- package/docs-release/guides/migration-playbook.en-US.md +14 -15
- package/docs-release/guides/migration-playbook.md +14 -15
- package/docs-release/guides/parent-control-repository-pattern.en-US.md +7 -5
- package/docs-release/guides/parent-control-repository-pattern.md +7 -5
- package/docs-release/guides/preset-development.md +214 -0
- package/docs-release/guides/repository-operating-models.en-US.md +5 -4
- package/docs-release/guides/repository-operating-models.md +5 -4
- package/docs-release/guides/task-state-machine.en-US.md +207 -0
- package/docs-release/guides/task-state-machine.md +214 -0
- package/docs-release/intl/en-US.md +1 -1
- package/docs-release/intl/zh-CN.md +1 -1
- package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
- package/package.json +8 -3
- package/presets/legacy-migration/checks/preset-check.mjs +3 -0
- package/presets/legacy-migration/preset.yaml +134 -0
- package/presets/legacy-migration/scripts/plan-work-queue.mjs +4 -0
- package/presets/legacy-migration/scripts/scaffold-task-contracts.mjs +4 -0
- package/presets/legacy-migration/templates/execution_strategy.append.md +18 -0
- package/presets/legacy-migration/templates/findings.seed.md +17 -0
- package/presets/legacy-migration/templates/review.seed.md +12 -0
- package/presets/legacy-migration/templates/task_plan.append.md +9 -0
- package/presets/legacy-migration/templates/visual_map.append.md +12 -0
- package/presets/legacy-migration/workbench/dashboard-panels.yaml +2 -0
- package/presets/legacy-migration/workbench/migration-queue.schema.json +23 -0
- package/presets/lesson-sedimentation/preset.yaml +23 -0
- package/presets/lesson-sedimentation/templates/prompt.md +23 -0
- package/presets/module/preset.yaml +25 -0
- package/presets/module/templates/execution_strategy.append.md +8 -0
- package/presets/module/templates/task_plan.append.md +17 -0
- package/presets/standard-task/preset.yaml +31 -0
- package/presets/standard-task/templates/task_plan.append.md +7 -0
- package/references/adversarial-review-standard.md +2 -2
- package/references/agents-md-pattern.md +2 -2
- package/references/delivery-operating-model-standard.md +3 -3
- package/references/docs-directory-standard.md +6 -7
- package/references/harness-ledger.md +53 -96
- package/references/lessons-governance.md +88 -93
- package/references/module-parallel-standard.md +14 -14
- package/references/planning-loop.md +12 -6
- package/references/pull-request-standard.md +118 -0
- package/references/repo-governance-standard.md +11 -2
- package/references/review-routing-standard.md +7 -1
- package/references/ssot-governance.md +67 -59
- package/references/taskr-gap-analysis.md +600 -0
- package/references/walkthrough-closeout.md +7 -7
- package/scripts/check-harness.mjs +40 -301
- package/scripts/commands/dashboard-command.mjs +67 -0
- package/scripts/commands/migration-command.mjs +96 -0
- package/scripts/commands/preset-command.mjs +73 -0
- package/scripts/commands/task-command.mjs +327 -0
- package/scripts/harness.mjs +55 -260
- package/scripts/lib/capability-registry.mjs +66 -8
- package/scripts/lib/check-module-parallel.mjs +237 -0
- package/scripts/lib/check-profiles.mjs +61 -153
- package/scripts/lib/check-task-contracts.mjs +47 -0
- package/scripts/lib/core-shared.mjs +10 -0
- package/scripts/lib/dashboard-data.mjs +29 -6
- package/scripts/lib/dashboard-workbench.mjs +52 -12
- package/scripts/lib/dashboard-writer.mjs +14 -2
- package/scripts/lib/git-status-summary.mjs +46 -0
- package/scripts/lib/governance-index-generator.mjs +174 -0
- package/scripts/lib/governance-sync.mjs +514 -0
- package/scripts/lib/governance-table-boundary.mjs +175 -0
- package/scripts/lib/harness-core.mjs +5 -0
- package/scripts/lib/lesson-maintenance.mjs +36 -29
- package/scripts/lib/migration-support.mjs +1 -1
- package/scripts/lib/preset-audit-contracts.mjs +37 -0
- package/scripts/lib/preset-engine.mjs +497 -0
- package/scripts/lib/preset-registry.mjs +627 -0
- package/scripts/lib/preset-resource-contracts.mjs +83 -0
- package/scripts/lib/review-confirm-git-gate.mjs +248 -0
- package/scripts/lib/status-dashboard-renderer.mjs +102 -0
- package/scripts/lib/subagent-authorization-audit.mjs +196 -0
- package/scripts/lib/task-completion-consistency.mjs +16 -0
- package/scripts/lib/task-index.mjs +93 -0
- package/scripts/lib/task-lesson-candidates.mjs +242 -0
- package/scripts/lib/task-lesson-sedimentation.mjs +326 -0
- package/scripts/lib/task-lifecycle/review-confirm.mjs +101 -0
- package/scripts/lib/task-lifecycle/review-gates.mjs +70 -0
- package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
- package/scripts/lib/task-lifecycle.mjs +297 -403
- package/scripts/lib/task-review-model.mjs +469 -0
- package/scripts/lib/task-scanner.mjs +130 -236
- package/scripts/lib/task-tombstone-commands.mjs +140 -0
- package/scripts/postinstall.mjs +14 -0
- package/skills/preset-creator/SKILL.md +179 -0
- package/skills/preset-creator/references/complex-task-skeleton/README.md +31 -0
- package/skills/preset-creator/references/complex-task-skeleton/artifacts/INDEX.md +12 -0
- package/skills/preset-creator/references/complex-task-skeleton/brief.md +32 -0
- package/skills/preset-creator/references/complex-task-skeleton/execution_strategy.md +71 -0
- package/skills/preset-creator/references/complex-task-skeleton/findings.md +24 -0
- package/skills/preset-creator/references/complex-task-skeleton/lesson_candidates.md +70 -0
- package/skills/preset-creator/references/complex-task-skeleton/long-running-task-contract.md +76 -0
- package/skills/preset-creator/references/complex-task-skeleton/progress.md +33 -0
- package/skills/preset-creator/references/complex-task-skeleton/references/INDEX.md +13 -0
- package/skills/preset-creator/references/complex-task-skeleton/review.md +107 -0
- package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +111 -0
- package/skills/preset-creator/references/complex-task-skeleton/visual_map.md +50 -0
- package/skills/preset-creator/references/preset-package-skeleton.md +296 -0
- package/templates/AGENTS.md.template +19 -15
- package/templates/dashboard/assets/app-src/00-state.js +1 -0
- package/templates/dashboard/assets/app-src/10-router.js +2 -1
- package/templates/dashboard/assets/app-src/20-overview.js +11 -5
- package/templates/dashboard/assets/app-src/30-tasks.js +92 -246
- package/templates/dashboard/assets/app-src/35-task-detail.js +246 -0
- package/templates/dashboard/assets/app-src/45-review.js +241 -22
- package/templates/dashboard/assets/app-src/50-migration.js +24 -10
- package/templates/dashboard/assets/app-src/90-bindings.js +171 -29
- package/templates/dashboard/assets/app.css +698 -156
- package/templates/dashboard/assets/app.css.manifest.json +9 -0
- package/templates/dashboard/assets/app.js +662 -91
- package/templates/dashboard/assets/app.manifest.json +1 -0
- package/templates/dashboard/assets/css-src/00-foundation.css +342 -0
- package/templates/dashboard/assets/css-src/10-panels-flow.css +236 -0
- package/templates/dashboard/assets/css-src/20-briefs-controls.css +398 -0
- package/templates/dashboard/assets/css-src/30-task-index.css +739 -0
- package/templates/dashboard/assets/css-src/35-review-workspace.css +507 -0
- package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +427 -0
- package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
- package/templates/dashboard/assets/i18n.js +123 -21
- package/templates/ledger/Harness-Ledger.md +13 -25
- package/templates/lessons/lesson-arch-process-change.md +1 -1
- package/templates/lessons/lesson-new-doc.md +1 -1
- package/templates/lessons/lesson-ref-change.md +1 -1
- package/templates/planning/execution_strategy.md +31 -0
- package/templates/planning/lesson_candidates.md +18 -6
- package/templates/planning/optional/artifacts/INDEX.md +3 -3
- package/templates/planning/optional/references/INDEX.md +3 -3
- package/templates/planning/review.md +59 -0
- package/templates/planning/task_plan.md +36 -13
- package/templates/reference/execution-workflow-standard.md +4 -3
- package/templates/reference/pull-request-standard.md +80 -0
- package/templates/reference/repo-governance-standard.md +7 -6
- package/templates/reference/review-routing-standard.md +6 -0
- package/templates/reference/walkthrough-standard.md +2 -1
- package/templates/verifier/verifier-output.md +1 -1
- package/templates-zh-CN/AGENTS.md.template +20 -16
- package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
- package/templates-zh-CN/planning/execution_strategy.md +30 -0
- package/templates-zh-CN/planning/lesson_candidates.md +18 -6
- package/templates-zh-CN/planning/review.md +59 -1
- package/templates-zh-CN/planning/task_plan.md +30 -10
- package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
- package/templates-zh-CN/reference/docs-library-standard.md +1 -1
- package/templates-zh-CN/reference/execution-workflow-standard.md +4 -3
- package/templates-zh-CN/reference/harness-ledger-standard.md +2 -2
- package/templates-zh-CN/reference/pull-request-standard.md +106 -0
- package/templates-zh-CN/reference/repo-governance-standard.md +4 -3
- package/templates-zh-CN/reference/review-routing-standard.md +8 -1
- package/templates-zh-CN/reference/walkthrough-standard.md +3 -2
- package/templates-zh-CN/walkthrough/Closeout-SSoT.md +1 -1
- package/docs-release/assets/dashboard-overview-en.png +0 -0
- package/scripts/smoke-dashboard.mjs +0 -92
- package/scripts/test-harness.mjs +0 -1395
- package/templates/ssot/Feature-SSoT.md +0 -43
- package/templates/ssot/Lessons-SSoT.md +0 -44
- package/templates-zh-CN/ssot/Feature-SSoT.md +0 -49
- package/templates-zh-CN/ssot/Lessons-SSoT.md +0 -49
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Preset Development
|
|
2
|
+
|
|
3
|
+
Harness presets are declarative task method packages. A preset can add task metadata, render Markdown templates, require CLI inputs, generate evidence files, and pre-load shared reference bundles without writing JavaScript.
|
|
4
|
+
|
|
5
|
+
Use a preset when multiple tasks should start from the same method, evidence contract, or shared context. Do not create a preset for one-off prose. Good presets encode repeatable task behavior: required inputs, task kind, review/evidence expectations, shared references, and a small amount of task-plan guidance that tells the next agent what to read first.
|
|
6
|
+
|
|
7
|
+
`preset.yaml` uses the Harness manifest subset: nested mappings, scalar strings/numbers/booleans, and inline arrays such as `[standard, complex]`. Do not use block strings or dash-list YAML forms in preset manifests.
|
|
8
|
+
|
|
9
|
+
## Install Location
|
|
10
|
+
|
|
11
|
+
Project presets live in:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
<target>/.coding-agent-harness/presets/<preset-id>/
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
User-installed presets live in:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
~/.coding-agent-harness/presets/<preset-id>/
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
When a target is supplied, Harness discovers project presets first, then user presets, then bundled presets under the package `presets/` directory. Use project presets when a repository needs to override or pin a task method. Use user presets for personal reusable methods across repositories.
|
|
24
|
+
|
|
25
|
+
Bundled presets are not only fallback files. `npm install -g coding-agent-harness`
|
|
26
|
+
and `harness install-user` seed them into the user preset root, while
|
|
27
|
+
`harness init` seeds them into the project preset root. Re-run
|
|
28
|
+
`harness preset seed` for the user root or `harness preset seed --project <target>`
|
|
29
|
+
for the project root when a preset root is missing or incomplete.
|
|
30
|
+
|
|
31
|
+
## Package Layout
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
my-preset/
|
|
35
|
+
preset.yaml
|
|
36
|
+
templates/
|
|
37
|
+
task_plan.append.md
|
|
38
|
+
references/
|
|
39
|
+
upstream-contract.md
|
|
40
|
+
resources/
|
|
41
|
+
service-runbook.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Minimal Manifest
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
id: custom-review
|
|
48
|
+
version: 1
|
|
49
|
+
purpose: Create a review task with preset evidence.
|
|
50
|
+
compatibleBudgets: [standard, complex]
|
|
51
|
+
localeSupport: [en-US, zh-CN]
|
|
52
|
+
task:
|
|
53
|
+
kind: review-task
|
|
54
|
+
defaultTaskId: custom-review-task
|
|
55
|
+
entrypoints:
|
|
56
|
+
newTask:
|
|
57
|
+
type: template
|
|
58
|
+
writes: [docs/09-PLANNING/TASKS/**]
|
|
59
|
+
audit: true
|
|
60
|
+
templates:
|
|
61
|
+
taskPlanAppend: templates/task_plan.append.md
|
|
62
|
+
inputs:
|
|
63
|
+
subject:
|
|
64
|
+
type: text
|
|
65
|
+
flag: --subject
|
|
66
|
+
required: true
|
|
67
|
+
templateValues:
|
|
68
|
+
subject:
|
|
69
|
+
from: inputs.subject
|
|
70
|
+
metadata:
|
|
71
|
+
ReviewSubject:
|
|
72
|
+
label: Review Subject
|
|
73
|
+
from: inputs.subject
|
|
74
|
+
evidence:
|
|
75
|
+
bundleDir: artifacts/preset
|
|
76
|
+
files:
|
|
77
|
+
subject:
|
|
78
|
+
path: subject.txt
|
|
79
|
+
type: text
|
|
80
|
+
value: inputs.subject
|
|
81
|
+
audit:
|
|
82
|
+
manifestRequired: true
|
|
83
|
+
evidenceFiles: [preset-audit.json, preset-manifest.json, write-scope.json]
|
|
84
|
+
writeScopes:
|
|
85
|
+
taskDocs:
|
|
86
|
+
path: docs/09-PLANNING/TASKS/**
|
|
87
|
+
access: write
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Reference Bundles
|
|
91
|
+
|
|
92
|
+
Use `resources.references` when a family of tasks shares the same outside context, such as another microservice, API contract, migration packet, reviewer input, or local verification runbook. Harness copies or renders these files into each created task directory, appends `references/INDEX.md` rows, and can add a required-read section to `task_plan.md`.
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
resources:
|
|
96
|
+
references:
|
|
97
|
+
upstreamContract:
|
|
98
|
+
path: references/upstream-contract.md
|
|
99
|
+
template: templates/references/upstream-contract.md
|
|
100
|
+
index:
|
|
101
|
+
id: REF-001
|
|
102
|
+
type: code
|
|
103
|
+
summary: Shared upstream {{service}} contract for every task created by this preset.
|
|
104
|
+
usedBy: coordinator,worker,reviewer
|
|
105
|
+
serviceRunbook:
|
|
106
|
+
path: references/service-runbook.md
|
|
107
|
+
source: resources/service-runbook.md
|
|
108
|
+
index:
|
|
109
|
+
id: REF-002
|
|
110
|
+
type: runbook
|
|
111
|
+
summary: Local verification notes for the shared upstream service.
|
|
112
|
+
usedBy: worker
|
|
113
|
+
context:
|
|
114
|
+
requiredReads: [REF-001, REF-002]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use `template` when the file needs `{{valueName}}` substitution. Use `source` when the file should be copied as static Markdown. `path`, `source`, and `template` must stay inside the preset package and generated task directory boundaries.
|
|
118
|
+
|
|
119
|
+
## Artifact Bundles
|
|
120
|
+
|
|
121
|
+
Use `resources.artifacts` for preset-provided fixtures, generated input packets, or review material that supports the task but is not a reference source of truth. Harness writes these files into the task's `artifacts/` area and appends `artifacts/INDEX.md`.
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
resources:
|
|
125
|
+
artifacts:
|
|
126
|
+
inputPacket:
|
|
127
|
+
path: artifacts/input-packet.md
|
|
128
|
+
source: resources/artifacts/input-packet.md
|
|
129
|
+
index:
|
|
130
|
+
id: ART-001
|
|
131
|
+
type: fixture
|
|
132
|
+
summary: Shared fixture packet copied by the preset.
|
|
133
|
+
producedBy: preset
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Template Rendering
|
|
137
|
+
|
|
138
|
+
Templates use `{{valueName}}` placeholders from `templateValues`. `templateValues` and `metadata` support literal `value`, `default`, and dot-path `from` references such as `inputs.subject` or `task.title`; they do not evaluate arbitrary expressions.
|
|
139
|
+
|
|
140
|
+
`metadata` entries render first-class task plan lines such as `Review Subject: API contracts`.
|
|
141
|
+
|
|
142
|
+
```md
|
|
143
|
+
## Custom Review
|
|
144
|
+
|
|
145
|
+
Subject: {{subject}}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Inputs
|
|
149
|
+
|
|
150
|
+
Supported input types:
|
|
151
|
+
|
|
152
|
+
| Type | Use |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| `text` | Reads a CLI flag value such as `--subject "API"` |
|
|
155
|
+
| `flag` | Reads a boolean CLI flag |
|
|
156
|
+
| `json-file` | Reads and validates a JSON file such as `--from-session session.json` |
|
|
157
|
+
|
|
158
|
+
`json-file` inputs can validate `validateOperation`, reject `planOnly`, require a target path, and route the task target from the JSON session.
|
|
159
|
+
|
|
160
|
+
## Evidence
|
|
161
|
+
|
|
162
|
+
Evidence files are written under the task directory and must match `writeScopes`.
|
|
163
|
+
|
|
164
|
+
Supported evidence types:
|
|
165
|
+
|
|
166
|
+
| Type | Output |
|
|
167
|
+
| --- | --- |
|
|
168
|
+
| `text` | Plain text from a value path |
|
|
169
|
+
| `json` | JSON from a value path |
|
|
170
|
+
| `input-json` | Raw resolved JSON input |
|
|
171
|
+
| `preset-audit` | Manifest audit payload |
|
|
172
|
+
| `preset-manifest` | Manifest snapshot |
|
|
173
|
+
| `write-scope` | Declared write scopes |
|
|
174
|
+
| `migration-verify` | Built-in migrate session verification |
|
|
175
|
+
| `migration-ledger` | Built-in migration phase ledger |
|
|
176
|
+
| `dashboard-hash` | Hash of the migration dashboard snapshot |
|
|
177
|
+
| `target-git-status` | Target Git status from migration session |
|
|
178
|
+
| `target-commit` | Current target commit |
|
|
179
|
+
| `harness-version` | Current package version |
|
|
180
|
+
| `generated-at` | Generation timestamp |
|
|
181
|
+
|
|
182
|
+
## Commands
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
harness preset check ./my-preset
|
|
186
|
+
harness preset install ./my-preset
|
|
187
|
+
harness preset install ./my-preset --project /path/to/project
|
|
188
|
+
harness preset install legacy-migration --force
|
|
189
|
+
harness preset seed
|
|
190
|
+
harness preset seed --project /path/to/project
|
|
191
|
+
harness preset list --json /path/to/project
|
|
192
|
+
harness preset inspect custom-review --json /path/to/project
|
|
193
|
+
harness new-task custom-review-task --preset custom-review --subject "API contracts" /path/to/project
|
|
194
|
+
harness preset uninstall custom-review
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Validation Method
|
|
198
|
+
|
|
199
|
+
For every preset, prove both the manifest and downstream task behavior:
|
|
200
|
+
|
|
201
|
+
1. Run `harness preset check ./my-preset`.
|
|
202
|
+
2. Install into an isolated HOME or disposable environment.
|
|
203
|
+
3. Create at least one task with `harness new-task --preset`.
|
|
204
|
+
4. For reference bundles, create two different tasks from the same preset and verify both contain the same shared `references/` files and independent audit/evidence bundles.
|
|
205
|
+
5. Run `harness status --json`, `harness task-index --json`, and `harness check --profile target-project <target>`.
|
|
206
|
+
6. Inspect `task_plan.md` to confirm required reads are visible before implementation starts.
|
|
207
|
+
|
|
208
|
+
## Boundaries
|
|
209
|
+
|
|
210
|
+
- Presets cannot write outside declared `writeScopes`.
|
|
211
|
+
- Presets do not run arbitrary JavaScript during `new-task`.
|
|
212
|
+
- Reference bundles are task-local snapshots. If the shared upstream context changes later, create a new preset version or a follow-up task rather than silently mutating historical tasks.
|
|
213
|
+
- Script and check entrypoints may exist in bundled packages, but the task creation path is YAML + templates + built-in processors.
|
|
214
|
+
- Use a new built-in processor only when multiple presets need the same capability and the behavior can be tested centrally.
|
|
@@ -92,7 +92,7 @@ Each repository should document its external boundary in:
|
|
|
92
92
|
|
|
93
93
|
The risk is harness fragmentation:
|
|
94
94
|
|
|
95
|
-
- The frontend
|
|
95
|
+
- The frontend local task state says a task is complete while the backend Regression SSoT is still red.
|
|
96
96
|
- An SDK breaking change is not projected into the product shell.
|
|
97
97
|
- An agent starts from a child repository, sees only local facts, and incorrectly treats the global task as complete.
|
|
98
98
|
|
|
@@ -124,7 +124,8 @@ product-control-repo/
|
|
|
124
124
|
The parent repository is the control plane. It owns:
|
|
125
125
|
|
|
126
126
|
- Overall architecture and repo topology.
|
|
127
|
-
- Cross-repo
|
|
127
|
+
- Cross-repo task lifecycle Ledger.
|
|
128
|
+
- Delivery SSoT when release or block orchestration is needed.
|
|
128
129
|
- Task plans, reviews, and walkthroughs.
|
|
129
130
|
- Regression SSoT and cross-repo cadence.
|
|
130
131
|
- Agent entrypoint and reading matrix.
|
|
@@ -152,7 +153,7 @@ The parent-control model fixes global truth in one place. Even if there are 100
|
|
|
152
153
|
|
|
153
154
|
This avoids:
|
|
154
155
|
|
|
155
|
-
- Conflicting
|
|
156
|
+
- Conflicting handwritten task lifecycle tables.
|
|
156
157
|
- Each child repo saying "done" while the release still cannot ship.
|
|
157
158
|
- Agents starting from the wrong repository and seeing only local context.
|
|
158
159
|
- Cross-repo review and regression evidence scattered across many places.
|
|
@@ -179,7 +180,7 @@ If cross-repo features remain common, create a parent-control repository.
|
|
|
179
180
|
Migration order:
|
|
180
181
|
|
|
181
182
|
1. Create the parent `AGENTS.md` and repo topology.
|
|
182
|
-
2. Move global
|
|
183
|
+
2. Move global Harness Ledger, Delivery SSoT, Regression SSoT, and walkthrough index into the parent repository.
|
|
183
184
|
3. Keep local `AGENTS.md` files in child repositories, but point global planning back to the parent.
|
|
184
185
|
4. Create new cross-repo tasks only in the parent repository.
|
|
185
186
|
5. Treat child repository commits as evidence for parent tasks.
|
|
@@ -92,7 +92,7 @@ sdk-repo/
|
|
|
92
92
|
|
|
93
93
|
多仓独立模式的风险是 Harness 分裂:
|
|
94
94
|
|
|
95
|
-
-
|
|
95
|
+
- 前端局部任务状态认为任务完成,后端 Regression SSoT 仍是红灯。
|
|
96
96
|
- SDK 的 breaking change 没有投影到产品 shell。
|
|
97
97
|
- Agent 从子仓库启动后,只看到局部事实,误以为全局任务已经结束。
|
|
98
98
|
|
|
@@ -124,7 +124,8 @@ product-control-repo/
|
|
|
124
124
|
父仓库是 control plane。它管理:
|
|
125
125
|
|
|
126
126
|
- 总体架构和 repo topology。
|
|
127
|
-
-
|
|
127
|
+
- 跨仓任务生命周期 Ledger。
|
|
128
|
+
- Delivery SSoT(需要 release / block 编排时)。
|
|
128
129
|
- 任务计划、review、walkthrough。
|
|
129
130
|
- Regression SSoT 和跨仓 cadence。
|
|
130
131
|
- Agent 启动入口和读文件矩阵。
|
|
@@ -152,7 +153,7 @@ product-control-repo/
|
|
|
152
153
|
|
|
153
154
|
这能避免:
|
|
154
155
|
|
|
155
|
-
-
|
|
156
|
+
- 多个手写任务生命周期表互相冲突。
|
|
156
157
|
- 每个子仓库都声称自己已经完成,但 release 仍不能发。
|
|
157
158
|
- Agent 从错误仓库启动,只看到局部上下文。
|
|
158
159
|
- 跨仓 review 和 regression 证据散落在不同地方。
|
|
@@ -179,7 +180,7 @@ product-control-repo/
|
|
|
179
180
|
迁移顺序:
|
|
180
181
|
|
|
181
182
|
1. 创建父仓库 `AGENTS.md` 和 repo topology。
|
|
182
|
-
2. 把全局
|
|
183
|
+
2. 把全局 Harness Ledger、Delivery SSoT、Regression SSoT、walkthrough index 收到父仓库。
|
|
183
184
|
3. 子仓库保留局部 `AGENTS.md`,但把全局计划指向父仓库。
|
|
184
185
|
4. 新跨仓任务只在父仓库创建 task。
|
|
185
186
|
5. 子仓库提交只作为父任务的 evidence。
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Task State Machine And Lifecycle Queues
|
|
2
|
+
|
|
3
|
+
Chinese mirror: `docs-release/guides/task-state-machine.md`
|
|
4
|
+
|
|
5
|
+
Coding Agent Harness does not model task state as a single field. The Dashboard derives the visible lifecycle from multiple files:
|
|
6
|
+
|
|
7
|
+
- `progress.md` stores raw `task.state` and execution evidence.
|
|
8
|
+
- `review.md` stores Agent Review Submission, material findings, and Human Review Confirmation.
|
|
9
|
+
- `lesson_candidates.md` records lesson candidate decisions and sedimentation routing.
|
|
10
|
+
- `10-WALKTHROUGH/Closeout-SSoT.md` records closeout status and links walkthrough evidence.
|
|
11
|
+
- Tombstone / supersede metadata records whether a task was soft-deleted, merged, archived, or replaced.
|
|
12
|
+
- The scanner derives `lifecycleState`, `reviewStatus`, `closeoutStatus`, `taskQueues[]`, `queueReasons[]`, and `repairPrompt` from those files.
|
|
13
|
+
|
|
14
|
+
The older `reviewQueueState` model was enough for a single review page. After PF-024, the public model is a set of lifecycle queues: Review, Missing Materials, Blocked, Lessons, Confirmed / Finalized, and Soft-deleted / Superseded.
|
|
15
|
+
|
|
16
|
+
## Raw Task Command Flow
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
stateDiagram-v2
|
|
20
|
+
[*] --> not_started: new-task
|
|
21
|
+
not_started --> in_progress: task-start
|
|
22
|
+
planned --> in_progress: task-start
|
|
23
|
+
in_progress --> in_progress: task-log / task-phase
|
|
24
|
+
in_progress --> blocked: task-block
|
|
25
|
+
blocked --> in_progress: blocker fixed
|
|
26
|
+
in_progress --> review_submitted: task-review
|
|
27
|
+
review_submitted --> missing_materials: returned for materials
|
|
28
|
+
missing_materials --> in_progress: repair materials
|
|
29
|
+
review_submitted --> blocked: blocking finding
|
|
30
|
+
review_submitted --> human_confirmed: review-confirm
|
|
31
|
+
human_confirmed --> finalized: task-complete + closeout
|
|
32
|
+
finalized --> [*]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`task-review` means the agent submitted a review packet. It does not mean human approval. `review-confirm` is the Human Review Confirmation gate. `task-complete` / closeout is not a substitute for review confirmation.
|
|
36
|
+
|
|
37
|
+
## Derived State
|
|
38
|
+
|
|
39
|
+
```mermaid
|
|
40
|
+
flowchart TB
|
|
41
|
+
Progress["progress.md<br/>task.state + evidence"]
|
|
42
|
+
Review["review.md<br/>Agent Review Submission + findings + Human Review Confirmation"]
|
|
43
|
+
Lessons["lesson_candidates.md<br/>decision + sedimentation route"]
|
|
44
|
+
Closeout["Closeout-SSoT.md<br/>closeout row + walkthrough"]
|
|
45
|
+
Tombstone["tombstone / supersede metadata"]
|
|
46
|
+
Scanner["scanner"]
|
|
47
|
+
|
|
48
|
+
Progress --> Scanner
|
|
49
|
+
Review --> Scanner
|
|
50
|
+
Lessons --> Scanner
|
|
51
|
+
Closeout --> Scanner
|
|
52
|
+
Tombstone --> Scanner
|
|
53
|
+
|
|
54
|
+
Scanner --> Lifecycle["lifecycleState"]
|
|
55
|
+
Scanner --> ReviewStatus["reviewStatus"]
|
|
56
|
+
Scanner --> CloseoutStatus["closeoutStatus"]
|
|
57
|
+
Scanner --> Queues["taskQueues[]"]
|
|
58
|
+
Scanner --> Reasons["queueReasons[]"]
|
|
59
|
+
Scanner --> Prompt["repairPrompt"]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
| Field | Source | Purpose |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `task.state` | `progress.md` | Raw execution stage. |
|
|
65
|
+
| `reviewStatus` | `review.md` + findings + Human Review Confirmation | Separates missing review, agent-submitted review, blockers, and human confirmation. |
|
|
66
|
+
| `closeoutStatus` | `Closeout-SSoT.md` | Separates missing, pending, and closed closeout. |
|
|
67
|
+
| `lifecycleState` | scanner-derived | Main Dashboard lifecycle meaning. |
|
|
68
|
+
| `taskQueues[]` | scanner-derived | Which lifecycle queues include the task. A task can be visible in more than one governance queue. |
|
|
69
|
+
| `queueReasons[]` | scanner-derived | Why the task entered a queue, including source file, field, and repair action. |
|
|
70
|
+
| `repairPrompt` | scanner-derived | A copyable, scoped repair prompt for a Coding Agent. |
|
|
71
|
+
|
|
72
|
+
## Lifecycle Matrix
|
|
73
|
+
|
|
74
|
+
| Condition | `lifecycleState` | Meaning |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| Tombstone, superseded-by, archive, or abandoned marker exists | `soft-deleted-superseded` | Hidden by default, but preserved for audit and replacement tracing. |
|
|
77
|
+
| Open P0-P2 finding, invalid transition, audit failure, or failed human-review gate | `blocked` | Cannot enter human confirmation until the blocker is fixed or waived. |
|
|
78
|
+
| Standard / complex task is missing required files, sections, evidence, lesson decision, or review submission | `missing-materials` | Needs agent repair; not part of the human review queue. |
|
|
79
|
+
| `task-review` was submitted, materials are ready, and Human Review Confirmation is missing | `review-submitted` | Truly waiting for human review. |
|
|
80
|
+
| Human Review Confirmation exists, but closeout / ledger / lessons are not fully closed | `confirmed-finalization-pending` | Accountability moved to the reviewer, but governance closeout remains. |
|
|
81
|
+
| Human Review Confirmation exists, and closeout / ledger / lesson routing are complete | `finalized` | Truly complete and traceable. |
|
|
82
|
+
| `task.state = blocked` without a review blocker | `active-blocked` | Execution is blocked. |
|
|
83
|
+
| `task.state = in_progress` | `active` | Work is active. |
|
|
84
|
+
| `task.state = planned/not_started` | `ready` | Work has not started; not in human review by default. |
|
|
85
|
+
|
|
86
|
+
## Review Status
|
|
87
|
+
|
|
88
|
+
| `reviewStatus` | Meaning |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `missing` | No usable review document or Agent Review Submission exists. |
|
|
91
|
+
| `required` | Review document exists, but the packet is not ready for human review. |
|
|
92
|
+
| `submitted` | An agent submitted a review packet. This is not human confirmation. |
|
|
93
|
+
| `blocked-open-findings` | There is an open P0-P2 finding or a finding that blocks release / confirmation. |
|
|
94
|
+
| `confirmed` | `Human Review Confirmation` exists. |
|
|
95
|
+
|
|
96
|
+
Agent self-review, subagent review, and coordinator review can only move a task toward `submitted`. Only `review-confirm` or an explicit Dashboard Workbench human confirmation writes `Human Review Confirmation`.
|
|
97
|
+
|
|
98
|
+
## Lifecycle Queues
|
|
99
|
+
|
|
100
|
+
The Dashboard lifecycle workbench is a set of queues, not one mixed review list.
|
|
101
|
+
|
|
102
|
+
```mermaid
|
|
103
|
+
flowchart TD
|
|
104
|
+
Task["task facts"]
|
|
105
|
+
Task --> Deleted{"tombstone / superseded / archived?"}
|
|
106
|
+
Deleted -->|yes| QDeleted["Soft-deleted / Superseded"]
|
|
107
|
+
Deleted -->|no| Blocker{"blocking finding or invalid transition?"}
|
|
108
|
+
Blocker -->|yes| QBlocked["Blocked"]
|
|
109
|
+
Blocker -->|no| Missing{"required materials missing?"}
|
|
110
|
+
Missing -->|yes| QMissing["Missing Materials"]
|
|
111
|
+
Missing -->|no| Submitted{"Agent Review Submission exists?"}
|
|
112
|
+
Submitted -->|yes + not human confirmed| QReview["Review"]
|
|
113
|
+
Submitted -->|no| Out["not in human review queue"]
|
|
114
|
+
Submitted -->|yes + human confirmed| Confirmed{"finalization complete?"}
|
|
115
|
+
Confirmed -->|no| QConfirmed["Confirmed / Finalized"]
|
|
116
|
+
Confirmed -->|yes| QFinal["Confirmed / Finalized"]
|
|
117
|
+
Task --> Lessons{"lesson candidate needs decision or sedimentation?"}
|
|
118
|
+
Lessons -->|yes| QLessons["Lessons"]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
| Queue | Entry condition | Primary owner | Exit condition |
|
|
122
|
+
| --- | --- | --- | --- |
|
|
123
|
+
| Review | Review packet submitted, materials ready, and no human confirmation yet. | human | Human confirms or returns it. |
|
|
124
|
+
| Missing Materials | Missing file, section, evidence, lesson decision, review submission, or incomplete phase. | agent | Agent repairs materials and resubmits review. |
|
|
125
|
+
| Blocked | Blocking finding, state conflict, Git audit failure, completion gate failure, or human waiver required. | agent + human | Fixed, closed, or explicitly waived. |
|
|
126
|
+
| Lessons | Lesson candidate needs decision, task-local retention, rejection, dry-run promotion, or a sedimentation task. | human + agent | Decision is complete, or a traceable sedimentation task exists. |
|
|
127
|
+
| Confirmed / Finalized | Human-confirmed, or finalized and ready for read-only tracing. | coordinator | Closeout, ledger, and lesson routing are complete; then read-only. |
|
|
128
|
+
| Soft-deleted / Superseded | Task was soft-deleted, replaced, merged, archived, or abandoned. | coordinator | Read-only tracing; reopen only when needed. |
|
|
129
|
+
|
|
130
|
+
The Review queue only waits for human confirmation. Missing materials, blockers, lesson sedimentation, confirmed-but-not-finalized work, and historical superseded tasks must not masquerade as Review queue items.
|
|
131
|
+
|
|
132
|
+
## Global Table Boundary
|
|
133
|
+
|
|
134
|
+
Global governance tables only keep index, state, route, and audit summary. They help the Dashboard find the source of truth, but they do not carry module-local facts, long evidence, execution logs, or temporary repair prompts.
|
|
135
|
+
|
|
136
|
+
| Layer | Should record | Should not record |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
| Global tables: Harness Ledger, Closeout SSoT, Regression SSoT, Cadence Ledger, Delivery SSoT | Current state, owner, task/module/detail links, regression gate, delivery sequence, closeout or audit summary | Module-internal steps, undecided lesson candidates, full command output, long evidence paragraphs, review transcripts, temporary repair prompts |
|
|
139
|
+
| Module layer: Module Registry, `module_plan.md` | Module boundary, module steps, handoff, current blockers, and local evidence indexes | Final promoted lesson body or cross-module release audit ledger |
|
|
140
|
+
| Task layer: `brief.md`, `task_plan.md`, `progress.md`, `review.md`, `lesson_candidates.md`, `lessons/LC-*.md`, `artifacts/INDEX.md` | Execution detail, evidence, agent review, candidate lessons, task-local lesson detail, repair prompts, and raw artifact routing | Cross-task ledgers or promoted lesson detail bodies |
|
|
141
|
+
|
|
142
|
+
The checker enforces this boundary for new global table rows. Overloaded rows that already existed before 2026-05-24 are surfaced in Dashboard migration advice as `legacy-report-only`; they are not automatically deleted or bulk-rewritten. New rows that continue placing task/module-local detail in global tables are reported as `governance-table-entropy` failures. Lesson candidates stay in `lesson_candidates.md`; candidates that enter `needs-promotion` must link a task-local `lessons/LC-*.md` detail artifact, and accepted reusable lessons live in `docs/01-GOVERNANCE/lessons/*.md`. The fix is to keep the global summary row and move detail into module/task/detail documents linked from that row.
|
|
143
|
+
|
|
144
|
+
## Human Confirmation Loop
|
|
145
|
+
|
|
146
|
+
```mermaid
|
|
147
|
+
sequenceDiagram
|
|
148
|
+
autonumber
|
|
149
|
+
participant Agent as Agent / coordinator
|
|
150
|
+
participant Human as Human reviewer
|
|
151
|
+
participant UI as Dashboard Workbench
|
|
152
|
+
participant API as workbench API
|
|
153
|
+
participant Lifecycle as task lifecycle writer
|
|
154
|
+
participant Docs as markdown files
|
|
155
|
+
participant Scanner as scanner
|
|
156
|
+
|
|
157
|
+
Agent->>Docs: write Agent Review Submission + evidence
|
|
158
|
+
Agent->>UI: submit task-review
|
|
159
|
+
Human->>UI: open Review queue item
|
|
160
|
+
UI->>API: POST /api/tasks/review-complete
|
|
161
|
+
API->>Scanner: read current task facts
|
|
162
|
+
Scanner-->>API: taskQueues, queueReasons, reviewStatus
|
|
163
|
+
alt not in Review queue
|
|
164
|
+
API-->>UI: reject with target queue
|
|
165
|
+
else missing material or blocker
|
|
166
|
+
API-->>UI: reject with repairPrompt
|
|
167
|
+
else accepted
|
|
168
|
+
API->>Lifecycle: confirmTaskReview()
|
|
169
|
+
Lifecycle->>Lifecycle: verify clean Git state, identity, hooks, allowlist
|
|
170
|
+
Lifecycle->>Docs: write Human Review Confirmation
|
|
171
|
+
Lifecycle->>Docs: append review-confirm log
|
|
172
|
+
Lifecycle->>Lifecycle: commit allowlisted review/progress files
|
|
173
|
+
Lifecycle->>Docs: record confirmation commit SHA + committed audit status
|
|
174
|
+
API->>Scanner: regenerate dashboard snapshot
|
|
175
|
+
API-->>UI: confirmed task
|
|
176
|
+
end
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Strict rule: an agent can prepare review evidence and submit the task for review, but the task is not human-confirmed until the Human Review Confirmation block exists. Confirmation must use gated auto-commit: the CLI and Workbench reject dirty Git state, missing commit identity, hook/preflight failure, or writes outside the current task `review.md` / `progress.md` allowlist, and return recovery guidance.
|
|
180
|
+
|
|
181
|
+
CLI-owned mechanical writes and agent-owned manual slices have different boundaries. `new-task`, `task-*`, `task-phase`, `module-step`, `review-confirm`, `lesson-sediment`, and `lesson-promote --apply` acquire a lock, restrict writes to an allowlist, and auto-commit in a clean Git root. When an agent manually edits code, templates, or task docs, it still needs to proactively commit after verification; if it cannot commit, it must record the no-commit reason, owner, and next step, and must not mix unrelated dirty changes into the task commit.
|
|
182
|
+
|
|
183
|
+
## Lesson Sedimentation
|
|
184
|
+
|
|
185
|
+
Lesson promotion does not write a shared Lessons table. The Dashboard or CLI should prefer a dry-run or follow-up sedimentation task so the assignee first:
|
|
186
|
+
|
|
187
|
+
- Classifies scope and boundary reason.
|
|
188
|
+
- Reads the task-local detail artifact referenced by the candidate row instead of reconstructing the lesson from the brief row.
|
|
189
|
+
- Checks conflicts against existing lesson candidates, lesson detail docs, reference standards, templates, and checkers.
|
|
190
|
+
- Proposes a target diff or no-action reason.
|
|
191
|
+
- Writes the promoted lesson detail doc or standard update only after human approval.
|
|
192
|
+
|
|
193
|
+
`needs-promotion` should not block human review confirmation by itself, but it must enter the Lessons queue and remain traceable in closeout / ledger records.
|
|
194
|
+
|
|
195
|
+
## Soft Delete And Supersede
|
|
196
|
+
|
|
197
|
+
The document library does not hard-delete task directories by default.
|
|
198
|
+
|
|
199
|
+
| State | Meaning | Requirement |
|
|
200
|
+
| --- | --- | --- |
|
|
201
|
+
| `active` | Normal task. | Dashboard shows it by default. |
|
|
202
|
+
| `soft-deleted` | Task was abandoned but the directory stays. | Write a tombstone with operator, timestamp, reason, and reopen eligibility. |
|
|
203
|
+
| `superseded` | Task was replaced or merged into a newer task. | Old task records `Superseded By`; new task records `Supersedes`. |
|
|
204
|
+
| `archived` | Task moved to archive. | Reference checks must pass first, and a redirect stub or generated index entry must remain. |
|
|
205
|
+
| `hard-deleted` | Physically deleted. | Forbidden by default; allowed only for mistaken tasks with no references, ledger, progress, or review evidence. |
|
|
206
|
+
|
|
207
|
+
The Soft-deleted / Superseded queue is read-only tracing. It tells users why a task is not active and which task replaced it.
|