@code-migration/wow-migrator 0.1.1 → 0.1.3
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-project-analyst/MIGRATION.md +51 -21
- package/skills/android-project-analyst/SKILL.md +74 -44
- package/skills/android-project-analyst/bind.md +24 -15
- package/skills/android-project-analyst/dependencies.yaml +8 -4
- package/skills/android-project-analyst/roles/analysis-workspace-state.md +123 -0
- package/skills/android-project-analyst/roles/behavior-logic.md +166 -0
- package/skills/android-project-analyst/roles/data-contract-flow.md +170 -0
- package/skills/android-project-analyst/roles/presentation-resource.md +301 -0
- package/skills/android-project-analyst/roles/project-architecture.md +174 -0
- package/skills/android-project-analyst/workflow.md +123 -72
- package/skills/android-to-kmp-migrator/MIGRATION.md +87 -2
- package/skills/android-to-kmp-migrator/SKILL.md +126 -133
- package/skills/android-to-kmp-migrator/bind.md +43 -15
- package/skills/android-to-kmp-migrator/dependencies.yaml +3 -3
- package/skills/android-to-kmp-migrator/roles/completion-report.md +79 -0
- package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +68 -0
- package/skills/android-to-kmp-migrator/roles/logic-implementation.md +71 -0
- package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +70 -0
- package/skills/android-to-kmp-migrator/roles/migration-verification.md +83 -0
- package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +210 -19
- package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +81 -0
- package/skills/android-to-kmp-migrator/roles/presentation-integration.md +70 -0
- package/skills/android-to-kmp-migrator/roles/state-data-prep.md +68 -0
- package/skills/android-to-kmp-migrator/roles/ui-implementation.md +69 -0
- package/skills/android-to-kmp-migrator/workflow.md +215 -149
- package/skills/kmp-test-validator/MIGRATION.md +44 -3
- package/skills/kmp-test-validator/SKILL.md +93 -77
- package/skills/kmp-test-validator/bind.md +29 -9
- package/skills/kmp-test-validator/dependencies.yaml +3 -3
- package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +72 -0
- package/skills/kmp-test-validator/roles/validation-plan-gate.md +72 -0
- package/skills/kmp-test-validator/roles/validation-remediation.md +14 -9
- package/skills/kmp-test-validator/roles/validation-report.md +15 -12
- package/skills/kmp-test-validator/roles/validation-test-runner.md +67 -0
- package/skills/kmp-test-validator/roles/validation-workspace-state.md +9 -4
- package/skills/kmp-test-validator/workflow.md +106 -118
- package/skills/migration-task-adapter/MIGRATION.md +49 -0
- package/skills/migration-task-adapter/SKILL.md +152 -0
- package/skills/migration-task-adapter/bind.md +116 -0
- package/skills/migration-task-adapter/dependencies.yaml +26 -0
- package/skills/migration-task-adapter/roles/task-reporter.md +134 -0
- package/skills/migration-task-adapter/roles/task-understanding-router.md +139 -0
- package/skills/migration-task-adapter/roles/workflow-orchestrator.md +145 -0
- package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +198 -0
- package/skills/migration-task-adapter/workflow.md +183 -0
- package/skills/android-project-analyst/roles/android-ecosystem.md +0 -141
- package/skills/android-project-analyst/roles/api-list.md +0 -136
- package/skills/android-project-analyst/roles/architecture-pattern.md +0 -131
- package/skills/android-project-analyst/roles/data-flow.md +0 -143
- package/skills/android-project-analyst/roles/logic-understand.md +0 -154
- package/skills/android-project-analyst/roles/resource-understand.md +0 -151
- package/skills/android-project-analyst/roles/ui-understand.md +0 -136
- package/skills/android-to-kmp-migrator/roles/api-contract-parity.md +0 -95
- package/skills/android-to-kmp-migrator/roles/dataflow-logic-implementation.md +0 -130
- package/skills/android-to-kmp-migrator/roles/dependency-resolution.md +0 -106
- package/skills/android-to-kmp-migrator/roles/incremental-build-check.md +0 -105
- package/skills/android-to-kmp-migrator/roles/legacy-spec-delta-review.md +0 -104
- package/skills/android-to-kmp-migrator/roles/migration-alignment.md +0 -119
- package/skills/android-to-kmp-migrator/roles/migration-report.md +0 -108
- package/skills/android-to-kmp-migrator/roles/module-node-migration-fix.md +0 -111
- package/skills/android-to-kmp-migrator/roles/module-node-migration-review.md +0 -108
- package/skills/android-to-kmp-migrator/roles/navigation-migration.md +0 -104
- package/skills/android-to-kmp-migrator/roles/platform-api-replacement.md +0 -104
- package/skills/android-to-kmp-migrator/roles/prd-completion-check.md +0 -124
- package/skills/android-to-kmp-migrator/roles/resource-migration.md +0 -109
- package/skills/android-to-kmp-migrator/roles/source-set-placement-guard.md +0 -95
- package/skills/android-to-kmp-migrator/roles/state-model-mapping.md +0 -109
- package/skills/android-to-kmp-migrator/roles/target-project-understand.md +0 -118
- package/skills/android-to-kmp-migrator/roles/theme-design-system-mapping.md +0 -101
- package/skills/android-to-kmp-migrator/roles/ui-mockup-implementation.md +0 -121
- package/skills/android-to-kmp-migrator/roles/ui-render-fidelity-check.md +0 -100
- package/skills/kmp-test-validator/roles/android-kmp-fidelity-audit.md +0 -102
- package/skills/kmp-test-validator/roles/build-preview-gate.md +0 -109
- package/skills/kmp-test-validator/roles/kmp-validation-plan.md +0 -108
- package/skills/kmp-test-validator/roles/test-case-decomposition.md +0 -103
- package/skills/kmp-test-validator/roles/test-execution.md +0 -104
- package/skills/kmp-test-validator/roles/validation-input-contract.md +0 -111
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Role: Project Architecture
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
> *"I name the project shape the code actually has — modules, layers, dependencies, Gradle knobs, generated tooling, and Android-only APIs included."*
|
|
6
|
+
|
|
7
|
+
You are the `project-architecture` node subagent and project architecture/ecosystem owner dispatched by the `android-project-analyst` controller. You own Gradle/package topology, architecture style detection (MVC/MVP/MVVM/MVI/Clean/layered/monolith/hybrid), layer roles, dependency direction, boundary violations, Gradle/SDK/build configuration, Jetpack and third-party dependencies, DI setup, persistence/background/platform services, generated tooling, resource platform constraints, and Android-only migration constraints.
|
|
8
|
+
|
|
9
|
+
## Success Criteria
|
|
10
|
+
|
|
11
|
+
- `project_architecture.json` and `project_architecture.md` written under the assigned module-scoped `output_dir`, both non-empty.
|
|
12
|
+
- The output includes the exact `module_id` and stays within `module_scope`.
|
|
13
|
+
- Every detected pattern carries a confidence (`high | medium | low`) and source evidence.
|
|
14
|
+
- Module topology covers all in-scope Android modules or explains why some were skipped.
|
|
15
|
+
- Build configuration includes source paths or explicit unknowns.
|
|
16
|
+
- Major dependency categories are covered for the in-scope project.
|
|
17
|
+
- Legacy hybrid, boundary-violation, Android-only API, platform-service, and generated-code concerns are recorded with source paths when present.
|
|
18
|
+
|
|
19
|
+
**Focus areas**: Gradle modules, package roots, feature/core/data/domain/presentation boundaries, dependency direction, layer roles (Activity/ViewModel/UseCase/Repository/DataSource/Mapper/Navigator), DI scope boundaries, base-class hidden behavior, god Activities/Fragments, Java/Kotlin mix, XML/Compose interop, global managers, AGP/Kotlin/compile-min-target SDK, namespaces/flavors/build types, version catalogs, buildSrc/convention plugins, AndroidX/Jetpack usage, Room/SQLite/DataStore/SharedPreferences, WorkManager/services/receivers/providers/alarms, ViewBinding/DataBinding/Compose compiler, KSP/KAPT/annotation processors, native libs, permissions.
|
|
20
|
+
|
|
21
|
+
## Boundary
|
|
22
|
+
|
|
23
|
+
**Forbidden** (prevent role overlap):
|
|
24
|
+
- Do NOT rebuild UI/screen hierarchy or resource usage maps — that is `presentation-resource`.
|
|
25
|
+
- Do NOT catalog endpoint semantics, request/response model fields, or end-to-end data movement — that is `data-contract-flow`.
|
|
26
|
+
- Do NOT trace per-user-action control flow, business rules, or state machines — that is `behavior-logic`.
|
|
27
|
+
- Do NOT download online resources or store remote media copies.
|
|
28
|
+
- Do NOT modify any source file.
|
|
29
|
+
|
|
30
|
+
**Mandatory**:
|
|
31
|
+
- You MUST read this role spec and the controller-provided contract completely before any analysis.
|
|
32
|
+
- 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` — never guess or broaden scope.
|
|
33
|
+
- You MUST attach source-path evidence to every pattern, ecosystem, dependency, build, platform, and important exception claim.
|
|
34
|
+
- You MUST surface every Android-only API / platform service / generated-code dependency as a migration constraint when present, even if it looks routine.
|
|
35
|
+
- You MUST write `project_architecture.json` and `project_architecture.md` under `output_dir`, list them in `output_files`, and verify them before reporting `completed`.
|
|
36
|
+
- If the architecture looks "clean", you MUST still hunt for boundary violations and legacy hybrids before declaring none.
|
|
37
|
+
|
|
38
|
+
## Output Schema
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"status": "completed",
|
|
43
|
+
"node": "project-architecture",
|
|
44
|
+
"source_project_path": "",
|
|
45
|
+
"analysis_scope": "",
|
|
46
|
+
"module_id": "",
|
|
47
|
+
"module_scope": {
|
|
48
|
+
"module_type": "app | feature | ui | logic | data | platform | shared | test | unknown",
|
|
49
|
+
"source_roots": [],
|
|
50
|
+
"ui_scope": [],
|
|
51
|
+
"logic_scope": [],
|
|
52
|
+
"data_scope": [],
|
|
53
|
+
"resource_scope": []
|
|
54
|
+
},
|
|
55
|
+
"build_config": {
|
|
56
|
+
"android_gradle_plugin": "",
|
|
57
|
+
"kotlin": "",
|
|
58
|
+
"compile_sdk": "",
|
|
59
|
+
"min_sdk": "",
|
|
60
|
+
"target_sdk": "",
|
|
61
|
+
"flavors": [],
|
|
62
|
+
"build_types": [],
|
|
63
|
+
"source_paths": []
|
|
64
|
+
},
|
|
65
|
+
"module_topology": [
|
|
66
|
+
{ "module": "", "type": "app | feature | core | data | domain | ui | library | unknown", "responsibility": "", "depends_on": [], "source_paths": [] }
|
|
67
|
+
],
|
|
68
|
+
"detected_patterns": [
|
|
69
|
+
{ "pattern": "MVC | MVP | MVVM | MVI | Clean Architecture | layered | monolith | hybrid | unknown", "confidence": "high | medium | low", "where": [], "evidence_paths": [], "notes": "" }
|
|
70
|
+
],
|
|
71
|
+
"layer_roles": [
|
|
72
|
+
{ "role": "UI | state-holder | domain | repository | datasource | mapper | navigation | DI | shared | platform | generated", "classes_or_files": [], "responsibility": "", "source_paths": [] }
|
|
73
|
+
],
|
|
74
|
+
"dependency_ecosystem": [
|
|
75
|
+
{ "category": "ui | navigation | lifecycle | network | persistence | di | background | image | testing | analytics | internal | build | generated | other", "name": "", "version": "", "modules": [], "source_paths": [] }
|
|
76
|
+
],
|
|
77
|
+
"jetpack_usage": [
|
|
78
|
+
{ "library": "", "usage": "", "source_paths": [] }
|
|
79
|
+
],
|
|
80
|
+
"di_setup": [
|
|
81
|
+
{ "framework": "Hilt | Dagger | Koin | manual | custom | unknown", "scopes_or_components": [], "source_paths": [] }
|
|
82
|
+
],
|
|
83
|
+
"platform_services": [
|
|
84
|
+
{ "type": "Service | BroadcastReceiver | ContentProvider | WorkManager | Alarm | Permission | Native | other", "name": "", "purpose": "", "source_paths": [] }
|
|
85
|
+
],
|
|
86
|
+
"boundary_violations_or_hybrids": [
|
|
87
|
+
{ "description": "", "impact": "", "source_paths": [] }
|
|
88
|
+
],
|
|
89
|
+
"migration_constraints": [
|
|
90
|
+
{ "constraint": "", "impact": "", "source_paths": [] }
|
|
91
|
+
],
|
|
92
|
+
"cross_module_dependencies": [
|
|
93
|
+
{ "target_module_id": "", "dependency_type": "gradle | package | DI | shared-state | platform | unknown", "source_paths": [] }
|
|
94
|
+
],
|
|
95
|
+
"assumptions": [],
|
|
96
|
+
"evidence_paths": []
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Output Files And Contents
|
|
101
|
+
|
|
102
|
+
- `project_architecture.json`: machine-routable architecture/ecosystem artifact containing build/SDK configuration, module topology, detected patterns with confidence, layer roles, dependency ecosystem, Jetpack usage, DI setup, platform services, boundary violations/hybrids, migration constraints, cross-module dependencies, assumptions, and evidence paths.
|
|
103
|
+
- `project_architecture.md`: agent-readable architecture handoff containing build/SDK configuration, project topology overview, detected patterns + confidence, layer/role mapping, dependency + Jetpack inventory, DI setup, persistence/background/platform-service usage, generated tooling, dependency direction notes, legacy hybrid patterns/risks, migration constraints, and unknowns.
|
|
104
|
+
|
|
105
|
+
## Inline Persona for Teammate
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
ROLE: Project Architecture node subagent in the android-project-analyst Swarm Skill.
|
|
109
|
+
|
|
110
|
+
You are the project architecture/ecosystem owner for Legacy Android code. You own Gradle/module
|
|
111
|
+
topology, architecture-style detection, layer roles, dependency direction, boundary violations,
|
|
112
|
+
build config, dependency ecosystem, Jetpack usage, DI, persistence, background work, platform
|
|
113
|
+
services, generated tooling, and Android-only migration constraints.
|
|
114
|
+
|
|
115
|
+
CONTROL — validate before you act, verify before you report:
|
|
116
|
+
- Read this prompt and the controller contract fully before analysis.
|
|
117
|
+
- Resolve and verify source_project_path exists, module_id is present, module_scope is in-bounds,
|
|
118
|
+
and module_brief_path exists. On missing / stale / contradictory / out-of-scope inputs, STOP
|
|
119
|
+
and return status "blocked" or "needs_rerun" with precise blocking_gaps. Do not guess or
|
|
120
|
+
broaden scope.
|
|
121
|
+
- Write outputs ONLY under output_dir; do not report "completed" until both files exist,
|
|
122
|
+
are non-empty, and are verified.
|
|
123
|
+
|
|
124
|
+
You MUST attach a source path to every architecture, build, dependency, ecosystem, and exception
|
|
125
|
+
claim.
|
|
126
|
+
You MUST give every detected pattern a confidence label (high | medium | low).
|
|
127
|
+
You MUST surface Android-only APIs, platform services, and generated-code deps as migration
|
|
128
|
+
constraints whenever present.
|
|
129
|
+
You MUST NOT rebuild UI/resource maps, catalog endpoint semantics, synthesize data flow, or trace
|
|
130
|
+
per-user-action logic.
|
|
131
|
+
You MUST NOT modify any source file.
|
|
132
|
+
|
|
133
|
+
INPUTS YOU WILL RECEIVE:
|
|
134
|
+
- source_project_path (required): {SOURCE_PROJECT_PATH}
|
|
135
|
+
- module_id (required): {MODULE_ID}
|
|
136
|
+
- module_scope (required): {MODULE_SCOPE}
|
|
137
|
+
- analysis_scope: {ANALYSIS_SCOPE}
|
|
138
|
+
- mode (exploration | migration): {MODE}
|
|
139
|
+
- module_brief_path (required): {MODULE_BRIEF_PATH}
|
|
140
|
+
- output_dir (required, exact): {OUTPUT_ROOT}/modules/{MODULE_ID}/node-results/project-architecture
|
|
141
|
+
- optional presentation_resource_path (when available): {PRESENTATION_RESOURCE_PATH}
|
|
142
|
+
- optional jetbrains MCP context (modules / dependencies / repositories): {MCP_CONTEXT}
|
|
143
|
+
|
|
144
|
+
HANDLER (how you process):
|
|
145
|
+
1. Stay inside module_scope; record dependencies on other modules as cross_module_dependencies
|
|
146
|
+
without analyzing those target modules here.
|
|
147
|
+
2. Inspect build config (Gradle files, AGP, Kotlin, compile/min/target SDK, namespaces/app IDs,
|
|
148
|
+
flavors, build types, version catalogs, buildSrc/convention plugins).
|
|
149
|
+
3. Identify project topology (Gradle modules, package roots, feature/core/data/domain/
|
|
150
|
+
presentation boundaries, dependency direction).
|
|
151
|
+
4. Detect architecture patterns (MVC/MVP/MVVM/MVI/Clean/layered/monolith/hybrid) with confidence.
|
|
152
|
+
5. Map core roles (Activity/Fragment/Page, ViewModel/Presenter/Controller, UseCase/Interactor,
|
|
153
|
+
Repository, DataSource, Mapper, Navigator/Router, DI, generated/platform integration).
|
|
154
|
+
6. Catalog dependency ecosystem and AndroidX/Jetpack usage.
|
|
155
|
+
7. Identify DI framework + scopes, persistence, background execution, services, receivers,
|
|
156
|
+
providers, alarms, permissions, native libs, generated code, KSP/KAPT/annotation processors.
|
|
157
|
+
8. Identify dependency boundaries and violations (UI->domain, domain->data, direct
|
|
158
|
+
UI->network/db, shared singletons, DI scope boundaries).
|
|
159
|
+
9. Identify legacy traits and migration/onboarding implications.
|
|
160
|
+
|
|
161
|
+
OUTPUTS (write under output_dir, exact names):
|
|
162
|
+
- project_architecture.json (machine artifact: build config, topology, patterns, layers, dependencies, platform/generated constraints, evidence)
|
|
163
|
+
- project_architecture.md (agent handoff: architecture/ecosystem tables, risks, migration constraints, unknowns)
|
|
164
|
+
|
|
165
|
+
RETURN TO CONTROLLER (exactly this shape, no preamble):
|
|
166
|
+
{
|
|
167
|
+
"status": "completed",
|
|
168
|
+
"node": "project-architecture",
|
|
169
|
+
"summary": "short summary",
|
|
170
|
+
"output_files": ["project_architecture.json", "project_architecture.md"],
|
|
171
|
+
"key_findings": [],
|
|
172
|
+
"blocking_gaps": []
|
|
173
|
+
}
|
|
174
|
+
```
|
|
@@ -1,102 +1,154 @@
|
|
|
1
|
-
# Workflow: Legacy Android source →
|
|
1
|
+
# Workflow: Legacy Android source → module artifacts → global representation → SPEC package
|
|
2
2
|
|
|
3
|
-
This Swarm Skill is **Mixed B+C**:
|
|
3
|
+
This Swarm Skill is **module-first Mixed B+C with workspace-state tracking**: the Leader first partitions the Legacy Android project into bounded analysis modules, maintains a ledger of module/node artifacts and stale inputs, then runs the clustered node schedule inside each module before combining the verified module representations into one global project representation and SPEC package. Each node owns a bounded module slice; the Leader never does node work and never invents claims that no node traced to source.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
```mermaid
|
|
8
8
|
graph TD
|
|
9
|
-
L0[Leader: Step 0 dependency pre-flight] --> L1[Leader: Step 1 trigger +
|
|
9
|
+
L0[Leader: Step 0 dependency pre-flight] --> L1[Leader: Step 1 trigger + output root lock]
|
|
10
10
|
L1 --> G0{Android evidence + valid scope?}
|
|
11
11
|
G0 -- No --> STOP[Stop: explain failed check / recommend Explore]
|
|
12
|
-
G0 -- Yes -->
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
S1 --
|
|
17
|
-
S1 -- Yes -->
|
|
12
|
+
G0 -- Yes --> WS0[analysis-workspace-state]
|
|
13
|
+
WS0 --> M0[Leader: Step 3 module inventory]
|
|
14
|
+
M0 --> WSM[Refresh analysis-workspace-state]
|
|
15
|
+
WSM --> S1{Module schedule valid?}
|
|
16
|
+
S1 -- "Over-scale (see bind.md)" --> DEG["Degraded mode: narrow module scope"]
|
|
17
|
+
S1 -- Yes --> LOOP[For each module_id in module_order]
|
|
18
|
+
LOOP --> MB[Leader: write module brief]
|
|
19
|
+
MB --> F1[presentation-resource]
|
|
20
|
+
MB --> F2[project-architecture]
|
|
21
|
+
MB --> F3[data-contract-flow]
|
|
18
22
|
F1 --> GA{Foundation outputs verified?}
|
|
19
23
|
F2 --> GA
|
|
20
24
|
F3 --> GA
|
|
21
|
-
|
|
22
|
-
GA -- "missing/empty/!=completed" --> RR1[Re-dispatch failed node<br/>with failure reason]
|
|
25
|
+
GA -- "missing/empty/!=completed" --> RR1[Re-dispatch failed foundation node]
|
|
23
26
|
RR1 --> GA
|
|
24
|
-
GA -- Yes -->
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
GB -- fail --> RR2[Re-dispatch failed node]
|
|
27
|
+
GA -- Yes --> WSA[Refresh analysis-workspace-state]
|
|
28
|
+
WSA --> B1[behavior-logic]
|
|
29
|
+
B1 --> GB{Behavior output verified?}
|
|
30
|
+
GB -- fail --> RR2[Re-dispatch behavior-logic]
|
|
29
31
|
RR2 --> GB
|
|
30
|
-
GB -- Yes -->
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
DEG -->
|
|
36
|
-
|
|
32
|
+
GB -- Yes --> MR[Leader: Step 5 write module representation]
|
|
33
|
+
MR --> WSR[Refresh analysis-workspace-state]
|
|
34
|
+
WSR --> NEXT{More modules?}
|
|
35
|
+
NEXT -- Yes --> LOOP
|
|
36
|
+
NEXT -- No --> GR[Leader: Step 6 global representation]
|
|
37
|
+
DEG --> GR
|
|
38
|
+
GR --> WSG[Refresh analysis-workspace-state]
|
|
39
|
+
WSG --> OUT[Leader: Step 8 write SPEC + verification verdict]
|
|
37
40
|
```
|
|
38
41
|
|
|
42
|
+
## Strict Output Paths
|
|
43
|
+
|
|
44
|
+
The Leader MUST lock one `output_root` before dispatch and MUST reject or rerun any node that writes outside its assigned directory. Defaults:
|
|
45
|
+
|
|
46
|
+
- `output_root`: `<output_dir or ~/.a2c_agents/understand>/android-project-analyst`
|
|
47
|
+
- `workspace_state_dir`: `<output_root>/workspace-state`
|
|
48
|
+
- `module_index_dir`: `<output_root>/module-index`
|
|
49
|
+
- `module_root`: `<output_root>/modules/<module_id>`
|
|
50
|
+
- `module_node_dir`: `<module_root>/node-results/<node_id>`
|
|
51
|
+
- `module_representation_dir`: `<module_root>/representation`
|
|
52
|
+
- `global_dir`: `<output_root>/global`
|
|
53
|
+
- `spec_dir`: `<output_root>/SPEC`
|
|
54
|
+
|
|
55
|
+
Required durable artifacts:
|
|
56
|
+
|
|
57
|
+
| Schedule point | Required artifacts |
|
|
58
|
+
|---|---|
|
|
59
|
+
| Output root lock | `<output_root>/run_manifest.json` - run identity, paths, mode, scope, allowed roots, dependency status, schedule version |
|
|
60
|
+
| Workspace state | `<workspace_state_dir>/analysis_workspace_state.json`, `<workspace_state_dir>/analysis_workspace_state.md` - module/node/artifact ledger, stale inputs, reruns, blockers, next safe actions |
|
|
61
|
+
| Module inventory | `<module_index_dir>/module_inventory.json`, `<module_index_dir>/module_inventory.md` - deterministic module list/order, scopes, dependencies, out-of-scope roots, evidence |
|
|
62
|
+
| Per module brief | `<module_root>/module_brief.json` - module-scoped dispatch contract and role hints for one `module_id` |
|
|
63
|
+
| Per module node outputs | `<module_node_dir>/<node_artifact>.json`, `<module_node_dir>/<node_artifact>.md` - role-owned evidence matching the active role schema |
|
|
64
|
+
| Per module representation | `<module_representation_dir>/module_representation.json`, `<module_representation_dir>/module_representation.md` - module synthesis from verified node outputs only |
|
|
65
|
+
| Global representation | `<global_dir>/global_representation.json`, `<global_dir>/global_representation.md` - full-project synthesis from module representations only |
|
|
66
|
+
| SPEC package | `<spec_dir>/prd.md`, `<spec_dir>/design.md`, `<spec_dir>/verification.md`, plus `<spec_dir>/plan.md` in migration mode - final SPEC with traceability, coverage, and readiness |
|
|
67
|
+
|
|
68
|
+
No node may choose its own output path. `presentation-resource` may write downloaded resources only under `<module_root>/node-results/presentation-resource/downloaded_resources/`.
|
|
69
|
+
|
|
39
70
|
## Detailed Steps
|
|
40
71
|
|
|
41
72
|
### Step 0 — Pre-flight: dependency check
|
|
42
73
|
|
|
43
74
|
- **Executor**: Leader (`android-project-analyst` controller)
|
|
44
75
|
- **Input**: [dependencies.yaml](dependencies.yaml)
|
|
45
|
-
- **Action**: verify each `tools[]` entry (`rg`, `curl`) is available; built-in Grep/Read substitute when `rg` is absent.
|
|
76
|
+
- **Action**: verify each `tools[]` entry (`rg`, `curl`, `git`) is available; built-in Grep/Read substitute when `rg` is absent. Presentation/resource downloads degrade to `download_gaps` when `curl` is absent. Stale-input detection degrades to artifact-path/status comparison when `git` is absent.
|
|
46
77
|
- **Output**: pre-flight note to the user
|
|
47
78
|
- **Quality gate**: all deps are `required: false` → the run proceeds even if missing; user is informed of any degraded mode. The Leader does NOT auto-skip nodes.
|
|
48
79
|
|
|
49
|
-
### Step 1 — Trigger verification + mode selection +
|
|
80
|
+
### Step 1 — Trigger verification + mode selection + output root lock
|
|
50
81
|
|
|
51
82
|
- **Executor**: Leader
|
|
52
83
|
- **Input**: `source_project_path`, optional `analysis_scope` / `mode` / `target_project_path` / `output_dir` / `language`, optional `jetbrains` MCP context
|
|
53
|
-
- **Action**: verify the target is an Android project (`AndroidManifest.xml`, `settings.gradle(.kts)`, `build.gradle(.kts)`, or a `com.android.*` module) and that the request needs structured analysis, not a one-off lookup. Select `exploration` or `migration`.
|
|
54
|
-
- **Output**: announced mode banner +
|
|
84
|
+
- **Action**: verify the target is an Android project (`AndroidManifest.xml`, `settings.gradle(.kts)`, `build.gradle(.kts)`, or a `com.android.*` module) and that the request needs structured analysis, not a one-off lookup. Select `exploration` or `migration`. Lock `output_root`, `module_index_dir`, `global_dir`, and `spec_dir`. Write `run_manifest.json` with source path, mode, target path, scope, schedule version, allowed path roots, and timestamp.
|
|
85
|
+
- **Output**: announced mode banner + `run_manifest.json`; default `output_root` = `~/.a2c_agents/understand/android-project-analyst`. `run_manifest.json` must contain source/target paths, mode, analysis scope, output root, allowed path roots, dependency-preflight status, schedule version, and timestamp.
|
|
55
86
|
- **Serial / Parallel**: serial (precedes all dispatch)
|
|
56
|
-
- **Quality gate**: Android evidence present AND scope valid → proceed; otherwise STOP and explain the failed check
|
|
57
|
-
|
|
58
|
-
### Step 2 — Stage A: dispatch foundation nodes (parallel, B-pattern)
|
|
87
|
+
- **Quality gate**: Android evidence present AND scope valid AND `run_manifest.json` exists/non-empty → proceed; otherwise STOP and explain the failed check. Migration mode without `target_project_path` → ask before producing `plan.md`.
|
|
59
88
|
|
|
60
|
-
|
|
61
|
-
- **Input**: per-node contract `{ source_project_path, analysis_scope, mode, shared_brief, skill_spec_path (roles/<id>.md), output_dir: <output_dir>/node-results/<node>, return_format: json }`; `api-list` may also receive `ui_entry_points`
|
|
62
|
-
- **Action**: each node validates inputs, performs its bounded slice, writes its JSON+MD artifacts, and returns the controller JSON shape
|
|
63
|
-
- **Output**: `ui_understanding.*`, `architecture_pattern.*`, `android_ecosystem.*`, `api_list.*`
|
|
64
|
-
- **Serial / Parallel**: parallel — all four run together (slices are dispatch-time fixed, not negotiated)
|
|
65
|
-
- **Quality gate**: each return must be `status: "completed"` with `output_files` that exist and are non-empty. On missing/empty/non-`completed` 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.
|
|
89
|
+
### Step 2 — Workspace state ledger
|
|
66
90
|
|
|
67
|
-
|
|
91
|
+
- **Executor**: `analysis-workspace-state`
|
|
92
|
+
- **Input**: output root, run manifest, current controller step, known module/node/artifact outputs, source change/timestamp evidence, rerun reports, blockers
|
|
93
|
+
- **Action**: initialize and refresh the analysis ledger. Track module status, node output inventory, artifact inventory, stale upstream inputs, rerun history, blockers, and next safe controller actions.
|
|
94
|
+
- **Output**: `analysis_workspace_state.json`, `analysis_workspace_state.md`. JSON is the machine ledger for module status, node output files, artifact inventory, stale upstream inputs, rerun history, blockers, and next actions. Markdown mirrors the ledger as an agent handoff with stale/rerun/blocker tables.
|
|
95
|
+
- **Serial / Parallel**: serial; refreshed after module inventory, Stage A, Stage B, module representation, global representation, and SPEC.
|
|
96
|
+
- **Quality gate**: downstream stages do not consume artifacts marked stale; rerun the responsible module/node or mark the affected module `blocked`.
|
|
68
97
|
|
|
69
|
-
|
|
70
|
-
- **Input**: Stage A verified output paths. `resource-understand` receives optional `ui_understanding_path` / `api_list_path` / `android_ecosystem_path`; `data-flow` receives required `api_list_path` + optional `architecture_pattern_path` / `android_ecosystem_path` / `ui_understanding_path`
|
|
71
|
-
- **Action**: `resource-understand` maps local + online resources and safely downloads concrete URLs into `<output_dir>/node-results/resource-understand/downloaded_resources/`; `data-flow` traces sources→repositories→streams→UI state, aligning API IDs to `api_list`
|
|
72
|
-
- **Output**: `resource_understanding.*`, `data_flow.*`
|
|
73
|
-
- **Serial / Parallel**: starts only after Stage A gate passes; the two nodes may run in parallel with each other
|
|
74
|
-
- **Quality gate**: same return-shape + output-file checks as Step 2. If a node needs upstream data that is missing/stale, it returns `needs_rerun`/`blocked` rather than rebuilding another node's catalog.
|
|
98
|
+
### Step 3 — Module inventory and schedule
|
|
75
99
|
|
|
76
|
-
|
|
100
|
+
- **Executor**: Leader
|
|
101
|
+
- **Input**: source path, analysis scope, Android evidence, module/build files, optional MCP module context
|
|
102
|
+
- **Action**: partition the project into explicit `analysis_modules`. Prefer Gradle modules and feature packages; when one Gradle module contains multiple independent features, split by package/route/feature boundary. Each module entry MUST include `module_id` (stable slug), `module_type` (`app | feature | ui | logic | data | platform | shared | test | unknown`), `source_roots`, `ui_scope`, `logic_scope`, `data_scope`, `resource_scope`, `depends_on`, and `module_output_root`. Include UI-only and logic-only modules when they exist; if a module has no UI or no logic, record `none` with evidence.
|
|
103
|
+
- **Output**: `module_inventory.json`, `module_inventory.md`. JSON must contain `analysis_modules`, deterministic `module_order`, in-scope and out-of-scope roots, dependencies, and each module's output root. Markdown must explain module boundaries and evidence without doing role analysis.
|
|
104
|
+
- **Serial / Parallel**: serial (precedes all module dispatch)
|
|
105
|
+
- **Quality gate**: module inventory exists/non-empty, every in-scope source root is assigned to one module or `out_of_scope`, and `module_order` is deterministic.
|
|
106
|
+
|
|
107
|
+
### Step 4 — Stage A per module: dispatch clustered foundation nodes (parallel, B-pattern)
|
|
108
|
+
|
|
109
|
+
- **Executor**: `presentation-resource`, `project-architecture`, `data-contract-flow`
|
|
110
|
+
- **Input**: per-node contract `{ source_project_path, module_id, module_scope, analysis_scope, mode, module_brief_path, skill_spec_path (roles/<id>.md), output_dir: <output_root>/modules/<module_id>/node-results/<node_id>, return_format: json }`; `data-contract-flow` may also receive `presentation_hints` when known.
|
|
111
|
+
- **Action**: each node validates inputs, performs its bounded clustered slice, writes its JSON+MD artifacts, and returns the controller JSON shape.
|
|
112
|
+
- **Output**:
|
|
113
|
+
- `presentation_resource.json`, `presentation_resource.md`: UI entry points, screen inventory, checked UI layout/view trees, navigation, presentation modules, resources, safe downloads, usage map, migration implications, gaps.
|
|
114
|
+
- `project_architecture.json`, `project_architecture.md`: build/SDK config, topology, architecture patterns, layer roles, dependencies, Jetpack/DI/platform/generated usage, boundary risks, migration constraints.
|
|
115
|
+
- `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.
|
|
116
|
+
- **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.
|
|
117
|
+
- **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.
|
|
118
|
+
|
|
119
|
+
### Step 5 — Stage B per module: dispatch behavior logic node (gated handoff, C-pattern)
|
|
120
|
+
|
|
121
|
+
- **Executor**: `behavior-logic`
|
|
122
|
+
- **Input**: required `module_id`, `module_scope`, `presentation_resource_path`, `project_architecture_path`, `data_contract_flow_path`, and latest `analysis_workspace_state_path`
|
|
123
|
+
- **Action**: synthesize user-action / lifecycle / state-machine / business-rule behavior, referencing (not rebuilding) upstream catalogs.
|
|
124
|
+
- **Output**: `behavior_logic.json`, `behavior_logic.md`. JSON must contain screen logic, state holders, lifecycle/user-action/control flows, business rules, data-contract links, cross-module interactions, state machines, and upstream alignment. Markdown must provide an agent handoff with diagrams when evidence supports them.
|
|
125
|
+
- **Serial / Parallel**: serial within the module — runs after that module's Stage A gate passes.
|
|
126
|
+
- **Quality gate**: latest workspace state must not mark Stage A inputs stale; return-shape + output-file checks; every major UI/logic scope from the module brief has behavior coverage or an explicit reason for none.
|
|
127
|
+
|
|
128
|
+
### Step 6 — Module representation
|
|
77
129
|
|
|
78
|
-
- **Executor**:
|
|
79
|
-
- **Input**:
|
|
80
|
-
- **Action**:
|
|
81
|
-
- **Output**: `
|
|
82
|
-
- **Serial / Parallel**: serial
|
|
83
|
-
- **Quality gate**:
|
|
130
|
+
- **Executor**: Leader
|
|
131
|
+
- **Input**: verified node JSON/MD outputs for one `module_id`
|
|
132
|
+
- **Action**: integrate ONLY from verified 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, dependencies, risks, gaps, evidence index, and readiness.
|
|
133
|
+
- **Output**: `module_representation.json`, `module_representation.md`. JSON is the module-level synthesis and traceability index; Markdown is the agent-readable handoff. Both must cite verified node artifacts and source evidence for UI/resources, architecture, data flow, behavior, risks, gaps, and readiness.
|
|
134
|
+
- **Serial / Parallel**: serial
|
|
135
|
+
- **Quality gate**: no unknowns hidden; every module representation points to its node artifacts and source evidence. Refresh workspace state after writing. Do not proceed to global integration until every scheduled module is represented or explicitly marked blocked/out of scope.
|
|
84
136
|
|
|
85
|
-
### Step
|
|
137
|
+
### Step 7 — Global representation
|
|
86
138
|
|
|
87
139
|
- **Executor**: Leader
|
|
88
|
-
- **Input**: all verified
|
|
89
|
-
- **Action**:
|
|
90
|
-
- **Output**:
|
|
140
|
+
- **Input**: all verified module representations
|
|
141
|
+
- **Action**: combine module representations into a total full-project global representation. Preserve module boundaries first, then synthesize cross-module architecture, navigation, data dependencies, shared resources, shared logic, platform constraints, conflicts, and global readiness. Do not read raw source to fill gaps at this stage; rerun the responsible module/node instead.
|
|
142
|
+
- **Output**: `global_representation.json`, `global_representation.md`. JSON is the full-project representation and evidence index; Markdown explains cross-module architecture, navigation, shared resources, shared logic, data dependencies, platform constraints, conflicts, and global readiness.
|
|
91
143
|
- **Serial / Parallel**: serial
|
|
92
|
-
- **Quality gate**:
|
|
144
|
+
- **Quality gate**: latest workspace state must not mark required module representations stale; every global claim maps to a module representation and source-path evidence, or is marked `assumed`, `unknown`, or `blocked`.
|
|
93
145
|
|
|
94
|
-
### Step
|
|
146
|
+
### Step 8 — Final: write SPEC package + emit completion report
|
|
95
147
|
|
|
96
148
|
- **Executor**: Leader
|
|
97
|
-
- **Input**:
|
|
98
|
-
- **Action**: write SPEC artifacts under `<
|
|
99
|
-
- **Output**: SPEC files + the completion report below
|
|
149
|
+
- **Input**: `global_representation.json`, `global_representation.md`, module inventory, module representations, latest `analysis_workspace_state.json`
|
|
150
|
+
- **Action**: write SPEC artifacts under `<output_root>/SPEC`. **Exploration** mode → `prd.md`, `design.md`, `verification.md`. **Migration** mode → adds `plan.md`. SPEC must synthesize, not paste node summaries; every important claim maps to module/global representation evidence and source paths or is marked assumption/gap. `design.md` sections include a Mermaid diagram, structured table, or evidence mapping; presentation/navigation, project architecture, data-contract/flow, and cross-module sections include diagrams when evidence exists.
|
|
151
|
+
- **Output**: SPEC files + the completion report below. `prd.md` captures product behavior and journeys, `design.md` captures implementation structure and evidence-backed diagrams/tables, `verification.md` captures coverage/traceability/consistency/readiness, and migration-mode `plan.md` captures migration milestones, source-to-target mapping, validation, risks, and blockers.
|
|
100
152
|
|
|
101
153
|
#### Final Report Format
|
|
102
154
|
|
|
@@ -106,15 +158,12 @@ graph TD
|
|
|
106
158
|
"mode": "exploration | migration",
|
|
107
159
|
"source_project_path": "...",
|
|
108
160
|
"target_project_path": "... or null",
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"data_flow": ["..."],
|
|
116
|
-
"logic_understand": ["..."]
|
|
117
|
-
},
|
|
161
|
+
"output_root": "...",
|
|
162
|
+
"workspace_state": ["..."],
|
|
163
|
+
"module_inventory": ["..."],
|
|
164
|
+
"module_representations": ["..."],
|
|
165
|
+
"global_representation": ["..."],
|
|
166
|
+
"node_outputs_by_module": {},
|
|
118
167
|
"spec_outputs": ["..."],
|
|
119
168
|
"readiness": "ready | ready_with_assumptions | blocked",
|
|
120
169
|
"blocking_gaps": []
|
|
@@ -124,9 +173,11 @@ graph TD
|
|
|
124
173
|
## Acceptance Criteria
|
|
125
174
|
|
|
126
175
|
- All dispatched nodes returned outputs matching their role `## Output Schema` (no malformed returns); any `[ROLE MISSING]` is recorded per [bind.md](bind.md).
|
|
127
|
-
- All required node artifacts exist and are non-empty; all required SPEC artifacts for the selected mode exist and are non-empty.
|
|
128
|
-
- **
|
|
129
|
-
- **
|
|
130
|
-
-
|
|
176
|
+
- All required node artifacts exist and are non-empty; latest `analysis-workspace-state` has no stale required inputs; all required SPEC artifacts for the selected mode exist and are non-empty.
|
|
177
|
+
- **Path check**: every artifact path is under `output_root`; every node artifact is under `<output_root>/modules/<module_id>/node-results/<node_id>/`; SPEC is under `<output_root>/SPEC`.
|
|
178
|
+
- **Module-first check**: every scheduled module has a module brief, node outputs, and module representation before global representation is written.
|
|
179
|
+
- **Coverage check (B-pattern)**: every per-module Stage A slice is accounted for — screens/resources from `presentation-resource`, topology/platform constraints from `project-architecture`, and APIs/data flows from `data-contract-flow` appear in module/global representations or are marked out of scope/unknown.
|
|
180
|
+
- **Gate check (C-pattern)**: per-module behavior analysis ran only after that module's Stage A verification; every kicked-back node is recorded.
|
|
181
|
+
- Data-flow and behavior-flow names align across `design.md`, `plan.md`, and `verification.md`.
|
|
131
182
|
- `verification.md` carries a readiness verdict (`ready | ready_with_assumptions | blocked`); if `blocked`, the final response lists blockers and exact missing evidence.
|
|
132
183
|
- No artifact claims certainty for unknown or dynamic code paths.
|
|
@@ -21,7 +21,7 @@ The registry separated controller from nodes and even encoded the staged dispatc
|
|
|
21
21
|
- Review→fix loop after any file-changing node: `module-node-migration-review` ↔ `module-node-migration-fix`.
|
|
22
22
|
- Parallel verify (B): `source-set-placement-guard`, `api-contract-parity`, `ui-render-fidelity-check`, `incremental-build-check`.
|
|
23
23
|
- Completion + report: `prd-completion-check` → `migration-report` → `kmp-test-validator` handoff.
|
|
24
|
-
- Cross-cutting: `migration-workspace-state` ledger refreshed after major
|
|
24
|
+
- Cross-cutting: `migration-workspace-state` progress ledger refreshed after every major stage, tracking per-module finish rate, plan-vs-code gaps, stale outputs, and rerun hooks.
|
|
25
25
|
- **Disjointness check: PASS.** Each node owns a distinct slice (state ledger vs SPEC delta vs target understanding vs alignment vs dependency gate vs theme vs resource vs navigation vs platform vs state/model vs UI vs logic vs review vs fix vs source-set guard vs API parity vs render vs build vs completion vs report). `module-node-migration-review` and `-fix` are intentionally complementary (read-only judge vs scoped editor) and gated as a loop, not overlapping.
|
|
26
26
|
|
|
27
27
|
## Content port map
|
|
@@ -41,4 +41,89 @@ The registry separated controller from nodes and even encoded the staged dispatc
|
|
|
41
41
|
|
|
42
42
|
## Team-vs-single delta
|
|
43
43
|
|
|
44
|
-
The conversion preserves every source contract while adding: explicit pipeline + parallel + loop topology with verifiable gates, per-role anti-overlap boundaries that name siblings, self-contained pasteable personas (no re-derivation per dispatch across 20 nodes), resource/token/wall-clock budgets plus a `max_review_fix_cycles` bound, failure-routing rules, and concrete degraded modes for large monorepos and missing tooling. The same-name controller subagent in `kmp-migration/agents/android-to-kmp-migrator.md`
|
|
44
|
+
The conversion preserves every source contract while adding: explicit pipeline + parallel + loop topology with verifiable gates, per-role anti-overlap boundaries that name siblings, self-contained pasteable personas (no re-derivation per dispatch across 20 nodes), resource/token/wall-clock budgets plus a `max_review_fix_cycles` bound, failure-routing rules, and concrete degraded modes for large monorepos and missing tooling. The same-name controller subagent in `kmp-migration/agents/android-to-kmp-migrator.md` was later updated to enforce the module-first schedule and strict output roots.
|
|
45
|
+
|
|
46
|
+
## Module-First Refactor (0.3)
|
|
47
|
+
|
|
48
|
+
The second refactor added a module-first migration schedule and strict output paths. It initially kept the 20-role shape, then Phase 0.4 superseded that result with the reduced 10-role set recorded in `ROLE_REDUCTION.md`.
|
|
49
|
+
|
|
50
|
+
### New schedule
|
|
51
|
+
|
|
52
|
+
1. Lock `output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator`.
|
|
53
|
+
2. Write `<output_root>/run_manifest.json`.
|
|
54
|
+
3. Write `<output_root>/module-index/migration_module_inventory.json` and `.md`.
|
|
55
|
+
4. For each `migration_module_id`, write `<output_root>/modules/<migration_module_id>/module_brief.json`.
|
|
56
|
+
5. Run module-scoped node outputs under `<output_root>/modules/<migration_module_id>/node-results/<node_id>/`.
|
|
57
|
+
6. Run review/fix loops per module and owning node slice.
|
|
58
|
+
7. Write `<output_root>/modules/<migration_module_id>/representation/module_migration_representation.json` and `.md`.
|
|
59
|
+
8. Combine all module representations into `<output_root>/global/global_migration_representation.json` and `.md`.
|
|
60
|
+
9. Write final `<output_root>/report/migration_report.json` and `.md`.
|
|
61
|
+
10. Hand the final report to `kmp-test-validator`.
|
|
62
|
+
|
|
63
|
+
### Contract changes
|
|
64
|
+
|
|
65
|
+
- Every module-scoped node now receives `migration_module_id`, `module_scope`, exact `output_dir`, and allowed target files/source sets when it may change files.
|
|
66
|
+
- Review mode remains read-only. Fix mode consumes explicit findings, `allowed_files`, `owning_node`, and `migration_module_id`; re-review is a fresh read-only invocation.
|
|
67
|
+
- Verification runs per module first. Global aggregation consumes module representations rather than loose node output lists.
|
|
68
|
+
- `completion-report` report mode may return `ready_for_validation` only when every scheduled module representation and the global representation exists and is non-empty.
|
|
69
|
+
|
|
70
|
+
### Path compatibility
|
|
71
|
+
|
|
72
|
+
The old default `~/.a2c_agents/migration/` is now only the base directory. The effective output root is always:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
<output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
No controller or node should write durable migration artifacts directly under the base directory.
|
|
79
|
+
|
|
80
|
+
## Role Reduction Refactor (0.4)
|
|
81
|
+
|
|
82
|
+
The third refactor reduces active migrator role definitions from 20 to 10. The full analysis lives in [ROLE_REDUCTION.md](ROLE_REDUCTION.md).
|
|
83
|
+
|
|
84
|
+
### Old-to-new map
|
|
85
|
+
|
|
86
|
+
| Old role(s) | Active role |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `migration-workspace-state` | `migration-workspace-state` |
|
|
89
|
+
| `legacy-spec-delta-review`, `target-project-understand`, `migration-alignment` | `migration-analysis-planning` |
|
|
90
|
+
| `dependency-resolution`, `platform-api-replacement` | `dependency-platform-gate` |
|
|
91
|
+
| `theme-design-system-mapping`, `resource-migration`, `navigation-migration` | `presentation-integration` |
|
|
92
|
+
| `state-model-mapping` plus API/data preparation expectations | `state-data-prep` |
|
|
93
|
+
| `ui-mockup-implementation` | `ui-implementation` |
|
|
94
|
+
| `dataflow-logic-implementation` | `logic-implementation` |
|
|
95
|
+
| `module-node-migration-review`, `module-node-migration-fix` | `module-node-review-fix` with `mode: review | fix` |
|
|
96
|
+
| `source-set-placement-guard`, `api-contract-parity`, `ui-render-fidelity-check`, `incremental-build-check` | `migration-verification` with stable `check_ids` |
|
|
97
|
+
| `prd-completion-check`, `migration-report` | `completion-report` with `mode: readiness | report` |
|
|
98
|
+
|
|
99
|
+
### Safety preserved by modes
|
|
100
|
+
|
|
101
|
+
- Review and fix are in one role file but must run as separate invocations.
|
|
102
|
+
- Verification is consolidated but still read-only for source changes and uses explicit check IDs.
|
|
103
|
+
- Completion and report are consolidated but report mode is blocked until readiness mode and module/global representation gates pass.
|
|
104
|
+
- Build-config changes remain owned only by `dependency-platform-gate`.
|
|
105
|
+
|
|
106
|
+
## Workspace Progress Ledger Refinement
|
|
107
|
+
|
|
108
|
+
The `migration-workspace-state` role was refined from basic node/stale-output tracking into the controller's progress ledger. It now records per-module migration status, current stage, planned/completed work units, `finish_rate`, changed-file ownership, plan-vs-code gaps, stale outputs, rerun hooks, blocker history, and next safe action.
|
|
109
|
+
|
|
110
|
+
This preserves the role boundary: `migration-workspace-state` still does not analyze source behavior, implement code, fix code, or issue readiness verdicts. It only compares controller-visible plan artifacts, implementation outputs, review outputs, verification outputs, changed-file ownership, and freshness evidence so the Leader can rerun the correct owner before downstream consumption.
|
|
111
|
+
|
|
112
|
+
## Output Contract Refinement
|
|
113
|
+
|
|
114
|
+
The active skill docs now distinguish output filenames from output content responsibilities. `SKILL.md` and `workflow.md` define the full artifact schedule and content matrix, while each role file states the exact JSON/Markdown filenames and the evidence each artifact must contain.
|
|
115
|
+
|
|
116
|
+
This keeps the reduced-role boundaries explicit:
|
|
117
|
+
|
|
118
|
+
- `migration_workspace_state.*` records progress ledger state only.
|
|
119
|
+
- `migration_analysis_planning.*` records SPEC/raw-source deltas, target evidence, source-to-target mapping, and ordered tasks.
|
|
120
|
+
- `dependency_platform_gate.*` records dependency, build, platform, and source-set decisions.
|
|
121
|
+
- `presentation_integration.*` records theme/token/resource/media/navigation prep and UI handoff.
|
|
122
|
+
- `state_data_prep.*` records state/model/API contract prep and logic handoff.
|
|
123
|
+
- `ui_implementation.*` records visible UI implementation evidence and binding surfaces.
|
|
124
|
+
- `logic_implementation.*` records behavior/data/API/state implementation evidence.
|
|
125
|
+
- `module_node_review.*` and `module_node_fix.*` record review/fix evidence by mode.
|
|
126
|
+
- `migration_verification.*` records stable check results and routed failures.
|
|
127
|
+
- `completion_readiness.*` and `migration_report.*` record readiness and validation handoff evidence.
|
|
128
|
+
|
|
129
|
+
The Leader must reject artifacts that have the correct filename but contain another role's work or prose-only summaries without machine-routable evidence.
|