Skip to main content

Module run_path

Module run_path 

Source
Expand description

failedStepPath: the structured RunPath representation (spine §9) and its canonical human-readable string form (07 §2.1).

The frame array is authoritative — RunLog, CheckpointView, StepRecord.runPath and pointlock locate all use the JSON PathFrame[] form. The canonical string (e.g. checkout@a1f3c9d2/purchase/call→login@9c2e77b0/enterPassword#2!tokenVisible) is its deterministic rendering, implemented here by render_run_path and parsed back by parse_run_path. Macro expansions never appear in a path — the sourceMap translates back to YAML lines and macro call chains. Not part of the FlowIR wire schema; consumed by pointlock-store / pointlock locate.

§Rendering rules (07 §2.1, verbatim)

framerenderingnotes
flow<flowId>@<hash8>leading segment; flows always carry the first 8 hex of their irHash
step/<stepId>
call/<stepId>/call→<calleeFlowId>@<hash8>one frame, two visual segments
iteration[<index>] or [<index>:<key>]no /; appends to the foreach step segment
hook/hook:<hookName>:<trigger>handler audit frame (spine R10)
attempt#<n>appends to the step segment, n ≥ 1
phase:<preflight|act|observe|assert>appends after the attempt
assertion!<assertId>path tail

An attempt (and a phase) following a call frame attaches to the call step’s own segment, before the arrow segment — 07’s example purchase#2/call→login@9c2e77b0 (caller retried the callee: call step attempt #2). A call→ segment directly after a hook segment (07’s pay/hook:onFail:1/call→repairCart@55d0ab12) is a handler-launched subflow and carries no call step id; ParsedPathFrame::Call::step_id is None there.

§Grammar caveats (documented)

  • Rendering truncates hashes to their first 8 hex chars, so parsing yields ParsedPathFrame (hash prefixes), not PathFrame. Round-tripping is exact in both directions modulo that truncation: render(frames) == render_parsed(parse(render(frames))).
  • A phase suffix is only recognized after an attempt (#n:phase, per 07 §2.1 “appends after the attempt”); a bare : inside a segment parses as part of a compiler-synthesized step id (which legally contains :). A synthesized id whose last segment spells a phase keyword is therefore renderable but not distinguishable — the structured array remains authoritative for such paths.
  • Segments starting with hook: always parse as hook frames (a real hook trigger count is numeric, which no step-id segment can be).
  • Iteration keys must not contain /, ] or be empty; v0.1 locates by index and reserves key for keyed foreach.

Structs§

RunPathParseError
Error produced by parse_run_path.

Enums§

ParsedPathFrame
A PathFrame as recoverable from the canonical string: identical in shape except that flow hashes appear as their rendered 8-hex prefixes (the full digest is not present in the string), and a call frame under a hook segment carries no step id (handler-launched subflow, 07 §2.1).
PathFrame
One frame of a RunPath (8 kinds, closed; spine §9), internally tagged with kind.

Functions§

parse_run_path
Parses a canonical RunPath string back to its frames. Inverse of render_run_path up to hash truncation (see ParsedPathFrame and the grammar caveats in the module docs).
render_parsed_run_path
Renders a parsed run path back to the canonical string. For any s accepted by parse_run_path, render_parsed_run_path(&parse_run_path(s)?) == s.
render_run_path
Renders a structured RunPath to its canonical human-readable string (07 §2.1; rules in the module docs). Deterministic; hashes appear as their first 8 hex chars.

Type Aliases§

RunPath
A structured run path: an ordered stack of frames from the run’s root flow down to the addressed site.