@code-migration/wow-migrator 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/SKILL.md +71 -28
  3. package/skills/android-project-analyst/bind.md +12 -6
  4. package/skills/android-project-analyst/dependencies.yaml +66 -10
  5. package/skills/android-project-analyst/output-contract.md +357 -0
  6. package/skills/android-project-analyst/roles/analysis-workspace-state.md +30 -8
  7. package/skills/android-project-analyst/roles/behavior-logic.md +12 -5
  8. package/skills/android-project-analyst/roles/data-contract-flow.md +11 -4
  9. package/skills/android-project-analyst/roles/presentation-resource.md +13 -4
  10. package/skills/android-project-analyst/roles/project-architecture.md +11 -4
  11. package/skills/android-project-analyst/workflow.md +88 -39
  12. package/skills/android-to-kmp-migrator/SKILL.md +62 -111
  13. package/skills/android-to-kmp-migrator/bind.md +29 -61
  14. package/skills/android-to-kmp-migrator/dependencies.yaml +72 -11
  15. package/skills/android-to-kmp-migrator/output-contract.md +318 -0
  16. package/skills/android-to-kmp-migrator/roles/completion-report.md +11 -2
  17. package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +87 -0
  18. package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +75 -0
  19. package/skills/android-to-kmp-migrator/roles/migration-prep.md +75 -0
  20. package/skills/android-to-kmp-migrator/roles/migration-verification.md +47 -23
  21. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +207 -20
  22. package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
  23. package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +9 -2
  24. package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
  25. package/skills/android-to-kmp-migrator/workflow.md +71 -170
  26. package/skills/kmp-test-validator/SKILL.md +63 -45
  27. package/skills/kmp-test-validator/bind.md +30 -36
  28. package/skills/kmp-test-validator/dependencies.yaml +101 -9
  29. package/skills/kmp-test-validator/output-contract.md +166 -0
  30. package/skills/kmp-test-validator/roles/validation-business-testing.md +83 -0
  31. package/skills/kmp-test-validator/roles/validation-code-gate.md +116 -0
  32. package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +118 -0
  33. package/skills/kmp-test-validator/roles/validation-report.md +30 -16
  34. package/skills/kmp-test-validator/roles/validation-workspace-state.md +12 -4
  35. package/skills/kmp-test-validator/workflow.md +62 -97
  36. package/skills/migration-task-adapter/SKILL.md +67 -76
  37. package/skills/migration-task-adapter/bind.md +25 -89
  38. package/skills/migration-task-adapter/dependencies.yaml +21 -10
  39. package/skills/migration-task-adapter/roles/adapter-report.md +71 -0
  40. package/skills/migration-task-adapter/roles/adapter-workspace-state.md +71 -0
  41. package/skills/migration-task-adapter/roles/task-route-orchestrator.md +103 -0
  42. package/skills/migration-task-adapter/workflow.md +71 -143
  43. package/skills/android-project-analyst/MIGRATION.md +0 -53
  44. package/skills/android-to-kmp-migrator/MIGRATION.md +0 -104
  45. package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -63
  46. package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -66
  47. package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -65
  48. package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -65
  49. package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -63
  50. package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -64
  51. package/skills/kmp-test-validator/MIGRATION.md +0 -58
  52. package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -67
  53. package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -66
  54. package/skills/kmp-test-validator/roles/validation-remediation.md +0 -112
  55. package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -61
  56. package/skills/migration-task-adapter/MIGRATION.md +0 -34
  57. package/skills/migration-task-adapter/roles/task-reporter.md +0 -129
  58. package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -134
  59. package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -140
  60. package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -189
@@ -1,87 +1,77 @@
1
1
  ---
2
2
  name: migration-task-adapter
3
3
  description: |
4
- 4-role task adapter Swarm Skill that classifies an incoming Android/KMP migration request, routes only-understand tasks for UI, logic, architecture, or overview to android-project-analyst, routes migration tasks through android-project-analyst and android-to-kmp-migrator, and records stage inspections plus intermediate asset records before final reporting.
5
- Use when a controller must decide whether the user is asking for focused understanding, overview analysis, migration, or post-migration validation handoff before invoking analyst/migrator/validator workflows.
4
+ Front-door Swarm Skill that classifies Android/KMP migration requests, routes understand/migration/validation tasks to analyst, migrator, and validator workflows, and records stage gates plus asset ledgers before the final adapter report.
5
+ Use when a controller must decide task intent and invoke the correct downstream workflow before detailed analysis, migration, or validation runs.
6
6
  Do NOT use for direct source lookup, single-file edits, generic KMP testing without migration context, or standalone implementation work.
7
- version: "0.1"
7
+ version: "0.2"
8
8
  kind: swarm-skill
9
9
  disable-model-invocation: true
10
10
  roles:
11
- - id: task-understanding-router
11
+ - id: task-route-orchestrator
12
12
  kind: ai_agent
13
- purpose: Task intake and route decision owner - normalize the user request, classify only-understand vs migration, choose UI/logic/architecture/overview focus, identify required source/target paths, and emit route contracts.
14
- skills: []
15
- tools: [rg]
16
- - id: workflow-orchestrator
17
- kind: ai_agent
18
- purpose: Workflow orchestration owner - consume the route decision, build downstream analyst/migrator/validator dispatch contracts, record observed workflow results, and request reruns without doing downstream role work.
13
+ purpose: Task route and orchestration mode route (classify intent, paths, downstream sequence) or orchestrate (dispatch contracts, observed downstream outputs). No downstream role work.
19
14
  skills: []
20
15
  tools: [rg, git]
21
- - id: workspace-state-discipline-inspector
16
+ - id: adapter-workspace-state
22
17
  kind: ai_agent
23
- purpose: Discipline inspector - verify workspace-state freshness, stage inspection records, intermediate asset records, output path compliance, stale inputs, and rerun/blocker routing.
18
+ purpose: Workspace ledger stage inspections, intermediate asset records, path compliance, freshness, reruns. No routing, orchestration, or final verdict.
24
19
  skills: []
25
20
  tools: [git]
26
- - id: task-reporter
21
+ - id: adapter-report
27
22
  kind: ai_agent
28
- purpose: Final task report owner - synthesize verified adapter and downstream workflow evidence into a machine-routable task report without new analysis, migration, validation, or fixes.
23
+ purpose: Final adapter report from verified route, orchestration, workspace, stage, and downstream evidence. No new routing or workflow execution.
29
24
  skills: []
30
25
  tools: [git]
31
26
  ---
32
27
 
33
28
  # Migration Task Adapter Swarm Skill
34
29
 
35
- This is the agent-facing registry and team definition for a front-door adapter in the KMP Migration Toolkit. It does not replace `android-project-analyst`, `android-to-kmp-migrator`, or `kmp-test-validator`. It understands the user's task first, selects the right downstream workflow, enforces stage inspections, records intermediate assets, and produces a final routing/report artifact.
30
+ Front-door adapter for the KMP Migration Toolkit. It does not replace `android-project-analyst`, `android-to-kmp-migrator`, or `kmp-test-validator`. It classifies the user task, invokes the right downstream workflow, enforces stage gates, records consumed artifacts, and produces a final adapter report.
36
31
 
37
- Supported task targets:
32
+ ## Task Routes
38
33
 
39
- - `only_understand_ui`: focused UI/presentation/resource understanding through `android-project-analyst`, with emphasis on `presentation-resource` outputs.
40
- - `only_understand_logic`: focused behavior/control-flow understanding through `android-project-analyst`, with emphasis on `behavior-logic` outputs and verified Stage A inputs.
41
- - `only_understand_architecture`: focused project architecture/ecosystem understanding through `android-project-analyst`, with emphasis on `project-architecture` outputs.
42
- - `only_understand_overview`: overview understanding through the full analyst representation and SPEC verification path.
43
- - `migration`: Android-to-KMP migration through analyst completion, migrator execution, and validator handoff when migration output is ready.
44
- - `validation_handoff`: post-migration validation through `kmp-test-validator` only when migration evidence exists.
34
+ | Route | Downstream |
35
+ |---|---|
36
+ | `only_understand_ui` | `android-project-analyst` UI/presentation focus |
37
+ | `only_understand_logic` | `android-project-analyst` behavior/control-flow focus |
38
+ | `only_understand_architecture` | `android-project-analyst` architecture/ecosystem focus |
39
+ | `only_understand_overview` | `android-project-analyst` full representation + SPEC |
40
+ | `migration` | analyst (if SPEC stale) → `android-to-kmp-migrator` → optional `kmp-test-validator` |
41
+ | `validation_handoff` | `kmp-test-validator` when migration evidence exists |
45
42
 
46
43
  ## Protocol Summary
47
44
 
48
- 0. **Pre-flight** - read [dependencies.yaml](dependencies.yaml), report missing optional tools, and lock adapter output root.
49
- 1. **Task understanding and route** - dispatch `task-understanding-router`; write task classification, route decision, required evidence, and downstream workflow contract.
50
- 2. **Workspace discipline init** - dispatch `workspace-state-discipline-inspector` to initialize stage inspection and intermediate asset ledgers.
51
- 3. **Workflow orchestration** - dispatch `workflow-orchestrator` to prepare and record downstream workflow execution:
52
- - only-understand routes to `android-project-analyst`.
53
- - migration routes to `android-project-analyst` first when SPEC evidence is missing or stale, then `android-to-kmp-migrator`, then validation handoff when ready.
54
- - validation handoff routes to `kmp-test-validator` only after migration report evidence exists.
55
- 4. **Stage inspections** - after every route boundary and downstream workflow boundary, refresh `workspace-state-discipline-inspector`.
56
- 5. **Task report** - dispatch `task-reporter` only after latest discipline inspection marks required inputs fresh and intermediate asset records complete.
45
+ 0. **Pre-flight** [dependencies.yaml](dependencies.yaml); lock adapter `output_root`.
46
+ 1. **Route** `task-route-orchestrator` mode `route` `task_route.*`.
47
+ 2. **Workspace init** `adapter-workspace-state` ledger, first stage inspection, asset records.
48
+ 3. **Orchestrate** `task-route-orchestrator` mode `orchestrate` downstream dispatch contracts and observed outputs.
49
+ 4. **Stage gates** refresh `adapter-workspace-state` after each route and downstream boundary.
50
+ 5. **Report** `adapter-report` when `pre_report` stage passes and assets are complete.
57
51
 
58
52
  ## Roles
59
53
 
60
- Each role is dispatched as a subagent that must read its role file (`skill_spec_path`) and execute only that bounded slice.
61
-
62
- | id | Purpose | When dispatched | Role file |
63
- |---|---|---|---|
64
- | `task-understanding-router` | Classify request, normalize paths/scope, select route and downstream workflow contracts | First stage after output root lock | [roles/task-understanding-router.md](roles/task-understanding-router.md) |
65
- | `workflow-orchestrator` | Build dispatch contracts, track downstream workflow observations, route reruns/blockers | After route decision and before/after downstream workflow execution | [roles/workflow-orchestrator.md](roles/workflow-orchestrator.md) |
66
- | `workspace-state-discipline-inspector` | Inspect stage records, intermediate assets, output paths, workspace freshness, reruns | Initialized early and refreshed after every stage boundary | [roles/workspace-state-discipline-inspector.md](roles/workspace-state-discipline-inspector.md) |
67
- | `task-reporter` | Final machine-routable report from verified adapter/downstream artifacts | Last stage only | [roles/task-reporter.md](roles/task-reporter.md) |
54
+ | id | Modes | Role file |
55
+ |---|---|---|
56
+ | `task-route-orchestrator` | `route \| orchestrate` | [roles/task-route-orchestrator.md](roles/task-route-orchestrator.md) |
57
+ | `adapter-workspace-state` | — | [roles/adapter-workspace-state.md](roles/adapter-workspace-state.md) |
58
+ | `adapter-report` | | [roles/adapter-report.md](roles/adapter-report.md) |
68
59
 
69
60
  ## Files
70
61
 
71
- | File | What it contains |
62
+ | File | Contents |
72
63
  |---|---|
73
- | [workflow.md](workflow.md) | Adapter topology, route matrix, stage inspection gates, intermediate asset records, final report contract |
74
- | [bind.md](bind.md) | Guardrails, failure handling, path discipline, stage inspection requirements |
75
- | [dependencies.yaml](dependencies.yaml) | Optional CLI tools checked at startup |
76
- | [roles/](roles/) | Active role specs |
64
+ | [workflow.md](workflow.md) | Topology, route matrix, stage gates, report shape |
65
+ | [bind.md](bind.md) | Guardrails, path contract, failure handling |
66
+ | [dependencies.yaml](dependencies.yaml) | Downstream skills and optional tools |
67
+ | [roles/](roles/) | Role specs |
77
68
 
78
- ## Strict Output Schedule
69
+ ## Output Layout
79
70
 
80
71
  ```text
81
72
  output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
82
- task_dir = <output_root>/task
83
73
  workspace_state_dir = <output_root>/workspace-state
84
- orchestration_dir = <output_root>/orchestration
74
+ route_orchestration_dir = <output_root>/route-orchestration
85
75
  stage_inspection_dir = <output_root>/stage-inspections
86
76
  intermediate_asset_dir = <output_root>/intermediate-assets
87
77
  report_dir = <output_root>/report
@@ -89,46 +79,47 @@ report_dir = <output_root>/report
89
79
 
90
80
  Required artifacts:
91
81
 
92
- - `<output_root>/run_manifest.json`
93
- - `<task_dir>/task_understanding_router.json`
94
- - `<task_dir>/task_understanding_router.md`
95
- - `<workspace_state_dir>/workspace_state_discipline.json`
96
- - `<workspace_state_dir>/workspace_state_discipline.md`
97
- - `<stage_inspection_dir>/<stage_id>/stage_inspection.json`
98
- - `<stage_inspection_dir>/<stage_id>/stage_inspection.md`
99
- - `<intermediate_asset_dir>/intermediate_asset_records.json`
100
- - `<intermediate_asset_dir>/intermediate_asset_records.md`
101
- - `<orchestration_dir>/workflow_orchestration.json`
102
- - `<orchestration_dir>/workflow_orchestration.md`
103
- - `<report_dir>/task_adapter_report.json`
104
- - `<report_dir>/task_adapter_report.md`
82
+ - `run_manifest.json`
83
+ - `route-orchestration/route/task_route.json`, `.md`
84
+ - `workspace-state/adapter_workspace_state.json`, `.md`
85
+ - `route-orchestration/orchestrate/workflow_orchestration.json`, `.md`
86
+ - `stage-inspections/<stage_id>/stage_inspection.json`, `.md`
87
+ - `intermediate-assets/intermediate_asset_records.json`, `.md`
88
+ - `report/adapter_report.json`, `.md`
89
+
90
+ Downstream workflows write only to their own output roots; the adapter records paths in asset records.
91
+
92
+ ## Artifact Owners
93
+
94
+ | Owner | Artifacts |
95
+ |---|---|
96
+ | Leader | `run_manifest.json` |
97
+ | `task-route-orchestrator` | `task_route.*`, `workflow_orchestration.*` |
98
+ | `adapter-workspace-state` | `adapter_workspace_state.*`, `stage_inspection.*`, `intermediate_asset_records.*` |
99
+ | `adapter-report` | `adapter_report.*` |
105
100
 
106
101
  ## Shared Return Contract
107
102
 
108
103
  ```json
109
104
  {
110
105
  "status": "completed | routed | passed | ready_for_report | needs_rerun | failed | blocked",
111
- "node": "<node-id>",
112
- "task_id": "<stable task id>",
113
- "route": "<only_understand_ui | only_understand_logic | only_understand_architecture | only_understand_overview | migration | validation_handoff | unknown>",
114
- "output_dir": "<exact role output dir>",
115
- "output_files": ["<paths>"],
106
+ "node": "node-id",
107
+ "mode": "route | orchestrate",
108
+ "task_id": "",
109
+ "route": "",
110
+ "output_dir": "",
111
+ "output_files": [],
116
112
  "changed_files": [],
117
113
  "stale_upstream_inputs": [],
118
- "rerun_requests": [
119
- { "node": "<adapter or downstream node/workflow>", "reason": "", "required_inputs": [], "expected_output": "" }
120
- ],
114
+ "rerun_requests": [],
121
115
  "blocking_gaps": []
122
116
  }
123
117
  ```
124
118
 
125
- Controller handling: missing or empty output files cause rerun of the same role. Stale upstream inputs cause a discipline refresh and rerun of the owning role or downstream workflow. Non-empty `blocking_gaps` stop the adapter unless the user supplies the missing evidence.
126
-
127
119
  ## Shared Rules
128
120
 
129
- - The adapter is an orchestrator only. It does not perform detailed Android analysis, migration implementation, validation testing, or code fixes.
130
- - Task classification must happen before selecting any downstream workflow.
131
- - Stage inspections are required after route decision, before downstream dispatch, after every downstream workflow boundary, before final report, and after final report.
132
- - Every durable artifact consumed by another stage must be recorded in `intermediate_asset_records.*`.
133
- - Downstream workflow outputs are consumed by path and status only; the adapter never invents missing downstream evidence.
134
- - User-facing completion happens only after `task-reporter` writes verified report artifacts.
121
+ - Adapter roles orchestrate only no Android analysis, migration implementation, validation testing, or code fixes.
122
+ - Route classification happens before downstream workflow selection.
123
+ - Every consumed durable artifact must appear in `intermediate_asset_records.*`.
124
+ - Downstream evidence is consumed by path and status only never invented.
125
+ - Final user-facing completion requires `adapter_report.*`.
@@ -4,110 +4,46 @@
4
4
 
5
5
  | Item | Limit | Reason |
6
6
  |---|---|---|
7
- | `max_parallel_teammates` | 1 | The adapter is a control plane. Stage inspections must be serialized around downstream workflow boundaries. |
8
- | `total_wall_clock_budget` | 20 min adapter overhead | Downstream analyst/migrator/validator workflows keep their own budgets. |
9
- | `total_token_budget` | 300k adapter overhead | The adapter records contracts, inspections, and asset ledgers; it must not duplicate downstream analysis. |
10
- | `per_node_token_budget` | 80k | Roles are narrow and should cite downstream artifacts by path rather than paste large outputs. |
11
- | `max_route_retries` | 2 | Repeated route ambiguity should be surfaced to the user as a blocker. |
12
- | `max_stage_inspection_repairs` | 2 per stage | Missing or malformed inspection records are repaired by rerunning the discipline inspector, not by bypassing the gate. |
7
+ | `max_parallel_teammates` | 1 | Serial control plane; stage gates around downstream boundaries |
8
+ | `total_wall_clock_budget` | 20 min | Adapter overhead only; downstream workflows keep own budgets |
9
+ | `total_token_budget` | 300k | Record contracts and ledgers; do not duplicate downstream analysis |
10
+ | `per_node_token_budget` | 90k | Narrow roles cite paths, not full downstream outputs |
11
+ | `max_route_retries` | 2 | Persistent ambiguity user blocker |
12
+ | `max_stage_repairs` | 2 per stage | Rerun `adapter-workspace-state`; do not bypass gates |
13
13
 
14
14
  ## Behavioral Constraints
15
15
 
16
- - **Adapter-as-orchestrator only**: the Leader and adapter roles classify, route, inspect, record, and report. They do not perform detailed Android analysis, implement migration code, run validation tests, or fix target source.
17
- - **Task-first routing**: `task-understanding-router` must complete before any downstream workflow is selected. A guessed route is invalid.
18
- - **Strict output root**: the Leader must lock `output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter` before role dispatch. Adapter roles write only under this root.
19
- - **Downstream boundary**: analyst, migrator, and validator artifacts stay under their own declared output roots. The adapter records their paths and statuses in intermediate asset records.
20
- - **Stage inspection discipline**: every route boundary and downstream workflow boundary must have a `stage_inspection.json` and `.md`. A stage inspection must say whether the next stage is `pass`, `needs_rerun`, or `blocked`.
21
- - **Intermediate asset discipline**: every durable artifact consumed by another stage must have one asset record with producer, path, status, freshness basis, consumers, and gaps.
22
- - **Workspace-state freshness**: the adapter must refresh `workspace-state-discipline-inspector` after task routing, after downstream workflow completion, before report, and after report.
23
- - **No hidden fallbacks**: if analyst/migrator/validator evidence is missing or stale, route a rerun request to that workflow. Do not synthesize missing SPEC, migration report, validation report, module representation, or node output.
24
- - **Only-understand focus is a route constraint, not a license to skip evidence gates**: focused UI, logic, architecture, and overview understanding still require analyst artifacts and verification. The focus determines priority and reporting emphasis.
25
- - **Migration readiness**: migration may not start from raw source alone when the migrator requires analyst completion. If fresh SPEC evidence is missing, route analyst in migration mode first.
26
- - **Report-only finalization**: only `task-reporter` issues the adapter final task status, and only from verified adapter and downstream artifacts.
27
-
28
- ## Stage Inspection Contract
29
-
30
- Each stage inspection artifact must include:
31
-
32
- ```json
33
- {
34
- "stage_id": "",
35
- "status": "pass | needs_rerun | blocked",
36
- "checked_inputs": [],
37
- "checked_outputs": [],
38
- "path_compliance": [],
39
- "freshness_checks": [],
40
- "intermediate_asset_coverage": [],
41
- "downstream_contract_checks": [],
42
- "rerun_requests": [],
43
- "blocking_gaps": [],
44
- "next_allowed_stage": ""
45
- }
46
- ```
47
-
48
- Inspection rules:
49
-
50
- - `pass` requires all required inputs and outputs to exist, be non-empty, be under allowed roots, and be recorded in intermediate assets when consumed.
51
- - `needs_rerun` requires a concrete owner and expected output.
52
- - `blocked` requires a user/actionable gap or unavailable environment/tool/evidence.
53
-
54
- ## Intermediate Asset Record Contract
55
-
56
- Every asset record must be stable and machine-routable:
57
-
58
- ```json
59
- {
60
- "asset_id": "",
61
- "asset_type": "run_manifest | route_decision | stage_inspection | workspace_state | downstream_output | representation | spec | migration_report | validation_report | final_report | log | other",
62
- "producer": "",
63
- "path": "",
64
- "status": "exists | missing | stale | blocked | not_applicable",
65
- "created_or_observed_at": "",
66
- "freshness_basis": "",
67
- "consumers": [],
68
- "source_evidence": [],
69
- "blocking_gaps": []
70
- }
71
- ```
72
-
73
- No downstream stage may consume a durable artifact whose record is `missing`, `stale`, or `blocked`.
16
+ - **Orchestrator only** classify, route, inspect, record, report. No analysis, migration, validation, or code edits.
17
+ - **Route before downstream** — `task-route-orchestrator` mode `route` completes before workflow invoke.
18
+ - **Strict output root** `output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter`.
19
+ - **Downstream boundary** analyst/migrator/validator artifacts stay in their output roots; adapter records paths in asset ledger.
20
+ - **Validator root** validation artifacts under parallel `validation` root, not migration root.
21
+ - **Stage gates** every route and downstream boundary gets `stage_inspection.*` with `pass | needs_rerun | blocked`.
22
+ - **Asset ledger** every consumed durable artifact has one record with producer, path, status, freshness.
23
+ - **No hidden fallbacks** missing/stale evidence rerun request to owning workflow.
24
+ - **Migration readiness** migrator requires fresh analyst SPEC; route analyst first when missing.
25
+ - **Final verdict** only `adapter-report` issues adapter final status.
74
26
 
75
27
  ## Failure Handling
76
28
 
77
- ### Teammate failure
78
-
79
- | Failure mode | Response |
29
+ | Failure | Response |
80
30
  |---|---|
81
- | Node timeout | Retry once with the same contract. On second timeout, record `[ROLE MISSING - node timed out]` in workspace discipline and block any stage that hard-requires it. |
82
- | Malformed output or missing JSON/MD artifacts | Rerun the same role once with the expected schema and output paths inlined. On second failure, record `[ROLE MISSING - malformed output]` and block downstream consumption. |
83
- | Route is ambiguous | Rerun `task-understanding-router` with the ambiguity. If still ambiguous, ask the user for source path, target path, task target, or scope. |
84
- | Stage inspection missing or malformed | Rerun `workspace-state-discipline-inspector` for that `stage_id`. Do not proceed past the stage. |
85
- | Intermediate asset record missing for consumed artifact | Rerun `workspace-state-discipline-inspector` to repair the asset ledger before downstream consumption. |
86
- | Downstream workflow output missing/empty | Route rerun to the owning downstream workflow or role; do not create adapter-side replacement artifacts. |
87
- | Downstream output stale | Refresh the owning downstream workspace-state workflow if available, then rerun the owning workflow/role before consumption. |
88
- | Downstream workflow returns blocked | Preserve its blocker in adapter stage inspection and final report. Do not downgrade to a partial pass. |
89
-
90
- ### Input over-scale degradation
31
+ | Node timeout | Retry once; then `[ROLE MISSING]` and block dependent stages |
32
+ | Malformed or out-of-path output | Rerun owning role with path contract |
33
+ | Ambiguous route | Rerun mode `route`; then ask user for path/scope |
34
+ | Missing stage inspection | Rerun `adapter-workspace-state` for `stage_id` |
35
+ | Missing asset record | Rerun workspace state before consumption |
36
+ | Downstream missing/stale | Rerun owning downstream workflow |
91
37
 
92
- | Trigger condition | Degraded mode |
93
- |---|---|
94
- | User asks for whole-project overview without a scope on a very large Android project | Route to `only_understand_overview` with a scope-narrowing blocker or ask for feature/module priority. |
95
- | User asks for migration without a KMP target path | Route classification may complete, but orchestration blocks before migrator dispatch. |
96
- | User asks for validation without migration report/SPEC evidence | Route to `validation_handoff` only as blocked, listing required migration evidence. |
97
- | Existing downstream artifacts are too large to inspect inline | Record paths and status only; require downstream report/verification artifacts instead of pasting node contents. |
98
-
99
- ## Required Path Contract
38
+ ## Path Contract
100
39
 
101
40
  ```json
102
41
  {
103
42
  "output_root": "<output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter",
104
- "task_dir": "<output_root>/task",
105
43
  "workspace_state_dir": "<output_root>/workspace-state",
106
- "orchestration_dir": "<output_root>/orchestration",
44
+ "route_orchestration_dir": "<output_root>/route-orchestration",
107
45
  "stage_inspection_dir": "<output_root>/stage-inspections",
108
46
  "intermediate_asset_dir": "<output_root>/intermediate-assets",
109
47
  "report_dir": "<output_root>/report"
110
48
  }
111
49
  ```
112
-
113
- Reject adapter artifacts outside this path contract. For downstream workflows, record their own output roots as external asset paths with producer workflow metadata.
@@ -1,26 +1,37 @@
1
- # dependencies.yaml - Migration Task Adapter startup dependency check
2
- #
3
- # All tools are optional. The adapter can still route and report with file-system
4
- # evidence, but degraded checks must be recorded in stage inspections.
1
+ # dependencies.yaml — migration-task-adapter startup check
5
2
 
6
3
  skills:
7
4
  - name: android-project-analyst
8
5
  required: false
9
- purpose: Downstream workflow for only-understand UI, logic, architecture, overview, and pre-migration SPEC generation.
6
+ used_by:
7
+ - task-route-orchestrator
8
+ purpose: Downstream for understand routes and pre-migration SPEC.
10
9
  - name: android-to-kmp-migrator
11
10
  required: false
12
- purpose: Downstream workflow for Android-to-KMP migration after analyst evidence is fresh.
11
+ used_by:
12
+ - task-route-orchestrator
13
+ purpose: Downstream for migration after analyst evidence is fresh.
13
14
  - name: kmp-test-validator
14
15
  required: false
15
- purpose: Downstream workflow for post-migration validation when migration report evidence is ready.
16
+ used_by:
17
+ - task-route-orchestrator
18
+ purpose: Downstream for validation when migration report exists; validation root is parallel to migration.
16
19
 
17
20
  tools:
18
21
  - name: rg
19
22
  required: false
20
- purpose: Optional path and evidence discovery for task routing; built-in search/read tools may substitute.
23
+ used_by:
24
+ - task-route-orchestrator
25
+ purpose: Optional evidence discovery for routing.
21
26
  - name: git
22
27
  required: false
23
- purpose: Optional changed-file and freshness detection for workspace-state discipline inspections.
28
+ used_by:
29
+ - task-route-orchestrator
30
+ - adapter-workspace-state
31
+ - adapter-report
32
+ purpose: Changed-file and freshness checks for ledger and report.
24
33
  - name: curl
25
34
  required: false
26
- purpose: Optional availability check because downstream presentation/resource workflows may need safe media downloads.
35
+ used_by:
36
+ - task-route-orchestrator
37
+ purpose: Optional; downstream analyst presentation workflows may fetch remote media.
@@ -0,0 +1,71 @@
1
+ # Role: Adapter Report
2
+
3
+ ## Identity
4
+
5
+ > "I issue the final adapter verdict from verified route, orchestration, workspace, stage, and downstream evidence only."
6
+
7
+ You are the `adapter-report` node subagent. You synthesize verified adapter and downstream artifacts into the final task report. You do not reclassify routes, orchestrate workflows, analyze source, migrate, validate, or fix code.
8
+
9
+ ## Success Criteria
10
+
11
+ - `adapter_report.json` and `adapter_report.md` under `report_dir`.
12
+ - Final status from verified evidence: `completed`, `ready_for_validation`, `needs_rerun`, `failed`, or `blocked`.
13
+ - Every claim cites an adapter artifact, stage inspection, asset record, or downstream report path.
14
+ - Missing `pre_report` inspection or stale required inputs → `needs_rerun` or `blocked`.
15
+
16
+ ## Status Rules
17
+
18
+ - `completed` — understand route satisfied; inspections pass; assets recorded.
19
+ - `ready_for_validation` — migration report ready; validation not run in this adapter pass.
20
+ - `needs_rerun` — concrete owner can resolve missing/stale evidence.
21
+ - `failed` — downstream workflow failed with verified evidence.
22
+ - `blocked` — missing path, evidence, or user decision.
23
+
24
+ ## Boundary
25
+
26
+ **Forbidden**:
27
+
28
+ - Do not repair stage inspections or alter orchestration contracts.
29
+ - Do not claim downstream pass without report artifacts and latest stage inspection support.
30
+
31
+ **Mandatory**:
32
+
33
+ - Validate all required input paths; use latest `pre_report` stage inspection before reporting.
34
+
35
+ ## Output Schema
36
+
37
+ ```json
38
+ {
39
+ "status": "completed | ready_for_validation | needs_rerun | failed | blocked",
40
+ "node": "adapter-report",
41
+ "task_id": "",
42
+ "route": "",
43
+ "understand_focus": "ui | logic | architecture | overview | mixed | none",
44
+ "source_project_path": "",
45
+ "target_project_path": "",
46
+ "downstream_workflows": [],
47
+ "stage_inspection_summary": [],
48
+ "intermediate_asset_summary": {},
49
+ "verified_outputs": [],
50
+ "readiness": "ready | ready_with_assumptions | ready_for_validation | blocked",
51
+ "rerun_requests": [],
52
+ "blocking_gaps": [],
53
+ "report_path": ""
54
+ }
55
+ ```
56
+
57
+ ## Output Files
58
+
59
+ - `adapter_report.json`, `adapter_report.md`
60
+
61
+ ## Inline Persona
62
+
63
+ ```text
64
+ ROLE: adapter-report.
65
+
66
+ Synthesize final adapter status from task_route, workflow_orchestration, adapter_workspace_state, stage inspections, asset records, and downstream reports.
67
+
68
+ INPUTS: task_id, route, task_route_path, workflow_orchestration_path, adapter_workspace_state_path, pre_report_stage_inspection_path, intermediate_asset_records_path, downstream_report_paths, report_dir.
69
+
70
+ Do not reclassify, orchestrate, analyze, migrate, validate, or fix.
71
+ ```
@@ -0,0 +1,71 @@
1
+ # Role: Adapter Workspace State
2
+
3
+ ## Identity
4
+
5
+ > "I keep the adapter ledger honest — stage gates, asset records, path compliance, and stale inputs."
6
+
7
+ You are the `adapter-workspace-state` node subagent. You maintain the workspace ledger, stage inspection records, and intermediate asset records. You do not route tasks, orchestrate downstream workflows, analyze source, migrate, validate, fix code, or issue the final report.
8
+
9
+ ## Success Criteria
10
+
11
+ - `adapter_workspace_state.json` and `.md` under `workspace_state_dir`.
12
+ - Per requested `stage_id`: `stage_inspection.json` and `.md` under `stage_inspection_dir/<stage_id>/`.
13
+ - `intermediate_asset_records.json` and `.md` under `intermediate_asset_dir`.
14
+ - Every consumed artifact has one asset record; every stage declares `pass`, `needs_rerun`, or `blocked`.
15
+
16
+ ## Boundary
17
+
18
+ **Forbidden**:
19
+
20
+ - Do not classify routes or build dispatch contracts (`task-route-orchestrator`).
21
+ - Do not issue final adapter status (`adapter-report`).
22
+ - Do not move or rewrite downstream workflow artifacts.
23
+
24
+ **Mandatory**:
25
+
26
+ - Validate `output_root`, stage and asset dirs, and known artifact paths.
27
+ - Treat missing/stale/out-of-path artifacts as `needs_rerun` or `blocked`.
28
+
29
+ ## Output Schema
30
+
31
+ ```json
32
+ {
33
+ "status": "passed | needs_rerun | blocked",
34
+ "node": "adapter-workspace-state",
35
+ "task_id": "",
36
+ "route": "",
37
+ "current_stage_id": "",
38
+ "stage_status": [],
39
+ "artifact_inventory": [],
40
+ "path_compliance": [],
41
+ "freshness_checks": [],
42
+ "rerun_history": [],
43
+ "blocking_gaps": [],
44
+ "next_actions": []
45
+ }
46
+ ```
47
+
48
+ ## Stage IDs
49
+
50
+ - `route_decision` — after task-route-orchestrator mode `route`
51
+ - `pre_downstream_dispatch` — before downstream invoke
52
+ - `post_analyst` | `post_migrator` | `post_validator` — after applicable workflow
53
+ - `pre_report` | `post_report` — around adapter-report
54
+
55
+ ## Output Files
56
+
57
+ - `adapter_workspace_state.json`, `adapter_workspace_state.md`
58
+ - `<stage_inspection_dir>/<stage_id>/stage_inspection.json`, `.md`
59
+ - `<intermediate_asset_dir>/intermediate_asset_records.json`, `.md`
60
+
61
+ ## Inline Persona
62
+
63
+ ```text
64
+ ROLE: adapter-workspace-state.
65
+
66
+ Inspect stage gates, record intermediate assets, track freshness and path compliance. Route stale or missing artifacts to the owning role or downstream workflow.
67
+
68
+ INPUTS: task_id, route, current_stage_id, output_root, known_artifacts, consumed_artifacts, downstream_observations, output_dir, stage_inspection_dir, intermediate_asset_dir.
69
+
70
+ Do not route, orchestrate, analyze, migrate, validate, or report final status.
71
+ ```