@code-migration/wow-migrator 0.1.4 → 0.1.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/package.json +1 -1
- package/skills/migration-task-adapter/SKILL.md +9 -11
- package/skills/migration-task-adapter/bind.md +4 -1
- package/skills/migration-task-adapter/output-contract.md +276 -0
- package/skills/migration-task-adapter/roles/adapter-report.md +2 -0
- package/skills/migration-task-adapter/roles/adapter-workspace-state.md +2 -0
- package/skills/migration-task-adapter/roles/task-route-orchestrator.md +5 -2
- package/skills/migration-task-adapter/workflow.md +8 -2
package/package.json
CHANGED
|
@@ -29,6 +29,8 @@ roles:
|
|
|
29
29
|
|
|
30
30
|
Front-door adapter for the KMP Migration Toolkit. It does not replace `android-project-analyst`, `android-to-kmp-migrator`, or `kmp-test-validator`. It classifies the user task, invokes the right downstream workflow, enforces stage gates, records consumed artifacts, and produces a final adapter report.
|
|
31
31
|
|
|
32
|
+
**Canonical file recording system**: [output-contract.md](output-contract.md) defines every adapter output path, required content, write order, and **handoff package gates** (`A0`–`A6`). The Leader MUST read `output-contract.md` before the first dispatch and MUST NOT claim completion without updating `handoff_gates` in `adapter_workspace_state.json`.
|
|
33
|
+
|
|
32
34
|
## Task Routes
|
|
33
35
|
|
|
34
36
|
| Route | Downstream |
|
|
@@ -61,6 +63,7 @@ Front-door adapter for the KMP Migration Toolkit. It does not replace `android-p
|
|
|
61
63
|
|
|
62
64
|
| File | Contents |
|
|
63
65
|
|---|---|
|
|
66
|
+
| [output-contract.md](output-contract.md) | Canonical path tree, artifact registry, gates `A0`–`A6`, downstream root recording |
|
|
64
67
|
| [workflow.md](workflow.md) | Topology, route matrix, stage gates, report shape |
|
|
65
68
|
| [bind.md](bind.md) | Guardrails, path contract, failure handling |
|
|
66
69
|
| [dependencies.yaml](dependencies.yaml) | Downstream skills and optional tools |
|
|
@@ -68,8 +71,11 @@ Front-door adapter for the KMP Migration Toolkit. It does not replace `android-p
|
|
|
68
71
|
|
|
69
72
|
## Output Layout
|
|
70
73
|
|
|
74
|
+
See [output-contract.md](output-contract.md) for the full folder tree, filename invariants, and handoff packages `A0`–`A6`. Summary path variables:
|
|
75
|
+
|
|
71
76
|
```text
|
|
72
77
|
output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
|
|
78
|
+
downstream_index_dir = <output_root>/downstream-index
|
|
73
79
|
workspace_state_dir = <output_root>/workspace-state
|
|
74
80
|
route_orchestration_dir = <output_root>/route-orchestration
|
|
75
81
|
stage_inspection_dir = <output_root>/stage-inspections
|
|
@@ -77,24 +83,16 @@ intermediate_asset_dir = <output_root>/intermediate-assets
|
|
|
77
83
|
report_dir = <output_root>/report
|
|
78
84
|
```
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- `run_manifest.json`
|
|
83
|
-
- `route-orchestration/route/task_route.json`, `.md`
|
|
84
|
-
- `workspace-state/adapter_workspace_state.json`, `.md`
|
|
85
|
-
- `route-orchestration/orchestrate/workflow_orchestration.json`, `.md`
|
|
86
|
-
- `stage-inspections/<stage_id>/stage_inspection.json`, `.md`
|
|
87
|
-
- `intermediate-assets/intermediate_asset_records.json`, `.md`
|
|
88
|
-
- `report/adapter_report.json`, `.md`
|
|
86
|
+
Downstream workflows write only to their own output roots; the adapter records paths in `downstream-index/` and `intermediate-assets/`.
|
|
89
87
|
|
|
90
|
-
|
|
88
|
+
Any artifact written outside the path tree in `output-contract.md` is **invalid** — adapter roles MUST return `blocked` with `reason: out_of_path`.
|
|
91
89
|
|
|
92
90
|
## Artifact Owners
|
|
93
91
|
|
|
94
92
|
| Owner | Artifacts |
|
|
95
93
|
|---|---|
|
|
96
94
|
| Leader | `run_manifest.json` |
|
|
97
|
-
| `task-route-orchestrator` | `task_route.*`, `workflow_orchestration.*` |
|
|
95
|
+
| `task-route-orchestrator` | `task_route.*`, `workflow_orchestration.*`, `downstream_workflow_index.*` |
|
|
98
96
|
| `adapter-workspace-state` | `adapter_workspace_state.*`, `stage_inspection.*`, `intermediate_asset_records.*` |
|
|
99
97
|
| `adapter-report` | `adapter_report.*` |
|
|
100
98
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
- **Orchestrator only** — classify, route, inspect, record, report. No analysis, migration, validation, or code edits.
|
|
17
17
|
- **Route before downstream** — `task-route-orchestrator` mode `route` completes before workflow invoke.
|
|
18
|
-
- **Strict output root** — `output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
|
|
18
|
+
- **Strict output root** — `output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter`; paths and gates per [output-contract.md](output-contract.md).
|
|
19
19
|
- **Downstream boundary** — analyst/migrator/validator artifacts stay in their output roots; adapter records paths in asset ledger.
|
|
20
20
|
- **Validator root** — validation artifacts under parallel `validation` root, not migration root.
|
|
21
21
|
- **Stage gates** — every route and downstream boundary gets `stage_inspection.*` with `pass | needs_rerun | blocked`.
|
|
@@ -37,9 +37,12 @@
|
|
|
37
37
|
|
|
38
38
|
## Path Contract
|
|
39
39
|
|
|
40
|
+
Canonical paths and handoff gates `A0`–`A6`: [output-contract.md](output-contract.md).
|
|
41
|
+
|
|
40
42
|
```json
|
|
41
43
|
{
|
|
42
44
|
"output_root": "<output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter",
|
|
45
|
+
"downstream_index_dir": "<output_root>/downstream-index",
|
|
43
46
|
"workspace_state_dir": "<output_root>/workspace-state",
|
|
44
47
|
"route_orchestration_dir": "<output_root>/route-orchestration",
|
|
45
48
|
"stage_inspection_dir": "<output_root>/stage-inspections",
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# Output Contract: Adapter File Recording, Downstream Roots, And Trigger Gates
|
|
2
|
+
|
|
3
|
+
This document is the **canonical path and content contract** for `migration-task-adapter`. Downstream controllers and human/agent orchestrators **MUST treat missing, empty, out-of-path, stale, or schema-invalid adapter artifacts as hard blockers** — they do not infer route, stage, or readiness from chat summaries.
|
|
4
|
+
|
|
5
|
+
The Leader and every node MUST read this file before writing artifacts. When `SKILL.md` or `workflow.md` diverge, **this file wins on paths, filenames, downstream root recording, and trigger gates**.
|
|
6
|
+
|
|
7
|
+
## Downstream Output Roots (read-only consumption)
|
|
8
|
+
|
|
9
|
+
The adapter records but does not write into downstream workflow roots:
|
|
10
|
+
|
|
11
|
+
| Workflow | Default `output_root` |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `android-project-analyst` | `<output_dir or ~/.a2c_agents/understand>/android-project-analyst` |
|
|
14
|
+
| `android-to-kmp-migrator` | `<output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator` |
|
|
15
|
+
| `kmp-test-validator` | `<output_dir or ~/.a2c_agents/validation>/kmp-test-validator` |
|
|
16
|
+
|
|
17
|
+
Validator artifacts MUST stay under the parallel `validation` root — never under the migration root.
|
|
18
|
+
|
|
19
|
+
**Fail closed**: adapter roles MUST NOT claim downstream pass without durable report artifacts and matching stage inspection support.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Adapter Output Root Layout
|
|
24
|
+
|
|
25
|
+
Lock one `output_root` before any dispatch:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
|
|
29
|
+
|
|
30
|
+
<output_root>/
|
|
31
|
+
├── run_manifest.json
|
|
32
|
+
├── downstream-index/
|
|
33
|
+
│ ├── downstream_workflow_index.json
|
|
34
|
+
│ └── downstream_workflow_index.md
|
|
35
|
+
├── workspace-state/
|
|
36
|
+
│ ├── adapter_workspace_state.json
|
|
37
|
+
│ └── adapter_workspace_state.md
|
|
38
|
+
├── route-orchestration/
|
|
39
|
+
│ ├── route/
|
|
40
|
+
│ │ ├── task_route.json
|
|
41
|
+
│ │ └── task_route.md
|
|
42
|
+
│ └── orchestrate/
|
|
43
|
+
│ ├── workflow_orchestration.json
|
|
44
|
+
│ └── workflow_orchestration.md
|
|
45
|
+
├── stage-inspections/
|
|
46
|
+
│ └── <stage_id>/
|
|
47
|
+
│ ├── stage_inspection.json
|
|
48
|
+
│ └── stage_inspection.md
|
|
49
|
+
├── intermediate-assets/
|
|
50
|
+
│ ├── intermediate_asset_records.json
|
|
51
|
+
│ └── intermediate_asset_records.md
|
|
52
|
+
└── report/
|
|
53
|
+
├── adapter_report.json
|
|
54
|
+
└── adapter_report.md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Path Variables (stable across runs)
|
|
58
|
+
|
|
59
|
+
| Variable | Resolved path |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `output_root` | `<output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter` |
|
|
62
|
+
| `downstream_index_dir` | `<output_root>/downstream-index` |
|
|
63
|
+
| `workspace_state_dir` | `<output_root>/workspace-state` |
|
|
64
|
+
| `route_orchestration_dir` | `<output_root>/route-orchestration` |
|
|
65
|
+
| `route_dir` | `<route_orchestration_dir>/route` |
|
|
66
|
+
| `orchestrate_dir` | `<route_orchestration_dir>/orchestrate` |
|
|
67
|
+
| `stage_inspection_dir` | `<output_root>/stage-inspections` |
|
|
68
|
+
| `stage_dir` | `<stage_inspection_dir>/<stage_id>` |
|
|
69
|
+
| `intermediate_asset_dir` | `<output_root>/intermediate-assets` |
|
|
70
|
+
| `report_dir` | `<output_root>/report` |
|
|
71
|
+
|
|
72
|
+
### Filename Invariants (downstream parsers depend on these)
|
|
73
|
+
|
|
74
|
+
- JSON primary artifacts use **snake_case** basenames (`task_route.json`, `workflow_orchestration.json`, `adapter_workspace_state.json`).
|
|
75
|
+
- Route/orchestration subfolders use fixed names: `route/`, `orchestrate/`.
|
|
76
|
+
- Stage folders use **kebab-case** `stage_id` values listed below.
|
|
77
|
+
- No adapter artifact outside `<output_root>/` is valid for gates below.
|
|
78
|
+
|
|
79
|
+
### Stage IDs (folder names under `stage-inspections/`)
|
|
80
|
+
|
|
81
|
+
| `stage_id` | When required |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `route_decision` | After `task-route-orchestrator` mode `route` |
|
|
84
|
+
| `pre_downstream_dispatch` | Before downstream workflow invoke |
|
|
85
|
+
| `post_analyst` | After analyst workflow when route requires it |
|
|
86
|
+
| `post_migrator` | After migrator workflow when route requires it |
|
|
87
|
+
| `post_validator` | After validator workflow when route requires it |
|
|
88
|
+
| `pre_report` | Before `adapter-report` |
|
|
89
|
+
| `post_report` | After `adapter-report` |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Write Order (Leader Schedule)
|
|
94
|
+
|
|
95
|
+
Artifacts MUST be produced in this order. Skipping a layer invalidates downstream trigger gates.
|
|
96
|
+
|
|
97
|
+
| Step | Gate id | Required artifacts before next step |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| 0 | `AG0` | `run_manifest.json` |
|
|
100
|
+
| 1 | `AG1` | `route-orchestration/route/task_route.*` |
|
|
101
|
+
| 2 | `AG2` | `workspace-state/adapter_workspace_state.*`, `stage-inspections/route_decision/*`, `intermediate-assets/intermediate_asset_records.*` |
|
|
102
|
+
| 3 | `AG3` | `route-orchestration/orchestrate/workflow_orchestration.*`, `downstream-index/downstream_workflow_index.*` |
|
|
103
|
+
| 4 | `AG4` | applicable `stage-inspections/<stage_id>/*` after each route/downstream boundary |
|
|
104
|
+
| 5 | `AG5` | `stage-inspections/pre_report/*` with `status: pass` |
|
|
105
|
+
| 6 | `AG6` | `report/adapter_report.*`, `stage-inspections/post_report/*` |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Artifact Registry: Path, Owner, Content, Trigger Role
|
|
110
|
+
|
|
111
|
+
### Run identity
|
|
112
|
+
|
|
113
|
+
| Path | Owner | Required JSON / content keys | Downstream trigger role |
|
|
114
|
+
|---|---|---|---|
|
|
115
|
+
| `run_manifest.json` | Leader | `task_id`, `route`, `source_project_path`, `target_project_path`, `output_root`, `downstream_output_roots`, `dependency_preflight`, `handoff_package`, `timestamp` | **All adapter roles** — resolves roots and declares claimed gate package |
|
|
116
|
+
|
|
117
|
+
`handoff_package` MUST list absolute paths to the gate entry artifacts the run claims ready (see Handoff Packages below).
|
|
118
|
+
|
|
119
|
+
### Downstream index
|
|
120
|
+
|
|
121
|
+
| Path | Owner | Required content | Downstream trigger role |
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
| `downstream-index/downstream_workflow_index.json` | `task-route-orchestrator` mode `orchestrate` | `workflows[]` with `workflow_id`, `output_root`, `handoff_package`, `key_artifact_paths[]`, `status` | **adapter-workspace-state**, **adapter-report** — machine lookup for consumed downstream evidence |
|
|
124
|
+
|
|
125
|
+
### Workspace ledger
|
|
126
|
+
|
|
127
|
+
| Path | Owner | Required content | Downstream trigger role |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| `workspace-state/adapter_workspace_state.json` | `adapter-workspace-state` | `stage_status`, `artifact_inventory`, `path_compliance`, `freshness_checks`, `stale_upstream_inputs`, `rerun_history`, `blocking_gaps`, `handoff_gates`, `next_actions` | **All adapter roles** — refuse consumption when required artifacts are stale or `handoff_gates.*.ready` is false |
|
|
130
|
+
|
|
131
|
+
### Route and orchestration
|
|
132
|
+
|
|
133
|
+
| Path | Owner | Required content | Downstream trigger role |
|
|
134
|
+
|---|---|---|---|
|
|
135
|
+
| `route-orchestration/route/task_route.json` | `task-route-orchestrator` mode `route` | `route`, `task_kind`, `understand_focus`, `downstream_workflow_sequence`, `blocking_gaps` | **adapter-workspace-state**, **task-route-orchestrator** mode `orchestrate` |
|
|
136
|
+
| `route-orchestration/orchestrate/workflow_orchestration.json` | `task-route-orchestrator` mode `orchestrate` | `downstream_sequence`, `dispatch_contracts[]`, `observed_outputs[]`, `intermediate_asset_record_updates[]`, `rerun_requests`, `blocking_gaps` | **adapter-workspace-state**, **adapter-report** |
|
|
137
|
+
|
|
138
|
+
### Stage inspections and asset ledger
|
|
139
|
+
|
|
140
|
+
| Path | Owner | Required content | Downstream trigger role |
|
|
141
|
+
|---|---|---|---|
|
|
142
|
+
| `stage-inspections/<stage_id>/stage_inspection.json` | `adapter-workspace-state` | `stage_id`, `status` (`pass \| needs_rerun \| blocked`), `inspected_artifacts[]`, `blocking_gaps` | **adapter-report** — `pre_report` must be `pass` before final report |
|
|
143
|
+
| `intermediate-assets/intermediate_asset_records.json` | `adapter-workspace-state` | `records[]` with `artifact_id`, `producer`, `path`, `status`, `freshness`, `consumed_by` | **adapter-report** — every consumed durable artifact MUST have one record |
|
|
144
|
+
|
|
145
|
+
### Final report
|
|
146
|
+
|
|
147
|
+
| Path | Owner | Required content | Downstream trigger role |
|
|
148
|
+
|---|---|---|---|
|
|
149
|
+
| `report/adapter_report.json` | `adapter-report` | `status`, `route`, `downstream_workflows`, `verified_outputs[]`, `readiness`, `blocking_gaps`, `report_path` | **Human/agent consumers** — final adapter verdict |
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Handoff Package Gates
|
|
154
|
+
|
|
155
|
+
| Gate | Ready when |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `A0` | `run_manifest.json` written; `output_root` locked |
|
|
158
|
+
| `A1` | `route-orchestration/route/task_route.json` — route known or explicit `blocked` with `blocking_gaps` |
|
|
159
|
+
| `A2` | `adapter_workspace_state.json`, `stage-inspections/route_decision/*`, route assets recorded in `intermediate_asset_records.json` |
|
|
160
|
+
| `A3` | `workflow_orchestration.json`, `downstream_workflow_index.json` — dispatch contracts and observed outputs recorded |
|
|
161
|
+
| `A4` | All applicable boundary stages (`pre_downstream_dispatch`, `post_analyst`, `post_migrator`, `post_validator`) are `pass` or explicitly `skipped` with evidence |
|
|
162
|
+
| `A5` | `stage-inspections/pre_report/*` — `status: pass` |
|
|
163
|
+
| `A6` | `report/adapter_report.json` issued |
|
|
164
|
+
|
|
165
|
+
**Fail closed**: `adapter-report` MUST NOT run when `A5` is false. Final `completed` requires `A6` and verified downstream evidence for the route.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Route-Specific Downstream Evidence Requirements
|
|
170
|
+
|
|
171
|
+
Record consumed paths in `intermediate_asset_records.json` and `downstream_workflow_index.json`. Gate on analyst `P*`, migrator `M*`/`V0`, validator `VG*` packages defined in their `output-contract.md` files.
|
|
172
|
+
|
|
173
|
+
| Route | Minimum downstream evidence before `A5` |
|
|
174
|
+
|---|---|
|
|
175
|
+
| `only_understand_ui` | analyst `P5` or focused `P2` with `presentation_resource.*` + SPEC |
|
|
176
|
+
| `only_understand_logic` | analyst `P5` or focused `P2` with `behavior_logic.*` + SPEC |
|
|
177
|
+
| `only_understand_architecture` | analyst `P5` or `P2` with `project_architecture.*` + SPEC |
|
|
178
|
+
| `only_understand_overview` | analyst `P5` |
|
|
179
|
+
| `migration` | analyst `P6` when required, migrator `M6` + `migration_report.*`; optional validator `VG5` |
|
|
180
|
+
| `validation_handoff` | migrator `V0`, validator `VG5` + `kmp_validation_report.*` |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Key Artifact Schemas
|
|
185
|
+
|
|
186
|
+
### `run_manifest.json`
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"task_id": "",
|
|
191
|
+
"route": "",
|
|
192
|
+
"source_project_path": "",
|
|
193
|
+
"target_project_path": "",
|
|
194
|
+
"output_root": "",
|
|
195
|
+
"downstream_output_roots": {
|
|
196
|
+
"android-project-analyst": "",
|
|
197
|
+
"android-to-kmp-migrator": "",
|
|
198
|
+
"kmp-test-validator": ""
|
|
199
|
+
},
|
|
200
|
+
"dependency_preflight": {},
|
|
201
|
+
"handoff_package": "A0",
|
|
202
|
+
"timestamp": ""
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### `downstream_workflow_index.json`
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"workflows": [
|
|
211
|
+
{
|
|
212
|
+
"workflow_id": "android-project-analyst | android-to-kmp-migrator | kmp-test-validator",
|
|
213
|
+
"output_root": "",
|
|
214
|
+
"handoff_package": "",
|
|
215
|
+
"handoff_ready": true,
|
|
216
|
+
"key_artifact_paths": [],
|
|
217
|
+
"status": "completed | needs_rerun | blocked | not_invoked"
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### `intermediate_asset_records.json` record shape
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"artifact_id": "",
|
|
228
|
+
"producer": "task-route-orchestrator | adapter-workspace-state | android-project-analyst | android-to-kmp-migrator | kmp-test-validator",
|
|
229
|
+
"path": "",
|
|
230
|
+
"status": "present | missing | stale | invalid",
|
|
231
|
+
"freshness": "fresh | stale | unknown",
|
|
232
|
+
"consumed_by": ["adapter-workspace-state", "adapter-report"]
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### `adapter_report.json` status rules
|
|
237
|
+
|
|
238
|
+
- `completed` — understand route satisfied; inspections pass; assets recorded.
|
|
239
|
+
- `ready_for_validation` — migration report ready; validation not run in this adapter pass.
|
|
240
|
+
- `needs_rerun` — concrete owner can resolve missing/stale evidence.
|
|
241
|
+
- `failed` — downstream workflow failed with verified evidence.
|
|
242
|
+
- `blocked` — missing path, evidence, or user decision.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Leader Obligations For Downstream Triggers
|
|
247
|
+
|
|
248
|
+
Before claiming adapter completion, the Leader MUST:
|
|
249
|
+
|
|
250
|
+
1. Write `handoff_gates` into `adapter_workspace_state.json` with boolean `ready` flags for `A0`–`A6` and `missing_paths[]` per false gate.
|
|
251
|
+
2. Set `run_manifest.json` → `handoff_package` to the **highest package actually ready** (`A0`..`A6`) and list every artifact path in that package.
|
|
252
|
+
3. Refresh `adapter-workspace-state` after every route and downstream boundary.
|
|
253
|
+
4. Never invoke `adapter-report` before `A5` is true.
|
|
254
|
+
5. Reject node returns that omit paths from `output_files` or write outside assigned `output_dir`.
|
|
255
|
+
|
|
256
|
+
## Node Obligations
|
|
257
|
+
|
|
258
|
+
Every node MUST:
|
|
259
|
+
|
|
260
|
+
- Write only under the `output_dir` declared in its dispatch contract.
|
|
261
|
+
- Use exact filenames and subfolders from this contract.
|
|
262
|
+
- Mirror downstream paths in `intermediate_asset_record_updates` or asset records — never invent evidence.
|
|
263
|
+
- Return `blocked` when required upstream/downstream package gates are false.
|
|
264
|
+
|
|
265
|
+
## Invalid Artifact Handling (uniform rule)
|
|
266
|
+
|
|
267
|
+
| Condition | Handler action |
|
|
268
|
+
|---|---|
|
|
269
|
+
| Path missing | `blocked` — `blocking_gaps: [{ "artifact": "<path>", "reason": "missing" }]` |
|
|
270
|
+
| File empty | `blocked` — reason `empty` |
|
|
271
|
+
| Path outside `output_root` | `blocked` — reason `out_of_path` |
|
|
272
|
+
| Stale per workspace ledger | `needs_rerun` — name owning role or downstream workflow |
|
|
273
|
+
| Schema/content invalid | `blocked` — reason `invalid_contract`; cite this file section |
|
|
274
|
+
| `pre_report` not `pass` | `blocked` — do not run `adapter-report` |
|
|
275
|
+
|
|
276
|
+
Downstream handlers MUST NOT parse chat text, controller summaries, or partial copies when gate artifacts are absent.
|
|
@@ -56,6 +56,8 @@ You are the `adapter-report` node subagent. You synthesize verified adapter and
|
|
|
56
56
|
|
|
57
57
|
## Output Files
|
|
58
58
|
|
|
59
|
+
Write only under `report_dir`. Require package `A5` (`pre_report` stage `pass`) before issuing report. See [output-contract.md](../output-contract.md) § Final report and package `A6`.
|
|
60
|
+
|
|
59
61
|
- `adapter_report.json`, `adapter_report.md`
|
|
60
62
|
|
|
61
63
|
## Inline Persona
|
|
@@ -54,6 +54,8 @@ You are the `adapter-workspace-state` node subagent. You maintain the workspace
|
|
|
54
54
|
|
|
55
55
|
## Output Files
|
|
56
56
|
|
|
57
|
+
Write only under `workspace_state_dir`, `stage_inspection_dir`, and `intermediate_asset_dir`. Exact filenames, stage folder names, and gate packages: [output-contract.md](../output-contract.md). Evaluate handoff packages `A0`–`A6`; persist `handoff_gates` with `ready` and `missing_paths[]`.
|
|
58
|
+
|
|
57
59
|
- `adapter_workspace_state.json`, `adapter_workspace_state.md`
|
|
58
60
|
- `<stage_inspection_dir>/<stage_id>/stage_inspection.json`, `.md`
|
|
59
61
|
- `<intermediate_asset_dir>/intermediate_asset_records.json`, `.md`
|
|
@@ -86,8 +86,11 @@ Shared return shape applies.
|
|
|
86
86
|
|
|
87
87
|
## Output Files
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
Write only under `output_dir` paths declared in the dispatch contract. Exact filenames and downstream trigger role: [output-contract.md](../output-contract.md) § Route and orchestration. Out-of-path artifacts invalidate packages `A1` and `A3`.
|
|
90
|
+
|
|
91
|
+
- `route/task_route.json`, `route/task_route.md` (mode `route`)
|
|
92
|
+
- `orchestrate/workflow_orchestration.json`, `orchestrate/workflow_orchestration.md` (mode `orchestrate`)
|
|
93
|
+
- `../downstream-index/downstream_workflow_index.json`, `.md` (mode `orchestrate`)
|
|
91
94
|
|
|
92
95
|
## Inline Persona
|
|
93
96
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The adapter classifies intent, records contracts and stage gates, and emits a verified report. It does not perform analysis, migration, or validation itself.
|
|
4
4
|
|
|
5
|
+
**File recording system**: every adapter output path, content requirement, and trigger gate is defined in [output-contract.md](output-contract.md). Adapter roles MUST fail closed when handoff package artifacts are missing, empty, out-of-path, stale, or schema-invalid.
|
|
6
|
+
|
|
5
7
|
## Overview
|
|
6
8
|
|
|
7
9
|
```mermaid
|
|
@@ -25,8 +27,11 @@ graph TD
|
|
|
25
27
|
|
|
26
28
|
## Output Paths
|
|
27
29
|
|
|
30
|
+
The canonical path tree, stage folder names, and handoff packages `A0`–`A6` are in [output-contract.md](output-contract.md). Summary:
|
|
31
|
+
|
|
28
32
|
```text
|
|
29
33
|
output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
|
|
34
|
+
downstream_index_dir = <output_root>/downstream-index
|
|
30
35
|
workspace_state_dir = <output_root>/workspace-state
|
|
31
36
|
route_orchestration_dir = <output_root>/route-orchestration
|
|
32
37
|
stage_inspection_dir = <output_root>/stage-inspections
|
|
@@ -106,6 +111,7 @@ Lock `output_root`; write `run_manifest.json` with task id, paths, scope, depend
|
|
|
106
111
|
|
|
107
112
|
- Route classified before downstream invoke.
|
|
108
113
|
- Stage inspections at each applicable boundary.
|
|
109
|
-
- Every consumed artifact in `intermediate_asset_records.*`.
|
|
110
|
-
- `
|
|
114
|
+
- Every consumed artifact in `intermediate_asset_records.*` and downstream roots indexed in `downstream_workflow_index.*`.
|
|
115
|
+
- `handoff_gates` in `adapter_workspace_state.json` accurately reflect [output-contract.md](output-contract.md) package readiness (`A0`–`A6`).
|
|
116
|
+
- `adapter-report` runs only after fresh `pre_report` gate (`A5`).
|
|
111
117
|
- Final report cites verified paths; gaps listed, not filled in.
|