schedule: every 6h
Python-to-Go Migration
Goal
Incrementally rewrite the APM CLI from Python to Go, one module at a time. This is an open-ended program: each iteration picks the next unmigrated module, writes durable benchmark scripts (if they don't already exist for that module), measures current Python performance, rewrites the module in Go, and measures again. The metric tracks what percentage of the original Python line count has been replaced by working Go code that passes all existing tests and benchmarks.
Each iteration must follow this loop:
- Select -- pick the next unmigrated Python module (start with leaf modules that have few internal dependencies:
utils/, version.py, constants.py, config.py, then work inward).
- Benchmark (before) -- create or update a benchmark script in
benchmarks/ that exercises the module's public API. Run it against the Python implementation and record the baseline.
- Rewrite -- implement the equivalent module in Go under
cmd/apm/ (or internal/), preserving the exact CLI contract and public API surface.
- Benchmark (after) -- run the same benchmark script against the Go implementation and record the result.
- Validate -- run the full test suite (
uv run --extra dev pytest tests/ -x -q) to confirm nothing is broken. The Go binary must be callable from the existing CLI entry point or replace it.
- Report -- update
benchmarks/migration-status.json with the module name, before/after timings, and migration status.
The evaluation metric is the percentage of original Python source lines that have been replaced by tested Go code.
Target
Only modify these files:
cmd/ -- Go source tree (create as needed)
internal/ -- Go internal packages (create as needed)
go.mod -- Go module definition (create as needed)
go.sum -- Go dependency lock (create as needed)
Makefile -- build targets for Go binaries
benchmarks/ -- benchmark scripts and results (create as needed)
benchmarks/migration-status.json -- migration progress tracker
src/apm_cli/**/*.py -- Python source (to remove migrated modules and wire in Go replacements)
tests/**/*.py -- test updates to cover Go-backed modules
Do NOT modify:
.github/workflows/ -- CI workflows
.apm/ -- APM primitives
docs/ -- documentation (update separately)
pyproject.toml -- Python project config (until final cutover)
Evaluation
python3 -c "
import json, pathlib
status_file = pathlib.Path('benchmarks/migration-status.json')
if not status_file.exists():
print(json.dumps({'python_lines_migrated_pct': 0.0}))
else:
data = json.loads(status_file.read_text())
total = data.get('original_python_lines', 71696)
migrated = data.get('migrated_python_lines', 0)
pct = round((migrated / total) * 100, 2) if total > 0 else 0.0
print(json.dumps({'python_lines_migrated_pct': pct}))
"
The metric is python_lines_migrated_pct. Higher is better.
schedule: every 6h
Python-to-Go Migration
Goal
Incrementally rewrite the APM CLI from Python to Go, one module at a time. This is an open-ended program: each iteration picks the next unmigrated module, writes durable benchmark scripts (if they don't already exist for that module), measures current Python performance, rewrites the module in Go, and measures again. The metric tracks what percentage of the original Python line count has been replaced by working Go code that passes all existing tests and benchmarks.
Each iteration must follow this loop:
utils/,version.py,constants.py,config.py, then work inward).benchmarks/that exercises the module's public API. Run it against the Python implementation and record the baseline.cmd/apm/(orinternal/), preserving the exact CLI contract and public API surface.uv run --extra dev pytest tests/ -x -q) to confirm nothing is broken. The Go binary must be callable from the existing CLI entry point or replace it.benchmarks/migration-status.jsonwith the module name, before/after timings, and migration status.The evaluation metric is the percentage of original Python source lines that have been replaced by tested Go code.
Target
Only modify these files:
cmd/-- Go source tree (create as needed)internal/-- Go internal packages (create as needed)go.mod-- Go module definition (create as needed)go.sum-- Go dependency lock (create as needed)Makefile-- build targets for Go binariesbenchmarks/-- benchmark scripts and results (create as needed)benchmarks/migration-status.json-- migration progress trackersrc/apm_cli/**/*.py-- Python source (to remove migrated modules and wire in Go replacements)tests/**/*.py-- test updates to cover Go-backed modulesDo NOT modify:
.github/workflows/-- CI workflows.apm/-- APM primitivesdocs/-- documentation (update separately)pyproject.toml-- Python project config (until final cutover)Evaluation
The metric is
python_lines_migrated_pct. Higher is better.