This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/17/2026.
Caps
import std/capscaps.kz — SPIKE: capability census + surface scan.
caps.kz · 2 tors · ~[comptime]
caps.kz — SPIKE: capability census + surface scan.
Collects `cap(...)` entries from vertical/inline annotation blocks on
every event_decl and proc_decl in the merged program, and runs a naive
substring scan over proc body text (the "opaque" hostline is just a
string in the AST — ProcDecl.body.text).
koruc <file> caps
Entries are opaque: `cap(io)`, `cap(io|network)`, `cap(auto)` — this
module defines no vocabulary, it reports what authors wrote and what
the surface scan saw. Declared vs scanned divergence is the finding.
~[comptime|command] pub tor caps {
program: std/compiler:*const Program,
allocator: __koru_std.mem.Allocator,
argv: []string
}~part explain koru_std/caps.explain.kz
caps.explain.kz — the `explain` part of caps — joined via `~part explain` in caps.kz; members land in koru_caps. Reports the program's declared capability surface: every cap(...) entry on every reachable declaration, plus the surface-scan tier — inferred, lexical, comments and strings count. Self-declared caps are claims the author makes; scan hits are evidence, never proof. Programs that don't import std/caps get no section — the explainer is opt-in like everything else here.
// @retain: explain_caps_event is referenced from generated code
// (koruc's koru_explain_gather invokes every discovered [explainer]).
~[comptime|explainer] pub tor explain-caps {
program: std/compiler:*const Program,
allocator: std.mem.Allocator
} -> ExplainReport