Skip to content

Move the host launcher into the swarmforge package - #36

Merged
CrypticSwarm merged 3 commits into
masterfrom
host-launcher-into-package
Aug 5, 2026
Merged

Move the host launcher into the swarmforge package#36
CrypticSwarm merged 3 commits into
masterfrom
host-launcher-into-package

Conversation

@CrypticSwarm

Copy link
Copy Markdown
Owner

The launcher, the tongs core, and the git-dir guard each loaded the next by file path — two spec_from_file_location blocks in the launcher, a sys.path prepend in the tongs core, and a loader in each of three test files. Every consumer re-implemented module loading, so none of it could be type-checked, linted for import errors, or mocked through ordinary means.

They are now swarmforge.anvil, swarmforge.tongs, and swarmforge.gitguard, importing each other normally. The only files left that resolve a path are three shims under bin/run-anvil, tongs, git-guard — each of which puts the checkout on sys.path and calls its module's main(). The Makefile's run_agent_container recipe invokes the shims.

This is a move, not a rewrite. Git reports the three files as renames at 98–99% similarity, and the only non-import changes inside them are docstrings and three usage strings that named files a caller can no longer run (run_anvil.pyrun-anvil, tongs.pytongs, git_guard.py:git-guard:). Nothing parses those strings; the Makefile consumes only the guard's stdout, which is unchanged.

Verification

The docker argv is the thing that must not move. Running the real run_opencode and run_claude recipes on this branch and on its base, with docker stubbed to record its argv, produces byte-identical argv on both targets (62 and 84 arguments), with the git guard emitting the same six .git mounts through the new shim.

The unit suite is green, and the make-recipe tests gained a guard that the recipe reaches the launcher through its shim rather than naming a module file: a path-named module still imports fine from a checkout and fails on a machine where the package is not installed, so that drift would otherwise pass CI and break in the field.

The shims resolve __file__ through realpath, so one symlinked onto PATH still finds the checkout it lives in.

The launcher, the tongs core, and the git-dir guard each loaded the next by
file path: two spec_from_file_location blocks in the launcher, one sys.path
prepend in the tongs core, and one loader in each of three test files. Every
consumer re-implemented module loading, so nothing could be type-checked,
linted for import errors, or mocked through ordinary means.

They are now swarmforge.anvil, swarmforge.tongs, and swarmforge.gitguard,
importing each other normally, and the only files that resolve a path are
three shims under bin/ -- run-anvil, tongs, git-guard -- that put the checkout
on sys.path and call the module's main(). The Makefile invokes the shims.

Behavior is unchanged. The usage strings now name the entry points a caller
can actually run, and the make-recipe tests gained a guard that the recipe
reaches the launcher through its shim: naming a module file directly would
still import fine here and fail on a machine without the package installed.
The README named `scripts/run_anvil.py` and `scripts/git_guard.py`, and the
contributor notes described `swarmforge/` as the package the container-side
entrypoint runs. The launcher lives there now too, reached through the shims
under `bin/`, which the overview did not mention at all.
…package

Conflicts:
  AGENTS.md
    - Adjacent lines conflicted: the `anvil/` bullet and the `swarmforge/`
      bullet, for different reasons.
      - master added the Claude status line and its settings seeder to the
        `anvil/` inventory, which this branch left untouched -> took master's
        bullet verbatim.
      - master described `swarmforge/` as the package the entrypoint runs agent
        translation and config merging out of, while this branch rewrote the
        same bullet to name the host launcher now living there and added a
        `bin/` bullet after it -> kept master's wording for the container side
        and folded this branch's host-launcher clause in front of it, then the
        `bin/` bullet unchanged.
@CrypticSwarm
CrypticSwarm merged commit 1efeb92 into master Aug 5, 2026
3 checks passed
@CrypticSwarm
CrypticSwarm deleted the host-launcher-into-package branch August 5, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant