DescribedResultDeclaration
Type Alias: DescribedResultDeclaration
DescribedResultDeclaration =
object& {provenance: {ageSeconds?:number;measuredAt:string;source:string;sourceExportDate?:string; }; } | {facts?:undefined;series?:undefined; }
Defined in: src/lib/semantics/types.ts:284
What a tool author passes to describedResult() — the
SemanticDeclaration fields in ONE spelling, camelCase, respelled to
the unchanged snake_case wire (ToolSemantics).
provenance is REQUIRED whenever series or facts is present, and the
compiler says so: a number with no source and no age is refused at run time
anyway, inside the tool, where the model reads the refusal. A declaration
with only edges or only a clarify question needs none.
At least one of series, facts, edges or a non-null clarify must be
present — an envelope with no data and no question declares nothing. There
is no notCovered: the prose list the model reads is derived from
coverage, so the two can never disagree.
Type Declaration
clarify?
readonlyoptionalclarify?:SemanticClarify|null
A question the result hands back instead of picking silently. null
states "ambiguity was considered; there is none". It does not pause the
run — the model reads it and decides what to ask.
coverage?
readonlyoptionalcoverage?:CoverageDeclaration
The coverage()-vocabulary declaration this result absorbs.
edges?
readonlyoptionaledges?: readonlySemanticEdge[]
Typed relationships — { from, to, kind }.
facts?
readonlyoptionalfacts?: readonlySemanticFact[]
Typed rows about entities — every row names its entity.
grain?
readonlyoptionalgrain?:object
What one value MEANS. Required with series.
grain.aggregation?
readonlyoptionalaggregation?:string
How the values were folded ('avg', 'max', 'sum', 'count', …).
grain.collapsed?
readonlyoptionalcollapsed?:string
What was folded away ('per-port rows collapsed to per-switch').
grain.interval?
readonlyoptionalinterval?:string
The collection interval the values live on ('30m', '1h', 'daily').
grain.isCounter?
readonlyoptionalisCounter?:boolean
Whether the values are counters — cumulative readings a reader must never
add together. MUST be stated (true or false) whenever aggregation is
counter-looking (see COUNTER_AGGREGATION_WORDS).
provenance?
readonlyoptionalprovenance?:object
Where the values came from and how old they are. Required with
series or facts.
provenance.ageSeconds?
readonlyoptionalageSeconds?:number
How stale the data was when the tool answered, in seconds.
provenance.measuredAt
readonlymeasuredAt:string
When the WORLD was measured, in the tool's own clock words — never parsed. Take it from the data: the export's time for a file, the moment of the read for a live query, the newest sample for a series, and the END of the window for a value computed over one.
provenance.source
readonlysource:string
The system of record the values were read from.
provenance.sourceExportDate?
readonlyoptionalsourceExportDate?:string
For file-fed collectors: the export the values rode in on.
render?
readonlyoptionalrender?:object
Hints for a UI. The model never reads them.
render.chartHint?
readonlyoptionalchartHint?:string
Chart-shape hint ('line per entity').
render.columns?
readonlyoptionalcolumns?: readonlystring[]
Column order for a tabular view.
render.default
readonlydefault:string
The default presentation ('table', 'chart', 'prose', …). A hint.
render.filterNote?
readonlyoptionalfilterNote?:string
A note about what filtering already happened ('replicas excluded').
render.sort?
readonlyoptionalsort?:string
Sort hint ('avg_iops desc').
series?
readonlyoptionalseries?: readonlySemanticSeriesPoint[]
Measured points — { t, entity, metric, value }. Needs grain.
