Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 29 additions & 17 deletions docs/rfcs/0010-audit-stream-queries.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
rfc: 0010
title: Audit-stream queries & template drift
status: specified
status: green
author: Jens Holdgaard Pedersen <jens@holdgaard.org>
drafting-assistance: Claude
created: 2026-06-09
Expand All @@ -11,22 +11,34 @@ superseded-by: —

# RFC 0010 — Audit-stream queries & template drift

> **Status note.** **`specified`.** The dedicated `drift` surface (a
> contained query head, not the general aggregation pipeline) was
> maintainer-confirmed 2026-06-09. This RFC fills the audit-stream
> query gap that RFC 0002 §6.3 deferred ("drift is an audit-stream
> property, not a column in the RFC 0005 data files, so it needs an
> audit-stream query path — a future capability"). It specifies a
> first-class, contained **`drift`** query over the per-tenant RFC 0005
> `audit/` Parquet stream, encapsulating the fixed aggregation that
> RFC 0001 §6.7 wrote out as SQL "for spec clarity". The §5 criteria
> below flip RFC 0001 scenario **H5.3**
> (`crates/ourios-miner/tests/hazards.rs::h5_3_drift_query_returns_templates_that_gained_a_version`,
> currently `#[ignore]` / `todo!()`). This RFC **extends** RFC 0002 (it
> does not reopen or renumber it; RFC 0002 stays `green`) and **reads**
> the RFC 0005 audit schema (it does not redefine it). Hazard 6
> (`CLAUDE.md` §4 — no DataFusion/SQL leakage) constrains the surface:
> drift is exposed through the DSL, never as raw SQL.
> **Status note.** **`green`** (2026-06-15) — all eight §5 acceptance
> scenarios (RFC0010.1–.8) have live, passing tests in
> `crates/ourios-querier/tests/drift.rs`: drift returns drifted templates
> with counts (.1), half-open `[from, to)` window (.2), `event_type`
> scoping excludes non-widenings (.3), tenant isolation (.4),
> empty-is-empty-not-error (.5), `widening_count` desc / `template_id` asc
> ordering (.6), aggregate version/time bounds (.7), no DataFusion/SQL
> leakage (.8). The dedicated `drift` surface (a contained query head, not
> the general aggregation pipeline) was maintainer-confirmed 2026-06-09;
> this RFC fills the audit-stream query gap RFC 0002 §6.3 deferred,
> encapsulating the fixed aggregation RFC 0001 §6.7 wrote out as SQL "for
> spec clarity".
>
> **RFC0010.1 discharges RFC 0001 H5.3.** That hazard test was *relocated*
> out of `crates/ourios-miner/tests/hazards.rs` (now a relocation pointer
> there) to `crates/ourios-querier/tests/drift.rs::h5_3_drift_query_returns_templates_that_gained_a_version`,
> where the `drift` surface lives — it is no longer `#[ignore]` / `todo!()`.
>
> This RFC **extends** RFC 0002 (it does not reopen or renumber it; RFC 0002
> stays `green`) and **reads** the RFC 0005 audit schema (it does not
> redefine it). Hazard 6 (`CLAUDE.md` §4 — no DataFusion/SQL leakage)
> constrains the surface: drift is exposed through the DSL, never as raw SQL.
>
> **Open for `accepted` (non-gating for `green`, per §9):** the verb-head
> fork is resolved; the remaining §9 items (range-clause vs stage token,
> mandatory vs default window, tie-break stability, cross-kind version
> aggregation) are maintainer confirmations. General audit aggregation
> stays out of scope (§3.2).

## 1. Summary

Expand Down
7 changes: 4 additions & 3 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

> Living document. Refreshed at phase boundaries (§4) and whenever
> a merged PR materially changes the *current state* in §3.
> Last updated: **2026-06-15** — RFC 0005 (Parquet storage) flipped to
> `green` (the RFC0005.6 row-group-sizing test landed). Earlier, on
> Last updated: **2026-06-15** — RFC 0005 (Parquet storage) and RFC 0010
> (audit-stream / drift queries) flipped to `green` (RFC0005.6 row-group
> sizing landed; RFC 0010's eight §5 drift scenarios all pass). Earlier, on
> 2026-06-14, RFC 0001, RFC 0008, and RFC 0011 flipped
> to `accepted` (maintainer sign-off). RFC 0001 reached `validated` first
> (C1/C2 pass authoritatively on the `benchmarks.md` §1 baseline hardware,
Expand Down Expand Up @@ -108,7 +109,7 @@ captured by B1/B2 (see `benchmarks.md` §2 / §7).
| 0007 | Querier (DataFusion + logs DSL) | **`validated`** |
| 0008 | WAL | **`accepted`** |
| 0009 | Background compaction | **`green`** — §5 RFC0009.1–.6 pass (manifest + `gc_orphans` + sweep; #206/#207/#208/#209); .7 (D2/D3 benches) deferred to `validated` |
| 0010 | Audit-stream / drift queries | `specified` — the `drift` surface is implemented; general audit aggregation deferred |
| 0010 | Audit-stream / drift queries | **`green`** — all 8 §5 scenarios pass (`crates/ourios-querier/tests/drift.rs`); discharges RFC 0001 H5.3; §9 items are `accepted`-gating; general audit aggregation deferred (§3.2) |
| 0011 | A1 re-scope | **`accepted`** |

**Crates — all ten product crates are implemented** (`ourios-core`,
Expand Down
Loading