@code-migration/wow-migrator 0.2.4 → 0.2.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.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/SKILL.md +7 -5
  3. package/skills/android-project-analyst/bind.md +1 -1
  4. package/skills/android-project-analyst/dependencies.yaml +11 -1
  5. package/skills/android-project-analyst/output-contract.md +18 -3
  6. package/skills/android-project-analyst/roles/analysis-workspace-state.md +11 -7
  7. package/skills/android-project-analyst/roles/data-contract-flow.md +80 -13
  8. package/skills/android-project-analyst/workflow.md +3 -2
  9. package/skills/android-to-kmp-migrator/SKILL.md +14 -12
  10. package/skills/android-to-kmp-migrator/bind.md +1 -0
  11. package/skills/android-to-kmp-migrator/dependencies.yaml +14 -0
  12. package/skills/android-to-kmp-migrator/output-contract.md +53 -8
  13. package/skills/android-to-kmp-migrator/roles/completion-report.md +1 -1
  14. package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +54 -0
  15. package/skills/android-to-kmp-migrator/roles/migration-prep.md +15 -3
  16. package/skills/android-to-kmp-migrator/roles/migration-verification.md +41 -6
  17. package/skills/android-to-kmp-migrator/roles/module-implementation.md +19 -4
  18. package/skills/android-to-kmp-migrator/workflow.md +9 -8
  19. package/skills/kmp-test-validator/SKILL.md +7 -5
  20. package/skills/kmp-test-validator/dependencies.yaml +10 -0
  21. package/skills/kmp-test-validator/output-contract.md +7 -4
  22. package/skills/kmp-test-validator/roles/validation-business-testing.md +15 -3
  23. package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +27 -2
  24. package/skills/kmp-test-validator/workflow.md +2 -2
  25. package/skills/migration-task-adapter/SKILL.md +5 -3
  26. package/skills/migration-task-adapter/dependencies.yaml +7 -0
  27. package/skills/operating-instructions/SKILL.md +55 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-migration/wow-migrator",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
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",
@@ -11,27 +11,27 @@ roles:
11
11
  - id: analysis-workspace-state
12
12
  kind: ai_agent
13
13
  purpose: Analysis ledger — module status, node output inventory, stale inputs, rerun/blocker history, artifact readiness, and next actions. No source analysis or SPEC writing.
14
- skills: []
14
+ skills: [operating-instructions]
15
15
  tools: [git]
16
16
  - id: presentation-resource
17
17
  kind: ai_agent
18
18
  purpose: Presentation and resource owner — screens, UI technologies, navigation, UI modules, local/remote image and media resources, safe downloads, and UI/resource migration implications.
19
- skills: []
19
+ skills: [operating-instructions]
20
20
  tools: [rg, curl]
21
21
  - id: project-architecture
22
22
  kind: ai_agent
23
23
  purpose: Project architecture owner — Gradle/module topology, architecture style, layer roles, dependency ecosystem, Jetpack/DI/platform services, generated tooling, and Android-only constraints.
24
- skills: []
24
+ skills: [operating-instructions]
25
25
  tools: [rg]
26
26
  - id: data-contract-flow
27
27
  kind: ai_agent
28
28
  purpose: Data contract and flow owner — network/local data contracts, models, consumers, repositories, streams, transformations, cache/error/pagination, write-back, and UI state propagation.
29
- skills: []
29
+ skills: [operating-instructions]
30
30
  tools: [rg]
31
31
  - id: behavior-logic
32
32
  kind: ai_agent
33
33
  purpose: Behavior and control-flow owner — user actions, lifecycle, state holders, business rules, side effects, state machines, navigation effects, gates, and cross-module interactions.
34
- skills: []
34
+ skills: [operating-instructions]
35
35
  tools: [rg]
36
36
  ---
37
37
 
@@ -41,6 +41,8 @@ This is the agent-facing registry and team definition for the `android-project-a
41
41
 
42
42
  **Canonical file recording system**: [output-contract.md](output-contract.md) defines every output path, required content, write order, and downstream **handoff package gates** (`P0`–`P6`). Downstream handlers (`migration-task-adapter`, `android-to-kmp-migrator`, `kmp-test-validator`) trigger only when the declared package artifacts exist, are non-empty, in-path, and not stale. The Leader MUST read `output-contract.md` before the first dispatch and MUST NOT claim completion without updating `handoff_gates` in the workspace ledger and `SPEC/verification.md`.
43
43
 
44
+ **Baseline operating instructions**: [../operating-instructions/SKILL.md](../operating-instructions/SKILL.md) is the shared conduct layer for this skill and every dispatched analyst role. The Leader MUST read it before pre-flight/module partitioning and include it in each role dispatch as baseline instructions; role files, workflow gates, and output contracts add to it, not replace it.
45
+
44
46
  The team is **module-first Mixed B+C with a workspace-state ledger**: the Leader partitions the project into `analysis_modules`, writes index artifacts and one `modules/<module_id>/` folder per module, maintains `analysis-workspace-state` before downstream consumption, runs three foundation nodes in **parallel** (B) inside each module, then a final **gated specialization** node (C) synthesizes module behavior from verified upstream outputs. The Leader writes a module representation per module, records cross-module architecture and data/logic separately under `global/`, then combines everything into `global_representation.*` and SPEC. The controller owns routing, strict output-path enforcement, reconciliation, workspace-state refreshes, and SPEC integration; nodes own bounded module analysis only.
45
47
 
46
48
  ## Module Partitioning Model
@@ -22,7 +22,7 @@ Team-level rules — distinct from each role's own `## Boundary`.
22
22
  - **Foundation slices, dispatch-time fixed (B-pattern, Stage A)**: each foundation node works ONLY on its assigned slice. Slices are fixed at dispatch and are not renegotiated between nodes; nodes do not see each other's working state during Stage A.
23
23
  - **Gated handoff, no upstream mutation (C-pattern, Stage B)**: `behavior-logic` references upstream node outputs (by path) and enriches only where behavior analysis requires; it MUST NOT rebuild or overwrite an upstream node's catalog. If upstream data is missing/stale, it returns `needs_rerun`/`blocked` rather than reconstructing it.
24
24
  - **Mandatory contract enforcement**: every node is dispatched with a complete module-scoped contract (`source_project_path`, `module_id`, `module_scope`, `module_brief_path`, required upstream artifacts, `analysis_scope`, `skill_spec_path`, exact `output_dir`). The Leader rejects any return that lacks required JSON/MD artifacts, omits produced files from `output_files`, writes outside the assigned path, or claims `completed`/`ready_*` without proven output storage.
25
- - **Role-output content discipline**: required artifacts must contain the content owned by their role, not just the correct filename. For example, `presentation_resource.*` must contain screens/resources/navigation/UI-tree evidence with `tree_text` in Required Markdown shape (`tree_text_format: required-markdown-v1`) for every checked screen; `module_representation.json` must promote those trees verbatim into `presentation_slice.ui_layout_view_trees[]`; `module_ui_representation.md` must contain the same trees as the standalone UI handoff; `project_architecture.*` must contain topology/build/dependency/platform evidence, `data_contract_flow.*` must contain APIs/data-source/model/flow evidence, and `behavior_logic.*` must contain action/lifecycle/rule/control-flow evidence. If content belongs to another role, rerun or route rather than accepting it.
25
+ - **Role-output content discipline**: required artifacts must contain the content owned by their role, not just the correct filename. For example, `presentation_resource.*` must contain screens/resources/navigation/UI-tree evidence with `tree_text` in Required Markdown shape (`tree_text_format: required-markdown-v1`) for every checked screen; `module_representation.json` must promote those trees verbatim into `presentation_slice.ui_layout_view_trees[]`; `module_ui_representation.md` must contain the same trees as the standalone UI handoff; `project_architecture.*` must contain topology/build/dependency/platform evidence; `data_contract_flow.*` must contain APIs/data-source/model/flow evidence; `data_flow_tracker_report.*` must record handler-step coverage, follow-ups, and links to `data_contract_flow.*`; and `behavior_logic.*` must contain action/lifecycle/rule/control-flow evidence. If content belongs to another role, rerun or route rather than accepting it.
26
26
  - **Conflict handling**: when nodes disagree on a fact affecting architecture, data flow, resources, ecosystem constraints, behavior, or migration, the Leader surfaces it verbatim as `Needs confirmation` in `verification.md`. The Leader does NOT silently pick a winner or average findings.
27
27
  - **No source modification**: no node and not the Leader may edit the analyzed Android project. `presentation-resource` writes downloads only under `<output_dir>/node-results/presentation-resource/downloaded_resources/` and never stores secrets/cookies/tokens.
28
28
  - **Agent-only artifacts**: node outputs and SPEC files are structured for downstream agents/controllers, not human presentation; any user-facing summary is produced only after durable artifacts exist.
@@ -5,7 +5,17 @@
5
5
  # Android Studio MCP is optional auxiliary evidence for the Legacy Android source project —
6
6
  # it never replaces durable node artifacts or handoff package gates (P0–P6).
7
7
 
8
- skills: [] # No local domain-specific skill packages required for active roles.
8
+ skills:
9
+ - name: operating-instructions
10
+ required: true
11
+ used_by:
12
+ - Leader
13
+ - analysis-workspace-state
14
+ - presentation-resource
15
+ - project-architecture
16
+ - data-contract-flow
17
+ - behavior-logic
18
+ purpose: Shared baseline conduct layer loaded before analyst pre-flight, module partitioning, node dispatch, evidence synthesis, and final handoff work.
9
19
 
10
20
  optional_mcp:
11
21
  - server: jetbrains
@@ -33,6 +33,8 @@ output_root = <output_dir or ~/.a2c_agents/understand>/android-project-analyst
33
33
  │ │ │ ├── project_architecture.json
34
34
  │ │ │ └── project_architecture.md
35
35
  │ │ ├── data-contract-flow/
36
+ │ │ │ ├── data_flow_tracker_report.json
37
+ │ │ │ ├── data_flow_tracker_report.md
36
38
  │ │ │ ├── data_contract_flow.json
37
39
  │ │ │ └── data_contract_flow.md
38
40
  │ │ └── behavior-logic/
@@ -162,6 +164,8 @@ Artifacts MUST be produced in this order. Skipping a layer invalidates downstrea
162
164
  | `modules/<module_id>/node-results/presentation-resource/presentation_resource.json` | `presentation-resource` | `module_id`, `screen_inventory`, `ui_layout_view_trees[]` (each with non-empty `tree_text` in `tree_text_format: required-markdown-v1` when `representation_promotion_ready: true`), `navigation_edges`, `cross_module_references[]`, `resource_usage_map`, `representation_promotion`, `evidence_paths` | UI understanding, resource migration, navigation handoff, representation promotion |
163
165
  | `modules/<module_id>/node-results/project-architecture/project_architecture.json` | `project-architecture` | `module_id`, `module_topology`, `detected_patterns`, `layer_roles`, `cross_module_dependencies[]`, `migration_constraints`, `evidence_paths` | Architecture migration, dependency/platform gate |
164
166
  | `modules/<module_id>/node-results/data-contract-flow/data_contract_flow.json` | `data-contract-flow` | `module_id`, API/model contracts, `end_to_end_flows`, `cross_module_data_links[]`, `evidence_paths` | Data/API migration, repository mapping |
167
+ | `modules/<module_id>/node-results/data-contract-flow/data_flow_tracker_report.json` | `data-contract-flow` | `module_id`, `handler_steps[]`, `coverage_summary`, `follow_ups[]`, `blocking_gaps`, `linked_artifacts` | Investigation coverage gate, workspace ledger, rerun routing |
168
+ | `modules/<module_id>/node-results/data-contract-flow/data_flow_tracker_report.md` | `data-contract-flow` | Step coverage table, coverage summary, open follow-ups, blockers | Agent-readable investigation handoff |
165
169
  | `modules/<module_id>/node-results/behavior-logic/behavior_logic.json` | `behavior-logic` | `module_id`, `screen_logic`, `control_flows`, `cross_module_interactions[]`, upstream alignment refs | Behavior/test planning, control-flow migration |
166
170
  | `modules/<module_id>/dimension_index.json` | Leader | `module_id`, `dimensions{}` with four entries, each with `node_id`, `output_dir`, `json_path`, `md_path`, `status` | **Per-module completeness gate** — handlers verify all four dimensions before consuming representation |
167
171
  | `modules/<module_id>/representation/module_representation.json` | Leader | `module_id`, `ui_representation_md_path`, `dimension_traceability[]`, `presentation_slice.ui_layout_view_trees[]` (verbatim `tree_text` from `presentation_resource.json`), synthesized slices per dimension, `intra_module_gaps`, `readiness` | **Module-level handoff** — migrator loads this for a scoped `module_id` |
@@ -277,14 +281,23 @@ Rules:
277
281
  "evidence_count": 0
278
282
  },
279
283
  "project-architecture": { },
280
- "data-contract-flow": { },
284
+ "data-contract-flow": {
285
+ "node_id": "data-contract-flow",
286
+ "output_dir": "",
287
+ "json_path": "",
288
+ "md_path": "",
289
+ "tracker_json_path": "",
290
+ "tracker_md_path": "",
291
+ "status": "completed | blocked | missing",
292
+ "evidence_count": 0
293
+ },
281
294
  "behavior-logic": { }
282
295
  },
283
296
  "representation_ready": false
284
297
  }
285
298
  ```
286
299
 
287
- Each dimension entry MUST have resolvable `json_path` and `md_path` before `representation_ready` is true.
300
+ Each dimension entry MUST have resolvable `json_path` and `md_path` before `representation_ready` is true. The `data-contract-flow` entry MUST also have resolvable `tracker_json_path` and `tracker_md_path`.
288
301
 
289
302
  ### Cross-module global records (migration assembly basis)
290
303
 
@@ -364,8 +377,9 @@ Downstream handlers MUST NOT start unless the declared package gate passes. A ga
364
377
  | `modules/<module_id>/module_brief.json` |
365
378
  | `modules/<module_id>/dimension_index.json` (all four dimensions `status: completed`) |
366
379
  | all four dimension JSON+MD pairs under `node-results/<dimension>/` |
380
+ | `modules/<module_id>/node-results/data-contract-flow/data_flow_tracker_report.json` and `.md` |
367
381
 
368
- **Fail closed when**: any dimension is `missing`, `blocked`, or paths in `dimension_index.json` do not resolve.
382
+ **Fail closed when**: any dimension is `missing`, `blocked`, or paths in `dimension_index.json` do not resolve; `data-contract-flow` tracker report is missing, empty, or `handler_steps` do not cover all eleven investigation steps.
369
383
 
370
384
  ### Package `P3` — Module representation handoff
371
385
 
@@ -440,6 +454,7 @@ Every node MUST:
440
454
  - Use exact filenames from this contract (JSON snake_case basename, dimension folder kebab-case).
441
455
  - Include `module_id` in every dimension JSON artifact.
442
456
  - Populate cross-module pointer arrays (`cross_module_references`, `cross_module_dependencies`, `cross_module_data_links`, `cross_module_interactions`) with `target_module_id` and `source_paths` so the Leader can build Package `P4` without re-reading source.
457
+ - `data-contract-flow` MUST write and maintain `data_flow_tracker_report.*` during investigation and list all four output files in `output_files`.
443
458
 
444
459
  ## Invalid Artifact Handling (downstream uniform rule)
445
460
 
@@ -10,7 +10,7 @@ You are the `analysis-workspace-state` node subagent dispatched by the `android-
10
10
 
11
11
  - `analysis_workspace_state.json` and `analysis_workspace_state.md` written under `output_dir`, both non-empty.
12
12
  - Every known analysis module and node output is normalized into one ledger.
13
- - Stale inputs are flagged when module briefs, node outputs, module representations, global representation, SPEC paths, source roots, or analysis requirements changed since a dependent artifact was produced.
13
+ - Stale inputs are flagged when module briefs, node outputs, data-flow investigation tracker reports, module representations, global representation, SPEC paths, source roots, or analysis requirements changed since a dependent artifact was produced.
14
14
  - Rerun and blocker history are recorded without hiding repeated failures.
15
15
  - Next safe controller actions are listed.
16
16
  - `handoff_gates` for packages `P0`–`P6` per [output-contract.md](../output-contract.md) are evaluated with `ready` flags and `missing_paths[]`.
@@ -70,7 +70,7 @@ Write only under `output_dir = <output_root>/workspace-state/`. Evaluate handoff
70
70
  ## Output Files And Contents
71
71
 
72
72
  - `analysis_workspace_state.json`: machine-routable ledger of run mode, current controller step, module statuses, node output statuses, artifact inventory, stale upstream inputs, rerun history, blocking gaps, `handoff_gates` (`P0`–`P6` per [output-contract.md](../output-contract.md)), and next safe actions. It must not include UI, architecture, data-flow, or behavior analysis.
73
- - `analysis_workspace_state.md`: agent-readable ledger handoff with module status table, dimension output inventory per `module_id`, `modules_index.json` and `dimension_index.json` readiness, cross-module global record status, artifact readiness table, stale-input table, rerun/blocker history, and next controller action. It must preserve exact artifact paths and owner nodes.
73
+ - `analysis_workspace_state.md`: agent-readable ledger handoff with module status table, dimension output inventory per `module_id`, data-flow investigation tracker status per module, `modules_index.json` and `dimension_index.json` readiness, cross-module global record status, artifact readiness table, stale-input table, rerun/blocker history, and next controller action. It must preserve exact artifact paths and owner nodes.
74
74
 
75
75
  ## Inline Persona for Teammate
76
76
 
@@ -114,13 +114,17 @@ INPUTS YOU WILL RECEIVE:
114
114
  HANDLER (how you process):
115
115
  1. Normalize module status and node output status for every known analysis module.
116
116
  2. Track artifact inventory for run manifest, module inventory, modules_index.json, module briefs,
117
- dimension outputs, dimension_index.json, module representations, cross-module global records,
117
+ dimension outputs (including `data-contract-flow` `data_flow_tracker_report.*` plus
118
+ `data_contract_flow.*`), dimension_index.json, module representations, cross-module global records,
118
119
  global representation, and SPEC outputs.
119
- 3. Detect stale upstream inputs when source roots, module briefs, node outputs, representations, or
120
+ 3. For each `data-contract-flow` module output, record tracker report paths, `handler_steps`
121
+ completion summary, open `follow_ups`, and `blocking_gaps`; flag stale when tracker and
122
+ `data_contract_flow.*` are out of sync or tracker is missing.
123
+ 4. Detect stale upstream inputs when source roots, module briefs, node outputs, representations, or
120
124
  SPEC inputs changed after dependent artifacts were produced.
121
- 4. Record rerun and blocker history without hiding repeated failures.
122
- 5. Evaluate handoff packages P0–P6 from output-contract.md; set ready flags and missing_paths.
123
- 6. Identify the next safe controller action.
125
+ 5. Record rerun and blocker history without hiding repeated failures.
126
+ 6. Evaluate handoff packages P0–P6 from output-contract.md; set ready flags and missing_paths.
127
+ 7. Identify the next safe controller action.
124
128
 
125
129
  OUTPUTS (write under output_dir, exact names):
126
130
  - analysis_workspace_state.json (machine ledger: module/node/artifact status, stale inputs, reruns, blockers, next actions)
@@ -8,7 +8,8 @@ You are the `data-contract-flow` node subagent and data contract/flow owner disp
8
8
 
9
9
  ## Success Criteria
10
10
 
11
- - `data_contract_flow.json` and `data_contract_flow.md` written under the assigned module-scoped `output_dir`, both non-empty.
11
+ - `data_contract_flow.json`, `data_contract_flow.md`, `data_flow_tracker_report.json`, and `data_flow_tracker_report.md` written under the assigned module-scoped `output_dir`, all non-empty.
12
+ - `data_flow_tracker_report.*` records investigation-step coverage, follow-ups, and links to the final flow artifacts.
12
13
  - The output includes the exact `module_id` and stays within `module_scope`.
13
14
  - Every API entry has a service class/function or is listed as dynamic/unknown.
14
15
  - Every API entry and major data-source claim has at least one source path.
@@ -33,7 +34,8 @@ You are the `data-contract-flow` node subagent and data contract/flow owner disp
33
34
  - You MUST validate inputs and scope before work (`module_id` present, `module_scope` in-bounds, and `module_brief_path` exists); on missing/stale/contradictory/out-of-scope inputs, stop and return `blocked` or `needs_rerun` with precise `blocking_gaps`.
34
35
  - You MUST attach a source path to every endpoint, major data source, repository flow, transformation, and end-to-end flow.
35
36
  - You MUST record dynamic/generated/unavailable APIs in `dynamic_or_unknown_apis` instead of guessing.
36
- - You MUST write `data_contract_flow.json` and `data_contract_flow.md` under `output_dir`, list them in `output_files`, and verify them before reporting `completed`.
37
+ - You MUST maintain `data_flow_tracker_report.json` and `data_flow_tracker_report.md` throughout investigation update step coverage and follow-ups as you work, then finalize before completion.
38
+ - You MUST write all four artifacts under `output_dir`, list them in `output_files`, and verify they exist and are non-empty before reporting `completed`.
37
39
 
38
40
  ## Output Schema
39
41
 
@@ -88,6 +90,54 @@ You are the `data-contract-flow` node subagent and data contract/flow owner disp
88
90
  }
89
91
  ```
90
92
 
93
+ #### `data_flow_tracker_report.json` (investigation tracker — write/update during analysis)
94
+
95
+ Machine-routable progress ledger for the data-flow investigation. Update as handler steps complete; finalize when `data_contract_flow.*` is written.
96
+
97
+ ```json
98
+ {
99
+ "status": "in_progress | completed | blocked",
100
+ "node": "data-contract-flow",
101
+ "module_id": "",
102
+ "investigation_started_at": "",
103
+ "investigation_completed_at": "",
104
+ "linked_artifacts": {
105
+ "data_contract_flow_json": "data_contract_flow.json",
106
+ "data_contract_flow_md": "data_contract_flow.md"
107
+ },
108
+ "handler_steps": [
109
+ {
110
+ "step_id": "scope_and_cross_module_links | network_stack | api_declarations | api_consumers | local_data_sources | models_and_mappings | repository_layers | reactive_propagation | transformations_writeback | loading_error_empty | record_unknowns",
111
+ "step_number": 0,
112
+ "status": "pending | in_progress | completed | partial | blocked | skipped",
113
+ "items_investigated": 0,
114
+ "items_pending": 0,
115
+ "follow_ups": [],
116
+ "evidence_paths": []
117
+ }
118
+ ],
119
+ "coverage_summary": {
120
+ "apis": { "total": 0, "investigated": 0, "unknown": 0 },
121
+ "data_sources": { "total": 0, "investigated": 0, "unknown": 0 },
122
+ "repository_flows": { "total": 0, "investigated": 0, "unknown": 0 },
123
+ "reactive_streams": { "total": 0, "investigated": 0, "unknown": 0 },
124
+ "end_to_end_flows": { "total": 0, "investigated": 0, "unknown": 0 }
125
+ },
126
+ "follow_ups": [
127
+ {
128
+ "id": "",
129
+ "area": "",
130
+ "description": "",
131
+ "reason": "",
132
+ "blocking": false,
133
+ "owner": "data-contract-flow | behavior-logic | Leader",
134
+ "source_paths": []
135
+ }
136
+ ],
137
+ "blocking_gaps": []
138
+ }
139
+ ```
140
+
91
141
  ## Output Path Contract
92
142
 
93
143
  Write only under `output_dir = <output_root>/modules/<module_id>/node-results/data-contract-flow/`. Exact filenames and downstream trigger role: [output-contract.md](../output-contract.md) § Per-module dispatch and dimensions. Out-of-path artifacts invalidate package `P2`.
@@ -96,6 +146,8 @@ Write only under `output_dir = <output_root>/modules/<module_id>/node-results/da
96
146
 
97
147
  - `data_contract_flow.json`: machine-routable data contract/flow artifact containing network stack, API declarations, request/response/model contracts, local/generated/platform data sources, model mappings, repository flows, reactive streams, transformations, end-to-end flows, dynamic/unknown APIs, cross-module data links, gaps, assumptions, and evidence paths.
98
148
  - `data_contract_flow.md`: agent-readable data handoff containing network stack overview, API endpoint table, consumer mapping table, local/generated/platform data-source inventory, model mapping notes, repository & mapper flow tables, reactive stream summary, end-to-end Mermaid flow diagrams when evidence allows, loading/error/empty handling summary, dynamic or unknown API gaps, gaps, and assumptions.
149
+ - `data_flow_tracker_report.json`: machine-routable investigation tracker — handler-step status, coverage counts, follow-ups, blocking gaps, and links to `data_contract_flow.*`.
150
+ - `data_flow_tracker_report.md`: agent-readable investigation handoff — step coverage table, coverage summary, open follow-ups, and blockers. Update during analysis; finalize when flow artifacts are complete.
99
151
 
100
152
  ## Inline Persona for Teammate
101
153
 
@@ -113,7 +165,9 @@ CONTROL — validate before you act, verify before you report:
113
165
  and module_brief_path exists. On missing / stale / contradictory / out-of-scope inputs, STOP
114
166
  and return status "blocked" or "needs_rerun" with precise blocking_gaps. Do not guess or
115
167
  broaden scope.
116
- - Write outputs ONLY under output_dir; do not report "completed" until both files exist,
168
+ - Initialize data_flow_tracker_report.* at investigation start; refresh step coverage and
169
+ follow_ups as handler steps complete.
170
+ - Write outputs ONLY under output_dir; do not report "completed" until all four files exist,
117
171
  are non-empty, and are verified.
118
172
 
119
173
  You MUST attach a source path to every endpoint, data source, repository flow, transformation,
@@ -137,28 +191,41 @@ INPUTS YOU WILL RECEIVE:
137
191
  - optional jetbrains MCP context (indexed search / symbol info): {MCP_CONTEXT}
138
192
 
139
193
  HANDLER (how you process):
194
+ 0. Create data_flow_tracker_report.json and .md with status in_progress, module_id,
195
+ investigation_started_at, empty handler_steps aligned to steps 1–11 below, and
196
+ coverage_summary initialized to zero.
140
197
  1. Stay inside module_scope; record cross-module data dependencies as cross_module_data_links with target_module_id and source_paths — these feed global/cross_module_data_logic.* during Leader integration
141
- without analyzing target modules here.
198
+ without analyzing target modules here. Update tracker step scope_and_cross_module_links.
142
199
  2. Identify network stack (Retrofit/OkHttp/Ktor/Volley/GraphQL/custom/generated clients).
200
+ Update tracker step network_stack.
143
201
  3. Catalog API service declarations (path, method, function, service class, request/response
144
- types, annotations).
202
+ types, annotations). Update tracker step api_declarations and coverage_summary.apis.
145
203
  4. Catalog API and data consumers (repositories, data sources, use cases, ViewModels, presenters,
146
- loaders, workers).
204
+ loaders, workers). Update tracker step api_consumers.
147
205
  5. Catalog local/generated/platform data sources (Room/SQLite/DataStore/SharedPreferences/files/
148
- ContentProvider/in-memory caches/Worker outputs/generated API or DB code).
206
+ ContentProvider/in-memory caches/Worker outputs/generated API or DB code). Update tracker step
207
+ local_data_sources and coverage_summary.data_sources.
149
208
  6. Catalog models and mappings (request/response DTOs, entities, domain models, UI state models,
150
- pagination/error wrappers).
209
+ pagination/error wrappers). Update tracker step models_and_mappings.
151
210
  7. Trace repository & data-source layers (interfaces, implementations, mappers, cache policies,
152
- paging sources, loaders, data managers).
211
+ paging sources, loaders, data managers). Update tracker step repository_layers and
212
+ coverage_summary.repository_flows.
153
213
  8. Trace reactive propagation (LiveData/StateFlow/Flow/Rx/callbacks/event-bus/observable fields/
154
- Compose state).
214
+ Compose state). Update tracker step reactive_propagation and coverage_summary.reactive_streams.
155
215
  9. Trace transformations and write-back paths (action→validation→repo/API/local write→cache
156
- invalidation→UI update).
216
+ invalidation→UI update). Update tracker step transformations_writeback.
157
217
  10. Identify loading/error/empty paths, retry/refresh, cache invalidation, pagination, and gaps.
218
+ Update tracker step loading_error_empty.
158
219
  11. Record unknowns (dynamic endpoint construction, generated code absent, remote schema
159
- unavailable, unclear consumers).
220
+ unavailable, unclear consumers). Update tracker step record_unknowns; add non-blocking items to
221
+ follow_ups and blocking items to blocking_gaps.
222
+ 12. Write data_contract_flow.json and .md from verified findings; finalize tracker with status
223
+ completed, investigation_completed_at, linked_artifacts paths, and reconciled coverage_summary
224
+ counts vs data_contract_flow.json.
160
225
 
161
226
  OUTPUTS (write under output_dir, exact names):
227
+ - data_flow_tracker_report.json (investigation tracker: handler-step coverage, follow-ups, blockers)
228
+ - data_flow_tracker_report.md (agent handoff: step table, coverage summary, follow-ups, blockers)
162
229
  - data_contract_flow.json (machine artifact: APIs, data sources, models, mappings, repository/reactive/end-to-end flows, gaps, evidence)
163
230
  - data_contract_flow.md (agent handoff: endpoint/source/consumer tables, flow diagrams, loading/error/empty behavior, unknowns)
164
231
 
@@ -167,7 +234,7 @@ RETURN TO CONTROLLER (exactly this shape, no preamble):
167
234
  "status": "completed",
168
235
  "node": "data-contract-flow",
169
236
  "summary": "short summary",
170
- "output_files": ["data_contract_flow.json", "data_contract_flow.md"],
237
+ "output_files": ["data_flow_tracker_report.json", "data_flow_tracker_report.md", "data_contract_flow.json", "data_contract_flow.md"],
171
238
  "key_findings": [],
172
239
  "blocking_gaps": []
173
240
  }
@@ -126,8 +126,9 @@ No node may choose its own output path. `presentation-resource` may write downlo
126
126
  - `presentation_resource.json`, `presentation_resource.md`: UI entry points, screen inventory, checked UI layout/view trees (`tree_text` in Required Markdown shape, `representation_promotion_ready`), navigation, presentation modules, resources, safe downloads, usage map, migration implications, gaps.
127
127
  - `project_architecture.json`, `project_architecture.md`: build/SDK config, topology, architecture patterns, layer roles, dependencies, Jetpack/DI/platform/generated usage, boundary risks, migration constraints.
128
128
  - `data_contract_flow.json`, `data_contract_flow.md`: network/local data contracts, APIs, models, data sources, mappings, repository/reactive/end-to-end flows, loading/error/empty behavior, dynamic API gaps.
129
+ - `data_flow_tracker_report.json`, `data_flow_tracker_report.md`: investigation-step coverage, coverage counts, follow-ups, blockers, and links to the flow artifacts above.
129
130
  - **Serial / Parallel**: parallel within one module — all three run together for the same `module_id`. Do not start the next module until the current module representation is written unless the user explicitly allows concurrent modules.
130
- - **Quality gate**: each return must be `status: "completed"` with `output_files` that exist and are non-empty. Refresh `analysis-workspace-state` after the group; on missing/empty/non-`completed`/stale output → re-dispatch that node with the same contract plus the failure reason (retry policy in [bind.md](bind.md) § Failure Handling). Do NOT synthesize around a failed node.
131
+ - **Quality gate**: each return must be `status: "completed"` with `output_files` that exist and are non-empty. For `data-contract-flow`, require `data_flow_tracker_report.*` in addition to `data_contract_flow.*`. Refresh `analysis-workspace-state` after the group; on missing/empty/non-`completed`/stale output → re-dispatch that node with the same contract plus the failure reason (retry policy in [bind.md](bind.md) § Failure Handling). Do NOT synthesize around a failed node.
131
132
 
132
133
  ### Step 5 — Stage B per module: dispatch behavior logic node (gated handoff, C-pattern)
133
134
 
@@ -142,7 +143,7 @@ No node may choose its own output path. `presentation-resource` may write downlo
142
143
 
143
144
  - **Executor**: Leader
144
145
  - **Input**: verified dimension JSON/MD outputs for one `module_id`
145
- - **Action**: write `dimension_index.json` mapping the four analysis dimensions to their verified artifact paths and status. Then integrate ONLY from verified dimension outputs for that module. Write a module representation that covers both UI and logic when present: module purpose, UI surface, resources, architecture/ecosystem, data contracts/flows, behavior logic, dimension traceability index, intra-module dependencies, risks, gaps, evidence index, and readiness. **Promote presentation UI trees**: copy every `presentation_resource.json` → `ui_layout_view_trees[]` item with `representation_promotion_ready: true` verbatim into `module_representation.json` → `presentation_slice.ui_layout_view_trees[]` (`tree_text`, `tree_text_format: required-markdown-v1`, screen/section metadata, `dimension_source_path`); write the same trees into independent `module_ui_representation.md` under `## UI Layout Trees` (Required Markdown shape in ` ```text ` fences per screen/section). Set `ui_representation_md_path` in JSON; `module_representation.md` links to the UI file — no duplicate tree blocks. Record cross-module references as pointers only; do not synthesize full inter-module graphs here.
146
+ - **Action**: write `dimension_index.json` mapping the four analysis dimensions to their verified artifact paths and status. For `data-contract-flow`, include `tracker_json_path` and `tracker_md_path` pointing at `data_flow_tracker_report.*`. Then integrate ONLY from verified dimension outputs for that module. Write a module representation that covers both UI and logic when present: module purpose, UI surface, resources, architecture/ecosystem, data contracts/flows, behavior logic, dimension traceability index, intra-module dependencies, risks, gaps, evidence index, and readiness. **Promote presentation UI trees**: copy every `presentation_resource.json` → `ui_layout_view_trees[]` item with `representation_promotion_ready: true` verbatim into `module_representation.json` → `presentation_slice.ui_layout_view_trees[]` (`tree_text`, `tree_text_format: required-markdown-v1`, screen/section metadata, `dimension_source_path`); write the same trees into independent `module_ui_representation.md` under `## UI Layout Trees` (Required Markdown shape in ` ```text ` fences per screen/section). Set `ui_representation_md_path` in JSON; `module_representation.md` links to the UI file — no duplicate tree blocks. Record cross-module references as pointers only; do not synthesize full inter-module graphs here.
146
147
  - **Output**: `dimension_index.json`, `module_representation.json`, `module_representation.md`, `module_ui_representation.md`. `dimension_index.json` is the per-module dimension lookup. Module representation JSON is the module-level synthesis and traceability index; `module_ui_representation.md` is the standalone UI handoff; `module_representation.md` is the full-module agent-readable summary. All must cite verified dimension artifacts and source evidence; presentation trees MUST use Required Markdown shape from [roles/presentation-resource.md](roles/presentation-resource.md).
147
148
  - **Serial / Parallel**: serial
148
149
  - **Quality gate**: `dimension_index.json` lists all four dimensions with resolvable paths; no unknowns hidden; every module representation points to its dimension artifacts and source evidence; every `representation_promotion_ready: true` UI tree from `presentation_resource.json` appears verbatim in `presentation_slice.ui_layout_view_trees[]` and in `module_ui_representation.md`. Refresh workspace state after writing. Do not proceed to cross-module global records until every scheduled module is represented or explicitly marked blocked/out of scope.
@@ -11,47 +11,47 @@ roles:
11
11
  - id: migration-workspace-state
12
12
  kind: ai_agent
13
13
  purpose: Migration ledger — handoff gates M0–V0, plan-vs-code gaps, stale outputs, rerun hooks. No code edits.
14
- skills: []
14
+ skills: [operating-instructions]
15
15
  tools: [git]
16
16
  - id: target-project-assistant
17
17
  kind: ai_agent
18
18
  purpose: Target KMP owner — global baseline, per-module anchors, alignment revision, consult log.
19
- skills: []
19
+ skills: [operating-instructions]
20
20
  tools: [rg]
21
21
  - id: migration-planning-gate
22
22
  kind: ai_agent
23
23
  purpose: Planning and dependency/platform gate — SPEC deltas, source-to-target map, capability map, ready_for_implementation.
24
- skills: []
24
+ skills: [operating-instructions]
25
25
  tools: [rg]
26
26
  - id: migration-prep
27
27
  kind: ai_agent
28
28
  purpose: Presentation and state/data prep — tokens, resources, routes, state/models/API expectations.
29
- skills: []
29
+ skills: [operating-instructions]
30
30
  tools: [rg, curl]
31
31
  - id: module-implementation
32
32
  kind: ai_agent
33
33
  purpose: Target KMP module implementation by mode — edit/create KMP UI files first, then logic after UI approval.
34
- skills: []
34
+ skills: [operating-instructions]
35
35
  tools: [rg]
36
36
  - id: module-node-review-fix
37
37
  kind: ai_agent
38
38
  purpose: Review or scoped fix by mode; fresh re-review after every fix.
39
- skills: []
39
+ skills: [operating-instructions]
40
40
  tools: [rg, git]
41
41
  - id: migration-verification
42
42
  kind: ai_agent
43
- purpose: Module static checks + UI/logic restoration vs analyst — no full project build.
44
- skills: []
43
+ purpose: Module static checks + UI/logic/analytics (埋点) restoration vs analyst — no full project build.
44
+ skills: [operating-instructions]
45
45
  tools: [rg, git]
46
46
  - id: global-migration-phase
47
47
  kind: ai_agent
48
48
  purpose: Target KMP global integrate (edit cross-module glue + entry point wiring) then align (read-only analyst vs target comparison incl. entry points) by mode.
49
- skills: []
49
+ skills: [operating-instructions]
50
50
  tools: [rg]
51
51
  - id: completion-report
52
52
  kind: ai_agent
53
53
  purpose: Readiness and migration_report modes; validation handoff to kmp-test-validator.
54
- skills: []
54
+ skills: [operating-instructions]
55
55
  tools: [rg, git]
56
56
  ---
57
57
 
@@ -61,6 +61,8 @@ Module-first migrator for Legacy Android → KMP target assembly. **Upstream ana
61
61
 
62
62
  **Canonical contract**: [output-contract.md](output-contract.md)
63
63
 
64
+ **Baseline operating instructions**: [../operating-instructions/SKILL.md](../operating-instructions/SKILL.md) is the shared conduct layer for this skill and every dispatched migrator role. The Leader MUST read it before pre-flight and include it in each role dispatch as baseline instructions; role files, architecture references, workflow gates, and output contracts add to it, not replace it.
65
+
64
66
  ## Protocol Summary
65
67
 
66
68
  0. Pre-flight — [dependencies.yaml](dependencies.yaml): `rg` / `git` / `curl`, optional `jetbrains` MCP (`optional_mcp`), upstream analyst **P6** (`upstream_inputs`); **identify `design_mode` from user input (default `mvi`)**; record `dependency_preflight` and `design_mode` in `run_manifest.json`.
@@ -68,8 +70,8 @@ Module-first migrator for Legacy Android → KMP target assembly. **Upstream ana
68
70
  2. Migration inventory + `modules_migration_index.json`.
69
71
  3. Workspace state init.
70
72
  4. TPA `global_baseline`.
71
- 5. **Per module** (assembly_order): TPA `module_anchors` → **planning-gate** → **prep** → review/fix → **implementation `ui`** → review/fix → **implementation `logic`** → review/fix → verification → completion record → readiness → module representation.
72
- 6. **Global phase `integrate`** (cross-module glue + **entry point wiring**) → **`align`** (incl. **entry point alignment** vs Android) + alignment report.
73
+ 5. **Per module** (assembly_order): TPA `module_anchors` → **planning-gate** → **prep** (incl. analytics_expectations) → review/fix → **implementation `ui`** → review/fix → **implementation `logic`** (incl. 埋点 restoration) → review/fix → verification (incl. analytics_restoration) → completion record → readiness → module representation.
74
+ 6. **Global phase `integrate`** (cross-module glue + **entry point wiring** + **analytics SDK wiring**) → **`align`** (incl. **entry point** and **analytics alignment** vs Android) + alignment report.
73
75
  7. Global representation + completion-report `report` mode.
74
76
  8. **kmp-test-validator** — **mandatory** when **V0** ready (MG17).
75
77
 
@@ -51,6 +51,7 @@
51
51
  | `ui` and `logic` combined | Reject invocation |
52
52
  | `integrate` and `align` combined | Reject invocation |
53
53
  | Verification restoration failed | Rerun `module-implementation` or `migration-prep`; no completion record |
54
+ | Analytics restoration failed (`analytics_restoration` check or `global_alignment_results.analytics` failed) | Rerun `module-implementation` `logic` for missing 埋点; rerun `global-migration-phase integrate` for SDK wiring gaps |
54
55
  | Align omissions | Rerun `rerun_modules` or `global-migration-phase integrate` |
55
56
  | Entry point alignment failed | `rerun_global_integration` — rewire KMP app shell in integrate mode |
56
57
  | Build requested in migrator | Block; route to kmp-test-validator |
@@ -8,6 +8,20 @@
8
8
 
9
9
  # Skill chain (mandatory — Leader enforces at Step 0 and MG17)
10
10
  skills:
11
+ - name: operating-instructions
12
+ required: true
13
+ used_by:
14
+ - Leader
15
+ - migration-workspace-state
16
+ - target-project-assistant
17
+ - migration-planning-gate
18
+ - migration-prep
19
+ - module-implementation
20
+ - module-node-review-fix
21
+ - migration-verification
22
+ - global-migration-phase
23
+ - completion-report
24
+ purpose: Shared baseline conduct layer loaded before migrator pre-flight, planning, implementation, review/fix, verification, integration, and reporting work.
11
25
  - name: android-project-analyst
12
26
  required: true
13
27
  phase: prerequisite
@@ -198,8 +198,8 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
198
198
  | `migration-prep/migration_prep.json` |
199
199
  | `module-implementation/ui/module_implementation_ui.json`, `module-implementation/logic/module_implementation_logic.json` + approved reviews |
200
200
  | **Target edits**: when planning tasks require file changes, both UI and logic implementation artifacts MUST have non-empty `changed_files[]` under `kmp_target_project_path` |
201
- | `migration_verification.json` with all required `check_ids` passed (including `target_files_exist` when `changed_files` non-empty) |
202
- | `module_completion_record.json` with `ui_restoration` and `logic_restoration` passed and `target_changed_files[]` listing module target paths |
201
+ | `migration_verification.json` with all required `check_ids` passed (including `target_files_exist` when `changed_files` non-empty, and `analytics_restoration` passed or `skipped` with evidence) |
202
+ | `module_completion_record.json` with `ui_restoration`, `logic_restoration`, and `analytics_restoration` passed (or analytics `skipped` with evidence) and `target_changed_files[]` listing module target paths |
203
203
 
204
204
  ### Package `M4` — All modules migrated
205
205
 
@@ -221,7 +221,7 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
221
221
  | Required paths |
222
222
  |---|
223
223
  | Package `M5` |
224
- | `global/node-results/global-migration-phase/align/post_integration_alignment.json` with `alignment_verdict: passed \| passed_with_assumptions` and `global_alignment_results.entry_points.verdict: passed \| passed_with_assumptions` |
224
+ | `global/node-results/global-migration-phase/align/post_integration_alignment.json` with `alignment_verdict: passed \| passed_with_assumptions` and `global_alignment_results.entry_points.verdict: passed \| passed_with_assumptions` and `global_alignment_results.analytics.verdict: passed \| passed_with_assumptions \| not_applicable` |
225
225
  | `report/alignment_report.json` (includes entry point alignment verdict) |
226
226
 
227
227
  ### Package `V0` — kmp-test-validator entry (downstream)
@@ -306,6 +306,7 @@ Machine lookup: `migration_module_id` → `legacy_module_id`, `module_output_roo
306
306
  "target_changed_files": [{ "path": "", "owning_role": "migration-prep | module-implementation | module-node-review-fix", "mode": "ui | logic | fix | null" }],
307
307
  "ui_restoration": { "status": "passed | failed", "gaps": [] },
308
308
  "logic_restoration": { "status": "passed | failed", "gaps": [] },
309
+ "analytics_restoration": { "status": "passed | failed | skipped", "restored_count": 0, "total_count": 0, "gaps": [] },
309
310
  "upstream_match": { "module_representation_path": "", "matched_claims": [], "missing_claims": [] },
310
311
  "rerun_required": false,
311
312
  "evidence_paths": []
@@ -321,16 +322,19 @@ Machine lookup: `migration_module_id` → `legacy_module_id`, `module_output_roo
321
322
  - `ui_render` — static UI surface check (Compose structure/resources; no full render pipeline build)
322
323
  - `ui_restoration` — migrated UI coverage vs upstream `presentation_resource` + module representation
323
324
  - `logic_restoration` — migrated logic coverage vs upstream `behavior_logic` + module representation
325
+ - `analytics_restoration` — legacy 埋点 inventory vs migrated KMP track/report calls and params; `skipped` only when module scope has no analytics with evidence
324
326
 
325
327
  **Forbidden**: `incremental_build`, `full_project_compile`, `gradle_assemble`.
326
328
 
329
+ Runtime analytics **reporting** verification (event actually reaches SDK/report pipeline after build) is delegated to **`kmp-test-validator`** restoreability / business-testing — migrator performs static parity only.
330
+
327
331
  ### `global_system_integration.json`
328
332
 
329
- `kmp_target_project_path`, `target_edit_summary`, `assembly_order`, `ui_transition_edges[]`, `control_logic_handoffs[]`, `data_call_edges[]`, `entry_point_wiring[]` (Android entry → KMP shell wiring with `wiring_kind` and `status`), `shared_contracts_applied[]`, `integration_changed_files[]` (target glue paths only), evidence paths from analyst cross-module globals and per-module `presentation_resource` `entry_points[]`. Integrate mode MUST edit the target KMP project and wire app-shell entry points; module body changes belong in `module-implementation`.
333
+ `kmp_target_project_path`, `target_edit_summary`, `assembly_order`, `ui_transition_edges[]`, `control_logic_handoffs[]`, `data_call_edges[]`, `entry_point_wiring[]` (Android entry → KMP shell wiring with `wiring_kind` and `status`), `analytics_sdk_wiring[]` (legacy analytics SDK/init → KMP facade/DI with `status`), `shared_contracts_applied[]`, `integration_changed_files[]` (target glue paths only), evidence paths from analyst cross-module globals and per-module `presentation_resource` `entry_points[]`. Integrate mode MUST edit the target KMP project and wire app-shell entry points and global analytics glue when required; module body changes belong in `module-implementation`.
330
334
 
331
335
  ### `post_integration_alignment.json` (analysis only — no target edits)
332
336
 
333
- `alignment_verdict`, `module_alignment_results[]`, `global_alignment_results` (including `entry_points.verdict`), `entry_point_alignment_results[]`, `omissions[]`, `poor_restoration[]`, `rerun_modules[]`, `rerun_global_integration` (true when entry point alignment fails), `comparison_evidence[]` (analyst path vs target path pairs). Entry point alignment MUST pass (`global_alignment_results.entry_points.verdict: passed | passed_with_assumptions`) for package **M6**.
337
+ `alignment_verdict`, `module_alignment_results[]`, `global_alignment_results` (including `entry_points.verdict` and `analytics.verdict`), `entry_point_alignment_results[]`, `analytics_alignment_results[]`, `omissions[]`, `poor_restoration[]`, `rerun_modules[]`, `rerun_global_integration` (true when entry point or analytics SDK alignment fails), `comparison_evidence[]` (analyst path vs target path pairs). Entry point alignment MUST pass (`global_alignment_results.entry_points.verdict: passed | passed_with_assumptions`) and analytics alignment MUST pass or be `not_applicable` for package **M6**.
334
338
 
335
339
  ### `migration_planning_gate.json`
336
340
 
@@ -338,15 +342,56 @@ Combined `planning` (spec deltas, source-to-target map, tasks) and `dependency_p
338
342
 
339
343
  ### `migration_prep.json`
340
344
 
341
- Combined `presentation` (tokens, resources, routes) and `state_data` (state/models/API expectations) sections.
345
+ Combined `presentation` (tokens, resources, routes) and `state_data` (state/models/API expectations, `analytics_expectations[]`) sections.
342
346
 
343
347
  ### `module_implementation_ui.json` / `module_implementation_logic.json`
344
348
 
345
- 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`.
349
+ 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. Logic mode MUST include `analytics_coverage[]` when legacy scope contains 埋点. Legacy Android paths are evidence only — implementation edits occur under `kmp_target_project_path`.
346
350
 
347
351
  ### `alignment_report.json`
348
352
 
349
- Human/agent-readable synthesis of align mode; includes `entry_point_alignment_results` summary; routes reruns to `migration_module_id` or `global-migration-phase integrate` when entry points or cross-module glue fail.
353
+ Human/agent-readable synthesis of align mode; includes `entry_point_alignment_results` summary and `analytics_alignment_results` / `global_alignment_results.analytics` summary; routes reruns to `migration_module_id` or `global-migration-phase integrate` when entry points, analytics SDK, or cross-module glue fail.
354
+
355
+ ### `migration_report.json` — analytics handoff (for kmp-test-validator)
356
+
357
+ When migration scope includes analytics, `migration_report.json` MUST aggregate:
358
+
359
+ ```json
360
+ {
361
+ "analytics_restoration_summary": {
362
+ "total_legacy_events": 0,
363
+ "restored_events": 0,
364
+ "partial_events": 0,
365
+ "missing_events": 0,
366
+ "global_analytics_verdict": "passed | passed_with_assumptions | failed | not_applicable",
367
+ "per_module": [
368
+ {
369
+ "migration_module_id": "",
370
+ "verification_ref": "",
371
+ "status": "passed | failed | skipped",
372
+ "event_count": 0
373
+ }
374
+ ],
375
+ "event_catalog": [
376
+ {
377
+ "event_id": "",
378
+ "event_name": "",
379
+ "trigger": "",
380
+ "legacy_source_path": "",
381
+ "target_path": "",
382
+ "migration_module_id": "",
383
+ "status": "restored | partial | missing"
384
+ }
385
+ ]
386
+ },
387
+ "validation_inputs": {
388
+ "analytics_reporting_required": true,
389
+ "analytics_event_catalog_path": "report/migration_report.json#analytics_restoration_summary.event_catalog"
390
+ }
391
+ }
392
+ ```
393
+
394
+ `validation_inputs.analytics_reporting_required` is `true` when `total_legacy_events > 0`; `kmp-test-validator` MUST run analytics reporting verification during restoreability / business-testing.
350
395
 
351
396
  ---
352
397
 
@@ -61,7 +61,7 @@ Shared return shape applies.
61
61
 
62
62
  - `completion_readiness.json`: machine-routable readiness artifact containing requirement coverage, migration invariants, module/global representation references when applicable, verification/review status, validation inputs readiness, rerun requests, and blockers.
63
63
  - `completion_readiness.md`: agent-readable readiness handoff containing coverage tables, invariant checks, incomplete markers, rerun routing, blockers, and whether representation/report gates may proceed.
64
- - `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, `target_changed_files[]` (deduplicated union of all module and global integrate target paths with `owning_role`), changed files by role, coverage summary, validation inputs for kmp-test-validator, `validation_deferred_to: kmp-test-validator`, limitations, blockers.
64
+ - `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, `target_changed_files[]` (deduplicated union of all module and global integrate target paths with `owning_role`), `analytics_restoration_summary` (aggregated 埋点 catalog for validator), changed files by role, coverage summary, validation inputs for kmp-test-validator (incl. `analytics_reporting_required`), `validation_deferred_to: kmp-test-validator`, limitations, blockers.
65
65
  - `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.
66
66
  - Report mode success signals Leader to **mandatorily invoke** `kmp-test-validator` — migration is incomplete without validator dispatch.
67
67