refactor(module): de-inline payload bodies into modules/src/ (#154 Phase 1) - #181
Open
defangdevs wants to merge 1 commit into
Open
refactor(module): de-inline payload bodies into modules/src/ (#154 Phase 1)#181defangdevs wants to merge 1 commit into
defangdevs wants to merge 1 commit into
Conversation
, Phase 1) Move the 15 remaining inline payloads out of agent-box.nix.in into real files under modules/src/: the per-user supervisor (mkStart), session CLI, env-exec wrapper, attach script, password helper, the four Caddyfile fragments, spot monitor, self-update script, codex remote-control wrapper, webhook CLI + spawner, and the default AGENTS.md. The template drops from 3341 to 1784 lines. The move is a PURE byte-identical cut: a new @@include-verbatim:@@ assembler marker splices a file with NO escaping, so each src file holds the body exactly as it sat inside the template's indented string — Nix-string dialect, live ${...} antiquotes and ''$-escapes included. That is deliberate: Phase 2 converts each payload into a genuine shell/python file (antiquotes purged, dialect unescaped) and flips its marker to the escaping @@include:@@ form, and THAT diff is where content review belongs. This one is verifiable mechanically: - regenerated modules/agent-box.nix is byte-identical (empty git diff; module-generated-up-to-date green) - golden-snapshot check: derivation unchanged, fixture untouched - module-single-file green Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPHNnT2DsWHLhbbhsq2Wc7
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of #154, stacked on #179 (Phase 0) — it uses the golden-snapshot check as its proof; retarget to master once #179 merges.
What moved
The 15 payloads still inlined in
modules/agent-box.nix.innow live as files undermodules/src/, spliced back by the assembler: supervisor (supervisor.sh), session CLI, env-exec wrapper, attach script, password helper, the Caddyfile template (header/terminal/root/webhook fragments), spot monitor, self-update script, codex remote-control wrapper, webhook CLI + spawner, and the default AGENTS.md. The template drops 3341 → 1784 lines. (settings-daemon.py had already established the pattern in #97/#140.)Why the new
@@include-verbatim:markerThe existing
@@include:escapes content for Nix indented strings, which would turn a live${pkgs.jq}antiquote into a literal. These payloads still carry live antiquotes (that's Phase 2's target), so Phase 1 adds a-verbatimmarker that splices the file unescaped: each src file holds the body exactly as it sat inside the template string — Nix-string dialect,''$-escapes and all.That makes this PR a pure cut/paste whose correctness is machine-checked, and defers all content changes to Phase 2, where each file becomes a genuine shell/python script and its marker flips to the escaping
@@include:form. Reviewing this PR = reviewing the assembler change (+8 lines) and trusting the byte-identity proofs; the src files need no line-by-line read.Proof of byte-identity
modules/agent-box.nixis byte-identical — the committed file has no diff in this PR, andmodule-generated-up-to-dateis green.checks.aarch64-linux.golden-snapshot: the snapshot derivation didn't even rebuild (same input hashes); fixture untouched.module-single-file,multi-usereval checks green.Second checkbox of #154.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NPHNnT2DsWHLhbbhsq2Wc7