Skip to content

Commit a7cea34

Browse files
Copilotmrjf
andauthored
docs: document Go CLI migration usage
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent 8f86a97 commit a7cea34

2 files changed

Lines changed: 110 additions & 0 deletions

File tree

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
11
# APM – Agent Package Manager
22

33
Experimental go migration of APM.
4+
5+
## Go CLI migration status
6+
7+
The Python-to-Go CLI migration is now landed but still intentionally keeps both
8+
implementations in the tree:
9+
10+
- The Python CLI remains the reference implementation and parity oracle.
11+
- The Go CLI lives under `cmd/apm` and can be built as a local `apm-go` binary.
12+
- The Crane migration PR was merged in
13+
[githubnext/apm#91](https://github.com/githubnext/apm/pull/91), and the
14+
migration issue is marked `crane-completed` in
15+
[githubnext/apm#78](https://github.com/githubnext/apm/issues/78).
16+
- The restored migration workflow verifies Python-vs-Go parity with
17+
`APM_PYTHON_BIN` set. Latest verified parity evidence reports
18+
`migration_score=1`, `progress=1`, and `706/706` parity tests passing.
19+
- The benchmark workflow follow-up in
20+
[githubnext/apm#93](https://github.com/githubnext/apm/pull/93) uploads a
21+
`migration-benchmark-evidence` artifact with Python-vs-Go CLI timings.
22+
23+
This means Python unit tests and Go parity tests pass for the migration gate.
24+
That gate is not the same thing as claiming all historical Python integration,
25+
live-service, and benchmark coverage is now green for every workflow.
26+
27+
### Build and run the Go CLI locally
28+
29+
From the repository root:
30+
31+
```bash
32+
go build -o ./dist/apm-go ./cmd/apm
33+
```
34+
35+
Then try the local binary:
36+
37+
```bash
38+
./dist/apm-go --help
39+
./dist/apm-go init --yes
40+
```
41+
42+
### Run the definitive parity check locally
43+
44+
When the Python CLI is installed in the project virtual environment, run:
45+
46+
```bash
47+
uv sync --extra dev
48+
export APM_PYTHON_BIN="$PWD/.venv/bin/apm"
49+
go test ./...
50+
go test -json ./... | go run .crane/scripts/score.go
51+
```
52+
53+
`APM_PYTHON_BIN` is required for the hard Python-vs-Go parity gate; without it,
54+
Go-only tests are not completion evidence.
55+
56+
### Run the Actions parity and benchmark workflow
57+
58+
Maintainers can dispatch the migration workflow manually:
59+
60+
```bash
61+
gh workflow run migration-ci.yml --repo githubnext/apm --ref main
62+
```
63+
64+
After it runs, open the **Migration Benchmarks** job summary for the timing
65+
table. The same run uploads the `migration-benchmark-evidence` artifact with
66+
JSON and Markdown copies of the benchmark data. In the benchmark table, the
67+
`Go/Python` ratio is the Go median duration divided by the Python median
68+
duration: values below `1.00x` mean Go is faster. Recent smoke benchmark
69+
evidence for startup/help/init-style commands shows the Go CLI roughly
70+
`327x`-`370x` faster than the Python CLI.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from __future__ import annotations
2+
3+
from pathlib import Path
4+
5+
ROOT = Path(__file__).resolve().parents[2]
6+
7+
8+
def test_readme_documents_go_cli_migration_usage() -> None:
9+
readme = (ROOT / "README.md").read_text(encoding="utf-8")
10+
11+
required_snippets = [
12+
"The Python CLI remains the reference implementation and parity oracle.",
13+
"The Go CLI lives under `cmd/apm`",
14+
"githubnext/apm#91",
15+
"githubnext/apm#78",
16+
"githubnext/apm#93",
17+
"go build -o ./dist/apm-go ./cmd/apm",
18+
"./dist/apm-go --help",
19+
"./dist/apm-go init --yes",
20+
'export APM_PYTHON_BIN="$PWD/.venv/bin/apm"',
21+
"go test -json ./... | go run .crane/scripts/score.go",
22+
"gh workflow run migration-ci.yml --repo githubnext/apm --ref main",
23+
"`migration-benchmark-evidence`",
24+
"`Go/Python` ratio is the Go median duration divided by the Python median",
25+
"`327x`-`370x` faster",
26+
]
27+
28+
for snippet in required_snippets:
29+
assert snippet in readme
30+
31+
32+
def test_readme_distinguishes_parity_gate_from_full_historical_coverage() -> None:
33+
readme = (ROOT / "README.md").read_text(encoding="utf-8")
34+
35+
assert (
36+
"`migration_score=1`, `progress=1`, and `706/706` parity tests passing"
37+
in readme
38+
)
39+
assert (
40+
"That gate is not the same thing as claiming all historical Python integration,"
41+
in readme
42+
)
43+
assert "`APM_PYTHON_BIN` is required for the hard Python-vs-Go parity gate" in readme

0 commit comments

Comments
 (0)