Skip to content

Harnessa evidence plane

Baseline source matrix

This matrix records the implementation at baseline 233678767bed6dde7deb10b30eb547c0509dfd31 before M11 changes. A source's own record remains authoritative; an evidence envelope is a provenance view and join, never a second task-state store.

Source Authoritative record and identifiers Delivery and replay Missing links in the baseline Adapter boundary
Harnessa task, specification, run, verification and review PostgreSQL Task.id/version, TaskTransition version pair, specification artifact revision/hash/base SHA, Run.id/attempt/fencing_token/source_revision/base_sha, VerificationEvidence, ReviewBundle, ReviewDecision, and IntegrationEvidence. DomainEvent has event/schema versions, organization/project/task/run IDs, per-task and per-project sequences, correlation/causation IDs, payload and retention deadline. Domain events commit with an outbox row. Redis is a rebuildable dispatch/stream projection; durable consumers use an inbox. Project event replay uses the persisted project sequence and retention boundary. There is no common typed link set or source, occurrence-time, content-hash, sensitivity/redaction, and idempotency envelope for every record. Some values are present only in payloads or adjacent rows; absent links must remain unknown. Existing lifecycle, specification, scheduler, verification and review services; DomainEvent/outbox/inbox remain the authority for lifecycle and stream state.
LiteLLM request telemetry Harnessa ModelRequestLedger is append-only and keyed by Harnessa request_id plus attempt/event; it includes project/task/run, route/model, optional LiteLLM request_identifier, token usage, usage_known, billed and estimated USD. It does not store prompts or completions. Harnessa owns budgets; LiteLLM is authoritative only for gateway-reported request telemetry. Each Harnessa attempt appends ledger events; expired reservations are conservatively reconciled by the worker. The baseline does not import late LiteLLM spend-log rows. No explicit typed link to the run's domain-event chain or a versioned import record for delayed/corrected gateway usage. An absent provider usage value cannot be interpreted as zero. LiteLLMModelRouter and ModelRequestLedger; add a bounded read-only usage-import adapter. Never write or replay model requests during reconciliation.
GitHub GitHubWebhookDelivery records app-scoped delivery ID, event/action, installation/repository IDs, payload hash/reference and processing state. GitHubSyncObject records the current reconciled issue/PR/check identity, task link, base/head and result state. EffectIntent owns outbound writes and stable keys. GitHub's current API is authoritative for remote state. Delivery IDs are unique per App; inbox/outbox workers retry with leases. A five-minute poll repairs missing or late PR/check/review/repository events; current PR state is fetched before acceptance. The webhook/sync/effect identifiers do not form one typed provenance join with model requests, tool calls, artifacts and evaluation records. A webhook receipt alone is not current remote truth. The baseline delivery row retains parsed payload needed for retry. GitHubAppClient, webhook inbox/outbox, GitHubWebhookProcessor, GitHubEffectReconciler; do not promote webhook payloads to task authority.
AG-UI AG-UI is a projection of Harnessa DomainEvent records. Event rows preserve task/run and project sequence; no AG-UI event can authorize a mutation. Redis carries rebuildable notifications. Browser SSE replays retained DB events by project cursor and resumes on reconnect; the stream does not start or cancel a run. The projection does not expose a common source/revision/hash/redaction envelope or link every stream event to gateway, GitHub, artifact and evaluation records. project_domain_event and the existing task event replay/stream routes; the browser receives only authorized, redacted projections.
MCP and tool calls Direct read-only MCP requests create MCPToolAudit rows with project, actor, server/tool/protocol, outcome, request/response hashes and duration. ACP tool-call activity is represented by normalized run.tool_* domain events and a provider tool_call_id. These are distinct invocation paths. The direct MCP route revalidates the grant after the remote call and stores hashes, not argument/result bodies. ACP events use the durable event outbox and replay path. Direct MCP audit rows lack task/run context; there is no shared typed tool-invocation reference joining either path to model request, GitHub effect and artifact records. Grant revocation and tool results must remain visible as separate facts. retrieval_routes/mcp_http for direct calls; ACP event normalization and ui_events for run activity. Never treat returned tool text as policy.
Artifacts RunArtifact identifies a project/task/run/fence, SHA-256 digest, media type, byte size and content-addressed storage key. Specification revisions and verifier outputs have their own revision/hash records. Artifact writes are content-addressed and private; unreferenced local CAS files are collected after an age bound. Verification records bind results to exact source revisions. The baseline has no bounded read-time checksum reconciliation or common artifact-to-GitHub/evaluation provenance view. A stored digest is metadata until the bytes are checked. LocalArtifactStore, scheduler publication and verification adapters. Artifact content is fetched only after project authorization and is never copied into general evidence metadata.
Evaluation and verification VerificationExecution and VerificationEvidence record verifier, source revision, manifest, outcome and artifact/content hashes; specification readiness and immutable review bundles/decisions are separate authorities. Verification is fenced and retryable under the run policy; review decisions bind to a bundle digest/head. No unified evaluation-record contract joins a score to its exact run, model requests, tool calls, harness, benchmark, seed, cost and artifact revisions. A score is not task completion or promotion authority. Verification and review services remain authoritative; M11 supplies typed fixture/import contracts, with later evaluation integrations adding adapters.
Harness² and skills No Harness² run importer, pinned source checkout, benchmark result table or versioned Harnessa skill-revision record exists at baseline. Existing run rows carry only a harness revision/digest; skill source is not yet linked to a run. No import/replay path exists. M11 must provide deterministic fixture contracts; M12/M14 provide later adapters and real runs. Upstream run/task IDs, benchmark/executor, recursion mode and k, candidate/probe/composition/adoption, judge result, source revision and artifact hashes need explicit, trust-labeled links. A versioned, fixture-tested import boundary only. Pin and verify upstream interfaces; imported files are immutable evidence, never mutable Harnessa state.

Upstream Harness² reference checked for the fixture boundary

The repository had no Harness² submodule or checkout. For a reproducible M11 fixture contract, upstream google-research/harness2 was inspected at commit 1cfe254e8d25b15f37048c3730134686abe60335 (the main head observed on 2026-10-23). At that commit its source tree contains harness2/core/{recursion,ledger,runmark,report}.py, harness2/benchmarks/{jobbench,lab,workbuddy}.py, and harness2/substrate/{opencode,codex}.py; its README documents OpenCode and Codex executors, JobBench (jb), LAB (lab), WorkBuddy-Bench (wb), and parallel/sequential recursion. Its run markers use a versioned .adapt_complete JSON file and include run ID/time and a harness fingerprint; its Python ledger records task ID, mode, k, model spend, and rollout/session labels. The output root is benchmark-specific (runs/lab, runs/jb, or runs/wb/<subset>), not a single cross-benchmark result schema. M11 therefore defines a Harnessa-owned fixture manifest and hashes every imported file rather than assuming an upstream universal export manifest.

This is a source-interface inspection, not a Harness² installation, executor smoke, benchmark run, license review, or provider-backed acceptance. No upstream code, benchmark, dataset, credential, or result artifact is added to Harnessa in M11. M12 must recheck this pin and the selected benchmark's license, setup requirements, exact result paths, executor support and data revision before enabling a real adapter.

M11 implementation and acceptance evidence

Read-side contract and adapters

GET /projects/{project_id}/evidence is a project-membership-protected projection over existing PostgreSQL source rows. It accepts task_id, run_id, source, revision, cursor, and a bounded limit (1–100). Membership is checked before reading; task and run IDs are checked against the selected project. Cursors encode the last (recorded_at, source_record_id) pair and are URL-safe. The TypeScript client is generated from the local FastAPI OpenAPI schema. The API exposes metadata and hashes only: model prompt/completion bodies, webhook payload JSON, tool arguments/results, and artifact bytes are omitted.

The version 2 CoreEvidenceEnvelope supplies typed known/unknown/redacted identifiers for organization, project, repository, task and revision, run/attempt, model request, tool invocation, webhook delivery, Git effect, artifact, evaluation, harness revision, and skill revision. Older envelopes remain valid with unknown defaults for newly added links. Native rows retain their existing IDs and authority. The response joins retained domain events, task transitions, runs, every model ledger event/attempt, artifact metadata, verification executions, GitHub effect intents and reconciled GitHub objects. Project-wide reads additionally include metadata-only direct MCP audits and webhook inbox receipts for linked repositories; task filters include webhook receipts only when a linked task/repository relation exists. ACP tool call IDs are extracted only from their redacted domain-event payload field.

Model summaries keep gateway billed spend, estimated spend and usage certainty distinct; provider-reported actuals are unknown unless the source reports them. Null is not coerced to zero. An unresolved model usage is marked pending_gateway_usage; failed webhook receipts are marked retryable; artifact hashes are marked checksum_unverified until a byte-level integrity check is run; GitHub objects are marked stale when their head differs from the latest run source revision. The existing M10 webhook retry/current-state reconciler remains the only GitHub repair path, and replay remains keyed by the App delivery ID. Late gateway usage reports are accepted in bounded batches only from project operators or administrators. They are explicitly unverified operator submissions, not authenticated provider evidence, and are labeled as such in the evidence projection. Each observation has a durable idempotency receipt; unmatched receipts receive exponential backoff and are retried by the worker in bounded batches every 30 seconds, up to 12 attempts. Ambiguous matches remain visible for operator correction. A unique match appends one usage_reconciled ledger event, guarded by a unique source-observation key, without rewriting earlier events or replaying model requests. Gateway billed and provider-reported amounts occupy separate columns and remain unknown when absent.

M11 defines Harness2ImportFixture and validate_harness2_fixture as a deterministic, untrusted boundary for M12. The fixture pins the upstream source revision, benchmark/task, executor and substrate, recursion mode, k, seed, result, candidate/judge revisions, candidate component tree, probe executions, composition/adoption state, and exact relative artifact paths, sizes, and SHA-256 digests. Unavailable fields remain typed unknown values. The validator rejects POSIX and Windows path traversal, duplicate paths, trust elevation, missing/extra files, and checksum or size mismatches. It does not execute Harness², persist a score, or promote imported results to Harnessa task outcomes.

Retention, export, and recovery contract

The provenance view is assembled from existing source-authoritative rows plus the durable gateway usage import receipt table. A new additive Alembic migration adds provider-reported spend, the reconciliation ledger event type, and source-observation retry state. Domain events are omitted after their stored retention deadline; the source rows remain governed by their existing per-source retention/deletion rules. An export must preserve row IDs, project/task/run references, event sequence, content hashes, source revision, and the artifact CAS volume together. Restore verification must compare artifact bytes with their declared SHA-256 and verify project-scoped foreign-key joins before serving provenance. Schema changes are additive and versioned; consumers ignore unknown links and retain unknown values instead of inventing defaults. Rollback downgrades this additive schema after stopping writers; historical source rows and ledger events are never rewritten, and deployments must retain gateway import exports before downgrade because the new receipt table is removed.

M11 acceptance state

Deterministic coverage validates cursor parsing, project-route authentication, known-versus-unknown envelope behavior, exact Harness² fixture checksums, rejection of path traversal/trust elevation, retryable late-usage imports, unique matching, duplicate-import idempotency, and sparse revision pagination. TypeScript API types are generated from the app's local OpenAPI document. The task inspector shows source, recorded time, revision, hash, import status, reconciliation status, and stale state; Browser Harness confirmed the unknown-spend labels and the checksum_unverified to verified integrity transition with its audit event. The final pnpm test acceptance passed on disposable PostgreSQL 16.13 and Redis 8.10.2. A live provider and authorized GitHub repository are not configured, so those are fixture-based adapter checks rather than live external acceptance.