@@ -20,7 +20,59 @@ cutover corpus, not final completion proof. Final completion requires the
2020full command matrix below to be represented as committed fixtures and replayed
2121by Go without invoking the Python runtime.
2222
23- Remaining commands return a "not yet fully implemented" message.
23+ Most remaining commands are wired at the CLI surface. That is not enough for
24+ cutover. A command that prints success without writing the expected files,
25+ mutating ` apm.yml ` , updating ` apm.lock.yaml ` , executing a script, or detecting a
26+ planted failure is still incomplete.
27+
28+ ## Real Criteria
29+
30+ Every completion criterion must be backed by real command execution. The scorer
31+ does not infer completion from test names for ` surface ` , ` help ` , ` functional ` ,
32+ ` state_diff ` , ` python_behavior_contracts ` , or ` benchmarks ` ; each one must emit an
33+ explicit ratio gate.
34+
35+ Crane must run ` go test ./cmd/apm -run TestParityRealFunctionalAndStateDiffContracts -json ` .
36+ That fixture-backed test executes the built Go ` apm ` binary in temporary
37+ projects and emits the existing completion gates directly:
38+
39+ ``` json
40+ {"crane" :" gate" ,"name" :" functional" ,"passing" :N,"total":N }
41+ {"crane" :" gate" ,"name" :" state_diff" ,"passing" :N,"total":N }
42+ ```
43+
44+ Crane must also run the migration benchmark test. It executes fixture-backed
45+ Python-vs-Go benchmark workloads and emits:
46+
47+ ``` json
48+ {"crane" :" gate" ,"name" :" benchmarks" ,"passing" :N,"total":N }
49+ ```
50+
51+ A legacy boolean such as ` {"name":"benchmarks","passed":true} ` is not enough.
52+ The benchmark report must prove that every benchmarked command produced the
53+ expected real artifact or output evidence.
54+
55+ The completion criteria are command-specific:
56+
57+ | Command area | Required proof |
58+ | --- | --- |
59+ | ` init ` | Creates a real ` apm.yml ` manifest. |
60+ | ` install ` | Installs a local package, writes ` apm.lock.yaml ` , and materializes installed content under ` apm_modules/ ` or target paths. |
61+ | ` update ` | Mutates the lockfile when a dependency changes and reports a real no-op when nothing changed. |
62+ | ` compile ` | Writes target artifacts such as ` .github/copilot-instructions.md ` from fixture project state. |
63+ | ` pack ` / ` unpack ` | Writes a non-empty distributable bundle and can extract it back into a temp project. |
64+ | ` run ` / ` preview ` / ` list ` | Reads project scripts, executes or previews the selected script, and reflects the actual manifest contents. |
65+ | ` audit ` / ` policy ` | Fails on planted hidden Unicode, missing lockfile state, or policy violations instead of always reporting success. |
66+ | ` mcp ` / ` runtime ` / ` plugin ` / ` marketplace ` | Persist real manifest or config changes, not just status text. |
67+ | ` cache ` | Removes cache entries while respecting the configured cache root. |
68+ | ` prune ` / ` uninstall ` | Removes only files owned by stale dependencies and proves the removed paths are gone. |
69+ | ` deps ` / ` outdated ` / ` view ` / ` search ` | Read lockfile, marketplace, or registry fixtures and report fixture-derived results. |
70+ | ` self-update ` / ` experimental ` / ` config ` | Persist or validate real configuration state where the Python command does. |
71+
72+ Each new command implementation should add or extend functional, state-diff, and
73+ benchmark fixture coverage before Crane can claim it moved the migration
74+ forward. Shims, dry-runs, mocks, and help-only assertions do not count as command
75+ completion.
2476
2577## Cutover Trigger Conditions
2678
@@ -32,19 +84,23 @@ are true:
3284 ` init ` , ` install ` , ` update ` , ` compile ` , ` pack ` , ` run ` , ` audit ` ,
3385 ` policy ` , ` mcp ` , ` runtime ` , ` targets ` , ` list ` , ` view ` , ` cache ` ,
3486 ` deps ` , ` marketplace ` , ` uninstall ` , ` prune `
35- 3 . Python-vs-Go parity tests pass for all commands in the matrix
36- 4 . The final Python-reference parity run has been frozen into a committed,
87+ 3 . ` TestParityRealFunctionalAndStateDiffContracts ` passes every fixture-backed
88+ real-command scenario and emits passing ` functional ` and ` state_diff ` gates
89+ 4 . Python-vs-Go parity tests pass for all commands in the matrix
90+ 5 . Migration benchmarks pass real fixture-backed command workloads and emit a
91+ passing counted ` benchmarks ` gate
92+ 6 . The final Python-reference parity run has been frozen into a committed,
3793 versioned golden fixture corpus. The corpus must include CLI inventory,
3894 help and usage output, error output, exit codes, generated files, lockfiles,
3995 config files, managed-file manifests, deterministic cache/config layout, and
4096 audit artifacts for the full command matrix.
41- 5 . An all-Go golden replay passes against that corpus with no live Python
97+ 7 . An all-Go golden replay passes against that corpus with no live Python
4298 oracle. The replay must build ` cmd/apm ` and compare only the Go binary
4399 against checked-in fixtures.
44- 6 . A no-Python-runtime check passes: ` APM_PYTHON_BIN ` is unset, the Python CLI
100+ 8 . A no-Python-runtime check passes: ` APM_PYTHON_BIN ` is unset, the Python CLI
45101 is hidden or unavailable to the replay, and the golden replay still passes.
46- 7 . ` go build ./cmd/apm ` produces a single static binary
47- 8 . CI passes on the crane PR branch (` crane/crane-migration-python-to-go-full-apm-cli-rewrite ` )
102+ 9 . ` go build ./cmd/apm ` produces a single static binary
103+ 10 . CI passes on the crane PR branch (` crane/crane-migration-python-to-go-full-apm-cli-rewrite ` )
48104
49105## Cutover Steps
50106
0 commit comments