@code-migration/wow-migrator 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/android-to-kmp-migrator/SKILL.md +2 -2
- package/skills/android-to-kmp-migrator/output-contract.md +2 -2
- package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +90 -17
- package/skills/android-to-kmp-migrator/roles/module-implementation.md +97 -22
- package/skills/android-to-kmp-migrator/workflow.md +4 -3
- package/skills/kmp-test-validator/SKILL.md +2 -2
- package/skills/kmp-test-validator/output-contract.md +1 -1
- package/skills/kmp-test-validator/roles/validation-code-gate.md +82 -21
- package/skills/kmp-test-validator/workflow.md +1 -1
- package/skills/migration-task-adapter/SKILL.md +2 -1
- package/skills/migration-task-adapter/bind.md +1 -0
- package/skills/migration-task-adapter/dependencies.yaml +1 -1
- package/skills/migration-task-adapter/output-contract.md +6 -5
- package/skills/migration-task-adapter/roles/adapter-report.md +5 -5
- package/skills/migration-task-adapter/roles/adapter-workspace-state.md +1 -1
- package/skills/migration-task-adapter/roles/task-route-orchestrator.md +37 -5
- package/skills/migration-task-adapter/workflow.md +5 -3
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@ roles:
|
|
|
30
30
|
tools: [rg, curl]
|
|
31
31
|
- id: module-implementation
|
|
32
32
|
kind: ai_agent
|
|
33
|
-
purpose:
|
|
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:
|
|
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
|
|
@@ -270,7 +270,7 @@ Machine lookup: `migration_module_id` → `legacy_module_id`, `module_output_roo
|
|
|
270
270
|
|
|
271
271
|
### `global_system_integration.json`
|
|
272
272
|
|
|
273
|
-
`assembly_order`, `ui_transition_edges[]`, `control_logic_handoffs[]`, `data_call_edges[]`, `shared_contracts_applied[]`, `integration_changed_files[]
|
|
273
|
+
`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
274
|
|
|
275
275
|
### `post_integration_alignment.json` (analysis only — no target edits)
|
|
276
276
|
|
|
@@ -286,7 +286,7 @@ Combined `presentation` (tokens, resources, routes) and `state_data` (state/mode
|
|
|
286
286
|
|
|
287
287
|
### `module_implementation_ui.json` / `module_implementation_logic.json`
|
|
288
288
|
|
|
289
|
-
UI mode and logic mode outputs under `module-implementation/ui/` and `module-implementation/logic/` respectively.
|
|
289
|
+
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
290
|
|
|
291
291
|
### `alignment_report.json`
|
|
292
292
|
|
|
@@ -2,38 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
## Identity
|
|
4
4
|
|
|
5
|
-
> *"After all modules complete, I
|
|
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.
|
|
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 —
|
|
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
|
-
-
|
|
20
|
-
- `integration_changed_files`
|
|
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
|
-
##
|
|
106
|
+
## Output Files And Contents
|
|
72
107
|
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
```
|
|
@@ -2,40 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
## Identity
|
|
4
4
|
|
|
5
|
-
> *"I
|
|
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.
|
|
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
|
-
-
|
|
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
|
-
-
|
|
25
|
-
-
|
|
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
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
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
|
|
38
|
-
-
|
|
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
|
|
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
|
-
|
|
72
|
-
|
|
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,
|
|
75
|
-
|
|
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
|
|
155
|
+
Return mode, kmp_target_project_path, changed_files (target paths only), target_edit_summary.
|
|
156
|
+
Do NOT run full project build.
|
|
82
157
|
```
|
|
@@ -69,8 +69,8 @@ graph TD
|
|
|
69
69
|
| 5b | `migration-planning-gate` | Planning + dep/platform in one pass |
|
|
70
70
|
| 5c | `migration-prep` | Presentation + state/data in one pass |
|
|
71
71
|
| 5d | `module-node-review-fix` | After prep if file-changing |
|
|
72
|
-
| 5e | `module-implementation` `ui` |
|
|
73
|
-
| 5f | `module-implementation` `logic` |
|
|
72
|
+
| 5e | `module-implementation` `ui` | Edit/create target KMP UI files; then review/fix |
|
|
73
|
+
| 5f | `module-implementation` `logic` | Edit/create target KMP logic files after UI approved; then review/fix |
|
|
74
74
|
| 5g | `migration-verification` | Static + restoration; **no full build** |
|
|
75
75
|
| 5h | Leader | `module_completion_record.json` |
|
|
76
76
|
| 5i | `completion-report` `readiness` + module representation | Package **M3** |
|
|
@@ -82,7 +82,8 @@ Repeat until package **M4**.
|
|
|
82
82
|
### 6a Integrate
|
|
83
83
|
|
|
84
84
|
- **Role**: `global-migration-phase` `mode: integrate`
|
|
85
|
-
- **
|
|
85
|
+
- **Action**: edit target KMP cross-module glue (nav, DI, shared contracts) under `kmp_target_project_path`
|
|
86
|
+
- **Output**: `global-migration-phase/integrate/global_system_integration.*` with `integration_changed_files[]`
|
|
86
87
|
- **Gate**: package **M5**
|
|
87
88
|
|
|
88
89
|
### 6b Align
|
|
@@ -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 (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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/
|
|
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 `
|
|
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
|
-
- `
|
|
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
|
-
##
|
|
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
|
|
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
|
-
-
|
|
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
|
|
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
|
-
"
|
|
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`
|
|
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
|
|
109
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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` →
|
|
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:
|
|
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
|
|
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
|
|
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` —
|
|
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` —
|
|
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
|
-
-
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
- **
|
|
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.
|