ContextSwitch
Explicit, scoped protocol-mode toggle with enter/revert boundaries
Mechanism
Agents explicitly signal a change in Context (protocol Mode), and all subsequent messages are interpreted under the new ruleset until a 'Revert' signal is sent. The new context pushes onto a stack; Revert pops it. Unlike an ambient Mode change (which applies to the whole agent), ContextSwitch is scoped to a specific conversation or channel and carries explicit enter/exit boundaries.
Invariants
- The switch is signalled explicitly; it is never inferred from content.
- Revert pops the most recent switch, not an arbitrary one.
- Scoped to one conversation or channel, unlike an ambient Mode change.
Failure modes
- Unbalanced stack: a switch is never reverted, so the ruleset outlives the exchange it was for.
- Scope leak: messages outside the switched channel are interpreted under the new ruleset.
Where this came from
—
Builds on
Used by
- WorkerMode references
Identity
- Ref:
ContextSwitch#aa92 - Hash: sema:ContextSwitch#mh:SHA-256:aa928020743949b151e03433b563540eaf1bb56dad262297d2907bd0473931e2
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository