Fix remediation reports blocked from writing result.json #201

Closed
opened 2026-09-07 21:21:58 +01:00 by nimmo · 2 comments
Owner

Context

Automated rejected-update remediation runs repeatedly publish fallback issues because the advisory model exits without .remediation-output/result.json. A live reproduction on Nova showed the model successfully diagnosed the failed update, then OpenCode denied each write call for /workspace/.remediation-output/result.json.

Root cause

The generated OpenCode policy combines a top-level "*": "deny" with path-specific object rules under edit. OpenCode 1.18.10 is affected by an upstream precedence defect where the top-level wildcard deny wins over a named object rule, despite the documented last-match semantics. The edit category is the correct permission category for the write tool.

Implementation

  • Replace the path-valued edit exception with the documented scalar edit: allow override.
  • Retain Bubblewrap as the authoritative write boundary: the workspace remains read-only and only .remediation-output is bind-mounted writable.
  • Add a regression assertion covering the generated effective policy.
  • Verify with the remediation regression suite, flake checks, and a non-publishing Nova reproduction.

Completion criteria

  • OpenCode can create result.json and optional proposal.patch.
  • Attempts to modify the rest of /workspace remain blocked by Bubblewrap.
  • Existing secret, network-tool, shell, and subprocess restrictions remain intact.
  • The previously failing retained incident completes model-result validation in a non-publishing smoke test.
## Context Automated rejected-update remediation runs repeatedly publish fallback issues because the advisory model exits without `.remediation-output/result.json`. A live reproduction on Nova showed the model successfully diagnosed the failed update, then OpenCode denied each `write` call for `/workspace/.remediation-output/result.json`. ## Root cause The generated OpenCode policy combines a top-level `"*": "deny"` with path-specific object rules under `edit`. OpenCode 1.18.10 is affected by an upstream precedence defect where the top-level wildcard deny wins over a named object rule, despite the documented last-match semantics. The `edit` category is the correct permission category for the `write` tool. ## Implementation - Replace the path-valued `edit` exception with the documented scalar `edit: allow` override. - Retain Bubblewrap as the authoritative write boundary: the workspace remains read-only and only `.remediation-output` is bind-mounted writable. - Add a regression assertion covering the generated effective policy. - Verify with the remediation regression suite, flake checks, and a non-publishing Nova reproduction. ## Completion criteria - OpenCode can create `result.json` and optional `proposal.patch`. - Attempts to modify the rest of `/workspace` remain blocked by Bubblewrap. - Existing secret, network-tool, shell, and subprocess restrictions remain intact. - The previously failing retained incident completes model-result validation in a non-publishing smoke test.
Author
Owner

Implemented locally in commit 0694f15 on branch fix/201-remediation-result-output.

Validation completed:

  • tests/nixos-update-remediation-regressions.sh passed.
  • nix flake check passed.
  • A non-publishing Nova replay of retained incident 8b621ba0… completed under OpenCode 1.18.10 with returnCode: 0, timedOut: false, and an accepted diagnosis-only result.
  • The replay correctly identified the Redview stale npmDepsHash and no longer failed with missing result.json.
  • Bubblewrap remains the write authority: the repository is read-only and only .remediation-output is writable.

The disposable Nova checkout and worktree were removed after the test.

Implemented locally in commit `0694f15` on branch `fix/201-remediation-result-output`. Validation completed: - `tests/nixos-update-remediation-regressions.sh` passed. - `nix flake check` passed. - A non-publishing Nova replay of retained incident `8b621ba0…` completed under OpenCode 1.18.10 with `returnCode: 0`, `timedOut: false`, and an accepted diagnosis-only result. - The replay correctly identified the Redview stale `npmDepsHash` and no longer failed with missing `result.json`. - Bubblewrap remains the write authority: the repository is read-only and only `.remediation-output` is writable. The disposable Nova checkout and worktree were removed after the test.
Author
Owner

Closure evidence: Electra deployed the integrated remediation changes at revision 4ba715cb38 at 20:11 on 2026-09-09. A normal follow-up run at 22:15 confirmed origin/main and the running system were current at 4a03f7ebc9, performed no build or activation, and exited successfully.

Closure evidence: Electra deployed the integrated remediation changes at revision 4ba715cb3812b7e86021e2a4b47054903ff66ee7 at 20:11 on 2026-09-09. A normal follow-up run at 22:15 confirmed origin/main and the running system were current at 4a03f7ebc909779e6290d436868d5509418604b8, performed no build or activation, and exited successfully.
nimmo closed this issue 2026-09-09 22:17:07 +01:00
Sign in to join this conversation.
No milestone
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#201
No description provided.