Port flake-update-cascade to Go #173
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!173
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/go-flake-update-cascade"
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?
Nothing changes for a running machine yet: no consumer references cmd/flake-update-cascade.
This adds the Go port while the Bash tool and every consumer wrapper stay identical.
The parity suites and nix flake check provide the validation evidence.
If the port is wrong, revert this PR's commits.
Risk
R3, per the migration plan's P3 cascade row. Residual risk is untested subprocess environments, not the logic covered by parity fixtures. Consumer cutovers and human rebuild validation follow in separate PRs after this merges; dependency ordering and pin propagation remain allod/tools#171.
Documented divergences and limits:
Validation
gofmt -l .go vet ./...go test ./...tests/flakein oracle, Go (CASCADE_UNDER_TEST), andCASCADE_PARITY=1modes, including the ptyflake-update-cascade-nixconfig.sh. Mock-driven parity compares stdout, stderr, exit status, subprocess trace, and workspace tree; the real-nix pty suite applies the same assertions to both implementations because nix's pty stderr is not byte-stable.nix build .#flake-update-cascadenix flake check(cascade-parity,go-checks,allod-parity). The pty suite runs separately outside the sandbox, withTERM=xtermandNO_COLOR/NOCOLORunset so Nix's prompt logger is active.Refs allod/tools#159
The read-only review found two gaps to resolve before merging: the pty validation claim is not reproducible in this environment, and combined preflight errors differ from Bash. The branch remains unchanged.
P2 — The pty witness fails before exercising either implementation.
tests/flake/flake-update-cascade-nixconfig.sh:138expects the raw update to block and exit 124, but Nix 2.34.8 returns 0 withignoring untrusted flake configuration setting 'extra-substituters'. This reproduces in oracle, Go, andCASCADE_PARITY=1modes, including with a terminal attached. Consequently the body claim that this suite pins #143 for both programs is not established by this review. Provide the environment and evidence for the earlier successful run, or revise the validation claim and resolve the lost witness according to the suite's own control-arm guidance.P2 — Combined preflight errors break stdout parity.
cmd/flake-update-cascade/main.go:381joins errors with", ", while Bash'sIFS=', '; echo "${repo_errors[*]}"joins with only the first IFS character,",". A repository onfeaturewith unstaged changes printsexpected 'master'),dirty working treein Bash andexpected 'master'), dirty working treein Go. The existing preflight suite exercises one error at a time and misses this. Restore the Bash separator and add the combined-error case to the parity suite.Reproduction for finding 2, from the branch worktree with the Go package built:
This returns 99 with
PARITY MISMATCHfor stdout. Both implementations still refuse the operation.Validation rerun:
gofmt -l .(empty),go vet ./...,go test ./...,nix build .#flake-update-cascade, andnix flake checkpassed; Nix reused existing successful check outputs. All nine mock-driven suites undertests/flakepassed in oracle, Go, and parity modes. The pty suite failed in all three modes as described above. The Bash source is unchanged, and the archetypes and nexus consumer wrappers still select it. No cutover or rebuild was performed.Owner request: implement the entire issue and stop only at human gates. I will resolve the review findings and complete agent-runnable implementation and validation before the implementation merge gate; consumer cutovers follow its merge, and Bash retirement follows the required human rebuild and live verification.
Both review findings are addressed in
cf09348.TERM=xtermand unsetsNO_COLORandNOCOLORfor both arms. Nix 2.34.8 uses those variables to enable its interactive logger; the runner environment had disabled it. The raw control now prompts and times out as required, and both cascade implementations decline the foreign configuration and complete. The test retains its failing control-arm assertion.Upstream condition: https://github.com/NixOS/nix/blob/2.34.8/src/libutil/terminal.cc#L77-L82
All ten cascade suites, including nixconfig, passed in oracle, Go, and parity modes (30 suite/mode pairs). The final strengthened preflight case was also rerun in all three modes. Formatting, vet, Go unit tests, the package build, and the final nix flake check passed, including cascade-parity, go-checks, and allod-parity. A focused read-only subagent review of
cf09348found no further issues in these fixes.Ready for the human implementation merge gate. Running machines still use the unchanged Bash wrappers; consumer cutover PRs follow this merge, then human rebuild and live verification precede Bash retirement. The previously documented ordering/malformed-lock divergences, timeout/interrupt witness limitation, and carried origin-parsing bug remain explicit in the PR body.