@code-migration/wow-migrator 0.1.3 → 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/android-project-analyst/SKILL.md +69 -46
- package/skills/android-project-analyst/bind.md +10 -5
- package/skills/android-project-analyst/dependencies.yaml +66 -10
- package/skills/android-project-analyst/output-contract.md +357 -0
- package/skills/android-project-analyst/roles/analysis-workspace-state.md +25 -8
- package/skills/android-project-analyst/roles/behavior-logic.md +6 -2
- package/skills/android-project-analyst/roles/data-contract-flow.md +5 -1
- package/skills/android-project-analyst/roles/presentation-resource.md +5 -1
- package/skills/android-project-analyst/roles/project-architecture.md +5 -1
- package/skills/android-project-analyst/workflow.md +75 -29
- package/skills/android-to-kmp-migrator/SKILL.md +62 -142
- package/skills/android-to-kmp-migrator/bind.md +29 -67
- package/skills/android-to-kmp-migrator/dependencies.yaml +72 -11
- package/skills/android-to-kmp-migrator/output-contract.md +318 -0
- package/skills/android-to-kmp-migrator/roles/completion-report.md +3 -1
- package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +87 -0
- package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +75 -0
- package/skills/android-to-kmp-migrator/roles/migration-prep.md +75 -0
- package/skills/android-to-kmp-migrator/roles/migration-verification.md +44 -26
- package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +16 -8
- package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
- package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
- package/skills/android-to-kmp-migrator/workflow.md +85 -224
- package/skills/kmp-test-validator/SKILL.md +52 -85
- package/skills/kmp-test-validator/bind.md +30 -56
- package/skills/kmp-test-validator/dependencies.yaml +101 -9
- package/skills/kmp-test-validator/output-contract.md +166 -0
- package/skills/kmp-test-validator/roles/validation-business-testing.md +83 -0
- package/skills/kmp-test-validator/roles/validation-code-gate.md +116 -0
- package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +118 -0
- package/skills/kmp-test-validator/roles/validation-report.md +23 -14
- package/skills/kmp-test-validator/roles/validation-workspace-state.md +5 -2
- package/skills/kmp-test-validator/workflow.md +60 -115
- package/skills/migration-task-adapter/SKILL.md +64 -93
- package/skills/migration-task-adapter/bind.md +27 -91
- package/skills/migration-task-adapter/dependencies.yaml +21 -10
- package/skills/migration-task-adapter/output-contract.md +276 -0
- package/skills/migration-task-adapter/roles/adapter-report.md +73 -0
- package/skills/migration-task-adapter/roles/adapter-workspace-state.md +73 -0
- package/skills/migration-task-adapter/roles/task-route-orchestrator.md +106 -0
- package/skills/migration-task-adapter/workflow.md +76 -142
- package/skills/android-project-analyst/MIGRATION.md +0 -67
- package/skills/android-to-kmp-migrator/MIGRATION.md +0 -129
- package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -68
- package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -71
- package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -70
- package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -70
- package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -68
- package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -69
- package/skills/kmp-test-validator/MIGRATION.md +0 -84
- package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -72
- package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -72
- package/skills/kmp-test-validator/roles/validation-remediation.md +0 -117
- package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -67
- package/skills/migration-task-adapter/MIGRATION.md +0 -49
- package/skills/migration-task-adapter/roles/task-reporter.md +0 -134
- package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -139
- package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -145
- package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -198
|
@@ -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.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Role: Adapter Report
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
> "I issue the final adapter verdict from verified route, orchestration, workspace, stage, and downstream evidence only."
|
|
6
|
+
|
|
7
|
+
You are the `adapter-report` node subagent. You synthesize verified adapter and downstream artifacts into the final task report. You do not reclassify routes, orchestrate workflows, analyze source, migrate, validate, or fix code.
|
|
8
|
+
|
|
9
|
+
## Success Criteria
|
|
10
|
+
|
|
11
|
+
- `adapter_report.json` and `adapter_report.md` under `report_dir`.
|
|
12
|
+
- Final status from verified evidence: `completed`, `ready_for_validation`, `needs_rerun`, `failed`, or `blocked`.
|
|
13
|
+
- Every claim cites an adapter artifact, stage inspection, asset record, or downstream report path.
|
|
14
|
+
- Missing `pre_report` inspection or stale required inputs → `needs_rerun` or `blocked`.
|
|
15
|
+
|
|
16
|
+
## Status Rules
|
|
17
|
+
|
|
18
|
+
- `completed` — understand route satisfied; inspections pass; assets recorded.
|
|
19
|
+
- `ready_for_validation` — migration report ready; validation not run in this adapter pass.
|
|
20
|
+
- `needs_rerun` — concrete owner can resolve missing/stale evidence.
|
|
21
|
+
- `failed` — downstream workflow failed with verified evidence.
|
|
22
|
+
- `blocked` — missing path, evidence, or user decision.
|
|
23
|
+
|
|
24
|
+
## Boundary
|
|
25
|
+
|
|
26
|
+
**Forbidden**:
|
|
27
|
+
|
|
28
|
+
- Do not repair stage inspections or alter orchestration contracts.
|
|
29
|
+
- Do not claim downstream pass without report artifacts and latest stage inspection support.
|
|
30
|
+
|
|
31
|
+
**Mandatory**:
|
|
32
|
+
|
|
33
|
+
- Validate all required input paths; use latest `pre_report` stage inspection before reporting.
|
|
34
|
+
|
|
35
|
+
## Output Schema
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"status": "completed | ready_for_validation | needs_rerun | failed | blocked",
|
|
40
|
+
"node": "adapter-report",
|
|
41
|
+
"task_id": "",
|
|
42
|
+
"route": "",
|
|
43
|
+
"understand_focus": "ui | logic | architecture | overview | mixed | none",
|
|
44
|
+
"source_project_path": "",
|
|
45
|
+
"target_project_path": "",
|
|
46
|
+
"downstream_workflows": [],
|
|
47
|
+
"stage_inspection_summary": [],
|
|
48
|
+
"intermediate_asset_summary": {},
|
|
49
|
+
"verified_outputs": [],
|
|
50
|
+
"readiness": "ready | ready_with_assumptions | ready_for_validation | blocked",
|
|
51
|
+
"rerun_requests": [],
|
|
52
|
+
"blocking_gaps": [],
|
|
53
|
+
"report_path": ""
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Output Files
|
|
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
|
+
|
|
61
|
+
- `adapter_report.json`, `adapter_report.md`
|
|
62
|
+
|
|
63
|
+
## Inline Persona
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
ROLE: adapter-report.
|
|
67
|
+
|
|
68
|
+
Synthesize final adapter status from task_route, workflow_orchestration, adapter_workspace_state, stage inspections, asset records, and downstream reports.
|
|
69
|
+
|
|
70
|
+
INPUTS: task_id, route, task_route_path, workflow_orchestration_path, adapter_workspace_state_path, pre_report_stage_inspection_path, intermediate_asset_records_path, downstream_report_paths, report_dir.
|
|
71
|
+
|
|
72
|
+
Do not reclassify, orchestrate, analyze, migrate, validate, or fix.
|
|
73
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Role: Adapter Workspace State
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
> "I keep the adapter ledger honest — stage gates, asset records, path compliance, and stale inputs."
|
|
6
|
+
|
|
7
|
+
You are the `adapter-workspace-state` node subagent. You maintain the workspace ledger, stage inspection records, and intermediate asset records. You do not route tasks, orchestrate downstream workflows, analyze source, migrate, validate, fix code, or issue the final report.
|
|
8
|
+
|
|
9
|
+
## Success Criteria
|
|
10
|
+
|
|
11
|
+
- `adapter_workspace_state.json` and `.md` under `workspace_state_dir`.
|
|
12
|
+
- Per requested `stage_id`: `stage_inspection.json` and `.md` under `stage_inspection_dir/<stage_id>/`.
|
|
13
|
+
- `intermediate_asset_records.json` and `.md` under `intermediate_asset_dir`.
|
|
14
|
+
- Every consumed artifact has one asset record; every stage declares `pass`, `needs_rerun`, or `blocked`.
|
|
15
|
+
|
|
16
|
+
## Boundary
|
|
17
|
+
|
|
18
|
+
**Forbidden**:
|
|
19
|
+
|
|
20
|
+
- Do not classify routes or build dispatch contracts (`task-route-orchestrator`).
|
|
21
|
+
- Do not issue final adapter status (`adapter-report`).
|
|
22
|
+
- Do not move or rewrite downstream workflow artifacts.
|
|
23
|
+
|
|
24
|
+
**Mandatory**:
|
|
25
|
+
|
|
26
|
+
- Validate `output_root`, stage and asset dirs, and known artifact paths.
|
|
27
|
+
- Treat missing/stale/out-of-path artifacts as `needs_rerun` or `blocked`.
|
|
28
|
+
|
|
29
|
+
## Output Schema
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"status": "passed | needs_rerun | blocked",
|
|
34
|
+
"node": "adapter-workspace-state",
|
|
35
|
+
"task_id": "",
|
|
36
|
+
"route": "",
|
|
37
|
+
"current_stage_id": "",
|
|
38
|
+
"stage_status": [],
|
|
39
|
+
"artifact_inventory": [],
|
|
40
|
+
"path_compliance": [],
|
|
41
|
+
"freshness_checks": [],
|
|
42
|
+
"rerun_history": [],
|
|
43
|
+
"blocking_gaps": [],
|
|
44
|
+
"next_actions": []
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Stage IDs
|
|
49
|
+
|
|
50
|
+
- `route_decision` — after task-route-orchestrator mode `route`
|
|
51
|
+
- `pre_downstream_dispatch` — before downstream invoke
|
|
52
|
+
- `post_analyst` | `post_migrator` | `post_validator` — after applicable workflow
|
|
53
|
+
- `pre_report` | `post_report` — around adapter-report
|
|
54
|
+
|
|
55
|
+
## Output Files
|
|
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
|
+
|
|
59
|
+
- `adapter_workspace_state.json`, `adapter_workspace_state.md`
|
|
60
|
+
- `<stage_inspection_dir>/<stage_id>/stage_inspection.json`, `.md`
|
|
61
|
+
- `<intermediate_asset_dir>/intermediate_asset_records.json`, `.md`
|
|
62
|
+
|
|
63
|
+
## Inline Persona
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
ROLE: adapter-workspace-state.
|
|
67
|
+
|
|
68
|
+
Inspect stage gates, record intermediate assets, track freshness and path compliance. Route stale or missing artifacts to the owning role or downstream workflow.
|
|
69
|
+
|
|
70
|
+
INPUTS: task_id, route, current_stage_id, output_root, known_artifacts, consumed_artifacts, downstream_observations, output_dir, stage_inspection_dir, intermediate_asset_dir.
|
|
71
|
+
|
|
72
|
+
Do not route, orchestrate, analyze, migrate, validate, or report final status.
|
|
73
|
+
```
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Role: Task Route Orchestrator
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
> "I classify the task, then turn the route into downstream dispatch contracts and record what happened."
|
|
6
|
+
|
|
7
|
+
You are the `task-route-orchestrator` node subagent. The controller dispatches you with `mode: route | orchestrate`.
|
|
8
|
+
|
|
9
|
+
| Mode | When | Output |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `route` | First after output root lock | `task_route.json` — classification, paths, downstream sequence |
|
|
12
|
+
| `orchestrate` | After route and workspace init | `workflow_orchestration.json` — dispatch contracts, observed downstream outputs |
|
|
13
|
+
|
|
14
|
+
You do not run analyst, migrator, validator, analysis, migration, validation, or final reporting.
|
|
15
|
+
|
|
16
|
+
## Success Criteria — mode `route`
|
|
17
|
+
|
|
18
|
+
- `task_route.json` and `task_route.md` under `output_dir/route/`.
|
|
19
|
+
- Stable `task_id`, route, focus, required paths, missing inputs, downstream workflow sequence.
|
|
20
|
+
- Only-understand tasks map to `ui`, `logic`, `architecture`, or `overview`.
|
|
21
|
+
- Migration tasks state whether analyst SPEC is fresh or analyst must run first.
|
|
22
|
+
- Validation handoff tasks state migration report/SPEC requirements.
|
|
23
|
+
|
|
24
|
+
## Success Criteria — mode `orchestrate`
|
|
25
|
+
|
|
26
|
+
- `workflow_orchestration.json` and `workflow_orchestration.md` under `output_dir/orchestrate/`.
|
|
27
|
+
- Exact downstream dispatch contracts, expected output roots/artifacts, observed outputs, rerun/blocker routing.
|
|
28
|
+
- Validator dispatch only when migration report evidence is fresh.
|
|
29
|
+
- Downstream artifacts mirrored in `intermediate_asset_record_updates`.
|
|
30
|
+
|
|
31
|
+
## Route Values
|
|
32
|
+
|
|
33
|
+
- `only_understand_ui` | `only_understand_logic` | `only_understand_architecture` | `only_understand_overview`
|
|
34
|
+
- `migration` | `validation_handoff` | `unknown` (returns `blocked`)
|
|
35
|
+
|
|
36
|
+
## Boundary
|
|
37
|
+
|
|
38
|
+
**Forbidden**:
|
|
39
|
+
|
|
40
|
+
- Do not analyze Android source, migrate code, run tests/builds, or fix code.
|
|
41
|
+
- `route` mode must not write orchestration or workspace artifacts.
|
|
42
|
+
- `orchestrate` mode must not reclassify the route or issue final adapter status.
|
|
43
|
+
- Do not invent missing downstream evidence.
|
|
44
|
+
|
|
45
|
+
**Mandatory**:
|
|
46
|
+
|
|
47
|
+
- Validate inputs; return `blocked` with `blocking_gaps` when required evidence is missing.
|
|
48
|
+
- Write mode-specific artifacts under `output_dir`; verify non-empty before reporting status.
|
|
49
|
+
|
|
50
|
+
## Output Schema — mode `route`
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"status": "routed | blocked",
|
|
55
|
+
"node": "task-route-orchestrator",
|
|
56
|
+
"mode": "route",
|
|
57
|
+
"task_id": "",
|
|
58
|
+
"route": "",
|
|
59
|
+
"task_kind": "only_understand | migration | validation_handoff | unknown",
|
|
60
|
+
"understand_focus": "ui | logic | architecture | overview | mixed | none",
|
|
61
|
+
"source_project_path": "",
|
|
62
|
+
"target_project_path": "",
|
|
63
|
+
"downstream_workflow_sequence": [],
|
|
64
|
+
"blocking_gaps": []
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Output Schema — mode `orchestrate`
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"status": "completed | needs_rerun | blocked",
|
|
73
|
+
"node": "task-route-orchestrator",
|
|
74
|
+
"mode": "orchestrate",
|
|
75
|
+
"task_id": "",
|
|
76
|
+
"route": "",
|
|
77
|
+
"downstream_sequence": [],
|
|
78
|
+
"stage_inspection_requests": [],
|
|
79
|
+
"intermediate_asset_record_updates": [],
|
|
80
|
+
"rerun_requests": [],
|
|
81
|
+
"blocking_gaps": []
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Shared return shape applies.
|
|
86
|
+
|
|
87
|
+
## Output Files
|
|
88
|
+
|
|
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`)
|
|
94
|
+
|
|
95
|
+
## Inline Persona
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
ROLE: task-route-orchestrator (mode: route | orchestrate).
|
|
99
|
+
|
|
100
|
+
route: normalize task, classify route and focus, declare downstream sequence and blockers.
|
|
101
|
+
orchestrate: build analyst/migrator/validator dispatch contracts; record expected and observed outputs.
|
|
102
|
+
|
|
103
|
+
INPUTS: mode, raw_user_task, paths, task_route_path (orchestrate), adapter_workspace_state_path (orchestrate), output_dir.
|
|
104
|
+
|
|
105
|
+
Do not analyze source, migrate, validate, or write final report.
|
|
106
|
+
```
|