Expand description
Static scanning — the first of the three evidence sources behind keel init
and keel doctor (dx-spec §2). No code runs: we read the project’s source
and find where effects enter.
Two scanners, one merged result:
pythonshells anast-walker out topython3 -for precise Python parsing (imports of known effect libraries, URL/DSN string literals).jsparses JS/TS/JSX in-process with oxc (no Node toolchain needed) forfetch/undici/node:httpusage, provider-SDK imports, effect-lib call sites, and URL literals.
Both label every finding with file:line, so the generated keel.toml can
cite where each target was found and trust stays inspectable.
Modules§
- js
- The JS/TS static scan — a real parse on oxc.
- python
- The Python static scan: an
ast-walker executed out-of-process viapython3 -.
Structs§
- Call
Site - One effect call site with enclosing-function attribution — an internal
detail of the JS/TS pass (
js), which uses it to verify its real scope-chain tracking (dotted paths likeClass.method) independently of the coarser top-level-onlyFunctionFactsattributionkeel flows suggestconsumes. Not exposed onScanResult. Field order is the sort order (file, then line). - DepAverse
File - One file the scan judged dependency-averse: stdlib-only imports plus a
risk/gate/guard/auth/valid/safety/kill name or docstring signal, or an
explicit
# keel: excludemarker. Markers win in both directions: an exclude marker forces this classification regardless of imports, and an include marker defeats the heuristic even where it would otherwise match.keel doctor/keel init(a later program task) use this to honestly exclude hosts seen only in such files from proposed policy. Field order is the sort order (by file). - Function
Facts - Per-function effect attribution — the evidence behind
keel flows suggest. - Lang
Findings - One language scanner’s raw findings before host-gating.
- Orchestration
Sighting - One hand-rolled orchestration construct sighted in a file the language
passes never parse — shell scripts,
Makefiles, CI workflows. Coarse by design: a substring line match, not a parse, so it is a lead to inspect, never a verdict.kindis a closed set: “lockfile-mutex” | “guard-file” | “pid-check”. Field order is sort order. - Scan
Result - The merged output of both scanners.
- Sighting
- One place a target was seen: a project-relative path and 1-based line.
- Simplification
Sighting - One hand-rolled resilience pattern sighted inside a function that also
reaches a Keel-relevant target — a simplification lead: once the target
is wrapped, the pattern becomes redundant.
kindis a closed set: “hand-rolled-retry” | “hand-rolled-poll” | “silent-swallow”.lineanchors the construct to delete (the loop / theexceptline), not the sleep call inside it. Python-only as of this build (JS pattern parity is a spec’d follow-on program). - Subprocess
Sighting - One externally-launched process the scan saw — traffic inside it is outside Keel’s visibility regardless of policy. Field order is the sort order (file, then line).
- Target
Evidence - A target and everywhere the static scan saw it, deduplicated and ordered.
Enums§
- Target
Class - What kind of target a sighting resolves to. Governs the policy block
keel initwrites (anllm:*target gets the LLM pack; a host gets the outbound pack). - Transport
Class - How a sighted host’s traffic is dispatched, best-known across sightings.
Ordering is meaningful:
Tracked < UntrackedKnown < Unknown, so merging (min) always keeps the most favorable class seen for a host across every file/language that sighted it. This is whatkeel doctor(a later program task) uses to say honestly what Keel can and cannot see: a host isTrackedif some sighting reached it through a registry-adapted library,UntrackedKnownif the best reach was a known-but-unadapted transport (http.client, or urllib withouturllib.request; Python’surllib.requestitself is adapted), andUnknownif no transport evidence was found near any sighting at all.
Functions§
- scan
- Scan
projectwith both scanners and merge. Host targets are only emitted when the language pass also saw an HTTP client in use (a bare URL in a non-networked file is not evidence of an outbound call), keeping the output honest.