Documentation
¶
Overview ¶
Command invocation_scope is the repository guard for the invocation-scope invariant: no goroutine, thread, task or promise the runtime starts may outlive the Lambda invocation that started it.
The guard enumerates every asynchronous launch in the shipped runtime trees (Go goroutine and timer launches under runtime/, pkg/, testkit/ and cmd/; thread, task, executor and promise launches under ts/src and py/src) and reports each one whose join it cannot prove. Go sources are parsed with go/ast. TypeScript sources are parsed with the TypeScript compiler API by scripts/tools/invocation_scope/scan_typescript.mjs, and Python sources with the standard-library `ast` module by scripts/tools/invocation_scope/scan_python.py; a missing interpreter, a scanner failure, or a TypeScript parse diagnostic fails the guard instead of skipping the language.
Every reported launch must be listed in scripts/invocation-scope-baseline.txt with the join that keeps it inside its invocation, and every baseline entry must still match a reported launch. The baseline is therefore the auditable sweep table for the invariant: it holds exactly the sites whose join the AST proof cannot show, not a description of the invariant.
A launch counts as joined only when a join on the same target dominates every exit of the scope that contains it. The Go proof is the statement-list flow walk in this file; the TypeScript and Python proofs are the per-scope control-flow graphs in the two scanner helpers above. A join that only some paths execute (a join inside one `if` branch, a join after an early return, a join in a nested function nobody calls), a `cancel()`/`Stop()` without a wait, and a `defer` registered behind a branch are not joins.