Fix remediation result output permissions #202
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!202
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/201-remediation-result-output"
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
edit: "allow"override.remediation-outputwritableReferences #201.
Root cause
OpenCode maps
writeoperations to theeditpermission category, but its top-level"*": "deny"currently wins over path-valued named rules. The model therefore completed its diagnosis but OpenCode denied creation ofresult.json.Validation
tests/nixos-update-remediation-regressions.shnix flake check8b621ba0…using OpenCode 1.18.10npmDepsHashresult.jsonfailureRemaining evidence
The change has not yet been deployed through the Forgejo workflow. Keep #201 open until the merged workflow has completed one genuine remediation run or equivalent production canary.
Automated code review
Reviewed commit:
0694f15b22fec95d5cba4015850fd2575a1595c8Verdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The PR modifies
scripts/nixos_update_remediation/model.pyto change theeditpermission in the OpenCode configuration from an object with path-specific rules to a scalar"allow". This addresses a bug in OpenCode 1.18.10 where top-level wildcard denies were not overridden by path-valued edit rules. The integration test is updated to enforce this scalar configuration and verify it, ensuring that if the code regresses to the object form, the test fails (or at least validates the config state).Blocking findings
None.
Important findings
if config_data['agent']['remediation']['permission'].get('edit') != 'allow':\n raise SystemExit(0)
Impact: The test exits with code 0 (success) if the configuration does not match the expected scalar allow. This masks potential misconfigurations in the fixture setup, making it harder to detect if the test environment is incorrectly configured.
Suggested fix: Consider raising a non-zero exit code or an assertion error to fail the test explicitly if the permission configuration is incorrect, ensuring the test validates its own prerequisites.
Suggestions
None.
Tests and validation
Questions
"allow"foreditinadvertently allow editing files outside of.remediation-outputthat were previously denied by the path-specific rules, relying solely on Bubblewrap for protection?Review limitations
nix flake checkor the integration tests to verify the changes.opencode_configfunction, so I cannot verify if other permission sections are affected.Diff coverage
scripts/nixos_update_remediation/model.py: reviewed — included in a context-limited batchtests/nixos-update-remediation-integration.py: reviewed — included in a context-limited batchReview metadata