Improve rejected-update evidence and verify real model diagnosis #207

Merged
nimmo merged 5 commits from fix/remediation-evaluation-evidence into main 2026-09-09 18:33:30 +01:00
Owner

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 c907fda also 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 35bbf3a and retained its complete flake.lock. The updater merge revision a514b03 has the same source narHash as reviewed cd61d13. Resolution head 1eb13d2 passes 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.

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 c907fda also 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 35bbf3a and retained its complete flake.lock. The updater merge revision a514b03 has the same source narHash as reviewed cd61d13. Resolution head 1eb13d2 passes 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.
Refs #205. Requires the coordinated nixos-auto-update evidence selector update.
Refs #205. Verified with a real non-publishing Nova replay of incident #204.
chore: pin published remediation evidence helper
All checks were successful
AI pull-request review / review (pull_request) Successful in 1m21s
Build and Push Attic Cache / test (pull_request) Successful in 1m49s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
e3ece68efa
Refs #205; depends on nixos-auto-update MR #1.
Author
Owner

Automated code review

Reviewed commit: 1eb13d2fccdd88ce2b5a07862abe5ba3fdefbc6d

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The PR introduces a build-output.txt companion file to preserve full diagnostic traces that would otherwise be truncated by OpenCode's per-line read limit, adds --show-trace to 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 suppression in production script without corresponding fix (scripts/attic-cache-build.sh:511; high confidence)

    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

  • No configured deterministic checks.

Questions

  • Is the 512-character line wrap length optimal for readability in build-output.txt, or should it be configurable?
  • Are there any other tools or readers besides OpenCode that might have similar per-line limits that could benefit from this text companion?

Review limitations

  • I cannot run the NixOS flake checks or integration tests to verify the changes in a live environment.
  • I am relying on the provided diff and documentation for evidence; I cannot verify the actual behavior of OpenCode's read tool.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • remediation/worker-prompt.md: reviewed — included in a context-limited batch
  • scripts/attic-cache-build.sh: reviewed — included in a context-limited batch
  • scripts/nixos_update_remediation/model.py: reviewed — included in a context-limited batch
  • scripts/nixos_update_remediation/publication.py: reviewed — included in a context-limited batch
  • tests/nixos-update-remediation-integration.py: reviewed — included in a context-limited batch
  • tests/nixos-update-remediation-regressions.sh: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: qwen3.6:35b-a3b-q8_0
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md
  • Commits considered: 5
  • Previous automated review: updated
  • Findings: 3
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `1eb13d2fccdd88ce2b5a07862abe5ba3fdefbc6d` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The PR introduces a `build-output.txt` companion file to preserve full diagnostic traces that would otherwise be truncated by OpenCode's per-line read limit, adds `--show-trace` to 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 suppression in production script without corresponding fix** (scripts/attic-cache-build.sh:511; high confidence) # 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 - No configured deterministic checks. ### Questions - Is the 512-character line wrap length optimal for readability in `build-output.txt`, or should it be configurable? - Are there any other tools or readers besides OpenCode that might have similar per-line limits that could benefit from this text companion? ### Review limitations - I cannot run the NixOS flake checks or integration tests to verify the changes in a live environment. - I am relying on the provided diff and documentation for evidence; I cannot verify the actual behavior of OpenCode's read tool. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `remediation/worker-prompt.md`: **reviewed** — included in a context-limited batch - `scripts/attic-cache-build.sh`: **reviewed** — included in a context-limited batch - `scripts/nixos_update_remediation/model.py`: **reviewed** — included in a context-limited batch - `scripts/nixos_update_remediation/publication.py`: **reviewed** — included in a context-limited batch - `tests/nixos-update-remediation-integration.py`: **reviewed** — included in a context-limited batch - `tests/nixos-update-remediation-regressions.sh`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: qwen3.6:35b-a3b-q8_0 - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md - Commits considered: 5 - Previous automated review: updated - Findings: 3 </details>
Address automated review of remediation evidence MR
All checks were successful
AI pull-request review / review (pull_request) Successful in 1m5s
Build and Push Attic Cache / test (pull_request) Successful in 1m25s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
c907fda69b
Resolve the merged updater dependency through main without changing its immutable revision. Name the evidence wrapping width and keep an independent regression check against the OpenCode read limit. Refs #205, MR #207.
Merge main into remediation evidence branch and retain current lock
All checks were successful
AI pull-request review / review (pull_request) Successful in 1m6s
Build and Push Attic Cache / test (pull_request) Successful in 1m24s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
1eb13d2fcc
Resolve the flake.lock conflict using main’s merged updater revision and current automatic input updates. The updater source hash is identical to the reviewed helper. Full flake check and remediation regressions pass.
nimmo merged commit 4ba715cb38 into main 2026-09-09 18:33:30 +01:00
Sign in to join this conversation.
No reviewers
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config!207
No description provided.