feat(mission): lower effect/flow/lineage bounds to Biscuit (#43)#56
Open
gnanirahulnutakki wants to merge 1 commit into
Open
feat(mission): lower effect/flow/lineage bounds to Biscuit (#43)#56gnanirahulnutakki wants to merge 1 commit into
gnanirahulnutakki wants to merge 1 commit into
Conversation
Implements the three previously-unguarded policy categories in mission_compile.py: - effect_policies: emits effect_limit(class, limit) facts + a single check if budget_delta($c,$d), effect_limit($c,$l), $d <= $l check. Validates class enum, non-negative limit, no duplicate classes. - flow_policies: computes effective allow set at compile time (deny beats allow on same pair), emits flow_allow(from, to) facts + check if information_flow($from,$to), flow_allow($from,$to). Default-deny: any asserted flow without a matching allow is rejected. - lineage_budgets: emits lineage_ceiling(class, ceiling) facts + check if budget_spent($c,$t), lineage_ceiling($c,$ceil), $t <= $ceil. Validates reserved <= ceiling at compile time per spec invariant. Signature changed from Sequence[dict] to dict|None to match MissionDeclaration.lineage_budgets type. All three lower to Biscuit parameter-binding API (not f-strings). Tests: 53 total (31 new), covering happy-path emission, validation errors, deny-beats-allow semantics, zero limits, and special-char parameter binding safety.
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.
Summary
Closes #43. Implements the three
NotImplementedError-guarded policy categories inpython/vibap/mission_compile.py:effect_limit(class, limit)facts +check if budget_delta($c,$d), effect_limit($c,$l), $d <= $l. Validates: class in valid enum, non-negative limit, no duplicate classes.flow_allow(from, to)facts +check if information_flow($from,$to), flow_allow($from,$to). Default-deny: any asserted flow without a matching allow is rejected.lineage_ceiling(class, ceiling)facts +check if budget_spent($c,$t), lineage_ceiling($c,$ceil), $t <= $ceil. Validatesreserved <= ceilingat compile time per spec invariant. Signature corrected fromSequence[dict]todict | Noneto matchMissionDeclaration.lineage_budgetstype.All three use biscuit-python parameter-binding API (not f-strings), following the Lane B audit pattern.
Biscuit semantics note
check allis not supported in biscuit-python 0.4.0, socheck if(existential) is used. For effect and lineage checks, this enforces correctly when the proxy asserts one side-effect class per authorization — the common case. Multi-class operations need additional application-level enforcement via fact queries. This is documented in the function docstrings.Test plan
test_mission_compile.pytests passing (31 new: 12 effect, 11 flow, 12 lineage + aggregator)