Skip to main content

Module sentinel

Module sentinel 

Source
Expand description

Reserved-token scanner for reconstructed assistant lines.

Unit 10 of the v1 kernel plan. Consumed by the loop controller in Unit 11: for every line yielded by claude_proc::ClaudeProcess, the controller feeds the text into a Scanner and decides what to do with the returned Hit.

Vocabulary in v1:

  • BLOCKED — always reserved. Signals the pipe run is waiting on a human or an external condition. Detected regardless of whether the active loop registers it.
  • User-supplied until tokens — carried on loop.until in the pipe YAML. ALL_TASKS_COMPLETE is the canonical one for ship-or-halt loops, but any string the user registered is fair game.

Match rule: the scanner returns Some(Hit) only when the input line, after trim, is exactly equal to a registered token. A narrative like I am BLOCKED by a dependency must not match; a standalone BLOCKED line (or one padded with whitespace) must.

Priority: when a stream contains both a BLOCKED and an until line, BLOCKED wins. Per-line Scanner::feed is unaware of prior lines, so callers that want this guarantee either use Scanner::scan (stateful pass over an iterator) or track the precedence themselves via Kind::Blocked vs Kind::Until.

Wrap-form tokens (<promise>TOKEN</promise>) are deferred past v1 — the plan explicitly narrows the surface to standalone lines.

Structs§

Hit
Outcome of a successful sentinel match.
Scanner
Stateless sentinel matcher.

Enums§

Kind
Classifies a Hit so callers can resolve priority without re-comparing against the constant.

Constants§

BLOCKED
The reserved sentinel that always takes priority over user tokens.