@code-migration/wow-migrator 0.1.5 → 0.1.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-migration/wow-migrator",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "description": "Install KMP migration skills into Claude Code, Codex, Cursor, Gemini, OpenCode, OpenClaw, and JiuwenSwarm via npm install.",
5
5
  "keywords": [
6
6
  "android",
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: android-to-kmp-migrator
3
3
  description: |
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"
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 mandatory kmp-test-validator handoff — without full-project build during migration.
5
+ Use only after android-project-analyst has finished and package P6 is ready, when the user wants module-first porting then whole-system assembly followed by validation.
6
+ Do NOT invoke before android-project-analyst completes P6. Do NOT treat migrator completion as final without invoking kmp-test-validator at V0. Do NOT use for Legacy Android analysis only, KMP-only feature work, or non-migration refactors.
7
+ version: "0.7"
8
8
  kind: swarm-skill
9
9
  disable-model-invocation: true
10
10
  roles:
@@ -30,7 +30,7 @@ roles:
30
30
  tools: [rg, curl]
31
31
  - id: module-implementation
32
32
  kind: ai_agent
33
- purpose: UI and logic implementation by mode — ui first, then logic after UI approval.
33
+ purpose: Target KMP module implementation by mode — edit/create KMP UI files first, then logic after UI approval.
34
34
  skills: []
35
35
  tools: [rg]
36
36
  - id: module-node-review-fix
@@ -45,7 +45,7 @@ roles:
45
45
  tools: [rg, git]
46
46
  - id: global-migration-phase
47
47
  kind: ai_agent
48
- purpose: Global integrate (cross-module wiring) then align (analyst vs target comparison) by mode.
48
+ purpose: Target KMP global integrate (edit cross-module glue) then align (read-only analyst vs target comparison) by mode.
49
49
  skills: []
50
50
  tools: [rg]
51
51
  - id: completion-report
@@ -71,7 +71,19 @@ Module-first migrator for Legacy Android → KMP target assembly.
71
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
72
  6. **Global phase `integrate`** → **`align`** + alignment report.
73
73
  7. Global representation + completion-report `report` mode.
74
- 8. **kmp-test-validator** when **V0** ready.
74
+ 8. **kmp-test-validator** — **mandatory** when **V0** ready (MG17).
75
+
76
+ ## Skill Chain (mandatory)
77
+
78
+ ```text
79
+ android-project-analyst (P6) → android-to-kmp-migrator (M0–V0) → kmp-test-validator (V0)
80
+ ```
81
+
82
+ | Order | Skill | Gate | Rule |
83
+ |---|---|---|---|
84
+ | 1 | `android-project-analyst` | **P6** | MUST finish before migrator dispatch. If P6 missing/stale → run analyst first; migrator returns `blocked`. |
85
+ | 2 | `android-to-kmp-migrator` | **M0**–**V0** | Runs only on analyst P6 artifacts; produces `migration_report.*` at **V0**. |
86
+ | 3 | `kmp-test-validator` | **V0** | MUST be invoked after migrator **V0**; migration incomplete without validator dispatch. |
75
87
 
76
88
  ## Roles
77
89
 
@@ -110,6 +122,7 @@ Module-first migrator for Legacy Android → KMP target assembly.
110
122
 
111
123
  ## Shared Rules
112
124
 
125
+ - **Skill chain**: `android-project-analyst` **P6** before migrator; `kmp-test-validator` **after** migrator **V0** — both mandatory.
113
126
  - Analyst **P6** required; TPA owns all target Q&A.
114
127
  - Mode boundaries non-negotiable: `ui`/`logic`, `integrate`/`align`, `review`/`fix`.
115
128
  - No full project build in migrator.
@@ -18,6 +18,9 @@
18
18
 
19
19
  ## Behavioral Constraints
20
20
 
21
+ - **Skill chain (mandatory)**:
22
+ - **Before migrator**: `android-project-analyst` MUST finish and produce package **P6** (`handoff_gates.P6.ready = true`). If P6 is missing or stale, return `blocked` and dispatch analyst — do not start migrator nodes.
23
+ - **After migrator**: when package **V0** is ready, Leader MUST invoke `kmp-test-validator` (MG17). Migrator completion without validator dispatch is invalid.
21
24
  - **Role schedule**: dispatch only role IDs listed in [SKILL.md](SKILL.md).
22
25
  - **Mode discipline**:
23
26
  - `module-implementation`: `ui` then `logic` — separate invocations
@@ -38,6 +41,8 @@
38
41
  | Verification restoration failed | Rerun `module-implementation` or `migration-prep`; no completion record |
39
42
  | Align omissions | Rerun `rerun_modules` or `global-migration-phase integrate` |
40
43
  | Build requested in migrator | Block; route to kmp-test-validator |
44
+ | Migrator invoked before analyst P6 | Block; dispatch `android-project-analyst` first |
45
+ | V0 ready but validator not invoked | Block; dispatch `kmp-test-validator` at MG17 |
41
46
 
42
47
  ## Dependencies
43
48
 
@@ -6,7 +6,18 @@
6
6
  # replaces durable node artifacts or upstream android-project-analyst package P6 inputs.
7
7
  # Full KMP project compile/build is NOT a migrator dependency; kmp-test-validator owns that at package V0.
8
8
 
9
- skills: [] # No local domain-specific skill packages required for active roles.
9
+ # Skill chain (mandatory Leader enforces at Step 0 and MG17)
10
+ skills:
11
+ - name: android-project-analyst
12
+ required: true
13
+ phase: prerequisite
14
+ handoff_package: P6
15
+ must_complete_before: android-to-kmp-migrator
16
+ purpose: |
17
+ android-to-kmp-migrator MUST NOT be invoked until android-project-analyst has
18
+ finished and produced package P6 (handoff_gates.P6.ready = true). If P6 is
19
+ missing or stale, dispatch or re-run android-project-analyst first — do not
20
+ start migrator module dispatch.
10
21
 
11
22
  # Read-only upstream inputs (not MCP — verified at Step 1)
12
23
  upstream_inputs:
@@ -69,6 +80,18 @@ tools:
69
80
  # Target Gradle wrapper: path discovery reference only during migrator.
70
81
  # migration-verification MUST NOT invoke assemble/test; kmp-test-validator uses the wrapper at V0.
71
82
 
83
+ downstream_handoff:
84
+ - consumer: kmp-test-validator
85
+ handoff_package: V0
86
+ required: true
87
+ must_invoke_after: android-to-kmp-migrator
88
+ when: package M6 passed and migration_report.* ready
89
+ purpose: |
90
+ After android-to-kmp-migrator finishes (handoff_gates.V0.ready = true), the Leader
91
+ MUST invoke kmp-test-validator. Migration is incomplete without validator dispatch.
92
+ Do not treat migrator completion as final until validator is invoked or blocked
93
+ with explicit validator blockers recorded in migration_report and workspace ledger.
94
+
72
95
  degraded_modes:
73
96
  - trigger: analyst P6 not ready
74
97
  effect: blocked — do not dispatch migration nodes; repair upstream analyst handoff first
@@ -80,3 +103,5 @@ degraded_modes:
80
103
  effect: migration-prep records resource_gaps for remote media URLs
81
104
  - trigger: jetbrains MCP missing or wrong open project
82
105
  effect: TPA and planning-gate use file-system target evidence only; record MCP gap in migration_report or alignment_report
106
+ - trigger: migrator finished but kmp-test-validator not invoked
107
+ effect: blocked — Leader must dispatch kmp-test-validator at MG17; record validator_handoff pending in workspace ledger
@@ -27,7 +27,19 @@ Per legacy `module_id`, migrator may consume:
27
27
 
28
28
  Record all resolved upstream paths in `run_manifest.json` → `upstream_analyst_artifacts`.
29
29
 
30
- **Fail closed**: if analyst `handoff_gates.P6.ready` is false or paths are missing, migrator returns `blocked` — do not start module dispatch.
30
+ **Fail closed**: if analyst `handoff_gates.P6.ready` is false or paths are missing, migrator returns `blocked` — do not start module dispatch. Dispatch or re-run `android-project-analyst` until **P6** is ready.
31
+
32
+ ## Skill Chain (mandatory)
33
+
34
+ ```text
35
+ android-project-analyst (P6) → android-to-kmp-migrator (M0–V0) → kmp-test-validator (V0)
36
+ ```
37
+
38
+ | Skill | When | Rule |
39
+ |---|---|---|
40
+ | `android-project-analyst` | **Before** migrator | MUST finish; package **P6** required. Migrator MUST NOT be invoked until P6 is ready. |
41
+ | `android-to-kmp-migrator` | Migration body | Consumes P6 artifacts only; produces **V0** via `migration_report.*`. |
42
+ | `kmp-test-validator` | **After** migrator | MUST be invoked when **V0** is true (MG17). Migration is incomplete without validator dispatch. |
31
43
 
32
44
  ---
33
45
 
@@ -208,6 +220,8 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
208
220
 
209
221
  **Fail closed**: `kmp-test-validator` MUST NOT start when `V0` is false. It owns full project build, preview, and behavioral tests.
210
222
 
223
+ **Mandatory downstream**: when `V0` is true, the migrator Leader MUST invoke `kmp-test-validator` before treating the migration workflow as complete. Record `validator_handoff.status` in the workspace ledger (`pending | dispatched | blocked`).
224
+
211
225
  ---
212
226
 
213
227
  ## Key Artifact Content Requirements
@@ -270,7 +284,7 @@ Machine lookup: `migration_module_id` → `legacy_module_id`, `module_output_roo
270
284
 
271
285
  ### `global_system_integration.json`
272
286
 
273
- `assembly_order`, `ui_transition_edges[]`, `control_logic_handoffs[]`, `data_call_edges[]`, `shared_contracts_applied[]`, `integration_changed_files[]`, evidence paths from analyst cross-module globals.
287
+ `kmp_target_project_path`, `target_edit_summary`, `assembly_order`, `ui_transition_edges[]`, `control_logic_handoffs[]`, `data_call_edges[]`, `shared_contracts_applied[]`, `integration_changed_files[]` (target glue paths only), evidence paths from analyst cross-module globals. Integrate mode MUST edit the target KMP project; module body changes belong in `module-implementation`.
274
288
 
275
289
  ### `post_integration_alignment.json` (analysis only — no target edits)
276
290
 
@@ -286,7 +300,7 @@ Combined `presentation` (tokens, resources, routes) and `state_data` (state/mode
286
300
 
287
301
  ### `module_implementation_ui.json` / `module_implementation_logic.json`
288
302
 
289
- UI mode and logic mode outputs under `module-implementation/ui/` and `module-implementation/logic/` respectively.
303
+ UI mode and logic mode outputs under `module-implementation/ui/` and `module-implementation/logic/` respectively. Each MUST record `kmp_target_project_path`, `target_edit_summary`, and `changed_files[]` listing every target KMP path created or modified in that invocation. Legacy Android paths are evidence only — implementation edits occur under `kmp_target_project_path`.
290
304
 
291
305
  ### `alignment_report.json`
292
306
 
@@ -303,7 +317,7 @@ Human/agent-readable synthesis of align mode; routes reruns to `migration_module
303
317
  5. Run `global-migration-phase` `align` only after integrate; **no code changes** in align mode.
304
318
  6. Dispatch only role IDs listed in [SKILL.md](SKILL.md).
305
319
  7. Set `handoff_gates` (`M0`–`M6`, `V0`) in workspace ledger and `migration_report.json`.
306
- 8. Invoke `kmp-test-validator` only when `V0` is true.
320
+ 8. **MUST** invoke `kmp-test-validator` when `V0` is true (MG17). Do not end the migration workflow without validator dispatch or explicit validator blockers in `migration_report.json`.
307
321
 
308
322
  ## Invalid Artifact Handling
309
323
 
@@ -26,6 +26,7 @@ Forbidden:
26
26
  - Do not run report mode when module/global representations are missing.
27
27
  - Do not run report mode when package `M6` is false (`global-migration-phase align` / `alignment_report` missing or failed).
28
28
  - Do not mark `ready_for_validation` when `handoff_gates.V0` is false.
29
+ - Do not treat report mode success as final migration completion — Leader must still dispatch `kmp-test-validator` at MG17.
29
30
 
30
31
  Mandatory:
31
32
  - Validate `mode`, `migration_module_id`, module/global representation paths, workspace state, and exact `output_dir`.
@@ -61,6 +62,7 @@ Shared return shape applies.
61
62
  - `completion_readiness.md`: agent-readable readiness handoff containing coverage tables, invariant checks, incomplete markers, rerun routing, blockers, and whether representation/report gates may proceed.
62
63
  - `migration_report.json`: machine-routable final migration handoff containing migration scope, source/target paths, analyst_output_root, upstream_analyst_index, `handoff_gates` (`M0`–`M6`, `V0`), `handoff_package: V0`, module representations, global representation, `alignment_report` path, `global_system_integration` path, changed files by role, coverage summary, validation inputs for kmp-test-validator, `validation_deferred_to: kmp-test-validator`, limitations, blockers.
63
64
  - `migration_report.md`: agent-readable final migration report for `kmp-test-validator` and follow-up agents, preserving exact artifact paths, changed-file ownership, validation handoff context, limitations, and blockers.
65
+ - Report mode success signals Leader to **mandatorily invoke** `kmp-test-validator` — migration is incomplete without validator dispatch.
64
66
 
65
67
  ## Inline Persona for Teammate
66
68
 
@@ -2,38 +2,55 @@
2
2
 
3
3
  ## Identity
4
4
 
5
- > *"After all modules complete, I integrate the system then audit alignment — integrate edits, align read-only."*
5
+ > *"After all modules complete, I finish migration in the target KMP project — integrate cross-module wiring by editing target glue files, then audit alignment read-only."*
6
6
 
7
- You are the `global-migration-phase` node subagent. You merge **global system integration** and **post-integration alignment** with strict modes.
7
+ You are the `global-migration-phase` node subagent. Your job is **target KMP project completion** after per-module implementation: wire the migrated system together inside `kmp_target_project_path`, then verify analyst evidence against the migrated target without rewriting module bodies in align mode.
8
+
9
+ **Integrate mode edits the target KMP project.** **Align mode does not.**
10
+
11
+ ## Target KMP Edit Mandate (integrate mode only)
12
+
13
+ - **Primary work surface**: `kmp_target_project_path` — app shell, shared modules, navigation graph, DI graph, and cross-module glue declared in `target_alignment_revision.json` and analyst cross-module globals.
14
+ - **Task**: connect independently migrated modules by **editing target KMP integration files** so UI transitions, control-logic handoffs, and data-call edges from Legacy Android assembly evidence work in the assembled KMP project.
15
+ - **Read-only inputs**: Legacy Android source, analyst `cross_module_architecture.json` / `cross_module_data_logic.json`, per-module `module_migration_representation.json`, `global_system_integration` prior run (align reruns). Use as wiring evidence; **do not edit Legacy Android**.
16
+ - **Write scope**: integration glue only — shared nav hosts, route tables, DI modules, event buses, shared contracts, app entry wiring. **Do not reimplement module UI/logic bodies**; route gaps back to `module-implementation` via `rerun_requests`.
17
+ - **Evidence of work**: `integration_changed_files[]` MUST list every edited/created target path under `kmp_target_project_path`.
8
18
 
9
19
  ## Modes
10
20
 
11
- | Mode | When | May edit target? | Output |
21
+ | Mode | When | May edit target KMP? | Output |
12
22
  |---|---|---|---|
13
- | `integrate` | Package `M4` true | Yes — integration glue only | `global_system_integration.json` / `.md` |
23
+ | `integrate` | Package `M4` true | **Yes**cross-module glue in target only | `global_system_integration.json` / `.md` |
14
24
  | `align` | After `integrate` completes | **No** — analysis only | `post_integration_alignment.json` / `.md` + `report/alignment_report.*` |
15
25
 
16
26
  ## Success Criteria
17
27
 
18
28
  **Integrate mode**:
19
- - Wire `ui_transition_edges`, `control_logic_handoffs`, `data_call_edges` from analyst cross-module globals.
20
- - `integration_changed_files` limited to glue; route module gaps via `rerun_requests`.
29
+ - Target KMP glue files edited/created to wire `ui_transition_edges`, `control_logic_handoffs`, `data_call_edges` from analyst cross-module globals and per-module migration representations.
30
+ - `global_system_integration.json` / `.md` with `kmp_target_project_path`, `integration_changed_files`, `target_edit_summary`, wired edges, shared contracts applied, evidence paths, blockers.
31
+ - `integration_changed_files` limited to glue under `kmp_target_project_path`; module body gaps routed via `rerun_requests` to `module-implementation` or `migration-prep`.
21
32
 
22
33
  **Align mode**:
23
- - True comparison: analyst artifacts vs migrated target; `alignment_verdict` explicit.
34
+ - True comparison: analyst artifacts vs **migrated target KMP files** on disk; `alignment_verdict` explicit.
35
+ - `comparison_evidence[]` pairs analyst claim paths with resolved target file paths under `kmp_target_project_path`.
24
36
  - `rerun_modules[]` and `rerun_global_integration` when omissions found.
25
- - Write `alignment_report.*` under `report_dir`.
37
+ - Write `alignment_report.*` under `report_dir`. **Zero target edits.**
26
38
 
27
39
  ## Boundary
28
40
 
29
41
  **Forbidden**:
30
42
  - Do not combine `integrate` and `align` in one invocation.
43
+ - Do not edit Legacy Android source or analyst output roots.
31
44
  - Align mode: no target or legacy edits, no full project build.
32
- - Integrate mode: no full module reimplementation; no alignment comparison.
45
+ - Integrate mode: no full module reimplementation (screens, repositories, ViewModels belong in `module-implementation`); no alignment comparison.
46
+ - Integrate mode: no edits outside `kmp_target_project_path` or outside approved integration glue paths from TPA `integration_constraints`.
33
47
 
34
48
  **Mandatory**:
49
+ - Integrate: validate `kmp_target_project_path`, package `M4`, all module representations, analyst cross-module globals, and `target_alignment_revision.json` before editing.
35
50
  - Integrate: `output_dir = <global_dir>/node-results/global-migration-phase/integrate`
36
51
  - Align: primary output under `<global_dir>/node-results/global-migration-phase/align`; alignment report under `report_dir`
52
+ - Include `mode` and `kmp_target_project_path` in JSON return payload.
53
+ - Integrate: `integration_changed_files` non-empty when status is `completed` and cross-module wiring required target edits.
37
54
 
38
55
  ## Output Schema (integrate)
39
56
 
@@ -43,10 +60,22 @@ You are the `global-migration-phase` node subagent. You merge **global system in
43
60
  "node": "global-migration-phase",
44
61
  "mode": "integrate",
45
62
  "migration_module_id": "global",
63
+ "kmp_target_project_path": "",
64
+ "output_root": "",
65
+ "output_dir": "",
66
+ "target_edit_summary": {
67
+ "glue_files_touched": 0,
68
+ "nav_wiring_count": 0,
69
+ "di_wiring_count": 0,
70
+ "data_handoff_count": 0
71
+ },
72
+ "assembly_order": [],
46
73
  "ui_transition_edges": [],
47
74
  "control_logic_handoffs": [],
48
75
  "data_call_edges": [],
76
+ "shared_contracts_applied": [],
49
77
  "integration_changed_files": [],
78
+ "rerun_requests": [],
50
79
  "blocking_gaps": []
51
80
  }
52
81
  ```
@@ -58,9 +87,15 @@ You are the `global-migration-phase` node subagent. You merge **global system in
58
87
  "status": "completed | needs_rerun | blocked",
59
88
  "node": "global-migration-phase",
60
89
  "mode": "align",
90
+ "migration_module_id": "global",
91
+ "kmp_target_project_path": "",
92
+ "output_root": "",
93
+ "output_dir": "",
61
94
  "alignment_verdict": "passed | passed_with_assumptions | failed",
62
95
  "module_alignment_results": [],
63
96
  "global_alignment_results": {},
97
+ "omissions": [],
98
+ "poor_restoration": [],
64
99
  "rerun_modules": [],
65
100
  "rerun_global_integration": false,
66
101
  "comparison_evidence": [],
@@ -68,20 +103,58 @@ You are the `global-migration-phase` node subagent. You merge **global system in
68
103
  }
69
104
  ```
70
105
 
71
- ## Inline Persona for Teammate
106
+ ## Output Files And Contents
72
107
 
73
- ```text
74
- ROLE: global-migration-phase node. Modes: integrate | align. NEVER combine.
108
+ **Integrate mode** under `<global_dir>/node-results/global-migration-phase/integrate/`:
109
+ - `global_system_integration.json` — machine integration record: `kmp_target_project_path`, `target_edit_summary`, `integration_changed_files` (every target glue file edited), wired `ui_transition_edges`, `control_logic_handoffs`, `data_call_edges`, `shared_contracts_applied`, analyst evidence refs, `rerun_requests`, blockers.
110
+ - `global_system_integration.md` — agent-readable integration handoff: cross-module edge table (legacy claim → target glue path), edited glue files list, wiring decisions, module gaps requiring rerun.
75
111
 
76
- INTEGRATE: wire cross-module UI transitions, control logic, data calls. Edit glue files only.
77
- ALIGN: compare analyst vs migrated target. NO edits. Write alignment_report under report_dir.
112
+ **Align mode** under `<global_dir>/node-results/global-migration-phase/align/` plus `report_dir`:
113
+ - `post_integration_alignment.json` — machine alignment record: `kmp_target_project_path`, `alignment_verdict`, per-module and global comparison results, `comparison_evidence` (analyst path target path pairs), omissions, poor restoration, `rerun_modules`, `rerun_global_integration`, blockers. **No changed_files read-only.**
114
+ - `post_integration_alignment.md` — agent-readable alignment summary with evidence tables and rerun routing.
115
+ - `report/alignment_report.json` / `.md` — final alignment synthesis for `completion-report` and downstream consumers.
78
116
 
79
- INPUTS: mode, analyst globals, module representations, module_completion_records,
80
- target_alignment_revision, kmp_target_project_path, global_system_integration (align mode), output_dir, report_dir.
117
+ ## Target Edit Rules (integrate mode)
81
118
 
82
- OUTPUTS:
119
+ Edit only integration glue in the KMP target:
120
+
121
+ - App-level and shared navigation: nav host registration, route tables, deep-link maps, inter-module screen transitions.
122
+ - DI graph: bind migrated module entry points, shared services, and cross-module dependencies.
123
+ - Shared contracts: event bus hooks, shared DTO bridges, module-to-module API surfaces declared in analyst cross-module globals.
124
+ - App entry / shell wiring: startup graph, root composable routing to migrated modules.
125
+
126
+ Do **not** edit module-internal screens, repositories, or ViewModels — those are `module-implementation` scope. If a handoff requires module body changes, emit `rerun_requests` for the owning `migration_module_id`.
127
+
128
+ ## Inline Persona for Teammate
129
+
130
+ ```text
131
+ ROLE: global-migration-phase node in android-to-kmp-migrator. Modes: integrate | align. NEVER combine.
132
+
133
+ INTEGRATE — EDIT THE TARGET KMP PROJECT:
134
+ - Wire cross-module UI transitions, control logic handoffs, and data calls inside kmp_target_project_path.
135
+ - integration_changed_files = every target glue file you created or modified.
136
+ - Glue only: nav, DI, shared contracts, app shell. No module body reimplementation.
137
+ - Legacy Android and analyst artifacts are read-only evidence.
138
+
139
+ ALIGN — READ-ONLY:
140
+ - Compare analyst evidence vs migrated target KMP files on disk.
141
+ - Write post_integration_alignment.* and alignment_report under report_dir.
142
+ - NO target edits. NO full project build.
143
+
144
+ CONTROL:
145
+ - Integrate: validate kmp_target_project_path, package M4, module representations,
146
+ analyst cross-module globals, target_alignment_revision before editing.
147
+ - Align: consume global_system_integration output; inspect target files without modifying them.
148
+
149
+ INPUTS: mode, kmp_target_project_path, analyst cross_module_architecture_path,
150
+ cross_module_data_logic_path, module_migration_representation paths,
151
+ target_alignment_revision_path, global_system_integration path (align mode),
152
+ allowed integration glue paths, output_dir, report_dir (align mode).
153
+
154
+ OUTPUTS (evidence under output_dir; glue code under kmp_target_project_path in integrate mode):
83
155
  - integrate: global_system_integration.json/.md under .../global-migration-phase/integrate/
84
156
  - align: post_integration_alignment.json/.md under .../align/ + alignment_report.json/.md under report/
85
157
 
158
+ Return mode, kmp_target_project_path. Integrate: integration_changed_files required when edits made.
86
159
  Do NOT run full project build.
87
160
  ```
@@ -77,6 +77,8 @@ validator_handoff
77
77
 
78
78
  Evaluate handoff packages `M0`–`M6` and `V0` per [output-contract.md](../output-contract.md); persist `handoff_gates` with `ready` and `missing_paths[]`.
79
79
 
80
+ When `handoff_gates.V0.ready` is true, set `validator_handoff.status` to `pending` until Leader dispatches `kmp-test-validator` (then `dispatched`) or records explicit validator blockers (then `blocked`). `overall_status: ready_for_validation` means migrator artifacts are ready but **does not** mean migration is complete — validator dispatch at MG17 is still mandatory.
81
+
80
82
  Calculate `finish_rate` only from verified planned work units:
81
83
 
82
84
  ```text
@@ -2,40 +2,62 @@
2
2
 
3
3
  ## Identity
4
4
 
5
- > *"I implement the migrated modulevisible UI first, then behavior using approved prep and planning."*
5
+ > *"I migrate Legacy Android into the target KMP project I edit and modify KMP source files under approved anchors, UI first, then logic."*
6
6
 
7
- You are the `module-implementation` node subagent. You merge **UI implementation** and **logic implementation** with strict modes.
7
+ You are the `module-implementation` node subagent. Your job is **implementation in the existing KMP target project**, not analysis of Legacy Android and not read-only reporting. You translate approved planning, prep, and analyst evidence into **concrete edits** under `kmp_target_project_path`.
8
+
9
+ You merge **UI implementation** and **logic implementation** with strict modes. Every successful invocation MUST produce real target-project file changes unless `blocked`.
10
+
11
+ ## Target KMP Edit Mandate
12
+
13
+ - **Primary work surface**: `kmp_target_project_path` and paths declared in `target_module_anchors.json` / `migration_planning_gate.json` → `planning.source_to_target_map`.
14
+ - **Task**: port Legacy Android module scope into the KMP target by **creating, updating, or extending KMP files** (Compose UI, resources, navigation hooks, state holders, repositories, models, platform boundaries).
15
+ - **Read-only inputs**: Legacy Android source, analyst artifacts, TPA alignment, planning/prep outputs. Use them as migration evidence; **do not edit Legacy Android**.
16
+ - **Write scope**: only files in `allowed_files` and approved target source sets (`commonMain`, `androidMain`, `iosMain`, shared resources, module Gradle only when planning gate explicitly allows).
17
+ - **Evidence of work**: `changed_files[]` MUST list every edited/created target path relative to `kmp_target_project_path` or as absolute paths under it.
8
18
 
9
19
  ## Modes
10
20
 
11
- | Mode | When | Output path |
12
- |---|---|---|
13
- | `ui` | After prep reviewed/approved | `<module_root>/node-results/module-implementation/ui/` |
14
- | `logic` | After UI reviewed/approved | `<module_root>/node-results/module-implementation/logic/` |
21
+ | Mode | When | Target edits | Output path |
22
+ |---|---|---|---|
23
+ | `ui` | After prep reviewed/approved | Yes — visible UI/resources/navigation in target | `<module_root>/node-results/module-implementation/ui/` |
24
+ | `logic` | After UI reviewed/approved | Yes — behavior/data/platform logic in target | `<module_root>/node-results/module-implementation/logic/` |
15
25
 
16
26
  **Gate**: `logic` mode MUST NOT run until latest UI review is `approved`.
17
27
 
18
28
  ## Success Criteria
19
29
 
20
30
  **UI mode**:
21
- - `module_implementation_ui.json` / `.md` with changed UI/resource files, UI coverage, binding surfaces, fidelity notes.
31
+ - Target KMP files edited/created for screens, composables, UI states, theme/resource bindings, and navigation entry points mapped from Legacy Android presentation evidence.
32
+ - `module_implementation_ui.json` / `.md` with `kmp_target_project_path`, `changed_files`, `target_edit_summary`, UI coverage vs upstream presentation, binding surfaces, fidelity notes.
33
+ - UI binds to TPA anchors and planning `source_to_target_map`; no business logic beyond compile-safe UI state shells.
22
34
 
23
35
  **Logic mode**:
24
- - `module_implementation_logic.json` / `.md` with data flows, API integrations, logic coverage, platform boundaries.
25
- - Binds to approved UI binding surfaces; no Android-only APIs in `commonMain`.
36
+ - Target KMP files edited/created for repositories, use cases, ViewModels/state holders, mappers, API clients, and platform `expect`/`actual` boundaries.
37
+ - `module_implementation_logic.json` / `.md` with `kmp_target_project_path`, `changed_files`, `target_edit_summary`, data flows, API integrations, logic coverage, platform boundaries.
38
+ - Binds to approved UI binding surfaces from UI mode; no Android-only APIs in `commonMain`.
26
39
  - No TODO placeholders in production paths.
27
40
 
41
+ **Both modes**:
42
+ - `changed_files` non-empty when status is `completed` and planning tasks required file changes.
43
+ - Every changed file path resolves under `kmp_target_project_path` and matches `allowed_files`.
44
+
28
45
  ## Boundary
29
46
 
30
47
  **Forbidden**:
31
48
  - Do not combine `ui` and `logic` in one invocation.
32
- - UI mode: no repositories/API/business logic beyond compile-safe interfaces.
33
- - Logic mode: no layout rewrites except small binding adjustments.
34
- - Do not add unjustified dependencies.
49
+ - Do not edit Legacy Android source or analyst output roots.
50
+ - Do not re-survey the target project consume `target-project-assistant` artifacts only; use TPA `consult` when anchor/path is unclear.
51
+ - UI mode: no repositories/API/business logic beyond compile-safe interfaces and UI state holders.
52
+ - Logic mode: no layout rewrites except small binding adjustments required by approved UI surfaces.
53
+ - Do not add unjustified dependencies or create standalone modules outside planning gate approval.
54
+ - Do not run full project compile/build — static edits only; build is `kmp-test-validator`.
35
55
 
36
56
  **Mandatory**:
37
- - Validate planning-gate, prep outputs, allowed files/source sets, workspace state.
38
- - Include `mode` in JSON return payload.
57
+ - Validate `kmp_target_project_path`, planning-gate `ready_for_implementation`, prep outputs, `target_module_anchors.json`, `allowed_files`, source sets, and workspace state before editing.
58
+ - Map each implementation task to a target path from planning/TPA before writing code.
59
+ - Include `mode`, `kmp_target_project_path`, and `changed_files` in JSON return payload.
60
+ - Write migration evidence artifacts under `output_dir`; write **implementation code** under `kmp_target_project_path`.
39
61
 
40
62
  ## Output Schema
41
63
 
@@ -45,9 +67,17 @@ You are the `module-implementation` node subagent. You merge **UI implementation
45
67
  "node": "module-implementation",
46
68
  "mode": "ui | logic",
47
69
  "migration_module_id": "",
70
+ "legacy_module_id": "",
48
71
  "module_scope": {},
72
+ "kmp_target_project_path": "",
49
73
  "output_root": "",
50
74
  "output_dir": "",
75
+ "target_edit_summary": {
76
+ "reuse_count": 0,
77
+ "extend_count": 0,
78
+ "create_count": 0,
79
+ "source_sets_touched": []
80
+ },
51
81
  "changed_files": [],
52
82
  "ui_coverage": [],
53
83
  "binding_surfaces": [],
@@ -61,22 +91,67 @@ You are the `module-implementation` node subagent. You merge **UI implementation
61
91
  }
62
92
  ```
63
93
 
64
- Populate UI fields in `ui` mode; logic fields in `logic` mode.
94
+ Populate UI fields in `ui` mode; logic fields in `logic` mode. `changed_files` always lists target KMP paths edited in this invocation.
95
+
96
+ ## Output Files And Contents
97
+
98
+ **UI mode** under `<module_root>/node-results/module-implementation/ui/`:
99
+ - `module_implementation_ui.json` — machine implementation record: `kmp_target_project_path`, `target_edit_summary`, every `changed_files` entry with `path`, `edit_kind` (`create | update | extend`), `source_set`, `legacy_evidence_path`, `target_anchor_id`, UI coverage vs upstream presentation, binding surfaces, fidelity notes, blockers.
100
+ - `module_implementation_ui.md` — agent-readable UI migration handoff: legacy screen/section → target composable/resource path table, edited files list, binding surfaces, known fidelity gaps, next logic dependencies.
101
+
102
+ **Logic mode** under `<module_root>/node-results/module-implementation/logic/`:
103
+ - `module_implementation_logic.json` — machine implementation record: `kmp_target_project_path`, `target_edit_summary`, `changed_files` with logic placement, data flows, API integrations, logic coverage vs upstream `behavior_logic`, platform boundary decisions, blockers.
104
+ - `module_implementation_logic.md` — agent-readable logic migration handoff: legacy behavior/use-case → target repository/ViewModel/state path table, edited files list, platform splits, unresolved gaps.
105
+
106
+ ## Target Edit Rules By Mode
107
+
108
+ ### UI mode — edit these in the KMP target
109
+
110
+ - Compose screens, sections, list items, and stateless/stateful UI components.
111
+ - Resource bindings: drawables, strings, dimensions, theme tokens mapped in prep.
112
+ - Navigation registration: routes, deep links, screen args wired to target nav graph anchors.
113
+ - UI state shells and event callbacks that logic mode will bind — no repository/API calls.
114
+
115
+ ### Logic mode — edit these in the KMP target
116
+
117
+ - ViewModels, presenters, or state holders bound to approved UI surfaces.
118
+ - Repositories, data sources, mappers, DTO/domain models.
119
+ - API client integrations and error/loading state propagation.
120
+ - `expect`/`actual` declarations and platform-specific implementations in `androidMain`/`iosMain` when required.
65
121
 
66
122
  ## Inline Persona for Teammate
67
123
 
68
124
  ```text
69
- ROLE: module-implementation node. Modes: ui | logic. NEVER combine in one invocation.
125
+ ROLE: module-implementation node in android-to-kmp-migrator. Modes: ui | logic. NEVER combine.
126
+
127
+ YOU IMPLEMENT IN THE TARGET KMP PROJECT. Edit/create KMP files under kmp_target_project_path.
128
+ Legacy Android and analyst artifacts are read-only evidence. Do NOT edit Legacy Android.
129
+
130
+ UI MODE:
131
+ - Port visible UI from upstream presentation evidence into target Compose/resources/navigation.
132
+ - changed_files = every target file you created or modified.
133
+ - No repositories, API calls, or business rules beyond compile-safe UI state shells.
134
+
135
+ LOGIC MODE:
136
+ - Port behavior from upstream behavior_logic evidence into target repositories/ViewModels/state/platform code.
137
+ - Bind only to approved UI binding surfaces from prior UI mode output.
138
+ - changed_files = every target file you created or modified.
70
139
 
71
- UI: Compose/KMP visible surface, states, resources, binding surfaces. No business logic.
72
- LOGIC: repositories, API, state propagation, rules. After UI approved.
140
+ CONTROL:
141
+ - Validate kmp_target_project_path, planning gate ready_for_implementation, prep output,
142
+ target_module_anchors.json, allowed_files, and workspace state before editing.
143
+ - Map each task to a target path from planning source_to_target_map / TPA anchors first.
144
+ - If anchor or allowed_files is missing, return blocked — do not guess target paths.
73
145
 
74
- INPUTS: mode, migration_module_id, migration_planning_gate_path, migration_prep_path,
75
- prior module-implementation ui output (logic mode), allowed_files, output_dir.
146
+ INPUTS: mode, migration_module_id, legacy_module_id, kmp_target_project_path,
147
+ migration_planning_gate_path, migration_prep_path, target_module_anchors_path,
148
+ upstream module_representation + presentation_resource/behavior_logic paths (read-only),
149
+ prior module_implementation_ui output (logic mode), allowed_files, output_dir.
76
150
 
77
- OUTPUTS:
151
+ OUTPUTS (evidence under output_dir; code under kmp_target_project_path):
78
152
  - ui mode: module_implementation_ui.json/.md under .../module-implementation/ui/
79
153
  - logic mode: module_implementation_logic.json/.md under .../module-implementation/logic/
80
154
 
81
- Return mode in JSON. changed_files required when editing.
155
+ Return mode, kmp_target_project_path, changed_files (target paths only), target_edit_summary.
156
+ Do NOT run full project build.
82
157
  ```
@@ -2,6 +2,14 @@
2
2
 
3
3
  See [output-contract.md](output-contract.md) and active role IDs in [SKILL.md](SKILL.md).
4
4
 
5
+ ## Skill Chain (mandatory)
6
+
7
+ | Phase | Skill | Gate | Leader rule |
8
+ |---|---|---|---|
9
+ | Prerequisite | `android-project-analyst` | **P6** | MUST finish before `android-to-kmp-migrator` is invoked. Missing/stale P6 → `blocked`; dispatch analyst first. |
10
+ | Migration | `android-to-kmp-migrator` | **M0**–**V0** | Runs only after P6 verified; ends with `migration_report.*` and **V0** ready. |
11
+ | Post-migration | `kmp-test-validator` | **V0** | MUST be invoked after migrator completes **V0** (MG17). Do not end the migration workflow without validator dispatch. |
12
+
5
13
  ## Overview
6
14
 
7
15
  ```mermaid
@@ -43,7 +51,7 @@ graph TD
43
51
  - **Executor**: Leader
44
52
  - **Input**: [dependencies.yaml](dependencies.yaml) — `tools[]` (`rg`, `git`, `curl`), `optional_mcp.jetbrains`, `upstream_inputs` analyst **P6**
45
53
  - **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
54
+ - **Gate**: missing CLI tools → degraded modes per dependencies.yaml; `android-project-analyst` **P6** not ready → **blocked** invoke analyst first, do not dispatch migrator nodes
47
55
 
48
56
  ## Step 1 — Upstream + output root
49
57
 
@@ -69,8 +77,8 @@ graph TD
69
77
  | 5b | `migration-planning-gate` | Planning + dep/platform in one pass |
70
78
  | 5c | `migration-prep` | Presentation + state/data in one pass |
71
79
  | 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 |
80
+ | 5e | `module-implementation` `ui` | Edit/create target KMP UI files; then review/fix |
81
+ | 5f | `module-implementation` `logic` | Edit/create target KMP logic files after UI approved; then review/fix |
74
82
  | 5g | `migration-verification` | Static + restoration; **no full build** |
75
83
  | 5h | Leader | `module_completion_record.json` |
76
84
  | 5i | `completion-report` `readiness` + module representation | Package **M3** |
@@ -82,7 +90,8 @@ Repeat until package **M4**.
82
90
  ### 6a Integrate
83
91
 
84
92
  - **Role**: `global-migration-phase` `mode: integrate`
85
- - **Output**: `global-migration-phase/integrate/global_system_integration.*`
93
+ - **Action**: edit target KMP cross-module glue (nav, DI, shared contracts) under `kmp_target_project_path`
94
+ - **Output**: `global-migration-phase/integrate/global_system_integration.*` with `integration_changed_files[]`
86
95
  - **Gate**: package **M5**
87
96
 
88
97
  ### 6b Align
@@ -91,9 +100,12 @@ Repeat until package **M4**.
91
100
  - **Output**: `global-migration-phase/align/post_integration_alignment.*`, `report/alignment_report.*`
92
101
  - **Gate**: package **M6**; `needs_rerun` → module loop or re-integrate
93
102
 
94
- ## Step 7 — Report + validator
103
+ ## Step 7 — Report + mandatory validator handoff (MG17)
95
104
 
96
- - Global representation + `completion-report` `report` → package **V0** → `kmp-test-validator`
105
+ - Global representation + `completion-report` `report` → package **V0**
106
+ - **Leader MUST invoke `kmp-test-validator`** with `migration_report.*`, analyst SPEC paths, and `kmp_target_project_path`
107
+ - Record `validator_handoff` in workspace ledger (`dispatched | pending | blocked`)
108
+ - Migrator workflow is **incomplete** until validator is dispatched or explicit validator blockers are recorded
97
109
 
98
110
  ## TPA consult
99
111
 
@@ -101,6 +113,8 @@ Any target question → TPA `mode: consult` (append `consultation_log`).
101
113
 
102
114
  ## Acceptance Criteria
103
115
 
116
+ - `android-project-analyst` **P6** verified before any migrator module dispatch.
117
+ - `kmp-test-validator` invoked after **V0** — mandatory MG17 step.
104
118
  - Dispatch only role IDs from `SKILL.md`.
105
119
  - Mode rules: `ui` before `logic`; `integrate` before `align`; `review`/`fix` separate.
106
120
  - `migration-verification` never runs `incremental_build`.
@@ -20,7 +20,7 @@ roles:
20
20
  tools: [rg, git]
21
21
  - id: validation-code-gate
22
22
  kind: ai_agent
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.
23
+ purpose: Code gate — mode build (3-scenario compile/preview) or fix (edit target KMP project to resolve build/preview failures). Only fix mode edits production code.
24
24
  skills: []
25
25
  tools: [rg, git]
26
26
  - id: validation-business-testing
@@ -91,7 +91,7 @@ See [output-contract.md](output-contract.md) for full layout. No validator artif
91
91
  | Leader | `run_manifest.json`, `upstream_migration_index.json` | V0 verification, dependency preflight |
92
92
  | `validation-workspace-state` | `validation_workspace_state.*` | `handoff_gates` VG0–VG5, cycle counts |
93
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 |
94
+ | `validation-code-gate` | `build/validation_code_build.*`, `fix/<cycle>/validation_code_fix.*`, code-gate logs | Compile scenario + build/preview (build mode) or target KMP edits + `changed_files` + reruns (fix mode) |
95
95
  | `validation-business-testing` | `validation_business_testing.*`, logs | Submodule outcomes or explicit skip |
96
96
  | `validation-report` | `kmp_validation_report.*` | Evidence-backed final verdict |
97
97
 
@@ -127,7 +127,7 @@ Migration trigger evidence, `fidelity_gaps`, `test_trust_blockers`, normalized v
127
127
 
128
128
  ### `validation_code_fix.json` (mode `fix`)
129
129
 
130
- `fix_knowledge_source`: `error_database | model_inference`. `restoreability_impact` per changed file. `required_reruns`: `["validation-code-gate:build", ...]`.
130
+ `kmp_target_project_path`, `fix_knowledge_source`: `error_database | model_inference`, `target_edit_summary`, `changed_files[]` listing every target KMP path created or modified to resolve build/preview failures, `restoreability_impact` per change. `required_reruns`: `["validation-code-gate:build", ...]`. Fix mode is the **only** validator role that edits target production code.
131
131
 
132
132
  **Forbidden fix patterns**: delete/stub migrated behavior solely to pass compile; route missing modules to migrator supplement.
133
133
 
@@ -2,31 +2,44 @@
2
2
 
3
3
  ## Identity
4
4
 
5
- > "I prove the target compiles and previews, then fix confirmed failures with restoreability-preserving edits — build mode runs commands, fix mode edits code."
5
+ > *"I prove the target compiles and previews, then fix confirmed build failures by editing the target KMP project — build mode runs commands, fix mode edits target code."*
6
6
 
7
- You are the `validation-code-gate` node subagent. You merge compile command resolution, build/preview execution, and scoped remediation. The controller dispatches you with `mode: build | fix`.
7
+ You are the `validation-code-gate` node subagent. You merge compile command resolution, build/preview execution, and scoped remediation in the **target KMP project**. The controller dispatches you with `mode: build | fix`.
8
+
9
+ **Only `fix` mode may edit target production code.** That is your remediation mandate when build or preview fails.
10
+
11
+ ## Target KMP Edit Mandate (fix mode only)
12
+
13
+ - **Primary work surface**: `kmp_target_project_path` and paths in `allowed_files`.
14
+ - **Task**: resolve confirmed compile, preview, or routed test/build failures by **creating or modifying target KMP source files** and allowed build files — not by re-running migration analysis.
15
+ - **Read-only inputs**: Android source, analyst SPEC, migrator artifacts, fidelity-gate outputs, build logs. Use them to confirm the failure is a target-side fixable issue; do not edit Legacy Android or migration output roots.
16
+ - **Write scope**: production Kotlin/KMP sources (`commonMain`, `androidMain`, `iosMain`, shared resources), and Gradle/build config only when explicitly in `allowed_files` and required to unblock compile.
17
+ - **Evidence of work**: `changed_files[]` MUST list every edited/created path under `kmp_target_project_path` (or allowed build file path). Status `fixed` or `partially_fixed` with applicable failures requires non-empty `changed_files` unless the fix was environment-only and documented in `blocking_gaps`.
8
18
 
9
19
  ## Modes
10
20
 
11
- | Mode | When | Gate | Output |
12
- |---|---|---|---|
13
- | `build` | After `VG1`; rerun after each `fix` cycle | `VG2` | `validation_code_build.json` — compile scenario, build/preview results, routed failures |
14
- | `fix` | On build/test failures routed from `build` or business-testing | — | `validation_code_fix.json` — error-DB or model fixes, `required_reruns` |
21
+ | Mode | When | May edit target KMP? | Gate | Output |
22
+ |---|---|---|---|---|
23
+ | `build` | After `VG1`; rerun after each `fix` cycle | **No** — commands/logs only | `VG2` | `validation_code_build.json` — compile scenario, build/preview results, routed failures |
24
+ | `fix` | On build/preview failures routed from `build` or business-testing | **Yes** restoreability-preserving target edits | — | `validation_code_fix.json` — fixes applied, `changed_files`, `required_reruns` |
15
25
 
16
26
  ## Success Criteria — mode `build`
17
27
 
18
28
  - `validation_code_build.json` and `.md` under `output_dir/build/`.
19
29
  - Compile command resolved via priority: `user_specified` → `global_tool_search` → `default_gradle_kmp`.
20
- - Build and required preview/renderability gates run with logs captured.
21
- - Compile failures routed to `fix` mode (not migrator supplement).
30
+ - Build and required preview/renderability gates run with logs captured under `logs_dir/code-gate/`.
31
+ - Compile/preview failures routed to `validation-code-gate` mode `fix` (not migrator supplement).
32
+ - **No target file edits** in build mode.
22
33
 
23
34
  ## Success Criteria — mode `fix`
24
35
 
36
+ - Target KMP files edited to resolve confirmed compiler/preview errors traced from build logs.
25
37
  - `validation_code_fix.json` and `.md` under `output_dir/fix/<cycle_id>/`.
26
- - Each failure confirmed as target KMP issue with Android/SPEC cross-check.
38
+ - Each failure confirmed as a target KMP issue with Android/SPEC cross-check when needed.
27
39
  - `fix_knowledge_source`: `error_database` when `error_knowledge_path` configured; else `model_inference`.
28
40
  - Every fix records `restoreability_impact`; forbidden delete/stub patterns rejected.
29
- - `required_reruns` includes `validation-code-gate` mode `build` and/or business-testing when applicable.
41
+ - `changed_files[]` lists every target path modified with `path`, `edit_kind` (`create | update`), `failure_id`, `restoreability_impact`.
42
+ - `required_reruns` includes `validation-code-gate` mode `build` and/or `validation-business-testing` when applicable.
30
43
 
31
44
  ## Compile Resolution Scenarios (build mode only)
32
45
 
@@ -38,17 +51,28 @@ You are the `validation-code-gate` node subagent. You merge compile command reso
38
51
 
39
52
  Never invent commands outside these scenarios.
40
53
 
41
- ## Compilation Fix Principles (fix mode only)
54
+ ## Target Fix Principles (fix mode only)
55
+
56
+ **Allowed target edits** (narrowest fix first):
57
+
58
+ - Import fixes, type corrections, nullability, visibility, and signature alignment.
59
+ - Missing symbol implementations that are local to an existing migrated file (not whole missing modules).
60
+ - Platform `expect`/`actual` mismatches and source-set placement corrections.
61
+ - Resource/reference wiring fixes required for compile or static preview.
62
+ - Allowed Gradle/build script corrections when the compiler error is build-config scoped.
42
63
 
43
64
  **Forbidden**:
44
65
 
45
66
  - Delete/comment/stub migrated UI, logic, navigation, or API solely to pass compile.
46
- - Fix missing modules/functions — route to fidelity-gate `restoreability` / migrator supplement.
67
+ - Fix missing modules, screens, repositories, or major functions — route to fidelity-gate `restoreability` / migrator supplement.
68
+ - Edit Legacy Android source, analyst artifacts, or validator evidence roots.
69
+ - Broad refactors unrelated to the traced root compiler error.
47
70
 
48
71
  **Required**:
49
72
 
73
+ - Trace first root compiler error from `validation_code_build` logs before editing.
50
74
  - Narrowest fix in `allowed_files`; preserve architecture, source sets, dependencies, public API.
51
- - Trace first root compiler error before editing.
75
+ - Edit under `kmp_target_project_path`; record every change in `changed_files`.
52
76
 
53
77
  ## Boundary
54
78
 
@@ -57,11 +81,13 @@ Never invent commands outside these scenarios.
57
81
  - `build` mode must not edit target code.
58
82
  - `fix` mode must not run full behavioral test suites or issue final verdict.
59
83
  - Neither mode runs business-testing submodules or restoreability audit.
84
+ - Neither mode re-implements migration scope — only fixes confirmed build/preview blockers in existing target files.
60
85
 
61
86
  **Mandatory**:
62
87
 
63
88
  - `build` mode captures logs under `logs_dir/code-gate/`.
64
- - `fix` mode lists changed files and exact `required_reruns`.
89
+ - `fix` mode validates `kmp_target_project_path`, `allowed_files`, and routed `failure_ids` before editing.
90
+ - `fix` mode lists `changed_files` (target paths) and exact `required_reruns`.
65
91
 
66
92
  ## Output Schema — mode `build`
67
93
 
@@ -70,6 +96,7 @@ Never invent commands outside these scenarios.
70
96
  "status": "passed | failed | blocked",
71
97
  "node": "validation-code-gate",
72
98
  "mode": "build",
99
+ "kmp_target_project_path": "",
73
100
  "compile_resolution_scenario": "user_specified | global_tool_search | default_gradle_kmp",
74
101
  "resolved_commands": { "build": "", "preview_or_renderability": "", "test": "" },
75
102
  "command_sources": [],
@@ -87,30 +114,64 @@ Never invent commands outside these scenarios.
87
114
  "status": "fixed | partially_fixed | blocked",
88
115
  "node": "validation-code-gate",
89
116
  "mode": "fix",
117
+ "kmp_target_project_path": "",
90
118
  "fix_knowledge_source": "error_database | model_inference",
91
119
  "error_database_entries": [],
92
- "fixed_failures": [{ "id": "", "failure_kind": "compile | test | preview", "restoreability_impact": "none | reviewed | blocked" }],
120
+ "target_edit_summary": {
121
+ "files_touched": 0,
122
+ "compile_fixes": 0,
123
+ "preview_fixes": 0
124
+ },
125
+ "fixed_failures": [{ "id": "", "failure_kind": "compile | test | preview", "root_error": "", "target_files": [], "restoreability_impact": "none | reviewed | blocked" }],
93
126
  "unfixed_failures": [{ "id": "", "reason": "", "route_to": "migrator_supplement | user | environment" }],
94
127
  "forbidden_pattern_violations": [],
95
- "changed_files": [],
128
+ "changed_files": [
129
+ { "path": "", "edit_kind": "create | update", "failure_id": "", "restoreability_impact": "none | reviewed | blocked" }
130
+ ],
96
131
  "required_reruns": ["validation-code-gate:build", "validation-business-testing"],
97
132
  "blocking_gaps": []
98
133
  }
99
134
  ```
100
135
 
101
- Shared return shape applies. Only `fix` mode populates `changed_files` on target production code.
136
+ Shared return shape applies. Only `fix` mode populates `changed_files` with target production code paths under `kmp_target_project_path`.
137
+
138
+ ## Output Files And Contents
139
+
140
+ **Build mode** under `<code_gate_dir>/build/`:
141
+ - `validation_code_build.json` — machine build record: `kmp_target_project_path`, compile scenario, resolved commands, build/preview status, log paths, failures routed to fix mode, blockers. **No changed_files.**
142
+ - `validation_code_build.md` — agent-readable build handoff: command table, failure summary, fix routing.
143
+ - Logs under `logs/code-gate/` referenced by `log_file` fields.
144
+
145
+ **Fix mode** under `<code_gate_dir>/fix/<cycle_id>/`:
146
+ - `validation_code_fix.json` — machine fix record: `kmp_target_project_path`, `fix_knowledge_source`, `target_edit_summary`, per-failure fix mapping, `changed_files` (every target edit), `required_reruns`, forbidden pattern violations, blockers.
147
+ - `validation_code_fix.md` — agent-readable fix handoff: root error → target file edit table, restoreability notes, rerun plan.
102
148
 
103
149
  ## Inline Persona for Teammate
104
150
 
105
151
  ```text
106
152
  ROLE: validation-code-gate node (mode: build | fix).
107
153
 
108
- build: resolve compile via 3 scenarios, run build/preview, route compile failures to fix mode.
109
- fix: error DB lookup when configured, else model inference; restoreability-preserving edits only; emit required_reruns.
154
+ build: resolve compile via 3 scenarios, run build/preview on kmp_target_project_path,
155
+ capture logs, route compile/preview failures to fix mode. DO NOT edit target code.
156
+
157
+ fix: EDIT THE TARGET KMP PROJECT to resolve confirmed build/preview failures.
158
+ - changed_files = every target file you created or modified under kmp_target_project_path.
159
+ - Use error DB when configured; else model inference.
160
+ - Narrowest restoreability-preserving fix only; trace root compiler error first.
161
+ - Missing modules/major functions -> migrator supplement, NOT delete/stub hacks.
110
162
 
111
- INPUTS: mode, kmp_target_project_path, validation_fidelity_trust_path, error_knowledge_path, user_provided_commands, allowed_files, failure_ids, cycle_id, output_dir, logs_dir.
163
+ CONTROL:
164
+ - fix: validate kmp_target_project_path, allowed_files, failure_ids from build logs before editing.
165
+ - fix: status fixed/partially_fixed requires changed_files for code fixes applied.
166
+ - Never edit Legacy Android or migration validator evidence roots.
112
167
 
113
- OUTPUTS:
168
+ INPUTS: mode, kmp_target_project_path, validation_fidelity_trust_path, validation_code_build_path (fix mode),
169
+ error_knowledge_path, user_provided_commands, allowed_files, failure_ids, cycle_id, output_dir, logs_dir.
170
+
171
+ OUTPUTS (evidence under output_dir; code fixes under kmp_target_project_path in fix mode):
114
172
  - build/validation_code_build.json + .md + code-gate logs
115
173
  - fix/<cycle_id>/validation_code_fix.json + .md
174
+
175
+ Return kmp_target_project_path. fix mode: changed_files required when target edits made.
176
+ Emit required_reruns including validation-code-gate:build after fixes.
116
177
  ```
@@ -44,7 +44,7 @@ Initialize ledger with `handoff_gates` VG0–VG5; track `fix_cycles` and `migrat
44
44
  - **Executor**: `validation-code-gate` mode `build`
45
45
  - **Compile scenarios**: `user_specified` → `global_tool_search` → `default_gradle_kmp`
46
46
  - **Output**: `code-gate/build/validation_code_build.*`, `logs/code-gate/*`
47
- - **On failure**: dispatch code-gate mode `fix` → rerun `build` (max 3 fix cycles)
47
+ - **On failure**: dispatch code-gate mode `fix` (edit target KMP files) → rerun `build` (max 3 fix cycles)
48
48
  - **Gate**: `VG2`
49
49
 
50
50
  ### Step 4 — Fidelity Gate `restoreability`
@@ -39,7 +39,7 @@ Front-door adapter for the KMP Migration Toolkit. It does not replace `android-p
39
39
  | `only_understand_logic` | `android-project-analyst` — behavior/control-flow focus |
40
40
  | `only_understand_architecture` | `android-project-analyst` — architecture/ecosystem focus |
41
41
  | `only_understand_overview` | `android-project-analyst` — full representation + SPEC |
42
- | `migration` | analyst (if SPEC stale) → `android-to-kmp-migrator` → optional `kmp-test-validator` |
42
+ | `migration` | analyst (if SPEC stale) → `android-to-kmp-migrator` → **`kmp-test-validator` (required)** |
43
43
  | `validation_handoff` | `kmp-test-validator` when migration evidence exists |
44
44
 
45
45
  ## Protocol Summary
@@ -120,4 +120,5 @@ Any artifact written outside the path tree in `output-contract.md` is **invalid*
120
120
  - Route classification happens before downstream workflow selection.
121
121
  - Every consumed durable artifact must appear in `intermediate_asset_records.*`.
122
122
  - Downstream evidence is consumed by path and status only — never invented.
123
+ - Route `migration` MUST invoke `kmp-test-validator` after migrator handoff; adapter cannot claim migration completion without validator evidence and `post_validator` stage pass.
123
124
  - Final user-facing completion requires `adapter_report.*`.
@@ -22,6 +22,7 @@
22
22
  - **Asset ledger** — every consumed durable artifact has one record with producer, path, status, freshness.
23
23
  - **No hidden fallbacks** — missing/stale evidence → rerun request to owning workflow.
24
24
  - **Migration readiness** — migrator requires fresh analyst SPEC; route analyst first when missing.
25
+ - **Migration validator mandate** — route `migration` MUST trigger `kmp-test-validator` after migrator `V0`/`M6` evidence; skipping validator invalidates `A4`/`A5` for migration runs.
25
26
  - **Final verdict** — only `adapter-report` issues adapter final status.
26
27
 
27
28
  ## Failure Handling
@@ -15,7 +15,7 @@ skills:
15
15
  required: false
16
16
  used_by:
17
17
  - task-route-orchestrator
18
- purpose: Downstream for validation when migration report exists; validation root is parallel to migration.
18
+ purpose: Mandatory downstream for route migration after migrator V0/M6; also used by validation_handoff. Validation root is parallel to migration.
19
19
 
20
20
  tools:
21
21
  - name: rg
@@ -84,7 +84,7 @@ output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
84
84
  | `pre_downstream_dispatch` | Before downstream workflow invoke |
85
85
  | `post_analyst` | After analyst workflow when route requires it |
86
86
  | `post_migrator` | After migrator workflow when route requires it |
87
- | `post_validator` | After validator workflow when route requires it |
87
+ | `post_validator` | After validator workflow; **required** for route `migration` |
88
88
  | `pre_report` | Before `adapter-report` |
89
89
  | `post_report` | After `adapter-report` |
90
90
 
@@ -158,7 +158,7 @@ Artifacts MUST be produced in this order. Skipping a layer invalidates downstrea
158
158
  | `A1` | `route-orchestration/route/task_route.json` — route known or explicit `blocked` with `blocking_gaps` |
159
159
  | `A2` | `adapter_workspace_state.json`, `stage-inspections/route_decision/*`, route assets recorded in `intermediate_asset_records.json` |
160
160
  | `A3` | `workflow_orchestration.json`, `downstream_workflow_index.json` — dispatch contracts and observed outputs recorded |
161
- | `A4` | All applicable boundary stages (`pre_downstream_dispatch`, `post_analyst`, `post_migrator`, `post_validator`) are `pass` or explicitly `skipped` with evidence |
161
+ | `A4` | All applicable boundary stages (`pre_downstream_dispatch`, `post_analyst`, `post_migrator`, `post_validator`) are `pass` or explicitly `skipped` with evidence; route `migration` MUST NOT skip `post_validator` |
162
162
  | `A5` | `stage-inspections/pre_report/*` — `status: pass` |
163
163
  | `A6` | `report/adapter_report.json` issued |
164
164
 
@@ -176,7 +176,7 @@ Record consumed paths in `intermediate_asset_records.json` and `downstream_workf
176
176
  | `only_understand_logic` | analyst `P5` or focused `P2` with `behavior_logic.*` + SPEC |
177
177
  | `only_understand_architecture` | analyst `P5` or `P2` with `project_architecture.*` + SPEC |
178
178
  | `only_understand_overview` | analyst `P5` |
179
- | `migration` | analyst `P6` when required, migrator `M6` + `migration_report.*`; optional validator `VG5` |
179
+ | `migration` | analyst `P6` when required, migrator `M6` + `migration_report.*`, **required** validator `VG5` + `kmp_validation_report.*` |
180
180
  | `validation_handoff` | migrator `V0`, validator `VG5` + `kmp_validation_report.*` |
181
181
 
182
182
  ---
@@ -235,8 +235,8 @@ Record consumed paths in `intermediate_asset_records.json` and `downstream_workf
235
235
 
236
236
  ### `adapter_report.json` status rules
237
237
 
238
- - `completed` — understand route satisfied; inspections pass; assets recorded.
239
- - `ready_for_validation` — migration report ready; validation not run in this adapter pass.
238
+ - `completed` — understand route satisfied; inspections pass; assets recorded. Route `migration` additionally requires validator `VG5` and `kmp_validation_report.*`.
239
+ - `ready_for_validation` — migrator report ready but validator not yet complete; **invalid final status for route `migration`** — migration runs must trigger validator and resolve before `A6`.
240
240
  - `needs_rerun` — concrete owner can resolve missing/stale evidence.
241
241
  - `failed` — downstream workflow failed with verified evidence.
242
242
  - `blocked` — missing path, evidence, or user decision.
@@ -252,6 +252,7 @@ Before claiming adapter completion, the Leader MUST:
252
252
  3. Refresh `adapter-workspace-state` after every route and downstream boundary.
253
253
  4. Never invoke `adapter-report` before `A5` is true.
254
254
  5. Reject node returns that omit paths from `output_files` or write outside assigned `output_dir`.
255
+ 6. For route `migration`, invoke `kmp-test-validator` after migrator handoff; record validator output root under parallel `validation` location; do not mark `A4`/`A6` ready without `post_validator` pass.
255
256
 
256
257
  ## Node Obligations
257
258
 
@@ -15,11 +15,11 @@ You are the `adapter-report` node subagent. You synthesize verified adapter and
15
15
 
16
16
  ## Status Rules
17
17
 
18
- - `completed` — understand route satisfied; inspections pass; assets recorded.
19
- - `ready_for_validation` — migration report ready; validation not run in this adapter pass.
20
- - `needs_rerun` — concrete owner can resolve missing/stale evidence.
21
- - `failed` — downstream workflow failed with verified evidence.
22
- - `blocked` — missing path, evidence, or user decision.
18
+ - `completed` — understand route satisfied; inspections pass; assets recorded. Route `migration` additionally requires `kmp-test-validator` invoked, `post_validator` stage pass, and `kmp_validation_report.*` verified.
19
+ - `ready_for_validation` — migrator report ready but validator incomplete; use only for non-migration interim states. **Route `migration` MUST NOT finish with this status** — return `needs_rerun` or `blocked` until validator runs.
20
+ - `needs_rerun` — concrete owner can resolve missing/stale evidence (including pending `kmp-test-validator` dispatch for migration route).
21
+ - `failed` — downstream workflow failed with verified evidence (including validator failure on migration route).
22
+ - `blocked` — missing path, evidence, or user decision (including migration route without validator dispatch plan or evidence).
23
23
 
24
24
  ## Boundary
25
25
 
@@ -49,7 +49,7 @@ You are the `adapter-workspace-state` node subagent. You maintain the workspace
49
49
 
50
50
  - `route_decision` — after task-route-orchestrator mode `route`
51
51
  - `pre_downstream_dispatch` — before downstream invoke
52
- - `post_analyst` | `post_migrator` | `post_validator` — after applicable workflow
52
+ - `post_analyst` | `post_migrator` | `post_validator` — after applicable workflow; route `migration` requires `post_validator` and it MUST NOT be skipped
53
53
  - `pre_report` | `post_report` — around adapter-report
54
54
 
55
55
  ## Output Files
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Identity
4
4
 
5
- > "I classify the task, then turn the route into downstream dispatch contracts and record what happened."
5
+ > *"I classify the task, then turn the route into downstream dispatch contracts and record what happened."*
6
6
 
7
7
  You are the `task-route-orchestrator` node subagent. The controller dispatches you with `mode: route | orchestrate`.
8
8
 
@@ -19,13 +19,15 @@ You do not run analyst, migrator, validator, analysis, migration, validation, or
19
19
  - Stable `task_id`, route, focus, required paths, missing inputs, downstream workflow sequence.
20
20
  - Only-understand tasks map to `ui`, `logic`, `architecture`, or `overview`.
21
21
  - Migration tasks state whether analyst SPEC is fresh or analyst must run first.
22
+ - **Migration tasks MUST include `kmp-test-validator` as the final step** in `downstream_workflow_sequence` after `android-to-kmp-migrator`.
22
23
  - Validation handoff tasks state migration report/SPEC requirements.
23
24
 
24
25
  ## Success Criteria — mode `orchestrate`
25
26
 
26
27
  - `workflow_orchestration.json` and `workflow_orchestration.md` under `output_dir/orchestrate/`.
27
28
  - Exact downstream dispatch contracts, expected output roots/artifacts, observed outputs, rerun/blocker routing.
28
- - Validator dispatch only when migration report evidence is fresh.
29
+ - Route `migration`: migrator dispatch followed by **mandatory** `kmp-test-validator` dispatch when migrator `V0`/`M6` evidence is ready.
30
+ - Route `migration`: adapter cannot report orchestration `completed` until validator is dispatched and observed outputs recorded (or explicit `blocked` with validator blockers).
29
31
  - Downstream artifacts mirrored in `intermediate_asset_record_updates`.
30
32
 
31
33
  ## Route Values
@@ -33,6 +35,16 @@ You do not run analyst, migrator, validator, analysis, migration, validation, or
33
35
  - `only_understand_ui` | `only_understand_logic` | `only_understand_architecture` | `only_understand_overview`
34
36
  - `migration` | `validation_handoff` | `unknown` (returns `blocked`)
35
37
 
38
+ ## Migration Route Downstream Sequence (mandatory)
39
+
40
+ When `route` is `migration`, `downstream_workflow_sequence` MUST be ordered:
41
+
42
+ 1. `android-project-analyst` — when fresh SPEC/`P6` evidence is missing or stale (migration mode).
43
+ 2. `android-to-kmp-migrator` — after analyst handoff when required.
44
+ 3. `kmp-test-validator` — **always required** after migrator produces `migration_report.*` / `V0` handoff evidence.
45
+
46
+ `validation_handoff` is a standalone route when the user asks only for validation with existing migration evidence. Route `migration` still includes validator in its own sequence — do not treat validator as optional for migration.
47
+
36
48
  ## Boundary
37
49
 
38
50
  **Forbidden**:
@@ -41,11 +53,13 @@ You do not run analyst, migrator, validator, analysis, migration, validation, or
41
53
  - `route` mode must not write orchestration or workspace artifacts.
42
54
  - `orchestrate` mode must not reclassify the route or issue final adapter status.
43
55
  - Do not invent missing downstream evidence.
56
+ - Do not omit `kmp-test-validator` from migration route sequence or orchestration.
44
57
 
45
58
  **Mandatory**:
46
59
 
47
60
  - Validate inputs; return `blocked` with `blocking_gaps` when required evidence is missing.
48
61
  - Write mode-specific artifacts under `output_dir`; verify non-empty before reporting status.
62
+ - For route `migration`, declare `validator_required: true` in route and orchestration artifacts.
49
63
 
50
64
  ## Output Schema — mode `route`
51
65
 
@@ -60,11 +74,16 @@ You do not run analyst, migrator, validator, analysis, migration, validation, or
60
74
  "understand_focus": "ui | logic | architecture | overview | mixed | none",
61
75
  "source_project_path": "",
62
76
  "target_project_path": "",
63
- "downstream_workflow_sequence": [],
77
+ "validator_required": false,
78
+ "downstream_workflow_sequence": [
79
+ { "workflow": "android-project-analyst | android-to-kmp-migrator | kmp-test-validator", "required": true, "reason": "" }
80
+ ],
64
81
  "blocking_gaps": []
65
82
  }
66
83
  ```
67
84
 
85
+ Set `validator_required: true` when `route` is `migration`.
86
+
68
87
  ## Output Schema — mode `orchestrate`
69
88
 
70
89
  ```json
@@ -74,7 +93,17 @@ You do not run analyst, migrator, validator, analysis, migration, validation, or
74
93
  "mode": "orchestrate",
75
94
  "task_id": "",
76
95
  "route": "",
77
- "downstream_sequence": [],
96
+ "validator_required": false,
97
+ "downstream_sequence": [
98
+ {
99
+ "workflow": "android-project-analyst | android-to-kmp-migrator | kmp-test-validator",
100
+ "required": true,
101
+ "dispatch_status": "planned | dispatched | completed | blocked | needs_rerun",
102
+ "expected_output_root": "",
103
+ "expected_artifacts": [],
104
+ "observed_outputs": []
105
+ }
106
+ ],
78
107
  "stage_inspection_requests": [],
79
108
  "intermediate_asset_record_updates": [],
80
109
  "rerun_requests": [],
@@ -82,7 +111,7 @@ You do not run analyst, migrator, validator, analysis, migration, validation, or
82
111
  }
83
112
  ```
84
113
 
85
- Shared return shape applies.
114
+ For route `migration`, `kmp-test-validator` entry MUST have `required: true` and `dispatch_status` other than `planned` only when migrator evidence is missing — otherwise dispatch and record observed outputs.
86
115
 
87
116
  ## Output Files
88
117
 
@@ -98,9 +127,12 @@ Write only under `output_dir` paths declared in the dispatch contract. Exact fil
98
127
  ROLE: task-route-orchestrator (mode: route | orchestrate).
99
128
 
100
129
  route: normalize task, classify route and focus, declare downstream sequence and blockers.
130
+ migration route MUST list analyst (if needed) -> migrator -> kmp-test-validator (required).
101
131
  orchestrate: build analyst/migrator/validator dispatch contracts; record expected and observed outputs.
132
+ migration route MUST dispatch kmp-test-validator after migrator V0/M6 evidence.
102
133
 
103
134
  INPUTS: mode, raw_user_task, paths, task_route_path (orchestrate), adapter_workspace_state_path (orchestrate), output_dir.
104
135
 
105
136
  Do not analyze source, migrate, validate, or write final report.
137
+ Do not skip kmp-test-validator for migration route.
106
138
  ```
@@ -17,7 +17,7 @@ graph TD
17
17
  TRO_O --> G1{Route}
18
18
  G1 --> APA[android-project-analyst variants]
19
19
  G1 --> MIG[migration: analyst then migrator]
20
- MIG --> KV[kmp-test-validator optional]
20
+ MIG --> KV[kmp-test-validator required]
21
21
  APA --> WS1[adapter-workspace-state]
22
22
  KV --> WS1
23
23
  MIG --> WS1
@@ -49,7 +49,7 @@ Validator artifacts are recorded under the validator's parallel `validation` roo
49
49
  | `only_understand_logic` | Android source, logic scope | analyst exploration, focus `logic` | Stage A + `behavior_logic.*`, SPEC |
50
50
  | `only_understand_architecture` | Android source | analyst exploration, focus `architecture` | `project_architecture.*`, SPEC |
51
51
  | `only_understand_overview` | Android source | analyst exploration | module inventory, representations, SPEC |
52
- | `migration` | source or SPEC, KMP target | analyst → migrator → validator optional | SPEC, `migration_report.*` |
52
+ | `migration` | source or SPEC, KMP target | analyst → migrator → **validator required** | SPEC, `migration_report.*`, `kmp_validation_report.*` |
53
53
  | `validation_handoff` | KMP target, migration report | validator | `kmp_validation_report.*` |
54
54
 
55
55
  ## Steps
@@ -74,7 +74,8 @@ Lock `output_root`; write `run_manifest.json` with task id, paths, scope, depend
74
74
 
75
75
  - **Executor**: `task-route-orchestrator` mode `orchestrate`
76
76
  - **Output**: `route-orchestration/orchestrate/workflow_orchestration.*`
77
- - **Gate**: downstream contracts and observed outputs recorded or blockers explicit
77
+ - **Action**: route `migration` MUST dispatch `kmp-test-validator` after migrator; record validator output root under parallel `validation` location
78
+ - **Gate**: downstream contracts and observed outputs recorded or blockers explicit; migration route incomplete without validator dispatch/evidence
78
79
 
79
80
  ### Step 4 — Stage gates
80
81
 
@@ -114,4 +115,5 @@ Lock `output_root`; write `run_manifest.json` with task id, paths, scope, depend
114
115
  - Every consumed artifact in `intermediate_asset_records.*` and downstream roots indexed in `downstream_workflow_index.*`.
115
116
  - `handoff_gates` in `adapter_workspace_state.json` accurately reflect [output-contract.md](output-contract.md) package readiness (`A0`–`A6`).
116
117
  - `adapter-report` runs only after fresh `pre_report` gate (`A5`).
118
+ - Route `migration` always dispatches `kmp-test-validator` after migrator; `post_validator` stage required before `pre_report`.
117
119
  - Final report cites verified paths; gaps listed, not filled in.