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.
| Field | Required | Meaning |
|---|---|---|
name | yes | Qualified metric identifier, e.g. analytics.weekly_active_users. |
version | yes | Definition version, independent of the SignalQL language version. |
source | yes | Underlying SourceRef the metric is computed from (e.g. events). |
measure | yes | SignalQL aggregate return expression, e.g. count_distinct(user_id). |
filter | no | SignalQL predicate scoping the metric, e.g. event_name = "session_start". |
grain | no | Natural reporting grain (h/d/w/m). |
unit | no | Reporting unit, e.g. users. |
owner | no | Owning team/person for governance. |
dimensions | no | Dimensions 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.
| Field | Required | Meaning |
|---|---|---|
identifier | yes | Entity/event/signal/metric/relationship identifier. |
kind | yes | One of entity, event, signal, metric, relationship. |
fields | yes | Column descriptors: name, type, unit, nullable. |
relationships | no | Traversable edges: { name, target }. |
description | no | Human-readable description. |
unit | no | Reporting unit (for signals/metrics). |
version | no | Definition version (for kind: "metric"). |
Without a configured catalog provider, DESCRIBE is capability-gated and returns an explicit CapabilityError (tier v0.3-capability).