Skip to content

refactor(permission): parse sourced config entries once - #796

Merged
hakula139 merged 2 commits into
mainfrom
refactor/permission-config-parse
Nov 1, 2026
Merged

hakula139 merged 2 commits into
mainfrom
refactor/permission-config-parse

Conversation

@hakula139

@hakula139 hakula139 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Permission configuration was parsed during per-file validation and again while constructing policy. This PR compiles sourced rules and validates extra roots once after the layers merge, retaining each entry's original file context and rejecting invalid lower-layer values.

  • Loading: each file still receives typed schema and project-key validation. Merged list entries are compiled once with their source provenance, including values contributed by lower layers.
  • Policy: config passes compiled deny, ask, and allow rules plus validated anchors to permission. Config retains provenance while permission retains workspace root invariants.
  • Contracts: unused serialization derives are removed, deserialization contracts remain tested, and verdict documentation accounts for current path-prefix checks.

Test plan

  • Regressions cover lower-layer validation, per-file schema rejection, error provenance, deserialization names, and extracted shell behavior.
  • Full local verification at 2559e7a39 passed: formatting, build, both Clippy runs, rustdoc, coverage, pnpm format/lint/spellcheck, and hooks. 3,497 tests passed with five existing paid-live tests ignored. Line coverage is 99.24%.
  • Exact-head CI passed at 8c4361a10, including Rust on Linux, macOS and Windows, MSRV, lint, both Nix builds, CI Result and Codecov.
  • The uncovered config error guard accepts only Source::File; permission-list entries come from file layers, so other sources cannot reach this path.

@hakula139 hakula139 added refactor Restructured code that preserves behavior (refactor) area: permission Touches permission rules, modes, or the approval gate labels Oct 30, 2026
@hakula139 hakula139 self-assigned this Oct 30, 2026
@hakula139
hakula139 force-pushed the refactor/permission-config-parse branch from 7a85a48 to 0b1d71a Compare October 30, 2026 14:12
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.63235% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ox-core/src/config/load.rs 99.29% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hakula139
hakula139 force-pushed the refactor/permission-config-parse branch from 0b1d71a to 3e706c2 Compare October 30, 2026 14:55
@hakula139
hakula139 force-pushed the refactor/permission-shell-modules branch from 7c02e89 to 651e8eb Compare November 1, 2026 09:20
Base automatically changed from refactor/permission-shell-modules to main November 1, 2026 09:40
@hakula139
hakula139 force-pushed the refactor/permission-config-parse branch from 3e706c2 to 85febb2 Compare November 1, 2026 09:41
@hakula139
hakula139 force-pushed the refactor/permission-config-parse branch from 2559e7a to 8c4361a Compare November 1, 2026 10:13
@hakula139
hakula139 merged commit ee91962 into main Nov 1, 2026
9 checks passed
@hakula139
hakula139 deleted the refactor/permission-config-parse branch November 1, 2026 10:40
@hakula139 hakula139 added this to the v0.1.0-alpha.10 milestone Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: permission Touches permission rules, modes, or the approval gate refactor Restructured code that preserves behavior (refactor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant