Documentation
¶
Overview ¶
Package providers implements the GUI-free introspection table providers — env, apps, build, sbom (ADR-0094 §SD8), sql_passes (ADR-0108 §SD5), extbin (ADR-0118), adr/subtask/coderef/adrcontent (ADR-0122 §SD4), helpsections/adrsections (ADR-0164 §SD5), capability/capsection/caprelation (ADR-0168 §SD8), panel_shapes (ADR-0170 §SD5) — and registers them into an introspect.Registry. The two GUI-coupled providers (demos, windows) live with the runtime wiring, where the egui2 host and its window-host instance exist, so this package stays importable from headless contexts.
Index ¶
- Variables
- func RegisterCodevol(r *introspect.Registry, src CodevolSourceI) (err error)
- func RegisterCoverage(r *introspect.Registry, src CoverageSourceI) (err error)
- func RegisterDefaults() error
- func RegisterEffects(r *introspect.Registry, bus *inprocbus.Inst, tasks *supervisor.Supervisor) (err error)
- func RegisterRunEvents(r *introspect.Registry, facts factsstore.FactsStoreI, ...) error
- func RegisterStatic(r *introspect.Registry) (err error)
- func RegisterTopology(r *introspect.Registry, holder *sysmetricsbus.LatestHolder) (err error)
- func RegisterWorkingsets(r *introspect.Registry, facts factsstore.FactsStoreI) error
- type CodevolSourceI
- type CoverageSourceI
- type MembershipLookup
Constants ¶
This section is empty.
Variables ¶
var SbomPath = env.NewString(env.Spec{ Name: "KEELSON_INTROSPECT_SBOM_PATH", Description: "path to a CycloneDX SBOM JSON exposed as the keelson.sbom introspection table; empty disables the table", Category: env.CategorySystem, })
SbomPath points at a CycloneDX SBOM JSON to expose as keelson.sbom (ADR-0094 §SD8). Empty (the default) yields a zero-row table — the SBOM is a build artefact that may be absent in a dev run, so the table degrades to empty rather than failing the query.
Functions ¶
func RegisterCodevol ¶ added in v0.0.20
func RegisterCodevol(r *introspect.Registry, src CodevolSourceI) (err error)
RegisterCodevol registers the two self-inspection tables into r. A nil src means "describe the binary I am running in", which is what every host wants; RegisterStatic passes nil. Tests pass a fixture.
func RegisterCoverage ¶ added in v0.0.20
func RegisterCoverage(r *introspect.Registry, src CoverageSourceI) (err error)
RegisterCoverage registers the three coverage tables into r. It takes the interface, never the concrete sampler, so this package stays free of runtime/coverage imports; a host on an uninstrumented build passes nil and gets empty tables rather than absent ones — the keelson('windows') precedent, so the set of table names does not depend on the build lane.
func RegisterDefaults ¶
func RegisterDefaults() error
RegisterDefaults registers the GUI-free providers into the process-wide introspect.Default registry.
func RegisterEffects ¶ added in v0.0.20
func RegisterEffects(r *introspect.Registry, bus *inprocbus.Inst, tasks *supervisor.Supervisor) (err error)
RegisterEffects registers the subscriptions, client_caps and tasks providers into r (ADR-0188 §SD4). bus and tasks may each be nil — the tables are then empty, never absent. Beware the typed-nil interface trap on the caller's side: hand over a supervisor only when it started.
func RegisterRunEvents ¶ added in v0.0.20
func RegisterRunEvents(r *introspect.Registry, facts factsstore.FactsStoreI, persistExec recordstore.ExecutorI) error
RegisterRunEvents registers the run-event view into r.
facts is the process's facts store, taken as the whole FactsStoreI for symmetry with RegisterWorkingsets; the read capability is asserted off it (ADR-0191 §SD7), so an in-memory store answers with an empty table rather than an absent one. persistExec is the executor the persist store was opened over, or nil — the provider opens its own read-only store on it, which is why it takes the executor and not the live backend: a scan must not contend with the writer's buffer.
func RegisterStatic ¶
func RegisterStatic(r *introspect.Registry) (err error)
RegisterStatic registers the GUI-free providers (env, apps, build, sbom, sql_passes, extbin, adr/subtask/coderef/adrcontent, capability/capsection/caprelation, components, panel_shapes) into r (ADR-0094 §SD8, ADR-0108 §SD5, ADR-0118, ADR-0122 §SD4, ADR-0126 §SD5, ADR-0168 §SD8, ADR-0170 §SD5).
The ADR and capability tables register unconditionally, like the rest: off-repo they are empty rather than absent, so the set of table names does not depend on where the process was started (see adr.go and capmap.go). Registering adrcontent costs nothing until it is named in a query — it reads the corpus on Snapshot, not here. The plane-fed topology tables (procs, sockets) are the exception — they need a consumer, so they register via RegisterTopology.
func RegisterTopology ¶ added in v0.0.14
func RegisterTopology(r *introspect.Registry, holder *sysmetricsbus.LatestHolder) (err error)
RegisterTopology registers the plane-fed observed-topology providers (procs, sockets) and the graph projection (topology_nodes, topology_edges) reading holder's latest snapshots. Call from a host that stands up a metric-plane consumer (ADR-0126 §SD5); observed rows are empty until a scraper publishes, declared rows are always there.
func RegisterWorkingsets ¶ added in v0.0.20
func RegisterWorkingsets(r *introspect.Registry, facts factsstore.FactsStoreI) error
RegisterWorkingsets registers a workingsets provider reading facts into r (ADR-0148 §SD7). It takes the FactsStoreI interface, never chstore, so this package stays importable from headless contexts; a host that has no facts store passes nil and gets an empty table rather than an absent one — the keelson('windows') precedent. Like RegisterTopology, it registers through its own function because it needs a live object the static set cannot see.
Types ¶
type CodevolSourceI ¶ added in v0.0.20
type CodevolSourceI interface {
Get() (mods []codevol.ModuleInfo, rep codevol.SymbolReport)
}
CodevolSourceI is the providers' view of the binary being described. Production passes the self-reading source below; tests pass a fixture, which is the only way to exercise these tables in the default lane — see selfCodevolSource for why.
type CoverageSourceI ¶ added in v0.0.20
type CoverageSourceI interface {
Meta() (meta *covsnap.MetaProfile)
Status() (status covsnap.RunStatus)
CoveredBitmap() (covered *roaring.Bitmap)
Seq() (seq uint64)
}
CoverageSourceI is the providers' view of the live sampler (*coverage.Sampler satisfies it). The accessors are individually consistent, not mutually snapshot-atomic — between two calls another sample may fold. Coverage is monotone, so the worst case is a table one tick fresher in one column than another, which a Live table tolerates.
type MembershipLookup ¶ added in v0.0.20
type MembershipLookup struct{}
MembershipLookup adapts the process registry to the membership-id lookup the leeway marshalling and SQL-authoring paths take (marshallreflect.LookupI, readback.IdLookup, constructsql.MembershipIdsI — one method, spelled the same in all three).
It lives here rather than in vdd because it exists for the SQL surface: it is what lets LW_GET name a membership on a ref channel instead of carrying its id (ADR-0171 §SD4, ADR-0181 §SD3).
func (MembershipLookup) LookupMembership ¶ added in v0.0.20
func (MembershipLookup) LookupMembership(name string) (id uint64, err error)
LookupMembership resolves a membership name to the id a ref lane carries. Unknown names error rather than returning zero — zero is a valid id shape, and a silent miss would expand into a predicate that matches nothing.
It searches every registry in [membershipRegistries], in order, and answers from the first that knows the name. Before ADR-0191 §SD6 it consulted vdd's alone, which meant a `boxer.facts` query naming a runtime membership — `runtimeKindAppLifecycle`, the vocabulary that table is mostly made of — was refused, and the author had to carry the raw uint64 in the SQL text. That is the exact complaint ADR-0171 §SD4 exists to answer, so answering it for one vocabulary and not the others was a half-open door rather than a policy.
The names are collision-free across the set (the provider test asserts it), so first-match is total order rather than precedence.