@code-migration/wow-migrator 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/android-project-analyst/SKILL.md +71 -28
- package/skills/android-project-analyst/bind.md +12 -6
- 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 +30 -8
- package/skills/android-project-analyst/roles/behavior-logic.md +12 -5
- package/skills/android-project-analyst/roles/data-contract-flow.md +11 -4
- package/skills/android-project-analyst/roles/presentation-resource.md +13 -4
- package/skills/android-project-analyst/roles/project-architecture.md +11 -4
- package/skills/android-project-analyst/workflow.md +88 -39
- package/skills/android-to-kmp-migrator/SKILL.md +62 -111
- package/skills/android-to-kmp-migrator/bind.md +29 -61
- 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 +11 -2
- 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 +47 -23
- package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +207 -20
- package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
- package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +9 -2
- package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
- package/skills/android-to-kmp-migrator/workflow.md +71 -170
- package/skills/kmp-test-validator/SKILL.md +63 -45
- package/skills/kmp-test-validator/bind.md +30 -36
- 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 +30 -16
- package/skills/kmp-test-validator/roles/validation-workspace-state.md +12 -4
- package/skills/kmp-test-validator/workflow.md +62 -97
- package/skills/migration-task-adapter/SKILL.md +67 -76
- package/skills/migration-task-adapter/bind.md +25 -89
- package/skills/migration-task-adapter/dependencies.yaml +21 -10
- package/skills/migration-task-adapter/roles/adapter-report.md +71 -0
- package/skills/migration-task-adapter/roles/adapter-workspace-state.md +71 -0
- package/skills/migration-task-adapter/roles/task-route-orchestrator.md +103 -0
- package/skills/migration-task-adapter/workflow.md +71 -143
- package/skills/android-project-analyst/MIGRATION.md +0 -53
- package/skills/android-to-kmp-migrator/MIGRATION.md +0 -104
- package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -63
- package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -66
- package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -65
- package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -65
- package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -63
- package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -64
- package/skills/kmp-test-validator/MIGRATION.md +0 -58
- package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -67
- package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -66
- package/skills/kmp-test-validator/roles/validation-remediation.md +0 -112
- package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -61
- package/skills/migration-task-adapter/MIGRATION.md +0 -34
- package/skills/migration-task-adapter/roles/task-reporter.md +0 -129
- package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -134
- package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -140
- package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -189
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Workflow: Legacy Android source → module artifacts → global representation → SPEC package
|
|
2
2
|
|
|
3
|
-
This Swarm Skill is **module-first Mixed B+C with workspace-state tracking**: the Leader first partitions the Legacy Android project into bounded analysis modules, maintains a ledger of module/node artifacts and stale inputs, then runs the
|
|
3
|
+
This Swarm Skill is **module-first Mixed B+C with workspace-state tracking**: the Leader first partitions the Legacy Android project into bounded analysis modules, maintains a ledger of module/node artifacts and stale inputs, then runs the foundation node schedule inside each module before combining the verified module representations into one global project representation and SPEC package. Each node owns a bounded module slice; the Leader never does node work and never invents claims that no node traced to source.
|
|
4
|
+
|
|
5
|
+
**File recording system**: every output path, content requirement, and downstream trigger gate is defined in [output-contract.md](output-contract.md). Downstream handlers (`migration-task-adapter`, `android-to-kmp-migrator`) MUST fail closed when handoff package artifacts are missing, empty, out-of-path, stale, or schema-invalid.
|
|
4
6
|
|
|
5
7
|
## Overview
|
|
6
8
|
|
|
@@ -29,18 +31,24 @@ graph TD
|
|
|
29
31
|
B1 --> GB{Behavior output verified?}
|
|
30
32
|
GB -- fail --> RR2[Re-dispatch behavior-logic]
|
|
31
33
|
RR2 --> GB
|
|
32
|
-
GB -- Yes -->
|
|
34
|
+
GB -- Yes --> DI[Leader: Step 5 write dimension_index.json]
|
|
35
|
+
DI --> MR[Leader: Step 6 write module representation]
|
|
33
36
|
MR --> WSR[Refresh analysis-workspace-state]
|
|
34
37
|
WSR --> NEXT{More modules?}
|
|
35
38
|
NEXT -- Yes --> LOOP
|
|
36
|
-
NEXT -- No -->
|
|
37
|
-
DEG -->
|
|
39
|
+
NEXT -- No --> CMA[Leader: Step 7 cross-module architecture]
|
|
40
|
+
DEG --> CMA
|
|
41
|
+
CMA --> CMD[Leader: Step 7 cross-module data/logic]
|
|
42
|
+
CMD --> MAB[Leader: Step 7 migration assembly basis]
|
|
43
|
+
MAB --> GR[Leader: Step 8 global representation]
|
|
38
44
|
GR --> WSG[Refresh analysis-workspace-state]
|
|
39
|
-
WSG --> OUT[Leader: Step
|
|
45
|
+
WSG --> OUT[Leader: Step 9 write SPEC + verification verdict]
|
|
40
46
|
```
|
|
41
47
|
|
|
42
48
|
## Strict Output Paths
|
|
43
49
|
|
|
50
|
+
The canonical path tree, filename invariants, and handoff packages `P0`–`P6` are in [output-contract.md](output-contract.md). This section summarizes path variables only.
|
|
51
|
+
|
|
44
52
|
The Leader MUST lock one `output_root` before dispatch and MUST reject or rerun any node that writes outside its assigned directory. Defaults:
|
|
45
53
|
|
|
46
54
|
- `output_root`: `<output_dir or ~/.a2c_agents/understand>/android-project-analyst`
|
|
@@ -56,14 +64,19 @@ Required durable artifacts:
|
|
|
56
64
|
|
|
57
65
|
| Schedule point | Required artifacts |
|
|
58
66
|
|---|---|
|
|
59
|
-
| Output root lock | `<output_root>/run_manifest.json` |
|
|
60
|
-
| Workspace state | `<workspace_state_dir>/analysis_workspace_state.json`, `<workspace_state_dir>/analysis_workspace_state.md` |
|
|
61
|
-
| Module inventory | `<module_index_dir>/module_inventory.json`, `<module_index_dir>/module_inventory.md` |
|
|
62
|
-
|
|
|
63
|
-
| Per module
|
|
64
|
-
| Per module
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
+
| Output root lock | `<output_root>/run_manifest.json` - run identity, paths, mode, scope, allowed roots, dependency status, schedule version |
|
|
68
|
+
| Workspace state | `<workspace_state_dir>/analysis_workspace_state.json`, `<workspace_state_dir>/analysis_workspace_state.md` - module/node/artifact ledger, stale inputs, reruns, blockers, next safe actions |
|
|
69
|
+
| Module inventory | `<module_index_dir>/module_inventory.json`, `<module_index_dir>/module_inventory.md` - deterministic module list/order, scopes, dependencies, out-of-scope roots, evidence |
|
|
70
|
+
| Modules index | `<module_index_dir>/modules_index.json` - machine-routable `module_id` → folder paths, dimension roots, representation paths, status |
|
|
71
|
+
| Per module brief | `<module_root>/module_brief.json` - module-scoped dispatch contract and role hints for one `module_id` |
|
|
72
|
+
| Per module dimension outputs | `<module_node_dir>/<node_artifact>.json`, `<module_node_dir>/<node_artifact>.md` - one analysis dimension per `node-results/<dimension>/` |
|
|
73
|
+
| Per module dimension index | `<module_root>/dimension_index.json` - dimension → artifact path map for the module |
|
|
74
|
+
| Per module representation | `<module_representation_dir>/module_representation.json`, `<module_representation_dir>/module_representation.md` - module synthesis from verified dimension outputs only |
|
|
75
|
+
| Cross-module architecture | `<global_dir>/cross_module_architecture.json`, `<global_dir>/cross_module_architecture.md` - inter-module topology, navigation glue, shared platform/DI bridges |
|
|
76
|
+
| Cross-module data/logic | `<global_dir>/cross_module_data_logic.json`, `<global_dir>/cross_module_data_logic.md` - shared contracts, cross-module data flows, control interactions |
|
|
77
|
+
| Migration assembly basis | `<global_dir>/migration_assembly_basis.json`, `<global_dir>/migration_assembly_basis.md` - module assembly order and integration checkpoints for downstream migration |
|
|
78
|
+
| Global representation | `<global_dir>/global_representation.json`, `<global_dir>/global_representation.md` - full-project synthesis from module representations plus cross-module global records |
|
|
79
|
+
| SPEC package | `<spec_dir>/prd.md`, `<spec_dir>/design.md`, `<spec_dir>/verification.md`, plus `<spec_dir>/plan.md` in migration mode - final SPEC with traceability, coverage, and readiness |
|
|
67
80
|
|
|
68
81
|
No node may choose its own output path. `presentation-resource` may write downloaded resources only under `<module_root>/node-results/presentation-resource/downloaded_resources/`.
|
|
69
82
|
|
|
@@ -73,7 +86,7 @@ No node may choose its own output path. `presentation-resource` may write downlo
|
|
|
73
86
|
|
|
74
87
|
- **Executor**: Leader (`android-project-analyst` controller)
|
|
75
88
|
- **Input**: [dependencies.yaml](dependencies.yaml)
|
|
76
|
-
- **Action**: verify
|
|
89
|
+
- **Action**: verify `tools[]`, `optional_mcp.jetbrains`, and migration-mode `downstream_handoff` package **P6** per [dependencies.yaml](dependencies.yaml). Record CLI/MCP status in `run_manifest.json` → `dependency_preflight`. Apply degraded modes when tools or MCP are unavailable; migration mode must plan for **P6** consumable by `android-to-kmp-migrator`.
|
|
77
90
|
- **Output**: pre-flight note to the user
|
|
78
91
|
- **Quality gate**: all deps are `required: false` → the run proceeds even if missing; user is informed of any degraded mode. The Leader does NOT auto-skip nodes.
|
|
79
92
|
|
|
@@ -82,7 +95,7 @@ No node may choose its own output path. `presentation-resource` may write downlo
|
|
|
82
95
|
- **Executor**: Leader
|
|
83
96
|
- **Input**: `source_project_path`, optional `analysis_scope` / `mode` / `target_project_path` / `output_dir` / `language`, optional `jetbrains` MCP context
|
|
84
97
|
- **Action**: verify the target is an Android project (`AndroidManifest.xml`, `settings.gradle(.kts)`, `build.gradle(.kts)`, or a `com.android.*` module) and that the request needs structured analysis, not a one-off lookup. Select `exploration` or `migration`. Lock `output_root`, `module_index_dir`, `global_dir`, and `spec_dir`. Write `run_manifest.json` with source path, mode, target path, scope, schedule version, allowed path roots, and timestamp.
|
|
85
|
-
- **Output**: announced mode banner + `run_manifest.json`; default `output_root` = `~/.a2c_agents/understand/android-project-analyst`
|
|
98
|
+
- **Output**: announced mode banner + `run_manifest.json`; default `output_root` = `~/.a2c_agents/understand/android-project-analyst`. `run_manifest.json` must contain source/target paths, mode, analysis scope, output root, allowed path roots, dependency-preflight status, schedule version, and timestamp.
|
|
86
99
|
- **Serial / Parallel**: serial (precedes all dispatch)
|
|
87
100
|
- **Quality gate**: Android evidence present AND scope valid AND `run_manifest.json` exists/non-empty → proceed; otherwise STOP and explain the failed check. Migration mode without `target_project_path` → ask before producing `plan.md`.
|
|
88
101
|
|
|
@@ -91,25 +104,28 @@ No node may choose its own output path. `presentation-resource` may write downlo
|
|
|
91
104
|
- **Executor**: `analysis-workspace-state`
|
|
92
105
|
- **Input**: output root, run manifest, current controller step, known module/node/artifact outputs, source change/timestamp evidence, rerun reports, blockers
|
|
93
106
|
- **Action**: initialize and refresh the analysis ledger. Track module status, node output inventory, artifact inventory, stale upstream inputs, rerun history, blockers, and next safe controller actions.
|
|
94
|
-
- **Output**: `analysis_workspace_state.json`, `analysis_workspace_state.md
|
|
107
|
+
- **Output**: `analysis_workspace_state.json`, `analysis_workspace_state.md`. JSON is the machine ledger for module status, node output files, artifact inventory, stale upstream inputs, rerun history, blockers, and next actions. Markdown mirrors the ledger as an agent handoff with stale/rerun/blocker tables.
|
|
95
108
|
- **Serial / Parallel**: serial; refreshed after module inventory, Stage A, Stage B, module representation, global representation, and SPEC.
|
|
96
109
|
- **Quality gate**: downstream stages do not consume artifacts marked stale; rerun the responsible module/node or mark the affected module `blocked`.
|
|
97
110
|
|
|
98
|
-
### Step 3 — Module inventory and
|
|
111
|
+
### Step 3 — Module inventory, modules index, and folder materialization
|
|
99
112
|
|
|
100
113
|
- **Executor**: Leader
|
|
101
114
|
- **Input**: source path, analysis scope, Android evidence, module/build files, optional MCP module context
|
|
102
|
-
- **Action**: partition the project into explicit `analysis_modules`. Prefer Gradle modules and feature packages; when one Gradle module contains multiple independent features, split by package/route/feature boundary. Each module entry MUST include `module_id` (stable slug), `module_type` (`app | feature | ui | logic | data | platform | shared | test | unknown`), `source_roots`, `ui_scope`, `logic_scope`, `data_scope`, `resource_scope`, `depends_on`, and `module_output_root
|
|
103
|
-
- **Output**: `module_inventory.json`, `module_inventory.md`
|
|
115
|
+
- **Action**: partition the project into explicit `analysis_modules`. Prefer Gradle modules and feature packages; when one Gradle module contains multiple independent features, split by package/route/feature boundary. Each module entry MUST include `module_id` (stable slug), `module_type` (`app | feature | ui | logic | data | platform | shared | test | unknown`), `source_roots`, `ui_scope`, `logic_scope`, `data_scope`, `resource_scope`, `depends_on`, and `module_output_root` (`<output_root>/modules/<module_id>`). Include UI-only and logic-only modules when they exist; if a module has no UI or no logic, record `none` with evidence. For every scheduled `module_id`, create the module folder root before dispatch. Write `modules_index.json` as the machine-routable lookup from `module_id` to `module_output_root`, `module_brief_path`, dimension roots under `node-results/<dimension>/`, and `representation_paths`.
|
|
116
|
+
- **Output**: `module_inventory.json`, `module_inventory.md`, `modules_index.json`. Inventory JSON must contain `analysis_modules`, deterministic `module_order`, in-scope and out-of-scope roots, dependencies, and each module's output root. `modules_index.json` must list every scheduled `module_id` with resolvable paths. Markdown must explain module boundaries and evidence without doing role analysis.
|
|
104
117
|
- **Serial / Parallel**: serial (precedes all module dispatch)
|
|
105
|
-
- **Quality gate**: module inventory exists/non-empty, every in-scope source root is assigned to one module or `out_of_scope`, and `module_order` is deterministic.
|
|
118
|
+
- **Quality gate**: module inventory exists/non-empty, `modules_index.json` exists/non-empty, every scheduled module folder path is declared, every in-scope source root is assigned to one module or `out_of_scope`, and `module_order` is deterministic.
|
|
106
119
|
|
|
107
|
-
### Step 4 — Stage A per module: dispatch
|
|
120
|
+
### Step 4 — Stage A per module: dispatch foundation nodes (parallel, B-pattern)
|
|
108
121
|
|
|
109
122
|
- **Executor**: `presentation-resource`, `project-architecture`, `data-contract-flow`
|
|
110
123
|
- **Input**: per-node contract `{ source_project_path, module_id, module_scope, analysis_scope, mode, module_brief_path, skill_spec_path (roles/<id>.md), output_dir: <output_root>/modules/<module_id>/node-results/<node_id>, return_format: json }`; `data-contract-flow` may also receive `presentation_hints` when known.
|
|
111
|
-
- **Action**: each node validates inputs, performs its bounded
|
|
112
|
-
- **Output**:
|
|
124
|
+
- **Action**: each node validates inputs, performs its bounded slice, writes its JSON+MD artifacts, and returns the controller JSON shape.
|
|
125
|
+
- **Output**:
|
|
126
|
+
- `presentation_resource.json`, `presentation_resource.md`: UI entry points, screen inventory, checked UI layout/view trees, navigation, presentation modules, resources, safe downloads, usage map, migration implications, gaps.
|
|
127
|
+
- `project_architecture.json`, `project_architecture.md`: build/SDK config, topology, architecture patterns, layer roles, dependencies, Jetpack/DI/platform/generated usage, boundary risks, migration constraints.
|
|
128
|
+
- `data_contract_flow.json`, `data_contract_flow.md`: network/local data contracts, APIs, models, data sources, mappings, repository/reactive/end-to-end flows, loading/error/empty behavior, dynamic API gaps.
|
|
113
129
|
- **Serial / Parallel**: parallel within one module — all three run together for the same `module_id`. Do not start the next module until the current module representation is written unless the user explicitly allows concurrent modules.
|
|
114
130
|
- **Quality gate**: each return must be `status: "completed"` with `output_files` that exist and are non-empty. Refresh `analysis-workspace-state` after the group; on missing/empty/non-`completed`/stale output → re-dispatch that node with the same contract plus the failure reason (retry policy in [bind.md](bind.md) § Failure Handling). Do NOT synthesize around a failed node.
|
|
115
131
|
|
|
@@ -118,34 +134,46 @@ No node may choose its own output path. `presentation-resource` may write downlo
|
|
|
118
134
|
- **Executor**: `behavior-logic`
|
|
119
135
|
- **Input**: required `module_id`, `module_scope`, `presentation_resource_path`, `project_architecture_path`, `data_contract_flow_path`, and latest `analysis_workspace_state_path`
|
|
120
136
|
- **Action**: synthesize user-action / lifecycle / state-machine / business-rule behavior, referencing (not rebuilding) upstream catalogs.
|
|
121
|
-
- **Output**: `behavior_logic
|
|
137
|
+
- **Output**: `behavior_logic.json`, `behavior_logic.md`. JSON must contain screen logic, state holders, lifecycle/user-action/control flows, business rules, data-contract links, cross-module interactions, state machines, and upstream alignment. Markdown must provide an agent handoff with diagrams when evidence supports them.
|
|
122
138
|
- **Serial / Parallel**: serial within the module — runs after that module's Stage A gate passes.
|
|
123
139
|
- **Quality gate**: latest workspace state must not mark Stage A inputs stale; return-shape + output-file checks; every major UI/logic scope from the module brief has behavior coverage or an explicit reason for none.
|
|
124
140
|
|
|
125
|
-
### Step 6 —
|
|
141
|
+
### Step 6 — Dimension index and module representation
|
|
126
142
|
|
|
127
143
|
- **Executor**: Leader
|
|
128
|
-
- **Input**: verified
|
|
129
|
-
- **Action**: integrate ONLY from verified outputs for that module. Write a module representation that covers both UI and logic when present: module purpose, UI surface, resources, architecture/ecosystem, data contracts/flows, behavior logic, dependencies, risks, gaps, evidence index, and readiness.
|
|
130
|
-
- **Output**: `module_representation.json`, `module_representation.md`
|
|
144
|
+
- **Input**: verified dimension JSON/MD outputs for one `module_id`
|
|
145
|
+
- **Action**: write `dimension_index.json` mapping the four analysis dimensions to their verified artifact paths and status. Then integrate ONLY from verified dimension outputs for that module. Write a module representation that covers both UI and logic when present: module purpose, UI surface, resources, architecture/ecosystem, data contracts/flows, behavior logic, dimension traceability index, intra-module dependencies, risks, gaps, evidence index, and readiness. Record cross-module references as pointers only; do not synthesize full inter-module graphs here.
|
|
146
|
+
- **Output**: `dimension_index.json`, `module_representation.json`, `module_representation.md`. `dimension_index.json` is the per-module dimension lookup. Module representation JSON is the module-level synthesis and traceability index; Markdown is the agent-readable handoff. Both must cite verified dimension artifacts and source evidence.
|
|
131
147
|
- **Serial / Parallel**: serial
|
|
132
|
-
- **Quality gate**: no unknowns hidden; every module representation points to its
|
|
148
|
+
- **Quality gate**: `dimension_index.json` lists all four dimensions with resolvable paths; no unknowns hidden; every module representation points to its dimension artifacts and source evidence. Refresh workspace state after writing. Do not proceed to cross-module global records until every scheduled module is represented or explicitly marked blocked/out of scope.
|
|
149
|
+
|
|
150
|
+
### Step 7 — Cross-module global records (migration assembly basis)
|
|
151
|
+
|
|
152
|
+
- **Executor**: Leader
|
|
153
|
+
- **Input**: all verified module representations, all per-module dimension outputs (for `cross_module_*` fields), `module_inventory.json`, `modules_index.json`
|
|
154
|
+
- **Action**: aggregate inter-module evidence into three dedicated global artifacts before `global_representation.*`:
|
|
155
|
+
1. **Cross-module architecture** — Gradle/topology glue, layer boundaries, navigation integration, shared platform services, DI scope bridges, architectural dependency edges, and conflicts. Source from module `cross_module_dependencies`, `cross_module_references`, and architecture dimensions.
|
|
156
|
+
2. **Cross-module data/logic** — shared APIs/models/stores, `cross_module_data_links`, `cross_module_interactions`, event/callback/bus paths, cache/write-back sharing, and control-flow handoffs.
|
|
157
|
+
3. **Migration assembly basis** — deterministic module assembly order (respecting `depends_on`), integration checkpoints, shared contracts each module must preserve, partial-migration boundaries, and blockers for downstream `android-to-kmp-migrator` scheduling.
|
|
158
|
+
- **Output**: `cross_module_architecture.json`, `cross_module_architecture.md`, `cross_module_data_logic.json`, `cross_module_data_logic.md`, `migration_assembly_basis.json`, `migration_assembly_basis.md`.
|
|
159
|
+
- **Serial / Parallel**: serial; write architecture, then data/logic, then assembly basis
|
|
160
|
+
- **Quality gate**: every inter-module edge cites source `module_id`, dimension artifact path, and source-path evidence; assembly order is deterministic and consistent with `module_order` and `depends_on`; no raw-source gap filling — rerun the responsible module/node instead.
|
|
133
161
|
|
|
134
|
-
### Step
|
|
162
|
+
### Step 8 — Global representation
|
|
135
163
|
|
|
136
164
|
- **Executor**: Leader
|
|
137
|
-
- **Input**: all verified module representations
|
|
138
|
-
- **Action**: combine module representations into a total full-project global representation. Preserve module boundaries first, then synthesize
|
|
139
|
-
- **Output**: `global_representation.json`, `global_representation.md
|
|
165
|
+
- **Input**: all verified module representations, cross-module global records from Step 7
|
|
166
|
+
- **Action**: combine module representations and cross-module global records into a total full-project global representation. Preserve module boundaries first, then synthesize navigation, shared resources, shared logic, platform constraints, conflicts, and global readiness. Do not read raw source to fill gaps at this stage; rerun the responsible module/node instead.
|
|
167
|
+
- **Output**: `global_representation.json`, `global_representation.md`. JSON is the full-project representation and evidence index; Markdown explains how modules connect using the dedicated cross-module artifacts.
|
|
140
168
|
- **Serial / Parallel**: serial
|
|
141
|
-
- **Quality gate**: latest workspace state must not mark required module representations stale; every global claim maps to a module representation and source-path evidence, or is marked `assumed`, `unknown`, or `blocked`.
|
|
169
|
+
- **Quality gate**: latest workspace state must not mark required module representations or cross-module global records stale; every global claim maps to a module representation, cross-module global record, and source-path evidence, or is marked `assumed`, `unknown`, or `blocked`.
|
|
142
170
|
|
|
143
|
-
### Step
|
|
171
|
+
### Step 9 — Final: write SPEC package + emit completion report
|
|
144
172
|
|
|
145
173
|
- **Executor**: Leader
|
|
146
|
-
- **Input**: `global_representation.json`, `global_representation.md`, module inventory, module representations, latest `analysis_workspace_state.json`
|
|
147
|
-
- **Action**: write SPEC artifacts under `<output_root>/SPEC`. **Exploration** mode → `prd.md`, `design.md`, `verification.md`. **Migration** mode → adds `plan.md`. SPEC must synthesize, not paste node summaries; every important claim maps to module/global
|
|
148
|
-
- **Output**: SPEC files + the completion report below
|
|
174
|
+
- **Input**: `global_representation.json`, `global_representation.md`, cross-module global records, module inventory, `modules_index.json`, module representations, latest `analysis_workspace_state.json`
|
|
175
|
+
- **Action**: write SPEC artifacts under `<output_root>/SPEC`. **Exploration** mode → `prd.md`, `design.md`, `verification.md`. **Migration** mode → adds `plan.md`. SPEC must synthesize, not paste node summaries; every important claim maps to module/global/cross-module evidence and source paths or is marked assumption/gap. `design.md` must cite `cross_module_architecture.*` and `cross_module_data_logic.*` for integration sections. Migration-mode `plan.md` must use `migration_assembly_basis.*` for module assembly order and integration checkpoints. `design.md` sections include a Mermaid diagram, structured table, or evidence mapping; presentation/navigation, project architecture, data-contract/flow, and cross-module sections include diagrams when evidence exists.
|
|
176
|
+
- **Output**: SPEC files + the completion report below. `prd.md` captures product behavior and journeys, `design.md` captures implementation structure and evidence-backed diagrams/tables, `verification.md` captures coverage/traceability/consistency/readiness, and migration-mode `plan.md` captures migration milestones, source-to-target mapping, validation, risks, and blockers.
|
|
149
177
|
|
|
150
178
|
#### Final Report Format
|
|
151
179
|
|
|
@@ -158,21 +186,42 @@ No node may choose its own output path. `presentation-resource` may write downlo
|
|
|
158
186
|
"output_root": "...",
|
|
159
187
|
"workspace_state": ["..."],
|
|
160
188
|
"module_inventory": ["..."],
|
|
189
|
+
"modules_index": ["..."],
|
|
161
190
|
"module_representations": ["..."],
|
|
191
|
+
"cross_module_architecture": ["..."],
|
|
192
|
+
"cross_module_data_logic": ["..."],
|
|
193
|
+
"migration_assembly_basis": ["..."],
|
|
162
194
|
"global_representation": ["..."],
|
|
163
195
|
"node_outputs_by_module": {},
|
|
164
196
|
"spec_outputs": ["..."],
|
|
165
197
|
"readiness": "ready | ready_with_assumptions | blocked",
|
|
198
|
+
"handoff_package": "P0 | P1 | P2 | P3 | P4 | P5 | P6",
|
|
199
|
+
"handoff_gates": {},
|
|
166
200
|
"blocking_gaps": []
|
|
167
201
|
}
|
|
168
202
|
```
|
|
169
203
|
|
|
204
|
+
## Downstream Handoff Gate (Leader final step)
|
|
205
|
+
|
|
206
|
+
Before emitting the completion report, the Leader MUST:
|
|
207
|
+
|
|
208
|
+
1. Evaluate handoff packages `P0`–`P6` per [output-contract.md](output-contract.md).
|
|
209
|
+
2. Write `handoff_gates` into `analysis_workspace_state.json` (boolean `ready` + `missing_paths[]` per package).
|
|
210
|
+
3. Add `## Handoff Gates` to `SPEC/verification.md` mirroring the same status.
|
|
211
|
+
4. Set `run_manifest.json` → `handoff_package` to the highest ready package id and list every artifact path in that package.
|
|
212
|
+
5. Set `readiness` in `verification.md` to `blocked` when the intended downstream package is not ready.
|
|
213
|
+
|
|
214
|
+
Downstream handlers read package gates only from these files — not from controller chat output.
|
|
215
|
+
|
|
170
216
|
## Acceptance Criteria
|
|
171
217
|
|
|
172
218
|
- All dispatched nodes returned outputs matching their role `## Output Schema` (no malformed returns); any `[ROLE MISSING]` is recorded per [bind.md](bind.md).
|
|
219
|
+
- `handoff_gates` in workspace ledger and `SPEC/verification.md` accurately reflect [output-contract.md](output-contract.md) package readiness.
|
|
173
220
|
- All required node artifacts exist and are non-empty; latest `analysis-workspace-state` has no stale required inputs; all required SPEC artifacts for the selected mode exist and are non-empty.
|
|
174
221
|
- **Path check**: every artifact path is under `output_root`; every node artifact is under `<output_root>/modules/<module_id>/node-results/<node_id>/`; SPEC is under `<output_root>/SPEC`.
|
|
175
|
-
- **Module-first check**: every scheduled module has a module brief,
|
|
222
|
+
- **Module-first check**: every scheduled module has a module brief, four dimension outputs, `dimension_index.json`, and module representation before cross-module global records are written.
|
|
223
|
+
- **Cross-module check**: `cross_module_architecture.*`, `cross_module_data_logic.*`, and `migration_assembly_basis.*` exist and are non-empty before `global_representation.*` is written.
|
|
224
|
+
- **Index check**: `modules_index.json` resolves every scheduled `module_id` to its module folder and representation paths.
|
|
176
225
|
- **Coverage check (B-pattern)**: every per-module Stage A slice is accounted for — screens/resources from `presentation-resource`, topology/platform constraints from `project-architecture`, and APIs/data flows from `data-contract-flow` appear in module/global representations or are marked out of scope/unknown.
|
|
177
226
|
- **Gate check (C-pattern)**: per-module behavior analysis ran only after that module's Stage A verification; every kicked-back node is recorded.
|
|
178
227
|
- Data-flow and behavior-flow names align across `design.md`, `plan.md`, and `verification.md`.
|
|
@@ -1,165 +1,116 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: android-to-kmp-migrator
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
Use
|
|
6
|
-
Do NOT use for Legacy Android analysis, KMP-only feature work,
|
|
7
|
-
version: "0.
|
|
4
|
+
Module-first Swarm Skill that migrates Legacy Android into an existing KMP target using upstream analyst P6 artifacts, target-project-assistant alignment, planning/prep/implementation roles, global integrate+align phase, and kmp-test-validator handoff — without full-project build during migration.
|
|
5
|
+
Use when analyst package P6 exists and the user wants module-first porting then whole-system assembly.
|
|
6
|
+
Do NOT use for Legacy Android analysis only, KMP-only feature work, or non-migration refactors.
|
|
7
|
+
version: "0.6"
|
|
8
8
|
kind: swarm-skill
|
|
9
9
|
disable-model-invocation: true
|
|
10
10
|
roles:
|
|
11
11
|
- id: migration-workspace-state
|
|
12
12
|
kind: ai_agent
|
|
13
|
-
purpose:
|
|
13
|
+
purpose: Migration ledger — handoff gates M0–V0, plan-vs-code gaps, stale outputs, rerun hooks. No code edits.
|
|
14
14
|
skills: []
|
|
15
15
|
tools: [git]
|
|
16
|
-
- id:
|
|
16
|
+
- id: target-project-assistant
|
|
17
17
|
kind: ai_agent
|
|
18
|
-
purpose:
|
|
18
|
+
purpose: Target KMP owner — global baseline, per-module anchors, alignment revision, consult log.
|
|
19
19
|
skills: []
|
|
20
20
|
tools: [rg]
|
|
21
|
-
- id:
|
|
21
|
+
- id: migration-planning-gate
|
|
22
22
|
kind: ai_agent
|
|
23
|
-
purpose:
|
|
23
|
+
purpose: Planning and dependency/platform gate — SPEC deltas, source-to-target map, capability map, ready_for_implementation.
|
|
24
24
|
skills: []
|
|
25
25
|
tools: [rg]
|
|
26
|
-
- id:
|
|
26
|
+
- id: migration-prep
|
|
27
27
|
kind: ai_agent
|
|
28
|
-
purpose: Presentation
|
|
28
|
+
purpose: Presentation and state/data prep — tokens, resources, routes, state/models/API expectations.
|
|
29
29
|
skills: []
|
|
30
30
|
tools: [rg, curl]
|
|
31
|
-
- id:
|
|
31
|
+
- id: module-implementation
|
|
32
32
|
kind: ai_agent
|
|
33
|
-
purpose:
|
|
34
|
-
skills: []
|
|
35
|
-
tools: [rg]
|
|
36
|
-
- id: ui-implementation
|
|
37
|
-
kind: ai_agent
|
|
38
|
-
purpose: UI implementation owner — migrated Compose UI layout/components/states/resources first, with binding surfaces and no business logic.
|
|
39
|
-
skills: []
|
|
40
|
-
tools: [rg]
|
|
41
|
-
- id: logic-implementation
|
|
42
|
-
kind: ai_agent
|
|
43
|
-
purpose: Logic implementation owner — repositories/use cases/API integration/state propagation/business logic bound to approved UI surfaces.
|
|
33
|
+
purpose: UI and logic implementation by mode — ui first, then logic after UI approval.
|
|
44
34
|
skills: []
|
|
45
35
|
tools: [rg]
|
|
46
36
|
- id: module-node-review-fix
|
|
47
37
|
kind: ai_agent
|
|
48
|
-
purpose: Review
|
|
38
|
+
purpose: Review or scoped fix by mode; fresh re-review after every fix.
|
|
49
39
|
skills: []
|
|
50
40
|
tools: [rg, git]
|
|
51
41
|
- id: migration-verification
|
|
52
42
|
kind: ai_agent
|
|
53
|
-
purpose:
|
|
43
|
+
purpose: Module static checks + UI/logic restoration vs analyst — no full project build.
|
|
54
44
|
skills: []
|
|
55
45
|
tools: [rg, git]
|
|
46
|
+
- id: global-migration-phase
|
|
47
|
+
kind: ai_agent
|
|
48
|
+
purpose: Global integrate (cross-module wiring) then align (analyst vs target comparison) by mode.
|
|
49
|
+
skills: []
|
|
50
|
+
tools: [rg]
|
|
56
51
|
- id: completion-report
|
|
57
52
|
kind: ai_agent
|
|
58
|
-
purpose:
|
|
53
|
+
purpose: Readiness and migration_report modes; validation handoff to kmp-test-validator.
|
|
59
54
|
skills: []
|
|
60
55
|
tools: [rg, git]
|
|
61
56
|
---
|
|
62
57
|
|
|
63
58
|
# Android To KMP Migrator Swarm Skill
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
Module-first migrator for Legacy Android → KMP target assembly.
|
|
66
61
|
|
|
67
|
-
|
|
62
|
+
**Canonical contract**: [output-contract.md](output-contract.md)
|
|
68
63
|
|
|
69
64
|
## Protocol Summary
|
|
70
65
|
|
|
71
|
-
0.
|
|
72
|
-
1.
|
|
73
|
-
2.
|
|
74
|
-
3.
|
|
75
|
-
4.
|
|
76
|
-
5. **Per
|
|
77
|
-
6. **
|
|
78
|
-
7.
|
|
79
|
-
8. **
|
|
80
|
-
9. **Verification** — run `migration-verification` with required `check_ids`: `source_set`, `api_contract`, `ui_render`, `incremental_build`.
|
|
81
|
-
10. **Completion/report** — run `completion-report` in `readiness` mode, write module/global representations, then run `completion-report` in `report` mode and hand off to `kmp-test-validator`.
|
|
66
|
+
0. Pre-flight — [dependencies.yaml](dependencies.yaml): `rg` / `git` / `curl`, optional `jetbrains` MCP (`optional_mcp`), upstream analyst **P6** (`upstream_inputs`); record `dependency_preflight` in `run_manifest.json`.
|
|
67
|
+
1. Verify analyst **P6**; `run_manifest.json`, `upstream_analyst_index.json`.
|
|
68
|
+
2. Migration inventory + `modules_migration_index.json`.
|
|
69
|
+
3. Workspace state init.
|
|
70
|
+
4. TPA `global_baseline`.
|
|
71
|
+
5. **Per module** (assembly_order): TPA `module_anchors` → **planning-gate** → **prep** → review/fix → **implementation `ui`** → review/fix → **implementation `logic`** → review/fix → verification → completion record → readiness → module representation.
|
|
72
|
+
6. **Global phase `integrate`** → **`align`** + alignment report.
|
|
73
|
+
7. Global representation + completion-report `report` mode.
|
|
74
|
+
8. **kmp-test-validator** when **V0** ready.
|
|
82
75
|
|
|
83
76
|
## Roles
|
|
84
77
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
|
88
|
-
|
|
89
|
-
| `migration-
|
|
90
|
-
| `migration-
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `module-node-review-fix` | Read-only review or scoped fix by mode | After file-changing slices | [roles/module-node-review-fix.md](roles/module-node-review-fix.md) |
|
|
97
|
-
| `migration-verification` | Source-set/API/UI/build checks | After implementation approval | [roles/migration-verification.md](roles/migration-verification.md) |
|
|
98
|
-
| `completion-report` | Readiness and final report by mode | Module/global completion | [roles/completion-report.md](roles/completion-report.md) |
|
|
78
|
+
| id | Modes | Role file |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| `migration-workspace-state` | — | [roles/migration-workspace-state.md](roles/migration-workspace-state.md) |
|
|
81
|
+
| `target-project-assistant` | `global_baseline`, `module_anchors`, `consult` | [roles/target-project-assistant.md](roles/target-project-assistant.md) |
|
|
82
|
+
| `migration-planning-gate` | — | [roles/migration-planning-gate.md](roles/migration-planning-gate.md) |
|
|
83
|
+
| `migration-prep` | — | [roles/migration-prep.md](roles/migration-prep.md) |
|
|
84
|
+
| `module-implementation` | `ui`, `logic` | [roles/module-implementation.md](roles/module-implementation.md) |
|
|
85
|
+
| `module-node-review-fix` | `review`, `fix` | [roles/module-node-review-fix.md](roles/module-node-review-fix.md) |
|
|
86
|
+
| `migration-verification` | — | [roles/migration-verification.md](roles/migration-verification.md) |
|
|
87
|
+
| `global-migration-phase` | `integrate`, `align` | [roles/global-migration-phase.md](roles/global-migration-phase.md) |
|
|
88
|
+
| `completion-report` | `readiness`, `report` | [roles/completion-report.md](roles/completion-report.md) |
|
|
99
89
|
|
|
100
90
|
## Files
|
|
101
91
|
|
|
102
|
-
| File |
|
|
92
|
+
| File | Contents |
|
|
103
93
|
|---|---|
|
|
104
|
-
| [
|
|
105
|
-
| [workflow.md](workflow.md) |
|
|
106
|
-
| [bind.md](bind.md) |
|
|
107
|
-
| [
|
|
108
|
-
| [
|
|
109
|
-
|
|
110
|
-
## Strict Output Schedule
|
|
111
|
-
|
|
112
|
-
```text
|
|
113
|
-
output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
|
|
114
|
-
module_index_dir = <output_root>/module-index
|
|
115
|
-
module_root = <output_root>/modules/<migration_module_id>
|
|
116
|
-
node_result_dir = <module_root>/node-results/<node_id>
|
|
117
|
-
module_representation_dir = <module_root>/representation
|
|
118
|
-
global_dir = <output_root>/global
|
|
119
|
-
report_dir = <output_root>/report
|
|
120
|
-
```
|
|
94
|
+
| [output-contract.md](output-contract.md) | Paths, upstream P6, packages M0–V0 |
|
|
95
|
+
| [workflow.md](workflow.md) | Topology, steps, gates |
|
|
96
|
+
| [bind.md](bind.md) | Limits, constraints, failures |
|
|
97
|
+
| [dependencies.yaml](dependencies.yaml) | CLI + optional MCP per role |
|
|
98
|
+
| [roles/](roles/) | Role specs |
|
|
121
99
|
|
|
122
|
-
|
|
100
|
+
## Handoff Gates
|
|
123
101
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
- `<global_dir>/global_migration_representation.json`
|
|
133
|
-
- `<global_dir>/global_migration_representation.md`
|
|
134
|
-
- `<report_dir>/migration_report.json`
|
|
135
|
-
- `<report_dir>/migration_report.md`
|
|
136
|
-
|
|
137
|
-
## Shared Return Shape
|
|
138
|
-
|
|
139
|
-
```json
|
|
140
|
-
{
|
|
141
|
-
"status": "completed | passed | ready_for_implementation | ready_for_validation | needs_rerun | failed | blocked",
|
|
142
|
-
"node": "<node-name>",
|
|
143
|
-
"mode": "<mode when role has modes>",
|
|
144
|
-
"migration_module_id": "<module id or global>",
|
|
145
|
-
"module_scope": "<module/screen/feature/resource/API scope or global>",
|
|
146
|
-
"output_dir": "<exact node_result_dir>",
|
|
147
|
-
"output_files": ["<paths>"],
|
|
148
|
-
"changed_files": ["<paths or empty>"],
|
|
149
|
-
"stale_upstream_inputs": ["<paths or empty>"],
|
|
150
|
-
"rerun_requests": [{ "node": "<responsible-node>", "reason": "", "required_inputs": [], "expected_output": "" }],
|
|
151
|
-
"blocking_gaps": ["<gaps or empty>"]
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Controller handling: missing/empty `output_files` -> rerun the same node; non-empty `stale_upstream_inputs` -> refresh upstream artifacts then rerun; non-empty `rerun_requests` -> dispatch the responsible node first; unresolved `blocking_gaps` -> stop with a user-visible blocker.
|
|
102
|
+
| Package | Unlocks |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `M2` | Target alignment (TPA) |
|
|
105
|
+
| `M3` | Per-module complete |
|
|
106
|
+
| `M4` | All modules migrated |
|
|
107
|
+
| `M5` | Global integrate |
|
|
108
|
+
| `M6` | Global align passed |
|
|
109
|
+
| `V0` | kmp-test-validator |
|
|
156
110
|
|
|
157
111
|
## Shared Rules
|
|
158
112
|
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
- Target conventions and reusable modules/components take priority over new abstractions.
|
|
164
|
-
- Target build config is read-only except through `dependency-platform-gate`.
|
|
165
|
-
- Migrated code stays inside one KMP target project; raw Legacy Android source wins when SPEC conflicts.
|
|
113
|
+
- Analyst **P6** required; TPA owns all target Q&A.
|
|
114
|
+
- Mode boundaries non-negotiable: `ui`/`logic`, `integrate`/`align`, `review`/`fix`.
|
|
115
|
+
- No full project build in migrator.
|
|
116
|
+
- JSON artifacts are machine-routable source of truth.
|
|
@@ -4,73 +4,41 @@
|
|
|
4
4
|
|
|
5
5
|
| Item | Limit | Reason |
|
|
6
6
|
|---|---|---|
|
|
7
|
-
| `max_parallel_teammates` |
|
|
8
|
-
| `total_wall_clock_budget` | 90 min per
|
|
9
|
-
| `total_token_budget` | 1.2M tokens per batch |
|
|
10
|
-
| `per_node_token_budget` |
|
|
11
|
-
| `max_review_fix_cycles` | 3 per slice |
|
|
12
|
-
| `incremental_build_runs` | 1 per Verify pass | One smallest-trustworthy build/check per verification pass; reruns only after a routed fix. |
|
|
7
|
+
| `max_parallel_teammates` | 1 | Serial pipeline per module |
|
|
8
|
+
| `total_wall_clock_budget` | 90 min per module batch | Module-first migration schedule |
|
|
9
|
+
| `total_token_budget` | 1.2M tokens per batch | Leader + role dispatches per module |
|
|
10
|
+
| `per_node_token_budget` | 160k tokens | Planning-gate, prep, module-implementation carry broader context |
|
|
11
|
+
| `max_review_fix_cycles` | 3 per slice | Before `blocked` escalation |
|
|
13
12
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
Team-level rules — distinct from each role's own `## Boundary`.
|
|
17
|
-
|
|
18
|
-
- **Leader-as-orchestrator only**: the Leader (`android-to-kmp-migrator` controller) verifies the trigger, builds the shared brief, dispatches reduced roles in dependency order, verifies outputs, routes reruns, and invokes `kmp-test-validator`. The Leader does NOT implement migration code, fix findings, or substitute any node's work.
|
|
19
|
-
- **Strict output root**: the Leader must lock `output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator` before any migration node dispatch. All node outputs, module representations, global representation, report artifacts, logs, and ledgers must be under this root.
|
|
20
|
-
- **Module-first schedule**: the Leader must write `module-index/migration_module_inventory.*`, then process each `migration_module_id` through planning, dependency/platform, prep, review/fix, UI, review/fix, logic, review/fix, verification, readiness, and module representation before global aggregation.
|
|
21
|
-
- **Per-node exact paths**: module-scoped nodes receive `output_dir = <output_root>/modules/<migration_module_id>/node-results/<node_id>`. Global-only outputs use `<output_root>/global/...`; final reports use `<output_root>/report/...`.
|
|
22
|
-
- **Hard dependency order (C-pattern)**: `migration-analysis-planning` precedes `dependency-platform-gate`, which precedes prep and implementation. `ui-implementation` precedes `logic-implementation`. A downstream node references upstream node outputs by path and must NOT rebuild or overwrite upstream artifacts.
|
|
23
|
-
- **Mandatory review→fix→re-review loop**: after any node changes files, `module-node-review-fix` runs in `mode: review`; on `needs_fix`, it runs in `mode: fix` inside `allowed_files`, then a fresh `mode: review` invocation is mandatory. No downstream gate consumes a slice whose latest review is not `approved`.
|
|
24
|
-
- **Dependency gate authority**: only `dependency-platform-gate` may justify a build-config change; target build configuration is read-only to every other role. No role adds dependencies, root Gradle/settings files, or wrappers.
|
|
25
|
-
- **Single-project invariant**: migrated code stays inside one KMP target project; no migrated sub-module becomes a standalone project. Android-only APIs never enter `commonMain`.
|
|
26
|
-
- **No placeholder completion**: no implementation node may return `completed` with TODO/FIXME/stub/sample-only-data in production paths as its deliverable.
|
|
27
|
-
- **Failure routing, not mediation**: when a verification node fails or nodes disagree, the Leader routes the failure verbatim to the responsible node (recorded in the workspace-state ledger and `prd_completion_check`); it does not silently reconcile or average.
|
|
28
|
-
- **Stale-artifact discipline**: `migration-workspace-state` is refreshed after major node completions; any output whose upstream changed afterward is marked stale and must be re-run before consumption.
|
|
29
|
-
- **Validation boundary**: only `completion-report` in `mode: readiness` issues readiness, only `completion-report` in `mode: report` assembles the validation handoff, and only `kmp-test-validator` validates. SPEC guides migration, but raw Legacy Android source wins when evidence conflicts.
|
|
30
|
-
- **Representation gate**: every scheduled module must have `module_migration_representation.json` and `.md`. `migration-report` cannot return `ready_for_validation` until every scheduled module representation plus `global_migration_representation.json` and `.md` exists and is non-empty.
|
|
13
|
+
## Build Boundary
|
|
31
14
|
|
|
32
|
-
|
|
15
|
+
- Migrator: `syntax_check`, static checks, restoration parity only.
|
|
16
|
+
- **Forbidden**: `incremental_build` in migrator.
|
|
17
|
+
- **kmp-test-validator**: full compile/build/test at package **V0**.
|
|
33
18
|
|
|
34
|
-
|
|
19
|
+
## Behavioral Constraints
|
|
35
20
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
- **Role schedule**: dispatch only role IDs listed in [SKILL.md](SKILL.md).
|
|
22
|
+
- **Mode discipline**:
|
|
23
|
+
- `module-implementation`: `ui` then `logic` — separate invocations
|
|
24
|
+
- `global-migration-phase`: `integrate` (edits) then `align` (read-only) — separate invocations
|
|
25
|
+
- `module-node-review-fix`: `review` then optional `fix` then fresh `review`
|
|
26
|
+
- **TPA monopoly**: all target Q&A through `target-project-assistant`.
|
|
27
|
+
- **Analyst P6 gate**: required before dispatch.
|
|
28
|
+
- **Output contract**: [output-contract.md](output-contract.md) paths only.
|
|
29
|
+
- **Handoff gates**: persist **M0**–**M6**, **V0** in workspace ledger.
|
|
44
30
|
|
|
45
|
-
|
|
31
|
+
## Failure Handling
|
|
46
32
|
|
|
47
|
-
|
|
|
33
|
+
| Failure | Response |
|
|
48
34
|
|---|---|
|
|
49
|
-
|
|
|
50
|
-
| `
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- If 50%+ of dispatched nodes in a stage return `[ROLE MISSING]`, the run is **FAILED** — emit a partial migration report with a `FAILED: insufficient node coverage` header, readiness `blocked`, and the missing-evidence list.
|
|
57
|
-
- If `total_wall_clock_budget` is exceeded, halt in-flight nodes, checkpoint via `migration-workspace-state`, emit whatever verified outputs exist, and tag the report `INCOMPLETE: budget exceeded`.
|
|
58
|
-
- If `total_token_budget` is exceeded mid-run, halt new dispatches, let in-flight nodes finish, checkpoint, and emit a partial report tagged `INCOMPLETE: token budget exceeded`.
|
|
59
|
-
|
|
60
|
-
## Required Path Contract
|
|
61
|
-
|
|
62
|
-
The controller must pass these values to nodes and reject any output outside the declared path:
|
|
35
|
+
| Unknown or invalid role ID | Reject; use role from `SKILL.md` registry |
|
|
36
|
+
| `ui` and `logic` combined | Reject invocation |
|
|
37
|
+
| `integrate` and `align` combined | Reject invocation |
|
|
38
|
+
| Verification restoration failed | Rerun `module-implementation` or `migration-prep`; no completion record |
|
|
39
|
+
| Align omissions | Rerun `rerun_modules` or `global-migration-phase integrate` |
|
|
40
|
+
| Build requested in migrator | Block; route to kmp-test-validator |
|
|
63
41
|
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
"output_root": "<output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator",
|
|
67
|
-
"module_index_dir": "<output_root>/module-index",
|
|
68
|
-
"module_root": "<output_root>/modules/<migration_module_id>",
|
|
69
|
-
"node_result_dir": "<module_root>/node-results/<node_id>",
|
|
70
|
-
"module_representation_dir": "<module_root>/representation",
|
|
71
|
-
"global_dir": "<output_root>/global",
|
|
72
|
-
"report_dir": "<output_root>/report"
|
|
73
|
-
}
|
|
74
|
-
```
|
|
42
|
+
## Dependencies
|
|
75
43
|
|
|
76
|
-
|
|
44
|
+
Pre-flight reads [dependencies.yaml](dependencies.yaml): `rg`, `git`, `curl`, optional `jetbrains` MCP. Record per-role `used_by` in manifest.
|