DB-persisted, test-type-agnostic results store (runs/cases/results/metrics/findings) for browser-test + any QA harness — history, trends, flake, perf budgets
| Tier | operations |
| Role | unclassified (baselined) |
| Path | crates/operations/test-results |
| Edition | 2021 |
| Targets | operations_test_results, pg_test_results |
| Public items | 85 across 7 modules |
| Tests | 29 |
What it is for
operations-test-results — a DB-persisted, test-type-agnostic results store.
Records test runs, stable cases (with rename history), per-case results, tall metric samples (Web-Vitals & arbitrary numbers), and structured findings (a11y/usability), so history / trends / flake / perf-budgets become plain SQL — the thing stateless harnesses can't do.
Transport-agnostic by design (Gate 1.5 Q7): this is models + a Service(pool); an HTTP API and a web report UI are separate consumer layers. See docs/userstories/sprint-0.41-test-results-framework.md.
Capabilities
crate root
operations-test-results — a DB-persisted, test-type-agnostic results store.
| Item |
|---|
async fn ensure_schema(pool : & sqlx::PgPool) -> Result <()> |
budget (other)
Adaptive perf budgets — a metric's budget is derived from its own history
| Item |
|---|
pub const MIN_BASELINE: usize |
pub const CONFIDENT_N: usize |
pub const NOISE_THRESHOLD: f64 |
pub const DEFAULT_TOLERANCE: f64 |
fn percentile(values : & f64, p : f64) -> Option <f64> |
fn budget_check(history : & f64, percentile_p : f64, tolerance : f64, dir : Direction,) -> BudgetStats |
BudgetStats
Adaptive perf budgets — a metric's budget is derived from its own history
| Item |
|---|
pub struct BudgetStats |
BudgetVerdict
Adaptive perf budgets — a metric's budget is derived from its own history
| Item |
|---|
pub enum BudgetVerdict |
Direction
Adaptive perf budgets — a metric's budget is derived from its own history
| Item |
|---|
pub enum Direction |
fn metric_direction(name : & str) -> Direction |
fn default_percentile(dir : Direction) -> f64 |
Result
Error type for operations-test-results.
| Item |
|---|
pub type Result<T>: std::result::Result <T, TestResultsError> |
TestResultsError
Error type for operations-test-results.
| Item |
|---|
pub enum TestResultsError |
flake (other)
Flake classification over a test case's result history — the marquee
| Item |
|---|
pub const MIN_SAMPLES: i64 |
pub const RECENT_WINDOW: usize |
pub const FLIP_THRESHOLD: i64 |
FlakeClass
Flake classification over a test case's result history — the marquee
| Item |
|---|
pub enum FlakeClass |
FlakeClass :: fn as_str(self) -> & 'static str |
FlakeStats
Flake classification over a test case's result history — the marquee
| Item |
|---|
pub struct FlakeStats |
fn flake_stats(statuses : & ResultStatus) -> FlakeStats |
models (other)
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub const NIL_TENANT: Uuid |
fn current_key(suite : & str, name : & str) -> Result <String> |
fn unit_for(metric_name : & str) -> & 'static str |
CompleteResultInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct CompleteResultInput |
CompleteRunInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct CompleteRunInput |
CreateRunInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct CreateRunInput |
CreateRunInput :: fn embedded(suite : impl Into <String>) -> Self |
FindingInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct FindingInput |
MetricInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct MetricInput |
MetricSample
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct MetricSample |
MetricSample :: fn id(& self) -> Uuid |
RecordMetricInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct RecordMetricInput |
RecordResultInput
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct RecordResultInput |
ResultStatus
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub enum ResultStatus |
ResultStatus :: fn as_str(self) -> & 'static str |
ResultStatus :: fn from_token(s : & str) -> Result <Self> |
RunStatus
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub enum RunStatus |
RunStatus :: fn as_str(self) -> & 'static str |
RunStatus :: fn from_token(s : & str) -> Result <Self> |
TestCase
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct TestCase |
TestCase :: fn id(& self) -> Uuid |
TestCase :: fn created_at(& self) -> DateTime <Utc> |
TestCase :: fn updated_at(& self) -> DateTime <Utc> |
TestFinding
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct TestFinding |
TestFinding :: fn id(& self) -> Uuid |
TestKind
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub enum TestKind |
TestKind :: fn as_str(self) -> & 'static str |
TestKind :: fn from_token(s : & str) -> Result <Self> |
TestResult
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct TestResult |
TestResult :: fn id(& self) -> Uuid |
TestRun
Domain models + pure helpers for the test-results library crate.
| Item |
|---|
pub struct TestRun |
TestRun :: fn id(& self) -> Uuid |
PostgresTestResultsRepository:PostgresTestResultsRepository
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
pub struct PostgresTestResultsRepository |
PostgresTestResultsRepository:create
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn create_run(& self, input : CreateRunInput) -> Result <TestRun> |
PostgresTestResultsRepository:findings
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn findings_for_run(& self, run_id : Uuid) -> Result <Vec <TestFinding>> |
PostgresTestResultsRepository:finish
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn finish_run(& self, run_id : Uuid, status : RunStatus) -> Result <()> |
PostgresTestResultsRepository:get
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn get_run(& self, tenant_id : Uuid, run_id : Uuid) -> Result <Option <TestRun>> |
PostgresTestResultsRepository:list
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn list_runs(& self, tenant_id : Uuid, project : Option <& str>, suite : Option <& str>, before : Option <(DateTime <Utc>, Uuid)>, limit : i64,) -> Result <Vec <TestRun>> |
PostgresTestResultsRepository:metrics
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn metrics_for_run(& self, run_id : Uuid) -> Result <Vec <MetricSample>> |
PostgresTestResultsRepository:new
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: fn new(pool : PgPool) -> Self |
PostgresTestResultsRepository:recent
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn recent_results(& self, tenant_id : Uuid, project : & str, current_key : & str, limit : i64,) -> Result <Vec <TestResult>> |
PostgresTestResultsRepository :: async fn recent_metrics(& self, name : & str, limit : i64) -> Result <Vec <MetricSample>> |
PostgresTestResultsRepository:record
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn record_result(& self, input : RecordResultInput) -> Result <TestResult> |
PostgresTestResultsRepository :: async fn record_metric(& self, input : RecordMetricInput) -> Result <MetricSample> |
PostgresTestResultsRepository :: async fn record_complete_run(& self, input : CompleteRunInput) -> Result <TestRun> |
PostgresTestResultsRepository:results
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn results_for_run(& self, run_id : Uuid) -> Result <Vec <TestResult>> |
PostgresTestResultsRepository:upsert
Postgres-backed TestResultsRepository. Uses runtime sqlx::query (no
| Item |
|---|
PostgresTestResultsRepository :: async fn upsert_case(& self, tenant_id : Uuid, project : & str, suite : & str, kind : TestKind, current_key : & str, display_name : & str,) -> Result <TestCase> |
TestResultsRepository
Storage abstraction for the test-results sink. The Postgres impl lives in
| Item |
|---|
pub trait TestResultsRepository |
TestResultsService:TestResultsService
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
pub struct TestResultsService |
TestResultsService:case
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn case_flake(& self, tenant_id : Uuid, project : & str, suite : & str, name : & str, window : i64,) -> Result <crate::flake::FlakeStats> |
TestResultsService:create
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn create_run(& self, input : CreateRunInput) -> Result <TestRun> |
TestResultsService:findings
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn findings_for_run(& self, run_id : Uuid) -> Result <Vec <TestFinding>> |
TestResultsService:finish
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn finish_run(& self, run_id : Uuid, status : RunStatus) -> Result <()> |
TestResultsService:get
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn get_run(& self, tenant_id : Uuid, run_id : Uuid) -> Result <Option <TestRun>> |
TestResultsService:list
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn list_runs(& self, tenant_id : Uuid, project : Option <& str>, suite : Option <& str>, before : Option <(DateTime <Utc>, Uuid)>, limit : i64,) -> Result <Vec <TestRun>> |
TestResultsService:metric
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn metric_budget(& self, name : & str, p : Option <f64>, window : i64,) -> Result <crate::budget::BudgetStats> |
TestResultsService:metrics
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn metrics_for_run(& self, run_id : Uuid) -> Result <Vec <MetricSample>> |
TestResultsService:new
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: fn new(pool : PgPool) -> Self |
TestResultsService:recent
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn recent_results(& self, tenant_id : Uuid, project : & str, suite : & str, name : & str, limit : i64,) -> Result <Vec <TestResult>> |
TestResultsService :: async fn recent_metrics(& self, name : & str, limit : i64) -> Result <Vec <MetricSample>> |
TestResultsService:record
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn record_case_result(& self, run_id : Uuid, tenant_id : Uuid, project : & str, suite : & str, kind : TestKind, name : & str, status : ResultStatus, duration_ms : Option <i32>, error : Option <String>, metadata : Json,) -> Result <TestResult> |
TestResultsService :: async fn record_metric(& self, input : RecordMetricInput) -> Result <MetricSample> |
TestResultsService :: async fn record_complete_run(& self, input : CompleteRunInput) -> Result <TestRun> |
TestResultsService:results
TestResultsService — the public entry point. Transport-agnostic (Gate 1.5
| Item |
|---|
TestResultsService :: async fn results_for_run(& self, run_id : Uuid) -> Result <Vec <TestResult>> |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
operations_test_results
budgeterrorsflakemodelspostgresrepositoryservice
flowchart TD n_operations_test_results["operations_test_results"] n_operations_test_results --> n_budget["budget"] n_operations_test_results --> n_errors["errors"] n_operations_test_results --> n_flake["flake"] n_operations_test_results --> n_models["models"] n_operations_test_results --> n_postgres["postgres"] n_operations_test_results --> n_repository["repository"] n_operations_test_results --> n_service["service"]
Public surface
`crate root`
| Item | What it is |
|---|---|
async fn ensure_schema(pool : & sqlx::PgPool) -> Result <()> | Apply the crate's schema (idempotent migrations, in order) to pool |
`budget`
| Item | What it is |
|---|---|
pub const MIN_BASELINE: usize | Below this many baseline samples we can't judge. |
pub const CONFIDENT_N: usize | Below this many, a would-be breach is only LowConfidence (p90≈max at tiny N). |
pub const NOISE_THRESHOLD: f64 | Relative spread (p90-p50)/p50 above which the metric is "noisy". |
pub const DEFAULT_TOLERANCE: f64 | Default tolerance band. |
pub enum Direction | Which way is "good" for a metric. |
fn metric_direction(name : & str) -> Direction | Infer a metric's direction from its name (lower-is-better default). |
fn default_percentile(dir : Direction) -> f64 | The percentile that makes sense as the budget edge for a direction. |
pub enum BudgetVerdict | — |
pub struct BudgetStats | — |
fn percentile(values : & f64, p : f64) -> Option <f64> | Nearest-rank percentile (p in 0..=100) |
fn budget_check(history : & f64, percentile_p : f64, tolerance : f64, dir : Direction,) -> BudgetStats | Check the newest sample (history0) against a budget derived from the rest (history1..) |
`errors`
| Item | What it is |
|---|---|
pub enum TestResultsError | Errors surfaced by the test-results library crate. |
pub type Result<T>: std::result::Result <T, TestResultsError> | Convenience alias. |
`flake`
| Item | What it is |
|---|---|
pub const MIN_SAMPLES: i64 | Below this many non-skipped outcomes we can't classify (Gate 1.5 Q4). |
pub const RECENT_WINDOW: usize | A failure within this many most-recent considered outcomes counts as "recent". |
pub const FLIP_THRESHOLD: i64 | Min flips for an active flaky verdict (Gate 1.5 Q5). |
pub enum FlakeClass | Reliability verdict for a test case. |
FlakeClass :: fn as_str(self) -> & 'static str | — |
pub struct FlakeStats | Flake statistics for one case over a window of recent results. |
fn flake_stats(statuses : & ResultStatus) -> FlakeStats | Classify a case from its result history |
`models`
| Item | What it is |
|---|---|
pub const NIL_TENANT: Uuid | Nil tenant used for embedded / single-dev mode (Gate 1.5 Q8 — tenant_id is NOT NULL with this default, so there is no nullable-uniqueness footgun). |
pub enum RunStatus | Lifecycle of a whole run (append-only; only finish_run moves it off Running) |
RunStatus :: fn as_str(self) -> & 'static str | Canonical lowercase token stored in the DB status column. |
RunStatus :: fn from_token(s : & str) -> Result <Self> | Parse a DB/API token back into a status. |
pub enum ResultStatus | Outcome of a single test case within a run. |
ResultStatus :: fn as_str(self) -> & 'static str | — |
ResultStatus :: fn from_token(s : & str) -> Result <Self> | — |
pub enum TestKind | What kind of test produced a result |
TestKind :: fn as_str(self) -> & 'static str | — |
TestKind :: fn from_token(s : & str) -> Result <Self> | — |
fn current_key(suite : & str, name : & str) -> Result <String> | Build the stable current_key for a test case from its suite + name: "suite::name", each side trimmed |
fn unit_for(metric_name : & str) -> & 'static str | Infer the canonical unit for a known metric name (tall metric_sample, Gate 1.5 Q1) |
pub struct TestRun | One execution of a suite (append-only; Q6). |
TestRun :: fn id(& self) -> Uuid | — |
pub struct TestCase | Stable identity of a test across runs/renames (Q2). |
TestCase :: fn id(& self) -> Uuid | — |
TestCase :: fn created_at(& self) -> DateTime <Utc> | — |
TestCase :: fn updated_at(& self) -> DateTime <Utc> | — |
pub struct TestResult | Outcome of one case within a run. |
TestResult :: fn id(& self) -> Uuid | — |
pub struct MetricSample | One numeric observation (tall store; Q1). |
MetricSample :: fn id(& self) -> Uuid | — |
pub struct TestFinding | Structured finding (a11y/usability/...) attached to a result (Q10). |
TestFinding :: fn id(& self) -> Uuid | — |
pub struct CreateRunInput | Start a run |
CreateRunInput :: fn embedded(suite : impl Into <String>) -> Self | Minimal embedded-mode run: nil tenant, default project. |
pub struct RecordResultInput | Record one case outcome within a run. |
pub struct RecordMetricInput | Record one numeric metric sample. |
pub struct FindingInput | A structured finding to attach to a result (a11y/usability/...). |
pub struct MetricInput | One metric within a complete-run report. |
pub struct CompleteResultInput | One result (with its nested metrics + findings) in a complete-run report. |
pub struct CompleteRunInput | A whole run reported in one shot — persisted atomically by record_complete_run (all-or-nothing; the fat-ingest path, Gate 1.5 0.42-Q1). |
`postgres`
| Item | What it is |
|---|---|
pub struct PostgresTestResultsRepository | Postgres implementation of the sink. |
PostgresTestResultsRepository :: fn new(pool : PgPool) -> Self | — |
PostgresTestResultsRepository :: async fn create_run(& self, input : CreateRunInput) -> Result <TestRun> | — |
PostgresTestResultsRepository :: async fn finish_run(& self, run_id : Uuid, status : RunStatus) -> Result <()> | — |
PostgresTestResultsRepository :: async fn upsert_case(& self, tenant_id : Uuid, project : & str, suite : & str, kind : TestKind, current_key : & str, display_name : & str,) -> Result <TestCase> | — |
PostgresTestResultsRepository :: async fn record_result(& self, input : RecordResultInput) -> Result <TestResult> | — |
PostgresTestResultsRepository :: async fn record_metric(& self, input : RecordMetricInput) -> Result <MetricSample> | — |
PostgresTestResultsRepository :: async fn recent_results(& self, tenant_id : Uuid, project : & str, current_key : & str, limit : i64,) -> Result <Vec <TestResult>> | — |
PostgresTestResultsRepository :: async fn record_complete_run(& self, input : CompleteRunInput) -> Result <TestRun> | — |
PostgresTestResultsRepository :: async fn recent_metrics(& self, name : & str, limit : i64) -> Result <Vec <MetricSample>> | — |
PostgresTestResultsRepository :: async fn get_run(& self, tenant_id : Uuid, run_id : Uuid) -> Result <Option <TestRun>> | — |
PostgresTestResultsRepository :: async fn list_runs(& self, tenant_id : Uuid, project : Option <& str>, suite : Option <& str>, before : Option <(DateTime <Utc>, Uuid)>, limit : i64,) -> Result <Vec <TestRun>> | — |
PostgresTestResultsRepository :: async fn results_for_run(& self, run_id : Uuid) -> Result <Vec <TestResult>> | — |
PostgresTestResultsRepository :: async fn metrics_for_run(& self, run_id : Uuid) -> Result <Vec <MetricSample>> | — |
PostgresTestResultsRepository :: async fn findings_for_run(& self, run_id : Uuid) -> Result <Vec <TestFinding>> | — |
`repository`
| Item | What it is |
|---|---|
pub trait TestResultsRepository | CRUD seam for runs/cases/results/metrics |
`service`
| Item | What it is |
|---|---|
pub struct TestResultsService | DB-backed test-results sink + minimal read side. |
TestResultsService :: fn new(pool : PgPool) -> Self | — |
TestResultsService :: async fn create_run(& self, input : CreateRunInput) -> Result <TestRun> | Start a run (status = running). |
TestResultsService :: async fn finish_run(& self, run_id : Uuid, status : RunStatus) -> Result <()> | Finalize a run. |
TestResultsService :: async fn record_case_result(& self, run_id : Uuid, tenant_id : Uuid, project : & str, suite : & str, kind : TestKind, name : & str, status : ResultStatus, duration_ms : Option <i32>, error : Option <String>, metadata : Json,) -> Result <TestResult> | Ergonomic one-call recorder: resolve the stable test_case (suite::name), then record the result linked to it |
TestResultsService :: async fn record_metric(& self, input : RecordMetricInput) -> Result <MetricSample> | Record a numeric metric (unit inferred from the name when omitted). |
TestResultsService :: async fn record_complete_run(& self, input : CompleteRunInput) -> Result <TestRun> | Persist a whole run (run + results + metrics + findings) atomically — the fat-ingest path used by the HTTP API's POST /runs/complete. |
TestResultsService :: async fn recent_results(& self, tenant_id : Uuid, project : & str, suite : & str, name : & str, limit : i64,) -> Result <Vec <TestResult>> | Newest-first results for a stable suite::name (flake/trend foundation). |
TestResultsService :: async fn recent_metrics(& self, name : & str, limit : i64) -> Result <Vec <MetricSample>> | Newest-first samples of a metric by name. |
TestResultsService :: async fn get_run(& self, tenant_id : Uuid, run_id : Uuid) -> Result <Option <TestRun>> | A single run by id (tenant-scoped). |
TestResultsService :: async fn list_runs(& self, tenant_id : Uuid, project : Option <& str>, suite : Option <& str>, before : Option <(DateTime <Utc>, Uuid)>, limit : i64,) -> Result <Vec <TestRun>> | Newest-first page of runs (keyset; before = prev page's last (started_at, id)). |
TestResultsService :: async fn metric_budget(& self, name : & str, p : Option <f64>, window : i64,) -> Result <crate::budget::BudgetStats> | Adaptive budget for a metric: derive a budget from its recent history and check the newest sample |
TestResultsService :: async fn case_flake(& self, tenant_id : Uuid, project : & str, suite : & str, name : & str, window : i64,) -> Result <crate::flake::FlakeStats> | Classify a case's flakiness from its recent results (newest-first). |
TestResultsService :: async fn results_for_run(& self, run_id : Uuid) -> Result <Vec <TestResult>> | Results / metrics / findings of one run (for the detail view). |
TestResultsService :: async fn metrics_for_run(& self, run_id : Uuid) -> Result <Vec <MetricSample>> | — |
TestResultsService :: async fn findings_for_run(& self, run_id : Uuid) -> Result <Vec <TestFinding>> | — |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
PostgresTestResultsRepository | postgres::PostgresTestResultsRepository |
TestResultsRepository | repository::TestResultsRepository |
TestResultsService | service::TestResultsService |
TestRun | crate::models::TestRun |
{Result,TestResultsError} | errors::{Result,TestResultsError} |
{budget_check,metric_direction,percentile,BudgetStats,BudgetVerdict,Direction,} | budget::{budget_check,metric_direction,percentile,BudgetStats,BudgetVerdict,Direction,} |
{current_key,unit_for,CompleteResultInput,CompleteRunInput,CreateRunInput,FindingInput,MetricInput,MetricSample,RecordMetricInput,RecordResultInput,ResultStatus,RunStatus,TestCase,TestFinding,TestKind,TestResult,TestRun,NIL_TENANT,} | models::{current_key,unit_for,CompleteResultInput,CompleteRunInput,CreateRunInput,FindingInput,MetricInput,MetricSample,RecordMetricInput,RecordResultInput,ResultStatus,RunStatus,TestCase,TestFinding,TestKind,TestResult,TestRun,NIL_TENANT,} |
{flake_stats,FlakeClass,FlakeStats} | flake::{flake_stats,FlakeClass,FlakeStats} |
Boundary
Reaches into foundation.
Shares tier operations with 40 other crates: operations-approval-workflow, operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, … (40 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | operations |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/operations/test-results |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_operations["operations"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
chrono | ^0.4 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | no | always |
thiserror | ^2 | — | no | always |
tracing | ^0.1 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full | no | always |
Build. None.
Depended on by. 3 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_test_results["application-test-results"] -->|uses| SELF n_operations_e2e_harness["operations-e2e-harness"] -->|uses| SELF n_operations_test_results_ingest["operations-test-results-ingest"] -->|uses| SELF SELF["operations-test-results"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
| Feature | Enables | On by default |
|---|---|---|
default | postgres | yes |
postgres | — | yes |
flowchart LR n_default["default"] --> n_postgres["postgres"] n_postgres["postgres"]
Targets
| Kind | Name | Source |
|---|---|---|
| lib | operations_test_results | `src/lib.rs` |
| test | pg_test_results | `tests/pg_test_results.rs` |
Error model
| Error type | Named by |
|---|---|
TestResultsError | Result |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | yes |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
3 workspace crates depend on this one: application-test-results, operations-e2e-harness, operations-test-results-ingest.
Verification
| Kind | Count |
|---|---|
| Unit tests | 24 |
| Integration tests | 5 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 1 | 0 | 1 |
budget | 11 | 0 | 7 |
errors | 2 | 0 | 5 |
flake | 6 | 0 | 4 |
models | 18 | 0 | 30 |
postgres | 1 | 0 | 0 |
repository | 1 | 0 | 0 |
service | 1 | 0 | 3 |
What the tests establish, by name:
a_complete_run_carries_unsupported_beside_passed_and_failed_and_reads_back—tests/pg_test_results.rsmigration_002_widens_a_database_created_by_001_alone—tests/pg_test_results.rsrecord_complete_run_persists_atomically—tests/pg_test_results.rssink_records_run_result_metric_and_reads_back—tests/pg_test_results.rsupsert_case_is_stable_across_runs—tests/pg_test_results.rsbreach_when_latest_far_over_on_tight_baseline—src/budget.rsdirection_inference—src/budget.rshigher_better_floor—src/budget.rsnoisy_baseline_breach_is_low_confidence—src/budget.rspercentile_nearest_rank—src/budget.rstoo_few_baseline_is_unknown—src/budget.rswithin_when_latest_under_budget—src/budget.rsall_fail_is_broken—src/flake.rsall_pass_is_stable—src/flake.rsalternating_is_flaky—src/flake.rslone_old_failure_decays_to_stable—src/flake.rspasses_with_errors_no_failures_is_erroring—src/flake.rsskipped_excluded_from_denominator—src/flake.rstoo_few_samples_is_unknown—src/flake.rscurrent_key_rejects_blank_sides—src/models.rscurrent_key_trims_and_joins—src/models.rsmigration_002s_status_list_and_the_enum_agree_both_ways—src/models.rsresult_status_rejects_unknown—src/models.rsresult_status_round_trips—src/models.rsrun_status_rejects_unknown—src/models.rsrun_status_round_trips—src/models.rstest_kind_rejects_unknown—src/models.rstest_kind_round_trips—src/models.rsunit_for_known_metrics—src/models.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 54 | 85 |
Public modules with a //! block | 7 | 7 |
pie showData
title Public items with rustdoc
"Documented" : 54
"No rustdoc detected" : 31
Metrics
| Metric | Value |
|---|---|
| Rust source files | 8 |
| Source lines | 1711 |
| Code lines | 1396 |
| Public API items | 85 |
| Public modules | 7 |
| Tests | 29 |
| Examples | 0 |
| Cargo features | 2 |
| Direct runtime dependencies | 9 |
| Workspace reverse dependencies | 3 |
pie showData
title Public API by kind
"constant" : 8
"enum" : 7
"function" : 8
"method" : 44
"struct" : 16
"trait" : 1
"type alias" : 1
pie showData
title Rust source composition
"Code" : 1396
"Blank or comment" : 315
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.