@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.
Files changed (60) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/SKILL.md +71 -28
  3. package/skills/android-project-analyst/bind.md +12 -6
  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 +30 -8
  7. package/skills/android-project-analyst/roles/behavior-logic.md +12 -5
  8. package/skills/android-project-analyst/roles/data-contract-flow.md +11 -4
  9. package/skills/android-project-analyst/roles/presentation-resource.md +13 -4
  10. package/skills/android-project-analyst/roles/project-architecture.md +11 -4
  11. package/skills/android-project-analyst/workflow.md +88 -39
  12. package/skills/android-to-kmp-migrator/SKILL.md +62 -111
  13. package/skills/android-to-kmp-migrator/bind.md +29 -61
  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 +11 -2
  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 +47 -23
  21. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +207 -20
  22. package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
  23. package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +9 -2
  24. package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
  25. package/skills/android-to-kmp-migrator/workflow.md +71 -170
  26. package/skills/kmp-test-validator/SKILL.md +63 -45
  27. package/skills/kmp-test-validator/bind.md +30 -36
  28. package/skills/kmp-test-validator/dependencies.yaml +101 -9
  29. package/skills/kmp-test-validator/output-contract.md +166 -0
  30. package/skills/kmp-test-validator/roles/validation-business-testing.md +83 -0
  31. package/skills/kmp-test-validator/roles/validation-code-gate.md +116 -0
  32. package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +118 -0
  33. package/skills/kmp-test-validator/roles/validation-report.md +30 -16
  34. package/skills/kmp-test-validator/roles/validation-workspace-state.md +12 -4
  35. package/skills/kmp-test-validator/workflow.md +62 -97
  36. package/skills/migration-task-adapter/SKILL.md +67 -76
  37. package/skills/migration-task-adapter/bind.md +25 -89
  38. package/skills/migration-task-adapter/dependencies.yaml +21 -10
  39. package/skills/migration-task-adapter/roles/adapter-report.md +71 -0
  40. package/skills/migration-task-adapter/roles/adapter-workspace-state.md +71 -0
  41. package/skills/migration-task-adapter/roles/task-route-orchestrator.md +103 -0
  42. package/skills/migration-task-adapter/workflow.md +71 -143
  43. package/skills/android-project-analyst/MIGRATION.md +0 -53
  44. package/skills/android-to-kmp-migrator/MIGRATION.md +0 -104
  45. package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -63
  46. package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -66
  47. package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -65
  48. package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -65
  49. package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -63
  50. package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -64
  51. package/skills/kmp-test-validator/MIGRATION.md +0 -58
  52. package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -67
  53. package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -66
  54. package/skills/kmp-test-validator/roles/validation-remediation.md +0 -112
  55. package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -61
  56. package/skills/migration-task-adapter/MIGRATION.md +0 -34
  57. package/skills/migration-task-adapter/roles/task-reporter.md +0 -129
  58. package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -134
  59. package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -140
  60. package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -189
@@ -0,0 +1,104 @@
1
+ # Role: Target Project Assistant
2
+
3
+ ## Identity
4
+
5
+ > *"I am the single owner of target KMP understanding — I locate anchor paths, revise alignment from upstream analyst evidence, and answer every target-project question during migration."*
6
+
7
+ You are the `target-project-assistant` node subagent. You understand the existing KMP target project, map legacy module scopes to target paths and anchor points using `android-project-analyst` artifacts, and produce revised alignment documents. Other migration roles MUST consume your outputs instead of re-analyzing the target independently.
8
+
9
+ ## Modes
10
+
11
+ | Mode | When | Output location |
12
+ |---|---|---|
13
+ | `global_baseline` | Once after migration index + upstream analyst index exist | `<global_dir>/node-results/target-project-assistant/` |
14
+ | `module_anchors` | Per `migration_module_id` before planning | `<module_root>/node-results/target-project-assistant/` |
15
+ | `consult` | Any time target context changes or a node asks a target question | Append to global `consultation_log` in `target_alignment_revision.json` |
16
+
17
+ ## Success Criteria
18
+
19
+ - Required JSON+MD artifacts written under assigned `output_dir`, both non-empty.
20
+ - `target_alignment_revision.json` exists after `global_baseline` with anchor points and revised alignment rows.
21
+ - Per-module `target_module_anchors.json` maps legacy evidence to resolvable target paths.
22
+ - `consult` responses reference prior alignment revision version and list affected anchor ids.
23
+ - No target code edits (read-only analysis).
24
+
25
+ ## Boundary
26
+
27
+ **Forbidden**:
28
+ - Do NOT implement migration code, edit target files, or add dependencies.
29
+ - Do NOT replace `migration-planning-gate` task ordering — you supply target evidence and alignment only.
30
+ - Do NOT run full project compile/build.
31
+
32
+ **Mandatory**:
33
+ - Read [output-contract.md](../output-contract.md) path contract before acting.
34
+ - Validate `kmp_target_project_path`, upstream analyst paths, `migration_module_id` (when module-scoped), and `output_dir`.
35
+ - On missing/stale upstream analyst artifacts, return `blocked` with precise `blocking_gaps`.
36
+ - Include `migration_module_id` or `"global"` in JSON return payload.
37
+
38
+ ## Output Schema (`global_baseline`)
39
+
40
+ ```json
41
+ {
42
+ "status": "completed | blocked",
43
+ "node": "target-project-assistant",
44
+ "mode": "global_baseline | module_anchors | consult",
45
+ "migration_module_id": "global | <id>",
46
+ "output_root": "",
47
+ "output_dir": "",
48
+ "target_project_layout": {},
49
+ "reusable_components": [],
50
+ "anchor_points": [
51
+ {
52
+ "anchor_id": "",
53
+ "legacy_module_id": "",
54
+ "legacy_scope": "",
55
+ "target_path": "",
56
+ "target_symbol": "",
57
+ "reuse_or_create": "reuse | extend | create",
58
+ "evidence_paths": []
59
+ }
60
+ ],
61
+ "revised_alignment": [],
62
+ "integration_constraints": [],
63
+ "consultation_log": [],
64
+ "blocking_gaps": []
65
+ }
66
+ ```
67
+
68
+ ## Output Files And Contents
69
+
70
+ **Global (`mode: global_baseline`)** under `<global_dir>/node-results/target-project-assistant/`:
71
+ - `target_project_assistant.json` — machine target understanding: layout, modules, navigation entry, theme/resource roots, DI graph hints, platform source sets.
72
+ - `target_project_assistant.md` — agent-readable target survey with exact paths.
73
+ - `target_alignment_revision.json` — revised alignment vs upstream analyst SPEC/module globals; anchor registry; consultation log.
74
+ - `target_alignment_revision.md` — alignment tables mapping legacy `module_id` → target placement.
75
+
76
+ **Per-module (`mode: module_anchors`)** under `<module_root>/node-results/target-project-assistant/`:
77
+ - `target_module_anchors.json` — module-scoped anchors, reuse decisions, target paths for UI/state/data/logic placement.
78
+ - `target_module_anchors.md` — agent-readable anchor handoff for planning and implementation nodes.
79
+
80
+ **Consult (`mode: consult`)** — append entry to global `target_alignment_revision.json` → `consultation_log[]`; optionally refresh `target_module_anchors.json` when anchors change.
81
+
82
+ ## Inline Persona for Teammate
83
+
84
+ ```text
85
+ ROLE: target-project-assistant node in android-to-kmp-migrator.
86
+
87
+ You own target KMP understanding and alignment revision. Modes:
88
+ - global_baseline: survey target + map analyst upstream to anchor_points; write target_alignment_revision.*
89
+ - module_anchors: per migration_module_id target paths and anchors for planning/implementation.
90
+ - consult: answer target questions; append consultation_log; refresh anchors when needed.
91
+
92
+ You do NOT edit target code or run full builds. Other roles MUST use your artifacts.
93
+
94
+ INPUTS: kmp_target_project_path, analyst_output_root, upstream_analyst_index_path, modules_index_path,
95
+ migration_assembly_basis_path, cross_module_architecture_path, cross_module_data_logic_path,
96
+ legacy module_representation paths, migration_module_id, mode, output_dir.
97
+
98
+ OUTPUTS (exact names per output-contract.md):
99
+ Global baseline: target_project_assistant.json/.md, target_alignment_revision.json/.md
100
+ Module anchors: target_module_anchors.json/.md
101
+
102
+ Return JSON with status, node, mode, migration_module_id, output_dir, output_files, changed_files: [],
103
+ stale_upstream_inputs, rerun_requests, blocking_gaps.
104
+ ```
@@ -1,206 +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, and exact output paths.
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]
9
+ L0[Pre-flight deps] --> UP[Verify analyst P6]
10
+ UP --> INV[migration inventory]
11
11
  INV --> WS[migration-workspace-state]
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]
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]
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
-
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
- ```
51
-
52
- ## Detailed Steps
53
-
54
- ### Step 0 — Pre-flight
55
-
56
- - **Executor**: Leader
57
- - **Input**: [dependencies.yaml](dependencies.yaml)
58
- - **Action**: check optional tools (`rg`, `git`, `curl`) and report degraded behavior.
59
- - **Gate**: missing optional tools do not skip nodes; the controller records degraded evidence.
60
-
61
- ### Step 1 — Trigger + Output Root
62
-
63
- - **Executor**: Leader
64
- - **Input**: `legacy_android_project_path` or completed SPEC, `kmp_target_project_path`, `migration_scope`, optional `output_dir`
65
- - **Action**: verify migration trigger, verify analyst completion, lock `output_root`, write `<output_root>/run_manifest.json`.
66
- - **Gate**: stop if target is not KMP-compatible or analyst completion is missing/stale.
67
-
68
- ### Step 2 — Migration Module Inventory
41
+ ## Step 0 — Pre-flight
69
42
 
70
43
  - **Executor**: Leader
71
- - **Action**: divide the requested migration into deterministic `migration_module_id` slices.
72
- - **Output**:
73
- - `<module_index_dir>/migration_module_inventory.json`
74
- - `<module_index_dir>/migration_module_inventory.md`
75
- - `<module_root>/module_brief.json` for every scheduled module
76
- - **Gate**: every module has `module_scope`, UI/logic/data/resource scope, target placement hints, `allowed_target_files`, and `allowed_source_sets`.
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
77
47
 
78
- ### Step 3Workspace State
48
+ ## Step 1Upstream + output root
79
49
 
80
- - **Executor**: `migration-workspace-state`
81
- - **Output**: `<global_dir>/node-results/migration-workspace-state/migration_workspace_state.*`
82
- - **Gate**: stale upstream outputs must be rerun before downstream consumption.
50
+ - Verify analyst package **P6**; write `upstream_analyst_index.json`.
83
51
 
84
- ### Step 4Module Analysis And Planning
52
+ ## Step 2Migration inventory
85
53
 
86
- - **Executor**: `migration-analysis-planning`
87
- - **Input**: module brief, SPEC paths, analyst artifacts, target path, workspace state
88
- - **Action**: verify SPEC/raw-source deltas, capture target KMP context/reuse inventory, produce source-to-target map and ordered implementation plan.
89
- - **Output**: `<module_root>/node-results/migration-analysis-planning/migration_analysis_planning.*`
90
- - **Gate**: target KMP evidence and source-to-target map must exist before dependency/platform work.
54
+ - `migration_module_inventory.*`, `modules_migration_index.json`, per-module `module_brief.json`.
91
55
 
92
- ### Step 5Dependency And Platform Gate
56
+ ## Step 3Workspace state
93
57
 
94
- - **Executor**: `dependency-platform-gate`
95
- - **Input**: planning output, target baseline, allowed files/source sets
96
- - **Action**: apply minimal-change dependency gate and define/implement safe platform boundaries when required.
97
- - **Output**: `<module_root>/node-results/dependency-platform-gate/dependency_platform_gate.*`
98
- - **Gate**: returns `ready_for_implementation` or `blocked`; no prep/implementation proceeds on blocked platform/dependency capability.
58
+ - Init ledger; track handoff gates **M0**–**V0**.
99
59
 
100
- ### Step 6Prep Fan-Out
60
+ ## Step 4Target project assistant (global)
101
61
 
102
- - **Executors**: `presentation-integration`, `state-data-prep`
103
- - **Action**:
104
- - `presentation-integration`: theme tokens, resource migration/modeling, navigation routes.
105
- - `state-data-prep`: state holders, models, mappers, API/data expectations, logic handoff.
106
- - **Output**:
107
- - `<module_root>/node-results/presentation-integration/presentation_integration.*`
108
- - `<module_root>/node-results/state-data-prep/state_data_prep.*`
109
- - **Gate**: every file-changing prep slice enters review/fix before UI or logic consumes it.
62
+ - `mode: global_baseline` `target_alignment_revision.*`
110
63
 
111
- ### Step 7Review/Fix Loop
64
+ ## Step 5Per-module pipeline
112
65
 
113
- - **Executor**: `module-node-review-fix`
114
- - **Modes**:
115
- - `review`: read-only review of one module/node slice.
116
- - `fix`: scoped edit of explicit `must_fix` findings inside `allowed_files`.
117
- - **Gate**: every fix must be followed by a fresh review. Downstream nodes may consume only slices whose latest review is `approved`.
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** |
118
77
 
119
- ### Step 8 — UI Implementation
78
+ Repeat until package **M4**.
120
79
 
121
- - **Executor**: `ui-implementation`
122
- - **Action**: implement visible UI surface first, including states/resources and binding surfaces.
123
- - **Gate**: UI output is reviewed/approved before logic implementation.
80
+ ## Step 6 — Global migration phase
124
81
 
125
- ### Step 9 — Logic Implementation
82
+ ### 6a Integrate
126
83
 
127
- - **Executor**: `logic-implementation`
128
- - **Action**: implement repositories/use cases/API integration/business logic bound to approved UI surfaces.
129
- - **Gate**: logic output is reviewed/approved before verification.
84
+ - **Role**: `global-migration-phase` `mode: integrate`
85
+ - **Output**: `global-migration-phase/integrate/global_system_integration.*`
86
+ - **Gate**: package **M5**
130
87
 
131
- ### Step 10 — Verification
88
+ ### 6b Align
132
89
 
133
- - **Executor**: `migration-verification`
134
- - **Required `check_ids`**:
135
- - `source_set`
136
- - `api_contract`
137
- - `ui_render`
138
- - `incremental_build`
139
- - **Output**: `<module_root>/node-results/migration-verification/migration_verification.*`
140
- - **Gate**: failures route to the responsible reduced role and re-enter review/fix.
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
141
93
 
142
- ### Step 11Readiness And Module Representation
94
+ ## Step 7Report + validator
143
95
 
144
- - **Executor**: `completion-report` in `mode: readiness`, then Leader
145
- - **Action**: decide module readiness; write module representation.
146
- - **Output**:
147
- - `<module_root>/node-results/completion-report/readiness/completion_readiness.*`
148
- - `<module_representation_dir>/module_migration_representation.json`
149
- - `<module_representation_dir>/module_migration_representation.md`
150
- - **Gate**: blocked modules still write a representation with blockers.
96
+ - Global representation + `completion-report` `report` package **V0** → `kmp-test-validator`
151
97
 
152
- ### Step 12 — Global Representation
98
+ ## TPA consult
153
99
 
154
- - **Executor**: Leader
155
- - **Input**: all module representations
156
- - **Output**:
157
- - `<global_dir>/global_migration_representation.json`
158
- - `<global_dir>/global_migration_representation.md`
159
- - **Gate**: final report cannot run until global representation exists and is non-empty.
160
-
161
- ### Step 13 — Final Report And Validation Handoff
162
-
163
- - **Executor**: `completion-report` in `mode: report`, then Leader
164
- - **Output**:
165
- - `<report_dir>/migration_report.json`
166
- - `<report_dir>/migration_report.md`
167
- - **Gate**: report mode may return `ready_for_validation` only after module/global representations exist and readiness has passed. Leader invokes `kmp-test-validator` afterward.
168
-
169
- ## Final Report Shape
170
-
171
- ```json
172
- {
173
- "status": "ready_for_validation | blocked",
174
- "migration_scope": "",
175
- "kmp_target_project_path": "",
176
- "legacy_android_project_path": "",
177
- "output_root": "",
178
- "migration_module_inventory": "",
179
- "module_representations": [],
180
- "global_migration_representation": "",
181
- "changed_files_by_role": [],
182
- "source_to_target_summary": [],
183
- "coverage_summary": {
184
- "presentation": "",
185
- "state_data": "",
186
- "ui": "",
187
- "logic": "",
188
- "platform": "",
189
- "verification": ""
190
- },
191
- "validation_inputs": [],
192
- "limitations": [],
193
- "manual_steps": [],
194
- "blocking_gaps": []
195
- }
196
- ```
100
+ Any target question → TPA `mode: consult` (append `consultation_log`).
197
101
 
198
102
  ## Acceptance Criteria
199
103
 
200
- - Active dispatch uses only the 10 reduced role IDs from `SKILL.md`.
201
- - Every module has a `module_brief.json`, verified node outputs under `<module_root>/node-results/`, and a module migration representation.
202
- - Review/fix invocations are separate: `review` -> optional `fix` -> fresh `review`.
203
- - Verification uses stable `check_ids` and routes failures to reduced role IDs.
204
- - No Android-only API leaks into `commonMain`; dependency changes pass the minimal-change gate.
205
- - `global_migration_representation.*` exists before report mode.
206
- - `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,88 +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.
46
41
 
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.
42
+ The team is a **serial pipeline with two controller loops**: code-gate fix remediation and migrator supplement.
43
+
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. **Workspace state** — 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 |
75
+
76
+ ## Strict Output Schedule
77
+
78
+ ```text
79
+ output_root = <output_dir or ~/.a2c_agents/validation>/kmp-test-validator
80
+ fidelity_gate_dir = <output_root>/fidelity-gate
81
+ code_gate_dir = <output_root>/code-gate
82
+ business_testing_dir = <output_root>/business-testing
83
+ ```
84
+
85
+ See [output-contract.md](output-contract.md) for full layout. No validator artifact inside migration output root.
86
+
87
+ ## Output Artifact Content Matrix
88
+
89
+ | Owner | Artifacts | Required content |
90
+ |---|---|---|
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 |
79
97
 
80
98
  ## Shared Return Contract
81
99
 
82
100
  ```json
83
101
  {
84
- "status": "completed | passed | failed | needs_rerun | blocked",
102
+ "status": "completed | passed | failed | needs_rerun | needs_migrator_supplement | blocked",
85
103
  "node": "node-name",
104
+ "mode": "trust | restoreability | build | fix",
105
+ "output_dir": "<node output dir>",
86
106
  "output_files": [],
87
107
  "changed_files": [],
88
108
  "stale_upstream_inputs": [],
@@ -91,12 +111,10 @@ The team is a **reduced serial pipeline with a remediation loop**. Role overlap
91
111
  }
92
112
  ```
93
113
 
94
- 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.
95
-
96
114
  ## Shared Rules
97
115
 
98
- - Each role must read its role file before work and stay inside its responsibility boundary.
99
- - Build/test/preview commands must come from user input, project scripts/docs/CI, or verified Gradle task discovery.
100
- - A passing KMP test that contradicts Android source/SPEC behavior is a validation failure.
101
- - Only `validation-remediation` edits target code.
102
- - 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.