Migrate program-shaped bash tools to Go #98
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#98
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story: So that I can trust larger workspace tools without spending review time on shell edge cases, the program-shaped Bash CLIs should migrate to small Go programs while preserving their command contracts.
Part of the "Forge / workspace CLI tooling" arc.
The allod bash inventory has grown to roughly 10,600 lines of production bash plus 9,600 lines of bash tests across
toolsandnexus. The largest tools are no longer pipeline glue but full programs written in bash:forge(2,505 lines, a Forgejo REST client),allod(1,235 lines, change workflow plus a patch transfer protocol with manifest integrity checking),flake-update-cascade(486 lines, a three-mode mutation state machine), andflake-status(490 lines, parallel data aggregation through tempfile IPC). Git history shows the recurring bash tax on these: quoting and injection fixes, glob safety fixes, and review cycles spent on argument marshalling rather than behavior.This issue tracks migrating the program-shaped tools in
allod/toolsto Go (standard library only, no third-party modules), while keeping pipeline-shaped tools in bash:pull-all,work-diff,setup-tracked-hooks,lib/workspace.sh,protected-refs-policy, and allnexusprovisioning andvm/profilesglue scripts stay bash. The nexus rotation suite (rotate-tokenand key rotation scripts) is explicitly deferred until the Go pattern has proven itself on dev-VM tools.Migration order: Phase 0 toolchain and scaffolding, Phase 1
forge, Phase 2allod, Phase 3 flake tools, Phase 4 cleanup. CLI names, flags, exit codes, and output contracts are preserved; each cutover is aprofiles/nexuswrapper switch with the bash source retained in-tree for rollback until Phase 4.Dev plan:
allod/strategydev-plans/bash-to-go-migration.md(PR to follow).Implementation PRs should use
Refs allod/tools#<this>until the final Phase 4 cleanup PR inallod/tools, which carries the closing keyword.allod pm(first bash-to-Go carve-off) #103allod pm(first bash-to-Go carve-off) #103allod pm(first bash-to-Go carve-off) #103#142 adds a carve-off this issue predates: the pr-explain report validator (~2,400 lines of parse-shaped bash in pr-explain/lib.sh, the largest single program in the repo). Same boundary as here — the validator ports, the orchestration cage in pr-explain/explain stays bash. Sequenced after the #141 redesign slices land; independent of Phase 1 (forge).
Phase 1 (
forge) is code-complete but not deployed, and it has drifted: allod/tools#155 records the remaining work and now owns it. The drift is the load-bearing part —forge pr snapshotlanded in bash after the Go port merged (commits0e768fb,44d9347,9e4b157, plus a 126-linetests/forge/snapshot.sh) and was never mirrored, so merging the open cutover pull requests as they stand would remove that command from every dev VM and breakallod pr explain, which consumes snapshots. This is the failure mode this issue's own sequencing rule was written to prevent.Phase 1 is complete. PR #156 added the missing
pr snapshotcontract to Go; the Go package was then deployed and verified on bothallod-devandnexus; and PR #157 retired the Bash implementation and duplicate shell suite. Both machines run the same versioned package and passed authentication, repository-inference, and live snapshot witnesses.The umbrella remains open: Phase 2 (
allod), Phase 3 (the flake tools), thepr-explainvalidator carve-off in #142, and later migration cleanup are still outstanding. The prior status comment saying Phase 1 was not deployed is now superseded.The allod/forge track of this umbrella is complete. Phase 4 (allod cleanup) landed on master as allod/tools@8c5188b: the root Bash allod oracle is deleted, the change/patch and pr-explain test defaults resolve the Go binary, and no deploy path references the bash source. go vet/go test, gofmt, nix flake check, and the Go-targeted parity plus the workspace and git-hooks bash suites all pass. pr-explain, pm, and lib/workspace.sh remain bash by design.
Still untracked if pursued later: Phase 3 (flake-status / flake-update-cascade) and the pr-explain validator carve-off (#142); each would need its own issue.
allod/forge track complete; see prior status. Phase 3 flake tools + #142 remain untracked in this issue.
forgeandallodmigrations were completed. the remaining scope was split out into allod/tools#158, allod/tools#159, and allod/tools#142