3.9 KiB
Evidence Chain Contract
The evidence chain contract fixes the MVP relationship between L1 audit records and L4 agent or worker evidence without changing either implementation surface. It is a fixture-level contract for now: services may persist the records in their existing tables, while the chain example binds the identities that must not split later.
Minimal ID Relationship
Every MVP evidence chain has one operationId, one traceId, one or more
auditId values, and one or more evidenceId values.
operationIdis the workflow anchor. It must match thehardwareOperation.operationId, every chainauditEvents[].operationId, everytraceEvents[].operationId, and everyevidenceRecords[].operationId.traceIdis the request and execution correlation ID. It must match everyauditEvents[].traceIdand everytraceEvents[].traceId. Because the L0evidence-recordschema does not carrytraceIdat the top level, MVP evidence records must copy it toevidenceRecords[].metadata.traceId.auditIdis unique per audit event in a chain. Each evidence record must setmetadata.producedByAuditIdto an audit event in the same fixture. The audit event that records evidence must target that evidence record withtargetType: "evidence_record"andtargetId: <evidenceId>.evidenceIdis the stable artifact record ID. It must be unique in a chain, belong to the sameprojectId,operationId, andenvironment, and point to a content-addressed artifact throughuri,sha256, and optionalsizeBytes.
The same relationship applies whether the producer is a hardware trusted loop or an agent automation loop. Agent and worker IDs are optional for hardware-only chains, but when present they must be carried consistently by the operation, trace events, and evidence records.
MVP Required Fields
The fixture root is not a database table. It exists to verify cross-record relationships and must include:
chainIdschemaVersionscenarioprojectIdoperationIdtraceIdenvironmenthardwareOperationauditEventstraceEventsevidenceRecords
hardwareOperation must satisfy the L0 hardware operation required fields:
operationId, projectId, gatewaySessionId, resourceId, capabilityId,
requestedBy, status, environment, requestedAt, and updatedAt.
Each MVP auditEvents[] entry must satisfy the L0 audit event required fields
and additionally include projectId, operationId, and outcome so the audit
stream can be joined back to the operation without service-specific inference.
Each MVP traceEvents[] entry must satisfy the L0 trace event required fields
and additionally include operationId.
Each MVP evidenceRecords[] entry must satisfy the L0 evidence record required
fields and additionally include:
metadata.traceIdmetadata.producedByAuditId
Agent automation chains must also include agentSessionId and
workerSessionId at the fixture root, on the hardware operation, on trace
events, and on evidence records.
Future Enhancements
The first version intentionally avoids heavier guarantees. Later contracts may add:
- canonical chain hashing, previous-record links, and signatures
- attestation data from real hardware roots of trust
- retention policy, storage tier, and artifact redaction metadata
- richer OpenTelemetry or JSON-LD correlation fields
- multiple operations under one trace with explicit parent-child edges
- policy decision records for agent authorization and remediation
Those additions must preserve the MVP identity bindings above.
Fixtures
The MVP fixture set lives under protocol/examples/evidence-chain:
fixtures/hardware-trusted-loop.jsonfixtures/agent-automation-loop.jsonartifacts/hardware-trusted-measurement.jsonartifacts/agent-automation-report.json
Validate the examples with:
node scripts/validate-evidence-chain.mjs