symfonic.kernel.contracts.scope_path¶
scope_path ¶
The one string a turn's stated scope binds its prompt and receipts under.
A turn's scope path is compared in four places: prompting compiles under it,
the kernel checks each compiler admission against it, the model-port binding
carries it, and a rendered selection is refused unless it names it. Each used
str(scope.path). That is right for a MemoryScope, whose path is
already its canonical string, and wrong for a typed scope, whose path is a
tuple of ScopeLevel values: str() of that tuple matches no memory key,
so a recall hydrated for the turn's own native scope was refused at compile
time and the prompt carried no memory (CORE-171).
A typed path becomes the kind-aware envelope native memory keys by
(MemoryScope.from_levels(...).path). The format is restated here, not
imported, because kernel.contracts is standard library only;
tests/kernel/test_core171_turn_scope_path.py pins the two strings equal.
Every other value keeps its previous string.
scope_root ¶
The root level's ID of a canonical scope path, or "".
A positional path is tenant/.... A native envelope is JSON, and its
IDs may contain /, so splitting it on / named the whole envelope
as the tenant.
Source code in src/symfonic/kernel/contracts/scope_path.py
turn_scope_path ¶
"" when no scope was stated; else its canonical path string.