Class: Insika::Policy::Decision
- Inherits:
-
Data
- Object
- Data
- Insika::Policy::Decision
- Defined in:
- lib/insika/policy/policy.rb
Overview
Output of ONE policy. allow_* == nil => "no restriction from this
policy" (does not enter the intersection); [] => empty set; deny_* is always
a list (union). verdict :deny denies the WHOLE TURN. All immutable Data — the
policy's purity is structural.
requires_approval: names of tools that require human approval —
does NOT deny or allow; the real gate is in the ToolEnvelope (stage 6). Default [].
Instance Attribute Summary collapse
-
#allow_skills ⇒ Object
readonly
Returns the value of attribute allow_skills.
-
#allow_tools ⇒ Object
readonly
Returns the value of attribute allow_tools.
-
#deny_skills ⇒ Object
readonly
Returns the value of attribute deny_skills.
-
#deny_tools ⇒ Object
readonly
Returns the value of attribute deny_tools.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#requires_approval ⇒ Object
readonly
Returns the value of attribute requires_approval.
-
#verdict ⇒ Object
readonly
Returns the value of attribute verdict.
Class Method Summary collapse
- .allow(allow_tools: nil, deny_tools: [], allow_skills: nil, deny_skills: [], requires_approval: []) ⇒ Object
- .deny(reason:, allow_tools: nil, deny_tools: [], allow_skills: nil, deny_skills: [], requires_approval: []) ⇒ Object
Instance Attribute Details
#allow_skills ⇒ Object (readonly)
Returns the value of attribute allow_skills
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def allow_skills @allow_skills end |
#allow_tools ⇒ Object (readonly)
Returns the value of attribute allow_tools
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def allow_tools @allow_tools end |
#deny_skills ⇒ Object (readonly)
Returns the value of attribute deny_skills
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def deny_skills @deny_skills end |
#deny_tools ⇒ Object (readonly)
Returns the value of attribute deny_tools
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def deny_tools @deny_tools end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def reason @reason end |
#requires_approval ⇒ Object (readonly)
Returns the value of attribute requires_approval
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def requires_approval @requires_approval end |
#verdict ⇒ Object (readonly)
Returns the value of attribute verdict
18 19 20 |
# File 'lib/insika/policy/policy.rb', line 18 def verdict @verdict end |
Class Method Details
.allow(allow_tools: nil, deny_tools: [], allow_skills: nil, deny_skills: [], requires_approval: []) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/insika/policy/policy.rb', line 20 def self.allow(allow_tools: nil, deny_tools: [], allow_skills: nil, deny_skills: [], requires_approval: []) new(allow_tools: allow_tools, deny_tools: deny_tools, allow_skills: allow_skills, deny_skills: deny_skills, requires_approval: requires_approval, verdict: :allow, reason: nil) end |
.deny(reason:, allow_tools: nil, deny_tools: [], allow_skills: nil, deny_skills: [], requires_approval: []) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/insika/policy/policy.rb', line 27 def self.deny(reason:, allow_tools: nil, deny_tools: [], allow_skills: nil, deny_skills: [], requires_approval: []) new(allow_tools: allow_tools, deny_tools: deny_tools, allow_skills: allow_skills, deny_skills: deny_skills, requires_approval: requires_approval, verdict: :deny, reason: reason) end |