Skip to content

Domain packs (external)

Domain packs let teams layer interpretation and reusable derived signals without changing SignalQL core grammar.

Purpose

  • Keep SignalQL core domain-agnostic.
  • Enable reusable higher-level logic for specific domains.
  • Version interpretation artifacts independently from language version.

Examples

  • Analytics pack: sessions, funnels, retention patterns.
  • Work intelligence pack: work_item, signal(risk_score), probability(delay), ownership_gap, dependency_chain.
  • Security pack: anomaly_detection, threat_signals.
  • Memory/knowledge pack: memory_object, decision, claim, context_bundle, provenance conventions.

What a domain pack may include

  • Derived signal definitions.
  • Reusable query templates.
  • Interpretation prompts/policies.
  • Validation and confidence metadata.
  • Namespaced entity catalogs (for example work.memory_item, analytics.session, code.architecture_decision).

What a domain pack must not do

  • Modify SignalQL core grammar.
  • Introduce core-only domain keywords.
  • Add mutating actions to SignalQL execution.

Metric definition contract (v0.3)

A governed metric(name) reference resolves, at bind time, to a metric definition supplied by a domain pack or metrics registry. The core language carries only the reference — the formula lives in the definition and is versioned independently from the language version. Resolved metric name and version are emitted in result-envelope metadata (metadata.metrics) so a re-run can detect definition drift.

FieldRequiredMeaning
nameyesQualified metric identifier, e.g. analytics.weekly_active_users.
versionyesDefinition version, independent of the SignalQL language version.
sourceyesUnderlying SourceRef the metric is computed from (e.g. events).
measureyesSignalQL aggregate return expression, e.g. count_distinct(user_id).
filternoSignalQL predicate scoping the metric, e.g. event_name = "session_start".
grainnoNatural reporting grain (h/d/w/m).
unitnoReporting unit, e.g. users.
ownernoOwning team/person for governance.
dimensionsnoDimensions the metric may be grouped by.

Binding semantics: a query FROM metric(name) … RETURN timestamp, metric_value is rewritten to FROM <source> WHERE <filter> … RETURN timestamp, <measure> — the reserved token metric_value in RETURN is replaced by the metric's measure; the caller's DURING/AS OF/BUCKET BY/GROUP BY/ORDER BY/LIMIT are preserved. Unknown metrics raise a typed MetricBindingError (code: "unknown_metric"). Metric formulas never enter the core grammar.

Catalog records for DESCRIBE (v0.3)

A catalog provider answers DESCRIBE introspection queries with machine-readable records so an agent can discover schema headlessly. Required fields are always present; optional fields are populated per adapter capability.

FieldRequiredMeaning
identifieryesEntity/event/signal/metric/relationship identifier.
kindyesOne of entity, event, signal, metric, relationship.
fieldsyesColumn descriptors: name, type, unit, nullable.
relationshipsnoTraversable edges: { name, target }.
descriptionnoHuman-readable description.
unitnoReporting unit (for signals/metrics).
versionnoDefinition version (for kind: "metric").

Without a configured catalog provider, DESCRIBE is capability-gated and returns an explicit CapabilityError (tier v0.3-capability).