| 1 | --- |
| 2 | type: decision |
| 3 | id: dcr-62ecc36 |
| 4 | status: decided |
| 5 | title: "Telemetry rides three signal contracts: durable events, lossy metrics, logs retained under declared policy" |
| 6 | created: 2026-08-05 |
| 7 | source: design conversation, 2026-08-05 |
| 8 | --- |
| 9 | |
| 10 | # Three signal contracts |
| 11 | |
| 12 | Telemetry on the instance's infrastructure is three signal classes, each with its own durability |
| 13 | contract: domain events are durable and replayable, metrics are lossy by design, and logs are |
| 14 | retained under declared policy. All three ride the instance's existing infrastructure; the classes |
| 15 | differ in what each is allowed to lose. |
| 16 | [architecture.md's event-log bet](../../design/architecture.md#bet-git-as-event-source--a-log-not-a-workflow-engine) |
| 17 | already holds that per-repo events are durable in git with the bus as a rebuildable projection, and |
| 18 | that only ephemeral cross-system events — naming metrics in passing — have the bus as their source |
| 19 | of truth. This node designs what that parenthetical left open, and adds a third class the |
| 20 | architecture does not name. |
| 21 | |
| 22 | ## Domain events — durable |
| 23 | |
| 24 | Domain events are the class Phase 1 built: schema'd one event type at a time in |
| 25 | [schema/events.cue](../../../schema/events.cue), carried on the bus's durable stream (JetStream), |
| 26 | deterministically replayable, and a projection of git. This decision leaves them unchanged. The |
| 27 | properties that make the bus trustworthy — durability, schemas, replay — belong to this class alone. |
| 28 | |
| 29 | ## Metrics — lossy by design, decided as a trial |
| 30 | |
| 31 | Metrics are rates, latencies, error counts, and resource use. They ride plain subjects on the same |
| 32 | server, deliberately unpersisted: fire-and-forget, no stream, no pressure on the bus's bounded |
| 33 | store. Loss of a sample is acceptable, and that acceptance is what distinguishes the class. |
| 34 | |
| 35 | This element is decided as a trial. The revisit condition: if the separation fails in practice — |
| 36 | metrics leaking into durable streams, the vocabulary discipline eroding, or the transport proving |
| 37 | wrong — the transport is revisited. The class distinctions stand regardless of the transport's fate. |
| 38 | |
| 39 | ## Logs — retention is a capability, governed by declared policy |
| 40 | |
| 41 | Retention is a capability of the system: ingestion and warehousing exist as machinery, and what is |
| 42 | retained, at what fidelity, for how long, is declared policy — never an implicit property of |
| 43 | whatever a collector happens to keep. Resources are bounded, and observability data's value decays |
| 44 | for the loop that consumes it — the observe-orient-decide-act loop the system runs over its own |
| 45 | signals ([[ida-a006b02]] |
| 46 | ([ida-a006b02-ooda-over-neural-nodes.md](../ideas/ida-a006b02-ooda-over-neural-nodes.md))). A |
| 47 | default retention strategy ships, and it evolves as use of the data drives efficiencies: the |
| 48 | retention policy is itself an output the loop tunes, governed like any configuration |
| 49 | ([self-transparency.md](../../design/self-transparency.md)). |
| 50 | |
| 51 | The declared-tiers shape already exists in this schema: `#Backup.retention` in |
| 52 | [schema/valley.cue](../../../schema/valley.cue) declares keep-counts as policy with defaults. The |
| 53 | same move extends to signals. |
| 54 | |
| 55 | Species differ and carry distinct defaults: some signals are already kept indefinitely at negligible |
| 56 | cost, others are bulky with fast-decaying value. Policy is per species, not one number. |
| 57 | |
| 58 | The warehouse technology, the query interface, and whether logs transit the bus at all or ship by |
| 59 | other means are deliberately open: the decision is that retention is declared, not which machinery |
| 60 | enforces it. That openness is the design's storage-agnosticism applied to logs — durability attaches |
| 61 | to project state, not to any one store ([[ida-48c8868]] |
| 62 | ([ida-48c8868-stores-beyond-git.md](../ideas/ida-48c8868-stores-beyond-git.md))), and an |
| 63 | implementation is a backend ([[ida-b9f646c]] |
| 64 | ([ida-b9f646c-nix-backend-not-substrate.md](../ideas/ida-b9f646c-nix-backend-not-substrate.md))). |
| 65 | |
| 66 | No declared retention policy exists today, so what is kept is an accident of each collector's |
| 67 | machine configuration rather than a decision. Journals on the pilot host rotate under default caps; |
| 68 | run trajectories persist indefinitely; neither is the outcome of declared policy. |
| 69 | Retention-by-accident is the gap this decision closes. |
| 70 | |
| 71 | ## The promotion ladder |
| 72 | |
| 73 | Promotion is how value escapes decay: raw signal is retained under the default policy and expires; |
| 74 | what a detection distills is promoted into a durable, schema'd insight event; what warrants |
| 75 | permanent memory becomes a graph node. The decay gradient and the promotion ladder are the same |
| 76 | structure read in two directions. Raw metrics and logs are sensing, not history. The one-history |
| 77 | property (S4, [user-scenarios.md](../../design/user-scenarios.md#the-rest-of-the-ladder)) is carried |
| 78 | by promoted insights and the durable event log, never by the firehose. |
| 79 | |
| 80 | ## The split of concerns |
| 81 | |
| 82 | The design states the properties; the instance supplies the machinery. This is the division the |
| 83 | backup policy already draws: `#Backup` in the host schema declares the durability policy, and the |
| 84 | installer supplies machine integration. Which warehouse, which collector, which retention storage — |
| 85 | instance and machine concerns. |
| 86 | |
| 87 | ## The authentication consequence |
| 88 | |
| 89 | [[bd-d853d9c]] ([bd-d853d9c-bus-unauthenticated.md](../bugs/bd-d853d9c-bus-unauthenticated.md)) |
| 90 | gates automated consumers on bus authentication. That fix should carve the subject namespace with |
| 91 | the class split in mind from the start: domain subjects writable only by the hook and integrator |
| 92 | identities, metrics subjects writable by machine services. Encoding the two write-authorities in |
| 93 | subject-level authorization is cheaper now than re-cutting the namespace later. |
| 94 | |
| 95 | ## Related |
| 96 | |
| 97 | - [[ida-b48bded]] |
| 98 | ([ida-b48bded-production-dags-and-events.md](../ideas/ida-b48bded-production-dags-and-events.md)) |
| 99 | — the event frame these contracts ride on. |
| 100 | - [[ida-b42d112]] |
| 101 | ([ida-b42d112-harness-log-is-normalized.md](../ideas/ida-b42d112-harness-log-is-normalized.md)) — |
| 102 | a harness's log of an agent run is normalized; normalization is what makes cross-node log |
| 103 | retention usable. |
| 104 | - [requirements.md's Minimal constraint](../../design/requirements.md#constraints) — one server |
| 105 | carrying three contracts instead of three systems. |
| 106 | - [[ida-f16bd96]] |
| 107 | ([ida-f16bd96-the-system-observes-itself.md](../ideas/ida-f16bd96-the-system-observes-itself.md)) |
| 108 | — the system observes itself, the goal these contracts serve. |
| 109 | |
| 110 | ## Open |
| 111 | |
| 112 | - The default retention strategy's actual tiers, per species. |
| 113 | - What usage signal drives the retention policy's evolution. |
| 114 | - Whether the offsite depth that protects git data extends to retained signals, and for which |
| 115 | species. |
| 116 | - The warehouse: technology and query interface. |
| 117 | - Whether logs transit the bus or ship journald-native. |
| 118 | - What volume the trial's plain subjects sustain on the pilot host before the transport question |
| 119 | reopens. |