feat: capture rejected update incident evidence #133
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!133
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-129-structured-update-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?
Summary
flake.lockonly when it is valid, bounded, and free of credential-like content; otherwise preserve explicit reproducibility metadata without raw secretsValidation
./tests/auto-update-regressions.sh./tests/nova-remediation-benchmark.shnix fmt -- --cinix shell nixpkgs#shellcheck nixpkgs#actionlintnix shell nixpkgs#forgejo-runner -c forgejo-runner validate --directory .nix flake checkgit diff --checkLive/deployment status
No deployment was forced. This changes only Nova producer evidence handling; normal even-hour auto-update observation remains the required post-merge deployment evidence.
Closes #129
Automated code review
Reviewed commit:
560fe9aeb4b98c2371af776fbbeacef8f0ad3853Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
Introduces a new incident bundle script to capture deterministic, sanitized evidence when flake-input candidates are rejected during auto-update isolation. Adds regression tests and updates workflow triggers. The implementation correctly bounds output size, sanitizes untrusted build logs, deduplicates via fingerprint, and handles missing or malformed artifacts gracefully.
Blocking findings
None.
Important findings
None.
Suggestions
Hardcoded derivation limit in evidence extraction (scripts/nixos-update-incident-bundle.sh:83; medium confidence)
grep -oE '/nix/store/[a-z0-9]{32}-[^'[:space:]]+.drv' "$log" 2>/dev/null | sort -u | head -20)
Impact: Inconsistent bounding policy; may retain too many or too few derivation paths depending on log volume, unlike the configurable excerpt limits.
Suggested fix: Introduce NIXOS_UPDATE_INCIDENT_MAX_DERIVATIONS and apply it consistently alongside other size bounds.
GNU-specific sed flags in sanitization function (scripts/nixos-update-incident-bundle.sh:13; medium confidence)
sed -E \n -e 's/\x1B0-9;]*[[:alpha://g' ... \n -e 's#(token|password|secret)[=:][^[:space:]]+#\1=#Ig'
Impact: Potential failure if sourced in non-GNU environments (e.g., macOS or BSD CI runners) due to -E and I flag usage.
Suggested fix: Replace with POSIX-compatible regex syntax or add an environment guard to ensure GNU sed is available.
Tests and validation
Questions
Review limitations
Diff coverage
.forgejo/workflows/attic-cache.yml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchscripts/attic-cache-build.sh: reviewed — included in a context-limited batchscripts/nixos-update-common.sh: reviewed — included in a context-limited batchscripts/nixos-update-incident-bundle.sh: reviewed — included in a context-limited batchtests/auto-update-regressions.sh: reviewed — included in a context-limited batchReview metadata
a1bf587112560fe9aeb4Resolved the automated-review findings in
560fe9a.build_hostnow setsNIXOS_UPDATE_FAILED_HOST="$host"before the retry wrapper; the regression asserts the wrapper observes that value, so a post-failure-only assignment would fail.rguse withgrep, already required by the updater runtime and used throughout the regression suite.token=,password=, orsecret=assignment is redacted even if benign. The rationale is documented beside the sanitizer, and a regression proves a benign-lookingtoken=nonsecret-fixture-valueis withheld.Revalidated: formatter, ShellCheck, actionlint, Forgejo workflow validation, auto-update and Nova benchmark regressions,
nix flake check, andgit diff --check.