Skip to main content

Module sequence

Module sequence 

Source
Expand description

#846: the sequence-diagram query.

Classifies a handler body’s calls into runtime-participant lifelines — consumed capabilities, calls into consumed contexts, and agents (including same-context agents) — for the “Show Sequence Diagram” VS Code feature. Everything else (commons fns, context-local fns, methods, constructors) folds into the entry participant’s own activation: no message is emitted for the call, and — because this repo’s resolver does not inline call bodies either — a lifeline call written inside a commons fn’s own body is invisible to this walk. That is a stated Tier-1 limitation, not a bug: see design/pending/sequence-diagram-846.md.

A pure, read-only IDE query: it never touches the checker’s hot path (bynk_check::checker::check_handler_body) and is built on the exhaustive expr_children/statement_exprs walkers only insofar as this module’s own statement dispatch mirrors their coverage of Statement — a new Statement variant is a compile error here, in Builder::walk_block’s match, not a silent gap.

Cross-context/agent calls are boundary-stop (Decision C): one Call + one Return message: the callee’s own body is never walked, even where reachable (an agent’s handlers are visible via ContextSequenceInfo::agents).

Structs§

AltBlock
Branch
Message
Participant
SequenceModel

Enums§

AltKind
HandlerOwner
Which declaration owns the handler being diagrammed.
MessageKind
ParticipantKind

Functions§

sequence_model
default_given is the owning service’s service-level given default (v0.155, ServiceDecl.default_given) — a handler that declares no given of its own inherits it. This classifier walks a freshly-parsed AST that has not been through bynk-emit’s inject_service_defaults normalization pass (which is what mutates handler.given in the compile pipeline), so the fallback has to be applied here or a handler relying on the service default would drop every capability lifeline. Pass &[] when there is no default (always the case for HandlerOwner::Agent — agents have no service-level given). default_by is the owning service’s service-level by default (v0.155, ServiceDecl.default_by) — a handler that declares no by of its own inherits it, exactly as it does the given default. Pass None for an agent (agents have no principal).