den: declare value-conditional policy codomains (binds, suppresses) - #178
Merged
Conversation
Both records emit their codomain from a value-conditional body, so a body fired at a value-less sentinel takes the false branch and the codomain cannot be observed by firing. env-to-hosts declares the accessGroups member binding it carries into host scope; drop-user-to-host-on-droid declares the policy its exclusion suppresses. Stratification is decided from the declared graph, so an edge known only at runtime is one the check never sees. Both are authored as policy records rather than bare functions because a bare closure has no field to declare a codomain on. The extra fields are inert under the current den pin: the fleet surfaces are byte-identical across the change.
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.
Two den policies emit their codomain from value-conditional bodies, so any analysis that discovers a policy's codomain by firing it at a value-less probe takes the false branch and observes nothing. This declares the codomain as data on the policy record instead:
env-to-hostsbecomes a policy record carryingbinds = [ "accessGroups" ]— its member emission bindsaccessGroups, gated on the host's environment matching, which a probe entry never does.drop-user-to-host-on-droidbecomes a policy record carryingsuppresses = [ "user-to-host" ]— its exclusion fires only wherehostis bound to a droid target.Both were bare lambdas; a lambda has no field to carry a declaration, so each becomes the
{ __isPolicy = true; …; fn }record form. den's policy type checks__isPolicyand its merge preserves extra fields, dispatch reads only.fn— verified inert under the current den pin:fnwith a throw propagates — the record form registers, type-checks, and dispatches.The declarations become load-bearing at the den v2 pin bump, where the compile layer consumes a declared codomain directly instead of probing the body.