feat(ocap): NamedPermissionPreset can clamp fs_read — clamp-grammar fix (#755)#768
Closed
hartsock wants to merge 1 commit into
Closed
feat(ocap): NamedPermissionPreset can clamp fs_read — clamp-grammar fix (#755)#768hartsock wants to merge 1 commit into
hartsock wants to merge 1 commit into
Conversation
…ix (#755) OCAP enforcement-floor stack (#749, PR 6/8; stacked on #765). The M6 grammar gap: a preset could not narrow fs_read (to_caveat_profile hardcoded ScopeSpec::default()=All), even though CaveatProfile/Caveats can. NamedPermissionPreset now has an optional fs_read: Option<ScopeSpec> (serde default None => All, so every existing preset is byte-for-byte unchanged); to_caveat_profile lowers it (Some narrows reads). A preset CAN now narrow fs_read when specified. Deferred (documented in-code): valid_for_generation (a causal-window axis, not a preset clamp — follow-up); the default-deny for un-annotated subtasks (an empty clamp is correctly meet-identity; default-deny belongs in step 8's subtask-clamp derivation, not role_profile's general default — flipping it would break back-compat for every preset consumer). TDD: fs_read_clamp_narrows_reads (red on today — fs_read always All; green after) + back-compat (omitted fs_read => All) + config-parse. RED verified by revert. just check green. Mechanical: adding the field required `fs_read: None` in 2 exhaustive struct literals (newt-tui test fixtures); behavior-preserving (consumer literals use ..default()). Fixes #755. Part of #749. Refs #739, #741. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 29, 2026
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OCAP enforcement-floor stack — PR 6 of 8 · epic #749
Stacked on step 5 (#765). Review/merge after #765. Full order: #749.
What this does
M6 grammar gap: a preset couldn't narrow
fs_read(to_caveat_profilehardcodedScopeSpec::default()=All).NamedPermissionPresetnow has an optionalfs_read: Option<ScopeSpec>(serde default None ⇒ All — every existing preset byte-for-byte unchanged); a preset can now narrowfs_readwhen specified. Deferred (documented in-code):valid_for_generation(causal-window axis — follow-up) and default-deny (the empty clamp is correctly meet-identity; default-deny belongs in step 8's subtask-clamp derivation, not the general default).Test plan
fs_read_clamp_narrows_reads(red on today — fs_read always All; green after) + back-compat (omitted ⇒ All) + config-parse. RED verified by revert.just checkgreen. (Mechanical:fs_read: Noneadded to 2newt-tuitest-fixture struct literals — unavoidable for a new field, behavior-preserving.)Fixes #755. Part of #749. Refs #739, #741.
🤖 Generated with Claude Code