Class: Textus::Domain::Policy::Predicates::TargetIsCanon
- Inherits:
-
Object
- Object
- Textus::Domain::Policy::Predicates::TargetIsCanon
- Defined in:
- lib/textus/domain/policy/predicates/target_is_canon.rb
Overview
Predicate: a proposal may only target a ‘canon` zone (ADR 0035). Runs on the `accept` floor, where Evaluation#target is the proposal’s resolved target_key. Refuses promotion into workspace/derived/ quarantine/queue — the queue→canon path is the only coherent one. No bespoke #error; failures accumulate into GuardFailed (ADR 0031).
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
13 14 15 |
# File 'lib/textus/domain/policy/predicates/target_is_canon.rb', line 13 def reason @reason end |
Instance Method Details
#call(eval) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/textus/domain/policy/predicates/target_is_canon.rb', line 17 def call(eval) zone = eval.manifest.resolver.resolve(eval.target).entry.zone kind = eval.manifest.policy.declared_kind(zone.to_s) return true if kind == :canon @reason = "proposal target '#{eval.target}' is in zone '#{zone}' " \ "(kind: #{kind || "none"}); proposals may only target a canon zone" false rescue Textus::UnknownKey @reason = "proposal target '#{eval.target}' resolves to no declared entry" false end |
#name ⇒ Object
15 |
# File 'lib/textus/domain/policy/predicates/target_is_canon.rb', line 15 def name = "target_is_canon" |