Class: Textus::Store
- Inherits:
-
Object
- Object
- Textus::Store
- Defined in:
- lib/textus/store.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
Class Method Summary collapse
Instance Method Summary collapse
- #as(role, dry_run: false, correlation_id: nil) ⇒ Object
-
#initialize(root) ⇒ Store
constructor
A new instance of Store.
-
#session(role:) ⇒ Object
Build an agent Session oriented at the current cursor/manifest — the Ruby equivalent of an MCP ‘initialize`.
Constructor Details
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
5 6 7 |
# File 'lib/textus/store.rb', line 5 def container @container end |
Class Method Details
.discover(start_dir = Dir.pwd, root: nil) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/textus/store.rb', line 14 def self.discover(start_dir = Dir.pwd, root: nil) explicit = root || ENV.fetch("TEXTUS_ROOT", nil) return discover_explicit(explicit) if explicit ascend_for_store(File.(start_dir)) || raise(IoError.new("no .textus directory found from #{start_dir}")) end |
Instance Method Details
#as(role, dry_run: false, correlation_id: nil) ⇒ Object
62 63 64 |
# File 'lib/textus/store.rb', line 62 def as(role, dry_run: false, correlation_id: nil) RoleScope.new(container: container, role: role, dry_run: dry_run, correlation_id: correlation_id) end |
#session(role:) ⇒ Object
Build an agent Session oriented at the current cursor/manifest — the Ruby equivalent of an MCP ‘initialize`. ADR 0036.
53 54 55 56 57 58 59 60 |
# File 'lib/textus/store.rb', line 53 def session(role:) Textus::Session.new( role: role, cursor: audit_log.latest_seq, propose_zone: manifest.policy.propose_zone_for(role), contract_etag: Textus::Etag.for_contract(root), ) end |