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 manifest etag and propose_zone captured at boot. Immutable Data value; advance_cursor returns a new instance. ADR 0036.
Instance Attribute Summary collapse
-
#cursor ⇒ Object
readonly
Returns the value of attribute cursor.
-
#manifest_etag ⇒ Object
readonly
Returns the value of attribute manifest_etag.
-
#propose_zone ⇒ Object
readonly
Returns the value of attribute propose_zone.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
Instance Attribute Details
#cursor ⇒ Object (readonly)
Returns the value of attribute cursor
6 7 8 |
# File 'lib/textus/session.rb', line 6 def cursor @cursor end |
#manifest_etag ⇒ Object (readonly)
Returns the value of attribute manifest_etag
6 7 8 |
# File 'lib/textus/session.rb', line 6 def manifest_etag @manifest_etag end |
#propose_zone ⇒ Object (readonly)
Returns the value of attribute propose_zone
6 7 8 |
# File 'lib/textus/session.rb', line 6 def propose_zone @propose_zone 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
7 |
# File 'lib/textus/session.rb', line 7 def advance_cursor(new_cursor) = with(cursor: new_cursor) |
#check_etag!(observed_etag) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/textus/session.rb', line 9 def check_etag!(observed_etag) return if observed_etag == manifest_etag raise Textus::MCP::ContractDrift.new( "manifest changed (was #{short_etag(manifest_etag)}, now #{short_etag(observed_etag)}); re-run boot", ) end |