@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.
Files changed (60) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/SKILL.md +69 -46
  3. package/skills/android-project-analyst/bind.md +10 -5
  4. package/skills/android-project-analyst/dependencies.yaml +66 -10
  5. package/skills/android-project-analyst/output-contract.md +357 -0
  6. package/skills/android-project-analyst/roles/analysis-workspace-state.md +25 -8
  7. package/skills/android-project-analyst/roles/behavior-logic.md +6 -2
  8. package/skills/android-project-analyst/roles/data-contract-flow.md +5 -1
  9. package/skills/android-project-analyst/roles/presentation-resource.md +5 -1
  10. package/skills/android-project-analyst/roles/project-architecture.md +5 -1
  11. package/skills/android-project-analyst/workflow.md +75 -29
  12. package/skills/android-to-kmp-migrator/SKILL.md +62 -142
  13. package/skills/android-to-kmp-migrator/bind.md +29 -67
  14. package/skills/android-to-kmp-migrator/dependencies.yaml +72 -11
  15. package/skills/android-to-kmp-migrator/output-contract.md +318 -0
  16. package/skills/android-to-kmp-migrator/roles/completion-report.md +3 -1
  17. package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +87 -0
  18. package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +75 -0
  19. package/skills/android-to-kmp-migrator/roles/migration-prep.md +75 -0
  20. package/skills/android-to-kmp-migrator/roles/migration-verification.md +44 -26
  21. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +16 -8
  22. package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
  23. package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
  24. package/skills/android-to-kmp-migrator/workflow.md +85 -224
  25. package/skills/kmp-test-validator/SKILL.md +52 -85
  26. package/skills/kmp-test-validator/bind.md +30 -56
  27. package/skills/kmp-test-validator/dependencies.yaml +101 -9
  28. package/skills/kmp-test-validator/output-contract.md +166 -0
  29. package/skills/kmp-test-validator/roles/validation-business-testing.md +83 -0
  30. package/skills/kmp-test-validator/roles/validation-code-gate.md +116 -0
  31. package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +118 -0
  32. package/skills/kmp-test-validator/roles/validation-report.md +23 -14
  33. package/skills/kmp-test-validator/roles/validation-workspace-state.md +5 -2
  34. package/skills/kmp-test-validator/workflow.md +60 -115
  35. package/skills/migration-task-adapter/SKILL.md +64 -93
  36. package/skills/migration-task-adapter/bind.md +27 -91
  37. package/skills/migration-task-adapter/dependencies.yaml +21 -10
  38. package/skills/migration-task-adapter/output-contract.md +276 -0
  39. package/skills/migration-task-adapter/roles/adapter-report.md +73 -0
  40. package/skills/migration-task-adapter/roles/adapter-workspace-state.md +73 -0
  41. package/skills/migration-task-adapter/roles/task-route-orchestrator.md +106 -0
  42. package/skills/migration-task-adapter/workflow.md +76 -142
  43. package/skills/android-project-analyst/MIGRATION.md +0 -67
  44. package/skills/android-to-kmp-migrator/MIGRATION.md +0 -129
  45. package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -68
  46. package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -71
  47. package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -70
  48. package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -70
  49. package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -68
  50. package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -69
  51. package/skills/kmp-test-validator/MIGRATION.md +0 -84
  52. package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -72
  53. package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -72
  54. package/skills/kmp-test-validator/roles/validation-remediation.md +0 -117
  55. package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -67
  56. package/skills/migration-task-adapter/MIGRATION.md +0 -49
  57. package/skills/migration-task-adapter/roles/task-reporter.md +0 -134
  58. package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -139
  59. package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -145
  60. package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -198
@@ -1,246 +1,107 @@
1
- # Workflow: Legacy Android SPEC + target KMP project -> migrated, validation-ready KMP code
1
+ # Workflow: Analyst P6 module-first migration kmp-test-validator
2
2
 
3
- This workflow uses the reduced 10-role module-first migrator. Adjacent responsibilities are consolidated, but gates remain explicit through role modes, check IDs, exact output paths, and a workspace-state progress ledger that tracks per-module finish rates, plan-vs-code gaps, and rerun hooks.
3
+ See [output-contract.md](output-contract.md) and active role IDs in [SKILL.md](SKILL.md).
4
4
 
5
5
  ## Overview
6
6
 
7
7
  ```mermaid
8
8
  graph TD
9
- L0[Leader pre-flight] --> ROOT[LockOutputRoot<br/>run_manifest.json]
10
- ROOT --> INV[MigrationModuleInventory]
11
- INV --> WS[migration-workspace-state<br/>progress ledger]
12
- WS --> LOOP[ForEachMigrationModule]
13
- LOOP --> PLAN[migration-analysis-planning]
14
- PLAN --> DP[dependency-platform-gate]
15
- DP --> PREP
16
-
17
- subgraph PREP[Prep fan-out]
18
- PI[presentation-integration]
19
- SD[state-data-prep]
9
+ L0[Pre-flight deps] --> UP[Verify analyst P6]
10
+ UP --> INV[migration inventory]
11
+ INV --> WS[migration-workspace-state]
12
+ WS --> TPA0[target-project-assistant global_baseline]
13
+ TPA0 --> LOOP[For each migration_module_id]
14
+
15
+ subgraph MOD[Per-module pipeline]
16
+ TPA1[target-project-assistant module_anchors]
17
+ TPA1 --> PG[migration-planning-gate]
18
+ PG --> PREP[migration-prep]
19
+ PREP --> RF1[review/fix]
20
+ RF1 --> UI[module-implementation mode ui]
21
+ UI --> RF2[review/fix]
22
+ RF2 --> LOGIC[module-implementation mode logic]
23
+ LOGIC --> RF3[review/fix]
24
+ RF3 --> VER[migration-verification]
25
+ VER --> MCR[module_completion_record]
26
+ MCR --> READY[completion-report readiness]
27
+ READY --> MODREP[module_migration_representation]
20
28
  end
21
29
 
22
- PREP --> RF1{module-node-review-fix<br/>review/fix/re-review}
23
- RF1 --> UI[ui-implementation]
24
- UI --> RF2{module-node-review-fix}
25
- RF2 --> LOGIC[logic-implementation]
26
- LOGIC --> RF3{module-node-review-fix}
27
- RF3 --> VER[migration-verification<br/>source_set api_contract ui_render incremental_build]
28
- VER -->|failed| RESP[Re-dispatch responsible reduced role<br/>from rerun_hook]
29
- RESP --> RF1
30
- VER -->|passed| READY[completion-report<br/>mode readiness]
31
- READY -->|needs_rerun| RESP
32
- READY -->|ready_for_validation| MODREP[module_migration_representation.*]
33
- MODREP --> ALL{all modules represented?}
34
- ALL -- No --> LOOP
35
- ALL -- Yes --> GLOB[global_migration_representation.*]
36
- GLOB --> REPORT[completion-report<br/>mode report]
37
- REPORT --> KV[kmp-test-validator]
30
+ LOOP --> MOD
31
+ MOD --> M4{Package M4?}
32
+ M4 -- No --> LOOP
33
+ M4 -- Yes --> GMP1[global-migration-phase mode integrate]
34
+ GMP1 --> GMP2[global-migration-phase mode align]
35
+ GMP2 -->|needs_rerun| LOOP
36
+ GMP2 -->|passed| GLOB[global_migration_representation]
37
+ GLOB --> REPORT[completion-report report]
38
+ REPORT --> KV[kmp-test-validator V0]
38
39
  ```
39
40
 
40
- ## Strict Output Roots
41
+ ## Step 0 — Pre-flight
41
42
 
42
- ```text
43
- output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
44
- module_index_dir = <output_root>/module-index
45
- module_root = <output_root>/modules/<migration_module_id>
46
- node_result_dir = <module_root>/node-results/<node_id>
47
- module_representation_dir = <module_root>/representation
48
- global_dir = <output_root>/global
49
- report_dir = <output_root>/report
50
- ```
43
+ - **Executor**: Leader
44
+ - **Input**: [dependencies.yaml](dependencies.yaml) `tools[]` (`rg`, `git`, `curl`), `optional_mcp.jetbrains`, `upstream_inputs` analyst **P6**
45
+ - **Output**: `run_manifest.json` → `dependency_preflight` (CLI status, MCP availability, P6 readiness pointer)
46
+ - **Gate**: missing CLI tools → degraded modes per dependencies.yaml; analyst P6 not ready → **blocked** before module dispatch
51
47
 
52
- ## Detailed Steps
48
+ ## Step 1 — Upstream + output root
53
49
 
54
- ### Step 0 Pre-flight
50
+ - Verify analyst package **P6**; write `upstream_analyst_index.json`.
55
51
 
56
- - **Executor**: Leader
57
- - **Input**: [dependencies.yaml](dependencies.yaml)
58
- - **Action**: check optional tools (`rg`, `git`, `curl`) and report degraded behavior.
59
- - **Output**: pre-flight status recorded in `run_manifest.json` and later workspace-state artifacts.
60
- - **Gate**: missing optional tools do not skip nodes; the controller records degraded evidence.
52
+ ## Step 2 — Migration inventory
61
53
 
62
- ### Step 1 Trigger + Output Root
54
+ - `migration_module_inventory.*`, `modules_migration_index.json`, per-module `module_brief.json`.
63
55
 
64
- - **Executor**: Leader
65
- - **Input**: `legacy_android_project_path` or completed SPEC, `kmp_target_project_path`, `migration_scope`, optional `output_dir`
66
- - **Action**: verify migration trigger, verify analyst completion, lock `output_root`, write `<output_root>/run_manifest.json`.
67
- - **Output**: `<output_root>/run_manifest.json` containing Android/SPEC inputs, KMP target path, migration scope, output root, allowed roots, dependency-preflight status, schedule version, and timestamp.
68
- - **Gate**: stop if target is not KMP-compatible or analyst completion is missing/stale.
56
+ ## Step 3 — Workspace state
69
57
 
70
- ### Step 2 Migration Module Inventory
58
+ - Init ledger; track handoff gates **M0**–**V0**.
71
59
 
72
- - **Executor**: Leader
73
- - **Action**: divide the requested migration into deterministic `migration_module_id` slices.
74
- - **Output**:
75
- - `<module_index_dir>/migration_module_inventory.json`: module ids/order, scope slices, target placement hints, allowed files/source sets, module output roots, blockers.
76
- - `<module_index_dir>/migration_module_inventory.md`: agent-readable module schedule and boundary evidence.
77
- - `<module_root>/module_brief.json` for every scheduled module: module dispatch contract, evidence paths, role hints, allowed files/source sets, assumptions.
78
- - **Gate**: every module has `module_scope`, UI/logic/data/resource scope, target placement hints, `allowed_target_files`, and `allowed_source_sets`.
79
-
80
- ### Step 3 — Workspace State
81
-
82
- - **Executor**: `migration-workspace-state`
83
- - **Input**: migration module inventory, module briefs, node outputs, changed files, planning outputs, implementation outputs, review outputs, verification outputs, representation outputs, source change/timestamp evidence, rerun reports, blockers.
84
- - **Action**: initialize and refresh a progress ledger. Track per-module current stage, stage status, planned/completed work units, `finish_rate`, changed-file ownership, plan-vs-code gaps, stale outputs, rerun hooks, blockers, and next safe actions.
85
- - **Output**:
86
- - `<global_dir>/node-results/migration-workspace-state/migration_workspace_state.json`, `.md`: global/module progress ledger, aggregate finish rate, stale/blocked modules, rerun hooks.
87
- - `<module_root>/node-results/migration-workspace-state/migration_workspace_state.json`, `.md`: module stage status, finish rate, changed-file ownership, plan-vs-code gaps, stale outputs, rerun hooks.
88
- - **Gate**: stale upstream outputs, failed stages, missing review/verification, or non-empty `rerun_hooks` must be routed before downstream consumption. A downstream stage may consume a module only when the latest module progress record marks its required upstream stages fresh and usable.
89
-
90
- ### Workspace State Refresh Points
91
-
92
- The Leader refreshes `migration-workspace-state` after each major stage, and before any downstream role consumes newly produced artifacts:
93
-
94
- | Refresh point | Required progress evidence |
95
- |---|---|
96
- | After module inventory | module list, module briefs, planned stage schedule |
97
- | After planning | planned work units, source-to-target map, expected artifacts |
98
- | After dependency/platform gate | dependency/platform readiness and blockers |
99
- | After prep fan-out | presentation/state-data prep outputs and changed-file ownership |
100
- | After every review/fix/re-review | latest review status, fix ownership, unresolved findings |
101
- | After UI implementation | UI coding artifacts, plan coverage, review hook if needed |
102
- | After logic implementation | logic coding artifacts, plan coverage, review hook if needed |
103
- | After verification | check status, failed check routing, verification-required gaps |
104
- | After readiness/module representation | module status and representation artifacts |
105
- | After global representation/report | aggregate finish rate, stale module list, validation handoff readiness |
106
-
107
- ### Step 4 — Module Analysis And Planning
108
-
109
- - **Executor**: `migration-analysis-planning`
110
- - **Input**: module brief, SPEC paths, analyst artifacts, target path, workspace state
111
- - **Action**: verify SPEC/raw-source deltas, capture target KMP context/reuse inventory, produce source-to-target map and ordered implementation plan.
112
- - **Output**: `<module_root>/node-results/migration-analysis-planning/migration_analysis_planning.json`, `.md`. The artifacts must contain SPEC/raw-source deltas, target KMP evidence, reuse inventory, source-to-target map, resource project map, integration scaffold, ordered implementation tasks, blockers.
113
- - **Gate**: target KMP evidence and source-to-target map must exist before dependency/platform work.
114
- - **Workspace-state update**: record planned work units and initial `finish_rate` basis. If the plan is incomplete, `migration-workspace-state` emits a rerun hook to `migration-analysis-planning`.
115
-
116
- ### Step 5 — Dependency And Platform Gate
117
-
118
- - **Executor**: `dependency-platform-gate`
119
- - **Input**: planning output, target baseline, allowed files/source sets
120
- - **Action**: apply minimal-change dependency gate and define/implement safe platform boundaries when required.
121
- - **Output**: `<module_root>/node-results/dependency-platform-gate/dependency_platform_gate.json`, `.md`. The artifacts must contain capability map, dependency/build decisions, platform capability boundaries, expect/actual/source-set plan, changed files, implementation constraints, blockers.
122
- - **Gate**: returns `ready_for_implementation` or `blocked`; no prep/implementation proceeds on blocked platform/dependency capability.
123
- - **Workspace-state update**: record dependency/platform stage status and pause downstream consumers when blocked.
124
-
125
- ### Step 6 — Prep Fan-Out
126
-
127
- - **Executors**: `presentation-integration`, `state-data-prep`
128
- - **Action**:
129
- - `presentation-integration`: theme tokens, resource migration/modeling, navigation routes.
130
- - `state-data-prep`: state holders, models, mappers, API/data expectations, logic handoff.
131
- - **Output**:
132
- - `<module_root>/node-results/presentation-integration/presentation_integration.json`, `.md`: token/component/resource/media/route mappings, UI handoff, changed files, presentation gaps.
133
- - `<module_root>/node-results/state-data-prep/state_data_prep.json`, `.md`: state holders, UI state/events/effects, model/mappers, API/data contract expectations, logic handoff, changed files.
134
- - **Gate**: every file-changing prep slice enters review/fix before UI or logic consumes it.
135
- - **Workspace-state update**: record changed-file ownership and plan-vs-code gaps for prep outputs; emit review rerun hooks when file-changing slices lack review approval.
136
-
137
- ### Step 7 — Review/Fix Loop
138
-
139
- - **Executor**: `module-node-review-fix`
140
- - **Modes**:
141
- - `review`: read-only review of one module/node slice.
142
- - `fix`: scoped edit of explicit `must_fix` findings inside `allowed_files`.
143
- - **Gate**: every fix must be followed by a fresh review. Downstream nodes may consume only slices whose latest review is `approved`.
144
- - **Output**:
145
- - Review mode: `<module_root>/node-results/module-node-review-fix/<owning_node>/review/module_node_review.json`, `.md` with read-only findings, reviewed files, approval/needs-fix status, blockers.
146
- - Fix mode: `<module_root>/node-results/module-node-review-fix/<owning_node>/fix/module_node_fix.json`, `.md` with fixed/unfixed findings, changed files, `requires_re_review: true`, blockers.
147
- - **Workspace-state update**: record review status by owner node and planned work unit. `needs_fix` and missing re-review produce rerun hooks.
148
-
149
- ### Step 8 — UI Implementation
150
-
151
- - **Executor**: `ui-implementation`
152
- - **Action**: implement visible UI surface first, including states/resources and binding surfaces.
153
- - **Output**: `<module_root>/node-results/ui-implementation/ui_implementation.json`, `.md` with changed UI/resource files, UI coverage, fidelity notes, binding surfaces, diagnostics, blockers.
154
- - **Gate**: UI output is reviewed/approved before logic implementation.
155
- - **Workspace-state update**: record UI implementation progress, changed files, missing planned UI work, unplanned UI changes, and required review hooks.
156
-
157
- ### Step 9 — Logic Implementation
158
-
159
- - **Executor**: `logic-implementation`
160
- - **Action**: implement repositories/use cases/API integration/business logic bound to approved UI surfaces.
161
- - **Output**: `<module_root>/node-results/logic-implementation/logic_implementation.json`, `.md` with changed logic/data/API files, architecture alignment, platform boundaries, data flows, API integrations, logic coverage, diagnostics, blockers.
162
- - **Gate**: logic output is reviewed/approved before verification.
163
- - **Workspace-state update**: record logic implementation progress, changed files, missing planned logic work, unplanned logic changes, and required review hooks.
164
-
165
- ### Step 10 — Verification
166
-
167
- - **Executor**: `migration-verification`
168
- - **Required `check_ids`**:
169
- - `source_set`
170
- - `api_contract`
171
- - `ui_render`
172
- - `incremental_build`
173
- - **Output**: `<module_root>/node-results/migration-verification/migration_verification.json`, `.md`, plus log files when commands run. The artifacts must contain stable `check_results`, evidence, failures, routed owner nodes, command/log paths, blockers.
174
- - **Gate**: failures route to the responsible reduced role and re-enter review/fix.
175
- - **Workspace-state update**: record verification status, failed check ids, `route_to_node`, and rerun hooks that pause readiness until resolved.
176
-
177
- ### Step 11 — Readiness And Module Representation
178
-
179
- - **Executor**: `completion-report` in `mode: readiness`, then Leader
180
- - **Action**: decide module readiness; write module representation.
181
- - **Output**:
182
- - `<module_root>/node-results/completion-report/readiness/completion_readiness.json`, `.md`: requirement coverage, invariants, review/verification status, rerun requests, blockers.
183
- - `<module_representation_dir>/module_migration_representation.json`: machine synthesis of verified module migration outputs, changed files by role, coverage, gaps, evidence.
184
- - `<module_representation_dir>/module_migration_representation.md`: agent-readable module migration handoff and traceability.
185
- - **Gate**: blocked modules still write a representation with blockers.
186
- - **Workspace-state update**: record module representation artifacts, final module finish rate, and remaining blockers without issuing the final report verdict.
187
-
188
- ### Step 12 — Global Representation
60
+ ## Step 4 — Target project assistant (global)
189
61
 
190
- - **Executor**: Leader
191
- - **Input**: all module representations
192
- - **Output**:
193
- - `<global_dir>/global_migration_representation.json`: machine synthesis of module representations, cross-module target changes, shared ownership, coverage, blockers.
194
- - `<global_dir>/global_migration_representation.md`: agent-readable global migration handoff and validation prerequisites.
195
- - **Gate**: final report cannot run until global representation exists and is non-empty.
196
- - **Workspace-state update**: record aggregate finish rate, represented modules, blocked/stale modules, and report blockers.
197
-
198
- ### Step 13 Final Report And Validation Handoff
199
-
200
- - **Executor**: `completion-report` in `mode: report`, then Leader
201
- - **Output**:
202
- - `<report_dir>/migration_report.json`: validation-ready machine handoff with scope, paths, module/global representations, changed files by role, coverage, validation inputs, limitations, blockers.
203
- - `<report_dir>/migration_report.md`: agent-readable migration report for validator and follow-up agents.
204
- - **Gate**: report mode may return `ready_for_validation` only after module/global representations exist and readiness has passed. Leader invokes `kmp-test-validator` afterward.
205
- - **Workspace-state update**: final refresh records report artifacts and validation handoff readiness.
206
-
207
- ## Final Report Shape
208
-
209
- ```json
210
- {
211
- "status": "ready_for_validation | blocked",
212
- "migration_scope": "",
213
- "kmp_target_project_path": "",
214
- "legacy_android_project_path": "",
215
- "output_root": "",
216
- "migration_module_inventory": "",
217
- "module_representations": [],
218
- "global_migration_representation": "",
219
- "changed_files_by_role": [],
220
- "source_to_target_summary": [],
221
- "coverage_summary": {
222
- "presentation": "",
223
- "state_data": "",
224
- "ui": "",
225
- "logic": "",
226
- "platform": "",
227
- "verification": ""
228
- },
229
- "validation_inputs": [],
230
- "limitations": [],
231
- "manual_steps": [],
232
- "blocking_gaps": []
233
- }
234
- ```
62
+ - `mode: global_baseline` → `target_alignment_revision.*`
63
+
64
+ ## Step 5 — Per-module pipeline
65
+
66
+ | Step | Role | Notes |
67
+ |---|---|---|
68
+ | 5a | TPA `module_anchors` | Package **M2** per module |
69
+ | 5b | `migration-planning-gate` | Planning + dep/platform in one pass |
70
+ | 5c | `migration-prep` | Presentation + state/data in one pass |
71
+ | 5d | `module-node-review-fix` | After prep if file-changing |
72
+ | 5e | `module-implementation` `ui` | Then review/fix |
73
+ | 5f | `module-implementation` `logic` | After UI approved; then review/fix |
74
+ | 5g | `migration-verification` | Static + restoration; **no full build** |
75
+ | 5h | Leader | `module_completion_record.json` |
76
+ | 5i | `completion-report` `readiness` + module representation | Package **M3** |
77
+
78
+ Repeat until package **M4**.
79
+
80
+ ## Step 6 — Global migration phase
81
+
82
+ ### 6a Integrate
83
+
84
+ - **Role**: `global-migration-phase` `mode: integrate`
85
+ - **Output**: `global-migration-phase/integrate/global_system_integration.*`
86
+ - **Gate**: package **M5**
87
+
88
+ ### 6b Align
89
+
90
+ - **Role**: `global-migration-phase` `mode: align`
91
+ - **Output**: `global-migration-phase/align/post_integration_alignment.*`, `report/alignment_report.*`
92
+ - **Gate**: package **M6**; `needs_rerun` → module loop or re-integrate
93
+
94
+ ## Step 7 — Report + validator
95
+
96
+ - Global representation + `completion-report` `report` → package **V0** → `kmp-test-validator`
97
+
98
+ ## TPA consult
99
+
100
+ Any target question → TPA `mode: consult` (append `consultation_log`).
235
101
 
236
102
  ## Acceptance Criteria
237
103
 
238
- - Active dispatch uses only the 10 reduced role IDs from `SKILL.md`.
239
- - Every module has a `module_brief.json`, verified node outputs under `<module_root>/node-results/`, and a module migration representation.
240
- - Latest `migration-workspace-state` includes `module_progress`, `finish_rate`, `plan_code_gaps`, and `rerun_hooks` for every scheduled module.
241
- - No downstream stage consumes a module when its latest workspace-state record has stale required inputs, unresolved blocking plan-vs-code gaps, missing review approval, missing verification, or blocking rerun hooks.
242
- - Review/fix invocations are separate: `review` -> optional `fix` -> fresh `review`.
243
- - Verification uses stable `check_ids` and routes failures to reduced role IDs.
244
- - No Android-only API leaks into `commonMain`; dependency changes pass the minimal-change gate.
245
- - `global_migration_representation.*` exists before report mode.
246
- - `kmp-test-validator` is invoked only after `completion-report` report mode returns `ready_for_validation`.
104
+ - Dispatch only role IDs from `SKILL.md`.
105
+ - Mode rules: `ui` before `logic`; `integrate` before `align`; `review`/`fix` separate.
106
+ - `migration-verification` never runs `incremental_build`.
107
+ - `handoff_gates` match output-contract.
@@ -1,139 +1,108 @@
1
1
  ---
2
2
  name: kmp-test-validator
3
3
  description: |
4
- 6-role reduced pipeline Swarm Skill that validates Android-to-KMP migration output: workspace ledger, intake/fidelity trust gate, command/build-preview gate, Android-anchored test runner, scoped remediation, and final validation report.
5
- Use with the kmp-test-validator controller after android-to-kmp-migrator has produced a validation-ready migration report, or when given Android source/SPEC plus a KMP target for migrated behavior validation.
4
+ Swarm Skill pipeline that validates Android-to-KMP migration output: workspace ledger, fidelity gate (trust + restoreability modes), code gate (build + fix modes), optional business testing (behavioral + Figma UI submodules), and final validation report.
5
+ Use with the kmp-test-validator controller after android-to-kmp-migrator has produced validation-ready package V0, or when given Android source/SPEC plus a KMP target for migrated behavior validation.
6
6
  Do NOT use for generic KMP testing, KMP-only feature work, isolated Gradle troubleshooting, Android analysis, or non-migration refactors.
7
- version: "0.3"
7
+ version: "0.5"
8
8
  kind: swarm-skill
9
9
  disable-model-invocation: true
10
10
  roles:
11
11
  - id: validation-workspace-state
12
12
  kind: ai_agent
13
- purpose: Validation ledger — node status, changed-file ownership, stale inputs, rerun/blocker history, next actions. No audit, build, test, fix, or verdict.
13
+ purpose: Validation ledger — node status, handoff gates VG0–VG5, supplement/remediation cycle counts, stale inputs, blockers. No audit, build, fix, or verdict.
14
14
  skills: []
15
15
  tools: [git]
16
- - id: validation-intake-fidelity
16
+ - id: validation-fidelity-gate
17
17
  kind: ai_agent
18
- purpose: Intake and fidelity trust gate — verify migration scenario, normalize brief, compare Android source/SPEC vs KMP, and flag test-trust blockers.
18
+ purpose: Fidelity gate — mode trust (pre-build Android/SPEC vs KMP) or restoreability (post-build module/function audit, migrator supplement routing). Read-only.
19
19
  skills: []
20
20
  tools: [rg, git]
21
- - id: validation-plan-gate
21
+ - id: validation-code-gate
22
22
  kind: ai_agent
23
- purpose: Command and build gate — resolve trusted build/preview/test commands, run build and preview/renderability before behavioral tests, route failures.
23
+ purpose: Code gate — mode build (3-scenario compile/preview) or fix (error DB or model, restoreability-preserving edits). Only fix mode edits production code.
24
24
  skills: []
25
25
  tools: [rg, git]
26
- - id: validation-test-runner
26
+ - id: validation-business-testing
27
27
  kind: ai_agent
28
- purpose: Test workflowdecompose validation requirements into atomic Android-anchored cases, execute them through project conventions, capture evidence.
29
- skills: []
30
- tools: [rg, git]
31
- - id: validation-remediation
32
- kind: ai_agent
33
- purpose: Scoped target fixes — fix confirmed target KMP failures inside allowed files and emit required reruns.
28
+ purpose: Optional business testing behavioral submodule (user test cases) and ui_comparison submodule (Figma) after VG3.
34
29
  skills: []
35
30
  tools: [rg, git]
36
31
  - id: validation-report
37
32
  kind: ai_agent
38
- purpose: Final verdict synthesis — passed/failed/blocked from verified fidelity, build, preview, test, and remediation evidence. No new tests or fixes.
33
+ purpose: Final verdict synthesis — passed/failed/blocked from verified fidelity, code-gate, business-testing, and fix evidence.
39
34
  skills: []
40
35
  tools: [git]
41
36
  ---
42
37
 
43
38
  # KMP Test Validator Swarm Skill
44
39
 
45
- This is the agent-facing registry and team definition for the `kmp-test-validator` controller. It validates Android-to-KMP migration output against Android source and migration SPEC evidence.
40
+ This is the agent-facing registry and team definition for the `kmp-test-validator` controller. It validates Android-to-KMP migration output against Android source, analyst SPEC, and migrator artifacts.
41
+
42
+ The team is a **serial pipeline with two controller loops**: code-gate fix remediation and migrator supplement.
46
43
 
47
- The team is a **reduced serial pipeline with a remediation loop**. Role overlap has been collapsed from 9 role files to 6 role definitions. See [ROLE_REDUCTION.md](ROLE_REDUCTION.md) for the old-to-new map and merge rationale.
44
+ **Canonical file recording system**: [output-contract.md](output-contract.md) defines paths, migrator `V0` inputs, handoff gates `VG0`–`VG5`, and mode contracts. The Leader MUST read `output-contract.md` before the first dispatch.
48
45
 
49
46
  ## Protocol Summary
50
47
 
51
- 0. **Pre-flight** — check optional dependencies from [dependencies.yaml](dependencies.yaml).
52
- 1. **Output root + workspace state** — lock validation output root parallel to migration, then initialize `validation-workspace-state`.
53
- 2. **Intake/fidelity trust gate** — run `validation-intake-fidelity`; block non-migration validation and test-trust blockers.
54
- 3. **Plan/build gate**run `validation-plan-gate`; commands must be trusted, and build/preview must pass before behavioral tests.
55
- 4. **Test workflow**run `validation-test-runner` when validation cases exist.
56
- 5. **Remediation loop** — run `validation-remediation` only for confirmed target KMP failures, then rerun affected gates/tests.
57
- 6. **Final report** — run `validation-report` to issue `passed | failed | blocked`.
48
+ 0. **Pre-flight** — [dependencies.yaml](dependencies.yaml); verify migrator `V0`; lock output root.
49
+ 1. **Workspace state** — ledger + `handoff_gates`.
50
+ 2. **Fidelity gate `trust`** migration trigger + pre-build fidelity (`VG1`).
51
+ 3. **Code gate `build`** three-scenario compile + build/preview (`VG2`); on failure code gate `fix` rerun `build` (max 3 cycles).
52
+ 4. **Fidelity gate `restoreability`** post-build restoreability (`VG3`); migrator supplement loop (max 3) when required.
53
+ 5. **Business testing** — optional behavioral / Figma submodules when user inputs exist (`VG4`).
54
+ 6. **Final report** — `validation-report` (`VG5`).
58
55
 
59
56
  ## Roles
60
57
 
61
- | id | Purpose | Role file |
58
+ | id | Modes | Role file |
62
59
  |---|---|---|
63
- | `validation-workspace-state` | Ledger and stale-input tracking | [roles/validation-workspace-state.md](roles/validation-workspace-state.md) |
64
- | `validation-intake-fidelity` | Migration scenario gate and fidelity audit | [roles/validation-intake-fidelity.md](roles/validation-intake-fidelity.md) |
65
- | `validation-plan-gate` | Command resolution plus build/preview gate | [roles/validation-plan-gate.md](roles/validation-plan-gate.md) |
66
- | `validation-test-runner` | Test decomposition and execution | [roles/validation-test-runner.md](roles/validation-test-runner.md) |
67
- | `validation-remediation` | Scoped target fixes and rerun requests | [roles/validation-remediation.md](roles/validation-remediation.md) |
68
- | `validation-report` | Final verdict synthesis | [roles/validation-report.md](roles/validation-report.md) |
60
+ | `validation-workspace-state` | | [roles/validation-workspace-state.md](roles/validation-workspace-state.md) |
61
+ | `validation-fidelity-gate` | `trust \| restoreability` | [roles/validation-fidelity-gate.md](roles/validation-fidelity-gate.md) |
62
+ | `validation-code-gate` | `build \| fix` | [roles/validation-code-gate.md](roles/validation-code-gate.md) |
63
+ | `validation-business-testing` | `behavioral \| ui_comparison` submodules | [roles/validation-business-testing.md](roles/validation-business-testing.md) |
64
+ | `validation-report` | | [roles/validation-report.md](roles/validation-report.md) |
69
65
 
70
66
  ## Files
71
67
 
72
68
  | File | What it contains |
73
69
  |---|---|
74
- | [ROLE_REDUCTION.md](ROLE_REDUCTION.md) | Reduced role analysis and old-to-new map |
75
- | [workflow.md](workflow.md) | Reduced pipeline, gates, remediation loop, final report format |
76
- | [bind.md](bind.md) | Guardrails, failure handling, resource constraints |
77
- | [roles/](roles/) | Active reduced role specs |
78
- | [dependencies.yaml](dependencies.yaml) | Optional CLI tools checked at startup |
70
+ | [output-contract.md](output-contract.md) | Canonical paths, V0 upstream, VG0–VG5 gates |
71
+ | [workflow.md](workflow.md) | Pipeline, gates, controller loops |
72
+ | [bind.md](bind.md) | Guardrails and resource limits |
73
+ | [dependencies.yaml](dependencies.yaml) | Upstream V0, optional inputs, MCP, tools |
74
+ | [roles/](roles/) | Role specs |
79
75
 
80
76
  ## Strict Output Schedule
81
77
 
82
- Validation artifacts must be written parallel to migration artifacts, under a `validation` base location. If the migration run uses a default base like `~/.a2c_agents/migration`, the validator uses the sibling base `~/.a2c_agents/validation`. If a `migration_output_root` is provided, derive the validation base by replacing the `migration` path segment with `validation` when possible; otherwise use `<output_dir or ~/.a2c_agents/validation>`.
83
-
84
78
  ```text
85
79
  output_root = <output_dir or ~/.a2c_agents/validation>/kmp-test-validator
86
- workspace_state_dir = <output_root>/workspace-state
87
- intake_dir = <output_root>/intake-fidelity
88
- plan_gate_dir = <output_root>/plan-gate
89
- test_runner_dir = <output_root>/test-runner
90
- remediation_dir = <output_root>/remediation
91
- report_dir = <output_root>/report
92
- logs_dir = <output_root>/logs
80
+ fidelity_gate_dir = <output_root>/fidelity-gate
81
+ code_gate_dir = <output_root>/code-gate
82
+ business_testing_dir = <output_root>/business-testing
93
83
  ```
94
84
 
95
- Required artifacts:
96
-
97
- - `<output_root>/run_manifest.json`
98
- - `<workspace_state_dir>/validation_workspace_state.json`
99
- - `<workspace_state_dir>/validation_workspace_state.md`
100
- - `<intake_dir>/validation_intake_fidelity.json`
101
- - `<intake_dir>/validation_intake_fidelity.md`
102
- - `<plan_gate_dir>/validation_plan_gate.json`
103
- - `<plan_gate_dir>/validation_plan_gate.md`
104
- - `<logs_dir>/plan-gate/*` when build/preview commands run
105
- - `<test_runner_dir>/validation_test_runner.json`
106
- - `<test_runner_dir>/validation_test_runner.md`
107
- - `<logs_dir>/test-runner/*` when tests run
108
- - `<remediation_dir>/<cycle_id>/validation_remediation.json` and `.md` when fixes run
109
- - `<report_dir>/kmp_validation_report.json`
110
- - `<report_dir>/kmp_validation_report.md`
111
-
112
- No validator artifact may be written inside the migration output root. Migration artifacts are read-only inputs referenced by path.
85
+ See [output-contract.md](output-contract.md) for full layout. No validator artifact inside migration output root.
113
86
 
114
87
  ## Output Artifact Content Matrix
115
88
 
116
- The controller verifies both artifact names and role-aligned content before downstream stages consume any file.
117
-
118
- | Stage / owner | Output file(s) | Required content |
89
+ | Owner | Artifacts | Required content |
119
90
  |---|---|---|
120
- | Output root lock / Leader | `run_manifest.json` | Validation scope, KMP target path, Android source/SPEC paths, migration report path, migration output root, validation output root, allowed roots, dependency-preflight status, timestamp. |
121
- | Workspace ledger / `validation-workspace-state` | `validation_workspace_state.json`, `validation_workspace_state.md` | Validator node status, output files, changed-file ownership, stale upstream inputs, rerun history, blockers, and next safe action. |
122
- | Intake/fidelity / `validation-intake-fidelity` | `validation_intake_fidelity.json`, `validation_intake_fidelity.md` | Migration trigger evidence, normalized validation brief, KMP evidence, Android/SPEC-vs-KMP fidelity gaps across UI/logic/data/control flow, test-trust blockers, rerun requests, blockers. |
123
- | Plan/build gate / `validation-plan-gate` | `validation_plan_gate.json`, `validation_plan_gate.md`, plan-gate logs | Target structure, source sets, test frameworks, trusted command resolution, command sources, build/preview/renderability gate results, log paths, routed failures, blockers. |
124
- | Test runner / `validation-test-runner` | `validation_test_runner.json`, `validation_test_runner.md`, test logs, optional changed test files | Android/SPEC-anchored test cases, expected vs actual results, commands, log paths, created/reused tests, failure routing, skipped/blocked reasons. |
125
- | Remediation / `validation-remediation` | `validation_remediation.json`, `validation_remediation.md`, changed target files | Confirmed target KMP failures, Android/SPEC evidence for fixes, fixed/unfixed failures, changed files, diagnostics, required reruns, blockers. |
126
- | Final verdict / `validation-report` | `kmp_validation_report.json`, `kmp_validation_report.md` | Final `passed | failed | blocked` verdict from verified evidence, fidelity summary, build/preview summary, test statistics, remediation summary, changed files, remaining failures, blockers, report path. |
127
-
128
- JSON artifacts are the machine-routable source of truth. Markdown artifacts are agent-readable handoffs that preserve exact paths, commands/logs, changed-file ownership, rerun context, blockers, and downstream routing. Node Markdown must not be a prose-only completion summary.
91
+ | Leader | `run_manifest.json`, `upstream_migration_index.json` | V0 verification, dependency preflight |
92
+ | `validation-workspace-state` | `validation_workspace_state.*` | `handoff_gates` VG0–VG5, cycle counts |
93
+ | `validation-fidelity-gate` | `trust/validation_fidelity_trust.*`, `restoreability/validation_restoreability_audit.*` | Pre-build trust or post-build restoreability per mode |
94
+ | `validation-code-gate` | `build/validation_code_build.*`, `fix/<cycle>/validation_code_fix.*`, code-gate logs | Compile scenario + build/preview or fix knowledge + reruns |
95
+ | `validation-business-testing` | `validation_business_testing.*`, logs | Submodule outcomes or explicit skip |
96
+ | `validation-report` | `kmp_validation_report.*` | Evidence-backed final verdict |
129
97
 
130
98
  ## Shared Return Contract
131
99
 
132
100
  ```json
133
101
  {
134
- "status": "completed | passed | failed | needs_rerun | blocked",
102
+ "status": "completed | passed | failed | needs_rerun | needs_migrator_supplement | blocked",
135
103
  "node": "node-name",
136
- "output_dir": "<exact validator node output dir under output_root>",
104
+ "mode": "trust | restoreability | build | fix",
105
+ "output_dir": "<node output dir>",
137
106
  "output_files": [],
138
107
  "changed_files": [],
139
108
  "stale_upstream_inputs": [],
@@ -142,12 +111,10 @@ JSON artifacts are the machine-routable source of truth. Markdown artifacts are
142
111
  }
143
112
  ```
144
113
 
145
- Use `needs_rerun` when a previous role can resolve the gap, `failed` when validation evidence is complete and a behavior/build/test failure remains, and `blocked` when required evidence, command, environment, or user input is missing.
146
-
147
114
  ## Shared Rules
148
115
 
149
- - Each role must read its role file before work and stay inside its responsibility boundary.
150
- - Build/test/preview commands must come from user input, project scripts/docs/CI, or verified Gradle task discovery.
151
- - A passing KMP test that contradicts Android source/SPEC behavior is a validation failure.
152
- - Only `validation-remediation` edits target code.
153
- - The controller must not substitute itself for a role's audit, command gate, test run, fix, or final verdict.
116
+ - Dispatch only role IDs listed in this registry.
117
+ - Only `validation-code-gate` mode `fix` edits target production code.
118
+ - Fidelity-gate modes are read-only; restoreability routes gaps to migrator supplement.
119
+ - Code-gate `build` uses three compile scenarios only; `fix` uses error DB when configured.
120
+ - Business-testing submodules require user inputs; skipped is not pass-by-omission.