@code-migration/wow-migrator 0.1.3 → 0.1.5
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/SKILL.md +69 -46
- package/skills/android-project-analyst/bind.md +10 -5
- package/skills/android-project-analyst/dependencies.yaml +66 -10
- package/skills/android-project-analyst/output-contract.md +357 -0
- package/skills/android-project-analyst/roles/analysis-workspace-state.md +25 -8
- package/skills/android-project-analyst/roles/behavior-logic.md +6 -2
- package/skills/android-project-analyst/roles/data-contract-flow.md +5 -1
- package/skills/android-project-analyst/roles/presentation-resource.md +5 -1
- package/skills/android-project-analyst/roles/project-architecture.md +5 -1
- package/skills/android-project-analyst/workflow.md +75 -29
- package/skills/android-to-kmp-migrator/SKILL.md +62 -142
- package/skills/android-to-kmp-migrator/bind.md +29 -67
- package/skills/android-to-kmp-migrator/dependencies.yaml +72 -11
- package/skills/android-to-kmp-migrator/output-contract.md +318 -0
- package/skills/android-to-kmp-migrator/roles/completion-report.md +3 -1
- package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +87 -0
- package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +75 -0
- package/skills/android-to-kmp-migrator/roles/migration-prep.md +75 -0
- package/skills/android-to-kmp-migrator/roles/migration-verification.md +44 -26
- package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +16 -8
- package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
- package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
- package/skills/android-to-kmp-migrator/workflow.md +85 -224
- package/skills/kmp-test-validator/SKILL.md +52 -85
- package/skills/kmp-test-validator/bind.md +30 -56
- package/skills/kmp-test-validator/dependencies.yaml +101 -9
- package/skills/kmp-test-validator/output-contract.md +166 -0
- package/skills/kmp-test-validator/roles/validation-business-testing.md +83 -0
- package/skills/kmp-test-validator/roles/validation-code-gate.md +116 -0
- package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +118 -0
- package/skills/kmp-test-validator/roles/validation-report.md +23 -14
- package/skills/kmp-test-validator/roles/validation-workspace-state.md +5 -2
- package/skills/kmp-test-validator/workflow.md +60 -115
- package/skills/migration-task-adapter/SKILL.md +64 -93
- package/skills/migration-task-adapter/bind.md +27 -91
- package/skills/migration-task-adapter/dependencies.yaml +21 -10
- package/skills/migration-task-adapter/output-contract.md +276 -0
- package/skills/migration-task-adapter/roles/adapter-report.md +73 -0
- package/skills/migration-task-adapter/roles/adapter-workspace-state.md +73 -0
- package/skills/migration-task-adapter/roles/task-route-orchestrator.md +106 -0
- package/skills/migration-task-adapter/workflow.md +76 -142
- package/skills/android-project-analyst/MIGRATION.md +0 -67
- package/skills/android-to-kmp-migrator/MIGRATION.md +0 -129
- package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -68
- package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -71
- package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -70
- package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -70
- package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -68
- package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -69
- package/skills/kmp-test-validator/MIGRATION.md +0 -84
- package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -72
- package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -72
- package/skills/kmp-test-validator/roles/validation-remediation.md +0 -117
- package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -67
- package/skills/migration-task-adapter/MIGRATION.md +0 -49
- package/skills/migration-task-adapter/roles/task-reporter.md +0 -134
- package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -139
- package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -145
- package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -198
|
@@ -4,70 +4,44 @@
|
|
|
4
4
|
|
|
5
5
|
| Item | Limit | Reason |
|
|
6
6
|
|---|---|---|
|
|
7
|
-
| `max_parallel_teammates` | 1 |
|
|
8
|
-
| `total_wall_clock_budget` | 45 min |
|
|
9
|
-
| `total_token_budget` | 600k tokens |
|
|
10
|
-
| `per_node_token_budget` | 130k tokens |
|
|
11
|
-
| `
|
|
12
|
-
| `
|
|
7
|
+
| `max_parallel_teammates` | 1 | Serial pipeline with mode dispatches |
|
|
8
|
+
| `total_wall_clock_budget` | 45 min | Full validation including loops |
|
|
9
|
+
| `total_token_budget` | 600k tokens | Leader + role dispatches + loops |
|
|
10
|
+
| `per_node_token_budget` | 130k tokens | Mode-based roles carry broader context |
|
|
11
|
+
| `max_fix_cycles` | 3 | Max code-gate `fix` → rerun `build`/business-testing iterations |
|
|
12
|
+
| `max_migrator_supplement_cycles` | 3 | Max restoreability gap → migrator supplement iterations |
|
|
13
13
|
|
|
14
14
|
## Behavioral Constraints
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **Stale-artifact discipline**: `validation-workspace-state` is refreshed after each node group; `validation-report` runs only when no required input is stale.
|
|
28
|
-
- **Report-only synthesis**: only `validation-report` issues the final `passed | failed | blocked` verdict, synthesizing verified outputs without new tests or fixes.
|
|
16
|
+
- **Leader orchestrates only** — dispatches roles with explicit `mode`; runs both controller loops.
|
|
17
|
+
- **Canonical contract**: [output-contract.md](output-contract.md) wins on paths and `VG0`–`VG5`.
|
|
18
|
+
- **Role schedule**: dispatch only role IDs listed in [SKILL.md](SKILL.md).
|
|
19
|
+
- **Dependency order**: workspace → fidelity-gate `trust` → code-gate `build` → [fix loop] → fidelity-gate `restoreability` → [supplement loop] → business-testing → report.
|
|
20
|
+
- **Read-only fidelity**: `validation-fidelity-gate` never runs commands or edits code.
|
|
21
|
+
- **Single production editor**: only `validation-code-gate` mode `fix` edits target production code.
|
|
22
|
+
- **Three compile scenarios**: `user_specified` → `global_tool_search` → `default_gradle_kmp`.
|
|
23
|
+
- **Two fix knowledge paths**: `error_knowledge_path` when configured; else `model_inference`.
|
|
24
|
+
- **Restoreability-preserving fixes**: no delete/stub of migrated behavior; missing modules → migrator supplement.
|
|
25
|
+
- **Optional business testing**: submodules require user inputs; skip is not pass-by-omission.
|
|
26
|
+
- **Report-only verdict**: only `validation-report` issues `passed | failed | blocked`.
|
|
29
27
|
|
|
30
28
|
## Failure Handling
|
|
31
29
|
|
|
32
|
-
### (a) Teammate failure
|
|
33
|
-
|
|
34
30
|
| Failure mode | Response |
|
|
35
31
|
|---|---|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
32
|
+
| Code-gate `build` compile failed | Code-gate mode `fix` → rerun `build` |
|
|
33
|
+
| Fidelity-gate `restoreability` needs supplement | Leader invokes migrator if under max cycles |
|
|
34
|
+
| Fix uses forbidden delete/stub | Reject; record violation; route supplement or `blocked` |
|
|
35
|
+
| Fix cycles exhausted | `blocked` with evidence |
|
|
36
|
+
| Business submodule failure | Code-gate `fix` if target-code; else `failed` |
|
|
37
|
+
| Unknown or invalid role ID | Re-dispatch with active role + mode from `SKILL.md` |
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
## Degraded Modes
|
|
44
40
|
|
|
45
|
-
| Trigger
|
|
41
|
+
| Trigger | Effect |
|
|
46
42
|
|---|---|
|
|
47
|
-
|
|
|
48
|
-
| No
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
### Escalation rules
|
|
53
|
-
|
|
54
|
-
- If 50%+ of dispatched nodes return `[ROLE MISSING]`, the run is **FAILED** — emit a partial validation report with a `FAILED: insufficient node coverage` header, status `blocked`, and the missing-evidence list.
|
|
55
|
-
- If `total_wall_clock_budget` is exceeded, halt in-flight nodes, checkpoint via `validation-workspace-state`, emit whatever verified outputs exist, and tag the report `INCOMPLETE: budget exceeded`.
|
|
56
|
-
- If `total_token_budget` is exceeded mid-run, halt new dispatches, let in-flight nodes finish, checkpoint, and emit a partial report tagged `INCOMPLETE: token budget exceeded`.
|
|
57
|
-
|
|
58
|
-
## Required Path Contract
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"output_root": "<output_dir or ~/.a2c_agents/validation>/kmp-test-validator",
|
|
63
|
-
"workspace_state_dir": "<output_root>/workspace-state",
|
|
64
|
-
"intake_dir": "<output_root>/intake-fidelity",
|
|
65
|
-
"plan_gate_dir": "<output_root>/plan-gate",
|
|
66
|
-
"test_runner_dir": "<output_root>/test-runner",
|
|
67
|
-
"remediation_dir": "<output_root>/remediation",
|
|
68
|
-
"report_dir": "<output_root>/report",
|
|
69
|
-
"logs_dir": "<output_root>/logs"
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Validator artifacts outside this path contract are invalid. Migration artifacts remain in their migration output location and are never overwritten or copied as validator outputs.
|
|
43
|
+
| Migrator V0 not ready | `blocked` |
|
|
44
|
+
| No `error_knowledge_path` | Fix uses `model_inference` only |
|
|
45
|
+
| No test cases or Figma refs | `VG4` skipped explicitly |
|
|
46
|
+
| Preview unsupported | Build only; preview `skipped` with reason |
|
|
47
|
+
| jetbrains / Figma MCP unavailable | Gradle + filesystem; record gap |
|
|
@@ -1,17 +1,109 @@
|
|
|
1
|
-
# dependencies.yaml — Swarm Skill startup dependency check
|
|
1
|
+
# dependencies.yaml — Swarm Skill startup dependency check (kmp-test-validator)
|
|
2
2
|
#
|
|
3
|
-
# Leader reads this
|
|
4
|
-
# Populated from Stage 2 auto-matching (local CLI scan): rg, git found locally; the target project's
|
|
5
|
-
# own Gradle wrapper drives build/preview/test commands (validation-plan-gate resolves them and returns
|
|
6
|
-
# blocked rather than inventing one). All entries are required: false — the team degrades gracefully
|
|
7
|
-
# (built-in Grep/Read substitute for rg; git is only for changed-file/diff inspection).
|
|
3
|
+
# Leader reads this in Workflow Step 0 → run_manifest.json dependency_preflight.
|
|
8
4
|
|
|
9
|
-
skills:
|
|
5
|
+
skills:
|
|
6
|
+
- name: ui-reconstruction-score
|
|
7
|
+
required: false
|
|
8
|
+
used_by:
|
|
9
|
+
- validation-business-testing
|
|
10
|
+
purpose: Optional UI screenshot comparison scoring for ui_comparison submodule when user supplies Figma refs.
|
|
11
|
+
|
|
12
|
+
upstream_inputs:
|
|
13
|
+
- source: android-to-kmp-migrator
|
|
14
|
+
handoff_package: V0
|
|
15
|
+
required: true
|
|
16
|
+
purpose: |
|
|
17
|
+
migration_report.json, global_migration_representation.json,
|
|
18
|
+
post_integration_alignment.json, modules_migration_index.json,
|
|
19
|
+
module_completion_record per module, analyst SPEC paths from run_manifest.
|
|
20
|
+
- source: android-project-analyst
|
|
21
|
+
handoff_package: P6
|
|
22
|
+
required: true
|
|
23
|
+
via: migrator run_manifest
|
|
24
|
+
purpose: |
|
|
25
|
+
SPEC prd/design/plan/verification, global_representation,
|
|
26
|
+
migration_assembly_basis, module representations for fidelity and restoreability.
|
|
27
|
+
|
|
28
|
+
optional_inputs:
|
|
29
|
+
- name: error_knowledge_path
|
|
30
|
+
required: false
|
|
31
|
+
used_by:
|
|
32
|
+
- validation-code-gate
|
|
33
|
+
mode: fix
|
|
34
|
+
purpose: Compilation error DB; code-gate fix mode uses error_database lookup before model_inference.
|
|
35
|
+
- name: user_provided_commands
|
|
36
|
+
required: false
|
|
37
|
+
used_by:
|
|
38
|
+
- validation-code-gate
|
|
39
|
+
- validation-business-testing
|
|
40
|
+
mode: build
|
|
41
|
+
purpose: User-specified compile/build/preview/test commands (scenario user_specified).
|
|
42
|
+
- name: validation_requirements
|
|
43
|
+
required: false
|
|
44
|
+
used_by:
|
|
45
|
+
- validation-business-testing
|
|
46
|
+
purpose: Enables behavioral submodule.
|
|
47
|
+
- name: figma_refs
|
|
48
|
+
required: false
|
|
49
|
+
used_by:
|
|
50
|
+
- validation-business-testing
|
|
51
|
+
purpose: Enables ui_comparison submodule.
|
|
52
|
+
|
|
53
|
+
optional_mcp:
|
|
54
|
+
- server: jetbrains
|
|
55
|
+
required: false
|
|
56
|
+
used_by:
|
|
57
|
+
- validation-code-gate
|
|
58
|
+
- validation-business-testing
|
|
59
|
+
purpose: |
|
|
60
|
+
KMP target diagnostics: get_file_problems, build_project, get_symbol_info,
|
|
61
|
+
rename_refactoring, reformat_file. projectPath = kmp_target_project_path.
|
|
62
|
+
- server: FigmaDevModel
|
|
63
|
+
required: false
|
|
64
|
+
used_by:
|
|
65
|
+
- validation-business-testing
|
|
66
|
+
purpose: Figma design fetch for ui_comparison when figma_refs supplied.
|
|
10
67
|
|
|
11
68
|
tools:
|
|
12
69
|
- name: rg
|
|
13
70
|
required: false
|
|
14
|
-
|
|
71
|
+
used_by:
|
|
72
|
+
- validation-fidelity-gate
|
|
73
|
+
- validation-code-gate
|
|
74
|
+
- validation-business-testing
|
|
75
|
+
- validation-report
|
|
76
|
+
purpose: Search Android source, KMP target, artifacts. Grep/Read substitute if unavailable.
|
|
15
77
|
- name: git
|
|
16
78
|
required: false
|
|
17
|
-
|
|
79
|
+
used_by:
|
|
80
|
+
- validation-workspace-state
|
|
81
|
+
- validation-fidelity-gate
|
|
82
|
+
- validation-code-gate
|
|
83
|
+
- validation-business-testing
|
|
84
|
+
- validation-report
|
|
85
|
+
purpose: Changed-file sets, diffs, ownership for ledger, fix, and report.
|
|
86
|
+
|
|
87
|
+
# Target Gradle wrapper: validation-code-gate mode build, scenario default_gradle_kmp.
|
|
88
|
+
|
|
89
|
+
degraded_modes:
|
|
90
|
+
- trigger: migrator V0 not ready
|
|
91
|
+
effect: blocked
|
|
92
|
+
- trigger: error_knowledge_path missing
|
|
93
|
+
effect: code-gate fix uses model_inference only
|
|
94
|
+
- trigger: no validation_requirements and no figma_refs
|
|
95
|
+
effect: VG4 skipped — not auto-pass
|
|
96
|
+
- trigger: rg missing
|
|
97
|
+
effect: Grep/Read substitute; record in preflight
|
|
98
|
+
- trigger: jetbrains MCP missing
|
|
99
|
+
effect: code-gate uses Gradle logs only
|
|
100
|
+
- trigger: Figma MCP missing
|
|
101
|
+
effect: ui_comparison uses exported assets or skips with reason
|
|
102
|
+
|
|
103
|
+
downstream_handoff:
|
|
104
|
+
- target: migration-task-adapter
|
|
105
|
+
package: VG5
|
|
106
|
+
artifacts:
|
|
107
|
+
- report/kmp_validation_report.json
|
|
108
|
+
- report/kmp_validation_report.md
|
|
109
|
+
- workspace-state/validation_workspace_state.json
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Output Contract: Validation File Recording, Upstream Inputs, And Trigger Gates
|
|
2
|
+
|
|
3
|
+
This document is the **canonical path and content contract** for `kmp-test-validator`. Downstream handlers and cross-controller loops **MUST treat missing, empty, out-of-path, stale, or schema-invalid artifacts as hard blockers**.
|
|
4
|
+
|
|
5
|
+
When `SKILL.md` or `workflow.md` diverge, **this file wins on paths, filenames, upstream inputs, and trigger gates**.
|
|
6
|
+
|
|
7
|
+
## Upstream Input Contract (android-to-kmp-migrator)
|
|
8
|
+
|
|
9
|
+
Validation starts only when migrator handoff package **`V0`** is ready. Required upstream paths (read-only):
|
|
10
|
+
|
|
11
|
+
| Upstream artifact | Purpose |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `migration_output_root/run_manifest.json` | KMP target, analyst SPEC paths, `handoff_gates.V0` |
|
|
14
|
+
| `migration_output_root/report/migration_report.json` | Scope, changed files, module completion |
|
|
15
|
+
| `migration_output_root/global/global_migration_representation.json` | Restoreability baseline |
|
|
16
|
+
| `migration_output_root/global/node-results/global-migration-phase/align/post_integration_alignment.json` | Alignment baseline |
|
|
17
|
+
| `migration_output_root/module-index/modules_migration_index.json` | Module lookup |
|
|
18
|
+
| Analyst `SPEC/prd.md`, `design.md`, `plan.md`, `verification.md` | Ground truth |
|
|
19
|
+
|
|
20
|
+
Record resolved paths in `run_manifest.json` → `upstream_migration_artifacts`.
|
|
21
|
+
|
|
22
|
+
**Fail closed**: migrator `V0` false → `blocked`.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Validation Output Root Layout
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
output_root = <output_dir or ~/.a2c_agents/validation>/kmp-test-validator
|
|
30
|
+
|
|
31
|
+
<output_root>/
|
|
32
|
+
├── run_manifest.json
|
|
33
|
+
├── upstream-index/
|
|
34
|
+
│ └── upstream_migration_index.json
|
|
35
|
+
├── workspace-state/
|
|
36
|
+
│ ├── validation_workspace_state.json
|
|
37
|
+
│ └── validation_workspace_state.md
|
|
38
|
+
├── fidelity-gate/
|
|
39
|
+
│ ├── trust/
|
|
40
|
+
│ │ ├── validation_fidelity_trust.json
|
|
41
|
+
│ │ └── validation_fidelity_trust.md
|
|
42
|
+
│ └── restoreability/
|
|
43
|
+
│ ├── validation_restoreability_audit.json
|
|
44
|
+
│ └── validation_restoreability_audit.md
|
|
45
|
+
├── code-gate/
|
|
46
|
+
│ ├── build/
|
|
47
|
+
│ │ ├── validation_code_build.json
|
|
48
|
+
│ │ └── validation_code_build.md
|
|
49
|
+
│ └── fix/
|
|
50
|
+
│ └── <cycle_id>/
|
|
51
|
+
│ ├── validation_code_fix.json
|
|
52
|
+
│ └── validation_code_fix.md
|
|
53
|
+
├── business-testing/
|
|
54
|
+
│ ├── validation_business_testing.json
|
|
55
|
+
│ └── validation_business_testing.md
|
|
56
|
+
├── report/
|
|
57
|
+
│ ├── kmp_validation_report.json
|
|
58
|
+
│ └── kmp_validation_report.md
|
|
59
|
+
└── logs/
|
|
60
|
+
├── code-gate/
|
|
61
|
+
├── business-testing/
|
|
62
|
+
└── ui-comparison/
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Path Variables
|
|
66
|
+
|
|
67
|
+
| Variable | Path |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `fidelity_gate_dir` | `<output_root>/fidelity-gate` |
|
|
70
|
+
| `fidelity_trust_dir` | `<fidelity_gate_dir>/trust` |
|
|
71
|
+
| `fidelity_restoreability_dir` | `<fidelity_gate_dir>/restoreability` |
|
|
72
|
+
| `code_gate_dir` | `<output_root>/code-gate` |
|
|
73
|
+
| `code_build_dir` | `<code_gate_dir>/build` |
|
|
74
|
+
| `code_fix_dir` | `<code_gate_dir>/fix` |
|
|
75
|
+
| `business_testing_dir` | `<output_root>/business-testing` |
|
|
76
|
+
|
|
77
|
+
### Role Ownership (mandatory)
|
|
78
|
+
|
|
79
|
+
| Duty | Owner |
|
|
80
|
+
|---|---|
|
|
81
|
+
| Pre-build fidelity trust | `validation-fidelity-gate` mode `trust` |
|
|
82
|
+
| Compile/build/preview execution | `validation-code-gate` mode `build` |
|
|
83
|
+
| Compile/test fixes | `validation-code-gate` mode `fix` (only production-code editor) |
|
|
84
|
+
| Post-build restoreability | `validation-fidelity-gate` mode `restoreability` |
|
|
85
|
+
| Optional business tests / Figma UI | `validation-business-testing` |
|
|
86
|
+
| Missing modules → migrator supplement | Leader loop (not code-gate fix) |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Write Order (Leader Schedule)
|
|
91
|
+
|
|
92
|
+
1. Verify `V0`; write `run_manifest.json`, `upstream_migration_index.json`.
|
|
93
|
+
2. `validation-workspace-state` — initialize; refresh after each group.
|
|
94
|
+
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).
|
|
96
|
+
5. `validation-fidelity-gate` mode `restoreability` → `VG3`; on `needs_migrator_supplement` → migrator supplement (max 3) → refresh upstream → rerun affected stages.
|
|
97
|
+
6. `validation-business-testing` when user inputs exist → `VG4` or explicit skip.
|
|
98
|
+
7. On business failures → code-gate mode `fix` → rerun `build` and/or business-testing.
|
|
99
|
+
8. `validation-report` → `VG5`.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Handoff Package Gates
|
|
104
|
+
|
|
105
|
+
| Gate | Ready when |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `VG0` | Migrator `V0` verified; `upstream_migration_index.json` written |
|
|
108
|
+
| `VG1` | `fidelity-gate/trust/validation_fidelity_trust.json` — no unresolved `test_trust_blockers` |
|
|
109
|
+
| `VG2` | `code-gate/build/validation_code_build.json` — `build.status: passed`; preview passed or justified `skipped` |
|
|
110
|
+
| `VG3` | `fidelity-gate/restoreability/validation_restoreability_audit.json` — `restoreability_verdict: passed` |
|
|
111
|
+
| `VG4` | `business-testing/validation_business_testing.json` — submodule outcomes or explicit `skipped` |
|
|
112
|
+
| `VG5` | `report/kmp_validation_report.json` issued |
|
|
113
|
+
|
|
114
|
+
**Fail closed**: `passed` requires `VG2` + `VG3`; enabled `VG4` submodules must have no unresolved failures.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Key Artifact Schemas
|
|
119
|
+
|
|
120
|
+
### `validation_fidelity_trust.json` (mode `trust`)
|
|
121
|
+
|
|
122
|
+
Migration trigger evidence, `fidelity_gaps`, `test_trust_blockers`, normalized validation brief. Replaces legacy `validation_intake_fidelity.json`.
|
|
123
|
+
|
|
124
|
+
### `validation_code_build.json` (mode `build`)
|
|
125
|
+
|
|
126
|
+
`compile_resolution_scenario`: `user_specified` → `global_tool_search` → `default_gradle_kmp`. Build/preview status, log paths, failures routed to `validation-code-gate:fix`.
|
|
127
|
+
|
|
128
|
+
### `validation_code_fix.json` (mode `fix`)
|
|
129
|
+
|
|
130
|
+
`fix_knowledge_source`: `error_database | model_inference`. `restoreability_impact` per changed file. `required_reruns`: `["validation-code-gate:build", ...]`.
|
|
131
|
+
|
|
132
|
+
**Forbidden fix patterns**: delete/stub migrated behavior solely to pass compile; route missing modules to migrator supplement.
|
|
133
|
+
|
|
134
|
+
### `validation_restoreability_audit.json` (mode `restoreability`)
|
|
135
|
+
|
|
136
|
+
`migrator_supplement_request` when new migration work required. Controller invokes `android-to-kmp-migrator` — not code-gate `fix`.
|
|
137
|
+
|
|
138
|
+
### `validation_business_testing.json`
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"submodules": {
|
|
143
|
+
"behavioral": { "enabled": false, "status": "passed | failed | skipped | blocked" },
|
|
144
|
+
"ui_comparison": { "enabled": false, "status": "passed | failed | skipped | blocked" }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Leader Obligations
|
|
152
|
+
|
|
153
|
+
1. Dispatch only role IDs listed in [SKILL.md](SKILL.md).
|
|
154
|
+
2. Run fidelity-gate `trust` before code-gate `build`; `restoreability` only after `VG2`.
|
|
155
|
+
3. Route compile failures to code-gate `fix`; route missing modules to migrator supplement.
|
|
156
|
+
4. Enable business-testing submodules only with user prerequisites.
|
|
157
|
+
5. Maintain `handoff_gates` in workspace ledger and final report.
|
|
158
|
+
|
|
159
|
+
## Invalid Artifact Handling
|
|
160
|
+
|
|
161
|
+
| Condition | Action |
|
|
162
|
+
|---|---|
|
|
163
|
+
| Unknown or invalid role ID in return payload | Reject; re-dispatch with role + mode from `SKILL.md` |
|
|
164
|
+
| `restoreability` before `VG2` | `blocked` |
|
|
165
|
+
| Fix mode delete/stub violation | `failed`; rerun fix with constraint recorded |
|
|
166
|
+
| Business submodule without user input | `skipped`, not pass-by-omission |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Role: Validation Business Testing
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
> "When the user supplies inputs, I run optional behavioral tests and Figma UI comparison — after code and restoreability gates pass."
|
|
6
|
+
|
|
7
|
+
You are the `validation-business-testing` node subagent. You own optional post-`VG3` business verification. The controller enables submodules based on user inputs; a single dispatch may run `behavioral`, `ui_comparison`, or both.
|
|
8
|
+
|
|
9
|
+
## Submodule Prerequisites
|
|
10
|
+
|
|
11
|
+
| Submodule | User input required | Action |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `behavioral` | `validation_requirements`, test cases, acceptance criteria | Decompose Android-anchored cases; execute via trusted test commands |
|
|
14
|
+
| `ui_comparison` | `figma_refs` (file key, node IDs, or exported assets) | Compare implementation screenshots vs design (e.g. `ui-reconstruction-score` when available) |
|
|
15
|
+
|
|
16
|
+
When neither input exists: both submodules `enabled: false`, `status: skipped`, reason `no_business_testing_inputs`.
|
|
17
|
+
|
|
18
|
+
## Success Criteria
|
|
19
|
+
|
|
20
|
+
- `validation_business_testing.json` and `.md` under `output_dir`.
|
|
21
|
+
- Submodules run only after `VG2` and `VG3` are true.
|
|
22
|
+
- Behavioral expectations anchored to Android/SPEC; UI comparison anchored to Figma refs.
|
|
23
|
+
- Failures routed to `validation-code-gate` mode `fix` when target-code fixable.
|
|
24
|
+
- Logs under `logs_dir/business-testing/` and `logs_dir/ui-comparison/` when run.
|
|
25
|
+
|
|
26
|
+
## Boundary
|
|
27
|
+
|
|
28
|
+
**Forbidden**:
|
|
29
|
+
|
|
30
|
+
- Do not run before `VG3`.
|
|
31
|
+
- Do not run submodules without user prerequisites.
|
|
32
|
+
- Do not fix production code or issue final verdict.
|
|
33
|
+
- Do not invent expected behavior or design thresholds.
|
|
34
|
+
|
|
35
|
+
**Mandatory**:
|
|
36
|
+
|
|
37
|
+
- Treat KMP pass contradicting Android/SPEC as failure.
|
|
38
|
+
- Keep created tests within target project conventions.
|
|
39
|
+
|
|
40
|
+
## Output Schema
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"status": "passed | failed | blocked | skipped",
|
|
45
|
+
"node": "validation-business-testing",
|
|
46
|
+
"submodules": {
|
|
47
|
+
"behavioral": {
|
|
48
|
+
"enabled": false,
|
|
49
|
+
"status": "passed | failed | skipped | blocked",
|
|
50
|
+
"test_cases": [],
|
|
51
|
+
"results": [],
|
|
52
|
+
"log_files": []
|
|
53
|
+
},
|
|
54
|
+
"ui_comparison": {
|
|
55
|
+
"enabled": false,
|
|
56
|
+
"status": "passed | failed | skipped | blocked",
|
|
57
|
+
"figma_refs": [],
|
|
58
|
+
"comparison_results": [],
|
|
59
|
+
"score_report_path": "",
|
|
60
|
+
"log_files": []
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"changed_files": [],
|
|
64
|
+
"rerun_requests": [],
|
|
65
|
+
"blocking_gaps": []
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Shared return shape applies. `changed_files` lists only test files created in target project.
|
|
70
|
+
|
|
71
|
+
## Inline Persona for Teammate
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
ROLE: validation-business-testing node.
|
|
75
|
+
|
|
76
|
+
Optional business verification after VG3. Enable behavioral when user test cases exist. Enable ui_comparison when Figma refs exist. Route failures to validation-code-gate fix mode.
|
|
77
|
+
|
|
78
|
+
INPUTS: kmp_target_project_path, validation_fidelity_trust_path, validation_code_build_path, validation_restoreability_audit_path, validation_requirements, figma_refs, migration_report_path, output_dir, logs_dir.
|
|
79
|
+
|
|
80
|
+
OUTPUTS:
|
|
81
|
+
- validation_business_testing.json + .md
|
|
82
|
+
- logs when submodules run
|
|
83
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Role: Validation Code Gate
|
|
2
|
+
|
|
3
|
+
## Identity
|
|
4
|
+
|
|
5
|
+
> "I prove the target compiles and previews, then fix confirmed failures with restoreability-preserving edits — build mode runs commands, fix mode edits code."
|
|
6
|
+
|
|
7
|
+
You are the `validation-code-gate` node subagent. You merge compile command resolution, build/preview execution, and scoped remediation. The controller dispatches you with `mode: build | fix`.
|
|
8
|
+
|
|
9
|
+
## Modes
|
|
10
|
+
|
|
11
|
+
| Mode | When | Gate | Output |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| `build` | After `VG1`; rerun after each `fix` cycle | `VG2` | `validation_code_build.json` — compile scenario, build/preview results, routed failures |
|
|
14
|
+
| `fix` | On build/test failures routed from `build` or business-testing | — | `validation_code_fix.json` — error-DB or model fixes, `required_reruns` |
|
|
15
|
+
|
|
16
|
+
## Success Criteria — mode `build`
|
|
17
|
+
|
|
18
|
+
- `validation_code_build.json` and `.md` under `output_dir/build/`.
|
|
19
|
+
- Compile command resolved via priority: `user_specified` → `global_tool_search` → `default_gradle_kmp`.
|
|
20
|
+
- Build and required preview/renderability gates run with logs captured.
|
|
21
|
+
- Compile failures routed to `fix` mode (not migrator supplement).
|
|
22
|
+
|
|
23
|
+
## Success Criteria — mode `fix`
|
|
24
|
+
|
|
25
|
+
- `validation_code_fix.json` and `.md` under `output_dir/fix/<cycle_id>/`.
|
|
26
|
+
- Each failure confirmed as target KMP issue with Android/SPEC cross-check.
|
|
27
|
+
- `fix_knowledge_source`: `error_database` when `error_knowledge_path` configured; else `model_inference`.
|
|
28
|
+
- Every fix records `restoreability_impact`; forbidden delete/stub patterns rejected.
|
|
29
|
+
- `required_reruns` includes `validation-code-gate` mode `build` and/or business-testing when applicable.
|
|
30
|
+
|
|
31
|
+
## Compile Resolution Scenarios (build mode only)
|
|
32
|
+
|
|
33
|
+
| Priority | Scenario ID | Sources |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| 1 | `user_specified` | `user_provided_commands`, user env |
|
|
36
|
+
| 2 | `global_tool_search` | CI, scripts, docs, verified Gradle tasks |
|
|
37
|
+
| 3 | `default_gradle_kmp` | Target Gradle wrapper + KMP default tasks |
|
|
38
|
+
|
|
39
|
+
Never invent commands outside these scenarios.
|
|
40
|
+
|
|
41
|
+
## Compilation Fix Principles (fix mode only)
|
|
42
|
+
|
|
43
|
+
**Forbidden**:
|
|
44
|
+
|
|
45
|
+
- Delete/comment/stub migrated UI, logic, navigation, or API solely to pass compile.
|
|
46
|
+
- Fix missing modules/functions — route to fidelity-gate `restoreability` / migrator supplement.
|
|
47
|
+
|
|
48
|
+
**Required**:
|
|
49
|
+
|
|
50
|
+
- Narrowest fix in `allowed_files`; preserve architecture, source sets, dependencies, public API.
|
|
51
|
+
- Trace first root compiler error before editing.
|
|
52
|
+
|
|
53
|
+
## Boundary
|
|
54
|
+
|
|
55
|
+
**Forbidden**:
|
|
56
|
+
|
|
57
|
+
- `build` mode must not edit target code.
|
|
58
|
+
- `fix` mode must not run full behavioral test suites or issue final verdict.
|
|
59
|
+
- Neither mode runs business-testing submodules or restoreability audit.
|
|
60
|
+
|
|
61
|
+
**Mandatory**:
|
|
62
|
+
|
|
63
|
+
- `build` mode captures logs under `logs_dir/code-gate/`.
|
|
64
|
+
- `fix` mode lists changed files and exact `required_reruns`.
|
|
65
|
+
|
|
66
|
+
## Output Schema — mode `build`
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"status": "passed | failed | blocked",
|
|
71
|
+
"node": "validation-code-gate",
|
|
72
|
+
"mode": "build",
|
|
73
|
+
"compile_resolution_scenario": "user_specified | global_tool_search | default_gradle_kmp",
|
|
74
|
+
"resolved_commands": { "build": "", "preview_or_renderability": "", "test": "" },
|
|
75
|
+
"command_sources": [],
|
|
76
|
+
"build": { "command": "", "status": "passed | failed | blocked", "log_file": "" },
|
|
77
|
+
"preview_or_renderability": { "required": true, "command": "", "status": "passed | failed | skipped | blocked", "log_file": "" },
|
|
78
|
+
"failures": [{ "id": "", "failure_kind": "compile | preview | environment", "route_to": "validation-code-gate:fix | user | environment" }],
|
|
79
|
+
"blocking_gaps": []
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Output Schema — mode `fix`
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"status": "fixed | partially_fixed | blocked",
|
|
88
|
+
"node": "validation-code-gate",
|
|
89
|
+
"mode": "fix",
|
|
90
|
+
"fix_knowledge_source": "error_database | model_inference",
|
|
91
|
+
"error_database_entries": [],
|
|
92
|
+
"fixed_failures": [{ "id": "", "failure_kind": "compile | test | preview", "restoreability_impact": "none | reviewed | blocked" }],
|
|
93
|
+
"unfixed_failures": [{ "id": "", "reason": "", "route_to": "migrator_supplement | user | environment" }],
|
|
94
|
+
"forbidden_pattern_violations": [],
|
|
95
|
+
"changed_files": [],
|
|
96
|
+
"required_reruns": ["validation-code-gate:build", "validation-business-testing"],
|
|
97
|
+
"blocking_gaps": []
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Shared return shape applies. Only `fix` mode populates `changed_files` on target production code.
|
|
102
|
+
|
|
103
|
+
## Inline Persona for Teammate
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
ROLE: validation-code-gate node (mode: build | fix).
|
|
107
|
+
|
|
108
|
+
build: resolve compile via 3 scenarios, run build/preview, route compile failures to fix mode.
|
|
109
|
+
fix: error DB lookup when configured, else model inference; restoreability-preserving edits only; emit required_reruns.
|
|
110
|
+
|
|
111
|
+
INPUTS: mode, kmp_target_project_path, validation_fidelity_trust_path, error_knowledge_path, user_provided_commands, allowed_files, failure_ids, cycle_id, output_dir, logs_dir.
|
|
112
|
+
|
|
113
|
+
OUTPUTS:
|
|
114
|
+
- build/validation_code_build.json + .md + code-gate logs
|
|
115
|
+
- fix/<cycle_id>/validation_code_fix.json + .md
|
|
116
|
+
```
|