{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "AuditTrail",
 "ref": "AuditTrail#163b",
 "hash": "sema:AuditTrail#mh:SHA-256:163b784f86e448340b94d0459483f0f476e052b5b7c589113f5c7df5dd1115a8",
 "stub": "163b",
 "layer": "Infrastructure",
 "type": "Verification",
 "summary": "Immutable append-only log of agent actions for compliance and debugging",
 "mechanism": "Every consequential Agent#e127 action (state mutation, external call, delegation, decision) appends a Sign#b202ed entry to an immutable Ledger#4dda whose sequence number advances via MonotonicCounter#d0d3, so no entry can be wedged between two existing ones. Each entry contains: timestamp, Agent#e127 Identity#b24a, action type, input hash, output hash, and the sema pattern invoked. Extends Trace#b68d from single-entity lineage to cross-agent compliance logging. The trail is append-only — entries cannot be modified or deleted. For cross-agent auditing, individual trails are aggregated via Merkle roots into a shared Snapshot#390d, enabling any party to verify the complete history without accessing raw entries.",
 "invariants": [
  "Append-Only: No entry in the Ledger#4dda may be modified after creation",
  "Every entry must be Sign#b202ed by the acting Agent#e127",
  "Trace#b68d provenance must link each entry to the sema pattern that triggered it"
 ],
 "parameters": {},
 "signature": [
  "Trace(Ledger)"
 ],
 "preconditions": [
  "Agent#e127 has established Identity#b24a",
  "Ledger#4dda is accessible and writable"
 ],
 "postconditions": [
  "Action recorded with full provenance in Ledger#4dda",
  "Snapshot#390d of trail Merkle root available for external verification"
 ],
 "failure_modes": [
  "Storage exhaustion (unbounded trail growth in long-running systems).",
  "Clock skew (distributed agents disagree on timestamps — use logical clocks).",
  "Selective logging (agent omits inconvenient entries — requires external Audit#be97)."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "AuditTrail",
 "builds_on": [
  {
   "alias": "identity",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Identity",
   "ref": "Identity#b24a",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Identity"
  },
  {
   "alias": "agent",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Agent",
   "ref": "Agent#e127",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Agent"
  },
  {
   "alias": "audit",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Audit",
   "ref": "Audit#be97",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Audit"
  },
  {
   "alias": "sign",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Sign",
   "ref": "Sign#b202",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Sign"
  },
  {
   "alias": "ledger",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Ledger",
   "ref": "Ledger#4dda",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Ledger"
  },
  {
   "alias": "trace",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Trace",
   "ref": "Trace#b68d",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Trace"
  },
  {
   "alias": "monotonic_counter",
   "relation": "references",
   "library": "bootstrap",
   "slug": "MonotonicCounter",
   "ref": "MonotonicCounter#d0d3",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/MonotonicCounter"
  },
  {
   "alias": "snapshot",
   "relation": "composes_with",
   "library": "bootstrap",
   "slug": "Snapshot",
   "ref": "Snapshot#390d",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Snapshot"
  }
 ],
 "related": [
  {
   "alias": null,
   "relation": "related",
   "library": "bootstrap",
   "slug": "SpotAudit",
   "ref": "SpotAudit#d3a9",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/SpotAudit"
  }
 ],
 "used_by": [],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/AuditTrail",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/AuditTrail.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
