J204: install infra as a safe CLI alias (D349) #349

Closed
opened 2026-11-04 16:25:06 +00:00 by kayg · 12 comments
Owner

Implement D349 across root, user, up, add-host, macOS and Nix installs. Preserve foreign infra paths and remove only owned aliases. Canonical help through either name. Plan: inspect dispatch/install paths; add failing regressions; implement symlinks; prove root/rootless and macOS behavior; run quick and fast; push branch without merging. Estimate: 3 hours. Branch cli-infra-alias-j204, base e9f2b3ef4. Tests/builds on VMs only, foreground waits, target cleanup at finish.

Implement D349 across root, user, up, add-host, macOS and Nix installs. Preserve foreign infra paths and remove only owned aliases. Canonical help through either name. Plan: inspect dispatch/install paths; add failing regressions; implement symlinks; prove root/rootless and macOS behavior; run quick and fast; push branch without merging. Estimate: 3 hours. Branch cli-infra-alias-j204, base e9f2b3ef4. Tests/builds on VMs only, foreground waits, target cleanup at finish.
Author
Owner

Start: branch cli-infra-alias-j204, base e9f2b3ef4. Dispatch inspection: command_tree explicitly sets bin_name("infraternal"); shim/session/internal roles use arguments after argv[0], so canonical help is already selected. A relative symlink infra -> infraternal follows atomic binary replacement without hardlink stale-image risk or a wrapper exec. Existing PATH publication found in up.rs, SSH bootstrap, and nix/package.nix. Separate download/root/user/macOS installer scripts are not present on this origin/dev tree; investigating the actual macOS service entry and will cover existing publication points without inventing a new installer. compute01 and dev02 slots are busy; root proof must use compute01. Added regression tests before implementation.

Start: branch cli-infra-alias-j204, base e9f2b3ef4. Dispatch inspection: command_tree explicitly sets bin_name("infraternal"); shim/session/internal roles use arguments after argv[0], so canonical help is already selected. A relative symlink infra -> infraternal follows atomic binary replacement without hardlink stale-image risk or a wrapper exec. Existing PATH publication found in up.rs, SSH bootstrap, and nix/package.nix. Separate download/root/user/macOS installer scripts are not present on this origin/dev tree; investigating the actual macOS service entry and will cover existing publication points without inventing a new installer. compute01 and dev02 slots are busy; root proof must use compute01. Added regression tests before implementation.
Author
Owner

RED evidence on compute01 (real ACTIVATE shell, isolated filesystem, inert service manager): canonical launcher exists: True; infra alias exists: False; AssertionError: D349 missing: successful bootstrap does not create infra. Compiled regression suite is queued in foreground at ~/.cache/codex-scratch/j204/red-ssh.log. Question for orchestrator: are the separately mentioned root/rootless/macOS download installers in another checkout? origin/dev has only SSH root/user bootstrap, Linux up, macOS mesh service, Nix package and release tooling. Safe default: cover each existing publication point and the existing macOS service rather than add a new installer.

RED evidence on compute01 (real ACTIVATE shell, isolated filesystem, inert service manager): canonical launcher exists: True; infra alias exists: False; AssertionError: D349 missing: successful bootstrap does not create infra. Compiled regression suite is queued in foreground at ~/.cache/codex-scratch/j204/red-ssh.log. Question for orchestrator: are the separately mentioned root/rootless/macOS download installers in another checkout? origin/dev has only SSH root/user bootstrap, Linux up, macOS mesh service, Nix package and release tooling. Safe default: cover each existing publication point and the existing macOS service rather than add a new installer.
Author
Owner

Progress: pushed WIP 3ad003f1b on cli-infra-alias-j204. Relative aliases implemented in Linux up, root/user SSH bootstrap, macOS service/release bundle and both Nix entry directories. Foreign alias warnings use a strict fixed receipt because SSH discards stderr; bootstrap emits the existing progress event. Rollback tracks newly created links and uninstall verifies target/uid. Shared filesystem helper tests: 3 passed on compute01 (standalone rustc via nix develop). Foreground quick precheck queued at ~/.cache/codex-scratch/j204/quick.log, using only ~/worktrees/j204/target. No background builds left unattended.

Progress: pushed WIP 3ad003f1b on cli-infra-alias-j204. Relative aliases implemented in Linux up, root/user SSH bootstrap, macOS service/release bundle and both Nix entry directories. Foreign alias warnings use a strict fixed receipt because SSH discards stderr; bootstrap emits the existing progress event. Rollback tracks newly created links and uninstall verifies target/uid. Shared filesystem helper tests: 3 passed on compute01 (standalone rustc via nix develop). Foreground quick precheck queued at ~/.cache/codex-scratch/j204/quick.log, using only ~/worktrees/j204/target. No background builds left unattended.
Author
Owner

Native macOS evidence under lockf -k /tmp/mac-bench.lock: standalone shared alias module tests ran on infraternal-macos-01-std, 3 passed / 0 failed. They cover image replacement, repeated install, uninstall, foreign files/directories/dangling symlinks, replaced aliases and mismatched ownership. No service or keychain state touched. Added regression coverage for compound SSH warning receipt and rollback after alias replacement.

Native macOS evidence under lockf -k /tmp/mac-bench.lock: standalone shared alias module tests ran on infraternal-macos-01-std, 3 passed / 0 failed. They cover image replacement, repeated install, uninstall, foreign files/directories/dangling symlinks, replaced aliases and mismatched ownership. No service or keychain state touched. Added regression coverage for compound SSH warning receipt and rollback after alias replacement.
Author
Owner

Additional native macOS proof: executed the release staging install/link commands with the installed CLI in an isolated temporary directory under the Mac lock. Output: macOS release staging: infra -> infraternal, both names work; help/version/error identical. Doc coverage ratchet also passed. compute01 quick remains foreground-queued; both VM slot pools are full. No tests/builds run on control host.

Additional native macOS proof: executed the release staging install/link commands with the installed CLI in an isolated temporary directory under the Mac lock. Output: macOS release staging: infra -> infraternal, both names work; help/version/error identical. Doc coverage ratchet also passed. compute01 quick remains foreground-queued; both VM slot pools are full. No tests/builds run on control host.
Author
Owner

Finding: rollback retires bin/live and bin/current before alias cleanup. A shell -O test follows infra through that now-dangling chain and cannot establish link ownership. Fixed both setup and rollback to inspect the symlink uid with stat (without -L); rollback also checks the literal canonical launcher target. Pushed checkpoint c77b660c5. Workspace clippy completed successfully in the foreground quick precheck; unit-test compilation is now running. Full gate and root/rootless binary proof remain pending.

Finding: rollback retires bin/live and bin/current before alias cleanup. A shell -O test follows infra through that now-dangling chain and cannot establish link ownership. Fixed both setup and rollback to inspect the symlink uid with stat (without -L); rollback also checks the literal canonical launcher target. Pushed checkpoint c77b660c5. Workspace clippy completed successfully in the foreground quick precheck; unit-test compilation is now running. Full gate and root/rootless binary proof remain pending.
Author
Owner

Implementation is now one atomic commit, d5464fba1e, pushed on cli-infra-alias-j204. Quick precheck: scope guard PASS; fmt PASS; doc coverage ratchet PASS; workspace clippy PASS; changed-package unit test compilation FAIL (101): existing bulk_reply_completion_waits_for_the_last_transport_packet_reference is guarded by socket-host but calls send_and_wait, which is guarded by native-streams. Queued a single foreground slot run to reproduce on unmodified base e9f2b3ef4, run alias regressions with the supported feature enabled, prove root/rootless installs, then run scripts/verify fast. Root orchestration retains the slot but compilation remains claude-owned; root proofs use the throwaway /root/infraternal-j204-proof clone. Only target: /home/claude/worktrees/j204/target.

Implementation is now one atomic commit, d5464fba1e4f5a232c64ab7c0f64306809ce6149, pushed on cli-infra-alias-j204. Quick precheck: scope guard PASS; fmt PASS; doc coverage ratchet PASS; workspace clippy PASS; changed-package unit test compilation FAIL (101): existing bulk_reply_completion_waits_for_the_last_transport_packet_reference is guarded by socket-host but calls send_and_wait, which is guarded by native-streams. Queued a single foreground slot run to reproduce on unmodified base e9f2b3ef4, run alias regressions with the supported feature enabled, prove root/rootless installs, then run scripts/verify fast. Root orchestration retains the slot but compilation remains claude-owned; root proofs use the throwaway /root/infraternal-j204-proof clone. Only target: /home/claude/worktrees/j204/target.
Author
Owner

Baseline proof completed in the foreground build slot: unmodified e9f2b3ef4 reproduces exit 101 with error[E0599], no method named send_and_wait found for ReplySender, at crates/infraternal-plugin-api/src/tests.rs:467. The implementation changes neither that test nor the method feature guard. Log: /home/claude/.cache/codex-scratch/j204/baseline-quick.log on compute01. Restored d5464fba1 and started the alias regressions with socket-host,native-streams enabled for the API test. This is a pre-existing quick scope feature-unification failure; the required full fast gate follows.

Baseline proof completed in the foreground build slot: unmodified e9f2b3ef4 reproduces exit 101 with error[E0599], no method named send_and_wait found for ReplySender, at crates/infraternal-plugin-api/src/tests.rs:467. The implementation changes neither that test nor the method feature guard. Log: /home/claude/.cache/codex-scratch/j204/baseline-quick.log on compute01. Restored d5464fba1 and started the alias regressions with socket-host,native-streams enabled for the API test. This is a pre-existing quick scope feature-unification failure; the required full fast gate follows.
Author
Owner

Foreground progress at head d5464fba1e: all targeted alias regressions passed (shared helper 3, SSH 5, CLI 1, system-up 1). Actual root proof ran in /root/infraternal-j204-proof on compute01, and rootless proof ran as uid 1500: both names work with identical help/version/errors, foreign files/links/directories survive with ALIAS skipped, and actual Nix installPhase exposes working bin/share names. Root system-up unit test also passed. Full scripts/verify fast is still foreground-running in the same build slot, currently server tests with no reported failure so far. Logs attached; only target remains /home/claude/worktrees/j204/target and will be deleted after static evidence. Mac temporary proof files have been removed. No merge/deploy.

Foreground progress at head d5464fba1e4f5a232c64ab7c0f64306809ce6149: all targeted alias regressions passed (shared helper 3, SSH 5, CLI 1, system-up 1). Actual root proof ran in /root/infraternal-j204-proof on compute01, and rootless proof ran as uid 1500: both names work with identical help/version/errors, foreign files/links/directories survive with ALIAS skipped, and actual Nix installPhase exposes working bin/share names. Root system-up unit test also passed. Full scripts/verify fast is still foreground-running in the same build slot, currently server tests with no reported failure so far. Logs attached; only target remains /home/claude/worktrees/j204/target and will be deleted after static evidence. Mac temporary proof files have been removed. No merge/deploy.
Author
Owner

Foreground progress at unchanged pushed head d5464fba1e: full fast gate completed Rust tests, cargo-deny, architecture checks, doc coverage and both static builds without a reported failure; TypeScript/tracer bundle checks are finishing. Static images: x86_64 23,394,416 bytes and aarch64 21,255,152 bytes, both PT_INTERP absent. Gate recorded-baseline deltas are +976,160 / +801,872 bytes (report only). The same-slot runner next saves head artifacts, builds task base e9f2b3ef4 for actual slice deltas, restores head, and repeats real root/rootless proof with the shipping x86 image. Foreground session is retained; target cleanup follows all evidence.

Foreground progress at unchanged pushed head d5464fba1e4f5a232c64ab7c0f64306809ce6149: full fast gate completed Rust tests, cargo-deny, architecture checks, doc coverage and both static builds without a reported failure; TypeScript/tracer bundle checks are finishing. Static images: x86_64 23,394,416 bytes and aarch64 21,255,152 bytes, both PT_INTERP absent. Gate recorded-baseline deltas are +976,160 / +801,872 bytes (report only). The same-slot runner next saves head artifacts, builds task base e9f2b3ef4 for actual slice deltas, restores head, and repeats real root/rootless proof with the shipping x86 image. Foreground session is retained; target cleanup follows all evidence.
Author
Owner

J204 implementation finished and pushed. Branch cli-infra-alias-j204, head d5464fba1e4f5a232c64ab7c0f64306809ce6149, task base e9f2b3ef4aa35f24795c435e3f76bd5389c79905. No merge or deploy; issue left open.

Relative infra -> infraternal links are installed beside the existing root/user SSH launchers (including add-host), system up launcher, macOS service executable and release staging executable, and both Nix bin and share/infraternal commands. Occupied foreign paths are preserved and reported. Rollback/uninstall removes only a link with the expected literal target and uid. The setup receipt is fixed and validated before the warning reaches bootstrap progress. Shell configuration is untouched.

Symlinks follow atomic canonical binary replacements. Hardlinks would retain an older image; a wrapper adds an exec. Help, usage and errors keep the canonical infraternal spelling. Shim/session dispatch uses explicit arguments after argv[0]; the real CLI regression proves equal help, version, invalid text/JSON command and private shim output/status through both names.

Tests first: the actual baseline ACTIVATE shell failed before implementation because infra was absent (earlier RED receipt above). The final proof also fails on unmodified task base with FileNotFoundError for bin/infra, then passes at head. Targeted regressions passed: shared helper 3, SSH installer 5, real CLI 1, system-up install 1. Shared tests cover image replacement, repeated installation, cleanup, foreign files/directories/dangling links and mismatched uid/replaced links.

Real environment evidence: compute01 root proof ran from throwaway /root/infraternal-j204-proof; rootless proof ran as uid 1500. Actual embedded activation shell and Nix installPhase published both working names using the built binary, with isolated filesystem paths and an inert service manager. Both debug and final shipping-static x86 proofs passed; foreign files, links and directories survived with the expected warning. The system-up install unit test also ran successfully as actual root. Native macOS shared helper tests passed under the Mac lock (3/3), and release staging with the installed CLI produced identical help/version/error output through both names. No live Mac service or keychain changes were made.

CARGO_BUILD_JOBS=4 RUST_TEST_THREADS=4 nix develop -c scripts/verify fast ran on compute01 through one build slot, foreground-polled to completion at the head above. Exit 0. Verbatim Rust gate summary follows; the attached fast.log is the complete verbatim output, including the subsequent passing metadata, startup cleanup, artifact checksum, TypeScript, tracer/bundle and protocol checks.

+---------------------------+--------------+
| Rust gate                 | Result       |
+---------------------------+--------------+
| fmt                       | PASS         |
| VT native fmt             | PASS         |
| CLI plugin compile-out    | PASS         |
| clippy                    | PASS         |
| SSH runtime test helper   | PASS         |
| real-binary fixture paths | PASS         |
| Traefik component manifest | PASS         |
| release component publication | PASS         |
| test                      | PASS         |
| SSH inode reuse fixture   | PASS         |
| shim process-per-user     | PASS         |
| cargo-deny                | PASS         |
| gate architecture         | PASS         |
| doc coverage ratchet      | PASS         |
| static builds             | PASS         |
+---------------------------+--------------+

Quick precheck ran first: scope guard, fmt, doc coverage and workspace clippy passed; changed-package unit compilation exited 101. Unmodified task base reproduces the same E0599 at plugin-api/src/tests.rs:467: a socket-host-only test calls ReplySender::send_and_wait, whose method requires native-streams. Baseline log attached. Alias regressions pass with the required features; the complete fast gate passes. No unrelated guard change was made.

Fresh stripped static sizes, same compute01 target and shipping recipe, versus the unmodified task base:

target base bytes head bytes delta bytes
x86_64 23,385,200 23,394,416 +9,216
aarch64 21,250,032 21,255,152 +5,120

Both head images have no PT_INTERP. x86 native key-memory check passed; arm64 native key-memory execution is SKIP on the x86 host, as reported by the gate. Raw gate deltas versus its recorded baselines are +976,160 / +801,872 bytes; those include changes already present in this task's base.

Cleanup verified: /home/claude/worktrees/j204/target and the root throwaway clone are deleted, no J204 process remains, and Mac temporary proof files are removed. Small logs and saved head binaries remain outside target for review. Control and VM worktrees are clean; remote branch resolves to the head above.

How to test:

  1. Install through an existing path, then compare infraternal --help and infra --help (also --version and an invalid command).
  2. Place a foreign infra in the destination before installation: it must survive with a skip warning.
  3. Replace our alias with a foreign link before uninstall: that replacement must survive.

Scope question remains recorded above: separate root/rootless/macOS download installer scripts do not exist on this task's origin/dev base. All existing publication points found there are covered; no new installer was invented. No owner decision is needed for the chosen symlink mechanism, already permitted by D349.

J204 implementation finished and pushed. Branch `cli-infra-alias-j204`, head `d5464fba1e4f5a232c64ab7c0f64306809ce6149`, task base `e9f2b3ef4aa35f24795c435e3f76bd5389c79905`. No merge or deploy; issue left open. Relative `infra -> infraternal` links are installed beside the existing root/user SSH launchers (including add-host), system `up` launcher, macOS service executable and release staging executable, and both Nix `bin` and `share/infraternal` commands. Occupied foreign paths are preserved and reported. Rollback/uninstall removes only a link with the expected literal target and uid. The setup receipt is fixed and validated before the warning reaches bootstrap progress. Shell configuration is untouched. Symlinks follow atomic canonical binary replacements. Hardlinks would retain an older image; a wrapper adds an exec. Help, usage and errors keep the canonical `infraternal` spelling. Shim/session dispatch uses explicit arguments after argv[0]; the real CLI regression proves equal help, version, invalid text/JSON command and private shim output/status through both names. Tests first: the actual baseline ACTIVATE shell failed before implementation because `infra` was absent (earlier RED receipt above). The final proof also fails on unmodified task base with FileNotFoundError for bin/infra, then passes at head. Targeted regressions passed: shared helper 3, SSH installer 5, real CLI 1, system-up install 1. Shared tests cover image replacement, repeated installation, cleanup, foreign files/directories/dangling links and mismatched uid/replaced links. Real environment evidence: compute01 root proof ran from throwaway `/root/infraternal-j204-proof`; rootless proof ran as uid 1500. Actual embedded activation shell and Nix installPhase published both working names using the built binary, with isolated filesystem paths and an inert service manager. Both debug and final shipping-static x86 proofs passed; foreign files, links and directories survived with the expected warning. The system-up install unit test also ran successfully as actual root. Native macOS shared helper tests passed under the Mac lock (3/3), and release staging with the installed CLI produced identical help/version/error output through both names. No live Mac service or keychain changes were made. `CARGO_BUILD_JOBS=4 RUST_TEST_THREADS=4 nix develop -c scripts/verify fast` ran on compute01 through one build slot, foreground-polled to completion at the head above. Exit 0. Verbatim Rust gate summary follows; the attached fast.log is the complete verbatim output, including the subsequent passing metadata, startup cleanup, artifact checksum, TypeScript, tracer/bundle and protocol checks. ``` +---------------------------+--------------+ | Rust gate | Result | +---------------------------+--------------+ | fmt | PASS | | VT native fmt | PASS | | CLI plugin compile-out | PASS | | clippy | PASS | | SSH runtime test helper | PASS | | real-binary fixture paths | PASS | | Traefik component manifest | PASS | | release component publication | PASS | | test | PASS | | SSH inode reuse fixture | PASS | | shim process-per-user | PASS | | cargo-deny | PASS | | gate architecture | PASS | | doc coverage ratchet | PASS | | static builds | PASS | +---------------------------+--------------+ ``` Quick precheck ran first: scope guard, fmt, doc coverage and workspace clippy passed; changed-package unit compilation exited 101. Unmodified task base reproduces the same E0599 at plugin-api/src/tests.rs:467: a socket-host-only test calls ReplySender::send_and_wait, whose method requires native-streams. Baseline log attached. Alias regressions pass with the required features; the complete fast gate passes. No unrelated guard change was made. Fresh stripped static sizes, same compute01 target and shipping recipe, versus the unmodified task base: | target | base bytes | head bytes | delta bytes | | --- | ---: | ---: | ---: | | x86_64 | 23,385,200 | 23,394,416 | +9,216 | | aarch64 | 21,250,032 | 21,255,152 | +5,120 | Both head images have no PT_INTERP. x86 native key-memory check passed; arm64 native key-memory execution is SKIP on the x86 host, as reported by the gate. Raw gate deltas versus its recorded baselines are +976,160 / +801,872 bytes; those include changes already present in this task's base. Cleanup verified: `/home/claude/worktrees/j204/target` and the root throwaway clone are deleted, no J204 process remains, and Mac temporary proof files are removed. Small logs and saved head binaries remain outside target for review. Control and VM worktrees are clean; remote branch resolves to the head above. How to test: 1. Install through an existing path, then compare `infraternal --help` and `infra --help` (also `--version` and an invalid command). 2. Place a foreign `infra` in the destination before installation: it must survive with a skip warning. 3. Replace our alias with a foreign link before uninstall: that replacement must survive. Scope question remains recorded above: separate root/rootless/macOS download installer scripts do not exist on this task's origin/dev base. All existing publication points found there are covered; no new installer was invented. No owner decision is needed for the chosen symlink mechanism, already permitted by D349.
Author
Owner

J256 housekeeping, authorized by kayg. Closing: The existing install/publication points now provide the owned infra symlink, preserve foreign paths, and have root, rootless and macOS evidence plus a passing fast gate. The final receipt states no owner decision remains.

Merged on dev: 953baf1783.

Rechecked all comments and issue timestamps immediately before closure; no activity in the last 12 hours. Audit: #369.

J256 housekeeping, authorized by kayg. Closing: The existing install/publication points now provide the owned infra symlink, preserve foreign paths, and have root, rootless and macOS evidence plus a passing fast gate. The final receipt states no owner decision remains. Merged on dev: https://git.kayg.org/kayg/infraternal/commit/953baf17831d8998a7e9352c5a339d28e507f3dd. Rechecked all comments and issue timestamps immediately before closure; no activity in the last 12 hours. Audit: #369.
kayg closed this issue 2026-11-05 17:48:44 +00:00
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#349
No description provided.