Port and deploy flake-status as a Go binary #158
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#158
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?
Replace
flake-statuswith a standard-library-only Go binary while preserving its command and output contracts, then deploy it and retire the Bash implementation.Primary goals:
flake-statuswork split from issue allod/tools#98.pkgs.buildGoModulewithvendorHash = null; parse lock JSON in-process and retain only the external commands the contract actually needs.Refs allod/tools#158; the finalallod/toolsPR that removes the verified Bash implementation carries the closing keyword.Current state and contracts
flake/flake-statusis a 490-line Bash program. It sourceslib/workspace.sh, parsesflake.lockthroughjq, coordinates parallel collection through temporary files, optionally resolves upstream revisions withgit ls-remote, and renders results back in workspace order.tests/flake/flake-status.shis the executable contract;flake/README.mdandflake/flake-status --helpare the human-facing contract.The deployed command is still assembled with
writeShellApplication:allod/archetypesmodules/dev-home-shared.nix:56-60for development machines andallod/nexusnix/home.nix:49-53for the host. Both wrappers prepend the shared workspace library to the Bash source. The Go implementation must preserveworkspace_collect_reposdiscovery and ordering semantics even though it can no longer source that function.Freeze current behavior at implementation start. In particular, preserve no-argument and named-input modes,
--upstream,FLAKE_STATUS_JOBS, terminal color behavior, direct-pin versusfollowshandling, repository health warnings, majority/staleness reporting, URL de-duplication, and nonfatal upstream lookup failures. The closed won't-fix decision in issue allod/tools#102 remains unchanged; this migration does not expand discovery. A correctness bug still open when implementation starts may diverge only with a regression test and an explicit PR-body note.Validation and deployment
Parameterize
tests/flake/flake-status.shwith a binary-under-test override and run its scenarios unchanged against both implementations. Compare stdout, stderr, and exit status for deterministic fixtures; add Go unit tests around lock parsing, ordering, concurrency bounds, and upstream-result aggregation where the Bash suite cannot isolate them.Before cutover,
gofmt -l .,go vet ./...,go test ./..., the Bash oracle suite, the Go-target parity suite,nix build .#flake-status, and affected flake checks must pass. Consumer PRs switch only this command tobuildGoModuleand retain the Bash file for rollback. After the downstream lock updates and human rebuilds, verify thatcommand -v flake-statusresolves to the Go package and run read-only no-argument, named-input, and upstream smoke checks on a development machine and nexus. Remove the Bash source only after those witnesses pass.Scope
In scope: the Go command and supporting internal packages in
allod/tools; parity and Go tests; theallod/toolspackage output; theallod/archetypesandallod/nexuspackage switches; downstream lock updates and rebuild verification; documentation adjustments required by packaging; and final Bash retirement.Out of scope:
flake-update-cascade, new discovery behavior, output redesign, unrelated workspace-tool migrations, and the report-validator work in issue allod/tools#142.