coding-agent-harness 1.0.2 → 1.0.5
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 +32 -0
- package/CONTRIBUTING.md +98 -0
- package/LICENSE +661 -21
- package/LICENSE-EXCEPTION.md +37 -0
- package/README.md +244 -87
- package/README.zh-CN.md +77 -35
- package/SKILL.md +32 -24
- 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/architecture/system-explainer/01-system-overview.md +217 -0
- package/docs-release/architecture/system-explainer/02-module-dependency.md +257 -0
- package/docs-release/architecture/system-explainer/03-task-lifecycle.md +304 -0
- package/docs-release/architecture/system-explainer/04-check-and-governance.md +239 -0
- package/docs-release/architecture/system-explainer/05-data-flow.md +276 -0
- package/docs-release/architecture/system-explainer/06-preset-and-migration.md +303 -0
- package/docs-release/architecture/system-explainer/README.md +67 -0
- package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +226 -0
- package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +263 -0
- package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +319 -0
- package/docs-release/architecture/system-explainer/en-US/04-check-and-governance.md +250 -0
- package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +290 -0
- package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +323 -0
- package/docs-release/architecture/system-explainer/en-US/README.md +70 -0
- package/docs-release/assets/dashboard-overview.png +0 -0
- package/docs-release/guides/agent-installation.en-US.md +39 -15
- package/docs-release/guides/agent-installation.md +43 -16
- 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 +238 -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 +224 -0
- package/docs-release/guides/task-state-machine.md +231 -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/INDEX.md +60 -0
- package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
- package/package.json +10 -4
- 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 +126 -0
- package/scripts/commands/preset-command.mjs +73 -0
- package/scripts/commands/task-command.mjs +328 -0
- package/scripts/harness.mjs +59 -260
- package/scripts/lib/capability-registry.mjs +82 -28
- package/scripts/lib/check-module-parallel.mjs +230 -0
- package/scripts/lib/check-profiles.mjs +90 -228
- package/scripts/lib/check-task-contracts.mjs +55 -0
- package/scripts/lib/core-shared.mjs +65 -2
- package/scripts/lib/dashboard-data.mjs +155 -24
- package/scripts/lib/dashboard-workbench.mjs +131 -12
- package/scripts/lib/dashboard-writer.mjs +20 -4
- package/scripts/lib/git-status-summary.mjs +46 -0
- package/scripts/lib/governance-index-generator.mjs +174 -0
- package/scripts/lib/governance-sync.mjs +611 -0
- package/scripts/lib/governance-table-boundary.mjs +175 -0
- package/scripts/lib/harness-core.mjs +6 -0
- package/scripts/lib/lesson-maintenance.mjs +36 -29
- package/scripts/lib/markdown-utils.mjs +33 -0
- package/scripts/lib/migration-planner.mjs +4 -6
- package/scripts/lib/migration-support.mjs +1 -1
- package/scripts/lib/phase-kind.mjs +50 -0
- package/scripts/lib/preset-audit-contracts.mjs +37 -0
- package/scripts/lib/preset-engine.mjs +494 -0
- package/scripts/lib/preset-registry.mjs +776 -0
- package/scripts/lib/preset-resource-contracts.mjs +83 -0
- package/scripts/lib/review-confirm-git-gate.mjs +248 -0
- package/scripts/lib/status-builder.mjs +88 -0
- package/scripts/lib/status-dashboard-renderer.mjs +105 -0
- package/scripts/lib/subagent-authorization-audit.mjs +196 -0
- package/scripts/lib/task-audit-metadata.mjs +385 -0
- package/scripts/lib/task-audit-migration.mjs +350 -0
- package/scripts/lib/task-completion-consistency.mjs +26 -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/create-task-helpers.mjs +67 -0
- package/scripts/lib/task-lifecycle/phase-sync.mjs +88 -0
- package/scripts/lib/task-lifecycle/review-confirm.mjs +112 -0
- package/scripts/lib/task-lifecycle/review-gates.mjs +73 -0
- package/scripts/lib/task-lifecycle/review-submission.mjs +63 -0
- package/scripts/lib/task-lifecycle/scaffold-provenance.mjs +49 -0
- package/scripts/lib/task-lifecycle/template-files.mjs +53 -0
- package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
- package/scripts/lib/task-lifecycle.mjs +338 -477
- package/scripts/lib/task-metadata.mjs +118 -0
- package/scripts/lib/task-review-model.mjs +455 -0
- package/scripts/lib/task-scanner.mjs +193 -372
- 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 +43 -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 +24 -18
- package/templates/dashboard/assets/app-src/00-state.js +13 -0
- package/templates/dashboard/assets/app-src/10-router.js +5 -1
- package/templates/dashboard/assets/app-src/20-overview.js +18 -8
- package/templates/dashboard/assets/app-src/30-tasks.js +92 -246
- package/templates/dashboard/assets/app-src/35-task-detail.js +286 -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/55-presets.js +375 -0
- package/templates/dashboard/assets/app-src/60-shared.js +3 -1
- package/templates/dashboard/assets/app-src/90-bindings.js +302 -29
- package/templates/dashboard/assets/app.css +1501 -376
- package/templates/dashboard/assets/app.css.manifest.json +10 -0
- package/templates/dashboard/assets/app.js +1240 -101
- package/templates/dashboard/assets/app.manifest.json +2 -0
- package/templates/dashboard/assets/css-src/00-foundation.css +346 -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 +489 -0
- package/templates/dashboard/assets/css-src/45-presets.css +516 -0
- package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
- package/templates/dashboard/assets/i18n.js +263 -23
- 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/INDEX.md +87 -0
- package/templates/planning/brief.md +1 -1
- package/templates/planning/execution_strategy.md +31 -0
- package/templates/planning/lesson_candidates.md +18 -6
- package/templates/planning/module_session_prompt.md +1 -0
- package/templates/planning/optional/artifacts/INDEX.md +3 -3
- package/templates/planning/optional/references/INDEX.md +3 -3
- package/templates/planning/review.md +41 -0
- package/templates/planning/task_plan.md +5 -21
- package/templates/planning/visual_map.md +13 -9
- package/templates/planning/visual_map.simple.md +52 -0
- package/templates/reference/execution-workflow-standard.md +31 -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 +25 -19
- package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
- package/templates-zh-CN/planning/INDEX.md +87 -0
- package/templates-zh-CN/planning/brief.md +1 -1
- 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/module_session_prompt.md +1 -0
- package/templates-zh-CN/planning/review.md +41 -1
- package/templates-zh-CN/planning/task_plan.md +4 -44
- package/templates-zh-CN/planning/visual_map.md +14 -7
- package/templates-zh-CN/planning/visual_map.simple.md +48 -0
- 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 +33 -7
- 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,224 @@
|
|
|
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 review evidence.
|
|
9
|
+
- `INDEX.md` stores Task Audit Metadata, including task creation and human review confirmation audit fields.
|
|
10
|
+
- `lesson_candidates.md` records lesson candidate decisions and sedimentation routing.
|
|
11
|
+
- `10-WALKTHROUGH/Closeout-SSoT.md` records closeout status and links walkthrough evidence.
|
|
12
|
+
- Tombstone / supersede metadata records whether a task was soft-deleted, merged, archived, or replaced.
|
|
13
|
+
- The scanner derives `lifecycleState`, `reviewStatus`, `closeoutStatus`, `taskQueues[]`, `queueReasons[]`, and `repairPrompt` from those files.
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
## Raw Task Command Flow
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
stateDiagram-v2
|
|
21
|
+
[*] --> not_started: new-task
|
|
22
|
+
not_started --> in_progress: task-start
|
|
23
|
+
planned --> in_progress: task-start
|
|
24
|
+
in_progress --> in_progress: task-log / task-phase
|
|
25
|
+
in_progress --> blocked: task-block
|
|
26
|
+
blocked --> in_progress: blocker fixed
|
|
27
|
+
in_progress --> review_submitted: task-review
|
|
28
|
+
review_submitted --> missing_materials: returned for materials
|
|
29
|
+
missing_materials --> in_progress: repair materials
|
|
30
|
+
review_submitted --> blocked: blocking finding
|
|
31
|
+
review_submitted --> human_confirmed: review-confirm
|
|
32
|
+
human_confirmed --> finalized: task-complete + closeout
|
|
33
|
+
finalized --> [*]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`task-review` means the agent submitted a review packet. It does not mean human approval. `review-confirm` is the human confirmation gate and writes its audit fields to `INDEX.md`. `task-complete` / closeout is not a substitute for review confirmation.
|
|
37
|
+
|
|
38
|
+
## Phase Kind Map
|
|
39
|
+
|
|
40
|
+
`visual_map.md` is the machine-readable phase timeline. New phase tables may include `Kind`, `Exit Command`, and `Actor` columns:
|
|
41
|
+
|
|
42
|
+
| Kind | Purpose | Counts Toward Implementation Completion | Typical Exit |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `init` | Scope, context, budget, and execution strategy. | no | `harness task-start <task-id>` |
|
|
45
|
+
| `execution` | Implementation, documentation, and verification slices. | yes | `harness task-phase <task-id> <phase-id> --state done --completion 100 --evidence present` |
|
|
46
|
+
| `gate` | Agent review submission, human confirmation, lesson routing, walkthrough, and closeout. | no | `harness task-review`, `harness review-confirm`, or `harness task-complete` |
|
|
47
|
+
|
|
48
|
+
Older phase tables without `Kind` remain valid and are treated as `execution`.
|
|
49
|
+
The Dashboard implementation score uses non-skipped `execution` phases only.
|
|
50
|
+
Gate phases explain the next lifecycle action and owner; they do not make a finished implementation look incomplete.
|
|
51
|
+
Agents may run `Exit Command` values with `Actor: agent`. `Actor: human` gates, especially `review-confirm`, require explicit human action.
|
|
52
|
+
|
|
53
|
+
## Derived State
|
|
54
|
+
|
|
55
|
+
```mermaid
|
|
56
|
+
flowchart TB
|
|
57
|
+
Progress["progress.md<br/>task.state + evidence"]
|
|
58
|
+
Index["INDEX.md<br/>Task Audit Metadata"]
|
|
59
|
+
Review["review.md<br/>Agent Review Submission + findings + evidence"]
|
|
60
|
+
Lessons["lesson_candidates.md<br/>decision + sedimentation route"]
|
|
61
|
+
Closeout["Closeout-SSoT.md<br/>closeout row + walkthrough"]
|
|
62
|
+
Tombstone["tombstone / supersede metadata"]
|
|
63
|
+
Scanner["scanner"]
|
|
64
|
+
|
|
65
|
+
Progress --> Scanner
|
|
66
|
+
Index --> Scanner
|
|
67
|
+
Review --> Scanner
|
|
68
|
+
Lessons --> Scanner
|
|
69
|
+
Closeout --> Scanner
|
|
70
|
+
Tombstone --> Scanner
|
|
71
|
+
|
|
72
|
+
Scanner --> Lifecycle["lifecycleState"]
|
|
73
|
+
Scanner --> ReviewStatus["reviewStatus"]
|
|
74
|
+
Scanner --> CloseoutStatus["closeoutStatus"]
|
|
75
|
+
Scanner --> Queues["taskQueues[]"]
|
|
76
|
+
Scanner --> Reasons["queueReasons[]"]
|
|
77
|
+
Scanner --> Prompt["repairPrompt"]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
| Field | Source | Purpose |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `task.state` | `progress.md` | Raw execution stage. |
|
|
83
|
+
| `reviewStatus` | `INDEX.md` Task Audit Metadata + `review.md` findings/submission | Separates missing review, agent-submitted review, blockers, and human confirmation. |
|
|
84
|
+
| `closeoutStatus` | `Closeout-SSoT.md` | Separates missing, pending, and closed closeout. |
|
|
85
|
+
| `lifecycleState` | scanner-derived | Main Dashboard lifecycle meaning. |
|
|
86
|
+
| `taskQueues[]` | scanner-derived | Which lifecycle queues include the task. A task can be visible in more than one governance queue. |
|
|
87
|
+
| `queueReasons[]` | scanner-derived | Why the task entered a queue, including source file, field, and repair action. |
|
|
88
|
+
| `repairPrompt` | scanner-derived | A copyable, scoped repair prompt for a Coding Agent. |
|
|
89
|
+
|
|
90
|
+
## Lifecycle Matrix
|
|
91
|
+
|
|
92
|
+
| Condition | `lifecycleState` | Meaning |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| Tombstone, superseded-by, archive, or abandoned marker exists | `soft-deleted-superseded` | Hidden by default, but preserved for audit and replacement tracing. |
|
|
95
|
+
| 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. |
|
|
96
|
+
| 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. |
|
|
97
|
+
| `task-review` was submitted, materials are ready, and `INDEX.md` does not show human confirmation | `review-submitted` | Truly waiting for human review. |
|
|
98
|
+
| `INDEX.md` shows human confirmation, but closeout / ledger / lessons are not fully closed | `confirmed-finalization-pending` | Accountability moved to the reviewer, but governance closeout remains. |
|
|
99
|
+
| `INDEX.md` shows human confirmation, and closeout / ledger / lesson routing are complete | `finalized` | Truly complete and traceable. |
|
|
100
|
+
| `task.state = blocked` without a review blocker | `active-blocked` | Execution is blocked. |
|
|
101
|
+
| `task.state = in_progress` | `active` | Work is active. |
|
|
102
|
+
| `task.state = planned/not_started` | `ready` | Work has not started; not in human review by default. |
|
|
103
|
+
|
|
104
|
+
## Review Status
|
|
105
|
+
|
|
106
|
+
| `reviewStatus` | Meaning |
|
|
107
|
+
| --- | --- |
|
|
108
|
+
| `missing` | No usable review document or Agent Review Submission exists. |
|
|
109
|
+
| `required` | Review document exists, but the packet is not ready for human review. |
|
|
110
|
+
| `submitted` | An agent submitted a review packet. This is not human confirmation. |
|
|
111
|
+
| `blocked-open-findings` | There is an open P0-P2 finding or a finding that blocks release / confirmation. |
|
|
112
|
+
| `confirmed` | `INDEX.md` Task Audit Metadata has `Human Review Status: confirmed` and committed audit fields. |
|
|
113
|
+
|
|
114
|
+
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 the confirmation audit fields in `INDEX.md`.
|
|
115
|
+
|
|
116
|
+
## Lifecycle Queues
|
|
117
|
+
|
|
118
|
+
The Dashboard lifecycle workbench is a set of queues, not one mixed review list.
|
|
119
|
+
|
|
120
|
+
```mermaid
|
|
121
|
+
flowchart TD
|
|
122
|
+
Task["task facts"]
|
|
123
|
+
Task --> Deleted{"tombstone / superseded / archived?"}
|
|
124
|
+
Deleted -->|yes| QDeleted["Soft-deleted / Superseded"]
|
|
125
|
+
Deleted -->|no| Blocker{"blocking finding or invalid transition?"}
|
|
126
|
+
Blocker -->|yes| QBlocked["Blocked"]
|
|
127
|
+
Blocker -->|no| Missing{"required materials missing?"}
|
|
128
|
+
Missing -->|yes| QMissing["Missing Materials"]
|
|
129
|
+
Missing -->|no| Submitted{"Agent Review Submission exists?"}
|
|
130
|
+
Submitted -->|yes + not human confirmed| QReview["Review"]
|
|
131
|
+
Submitted -->|no| Out["not in human review queue"]
|
|
132
|
+
Submitted -->|yes + human confirmed| Confirmed{"finalization complete?"}
|
|
133
|
+
Confirmed -->|no| QConfirmed["Confirmed / Finalized"]
|
|
134
|
+
Confirmed -->|yes| QFinal["Confirmed / Finalized"]
|
|
135
|
+
Task --> Lessons{"lesson candidate needs decision or sedimentation?"}
|
|
136
|
+
Lessons -->|yes| QLessons["Lessons"]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
| Queue | Entry condition | Primary owner | Exit condition |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| Review | Review packet submitted, materials ready, and no human confirmation yet. | human | Human confirms or returns it. |
|
|
142
|
+
| Missing Materials | Missing file, section, evidence, lesson decision, review submission, or incomplete phase. | agent | Agent repairs materials and resubmits review. |
|
|
143
|
+
| Blocked | Blocking finding, state conflict, Git audit failure, completion gate failure, or human waiver required. | agent + human | Fixed, closed, or explicitly waived. |
|
|
144
|
+
| 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. |
|
|
145
|
+
| Confirmed / Finalized | Human-confirmed, or finalized and ready for read-only tracing. | coordinator | Closeout, ledger, and lesson routing are complete; then read-only. |
|
|
146
|
+
| Soft-deleted / Superseded | Task was soft-deleted, replaced, merged, archived, or abandoned. | coordinator | Read-only tracing; reopen only when needed. |
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
|
|
150
|
+
## Global Table Boundary
|
|
151
|
+
|
|
152
|
+
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.
|
|
153
|
+
|
|
154
|
+
| Layer | Should record | Should not record |
|
|
155
|
+
| --- | --- | --- |
|
|
156
|
+
| 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 |
|
|
157
|
+
| 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 |
|
|
158
|
+
| 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 |
|
|
159
|
+
|
|
160
|
+
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.
|
|
161
|
+
|
|
162
|
+
## Human Confirmation Loop
|
|
163
|
+
|
|
164
|
+
```mermaid
|
|
165
|
+
sequenceDiagram
|
|
166
|
+
autonumber
|
|
167
|
+
participant Agent as Agent / coordinator
|
|
168
|
+
participant Human as Human reviewer
|
|
169
|
+
participant UI as Dashboard Workbench
|
|
170
|
+
participant API as workbench API
|
|
171
|
+
participant Lifecycle as task lifecycle writer
|
|
172
|
+
participant Docs as markdown files
|
|
173
|
+
participant Scanner as scanner
|
|
174
|
+
|
|
175
|
+
Agent->>Docs: write Agent Review Submission + evidence
|
|
176
|
+
Agent->>UI: submit task-review
|
|
177
|
+
Human->>UI: open Review queue item
|
|
178
|
+
UI->>API: POST /api/tasks/review-complete
|
|
179
|
+
API->>Scanner: read current task facts
|
|
180
|
+
Scanner-->>API: taskQueues, queueReasons, reviewStatus
|
|
181
|
+
alt not in Review queue
|
|
182
|
+
API-->>UI: reject with target queue
|
|
183
|
+
else missing material or blocker
|
|
184
|
+
API-->>UI: reject with repairPrompt
|
|
185
|
+
else accepted
|
|
186
|
+
API->>Lifecycle: confirmTaskReview()
|
|
187
|
+
Lifecycle->>Lifecycle: verify clean Git state, identity, hooks, allowlist
|
|
188
|
+
Lifecycle->>Docs: write confirmation fields to INDEX.md
|
|
189
|
+
Lifecycle->>Lifecycle: commit allowlisted INDEX.md
|
|
190
|
+
Lifecycle->>Docs: record confirmation commit SHA + committed audit status
|
|
191
|
+
API->>Scanner: regenerate dashboard snapshot
|
|
192
|
+
API-->>UI: confirmed task
|
|
193
|
+
end
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Strict rule: an agent can prepare review evidence and submit the task for review, but the task is not human-confirmed until the task `INDEX.md` contains committed confirmation audit fields. 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 `INDEX.md` allowlist, and return recovery guidance.
|
|
197
|
+
|
|
198
|
+
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.
|
|
199
|
+
|
|
200
|
+
## Lesson Sedimentation
|
|
201
|
+
|
|
202
|
+
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:
|
|
203
|
+
|
|
204
|
+
- Classifies scope and boundary reason.
|
|
205
|
+
- Reads the task-local detail artifact referenced by the candidate row instead of reconstructing the lesson from the brief row.
|
|
206
|
+
- Checks conflicts against existing lesson candidates, lesson detail docs, reference standards, templates, and checkers.
|
|
207
|
+
- Proposes a target diff or no-action reason.
|
|
208
|
+
- Writes the promoted lesson detail doc or standard update only after human approval.
|
|
209
|
+
|
|
210
|
+
`needs-promotion` should not block human review confirmation by itself, but it must enter the Lessons queue and remain traceable in closeout / ledger records.
|
|
211
|
+
|
|
212
|
+
## Soft Delete And Supersede
|
|
213
|
+
|
|
214
|
+
The document library does not hard-delete task directories by default.
|
|
215
|
+
|
|
216
|
+
| State | Meaning | Requirement |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| `active` | Normal task. | Dashboard shows it by default. |
|
|
219
|
+
| `soft-deleted` | Task was abandoned but the directory stays. | Write a tombstone with operator, timestamp, reason, and reopen eligibility. |
|
|
220
|
+
| `superseded` | Task was replaced or merged into a newer task. | Old task records `Superseded By`; new task records `Supersedes`. |
|
|
221
|
+
| `archived` | Task moved to archive. | Reference checks must pass first, and a redirect stub or generated index entry must remain. |
|
|
222
|
+
| `hard-deleted` | Physically deleted. | Forbidden by default; allowed only for mistaken tasks with no references, ledger, progress, or review evidence. |
|
|
223
|
+
|
|
224
|
+
The Soft-deleted / Superseded queue is read-only tracing. It tells users why a task is not active and which task replaced it.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# 任务状态机与生命周期队列
|
|
2
|
+
|
|
3
|
+
English mirror: `docs-release/guides/task-state-machine.en-US.md`
|
|
4
|
+
|
|
5
|
+
Coding Agent Harness 的任务状态不是一个单字段。Dashboard 里看到的生命周期由多个文件共同推导:
|
|
6
|
+
|
|
7
|
+
- `progress.md` 记录原始 `task.state` 和执行证据。
|
|
8
|
+
- `review.md` 记录 Agent Review Submission、material findings 和审查证据。
|
|
9
|
+
- `INDEX.md` 记录任务审计元数据,包括任务创建和人工确认审计字段。
|
|
10
|
+
- `lesson_candidates.md` 记录 lesson candidate 的人工判定和后续沉淀路由。
|
|
11
|
+
- `10-WALKTHROUGH/Closeout-SSoT.md` 记录任务是否完成收口,并链接 walkthrough。
|
|
12
|
+
- Tombstone / supersede 信息记录任务是否被软删除、合并、归档或替代。
|
|
13
|
+
- Scanner 从这些文件推导 `lifecycleState`、`reviewStatus`、`closeoutStatus`、`taskQueues[]`、`queueReasons[]` 和 `repairPrompt`。
|
|
14
|
+
|
|
15
|
+
旧版 `reviewQueueState` 只适合表示单一审查页面。PF-024 后,公开模型改为多个生命周期队列:Review、Missing Materials、Blocked、Lessons、Confirmed / Finalized、Soft-deleted / Superseded。
|
|
16
|
+
|
|
17
|
+
## 原始任务命令流
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
stateDiagram-v2
|
|
21
|
+
[*] --> not_started: new-task
|
|
22
|
+
not_started --> in_progress: task-start
|
|
23
|
+
planned --> in_progress: task-start
|
|
24
|
+
in_progress --> in_progress: task-log / task-phase
|
|
25
|
+
in_progress --> blocked: task-block
|
|
26
|
+
blocked --> in_progress: blocker fixed
|
|
27
|
+
in_progress --> review_submitted: task-review
|
|
28
|
+
review_submitted --> missing_materials: returned for materials
|
|
29
|
+
missing_materials --> in_progress: repair materials
|
|
30
|
+
review_submitted --> blocked: blocking finding
|
|
31
|
+
review_submitted --> human_confirmed: review-confirm
|
|
32
|
+
human_confirmed --> finalized: task-complete + closeout
|
|
33
|
+
finalized --> [*]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`task-review` 表示 Agent 提交审查材料包,不表示人工批准。`review-confirm` 才表示人工确认门禁,并把审计字段写入 `INDEX.md`。`task-complete` / closeout 也不是 review confirmation 的替代品。
|
|
37
|
+
|
|
38
|
+
## 阶段类型地图
|
|
39
|
+
|
|
40
|
+
`visual_map.md` 是机器可读的阶段时间线。新的阶段表可以包含 `Kind`、`Exit Command` 和 `Actor` 三列:
|
|
41
|
+
|
|
42
|
+
| Kind | 作用 | 是否计入实现完成度 | 典型出口 |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `init` | 范围、上下文、预算和执行策略。 | 否 | `harness task-start <task-id>` |
|
|
45
|
+
| `execution` | 实现、文档和验证切片。 | 是 | `harness task-phase <task-id> <phase-id> --state done --completion 100 --evidence present` |
|
|
46
|
+
| `gate` | Agent 提交审查、人工确认、lesson routing、walkthrough 和 closeout。 | 否 | `harness task-review`、`harness review-confirm` 或 `harness task-complete` |
|
|
47
|
+
|
|
48
|
+
旧阶段表没有 `Kind` 也继续有效,默认按 `execution` 处理。
|
|
49
|
+
Dashboard 实现完成度只计算非 skipped 的 `execution` 阶段。
|
|
50
|
+
Gate 阶段用于解释下一步生命周期动作和责任人,不会让已完成的实现看起来未完成。
|
|
51
|
+
Agent 只能执行 `Actor: agent` 的 `Exit Command`。`Actor: human` 的 gate,尤其是 `review-confirm`,必须由人工明确执行。
|
|
52
|
+
|
|
53
|
+
## 派生状态
|
|
54
|
+
|
|
55
|
+
```mermaid
|
|
56
|
+
flowchart TB
|
|
57
|
+
Progress["progress.md<br/>task.state + evidence"]
|
|
58
|
+
Index["INDEX.md<br/>Task Audit Metadata"]
|
|
59
|
+
Review["review.md<br/>Agent Review Submission + findings + evidence"]
|
|
60
|
+
Lessons["lesson_candidates.md<br/>decision + sedimentation route"]
|
|
61
|
+
Closeout["Closeout-SSoT.md<br/>closeout row + walkthrough"]
|
|
62
|
+
Tombstone["tombstone / supersede metadata"]
|
|
63
|
+
Scanner["scanner"]
|
|
64
|
+
|
|
65
|
+
Progress --> Scanner
|
|
66
|
+
Index --> Scanner
|
|
67
|
+
Review --> Scanner
|
|
68
|
+
Lessons --> Scanner
|
|
69
|
+
Closeout --> Scanner
|
|
70
|
+
Tombstone --> Scanner
|
|
71
|
+
|
|
72
|
+
Scanner --> Lifecycle["lifecycleState"]
|
|
73
|
+
Scanner --> ReviewStatus["reviewStatus"]
|
|
74
|
+
Scanner --> CloseoutStatus["closeoutStatus"]
|
|
75
|
+
Scanner --> Queues["taskQueues[]"]
|
|
76
|
+
Scanner --> Reasons["queueReasons[]"]
|
|
77
|
+
Scanner --> Prompt["repairPrompt"]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
| 字段 | 来源 | 作用 |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| `task.state` | `progress.md` | 原始执行阶段。 |
|
|
83
|
+
| `reviewStatus` | `INDEX.md` Task Audit Metadata + `review.md` findings/submission | 区分缺审查、Agent 已提交审查、阻塞、人工确认。 |
|
|
84
|
+
| `closeoutStatus` | `Closeout-SSoT.md` | 区分收口缺失、待处理、已关闭。 |
|
|
85
|
+
| `lifecycleState` | scanner 派生 | Dashboard 的主生命周期语义。 |
|
|
86
|
+
| `taskQueues[]` | scanner 派生 | 任务属于哪些生命周期队列。一个任务可同时在多个治理队列中可见。 |
|
|
87
|
+
| `queueReasons[]` | scanner 派生 | 为什么进入队列,以及对应源文件、字段和修复动作。 |
|
|
88
|
+
| `repairPrompt` | scanner 派生 | 可复制给 Coding Agent 的受限修复提示。 |
|
|
89
|
+
|
|
90
|
+
## 生命周期矩阵
|
|
91
|
+
|
|
92
|
+
| 条件 | `lifecycleState` | 含义 |
|
|
93
|
+
| --- | --- | --- |
|
|
94
|
+
| 有 tombstone、superseded-by、archive 或 abandoned 标记 | `soft-deleted-superseded` | 默认隐藏,但保留审计和替代链。 |
|
|
95
|
+
| 有 open P0-P2 finding、非法状态转换、审计失败或人审门禁失败 | `blocked` | 不能进入人工确认,必须先修 blocker 或记录 waiver。 |
|
|
96
|
+
| 标准/复杂任务缺必需文件、章节、证据、lesson decision 或 review submission | `missing-materials` | 需要 Agent 补材料,不属于人审队列。 |
|
|
97
|
+
| 已执行 `task-review`,材料齐全,且 `INDEX.md` 尚未显示人工确认 | `review-submitted` | 真正等待人审。 |
|
|
98
|
+
| `INDEX.md` 已显示人工确认,但 closeout / ledger / lessons 仍未全部收口 | `confirmed-finalization-pending` | 责任已转移给确认人,但治理收口仍待完成。 |
|
|
99
|
+
| `INDEX.md` 已显示人工确认,且 closeout / ledger / lesson routing 完成 | `finalized` | 真正完成,可只读追溯。 |
|
|
100
|
+
| `task.state = blocked` 但没有 review blocker | `active-blocked` | 执行阻塞。 |
|
|
101
|
+
| `task.state = in_progress` | `active` | 执行中。 |
|
|
102
|
+
| `task.state = planned/not_started` | `ready` | 准备中,默认不进入人审队列。 |
|
|
103
|
+
|
|
104
|
+
## 审查状态
|
|
105
|
+
|
|
106
|
+
| `reviewStatus` | 含义 |
|
|
107
|
+
| --- | --- |
|
|
108
|
+
| `missing` | 没有可用 review 文档或缺 Agent Review Submission。 |
|
|
109
|
+
| `required` | 有 review 文档,但还没有足够材料可提交人审。 |
|
|
110
|
+
| `submitted` | Agent 已提交审查材料包;这不是人工确认。 |
|
|
111
|
+
| `blocked-open-findings` | 有 open P0-P2 finding,或 finding 阻塞发布 / 确认。 |
|
|
112
|
+
| `confirmed` | `INDEX.md` Task Audit Metadata 包含 `Human Review Status: confirmed` 和已提交审计字段。 |
|
|
113
|
+
|
|
114
|
+
Agent 自查、subagent 审查和 coordinator 审查都只能让任务接近 `submitted`。只有 `review-confirm` 或 Workbench 的明确人工确认动作会把确认审计字段写入 `INDEX.md`。
|
|
115
|
+
|
|
116
|
+
## 生命周期队列
|
|
117
|
+
|
|
118
|
+
Dashboard 的 lifecycle workbench 是多个队列,不是一个混合 review 列表。
|
|
119
|
+
|
|
120
|
+
```mermaid
|
|
121
|
+
flowchart TD
|
|
122
|
+
Task["task facts"]
|
|
123
|
+
Task --> Deleted{"tombstone / superseded / archived?"}
|
|
124
|
+
Deleted -->|yes| QDeleted["Soft-deleted / Superseded"]
|
|
125
|
+
Deleted -->|no| Blocker{"blocking finding or invalid transition?"}
|
|
126
|
+
Blocker -->|yes| QBlocked["Blocked"]
|
|
127
|
+
Blocker -->|no| Missing{"required materials missing?"}
|
|
128
|
+
Missing -->|yes| QMissing["Missing Materials"]
|
|
129
|
+
Missing -->|no| Submitted{"Agent Review Submission exists?"}
|
|
130
|
+
Submitted -->|yes + not human confirmed| QReview["Review"]
|
|
131
|
+
Submitted -->|no| Out["not in human review queue"]
|
|
132
|
+
Submitted -->|yes + human confirmed| Confirmed{"finalization complete?"}
|
|
133
|
+
Confirmed -->|no| QConfirmed["Confirmed / Finalized"]
|
|
134
|
+
Confirmed -->|yes| QFinal["Confirmed / Finalized"]
|
|
135
|
+
Task --> Lessons{"lesson candidate needs decision or sedimentation?"}
|
|
136
|
+
Lessons -->|yes| QLessons["Lessons"]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
| 队列 | 进入条件 | 主要责任方 | 退出条件 |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| Review | 已提交 review packet,材料齐,且未人工确认。 | human | 人工确认或退回。 |
|
|
142
|
+
| Missing Materials | 缺文件、缺章节、缺证据、缺 lesson decision、缺 review submission 或 phase 未完成。 | agent | 补齐材料并重新提交 review。 |
|
|
143
|
+
| Blocked | 有 blocking finding、状态矛盾、Git 审计失败、完成门禁失败或需要 human waiver。 | agent + human | 修复、关闭、或人工豁免。 |
|
|
144
|
+
| Lessons | lesson candidate 需要判定、保留、拒绝、dry-run promotion 或创建沉淀任务。 | human + agent | 决策完成,或创建可追踪沉淀任务。 |
|
|
145
|
+
| Confirmed / Finalized | 已人工确认,或已结项需要只读追溯。 | coordinator | closeout、ledger、lesson routing 全部完成;之后只读。 |
|
|
146
|
+
| Soft-deleted / Superseded | 任务被软删除、替代、合并、归档或废弃。 | coordinator | 只读追溯;必要时 reopen。 |
|
|
147
|
+
|
|
148
|
+
Review 队列只等人确认。缺材料、阻塞、lesson 沉淀、已确认待结项、历史替代任务都不应伪装成 Review 队列项。
|
|
149
|
+
|
|
150
|
+
## 全局表边界
|
|
151
|
+
|
|
152
|
+
全局治理表只保留索引、状态、路由和审计摘要。它们帮助 Dashboard 找到事实位置,
|
|
153
|
+
但不承载模块局部事实、长证据、执行流水或临时修复提示。
|
|
154
|
+
|
|
155
|
+
| 层级 | 应该记录什么 | 不应该记录什么 |
|
|
156
|
+
| --- | --- | --- |
|
|
157
|
+
| 全局表:Harness Ledger、Closeout SSoT、Regression SSoT、Cadence Ledger、Delivery SSoT | 当前状态、负责人、任务/模块/详情文档链接、回归 gate、交付顺序、收口或审计摘要 | 模块内步骤、未判定 lesson candidate、完整命令输出、长证据段落、review transcript、临时 repair prompt |
|
|
158
|
+
| 模块层:Module Registry、`module_plan.md` | 模块边界、模块内步骤、handoff、当前阻塞和局部证据索引 | 已 promotion 的全局 lesson 正文、跨模块发布审计总账 |
|
|
159
|
+
| 任务层:`brief.md`、`task_plan.md`、`progress.md`、`review.md`、`lesson_candidates.md`、`lessons/LC-*.md`、`artifacts/INDEX.md` | 执行细节、证据、agent review、候选 lesson、task-local lesson 详情、修复提示和 raw artifact 路由 | 跨任务总账或 promoted lesson 详情正文 |
|
|
160
|
+
|
|
161
|
+
Checker 对新增全局表行执行该边界。2026-05-24 之前已经存在的过载行默认作为
|
|
162
|
+
`legacy-report-only` 出现在 Dashboard 迁移建议里,不会被自动删除或批量改写。
|
|
163
|
+
新增行如果把 task/module 局部细节继续塞进全局表,会作为 `governance-table-entropy`
|
|
164
|
+
失败项报告。Lesson candidate 留在 `lesson_candidates.md`;进入 `needs-promotion`
|
|
165
|
+
的候选必须链接任务本地 `lessons/LC-*.md` 详情文件,已接受的经验再写入
|
|
166
|
+
`docs/01-GOVERNANCE/lessons/*.md` promoted 详情文档。修复方式是保留必要全局摘要行,
|
|
167
|
+
把细节移动到 module/task/detail 文档并在全局表中链接过去。
|
|
168
|
+
|
|
169
|
+
## 人工确认闭环
|
|
170
|
+
|
|
171
|
+
```mermaid
|
|
172
|
+
sequenceDiagram
|
|
173
|
+
autonumber
|
|
174
|
+
participant Agent as Agent / coordinator
|
|
175
|
+
participant Human as Human reviewer
|
|
176
|
+
participant UI as Dashboard Workbench
|
|
177
|
+
participant API as workbench API
|
|
178
|
+
participant Lifecycle as task lifecycle writer
|
|
179
|
+
participant Docs as markdown files
|
|
180
|
+
participant Scanner as scanner
|
|
181
|
+
|
|
182
|
+
Agent->>Docs: write Agent Review Submission + evidence
|
|
183
|
+
Agent->>UI: submit task-review
|
|
184
|
+
Human->>UI: open Review queue item
|
|
185
|
+
UI->>API: POST /api/tasks/review-complete
|
|
186
|
+
API->>Scanner: read current task facts
|
|
187
|
+
Scanner-->>API: taskQueues, queueReasons, reviewStatus
|
|
188
|
+
alt not in Review queue
|
|
189
|
+
API-->>UI: reject with target queue
|
|
190
|
+
else missing material or blocker
|
|
191
|
+
API-->>UI: reject with repairPrompt
|
|
192
|
+
else accepted
|
|
193
|
+
API->>Lifecycle: confirmTaskReview()
|
|
194
|
+
Lifecycle->>Lifecycle: verify Git clean, identity, hooks, allowlist
|
|
195
|
+
Lifecycle->>Docs: write confirmation fields to INDEX.md
|
|
196
|
+
Lifecycle->>Lifecycle: commit allowlisted INDEX.md
|
|
197
|
+
Lifecycle->>Docs: record confirmation commit SHA + committed audit status
|
|
198
|
+
API->>Scanner: regenerate dashboard snapshot
|
|
199
|
+
API-->>UI: confirmed task
|
|
200
|
+
end
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
严格规则:Agent 可以准备 review evidence,也可以提交审查;但任务只有在任务 `INDEX.md` 包含已提交的确认审计字段后,才算人工确认。确认动作必须通过 gated auto-commit:Git 状态不干净、提交身份缺失、hook/preflight 失败,或待写文件超出当前任务 `INDEX.md` 白名单时,CLI 和 Workbench 都会拒绝并返回恢复建议。
|
|
204
|
+
|
|
205
|
+
CLI-owned 机械写入和 agent-owned 手工切片是两条边界。`new-task`、`task-*`、`task-phase`、`module-step`、`review-confirm`、`lesson-sediment` 和 `lesson-promote --apply` 会在干净 Git root 中加锁、限制写入范围并自动提交。Agent 手工编辑代码、模板或任务文档时仍要在验证后主动提交;无法提交时必须记录 no-commit reason、owner 和下一步,不能把 unrelated dirty changes 混入任务提交。
|
|
206
|
+
|
|
207
|
+
## Lesson 沉淀
|
|
208
|
+
|
|
209
|
+
Lesson promotion 默认不写共享 Lessons 表。Dashboard 或 CLI 应优先创建 dry-run 或后续沉淀任务,让执行者先完成:
|
|
210
|
+
|
|
211
|
+
- 分类 scope 和边界原因。
|
|
212
|
+
- 读取候选行的 `Detail Artifact` 指向的任务本地详情文件,不从表格 brief 复写正文。
|
|
213
|
+
- 检查既有 lesson candidate、lesson detail doc、reference standard、template、checker 是否冲突。
|
|
214
|
+
- 给出目标 diff 或 no-action 理由。
|
|
215
|
+
- 由人工批准后再写 promoted lesson 详情文档或标准文档。
|
|
216
|
+
|
|
217
|
+
`needs-promotion` 不应阻塞人审确认本身,但必须进入 Lessons 队列,并在 closeout / ledger 中可追踪。
|
|
218
|
+
|
|
219
|
+
## 软删除与替代
|
|
220
|
+
|
|
221
|
+
文档库默认不 hard delete 任务目录。
|
|
222
|
+
|
|
223
|
+
| 状态 | 含义 | 要求 |
|
|
224
|
+
| --- | --- | --- |
|
|
225
|
+
| `active` | 正常任务。 | Dashboard 默认显示。 |
|
|
226
|
+
| `soft-deleted` | 任务被废弃但保留目录。 | 写 tombstone,记录操作者、时间、原因和 reopen eligibility。 |
|
|
227
|
+
| `superseded` | 任务被新任务替代或合并。 | 旧任务记录 `Superseded By`,新任务记录 `Supersedes`。 |
|
|
228
|
+
| `archived` | 任务移入归档。 | 必须先通过引用检查,并留下 redirect stub 或 generated index entry。 |
|
|
229
|
+
| `hard-deleted` | 物理删除。 | 默认禁止;只允许误创建且无引用、无 ledger、无 progress、无 review 证据的任务。 |
|
|
230
|
+
|
|
231
|
+
Soft-deleted / Superseded 队列用于只读追溯,帮助用户看清“为什么这个任务不在活跃队列里”以及替代任务是谁。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Coding Agent Harness keeps coding-agent work inside the repository instead of leaving it buried in chat history. Plans, progress, reviews, migration notes, and dashboard snapshots stay with the code.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
## How It Works
|
|
8
8
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Demo task - Task Package Index
|
|
2
|
+
|
|
3
|
+
Task Contract: harness-task/v1
|
|
4
|
+
|
|
5
|
+
## Task Identity
|
|
6
|
+
|
|
7
|
+
| Field | Value |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Task ID | `demo-task` |
|
|
10
|
+
| Budget | `standard` |
|
|
11
|
+
| Preset | `none` |
|
|
12
|
+
| Module | `n/a` |
|
|
13
|
+
| Long-running | `no` |
|
|
14
|
+
| Created | 2026-05-25 |
|
|
15
|
+
|
|
16
|
+
## Task Audit Metadata
|
|
17
|
+
|
|
18
|
+
| Field | Value |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Created By | historical-backfill |
|
|
21
|
+
| Created At | 2026-05-25 |
|
|
22
|
+
| Command Shape | n/a |
|
|
23
|
+
| Budget | standard |
|
|
24
|
+
| Template Source | examples/minimal-project historical fixture |
|
|
25
|
+
| Task Creator | n/a |
|
|
26
|
+
| Task Creator Source | legacy-unavailable |
|
|
27
|
+
| Human Review Status | not-confirmed |
|
|
28
|
+
| Confirmation ID | n/a |
|
|
29
|
+
| Confirmed At | n/a |
|
|
30
|
+
| Reviewer | n/a |
|
|
31
|
+
| Reviewer Email | n/a |
|
|
32
|
+
| Confirm Text | n/a |
|
|
33
|
+
| Evidence Checked | n/a |
|
|
34
|
+
| Review Commit SHA | n/a |
|
|
35
|
+
| Audit Source | migrated-legacy-scaffold |
|
|
36
|
+
| Audit Status | migrated |
|
|
37
|
+
| Exception Reason | Existing demo task predates scaffold provenance enforcement. |
|
|
38
|
+
| Message | n/a |
|
|
39
|
+
| Migration Status | migrated |
|
|
40
|
+
| Migrated From | brief.md#Scaffold Provenance |
|
|
41
|
+
| Legacy Extra Fields | {} |
|
|
42
|
+
| Migration Notes | example fixture backfilled to INDEX audit metadata |
|
|
43
|
+
|
|
44
|
+
## Core Contract Files
|
|
45
|
+
|
|
46
|
+
| File | Purpose |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `brief.md` | Human-readable task summary and context entry. |
|
|
49
|
+
| `task_plan.md` | Current task goal, scope, selected budget, acceptance, and operating decisions. |
|
|
50
|
+
| `visual_map.md` | Phase map, evidence status, next lifecycle commands, and supporting diagrams. |
|
|
51
|
+
| `progress.md` | Execution log, verification evidence, decisions, and handoff notes. |
|
|
52
|
+
|
|
53
|
+
## Standard Task Files
|
|
54
|
+
|
|
55
|
+
| File | Purpose |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `execution_strategy.md` | Execution mode, ownership, conflict control, and evidence strategy. |
|
|
58
|
+
| `findings.md` | Findings, research notes, accepted risks, and unresolved questions. |
|
|
59
|
+
| `lesson_candidates.md` | Task-local lesson candidate decisions before closeout. |
|
|
60
|
+
| `review.md` | Agent review submission, adversarial review, findings, evidence, and routing. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coding-agent-harness",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Document governance kernel for long-running coding agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -31,17 +31,23 @@
|
|
|
31
31
|
"status": "node scripts/harness.mjs status --json .",
|
|
32
32
|
"dashboard": "node scripts/harness.mjs dashboard --out tmp/harness-dashboard.html examples/minimal-project",
|
|
33
33
|
"dashboard:folder": "node scripts/harness.mjs dashboard --out-dir tmp/harness-dashboard examples/minimal-project",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"pack:dry-run": "npm pack --dry-run --json",
|
|
35
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
36
|
+
"smoke:dashboard": "node tests/smoke-dashboard.mjs",
|
|
37
|
+
"test": "node tests/run-all.mjs"
|
|
36
38
|
},
|
|
37
39
|
"files": [
|
|
38
40
|
"README.md",
|
|
39
41
|
"README.en-US.md",
|
|
40
42
|
"README.zh-CN.md",
|
|
43
|
+
"CONTRIBUTING.md",
|
|
41
44
|
"CHANGELOG.md",
|
|
42
45
|
"SKILL.md",
|
|
43
46
|
"LICENSE",
|
|
47
|
+
"LICENSE-EXCEPTION.md",
|
|
44
48
|
"references/",
|
|
49
|
+
"skills/",
|
|
50
|
+
"presets/",
|
|
45
51
|
"templates/",
|
|
46
52
|
"templates-zh-CN/",
|
|
47
53
|
"scripts/",
|
|
@@ -51,5 +57,5 @@
|
|
|
51
57
|
"engines": {
|
|
52
58
|
"node": ">=18"
|
|
53
59
|
},
|
|
54
|
-
"license": "
|
|
60
|
+
"license": "AGPL-3.0-or-later"
|
|
55
61
|
}
|