Isolate failing flake input groups after combined candidate validation fails (#92) #93
No reviewers
Labels
No labels
host:electra
host:fleet
host:lyra
host:vega
host:vega
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:declarative-purity-cleanup
project:external-review
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
service:auto-update
service:mem0
service:sillytavern
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!93
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-92-flake-group-isolation"
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?
Summary
Implements #92: when a combined flake.lock candidate fails validation, the runner now isolates the broken input group(s) instead of rejecting every group. The 2026-07-24
paseonpm-deps hash mismatch (groupshared-ai-tooling) is the reference case — it previously blocked all unrelated updates.Design
Three-phase runner in
scripts/nixos-update-common.sh(nixos_update_run_input_groups):isolation trial failed … original lock restored.rejected-update("passed isolation but failed final combination; unresolved/rejected").Extracted reusable candidate primitives (snapshot/restore/apply/validate/record). Validation logging is phase-aware (
combined candidate/isolation trial/final combined candidate) and flows through existing outcome summary, commit message, and ntfy plumbing. The published lock is always the final validated state, so atomicity is preserved. No caller signature changed;lib/auto-update-policy.nixordering was already deterministic.Tests
tests/auto-update-regressions.sh: 6 new isolation cases (one accepted + one rejected, multiple rejected, final re-combination failure, no-change, plus a reworked all-or-nothing assertion) — 39/39 pass.nix flake checkpasses, including theauto-update-state-machineVM test.shellcheckclean on the modified script.Remaining (per repo policy)
Before closing: one genuine Forgejo update/deployment and a no-op follow-up still need to be run as live evidence. This PR is the code change; deployment evidence to follow.
Automated code review
Reviewed commit:
1dc4b8a74abc7721c9030924fa2147483dd8f951Verdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
Implements a three-phase runner (combined, isolation trial, final re-combination) to isolate failing flake input groups after combined validation fails. Extracts reusable candidate primitives and adds regression tests covering partial acceptance, interaction failures, and no-change scenarios.
Blocking findings
while IFS="$pending_tab" read -r pending_group pending_inputs pending_hosts pending_previous_detail _; do
nixos_update_record_outcome
"$group_name" "rejected-update" "$pending_inputs" "$pending_hosts"
"$final_detail"
Impact: All groups rejected during final re-combination will be incorrectly labeled with the name of the last processed group ($group_name) instead of their actual names ($pending_group), corrupting the outcome report and audit trail.
Suggested fix: Replace $group_name with $pending_group in the nixos_update_record_outcome call within the Phase C failure loop.
Important findings
None.
Suggestions
None.
Tests and validation
error: Resource temporarily unavailableQuestions
Review limitations
Diff coverage
scripts/nixos-update-common.sh: reviewed — included in a context-limited batchtests/auto-update-regressions.sh: reviewed — included in a context-limited batchReview metadata
Re: blocking finding (Phase C group name) — false positive
The cited line 498 is
nixos_update_built_hosts_line, not the Phase C handler. The actual Phase C final-recombination failure loop at scripts/nixos-update-common.sh:485-488 already records each rejected group with its own name:Verified at the exact reviewed commit
1dc4b8a. No occurrence of$group_nameis used in the record call; the correct$pending_groupis used. The outcome report and audit trail are therefore not corrupted. This matches the prior review round where a similar non-existent defect was flagged.nix-flake-check failure
error: Resource temporarily unavailableis the environmental CI-runner resource limit already documented for this repo; localnix flake check(incl. theauto-update-state-machineVM test) passes, as do the 40 regression assertions. Not a code defect.Trailing-space question
nixos_update_compute_candidate_hostsleaves a trailing space thatnixos_update_validate_candidateexplicitly strips; downstream callers tolerate it. Left as-is intentionally to avoid churn — noted, not acted on.No code change required for the blocking finding. Requesting re-review.