docs: add evidence chain fixtures

This commit is contained in:
HWLAB Code Queue
2026-05-21 15:04:27 +00:00
parent e039deea10
commit 440ef6adaf
7 changed files with 934 additions and 0 deletions
@@ -0,0 +1,12 @@
# Evidence Chain Examples
These fixtures model the minimum MVP chain between hardware operations, audit
events, trace events, and evidence records.
- `fixtures/hardware-trusted-loop.json` covers the hardware trusted closed loop.
- `fixtures/agent-automation-loop.json` covers the agent automation closed loop.
- `artifacts/` contains small content-addressed files referenced by the
evidence records.
Run `node scripts/validate-evidence-chain.mjs` from the repository root to
verify field completeness, cross-record references, and artifact checksums.
@@ -0,0 +1,13 @@
{
"format": "hwlab.agent-report.v1",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"result": "succeeded",
"steps": [
"selected capability",
"ran firmware smoke command",
"persisted evidence"
],
"createdAt": "2026-05-21T00:20:06.000Z"
}
@@ -0,0 +1,15 @@
{
"format": "hwlab.measurement.v1",
"resourceId": "res_boxsim-alpha",
"capabilityId": "cap_gpio-measure",
"operationId": "op_hw-trusted-loop-001",
"samples": [
{
"name": "gpio0",
"unit": "logic",
"value": 1,
"trusted": true
}
],
"capturedAt": "2026-05-21T00:10:03.000Z"
}
@@ -0,0 +1,235 @@
{
"chainId": "echain_agent-auto-loop",
"schemaVersion": 1,
"scenario": "agent-automation-closed-loop",
"title": "Agent automation closed loop MVP",
"environment": "dev",
"projectId": "prj_evidence-chain",
"operationId": "op_agent-auto-loop-001",
"traceId": "trc_agent-auto-loop-001",
"gatewaySessionId": "gws_evidence-gateway-001",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"resourceId": "res_boxsim-beta",
"capabilityId": "cap_firmware-smoke",
"hardwareOperation": {
"operationId": "op_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"resourceId": "res_boxsim-beta",
"capabilityId": "cap_firmware-smoke",
"requestedBy": "wkr_agent-auto-001",
"input": {
"command": "firmware-smoke",
"timeoutSeconds": 60
},
"output": {
"exitCode": 0,
"result": "passed"
},
"status": "succeeded",
"environment": "dev",
"requestedAt": "2026-05-21T00:20:02.000Z",
"startedAt": "2026-05-21T00:20:03.000Z",
"completedAt": "2026-05-21T00:20:05.000Z",
"updatedAt": "2026-05-21T00:20:05.000Z"
},
"auditEvents": [
{
"auditId": "aud_agent-auto-session-started",
"traceId": "trc_agent-auto-loop-001",
"actorType": "user",
"actorId": "usr_alice",
"action": "agent.session.started",
"targetType": "agent_session",
"targetId": "ags_agent-auto-001",
"projectId": "prj_evidence-chain",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-mgr",
"environment": "dev",
"outcome": "accepted",
"metadata": {
"agentSessionId": "ags_agent-auto-001",
"goal": "run firmware smoke and persist evidence"
},
"occurredAt": "2026-05-21T00:20:00.000Z"
},
{
"auditId": "aud_agent-auto-worker-started",
"traceId": "trc_agent-auto-loop-001",
"actorType": "agent",
"actorId": "agt_agent-auto-001",
"action": "worker.session.started",
"targetType": "worker_session",
"targetId": "wks_agent-auto-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-worker",
"environment": "dev",
"outcome": "accepted",
"metadata": {
"agentSessionId": "ags_agent-auto-001"
},
"occurredAt": "2026-05-21T00:20:01.000Z"
},
{
"auditId": "aud_agent-auto-operation-requested",
"traceId": "trc_agent-auto-loop-001",
"actorType": "worker",
"actorId": "wkr_agent-auto-001",
"action": "hardware.operation.requested",
"targetType": "hardware_operation",
"targetId": "op_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-worker",
"environment": "dev",
"outcome": "accepted",
"metadata": {
"agentSessionId": "ags_agent-auto-001",
"capabilityId": "cap_firmware-smoke"
},
"occurredAt": "2026-05-21T00:20:02.000Z"
},
{
"auditId": "aud_agent-auto-operation-succeeded",
"traceId": "trc_agent-auto-loop-001",
"actorType": "service",
"actorId": "svc_hwlab-box-simu",
"action": "hardware.operation.succeeded",
"targetType": "hardware_operation",
"targetId": "op_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-box-simu",
"environment": "dev",
"outcome": "succeeded",
"metadata": {
"agentSessionId": "ags_agent-auto-001",
"exitCode": 0
},
"occurredAt": "2026-05-21T00:20:05.000Z"
},
{
"auditId": "aud_agent-auto-evidence-recorded",
"traceId": "trc_agent-auto-loop-001",
"actorType": "worker",
"actorId": "wkr_agent-auto-001",
"action": "evidence.recorded",
"targetType": "evidence_record",
"targetId": "evd_agent-auto-report",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-worker",
"environment": "dev",
"outcome": "succeeded",
"metadata": {
"agentSessionId": "ags_agent-auto-001",
"evidenceId": "evd_agent-auto-report",
"evidenceKind": "report"
},
"occurredAt": "2026-05-21T00:20:06.000Z"
}
],
"traceEvents": [
{
"traceEventId": "tev_agent-auto-goal",
"traceId": "trc_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-mgr",
"level": "info",
"message": "Agent session accepted automation goal",
"environment": "dev",
"metadata": {
"auditId": "aud_agent-auto-session-started"
},
"occurredAt": "2026-05-21T00:20:00.000Z"
},
{
"traceEventId": "tev_agent-auto-worker",
"traceId": "trc_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-worker",
"level": "info",
"message": "Worker requested firmware smoke operation",
"environment": "dev",
"metadata": {
"auditId": "aud_agent-auto-operation-requested"
},
"occurredAt": "2026-05-21T00:20:02.000Z"
},
{
"traceEventId": "tev_agent-auto-operation",
"traceId": "trc_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-box-simu",
"level": "info",
"message": "Firmware smoke operation completed",
"environment": "dev",
"metadata": {
"auditId": "aud_agent-auto-operation-succeeded"
},
"occurredAt": "2026-05-21T00:20:05.000Z"
},
{
"traceEventId": "tev_agent-auto-evidence",
"traceId": "trc_agent-auto-loop-001",
"projectId": "prj_evidence-chain",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"operationId": "op_agent-auto-loop-001",
"serviceId": "hwlab-agent-worker",
"level": "info",
"message": "Agent report evidence persisted",
"environment": "dev",
"metadata": {
"auditId": "aud_agent-auto-evidence-recorded",
"evidenceId": "evd_agent-auto-report"
},
"occurredAt": "2026-05-21T00:20:06.000Z"
}
],
"evidenceRecords": [
{
"evidenceId": "evd_agent-auto-report",
"projectId": "prj_evidence-chain",
"operationId": "op_agent-auto-loop-001",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"kind": "report",
"uri": "protocol/examples/evidence-chain/artifacts/agent-automation-report.json",
"mimeType": "application/json",
"sha256": "2fc63687cd3170c9cf34cd650aaedfb84d3fe75683ae969ae286230ce3b425a7",
"sizeBytes": 340,
"serviceId": "hwlab-agent-worker",
"environment": "dev",
"metadata": {
"traceId": "trc_agent-auto-loop-001",
"producedByAuditId": "aud_agent-auto-evidence-recorded",
"agentSessionId": "ags_agent-auto-001",
"workerSessionId": "wks_agent-auto-001",
"producerServiceId": "hwlab-agent-worker"
},
"createdAt": "2026-05-21T00:20:06.000Z"
}
]
}
@@ -0,0 +1,182 @@
{
"chainId": "echain_hw-trusted-loop",
"schemaVersion": 1,
"scenario": "hardware-trusted-closed-loop",
"title": "Hardware trusted closed loop MVP",
"environment": "dev",
"projectId": "prj_evidence-chain",
"operationId": "op_hw-trusted-loop-001",
"traceId": "trc_hw-trusted-loop-001",
"gatewaySessionId": "gws_evidence-gateway-001",
"resourceId": "res_boxsim-alpha",
"capabilityId": "cap_gpio-measure",
"hardwareOperation": {
"operationId": "op_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"resourceId": "res_boxsim-alpha",
"capabilityId": "cap_gpio-measure",
"requestedBy": "usr_alice",
"input": {
"command": "measure",
"port": "gpio0"
},
"output": {
"sampleCount": 1,
"result": "logic-high"
},
"status": "succeeded",
"environment": "dev",
"requestedAt": "2026-05-21T00:10:00.000Z",
"startedAt": "2026-05-21T00:10:01.000Z",
"completedAt": "2026-05-21T00:10:03.000Z",
"updatedAt": "2026-05-21T00:10:03.000Z"
},
"auditEvents": [
{
"auditId": "aud_hw-trusted-requested",
"traceId": "trc_hw-trusted-loop-001",
"actorType": "user",
"actorId": "usr_alice",
"action": "hardware.operation.requested",
"targetType": "hardware_operation",
"targetId": "op_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-cloud-api",
"environment": "dev",
"outcome": "accepted",
"metadata": {
"requestId": "req_hw-trusted-001"
},
"occurredAt": "2026-05-21T00:10:00.000Z"
},
{
"auditId": "aud_hw-trusted-dispatched",
"traceId": "trc_hw-trusted-loop-001",
"actorType": "service",
"actorId": "svc_hwlab-gateway-simu",
"action": "hardware.operation.dispatched",
"targetType": "hardware_operation",
"targetId": "op_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-gateway-simu",
"environment": "dev",
"outcome": "accepted",
"metadata": {
"resourceId": "res_boxsim-alpha",
"capabilityId": "cap_gpio-measure"
},
"occurredAt": "2026-05-21T00:10:01.000Z"
},
{
"auditId": "aud_hw-trusted-succeeded",
"traceId": "trc_hw-trusted-loop-001",
"actorType": "service",
"actorId": "svc_hwlab-box-simu",
"action": "hardware.operation.succeeded",
"targetType": "hardware_operation",
"targetId": "op_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-box-simu",
"environment": "dev",
"outcome": "succeeded",
"metadata": {
"sampleCount": 1
},
"occurredAt": "2026-05-21T00:10:03.000Z"
},
{
"auditId": "aud_hw-trusted-evidence-recorded",
"traceId": "trc_hw-trusted-loop-001",
"actorType": "service",
"actorId": "svc_hwlab-cloud-api",
"action": "evidence.recorded",
"targetType": "evidence_record",
"targetId": "evd_hw-trusted-measurement",
"projectId": "prj_evidence-chain",
"gatewaySessionId": "gws_evidence-gateway-001",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-cloud-api",
"environment": "dev",
"outcome": "succeeded",
"metadata": {
"evidenceId": "evd_hw-trusted-measurement",
"evidenceKind": "measurement"
},
"occurredAt": "2026-05-21T00:10:04.000Z"
}
],
"traceEvents": [
{
"traceEventId": "tev_hw-trusted-accepted",
"traceId": "trc_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-cloud-api",
"level": "info",
"message": "Hardware operation accepted",
"environment": "dev",
"metadata": {
"auditId": "aud_hw-trusted-requested"
},
"occurredAt": "2026-05-21T00:10:00.000Z"
},
{
"traceEventId": "tev_hw-trusted-dispatched",
"traceId": "trc_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-gateway-simu",
"level": "info",
"message": "Gateway dispatched trusted measurement",
"environment": "dev",
"metadata": {
"auditId": "aud_hw-trusted-dispatched"
},
"occurredAt": "2026-05-21T00:10:01.000Z"
},
{
"traceEventId": "tev_hw-trusted-evidence",
"traceId": "trc_hw-trusted-loop-001",
"projectId": "prj_evidence-chain",
"operationId": "op_hw-trusted-loop-001",
"serviceId": "hwlab-cloud-api",
"level": "info",
"message": "Measurement evidence persisted",
"environment": "dev",
"metadata": {
"auditId": "aud_hw-trusted-evidence-recorded",
"evidenceId": "evd_hw-trusted-measurement"
},
"occurredAt": "2026-05-21T00:10:04.000Z"
}
],
"evidenceRecords": [
{
"evidenceId": "evd_hw-trusted-measurement",
"projectId": "prj_evidence-chain",
"operationId": "op_hw-trusted-loop-001",
"kind": "measurement",
"uri": "protocol/examples/evidence-chain/artifacts/hardware-trusted-measurement.json",
"mimeType": "application/json",
"sha256": "da1bb981f0a966e6906bfdf6a0387180617c8f891c131d7bebf9e19b14989a99",
"sizeBytes": 318,
"serviceId": "hwlab-cloud-api",
"environment": "dev",
"metadata": {
"traceId": "trc_hw-trusted-loop-001",
"producedByAuditId": "aud_hw-trusted-evidence-recorded",
"producerServiceId": "hwlab-box-simu",
"resourceId": "res_boxsim-alpha",
"capabilityId": "cap_gpio-measure"
},
"createdAt": "2026-05-21T00:10:04.000Z"
}
]
}