Class: Textus::Session
- Inherits:
-
Data
- Object
- Data
- Textus::Session
- Defined in:
- lib/textus/session.rb
Overview
The agent session: per-connection (MCP), per-process (CLI), or per-loop (Ruby) orientation state — the audit cursor plus the contract etag and propose_lane captured at boot. Immutable Data value; advance_cursor returns a new instance. ADR 0036; contract_etag widened in ADR 0074.
Instance Attribute Summary collapse
-
#contract_etag ⇒ Object
readonly
Returns the value of attribute contract_etag.
-
#cursor ⇒ Object
readonly
Returns the value of attribute cursor.
-
#propose_lane ⇒ Object
readonly
Returns the value of attribute propose_lane.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #advance_cursor(new_cursor) ⇒ Object
- #check_etag!(observed_etag) ⇒ Object
-
#propose_zone ⇒ Object
Back-compat reader while lane terminology migrates.
Instance Attribute Details
#contract_etag ⇒ Object (readonly)
Returns the value of attribute contract_etag
6 7 8 |
# File 'lib/textus/session.rb', line 6 def contract_etag @contract_etag end |
#cursor ⇒ Object (readonly)
Returns the value of attribute cursor
6 7 8 |
# File 'lib/textus/session.rb', line 6 def cursor @cursor end |
#propose_lane ⇒ Object (readonly)
Returns the value of attribute propose_lane
6 7 8 |
# File 'lib/textus/session.rb', line 6 def propose_lane @propose_lane end |
#role ⇒ Object (readonly)
Returns the value of attribute role
6 7 8 |
# File 'lib/textus/session.rb', line 6 def role @role end |
Instance Method Details
#advance_cursor(new_cursor) ⇒ Object
10 |
# File 'lib/textus/session.rb', line 10 def advance_cursor(new_cursor) = with(cursor: new_cursor) |
#check_etag!(observed_etag) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/textus/session.rb', line 12 def check_etag!(observed_etag) return if observed_etag == contract_etag raise Textus::Surfaces::MCP::ContractDrift.new( "contract changed (manifest/hooks/schemas were #{short_etag(contract_etag)}, " \ "now #{short_etag(observed_etag)}); re-run boot", ) end |
#propose_zone ⇒ Object
Back-compat reader while lane terminology migrates.
8 |
# File 'lib/textus/session.rb', line 8 def propose_zone = propose_lane |