Add bash-to-go migration dev plan #16

Merged
vnprc merged 2 commits from agent/bash-to-go-migration-plan into master 2026-07-11 13:22:28 +01:00
Member

Adds dev-plans/bash-to-go-migration.md: a phased plan to migrate the four program-shaped bash tools in allod/tools (forge, allod, flake-update-cascade, flake-status) to stdlib-only Go, keeping pipeline-shaped tools, git hooks, and all nexus provisioning in bash, and deferring the nexus rotation suite.

Based on a full audit of the bash inventory across tools, nexus, vm, and profiles (~10,600 production lines + ~9,600 test lines): decision rule, per-tool split, language tradeoffs against the Allod priorities, cross-repo cutover sequencing (writeShellApplication → buildGoModule), and per-phase risk.

Refs allod/tools#98

Risk

R0 for this PR (docs only). The plan itself scores the implementation R3 overall, per-phase table inside.

Validation

Plan follows allod/memory/templates/dev-plan.md section order; tracking issue exists (allod/tools#98); sequencing checked against the live packaging in profiles/hosts/dev/home-shared.nix and nexus/nix/home.nix; no conflict with the active pull-all redesign (allod/tools#87), which stays bash and out of scope.

Adds `dev-plans/bash-to-go-migration.md`: a phased plan to migrate the four program-shaped bash tools in `allod/tools` (`forge`, `allod`, `flake-update-cascade`, `flake-status`) to stdlib-only Go, keeping pipeline-shaped tools, git hooks, and all nexus provisioning in bash, and deferring the nexus rotation suite. Based on a full audit of the bash inventory across `tools`, `nexus`, `vm`, and `profiles` (~10,600 production lines + ~9,600 test lines): decision rule, per-tool split, language tradeoffs against the Allod priorities, cross-repo cutover sequencing (writeShellApplication → buildGoModule), and per-phase risk. Refs allod/tools#98 ## Risk R0 for this PR (docs only). The plan itself scores the implementation R3 overall, per-phase table inside. ## Validation Plan follows `allod/memory/templates/dev-plan.md` section order; tracking issue exists (allod/tools#98); sequencing checked against the live packaging in `profiles/hosts/dev/home-shared.nix` and `nexus/nix/home.nix`; no conflict with the active pull-all redesign (allod/tools#87), which stays bash and out of scope.
Author
Member

Self-review findings (standing focus areas):

  1. Acceptance test determinism (Phase 0): nix build .#checks-placeholder 2>/dev/null || nix flake check is a fallback chain, not a test. The dev flake is a Phase 0 deliverable, so the gate should be plain nix flake check.

  2. Token-safety check is racy and checks the wrong process: forge pr list & p=$!; grep -c token /proc/$p/cmdline races the process exit and inspects the parent's argv, which never carried the token even in bash — the historical risk was child (curl) argv. Replacing with a precise executable gate: static assertion that the forge API path imports no os/exec, plus a Go test that the Authorization header is set only in-process.

  3. Verified during review: curl and jq are in the dev VM system closure independent of the wrappers (checked hosts/dev/dev-1/configuration.nix and the live VM), so the Phase 4 rollback workaround (running the bash forge from the checkout) holds.

Fixes for 1 and 2 in a follow-up commit.

Self-review findings (standing focus areas): 1. **Acceptance test determinism (Phase 0)**: `nix build .#checks-placeholder 2>/dev/null || nix flake check` is a fallback chain, not a test. The dev flake is a Phase 0 deliverable, so the gate should be plain `nix flake check`. 2. **Token-safety check is racy and checks the wrong process**: `forge pr list & p=$!; grep -c token /proc/$p/cmdline` races the process exit and inspects the parent's argv, which never carried the token even in bash — the historical risk was *child* (curl) argv. Replacing with a precise executable gate: static assertion that the forge API path imports no `os/exec`, plus a Go test that the Authorization header is set only in-process. 3. Verified during review: `curl` and `jq` are in the dev VM system closure independent of the wrappers (checked `hosts/dev/dev-1/configuration.nix` and the live VM), so the Phase 4 rollback workaround (running the bash `forge` from the checkout) holds. Fixes for 1 and 2 in a follow-up commit.
vnprc approved these changes 2026-07-11 13:22:15 +01:00
vnprc merged commit 89aa91c235 into master 2026-07-11 13:22:28 +01:00
vnprc deleted branch agent/bash-to-go-migration-plan 2026-07-11 13:22:28 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
allod/strategy!16
No description provided.