@code-migration/wow-migrator 0.2.1 → 0.2.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-to-kmp-migrator/SKILL.md +12 -5
- package/skills/android-to-kmp-migrator/bind.md +11 -0
- package/skills/android-to-kmp-migrator/output-contract.md +32 -10
- package/skills/android-to-kmp-migrator/roles/completion-report.md +2 -1
- package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +1 -0
- package/skills/android-to-kmp-migrator/roles/migration-prep.md +6 -0
- package/skills/android-to-kmp-migrator/roles/migration-verification.md +5 -3
- package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +1 -1
- package/skills/android-to-kmp-migrator/workflow.md +11 -0
- package/skills/kmp-test-validator/SKILL.md +3 -3
- package/skills/kmp-test-validator/bind.md +3 -2
- package/skills/kmp-test-validator/dependencies.yaml +15 -2
- package/skills/kmp-test-validator/output-contract.md +92 -8
- package/skills/kmp-test-validator/roles/validation-code-gate.md +53 -7
- package/skills/kmp-test-validator/roles/validation-workspace-state.md +7 -2
- package/skills/kmp-test-validator/workflow.md +3 -1
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: android-to-kmp-migrator
|
|
3
3
|
description: |
|
|
4
|
-
Module-first Swarm Skill that migrates Legacy Android into an existing KMP target
|
|
5
|
-
Use only after android-project-analyst has finished and package P6 is ready, when the user wants module-first porting then whole-system assembly followed by validation.
|
|
6
|
-
Do NOT invoke before android-project-analyst completes P6. Do NOT treat migrator completion as final without invoking kmp-test-validator at V0. Do NOT use for Legacy Android analysis only, KMP-only feature work, or non-migration refactors.
|
|
7
|
-
version: "0.
|
|
4
|
+
Module-first Swarm Skill that migrates Legacy Android into an existing KMP target by editing target KMP source after analyst P6 understanding — planning/prep/implementation roles create and update files under kmp_target_project_path, global integrate wires cross-module glue, then mandatory kmp-test-validator handoff — without full-project build during migration.
|
|
5
|
+
Use only after android-project-analyst has finished and package P6 is ready, when the user wants module-first porting with real target code changes then whole-system assembly followed by validation.
|
|
6
|
+
Do NOT invoke before android-project-analyst completes P6. Do NOT treat planning or analysis artifacts alone as migration success — target KMP files MUST be edited. Do NOT treat migrator completion as final without invoking kmp-test-validator at V0. Do NOT use for Legacy Android analysis only, KMP-only feature work, or non-migration refactors.
|
|
7
|
+
version: "0.9"
|
|
8
8
|
kind: swarm-skill
|
|
9
9
|
disable-model-invocation: false
|
|
10
10
|
roles:
|
|
@@ -57,7 +57,7 @@ roles:
|
|
|
57
57
|
|
|
58
58
|
# Android To KMP Migrator Swarm Skill
|
|
59
59
|
|
|
60
|
-
Module-first migrator for Legacy Android → KMP target assembly.
|
|
60
|
+
Module-first migrator for Legacy Android → KMP target assembly. **Upstream analyst P6 is read-only input; this skill's job is to edit the target KMP project** under `kmp_target_project_path`.
|
|
61
61
|
|
|
62
62
|
**Canonical contract**: [output-contract.md](output-contract.md)
|
|
63
63
|
|
|
@@ -123,6 +123,13 @@ android-project-analyst (P6) → android-to-kmp-migrator (M0–V0) → kmp-test-
|
|
|
123
123
|
## Shared Rules
|
|
124
124
|
|
|
125
125
|
- **Skill chain**: `android-project-analyst` **P6** before migrator; `kmp-test-validator` **after** migrator **V0** — both mandatory.
|
|
126
|
+
- **Target KMP edit mandate**: after analyst P6 understanding, migrator roles MUST create or update production files under `kmp_target_project_path`. Planning-only or artifact-only completion is invalid.
|
|
127
|
+
- **Roles that edit target** (record `changed_files[]` or `integration_changed_files[]`):
|
|
128
|
+
- `migration-prep` — optional scaffold edits (theme, resources, routes, models) when planning allows
|
|
129
|
+
- `module-implementation` `ui` / `logic` — required per-module UI and logic port
|
|
130
|
+
- `module-node-review-fix` `fix` — scoped remediation in `allowed_files`
|
|
131
|
+
- `global-migration-phase` `integrate` — cross-module glue and entry-point wiring
|
|
132
|
+
- **Read-only on target**: `target-project-assistant`, `migration-planning-gate`, `migration-verification`, `global-migration-phase` `align`, `completion-report`.
|
|
126
133
|
- Analyst **P6** required; TPA owns all target Q&A.
|
|
127
134
|
- Mode boundaries non-negotiable: `ui`/`logic`, `integrate`/`align`, `review`/`fix`.
|
|
128
135
|
- No full project build in migrator.
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
- **Forbidden**: `incremental_build` in migrator.
|
|
17
17
|
- **kmp-test-validator**: full compile/build/test at package **V0**.
|
|
18
18
|
|
|
19
|
+
## Target KMP Edit Mandate
|
|
20
|
+
|
|
21
|
+
- Analyst **P6** is read-only input. Migrator success requires **editing the target KMP project** at `kmp_target_project_path`.
|
|
22
|
+
- **Edit-owning roles**: `migration-prep` (optional scaffold), `module-implementation` `ui`/`logic` (required), `module-node-review-fix` `fix`, `global-migration-phase` `integrate`.
|
|
23
|
+
- **Read-only on target**: TPA, `migration-planning-gate`, `migration-verification`, `global-migration-phase` `align`, `completion-report`.
|
|
24
|
+
- When planning tasks require file changes, `changed_files[]` MUST be non-empty and paths MUST resolve under `kmp_target_project_path`.
|
|
25
|
+
- `migration_report.json` MUST aggregate `target_changed_files[]` before **V0**.
|
|
26
|
+
|
|
19
27
|
## Behavioral Constraints
|
|
20
28
|
|
|
21
29
|
- **Skill chain (mandatory)**:
|
|
@@ -44,6 +52,9 @@
|
|
|
44
52
|
| Build requested in migrator | Block; route to kmp-test-validator |
|
|
45
53
|
| Migrator invoked before analyst P6 | Block; dispatch `android-project-analyst` first |
|
|
46
54
|
| V0 ready but validator not invoked | Block; dispatch `kmp-test-validator` at MG17 |
|
|
55
|
+
| Analysis/planning only — no target edits when required | Block package M3; rerun `module-implementation` or `migration-prep` |
|
|
56
|
+
| `changed_files` outside `kmp_target_project_path` | Block; rerun owning edit role |
|
|
57
|
+
| Empty `target_changed_files` in `migration_report.json` when scope required edits | Block package V0 |
|
|
47
58
|
|
|
48
59
|
## Dependencies
|
|
49
60
|
|
|
@@ -128,6 +128,19 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
|
|
|
128
128
|
- **`incremental_build` is forbidden** in `migration-verification` during migrator runs.
|
|
129
129
|
- **Full compile/build/preview/behavioral tests** are delegated to **`kmp-test-validator`** after `migration_report.*` handoff package **`V0`** is ready.
|
|
130
130
|
|
|
131
|
+
### Target KMP Edit Mandate (mandatory)
|
|
132
|
+
|
|
133
|
+
- **Purpose**: `android-project-analyst` **P6** supplies Legacy Android understanding only. The migrator MUST translate that understanding into **concrete edits** in the existing KMP target at `kmp_target_project_path`.
|
|
134
|
+
- **Analysis alone is not migration**: planning gates, prep handoffs, TPA alignment, and representations do **not** satisfy migration without target file changes where tasks require implementation.
|
|
135
|
+
- **Edit-owning roles** (each MUST record paths under `kmp_target_project_path`):
|
|
136
|
+
- `migration-prep` → `migration_prep.json` → `changed_files[]` (optional scaffold when planning allows)
|
|
137
|
+
- `module-implementation` `ui` / `logic` → `module_implementation_ui.json` / `module_implementation_logic.json` → `changed_files[]`, `target_edit_summary`
|
|
138
|
+
- `module-node-review-fix` `fix` → `module_node_fix.json` → `changed_files[]`
|
|
139
|
+
- `global-migration-phase` `integrate` → `global_system_integration.json` → `integration_changed_files[]`, `entry_point_wiring[]`
|
|
140
|
+
- **Read-only on target**: `target-project-assistant`, `migration-planning-gate`, `migration-verification`, `global-migration-phase` `align`, `completion-report`.
|
|
141
|
+
- **Fail closed**: when `migration_planning_gate.json` → `planning.tasks[]` includes file-changing work for a module, package **M3** is false if both `module_implementation_ui.json` and `module_implementation_logic.json` have empty `changed_files[]` or paths resolve outside `kmp_target_project_path`.
|
|
142
|
+
- **Aggregation**: `migration_report.json` MUST include `target_changed_files[]` — deduplicated union of all module and global integrate target paths with `owning_role` and `migration_module_id` (or `global` for integrate).
|
|
143
|
+
|
|
131
144
|
---
|
|
132
145
|
|
|
133
146
|
## Write Order (Leader Schedule)
|
|
@@ -184,8 +197,9 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
|
|
|
184
197
|
| `migration-planning-gate/migration_planning_gate.json` |
|
|
185
198
|
| `migration-prep/migration_prep.json` |
|
|
186
199
|
| `module-implementation/ui/module_implementation_ui.json`, `module-implementation/logic/module_implementation_logic.json` + approved reviews |
|
|
187
|
-
|
|
|
188
|
-
| `
|
|
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 |
|
|
189
203
|
|
|
190
204
|
### Package `M4` — All modules migrated
|
|
191
205
|
|
|
@@ -199,7 +213,7 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
|
|
|
199
213
|
| Required paths |
|
|
200
214
|
|---|
|
|
201
215
|
| Package `M4` |
|
|
202
|
-
| `global/node-results/global-migration-phase/integrate/global_system_integration.json` |
|
|
216
|
+
| `global/node-results/global-migration-phase/integrate/global_system_integration.json` with non-empty `integration_changed_files[]` when cross-module glue or entry-point wiring is required |
|
|
203
217
|
| `global_migration_representation.json` |
|
|
204
218
|
|
|
205
219
|
### Package `M6` — Post-integration alignment passed
|
|
@@ -215,7 +229,7 @@ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
|
|
|
215
229
|
| Required paths |
|
|
216
230
|
|---|
|
|
217
231
|
| Package `M6` |
|
|
218
|
-
| `report/migration_report.json` |
|
|
232
|
+
| `report/migration_report.json` with non-empty `target_changed_files[]` when any scheduled module required implementation |
|
|
219
233
|
| `global_migration_representation.json` |
|
|
220
234
|
| analyst `SPEC/*` paths recorded in `run_manifest.json` |
|
|
221
235
|
|
|
@@ -262,8 +276,10 @@ Machine lookup: `migration_module_id` → `legacy_module_id`, `module_output_roo
|
|
|
262
276
|
{
|
|
263
277
|
"migration_module_id": "",
|
|
264
278
|
"legacy_module_id": "",
|
|
279
|
+
"kmp_target_project_path": "",
|
|
265
280
|
"completion_status": "completed | needs_rerun | blocked",
|
|
266
281
|
"verification_ref": "",
|
|
282
|
+
"target_changed_files": [{ "path": "", "owning_role": "migration-prep | module-implementation | module-node-review-fix", "mode": "ui | logic | fix | null" }],
|
|
267
283
|
"ui_restoration": { "status": "passed | failed", "gaps": [] },
|
|
268
284
|
"logic_restoration": { "status": "passed | failed", "gaps": [] },
|
|
269
285
|
"upstream_match": { "module_representation_path": "", "matched_claims": [], "missing_claims": [] },
|
|
@@ -274,6 +290,7 @@ Machine lookup: `migration_module_id` → `legacy_module_id`, `module_output_roo
|
|
|
274
290
|
|
|
275
291
|
### `migration_verification.json` — required `check_ids` (migrator only)
|
|
276
292
|
|
|
293
|
+
- `target_files_exist` — every path in aggregated module `changed_files[]` exists on disk under `kmp_target_project_path`
|
|
277
294
|
- `source_set` — files in allowed source sets
|
|
278
295
|
- `syntax_check` — Kotlin/syntax validity on changed files (static; no full project compile)
|
|
279
296
|
- `api_contract` — API/model shape vs planning + analyst data contracts
|
|
@@ -313,12 +330,14 @@ Human/agent-readable synthesis of align mode; includes `entry_point_alignment_re
|
|
|
313
330
|
|
|
314
331
|
1. Verify analyst package `P6` before `MG0` completes.
|
|
315
332
|
2. Dispatch `target-project-assistant` for all target-project questions; other roles MUST reference TPA artifacts instead of re-analyzing target ad hoc.
|
|
316
|
-
3.
|
|
317
|
-
4.
|
|
318
|
-
5. Run `global-migration-phase` `
|
|
319
|
-
6.
|
|
320
|
-
7.
|
|
321
|
-
8.
|
|
333
|
+
3. Ensure each module produces **target KMP edits** via `module-implementation` (and optional `migration-prep` / `module-node-review-fix` `fix`) before writing `module_completion_record.json`.
|
|
334
|
+
4. Write `module_completion_record.json` after each module passes `migration-verification`; include aggregated `target_changed_files[]` for the module.
|
|
335
|
+
5. Run `global-migration-phase` `integrate` only after package `M4`; integrate MUST edit target glue when assembly requires it.
|
|
336
|
+
6. Run `global-migration-phase` `align` only after integrate; **no code changes** in align mode.
|
|
337
|
+
7. Dispatch only role IDs listed in [SKILL.md](SKILL.md).
|
|
338
|
+
8. Set `handoff_gates` (`M0`–`M6`, `V0`) in workspace ledger and `migration_report.json`.
|
|
339
|
+
9. Aggregate all module and global integrate target paths into `migration_report.json` → `target_changed_files[]`.
|
|
340
|
+
10. **MUST** invoke `kmp-test-validator` when `V0` is true (MG17). Do not end the migration workflow without validator dispatch or explicit validator blockers in `migration_report.json`.
|
|
322
341
|
|
|
323
342
|
## Invalid Artifact Handling
|
|
324
343
|
|
|
@@ -331,3 +350,6 @@ Human/agent-readable synthesis of align mode; includes `entry_point_alignment_re
|
|
|
331
350
|
| `module_completion_record` failed | Re-enter module loop from routed node |
|
|
332
351
|
| `post_integration_alignment` omissions | Rerun listed modules or `global-migration-phase integrate` |
|
|
333
352
|
| Full build requested during migrator | Reject — route to `kmp-test-validator` |
|
|
353
|
+
| Planning complete but `changed_files[]` empty when tasks require edits | `needs_rerun` → `module-implementation` or `migration-prep` |
|
|
354
|
+
| `changed_files` paths outside `kmp_target_project_path` | `blocked` — reject artifact; rerun owning role |
|
|
355
|
+
| `target_files_exist` failed | `needs_rerun` → owning edit role |
|
|
@@ -29,6 +29,7 @@ Forbidden:
|
|
|
29
29
|
- Do not treat report mode success as final migration completion — Leader must still dispatch `kmp-test-validator` at MG17.
|
|
30
30
|
|
|
31
31
|
Mandatory:
|
|
32
|
+
- Report mode MUST fail when scheduled modules required implementation but `target_changed_files[]` would be empty.
|
|
32
33
|
- Validate `mode`, `migration_module_id`, module/global representation paths, workspace state, and exact `output_dir`.
|
|
33
34
|
- Readiness output path is `<module_root>/node-results/completion-report/readiness` or `<global_dir>/node-results/completion-report/readiness`.
|
|
34
35
|
- Report output path is `<output_root>/report`.
|
|
@@ -60,7 +61,7 @@ Shared return shape applies.
|
|
|
60
61
|
|
|
61
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.
|
|
62
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.
|
|
63
|
-
- `migration_report.json`: machine-routable final migration handoff containing migration scope, source/target paths, analyst_output_root, upstream_analyst_index, `handoff_gates` (`M0`–`M6`, `V0`), `handoff_package: V0`, module representations, global representation, `alignment_report` path, `global_system_integration` path, changed files by role, coverage summary, validation inputs for kmp-test-validator, `validation_deferred_to: kmp-test-validator`, limitations, blockers.
|
|
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
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.
|
|
65
66
|
- Report mode success signals Leader to **mandatorily invoke** `kmp-test-validator` — migration is incomplete without validator dispatch.
|
|
66
67
|
|
|
@@ -17,6 +17,7 @@ You are the `migration-planning-gate` node subagent. You merge **migration analy
|
|
|
17
17
|
|
|
18
18
|
**Forbidden**:
|
|
19
19
|
- Do not re-survey target project (consume `target-project-assistant` artifacts only).
|
|
20
|
+
- Do not edit target KMP source files — planning routes edits to `migration-prep` and `module-implementation`.
|
|
20
21
|
- Do not implement UI, repositories, or business logic.
|
|
21
22
|
- Do not add dependencies for convenience.
|
|
22
23
|
|
|
@@ -14,16 +14,22 @@ You are the `migration-prep` node subagent. You merge **presentation integration
|
|
|
14
14
|
- Changed files recorded; cross-module impacts noted.
|
|
15
15
|
- No full UI layouts or repository/API behavior.
|
|
16
16
|
|
|
17
|
+
## Target KMP Edit Mandate (optional scaffold)
|
|
18
|
+
|
|
19
|
+
When planning allows prep-time file changes, you MAY create or update target scaffold files (theme tokens, shared resources, route stubs, model shells) under `kmp_target_project_path` and `allowed_files`. Record every path in `changed_files[]`. Full screens and business logic belong in `module-implementation`.
|
|
20
|
+
|
|
17
21
|
## Boundary
|
|
18
22
|
|
|
19
23
|
**Forbidden**:
|
|
20
24
|
- Do not implement visible UI screens or business logic.
|
|
21
25
|
- Do not add dependencies or create standalone modules.
|
|
22
26
|
- Do not invent missing assets or API fields.
|
|
27
|
+
- Do not edit Legacy Android source.
|
|
23
28
|
|
|
24
29
|
**Mandatory**:
|
|
25
30
|
- Validate `migration_planning_gate` output, analyst presentation/data/behavior evidence, TPA anchors.
|
|
26
31
|
- Use `output_dir = <output_root>/modules/<migration_module_id>/node-results/migration-prep`.
|
|
32
|
+
- When `changed_files[]` is non-empty, every path MUST resolve under `kmp_target_project_path`; file-changing prep requires review before `module-implementation`.
|
|
27
33
|
- `curl` optional for online resource fetch; gaps recorded when unavailable.
|
|
28
34
|
|
|
29
35
|
## Output Schema
|
|
@@ -8,6 +8,7 @@ You are the `migration-verification` node subagent. You verify one `migration_mo
|
|
|
8
8
|
|
|
9
9
|
## Required Check IDs (migrator only)
|
|
10
10
|
|
|
11
|
+
- `target_files_exist`
|
|
11
12
|
- `source_set`
|
|
12
13
|
- `syntax_check`
|
|
13
14
|
- `api_contract`
|
|
@@ -29,6 +30,7 @@ If a dispatch contract includes forbidden check ids, return `blocked` and cite [
|
|
|
29
30
|
- Every required `check_id` has `passed | failed | blocked`.
|
|
30
31
|
- `ui_restoration` and `logic_restoration` cite upstream analyst paths and list gaps explicitly.
|
|
31
32
|
- `syntax_check` validates changed Kotlin/files statically without assembling the whole project.
|
|
33
|
+
- `target_files_exist` confirms every aggregated module `changed_files[]` path exists on disk under `kmp_target_project_path`.
|
|
32
34
|
- Failures route to owning roles per `SKILL.md`; Leader writes `module_completion_record.json` only when all checks pass.
|
|
33
35
|
|
|
34
36
|
## Boundary
|
|
@@ -56,7 +58,7 @@ If a dispatch contract includes forbidden check ids, return `blocked` and cite [
|
|
|
56
58
|
"upstream_module_representation_path": "",
|
|
57
59
|
"check_results": [
|
|
58
60
|
{
|
|
59
|
-
"check_id": "source_set | syntax_check | api_contract | ui_render | ui_restoration | logic_restoration",
|
|
61
|
+
"check_id": "target_files_exist | source_set | syntax_check | api_contract | ui_render | ui_restoration | logic_restoration",
|
|
60
62
|
"status": "passed | failed | blocked",
|
|
61
63
|
"evidence": [],
|
|
62
64
|
"failures": [],
|
|
@@ -86,8 +88,8 @@ Write only under `output_dir = <output_root>/modules/<migration_module_id>/node-
|
|
|
86
88
|
```text
|
|
87
89
|
ROLE: migration-verification node.
|
|
88
90
|
|
|
89
|
-
Run module-scoped checks ONLY: source_set, syntax_check, api_contract,
|
|
90
|
-
ui_restoration, logic_restoration. Compare UI/logic to upstream analyst module_representation.
|
|
91
|
+
Run module-scoped checks ONLY: target_files_exist, source_set, syntax_check, api_contract,
|
|
92
|
+
ui_render, ui_restoration, logic_restoration. Compare UI/logic to upstream analyst module_representation.
|
|
91
93
|
|
|
92
94
|
DO NOT run incremental_build or full project compile — kmp-test-validator owns that.
|
|
93
95
|
|
|
@@ -16,7 +16,7 @@ You are the `module-node-review-fix` node subagent. You consolidate review and f
|
|
|
16
16
|
- Review mode writes `module_node_review.json` and `module_node_review.md`.
|
|
17
17
|
- Fix mode writes `module_node_fix.json` and `module_node_fix.md`.
|
|
18
18
|
- Review mode edits no files.
|
|
19
|
-
- Fix mode edits only `allowed_files`, sets `requires_re_review: true`, and never self-approves.
|
|
19
|
+
- Fix mode edits only `allowed_files` under `kmp_target_project_path`, sets `requires_re_review: true`, records `changed_files[]`, and never self-approves.
|
|
20
20
|
|
|
21
21
|
## Boundary
|
|
22
22
|
|
|
@@ -10,6 +10,16 @@ See [output-contract.md](output-contract.md) and active role IDs in [SKILL.md](S
|
|
|
10
10
|
| Migration | `android-to-kmp-migrator` | **M0**–**V0** | Runs only after P6 verified; ends with `migration_report.*` and **V0** ready. |
|
|
11
11
|
| Post-migration | `kmp-test-validator` | **V0** | MUST be invoked after migrator completes **V0** (MG17). Do not end the migration workflow without validator dispatch. |
|
|
12
12
|
|
|
13
|
+
## Target KMP Edit Flow
|
|
14
|
+
|
|
15
|
+
After analyst **P6** understanding (read-only), the migrator **edits** `kmp_target_project_path`:
|
|
16
|
+
|
|
17
|
+
1. **Per module**: `migration-prep` (optional scaffold) → `module-implementation` `ui` → `logic` (required target edits) → review/fix remediation as needed.
|
|
18
|
+
2. **Global**: `global-migration-phase` `integrate` edits cross-module glue and entry-point wiring.
|
|
19
|
+
3. **Align** is read-only verification — reruns integrate or module implementation when target edits are missing or wrong.
|
|
20
|
+
|
|
21
|
+
Planning and TPA artifacts route edits; they do not replace implementation.
|
|
22
|
+
|
|
13
23
|
## Overview
|
|
14
24
|
|
|
15
25
|
```mermaid
|
|
@@ -115,6 +125,7 @@ Any target question → TPA `mode: consult` (append `consultation_log`).
|
|
|
115
125
|
## Acceptance Criteria
|
|
116
126
|
|
|
117
127
|
- `android-project-analyst` **P6** verified before any migrator module dispatch.
|
|
128
|
+
- Target KMP files created or updated under `kmp_target_project_path` for every module requiring implementation; `target_changed_files[]` aggregated in `migration_report.json`.
|
|
118
129
|
- `kmp-test-validator` invoked after **V0** — mandatory MG17 step.
|
|
119
130
|
- Dispatch only role IDs from `SKILL.md`.
|
|
120
131
|
- Mode rules: `ui` before `logic`; `integrate` before `align`; `review`/`fix` separate.
|
|
@@ -48,7 +48,7 @@ The team is a **serial pipeline with two controller loops**: code-gate fix remed
|
|
|
48
48
|
0. **Pre-flight** — [dependencies.yaml](dependencies.yaml); verify migrator `V0`; lock output root.
|
|
49
49
|
1. **Workspace state** — ledger + `handoff_gates`.
|
|
50
50
|
2. **Fidelity gate `trust`** — migration trigger + pre-build fidelity (`VG1`).
|
|
51
|
-
3. **Code gate `build`** — three-scenario compile + build/preview (`VG2`); on failure → code gate `fix` → rerun `build` (max 3 cycles).
|
|
51
|
+
3. **Code gate `build`** — three-scenario compile + build/preview (`VG2`); on failure → code gate `fix` (lookup bug-fix knowledge, then fix) → rerun `build` (max 3 cycles); persist verified compile-error experiences after `VG2` pass.
|
|
52
52
|
4. **Fidelity gate `restoreability`** — post-build restoreability (`VG3`); migrator supplement loop (max 3) when required.
|
|
53
53
|
5. **Business testing** — optional behavioral / Figma submodules when user inputs exist (`VG4`).
|
|
54
54
|
6. **Final report** — `validation-report` (`VG5`).
|
|
@@ -91,7 +91,7 @@ See [output-contract.md](output-contract.md) for full layout. No validator artif
|
|
|
91
91
|
| Leader | `run_manifest.json`, `upstream_migration_index.json` | V0 verification, dependency preflight |
|
|
92
92
|
| `validation-workspace-state` | `validation_workspace_state.*` | `handoff_gates` VG0–VG5, cycle counts |
|
|
93
93
|
| `validation-fidelity-gate` | `trust/validation_fidelity_trust.*`, `restoreability/validation_restoreability_audit.*` | Pre-build trust or post-build restoreability per mode |
|
|
94
|
-
| `validation-code-gate` | `build/validation_code_build.*`, `fix/<cycle>/validation_code_fix.*`, code-gate logs | Compile scenario + build/preview (build mode)
|
|
94
|
+
| `validation-code-gate` | `build/validation_code_build.*`, `fix/<cycle>/validation_code_fix.*`, `knowledge/compile_error_knowledge.*`, `knowledge/entries/<entry_id>/bug_fix_experience.*`, code-gate logs | Compile scenario + build/preview (build mode); target KMP edits + knowledge lookup/candidates (fix mode); verified bug-fix experiences (after `VG2` pass) |
|
|
95
95
|
| `validation-business-testing` | `validation_business_testing.*`, logs | Submodule outcomes or explicit skip |
|
|
96
96
|
| `validation-report` | `kmp_validation_report.*` | Evidence-backed final verdict |
|
|
97
97
|
|
|
@@ -116,5 +116,5 @@ See [output-contract.md](output-contract.md) for full layout. No validator artif
|
|
|
116
116
|
- Dispatch only role IDs listed in this registry.
|
|
117
117
|
- Only `validation-code-gate` mode `fix` edits target production code.
|
|
118
118
|
- Fidelity-gate modes are read-only; restoreability routes gaps to migrator supplement.
|
|
119
|
-
- Code-gate `build` uses three compile scenarios only; `fix`
|
|
119
|
+
- Code-gate `build` uses three compile scenarios only; `fix` reuses `code-gate/knowledge/` bug-fix experiences when fingerprints match, then optional external error DB, then `model_inference`.
|
|
120
120
|
- Business-testing submodules require user inputs; skipped is not pass-by-omission.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- **Read-only fidelity**: `validation-fidelity-gate` never runs commands or edits code.
|
|
21
21
|
- **Single production editor**: only `validation-code-gate` mode `fix` edits target production code.
|
|
22
22
|
- **Three compile scenarios**: `user_specified` → `global_tool_search` → `default_gradle_kmp`.
|
|
23
|
-
- **
|
|
23
|
+
- **Compile error knowledge loop**: fix mode looks up `code-gate/knowledge/compile_error_knowledge.json` first, then optional `error_knowledge_path`, then `model_inference`; verified fixes persist under `knowledge/entries/` after `VG2` pass.
|
|
24
24
|
- **Restoreability-preserving fixes**: no delete/stub of migrated behavior; missing modules → migrator supplement.
|
|
25
25
|
- **Optional business testing**: submodules require user inputs; skip is not pass-by-omission.
|
|
26
26
|
- **Report-only verdict**: only `validation-report` issues `passed | failed | blocked`.
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
| Trigger | Effect |
|
|
42
42
|
|---|---|
|
|
43
43
|
| Migrator V0 not ready | `blocked` |
|
|
44
|
-
| No
|
|
44
|
+
| No local knowledge index yet | Leader initializes empty `compile_error_knowledge.json` |
|
|
45
|
+
| No knowledge match and no `error_knowledge_path` | Fix uses `model_inference` |
|
|
45
46
|
| No test cases or Figma refs | `VG4` skipped explicitly |
|
|
46
47
|
| Preview unsupported | Build only; preview `skipped` with reason |
|
|
47
48
|
| jetbrains / Figma MCP unavailable | Gradle + filesystem; record gap |
|
|
@@ -26,12 +26,23 @@ upstream_inputs:
|
|
|
26
26
|
migration_assembly_basis, module representations for fidelity and restoreability.
|
|
27
27
|
|
|
28
28
|
optional_inputs:
|
|
29
|
+
- name: compile_error_knowledge_path
|
|
30
|
+
required: false
|
|
31
|
+
default: <output_root>/code-gate/knowledge/compile_error_knowledge.json
|
|
32
|
+
used_by:
|
|
33
|
+
- validation-code-gate
|
|
34
|
+
mode: fix
|
|
35
|
+
purpose: |
|
|
36
|
+
Run-local bug-fix experience index. Fix mode looks up matching compile errors here first;
|
|
37
|
+
verified fixes are persisted under code-gate/knowledge/entries/ after VG2 pass.
|
|
29
38
|
- name: error_knowledge_path
|
|
30
39
|
required: false
|
|
31
40
|
used_by:
|
|
32
41
|
- validation-code-gate
|
|
33
42
|
mode: fix
|
|
34
|
-
purpose:
|
|
43
|
+
purpose: |
|
|
44
|
+
Optional external/shared compilation error DB. Used after local compile_error_knowledge lookup;
|
|
45
|
+
does not replace run-local knowledge persistence.
|
|
35
46
|
- name: user_provided_commands
|
|
36
47
|
required: false
|
|
37
48
|
used_by:
|
|
@@ -89,8 +100,10 @@ tools:
|
|
|
89
100
|
degraded_modes:
|
|
90
101
|
- trigger: migrator V0 not ready
|
|
91
102
|
effect: blocked
|
|
103
|
+
- trigger: compile_error_knowledge_path missing
|
|
104
|
+
effect: Leader initializes empty code-gate/knowledge/compile_error_knowledge.json on first fix dispatch
|
|
92
105
|
- trigger: error_knowledge_path missing
|
|
93
|
-
effect: code-gate fix uses model_inference only
|
|
106
|
+
effect: code-gate fix uses local knowledge + model_inference only
|
|
94
107
|
- trigger: no validation_requirements and no figma_refs
|
|
95
108
|
effect: VG4 skipped — not auto-pass
|
|
96
109
|
- trigger: rg missing
|
|
@@ -46,10 +46,17 @@ output_root = <output_dir or ~/.a2c_agents/validation>/kmp-test-validator
|
|
|
46
46
|
│ ├── build/
|
|
47
47
|
│ │ ├── validation_code_build.json
|
|
48
48
|
│ │ └── validation_code_build.md
|
|
49
|
-
│
|
|
50
|
-
│
|
|
51
|
-
│
|
|
52
|
-
│
|
|
49
|
+
│ ├── fix/
|
|
50
|
+
│ │ └── <cycle_id>/
|
|
51
|
+
│ │ ├── validation_code_fix.json
|
|
52
|
+
│ │ └── validation_code_fix.md
|
|
53
|
+
│ └── knowledge/
|
|
54
|
+
│ ├── compile_error_knowledge.json
|
|
55
|
+
│ ├── compile_error_knowledge.md
|
|
56
|
+
│ └── entries/
|
|
57
|
+
│ └── <entry_id>/
|
|
58
|
+
│ ├── bug_fix_experience.json
|
|
59
|
+
│ └── bug_fix_experience.md
|
|
53
60
|
├── business-testing/
|
|
54
61
|
│ ├── validation_business_testing.json
|
|
55
62
|
│ └── validation_business_testing.md
|
|
@@ -72,6 +79,8 @@ output_root = <output_dir or ~/.a2c_agents/validation>/kmp-test-validator
|
|
|
72
79
|
| `code_gate_dir` | `<output_root>/code-gate` |
|
|
73
80
|
| `code_build_dir` | `<code_gate_dir>/build` |
|
|
74
81
|
| `code_fix_dir` | `<code_gate_dir>/fix` |
|
|
82
|
+
| `code_gate_knowledge_dir` | `<code_gate_dir>/knowledge` |
|
|
83
|
+
| `knowledge_entries_dir` | `<code_gate_knowledge_dir>/entries` |
|
|
75
84
|
| `business_testing_dir` | `<output_root>/business-testing` |
|
|
76
85
|
|
|
77
86
|
### Role Ownership (mandatory)
|
|
@@ -92,7 +101,7 @@ output_root = <output_dir or ~/.a2c_agents/validation>/kmp-test-validator
|
|
|
92
101
|
1. Verify `V0`; write `run_manifest.json`, `upstream_migration_index.json`.
|
|
93
102
|
2. `validation-workspace-state` — initialize; refresh after each group.
|
|
94
103
|
3. `validation-fidelity-gate` mode `trust` → `VG1`.
|
|
95
|
-
4. `validation-code-gate` mode `build` → `VG2`; on failure → mode `fix` → rerun `build` (max 3 fix cycles)
|
|
104
|
+
4. `validation-code-gate` mode `build` → `VG2`; on failure → mode `fix` (lookup `compile_error_knowledge.*` and optional `error_knowledge_path`) → rerun `build` (max 3 fix cycles); on `VG2` pass after a fix cycle, persist verified bug-fix experiences under `code-gate/knowledge/entries/`.
|
|
96
105
|
5. `validation-fidelity-gate` mode `restoreability` → `VG3`; on `needs_migrator_supplement` → migrator supplement (max 3) → refresh upstream → rerun affected stages.
|
|
97
106
|
6. `validation-business-testing` when user inputs exist → `VG4` or explicit skip.
|
|
98
107
|
7. On business failures → code-gate mode `fix` → rerun `build` and/or business-testing.
|
|
@@ -127,10 +136,84 @@ Migration trigger evidence, `fidelity_gaps`, `test_trust_blockers`, normalized v
|
|
|
127
136
|
|
|
128
137
|
### `validation_code_fix.json` (mode `fix`)
|
|
129
138
|
|
|
130
|
-
`kmp_target_project_path`, `fix_knowledge_source`: `error_database | model_inference`, `target_edit_summary`, `changed_files[]` listing every target KMP path created or modified to resolve build/preview failures, `restoreability_impact` per change. `required_reruns`: `["validation-code-gate:build", ...]`. Fix mode is the **only** validator role that edits target production code.
|
|
139
|
+
`kmp_target_project_path`, `fix_knowledge_source`: `prior_experience | error_database | model_inference`, `knowledge_lookup`, `referenced_entry_ids[]`, `knowledge_candidates[]`, `target_edit_summary`, `changed_files[]` listing every target KMP path created or modified to resolve build/preview failures, `restoreability_impact` per change. `required_reruns`: `["validation-code-gate:build", ...]`. Fix mode is the **only** validator role that edits target production code.
|
|
131
140
|
|
|
132
141
|
**Forbidden fix patterns**: delete/stub migrated behavior solely to pass compile; route missing modules to migrator supplement.
|
|
133
142
|
|
|
143
|
+
### Compile error knowledge store (`code-gate/knowledge/`)
|
|
144
|
+
|
|
145
|
+
The validator maintains a durable bug-fix experience ledger for compile/preview failures. Reuse it before inventing new fixes.
|
|
146
|
+
|
|
147
|
+
| Path | Owner | When written | Purpose |
|
|
148
|
+
|---|---|---|---|
|
|
149
|
+
| `compile_error_knowledge.json` | `validation-code-gate` | init empty; update after verified fix | Machine index: fingerprints → `entry_id`, hit counts, last match |
|
|
150
|
+
| `compile_error_knowledge.md` | `validation-code-gate` | with index updates | Agent-readable lookup table |
|
|
151
|
+
| `entries/<entry_id>/bug_fix_experience.json` | `validation-code-gate` | after `VG2` pass confirms fix cycle | Verified error signature + solution steps + changed files |
|
|
152
|
+
| `entries/<entry_id>/bug_fix_experience.md` | `validation-code-gate` | with entry JSON | Agent-readable bug-fix experience card |
|
|
153
|
+
|
|
154
|
+
**Lookup order (fix mode, before editing target code)**:
|
|
155
|
+
|
|
156
|
+
1. `code-gate/knowledge/compile_error_knowledge.json` — match `message_fingerprint`, `error_code`, `file_pattern`, `symbol_pattern`.
|
|
157
|
+
2. Optional external `error_knowledge_path` — same signature matching when configured.
|
|
158
|
+
3. `model_inference` — only when no prior experience matches.
|
|
159
|
+
|
|
160
|
+
**Persist rule**: write or update `entries/<entry_id>/` only after the fix cycle is **verified** by a subsequent code-gate `build` pass (`VG2`). Unverified fixes stay in `validation_code_fix.json` → `knowledge_candidates[]` only.
|
|
161
|
+
|
|
162
|
+
#### `compile_error_knowledge.json` index shape
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"knowledge_root": "",
|
|
167
|
+
"external_error_knowledge_path": "",
|
|
168
|
+
"entry_count": 0,
|
|
169
|
+
"entries": [
|
|
170
|
+
{
|
|
171
|
+
"entry_id": "ce-<slug>",
|
|
172
|
+
"message_fingerprint": "",
|
|
173
|
+
"error_code": "",
|
|
174
|
+
"compiler": "kotlin | gradle | compose",
|
|
175
|
+
"verified": true,
|
|
176
|
+
"hit_count": 0,
|
|
177
|
+
"last_matched_at": "",
|
|
178
|
+
"entry_path": "entries/<entry_id>/bug_fix_experience.json"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### `bug_fix_experience.json` entry shape
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"entry_id": "ce-<slug>",
|
|
189
|
+
"error_signature": {
|
|
190
|
+
"compiler": "kotlin | gradle | compose",
|
|
191
|
+
"error_code": "",
|
|
192
|
+
"normalized_message": "",
|
|
193
|
+
"message_fingerprint": "",
|
|
194
|
+
"file_pattern": "",
|
|
195
|
+
"symbol_pattern": ""
|
|
196
|
+
},
|
|
197
|
+
"root_error_excerpt": "",
|
|
198
|
+
"build_log_ref": "",
|
|
199
|
+
"failure_id": "",
|
|
200
|
+
"fix_summary": "",
|
|
201
|
+
"solution_steps": [],
|
|
202
|
+
"target_files_changed": [],
|
|
203
|
+
"changed_files_snapshot": [],
|
|
204
|
+
"fix_knowledge_source": "prior_experience | error_database | model_inference",
|
|
205
|
+
"referenced_entry_ids": [],
|
|
206
|
+
"verified_by": "validation-code-gate:build",
|
|
207
|
+
"verification_cycle_id": "",
|
|
208
|
+
"fix_cycle_id": "",
|
|
209
|
+
"created_at": "",
|
|
210
|
+
"hit_count": 0,
|
|
211
|
+
"last_matched_at": ""
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Same-error reuse**: when a routed failure matches an existing fingerprint, fix mode MUST set `fix_knowledge_source: prior_experience`, populate `referenced_entry_ids`, apply the recorded `solution_steps` when still valid, and increment `hit_count` in the index after successful verification.
|
|
216
|
+
|
|
134
217
|
### `validation_restoreability_audit.json` (mode `restoreability`)
|
|
135
218
|
|
|
136
219
|
`migrator_supplement_request` when new migration work required. Controller invokes `android-to-kmp-migrator` — not code-gate `fix`.
|
|
@@ -153,8 +236,9 @@ Migration trigger evidence, `fidelity_gaps`, `test_trust_blockers`, normalized v
|
|
|
153
236
|
1. Dispatch only role IDs listed in [SKILL.md](SKILL.md).
|
|
154
237
|
2. Run fidelity-gate `trust` before code-gate `build`; `restoreability` only after `VG2`.
|
|
155
238
|
3. Route compile failures to code-gate `fix`; route missing modules to migrator supplement.
|
|
156
|
-
4.
|
|
157
|
-
5.
|
|
239
|
+
4. Initialize `code-gate/knowledge/compile_error_knowledge.json` when missing; persist verified bug-fix experiences after `VG2` pass.
|
|
240
|
+
5. Enable business-testing submodules only with user prerequisites.
|
|
241
|
+
6. Maintain `handoff_gates` in workspace ledger and final report.
|
|
158
242
|
|
|
159
243
|
## Invalid Artifact Handling
|
|
160
244
|
|
|
@@ -36,11 +36,22 @@ You are the `validation-code-gate` node subagent. You merge compile command reso
|
|
|
36
36
|
- Target KMP files edited to resolve confirmed compiler/preview errors traced from build logs.
|
|
37
37
|
- `validation_code_fix.json` and `.md` under `output_dir/fix/<cycle_id>/`.
|
|
38
38
|
- Each failure confirmed as a target KMP issue with Android/SPEC cross-check when needed.
|
|
39
|
-
-
|
|
39
|
+
- Before editing: lookup compile errors in `code-gate/knowledge/compile_error_knowledge.json` and optional `error_knowledge_path`; reuse matching `bug_fix_experience` entries when still valid.
|
|
40
|
+
- `fix_knowledge_source`: `prior_experience` when local knowledge matches; `error_database` when external DB matches; else `model_inference`.
|
|
41
|
+
- `referenced_entry_ids[]` populated when prior bug-fix experiences were applied.
|
|
42
|
+
- `knowledge_candidates[]` proposed for each fixed failure; persisted to `knowledge/entries/` only after subsequent `build` pass verifies the fix.
|
|
40
43
|
- Every fix records `restoreability_impact`; forbidden delete/stub patterns rejected.
|
|
41
44
|
- `changed_files[]` lists every target path modified with `path`, `edit_kind` (`create | update`), `failure_id`, `restoreability_impact`.
|
|
42
45
|
- `required_reruns` includes `validation-code-gate` mode `build` and/or `validation-business-testing` when applicable.
|
|
43
46
|
|
|
47
|
+
## Success Criteria — knowledge persist (after verified `build` pass)
|
|
48
|
+
|
|
49
|
+
When code-gate `build` passes after a fix cycle (`VG2`):
|
|
50
|
+
|
|
51
|
+
- Promote `knowledge_candidates[]` from the verifying fix cycle into `code-gate/knowledge/entries/<entry_id>/bug_fix_experience.*`.
|
|
52
|
+
- Update `compile_error_knowledge.json` and `.md` index with fingerprints, `entry_path`, `verified: true`, and `hit_count` when a prior entry was reused.
|
|
53
|
+
- Skip persist when the same `message_fingerprint` already has a verified entry unless the new fix adds materially different `solution_steps` — then append a new `entry_id` and link via `referenced_entry_ids`.
|
|
54
|
+
|
|
44
55
|
## Compile Resolution Scenarios (build mode only)
|
|
45
56
|
|
|
46
57
|
| Priority | Scenario ID | Sources |
|
|
@@ -71,6 +82,8 @@ Never invent commands outside these scenarios.
|
|
|
71
82
|
**Required**:
|
|
72
83
|
|
|
73
84
|
- Trace first root compiler error from `validation_code_build` logs before editing.
|
|
85
|
+
- Lookup matching bug-fix experiences in [output-contract.md](../output-contract.md) § Compile error knowledge store before `model_inference`.
|
|
86
|
+
- When the same error fingerprint matches a verified entry, apply recorded `solution_steps` first; adapt only when target context differs.
|
|
74
87
|
- Narrowest fix in `allowed_files`; preserve architecture, source sets, dependencies, public API.
|
|
75
88
|
- Edit under `kmp_target_project_path`; record every change in `changed_files`.
|
|
76
89
|
|
|
@@ -103,10 +116,18 @@ Never invent commands outside these scenarios.
|
|
|
103
116
|
"build": { "command": "", "status": "passed | failed | blocked", "log_file": "" },
|
|
104
117
|
"preview_or_renderability": { "required": true, "command": "", "status": "passed | failed | skipped | blocked", "log_file": "" },
|
|
105
118
|
"failures": [{ "id": "", "failure_kind": "compile | preview | environment", "route_to": "validation-code-gate:fix | user | environment" }],
|
|
119
|
+
"knowledge_persist_summary": {
|
|
120
|
+
"verified_fix_cycle_id": "",
|
|
121
|
+
"persisted_entry_ids": [],
|
|
122
|
+
"reused_entry_ids": [],
|
|
123
|
+
"skipped_candidates": []
|
|
124
|
+
},
|
|
106
125
|
"blocking_gaps": []
|
|
107
126
|
}
|
|
108
127
|
```
|
|
109
128
|
|
|
129
|
+
When `status: passed` immediately after a fix cycle, populate `knowledge_persist_summary` and write verified `knowledge_candidates` to `code-gate/knowledge/entries/`.
|
|
130
|
+
|
|
110
131
|
## Output Schema — mode `fix`
|
|
111
132
|
|
|
112
133
|
```json
|
|
@@ -115,8 +136,24 @@ Never invent commands outside these scenarios.
|
|
|
115
136
|
"node": "validation-code-gate",
|
|
116
137
|
"mode": "fix",
|
|
117
138
|
"kmp_target_project_path": "",
|
|
118
|
-
"fix_knowledge_source": "error_database | model_inference",
|
|
119
|
-
"
|
|
139
|
+
"fix_knowledge_source": "prior_experience | error_database | model_inference",
|
|
140
|
+
"knowledge_lookup": {
|
|
141
|
+
"local_knowledge_path": "",
|
|
142
|
+
"external_error_knowledge_path": "",
|
|
143
|
+
"matched_entry_ids": [],
|
|
144
|
+
"lookup_status": "matched | partial_match | no_match"
|
|
145
|
+
},
|
|
146
|
+
"referenced_entry_ids": [],
|
|
147
|
+
"knowledge_candidates": [
|
|
148
|
+
{
|
|
149
|
+
"entry_id": "ce-<slug>",
|
|
150
|
+
"error_signature": {},
|
|
151
|
+
"root_error_excerpt": "",
|
|
152
|
+
"fix_summary": "",
|
|
153
|
+
"solution_steps": [],
|
|
154
|
+
"changed_files_snapshot": []
|
|
155
|
+
}
|
|
156
|
+
],
|
|
120
157
|
"target_edit_summary": {
|
|
121
158
|
"files_touched": 0,
|
|
122
159
|
"compile_fixes": 0,
|
|
@@ -143,8 +180,12 @@ Shared return shape applies. Only `fix` mode populates `changed_files` with targ
|
|
|
143
180
|
- Logs under `logs/code-gate/` referenced by `log_file` fields.
|
|
144
181
|
|
|
145
182
|
**Fix mode** under `<code_gate_dir>/fix/<cycle_id>/`:
|
|
146
|
-
- `validation_code_fix.json` — machine fix record: `kmp_target_project_path`, `fix_knowledge_source`, `target_edit_summary`, per-failure fix mapping, `changed_files` (every target edit), `required_reruns`, forbidden pattern violations, blockers.
|
|
147
|
-
- `validation_code_fix.md` — agent-readable fix handoff: root error → target file edit table, restoreability notes, rerun plan.
|
|
183
|
+
- `validation_code_fix.json` — machine fix record: `kmp_target_project_path`, `fix_knowledge_source`, `knowledge_lookup`, `referenced_entry_ids`, `knowledge_candidates`, `target_edit_summary`, per-failure fix mapping, `changed_files` (every target edit), `required_reruns`, forbidden pattern violations, blockers.
|
|
184
|
+
- `validation_code_fix.md` — agent-readable fix handoff: matched bug-fix experiences, root error → target file edit table, restoreability notes, rerun plan.
|
|
185
|
+
|
|
186
|
+
**Knowledge store** under `<code_gate_dir>/knowledge/` (see [output-contract.md](../output-contract.md)):
|
|
187
|
+
- `compile_error_knowledge.json`, `compile_error_knowledge.md` — lookup index.
|
|
188
|
+
- `entries/<entry_id>/bug_fix_experience.json`, `.md` — verified compile-error → solution experiences, written after `VG2` confirms the fix cycle.
|
|
148
189
|
|
|
149
190
|
## Inline Persona for Teammate
|
|
150
191
|
|
|
@@ -156,7 +197,10 @@ capture logs, route compile/preview failures to fix mode. DO NOT edit target cod
|
|
|
156
197
|
|
|
157
198
|
fix: EDIT THE TARGET KMP PROJECT to resolve confirmed build/preview failures.
|
|
158
199
|
- changed_files = every target file you created or modified under kmp_target_project_path.
|
|
159
|
-
-
|
|
200
|
+
- LOOKUP FIRST: code-gate/knowledge/compile_error_knowledge.json, then optional error_knowledge_path.
|
|
201
|
+
- Reuse prior bug_fix_experience when fingerprint matches; set fix_knowledge_source=prior_experience.
|
|
202
|
+
- Else use external error DB when configured; else model_inference.
|
|
203
|
+
- Record knowledge_candidates for fixed failures; persist entries only after build verifies fix.
|
|
160
204
|
- Narrowest restoreability-preserving fix only; trace root compiler error first.
|
|
161
205
|
- Missing modules/major functions -> migrator supplement, NOT delete/stub hacks.
|
|
162
206
|
|
|
@@ -166,11 +210,13 @@ CONTROL:
|
|
|
166
210
|
- Never edit Legacy Android or migration validator evidence roots.
|
|
167
211
|
|
|
168
212
|
INPUTS: mode, kmp_target_project_path, validation_fidelity_trust_path, validation_code_build_path (fix mode),
|
|
169
|
-
|
|
213
|
+
code_gate_knowledge_dir, compile_error_knowledge_path, error_knowledge_path, user_provided_commands,
|
|
214
|
+
allowed_files, failure_ids, cycle_id, output_dir, logs_dir.
|
|
170
215
|
|
|
171
216
|
OUTPUTS (evidence under output_dir; code fixes under kmp_target_project_path in fix mode):
|
|
172
217
|
- build/validation_code_build.json + .md + code-gate logs
|
|
173
218
|
- fix/<cycle_id>/validation_code_fix.json + .md
|
|
219
|
+
- knowledge/compile_error_knowledge.json + .md + entries/<entry_id>/bug_fix_experience.* (after verified build pass)
|
|
174
220
|
|
|
175
221
|
Return kmp_target_project_path. fix mode: changed_files required when target edits made.
|
|
176
222
|
Emit required_reruns including validation-code-gate:build after fixes.
|
|
@@ -13,7 +13,7 @@ You are the `validation-workspace-state` node subagent dispatched by the `kmp-te
|
|
|
13
13
|
- Stale upstream inputs flagged when changed files, SPEC paths, migration report, or validation requirements changed since a node ran.
|
|
14
14
|
- Rerun history recorded without hiding repeated failures; next safe controller action identified.
|
|
15
15
|
|
|
16
|
-
**Focus areas**: node status normalization, stale-input detection, changed-file ownership, rerun/blocker history, next-action guidance.
|
|
16
|
+
**Focus areas**: node status normalization, stale-input detection, changed-file ownership, compile-error knowledge inventory, rerun/blocker history, next-action guidance.
|
|
17
17
|
|
|
18
18
|
## Boundary
|
|
19
19
|
|
|
@@ -43,6 +43,11 @@ You are the `validation-workspace-state` node subagent dispatched by the `kmp-te
|
|
|
43
43
|
"handoff_gates": { "VG0": {}, "VG1": {}, "VG2": {}, "VG3": {}, "VG4": {}, "VG5": {} },
|
|
44
44
|
"migrator_supplement_cycles": 0,
|
|
45
45
|
"fix_cycles": 0,
|
|
46
|
+
"knowledge_inventory": {
|
|
47
|
+
"compile_error_knowledge_path": "",
|
|
48
|
+
"verified_entry_count": 0,
|
|
49
|
+
"last_persisted_entry_ids": []
|
|
50
|
+
},
|
|
46
51
|
"next_actions": []
|
|
47
52
|
}
|
|
48
53
|
```
|
|
@@ -51,7 +56,7 @@ Shared controller return shape (all nodes): `status`, `node`, `output_files`, `c
|
|
|
51
56
|
|
|
52
57
|
## Output Files And Contents
|
|
53
58
|
|
|
54
|
-
- `validation_workspace_state.json`: machine-routable validation ledger containing current controller step, validator node status, output file inventory, changed-file ownership, stale upstream inputs, rerun history, blockers, and next safe actions.
|
|
59
|
+
- `validation_workspace_state.json`: machine-routable validation ledger containing current controller step, validator node status, output file inventory, changed-file ownership, compile-error knowledge inventory (`knowledge_inventory`), stale upstream inputs, rerun history, blockers, and next safe actions.
|
|
55
60
|
- `validation_workspace_state.md`: agent-readable ledger handoff containing node status table, stale-input table, changed-file ownership summary, rerun/blocker history, and next safe controller action.
|
|
56
61
|
|
|
57
62
|
## Inline Persona for Teammate
|
|
@@ -44,7 +44,8 @@ Initialize ledger with `handoff_gates` VG0–VG5; track `fix_cycles` and `migrat
|
|
|
44
44
|
- **Executor**: `validation-code-gate` mode `build`
|
|
45
45
|
- **Compile scenarios**: `user_specified` → `global_tool_search` → `default_gradle_kmp`
|
|
46
46
|
- **Output**: `code-gate/build/validation_code_build.*`, `logs/code-gate/*`
|
|
47
|
-
- **On failure**: dispatch code-gate mode `fix`
|
|
47
|
+
- **On failure**: dispatch code-gate mode `fix` — lookup `code-gate/knowledge/compile_error_knowledge.json` and optional `error_knowledge_path` for matching bug-fix experiences, then edit target KMP files → rerun `build` (max 3 fix cycles)
|
|
48
|
+
- **On `VG2` pass after fix**: persist verified `knowledge_candidates` to `code-gate/knowledge/entries/<entry_id>/bug_fix_experience.*` and update the knowledge index
|
|
48
49
|
- **Gate**: `VG2`
|
|
49
50
|
|
|
50
51
|
### Step 4 — Fidelity Gate `restoreability`
|
|
@@ -80,5 +81,6 @@ Initialize ledger with `handoff_gates` VG0–VG5; track `fix_cycles` and `migrat
|
|
|
80
81
|
- Dispatch only role IDs from `SKILL.md`.
|
|
81
82
|
- Fidelity-gate `trust` before code-gate `build`; `restoreability` after `VG2`.
|
|
82
83
|
- Only code-gate mode `fix` edits production code.
|
|
84
|
+
- Compile errors with verified solutions are stored as bug-fix experiences; same fingerprints reuse prior entries before `model_inference`.
|
|
83
85
|
- Business testing skipped (not passed) when no user inputs.
|
|
84
86
|
- Final verdict evidence-backed from verified artifacts.
|