/** * Node-path addressing (spec §8.5): the address of a step or node within a run — enclosing node * names, the iteration/item index where one applies, then the leaf name. E.g. `until-valid#3/design` * (loop iteration 3), `batch@7/review` (foreach item 7), `audit/lint` (nested workflow). * * Two forms of the same segment list: * - DYNAMIC path — every segment carries its real iteration/item index. Recorded on every event * that names a step (spec §8.1) and used for blocking/resume addressing (spec §8.4/§8.5). * - STATIC path — used to key step state and data-flow (spec §5.4). A loop iteration's index is * DROPPED (only the latest iteration's value is ever kept, since a loop is inherently sequential — * at most one iteration is ever live). A foreach item's index is KEPT (spec §5.4's exception): with * `concurrency > 1` several items are genuinely live at once, so collapsing them the way loop * iterations collapse would let one item's bare-name read resolve against a DIFFERENT item's * in-flight value — precisely the race spec §3.9 exists to exclude (P3 closes a P2 gap here). * * The wire format distinguishes the two kinds of index with a different separator (`#` loop, `@` * foreach) specifically so a consumer holding only the formatted STRING (an event off the log) can * still tell them apart without the workflow tree — `deriveStepStates`/`rebuildStepOutputs` are pure * folds over the log and have no access to the tree to disambiguate otherwise. * * Pure — no fs/PI/network. This is the P2 seam P1 left for `step-state.ts`'s `keyOf` to grow into. */ /** Whether a segment's index is a loop iteration (dropped in the static key) or a foreach item (kept). */ export type IndexKind = "loop" | "foreach"; export interface PathSegment { readonly name: string; /** The loop iteration (1-based) or foreach item index (0-based) this segment addresses, if any. */ readonly index?: number; /** Present iff `index` is present: which of the two indexed kinds this segment is (spec §5.4). */ readonly indexKind?: IndexKind; } /** A node path: root-to-leaf, at least one segment. */ export type NodePath = readonly PathSegment[]; /** * A bare step/node name may not carry path syntax (spec §3): `.commit()` rejects a name containing * `/`, `#`, or `@` — all three are node-path syntax, and any would make a path built from it unparseable. */ export declare function isValidNodeName(name: string): boolean; /** Append one plain (non-indexed) segment — a construct's own addressing name, a step name, an arm name. */ export declare function appendSegment(parent: NodePath, name: string): NodePath; /** Append a loop-iteration segment (1-based `iteration`) — its index is dropped from the static key. */ export declare function appendLoopIteration(parent: NodePath, name: string, iteration: number): NodePath; /** Append a foreach-item segment (0-based `index`) — its index is KEPT in the static key (spec §5.4). */ export declare function appendForeachItem(parent: NodePath, name: string, index: number): NodePath; /** Render a path to its wire/log form: `until-valid#3/design`, `batch@7/review`. */ export declare function formatPath(path: NodePath): string; /** * Parse a formatted path string. Fails loudly on anything unparseable rather than guessing — a log * written before this phase has no `path` field at all and must not be silently mis-read as one * (spec: old logs break by design; the reader fails loudly). */ export declare function parsePath(raw: string): NodePath; /** * Drop LOOP iteration indices (a loop is inherently sequential — at most one iteration is ever live); * KEEP foreach item indices (spec §5.4's exception — see the module header). This is the form both * `RunState.stepOutputs` (data flow) and `deriveStepStates` (step state) key by. */ export declare function staticPathOf(path: NodePath): NodePath; /** The static key for a path, formatted — what `deriveStepStates` and `RunState.stepOutputs` key by. */ export declare function staticKeyOf(path: NodePath): string; /** Build a static key directly from a dynamic parent path plus one or more child names, without index. */ export declare function staticChildKey(parent: NodePath, ...names: readonly string[]): string; //# sourceMappingURL=node-path.d.ts.map