Scope (connection phases)

Scope tracks which **business phase** the connection is in (`auth`, a room, etc.). Enter with `~name`, exit with `!~name`; affects which `--` lines match and whether `--@loop` timers run.

读法:enter 根 runBranch 结束后 push 帧并移入匹配上下文。缩进在 返回行 下的 -- → 下帧生效;与 entry 平级 的子 -- → 同帧 scan(§5.2)。

Normative 定义见第十七节。 本节为阅读摘要:

  • scopeStack + 隐式 root 帧;--login ~auth push;--logout !~auth pop(含子孙)
  • --@loop 绑 scope 帧;pop → cancel timers
  • 普通 -- 仅在栈顶帧匹配上下文子树内选取 entry!~name 全 Flow 扫描但 须栈上已有 name优先于 entry
  • entry 命中 → enter 根 runBranch:平级子节点顺序 scan(§5.2);递归子 --scan 模式,不 push 中间帧
  • 多个 互斥 entry(同级不同 -- 根分支)仍为 OR,源序深度优先择一