/** * Internal Step Id Contract. * * Static analysis turns top-level play statements it cannot attribute to a * structured step into `run_javascript` glue substeps whose alias is a * machine-generated source line range (`lines__`, built in * `src/lib/plays/static-analysis.ts` → `createCodeStageForStatements`). The * execution plan / runtime node ids namespace every substep by its type * (`getStaticSubstepNodeId` in `src/lib/plays/step-progress.ts`), so glue nodes are ALWAYS * `run_javascript:` on the wire (ledger stepsById, snapshot * nodeStates, `play.step.*` stream events). * * These nodes are internal bookkeeping, not user-level play steps: surfacing * them produced the `step lines_687_687: completed` garbage in the CLI run * summary (SDK 0.1.93 regression). This module is the single structural * marker both the app package builder and the SDK CLI renderer use to keep * them out of user-facing output. Do NOT re-implement this check with ad-hoc * string matching elsewhere — import the predicate. */ /** Node-id namespace stamped on machine-generated glue-code substeps. */ export const INTERNAL_GLUE_NODE_ID_PREFIX = 'run_javascript:'; /** * True when a ledger/snapshot/stream step id refers to an internal * glue-code node rather than a user-level play step. */ export function isInternalGlueStepId(stepId: unknown): boolean { return ( typeof stepId === 'string' && stepId.startsWith(INTERNAL_GLUE_NODE_ID_PREFIX) ); }