Improve rejected-update evidence and verify real model diagnosis #207
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!207
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/remediation-evaluation-evidence"
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?
Rejected-update diagnoses lacked useful evaluation context and could misstate affected hosts as observed failures. Host builds now request traces; the incident helper retains named context and final errors; reports distinguish the recorded failed host from validation scope. A read-only text companion prevents OpenCode from clipping the JSON diagnostic string at its 2000-character line limit.
Refs #205. Updater MR #1 is merged. The lock now resolves the same immutable helper revision through main. Review fix
c907fdaalso names the evidence wrapping constant; the exact pinned emitter's ShellCheck-suppressed assignments were verified as consumed. Full flake and remediation regression checks pass.Validation: both regression suites, ShellCheck, formatting, full flake/VM checks with the published input pin. Exact #204 real-model replay identified pi-coding-agent nativeBuildInputs and the typescript-go rename in 239.353 seconds without timeout or publication. Historical #172 replay correctly found Moonlight/FFmpeg incompatibility but still could not propose a pin; separate follow-up will address failed-builder attribution and leaf patch scope. Detailed model dependency-chain claims remain advisory.
Scheduled live deployment/no-op evidence remains pending; #205 stays open. Existing upstream deprecation warnings remain outside this change.
Conflict resolution: merged main at
35bbf3aand retained its complete flake.lock. The updater merge revision a514b03 has the same source narHash as reviewed cd61d13. Resolution head1eb13d2passes full flake check, remediation regressions, and CI test run 856.Final review triage: the automated review repeated the sourced-variable suppression concern. Standalone ShellCheck of the exact a514b03 incident emitter passes, and its reads of LAST_BUILD_RC/FAILED_HOST/FAILED_COMMAND were verified. Suppressions remain assignment-scoped. The suggested named constant and explanatory comment already exist; the fixed diagnostic assertion intentionally tests retained fixture evidence. No unresolved functional defect or failed deterministic check was identified.
Automated code review
Reviewed commit:
1eb13d2fccdd88ce2b5a07862abe5ba3fdefbc6dVerdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The PR introduces a
build-output.txtcompanion file to preserve full diagnostic traces that would otherwise be truncated by OpenCode's per-line read limit, adds--show-traceto Nix build commands, and clarifies documentation regarding host failure scope and model confidence. The changes are well-supported by tests and documentation updates.Blocking findings
None.
Important findings
shellcheck disable=SC2034 # consumed by the sourced incident emitter
NIXOS_UPDATE_LAST_BUILD_RC="$build_rc"Impact: Suppressing SC2034 hides unused variable warnings. While justified here due to dynamic sourcing, it reduces static analysis coverage for this file.
Suggested fix: Ensure the incident emitter script is well-documented or linted separately to maintain confidence in these suppressed assignments.
Suggestions
Hardcoded line length constant in Python code (scripts/nixos_update_remediation/model.py:35; high confidence)
EVIDENCE_LINE_CHARACTERS = 512
Impact: The value 512 is a magic number. If the OpenCode read limit changes or if a different wrapping strategy is desired, this constant must be updated manually.
Suggested fix: Consider defining this as a named constant with a comment explaining its origin (e.g., 'OpenCode line limit headroom') or making it configurable via environment variable for easier tuning.
Test assertion dependency on specific error message (tests/nixos-update-remediation-integration.py:295; high confidence)
assert 'renamed to/replaced by' in preview
Impact: The test relies on a specific substring from the fake evidence. If the model or upstream package names change, this assertion might break even if the logic is correct.
Suggested fix: Consider using a more generic assertion or ensuring the fake evidence is generated dynamically to match current upstream states if possible.
Tests and validation
Questions
build-output.txt, or should it be configurable?Review limitations
Diff coverage
README.md: reviewed — included in a context-limited batchremediation/worker-prompt.md: reviewed — included in a context-limited batchscripts/attic-cache-build.sh: reviewed — included in a context-limited batchscripts/nixos_update_remediation/model.py: reviewed — included in a context-limited batchscripts/nixos_update_remediation/publication.py: reviewed — included in a context-limited batchtests/nixos-update-remediation-integration.py: reviewed — included in a context-limited batchtests/nixos-update-remediation-regressions.sh: reviewed — included in a context-limited batchReview metadata