IBEX Harness
DocsBenchmarksBlogChangelogRoadmap
GitHub
IBEX Harness

Documentation

Architecture Decision RecordsADR-0002: Repository foundation bootstrapADR-0003: Branch protection and merge policyADR-0004: Protobuf and code generation policyADR-0005: Postgres migration strategyADR-0006: Auth protobuf contract (`ibex.auth.v1`)ADR-0007: Auth token validation implementationADR-0008: Security scanning and CI quality gatesADR-0009: Permission bitmap layoutADR-0010: Cryptography policyADR-0011: Proxy auth gRPC client and middlewareADR-0012: Proxy request normalization (OpenAI chat)ADR-0013: Proxy input validation and stable error envelopeADR-0014: Core domain migration sequencingADR-0015: Proxy rate limit skeleton (Phase 1)ADR-0016: Proxy agent identity verification (Phase 1)ADR-0017: Request ID and trace context strategy (Phase 1)ADR-0018: Graceful shutdown contract (Phase 1)ADR-0019: OpenTelemetry provider configuration (Phase 1)ADR-0020: Shared package boundaries — `packages/config` and `packages/apierror`ADR-0021: Prometheus Metric Catalog (Phase 1)ADR-0022: Health check contract (Phase 1)ADR-0023: Docs site architecture (Phase 1.5)ADR-0024: Benchmark data publishing modelADR-0025: LLM provider abstractionADR-0026: OpenAI client designADR-0027: Streaming dual-write strategyADR-0028: Auth cache designADR-0029: Token revocation propagation via Redis pub/subADR-0030: Directive versioning strategyADR-0031: System prompt injection strategyADR-0032: Session data model and retentionADR-0033: ClickHouse llm_traces schema and retentionADR-0034: Proxy overhead performance measurement methodologyADR-0035: Chat Idempotency-Key Redis dedupeADR-0038: Context assembly service design and gRPC contractADR-0039: Proxy Postgres ownership for session and directive storesADR-0040: Anthropic provider adapterADR-0041: Model capability registryADR-0042: Self-hosted OpenAI-compatible LLM adapterADR-0043: Tokenizer registry architectureADR-0044: Non-streaming response pipelineADR-0045: Streaming response transformationADR-0046: Embedder interface and profile registryADR-0047: Memory temporal validity foundationADR-0048: Memory multi-label categoriesADR-0049: Memory relationship graph readinessADR-0050: MCP server skeleton (transport, auth, audit)ADR-0051: Local LGTM observability stack (Phase 2.5 exit pull-forward)ADR-0052: Memory schema v2 expand (HNSW, quality columns)ADR-0053: Vector store abstraction and composite scoring v2ADR-0054: In-process Presidio PII detection in memoryADR-0055: Memory write-path exact and near-duplicate dedupADR-0056: Temporal-interval-aware conflict detectionADR-0057: Memory write-path persistence and orchestrationADR-0058: Semantic search FTS fallback triggerADR-0059: Hot cache read pathADR-0060: Memory service tenant isolation architectureADR-0061: Retrieval-quality benchmark methodologyADR-0062: Worker task observability and dead-letter handlingADR-0063: Extraction output schema v2ADR-0064: Extraction provider registry and batch executionADR-0065: Extraction batch idempotency and turn pointer orderingADR-0066: Extraction quality evaluation harnessADR-0067: Context capability catalog generate-and-diff for token budgetsADR-0068: Composite scoring-time relevance gateADR-0069: Context packer bounded DP knapsackADR-0070: Context formatting locked ordering and session nonceADR-0071: Context assembly gRPC degradation ladder and retrieval deadlineADR-0072: Extraction enqueue via worker HTTP (not Celery Redis wire format)ADR-0073: Organization Lifecycle and Cascading SuspensionADR-0074 Provider Credential StorageADR-0075 Per-Org Model Routing PolicyADR-0076: Circuit Breaker per ProviderADR-0077: Provider Fallback RoutingADR-0078: Operator runtime topology & environment contract (4.P.0)ADR-0079: Operator session RS256 dual-verify and TOTP step-upIBEX Console service rename and boundaryADR-0081: Fail-closed Proxy runtime controlsD2 metadata-only trace read contractD2 publication, identity, query, and lifecycle contractG0 principal, agent binding, and idempotency contractEvidence relay daemon and session-fence authority (local, default-off)Read-only MCP operator gateway and gateway-side authorization boundary (local, default-off)
ADRs›D2 publication, identity, query, and lifecycle contract
ADRs

D2 publication, identity, query, and lifecycle contract

Canonical run identity, outbox publication watermarks, P3 field tiers, P4 query grammar, and interim score boundary for 4.D.2.

ADR-0083: D2 publication, identity, query, and lifecycle contract

  • Status: accepted for in-repo 4.D.2 contract assurance on PR #911
  • Date: 2026-09-27
  • Issues: #910, #911
  • Supersedes in part: ADR-0082 watermark/LIMIT 1 detail ambiguity

Decision

Canonical read source

The initial D2 read plane is PostgreSQL ibex_core.evidence_* (runs, spans, events, assembly metrics, score candidates, directive snapshots, tool audits, outbox). ClickHouse and object storage are not authoritative for this slice.

Identity and cardinality

  • run_id (evidence_runs.id) is the immutable detail identity.
  • trace_id is a display/grouping field. Multiple requests under one trace are allowed (UNIQUE (org_id, trace_id, request_id)).
  • Canonical detail route: GET /v1/operator/traces/runs/{run_id}.
  • Trace-level route GET /v1/operator/traces/{trace_id} returns a deterministic multi-run listing (stable (started_at DESC, run_id DESC)), never a silent single arbitrary run.
  • No join by session, timestamp proximity, row position, or “current” directive.

Publication watermark and visibility

  • Outbox aggregate identity is request_id (evidence_outbox.aggregate_id).
  • Read DTOs expose:
    • publication_state: published | partial | pending | failed | poison | unavailable
    • source_watermark: persisted aggregate sequence string when known; otherwise honest not_provided / unavailable — never observed_at as a watermark
    • ingestion_lag_ms when both delivered_at/created_at and observation time allow measurement
    • matched_count, returned_count, truncated on list envelopes
  • Mapping from outbox delivery_status:
    • all relevant rows delivered → published
    • any pending/in_flight with some delivered → partial
    • only pending/in_flight → pending
    • failed → failed
    • poison → poison
    • no outbox row → unavailable (not empty-success “complete”)
  • Duplicate/delayed/reordered outbox records must not invent completeness; missing publication stays partial/unavailable.

P3 metadata / content field tiers

TierExamplesGate
Metadataidentity, status, schema/capture/sample/completeness, publication, badgesOPERATOR_METADATA_READ
Redacted contentfuture sanitized payloadsP3 redaction + audit + step-up
Restricted contentraw prompts/completions/tool argsDisabled in D2

Lifecycle fields (retention, legal hold, redaction version, deletion/tombstone) are authoritative only when a canonical source exists. Otherwise the DTO keeps unknown / unavailable and the residual register records the gap. Never derive retention from completeness or ClickHouse TTL.

P4 query grammar

  • Versioned allowlist (operator.trace-query.v1): status, time range, trace_id / request_id / run_id / session_id, error class, completeness, capture mode.
  • Filter-before-pagination; sort (started_at DESC, trace_id DESC, run_id DESC); max range 7 days; max page 100; statement timeout; HMAC cursor binds tenant, normalized query, bounds, sort, expiry.
  • Sessions/failures Explore tabs remain deferred until backed by canonical result types.
  • Autocomplete/facets: only allowlisted bounded metadata facets with budgets; otherwise unavailable.

Score schema / interim_v1

Persisted score rows may be read when present. interim_v1 is labelled interim and must not render a five-term waterfall. Weights 0.40/0.25/0.20/0.10/0.05 stay deferred until writer, payload, API, and UI agree on one versioned formula.

C5 conditionality

This D2 slice is snapshot-only. It makes no streaming claim; C5 soak is not a dependency for metadata/publication contract assurance.

Consequences

  • Console live Explore links by run_id for detail; trace pages list related runs.
  • P6/hosted AuthService topology remains residual until staging artifacts exist; local tests are contract-tested only.
  • Raw/replay/actions stay disabled with explicit unavailable reasons.

Evidence basis

  • infra/migrations/postgres/000036_evidence_plane.up.sql evidence tables + outbox.
  • packages/evidenceoutbox/store.go aggregate_id = request_id.
  • Residual register: infra/assurance/p6/d2-residual-register.json.
  • Milestone: web/content/roadmap/phase-4-multi-provider/milestones/4.d.2-explore-provenance-trace-inspector.mdx.

Was this page helpful?

Edit on GitHub

Last updated on

PreviousD2 metadata-only trace read contractNextG0 principal, agent binding, and idempotency contract

On this page

  • Decision
  • Canonical read source
  • Identity and cardinality
  • Publication watermark and visibility
  • P3 metadata / content field tiers
  • P4 query grammar
  • Score schema / interim_v1
  • C5 conditionality
  • Consequences
  • Evidence basis
0%