Skip to content

Autoloop Go Migration Progress

This page tracks the Autoloop program that is incrementally rewriting the APM CLI from Python to Go. It is seeded from the memory/autoloop branch, the Autoloop workflow history, issue #3, and PR #39.

FieldValue
Programpython-to-go-migration
StatusActive, open-ended
Autoloop branchautoloop/python-to-go-migration
Tracking issue#3 Python-to-Go Migration
PR#39 Autoloop: python-to-go-migration (merged 2026-05-14)
Last accepted iterationIteration 35, 2026-05-14 04:48 UTC
Best metric21.08% migrated (python_lines_migrated_pct)
Migrated lines15,116 of 71,696 original Python lines
Migrated modules89 recorded in benchmarks/migration-status.json
IterationRunChangeMetric
125717987972Initialized Go module; migrated constants.py, version.py, utils/short_sha.py, utils/paths.py, utils/normalization.py.0.40%
225736801433Migrated utils/yaml_io.py, utils/atomic_io.py, utils/git_env.py.0.68%
325744614816Migrated utils/guards.py.0.85%
425747630390Migrated utils/subprocess_env.py, utils/helpers.py.1.15%
5-12Migrated utils/content_hash.py, utils/exclude.py, utils/path_security.py, utils/version_checker.py, utils/file_ops.py, utils/console.py, utils/diagnostics.py, utils/install_tui.py, utils/github_host.py, utils/reflink.py; branch resets caused repeated rebuilds.0.0%–5.41%
1325771166584Migrated 13 modules including install/errors.py, install/cache_pin.py, install/context.py; 4,245 total lines — stable JSON baseline.5.92%
14-27Repeatedly rebuilt modules lost to branch resets; added compilation/*, models/*, policy/*, marketplace/*, cache/*, integration/*, workflow/*, primitives/*, core/*, deps/*; metrics oscillated with each reset.6.39%–13.98%
28-31Rebuilt lost modules from branch resets; added policy/discovery, phases/integrate, phases/resolve, phases/targets, MCP sub-modules, pipeline, sources, services, drift, and validation modules. Metrics: 13.45%–15.16%.13.45%–15.16%
3225835089265Migrated 16 modules (+4,024 lines): all install phases, all 6 MCP sub-modules, policy/policy_checks (1010), policy/ci_checks (588).16.68%
3325836695236Migrated 9 modules (+1,103 lines): skill_transformer, dispatch, heals chain (base+2 healers), constitution_block, phases/local_content, phases/policy_target_check, phases/policy_gate.18.22%
3425838675792Migrated 5 modules (+1,127 lines): core/scope, marketplace/models, integration/copilot_cowork_paths, models/dependency/mcp, deps/shared_clone_cache.19.79%
3525842273066Migrated 5 modules (+926 lines): policy/models, models/plugin, deps/dependency_graph, core/apm_yml, integration/cleanup.21.08%

All 89 modules recorded in benchmarks/migration-status.json on branch autoloop/python-to-go-migration (as of iteration 35).

Python moduleGo packagePython lines
src/apm_cli/constants.pyinternal/constants55
src/apm_cli/version.pyinternal/version101
src/apm_cli/utils/short_sha.pyinternal/utils/sha45
src/apm_cli/utils/paths.pyinternal/utils/paths27
src/apm_cli/utils/normalization.pyinternal/utils/normalization57
src/apm_cli/utils/yaml_io.pyinternal/utils/yamlio55
src/apm_cli/utils/atomic_io.pyinternal/utils/atomicio52
src/apm_cli/utils/git_env.pyinternal/utils/gitenv97
src/apm_cli/utils/guards.pyinternal/utils/guards123
src/apm_cli/utils/subprocess_env.pyinternal/utils/subprocenv84
src/apm_cli/utils/helpers.pyinternal/utils/helpers131
src/apm_cli/utils/content_hash.pyinternal/utils/contenthash108
src/apm_cli/utils/exclude.pyinternal/utils/exclude169
src/apm_cli/utils/path_security.pyinternal/utils/pathsecurity130
src/apm_cli/utils/version_checker.pyinternal/utils/versionchecker193
src/apm_cli/utils/file_ops.pyinternal/utils/fileops326
src/apm_cli/utils/console.pyinternal/utils/console224
src/apm_cli/utils/diagnostics.pyinternal/utils/diagnostics486
src/apm_cli/utils/install_tui.pyinternal/utils/installtui365
src/apm_cli/utils/github_host.pyinternal/utils/githubhost624
src/apm_cli/utils/reflink.pyinternal/utils/reflink281
src/apm_cli/install/errors.pyinternal/install/errors113
src/apm_cli/install/cache_pin.pyinternal/install/cachepin233
src/apm_cli/install/context.pyinternal/install/installctx166
src/apm_cli/compilation/build_id.pyinternal/compilation/buildid39
src/apm_cli/compilation/constants.pyinternal/compilation/compilationconst18
src/apm_cli/compilation/output_writer.pyinternal/compilation/outputwriter49
src/apm_cli/compilation/constitution.pyinternal/compilation/constitution51
src/apm_cli/models/results.pyinternal/models/results27
src/apm_cli/models/dependency/types.pyinternal/models/deptypes74
src/apm_cli/policy/schema.pyinternal/policy/schema117
src/apm_cli/policy/matcher.pyinternal/policy/matcher84
src/apm_cli/policy/inheritance.pyinternal/policy/inheritance257
src/apm_cli/install/request.pyinternal/install/request60
src/apm_cli/install/summary.pyinternal/install/summary73
src/apm_cli/install/mcp/args.pyinternal/install/mcpargs43
src/apm_cli/runtime/base.pyinternal/runtime/base63
src/apm_cli/marketplace/validator.pyinternal/marketplace/mktvalidator78
src/apm_cli/marketplace/errors.pyinternal/marketplace/mkterrors132
src/apm_cli/marketplace/semver.pyinternal/marketplace/semver234
src/apm_cli/marketplace/tag_pattern.pyinternal/marketplace/tagpattern103
src/apm_cli/marketplace/shadow_detector.pyinternal/marketplace/shadowdetector75
src/apm_cli/cache/url_normalize.pyinternal/cache/urlnormalize133
src/apm_cli/cache/paths.pyinternal/cache/cachepaths169
src/apm_cli/cache/integrity.pyinternal/cache/integrity104
src/apm_cli/integration/utils.pyinternal/integration/intutils46
src/apm_cli/integration/coverage.pyinternal/integration/coverage66
src/apm_cli/workflow/parser.pyinternal/workflow/wfparser92
src/apm_cli/core/null_logger.pyinternal/core/nulllogger84
src/apm_cli/core/docker_args.pyinternal/core/dockerargs96
src/apm_cli/deps/git_remote_ops.pyinternal/deps/gitremoteops91
src/apm_cli/deps/aggregator.pyinternal/deps/aggregator66
src/apm_cli/deps/installed_package.pyinternal/deps/installedpkg54
src/apm_cli/primitives/models.pyinternal/primitives/primmodels269
src/apm_cli/workflow/discovery.pyinternal/workflow/discovery101
src/apm_cli/compilation/claude_formatter.pyinternal/compilation/agentformatter354
src/apm_cli/compilation/gemini_formatter.pyinternal/compilation/agentformatter121
src/apm_cli/compilation/injector.pyinternal/compilation/injector94
src/apm_cli/compilation/template_builder.pyinternal/compilation/templatebuilder174
src/apm_cli/install/plan.pyinternal/install/plan425
src/apm_cli/install/insecure_policy.pyinternal/install/insecurepolicy229
src/apm_cli/install/phases/cleanup.pyinternal/install/phases/cleanup158
src/apm_cli/install/phases/finalize.pyinternal/install/phases/finalize92
src/apm_cli/install/phases/heal.pyinternal/install/phases/heal90
src/apm_cli/install/phases/lockfile.pyinternal/install/phases/lockfile260
src/apm_cli/install/phases/post_deps_local.pyinternal/install/phases/postdepslocal117
src/apm_cli/install/phases/download.pyinternal/install/phases/download135
src/apm_cli/install/mcp/warnings.pyinternal/install/mcp/mcpwarnings123
src/apm_cli/install/mcp/conflicts.pyinternal/install/mcp/mcpconflicts122
src/apm_cli/install/mcp/entry.pyinternal/install/mcp/mcpentry106
src/apm_cli/install/mcp/writer.pyinternal/install/mcp/mcpwriter132
src/apm_cli/install/mcp/command.pyinternal/install/mcp/mcpcommand160
src/apm_cli/install/mcp/registry.pyinternal/install/mcp/mcpregistry277
src/apm_cli/policy/policy_checks.pyinternal/policy/policychecks1010
src/apm_cli/policy/ci_checks.pyinternal/policy/cichecks588
src/apm_cli/integration/skill_transformer.pyinternal/integration/skilltransformer113
src/apm_cli/integration/dispatch.pyinternal/integration/dispatch91
src/apm_cli/install/heals/base.pyinternal/install/heals122
src/apm_cli/install/heals/branch_ref_drift.pyinternal/install/heals66
src/apm_cli/install/heals/buggy_lockfile_recovery.pyinternal/install/heals99
src/apm_cli/compilation/constitution_block.pyinternal/compilation/constitutionblock104
src/apm_cli/install/phases/local_content.pyinternal/install/phases/localcontent191
src/apm_cli/install/phases/policy_target_check.pyinternal/install/phases/policytargetcheck113
src/apm_cli/install/phases/policy_gate.pyinternal/install/phases/policygate204
src/apm_cli/core/scope.pyinternal/core/scope163
src/apm_cli/marketplace/models.pyinternal/marketplace/mktmodels224
src/apm_cli/integration/copilot_cowork_paths.pyinternal/integration/coworkpaths241
src/apm_cli/models/dependency/mcp.pyinternal/models/mcpdep267
src/apm_cli/deps/shared_clone_cache.pyinternal/deps/sharedclonecache232
src/apm_cli/policy/models.pyinternal/policy/policymodels143
src/apm_cli/models/plugin.pyinternal/models/plugin152
src/apm_cli/deps/dependency_graph.pyinternal/deps/depgraph227
src/apm_cli/core/apm_yml.pyinternal/core/apmyml107
src/apm_cli/integration/cleanup.pyinternal/integration/cleanuphelper297

Autoloop tracks python_lines_migrated_pct = (migrated_python_lines / original_python_lines) * 100. The best recorded value is 21.08% (iteration 35, 15,116 of 71,696 lines). go build ./... and go test ./... pass on all accepted iterations. Module-specific Python-vs-Go timing data is not yet present in benchmarks/migration-status.json.

Manifest operations benchmark (scripts/benchmark_manifest_ops.py)

Section titled “Manifest operations benchmark (scripts/benchmark_manifest_ops.py)”

The script scripts/benchmark_manifest_ops.py exists in the repository. A local run was attempted but could not complete (permission denied in the sandbox environment). Results from the previous documented run (2026-05-13) are shown below for reference; re-run locally to get current values.

Scalecheck_collision speedupsync_remove_files speedupcleanup_empty_parents speedupScoped uninstall speedup
Current: 10 pkgs, 50 paths18.1x0.8x0.7x1.4x
Growing: 50 pkgs, 250 paths17.4x1.6x0.5x12.2x
Large monorepo: 100 pkgs, 2,000 paths1,606.6x2.2x0.6x26.0x

cleanup_empty_parents shows a small regression at scale (0.5x-0.9x) because the batch bottom-up algorithm has higher constant overhead than the legacy per-file walk-up at low deleted-file counts. This is expected and acceptable given the gains on the other three operations.

SignalStatusNotes
go build ./...Pass (all accepted iters)Confirmed in iter-32, iter-33, iter-34, iter-35 notes
go test ./...Pass (all accepted iters)Confirmed in iter-32, iter-33, iter-34, iter-35 notes
External depsUnavailable in sandboxgopkg.in/yaml.v3 blocked; stdlib-only YAML scanner used throughout

From the Autoloop memory Future Directions:

  • integration/skill_integrator.py (1,513 lines) — large integrator; worth tackling next.
  • integration/hook_integrator.py (1,071 lines), integration/targets.py (846 lines) — sizeable integrators.
  • install/local_bundle_handler.py (399 lines) — local bundle handling.
  • deps/github_downloader.py (1,686 lines) — requires HTTP client; deferred.
  • Smaller targets: install/template.py (140), runtime/factory.py (139), marketplace/registry.py (136), marketplace/git_stderr.py (173).
  • Wire Go packages into the Python CLI via subprocess or subprocess-replacement.
  • Address recurring branch-reset issue: consider a stable upstream merge strategy.
  • Prefer leaf modules first; fewer internal APM dependencies and lower integration risk.
  • Keep Go implementations stdlib-only when sandbox networking blocks external module fetches.
  • Record every accepted iteration in benchmarks/migration-status.json so this page can report complete module data.

Last updated: 2026-05-14 05:33 UTC.