Module: Textus::Manifest::Capabilities
- Defined in:
- lib/textus/manifest/capabilities.rb
Overview
Resolves a manifest's roles: block (or the absence of one) into a
capability map: { role_name => [verbs] }. Verbs are a subset of the
closed capability set (Schema::CAPABILITIES). See ADR 0030.
Constant Summary collapse
- DEFAULT_MAPPING =
Fallback role set for a manifest that omits
roles:entirely. Agent is intentionally minimal here (proposeonly) — narrower than thetextus initscaffold, which declaresagent: [propose, keep]so the defaultscratchpadworkspace is writable. A roles-less manifest that declares akind: workspacezone is therefore rejected at load (nokeep-holder); declareroles:to opt into a workspace lane (ADR 0033). { Textus::Value::Role::HUMAN => %w[author propose].freeze, Textus::Value::Role::AGENT => %w[propose].freeze, Textus::Value::Role::AUTOMATION => %w[converge].freeze, }.freeze
Class Method Summary collapse
-
.resolve(raw_roles) ⇒ Object
Returns { role_name => [verbs] }.
Class Method Details
.resolve(raw_roles) ⇒ Object
Returns { role_name => [verbs] }. When roles: is declared we use
exactly that; defaults are not layered in (declaring roles is an
opt-in to a fully user-defined vocabulary).
22 23 24 25 26 |
# File 'lib/textus/manifest/capabilities.rb', line 22 def self.resolve(raw_roles) return DEFAULT_MAPPING if raw_roles.nil? raw_roles.to_h { |r| [r["name"], Array(r["can"]).freeze] }.freeze end |