Using Audit Pipelines
Overview
Procedural decisions are first-class artifacts. Every decision has a verifiable provenance chain.
This pack treats the decision — not the log line that mentions it — as the unit of evidence. A decision-log entry binds together inputs, the rule or policy version, the code version, the output, and a timestamp; entries are canonically encoded, fingerprinted, and chained so that tampering, replay, partial deletion, or time-shift becomes detectable. Exports carry their own integrity proofs so a downstream consumer can verify a subset without re-trusting the producer.
This is the evidence counterpart to security architecture's controls:
ordis-security-architect answers what must be protected and how — threat models of the system, controls at trust boundaries, defense-in-depth design.
axiom-audit-pipelines (this pack) answers what proves a decision happened, with what inputs, under which ruleset version and code version — and how that proof survives review, export, partial deletion, and adversarial scrutiny.
- The threat model OF the audit log itself lives in this pack (because the log is the evidence, and adversaries who reach the log are attacking the evidence). System-level threat modelling stays in
ordis-security-architect. Cross-link the two; do not duplicate STRIDE tables.
When to Use
Use this pack when:
- A system component decides something a regulator, auditor, customer, or court might later ask "prove it" about.
- Procedural decisions are produced by a rule engine, policy engine, governor, scheduler, or workflow engine, and the question "why did it do that?" must be answerable months later.
- You need to export a subset of decisions to an auditor, downstream system, or compliance pipeline without breaking integrity proofs over the rest.
- A regulator imposes retention, redaction, or right-to-be-forgotten obligations that conflict naively with append-only storage.
- You need to replay a state machine from a partial trail to investigate an incident, reconstruct a customer's experience, or test a fix against historical inputs.
- The team writes "we'll just log it" and you can already see the audit going wrong.
Do not use this pack when:
- You are designing system controls or threat-modelling the system →
/security-architect
- You are debugging non-determinism in a simulator or replay-for-debugging → simulation-foundations / determinism guidance (replay-for-debugging is a different problem from replay-from-audit-trail; this pack handles the latter)
- You are designing application logging for ordinary observability (latency, errors, throughput) — read
audit-aware-logging-vs-observability.md to understand why those are different problems, then use ordinary observability tooling
- You only need a tamper-evident commit log for engineers (use git, signed commits, and CI provenance)
Start Here
If your input is a system that already makes decisions and you have not run this pack before:
- Read
decision-log-architecture.md — define what counts as a decision in this system, choose entry shape, emit 00-scope-and-decisions.md and 01-decision-log-schema.md.
- Read
canonical-encoding-for-fingerprinting.md — pick the canonicalisation form (RFC8785 JCS unless you can defend an alternative), enumerate float / map / timezone gotchas, emit 02-canonical-encoding-spec.md.
- Read
fingerprint-chains-and-integrity.md — choose chain construction (linked hash vs Merkle), recovery-from-gaps strategy, partial-trust verification model, emit 03-chain-and-integrity-spec.md.
- Use the Routing section below to walk the rest at the right depth for your tier.
- Run the Consistency Gate below before declaring
99-audit-pipeline-specification.md ready.
Steps 1–3 are the spike: if those three artifacts hold together, the rest is fill-in. If they don't, no later sheet can save you.
How to Access Reference Sheets
All reference sheets are in the same directory as this SKILL.md. When you see a link like [canonical-encoding-for-fingerprinting.md](canonical-encoding-for-fingerprinting.md), read the file from the same directory.
Pipeline Position
ordis-security-architect (controls) axiom-audit-pipelines (evidence)
threat-models the SYSTEM ←-cross-ref-→ threat-models the LOG
designs controls at boundaries designs canonical encoding,
chain, signing, retention
replay, perf budget
─────────────────────────────────────────────────────────────────────
↓
axiom-solution-architect picks up:
17-risk-register.md cites threats from BOTH packs
04-solution-overview.md cites the audit-pipeline spec
ADRs cite chain construction, canonical-encoding choice
Expected Artifact Set
The pack produces a numbered artifact set in an audit-pipeline/ workspace:
| # |
Artifact |
Producer skill |
| 00 |
scope-and-decisions.md |
decision-log-architecture |
| 01 |
decision-log-schema.md |
decision-log-architecture |
| 02 |
canonical-encoding-spec.md |
canonical-encoding-for-fingerprinting |
| 03 |
chain-and-integrity-spec.md |
fingerprint-chains-and-integrity |
| 04 |
signing-and-export-spec.md |
signing-and-export-integrity |
| 05 |
provenance-bindings.md |
decision-provenance |
| 06 |
storage-and-retention.md |
immutable-storage-patterns + retention-expiry-and-rtbf |
| 07 |
threat-model.md |
threat-model-for-audit-logs |
| 08 |
replay-capability.md |
partial-replay-from-trail |
| 09 |
audit-vs-observability-boundary.md |
audit-aware-logging-vs-observability |
| 10 |
performance-budget.md |
performance-budget-for-audit-grade-pipelines |
| 99 |
audit-pipeline-specification.md |
router-owned consolidation (this SKILL.md) |
Spec Dependency Graph
The numbered artifacts are not independent — changes propagate. Read this before editing any spec.
02-canonical-encoding-spec.md (the bytes)
│
▼
01-decision-log-schema.md (what fields, in what canonical bytes)
│
▼
03-chain-and-integrity-spec.md (hash over those bytes, chain construction)
│
▼
04-signing-and-export-spec.md (signature over hash, export format)
│
▼
05-provenance-bindings.md (input/ruleset/code closure over the entry)
│
▼
08-replay-capability.md (replay reads canonical bytes by version)
Coordinated re-emission rules:
| If you change |
You also re-emit |
Chain-breaking? |
02- canonicalisation rule |
01- (entry_version bump) and 03- (chain-breaking event note) |
Yes |
01- mandatory field added/removed/renamed |
02- if encoding rule affected, 03- (chain-breaking event note) |
Yes |
03- hash function changed |
01- if inputs_commitment.ref.hash was that function, 04- signature-over-hash recomputation |
Yes |
03- chain construction changed (linked-hash → Merkle) |
04- export format, 08- replay traversal |
Yes (with documented transition) |
04- signature scheme changed |
06- if signature material is held in storage, 07- adversary update |
No (chain-side unaffected) |
06- retention class redrawn |
07- partial-deletion threat, 08- replay coverage shrinks |
No |
A change not listed above is not exempt; it gets evaluated against the chain-breaking-event rule in 03- and against the consistency gate's affected checks. The default for ambiguity is "treat as chain-breaking" — it is cheap to over-document a transition and expensive to under-document one.
Scope Tier
Every workflow is classified during decision-log-architecture and recorded in 00-scope-and-decisions.md. The tier determines which artifacts are required by the consistency gate.
| Tier |
Trigger |
Required artifacts |
| XS |
Single decision type, single producer, no export, internal-only |
00, 01, 02, 03, 06; 99 is a one-page memo |
| S |
Multiple decision types under one ruleset, no cross-system export |
XS set + 04, 07, 09 |
| M |
Decisions consumed by a downstream system or persisted across deploys |
S set + 05, 08, 10 |
| L |
Decisions are subject to regulatory audit, external export, or legal hold |
M set + full 07-threat-model.md (not summary), explicit cryptographic agility plan in 04-, documented incident-response runbook in 06- |
| XL |
Decisions feed an external regulator's pipeline, ATO/RMF process, or court evidence |
L set + signed-export key-rotation runbook, third-party verifier compatibility statement, retention-vs-RTBF reconciliation memo with named legal authority |
Tier is authoritative. If any sheet's guidance forces an artifact above your declared tier, that artifact becomes required — this is a tier promotion, not a waiver.
Routing
Scenario: "We have a system that makes decisions; design its audit pipeline"
decision-log-architecture → 00-, 01- (also classifies the tier)
canonical-encoding-for-fingerprinting → 02-
fingerprint-chains-and-integrity → 03-
signing-and-export-integrity → 04- (S tier and above)
decision-provenance → 05- (M tier and above)
immutable-storage-patterns + retention-expiry-and-rtbf → 06-
threat-model-for-audit-logs → 07- (always at least summary; full document at L+)
partial-replay-from-trail → 08- (M tier and above)
audit-aware-logging-vs-observability → 09- (the delineation sheet — write last)
performance-budget-for-audit-grade-pipelines → 10- (M tier and above)
- Consolidate into
99-audit-pipeline-specification.md and run the consistency gate below.
Scenario: "Verify the integrity of an existing trail"
Use the /verify-integrity slash command, which dispatches the integrity-auditor agent against an existing trail directory.
Scenario: "Review a system for missing audit instrumentation"
Use the audit-architecture-reviewer agent. Provide the system's design artifacts (a SAD, an HLD, or a code map) and it reports decision points lacking provenance, with severity.
Scenario: "Bootstrap audit-trail scaffolding for a new component"
Use the /scaffold-audit-trail slash command. It drops in canonical-encoding, chain, and storage scaffolding aligned to your declared tier; it does not replace the design artifacts above — it implements them.
Scenario: "I'm not sure what counts as a decision in our system"
Use the /design-decision-log slash command. It runs an interactive elicitation: which producers, which decision types, which fields are mandatory, where the boundary sits. Output feeds decision-log-architecture step 1.
Specialist Agents
agent: audit-architecture-reviewer — Reviews a system for decision points lacking provenance. Reads design artifacts, reports gaps with severity. Invoked via /scaffold-audit-trail's gap-analysis option or directly via the Task tool.
agent: integrity-auditor — Runs verification on a real trail and reports gaps, signature mismatches, chain breaks, and recovery scope. Invoked via /verify-integrity.
Agents vs. skills: Skills produce design artifacts (the spec). Agents audit or critique either a design or a running trail. Load a skill when designing; dispatch an agent when reviewing.
Consistency Gate
Run before emitting 99-audit-pipeline-specification.md. Each check produces a pass/fail line in the gate report. Failures must be addressed or recorded as explicit waivers (with reactivation conditions); silent drops are the failure mode this pack exists to prevent.
| # |
Check |
Question |
| 1 |
Tier coverage |
Every artifact required by the declared tier exists. |
| 2 |
Schema completeness |
Every field promised in 01-decision-log-schema.md is producible by the system as described in 00-scope-and-decisions.md. No "TBD" in mandatory fields. |
| 3 |
Encoding determinism |
02- names the canonicalisation form (RFC8785 JCS or alternative with rationale), and addresses every gotcha class enumerated in canonical-encoding-for-fingerprinting.md: floats, map ordering, timezones, Unicode normalization, integer width. |
| 4 |
Chain integrity |
03- specifies chain construction, gap-recovery procedure, partial-trust verification, and clock dependence — and 04- (if present) is consistent with 03- on signature granularity. |
| 5 |
Provenance closure |
05- (M+) closes the loop: every output in the schema can be traced to its inputs, ruleset version, and code version. No dangling outputs. |
| 6 |
Retention / RTBF reconciliation |
06- resolves the apparent contradiction between append-only and right-to-be-forgotten with a named mechanism (cryptographic erasure, redaction-with-witness, segregated PII, or legal-authority-recorded waiver). The mechanism is named, not hand-waved. |
| 7 |
Threat coverage |
07- covers the standard adversaries (tamper, replay, time-shift, partial deletion, key compromise, insider). Each has a control or an explicit accepted-risk entry. |
| 8 |
Replay scope honesty |
08- (M+) states what can and cannot be replayed from N entries, and where state outside the trail is required. No "fully replayable" claims without a state-coverage proof. |
| 9 |
Boundary clarity |
09- distinguishes audit-grade events from ordinary observability events with a stable rule, not a slogan. The rule is testable: a developer reading it can correctly classify a new event class. |
| 10 |
Performance honesty |
10- (M+) states amortisation strategy, write/read budgets, and the pipeline's behaviour under burst load. "Stream everything" or "batch everything" without numbers fails the check. |
| 11 |
Cross-pack handoff |
If ordis-security-architect artifacts exist for the same system, 07- cross-references the system threat model rather than duplicating it. If axiom-solution-architect artifacts exist, 99- is cited from 04-solution-overview.md and from any ADR that touches the audit subsystem. |
A 99-audit-pipeline-specification.md whose gate report is older than its latest numbered artifact is stale and must be re-gated before downstream citation.
Update Workflows
| Change shape |
Re-run |
Re-gate |
| New decision type |
00-, 01-, 05- cross-ref |
Checks 1, 2, 5 |
| New field on existing decision |
01-, 02- if encoding rule affected, 08- if replay-relevant |
Checks 2, 3, 8 |
| Canonicalisation form change |
02-, 03- (chain re-verification on legacy entries), 04- |
Checks 3, 4 |
| Chain construction change |
03-, 04-, 08-, migration plan in 99- |
Checks 4, 8 |
| Key rotation event |
04-, 06- if rotation drives storage layout, 07- adversary update |
Checks 4, 6, 7 |
| Retention policy change |
06-, 08- (replay coverage shrinks), 07- (partial-deletion threat) |
Checks 6, 7, 8 |
| New regulator obligation |
00- tier may promote, 06-, 07- |
Re-gate at promoted tier |
| New downstream consumer of exports |
04-, 05- (exposure surface), 09- (boundary may shift) |
Checks 4, 5, 9 |
Bump the 99- semver on every re-emission. Re-gate before downstream citation.
Stop Conditions
| Condition |
Response |
| The system makes no decisions a regulator/auditor/customer would ask "prove it" about |
Stop. The system needs ordinary observability, not an audit pipeline. Record the determination in a one-page memo. |
| Decisions are too low-level to log atomically (per-tick simulation, per-microsecond control loop) |
Aggregate to the meaningful decision boundary (the trade, the verdict, the dispatch) and log there. Log the aggregation rule. Do not log every tick. |
| Append-only conflicts with regulator's RTBF requirement and legal authority is unclear |
Stop at 06-. Escalate to legal/compliance owner. Do not improvise a redaction scheme. |
| Required cryptographic agility (post-quantum readiness) is unsettled |
Record current choice in 04- with explicit crypto-agility-plan: deferred-to-vN+1, raise risk in 07-, proceed. Do not block on speculative cryptography. |
| Performance budget is impossible at the proposed entry shape |
Return to 01- and consider summary entries with on-demand detail expansion, or per-class entry shapes. Do not silently drop entries to fit. |
Decision Tree
Does the system make decisions someone might later need to verify?
├─ No → wrong pack; use ordinary observability
└─ Yes → Continue
Are decisions exposed to a regulator, auditor, or external party?
├─ No → tier XS or S likely
└─ Yes → tier M, L, or XL — full pipeline required
Is there an existing trail you need to verify, not design?
├─ Yes → /verify-integrity (integrity-auditor agent)
└─ No → Continue
Is there a system design you suspect is under-instrumented?
├─ Yes → audit-architecture-reviewer agent (gap report)
└─ No → /design-decision-log (interactive) → decision-log-architecture skill
Integration with Other Skillpacks
Security architecture (ordis-security-architect)
ordis produces system threat model + control set
→ this pack reads them; threat-model-for-audit-logs cross-references rather than duplicates
→ this pack produces 07-threat-model.md (the log itself)
→ ordis can then add controls protecting log integrity (HSM, write-once media, signing service)
The boundary: ordis owns system threat modelling and control design; this pack owns audit-log threat modelling and the design of the evidence itself. They cross-link.
Solution architecture (axiom-solution-architect)
solution-architect's 04-solution-overview.md cites this pack's 99-
solution-architect's adrs/ cite specific choices (RFC8785, chain shape, signature scheme)
solution-architect's 17-risk-register.md cites threats from both this pack's 07- and ordis' threat model
If solution-architect is in play and the system has procedural decisions, this pack's 99- is a normal input to 04- and to ADRs.
Determinism and replay (axiom-determinism-and-replay)
axiom-determinism-and-replay designs replayable systems
(seeds, RNG isolation, snapshots, divergence detection)
→ this pack designs the audit trail of decisions made by such systems
→ replay-from-audit (this pack's 08-) reconstructs decisions from the trail
→ replay-for-debugging (determinism pack) reconstructs system state from inputs
→ different questions, different scopes, cross-link in 99-
The boundary: this pack records what was decided; the determinism pack arranges that, given recorded inputs, the system would behave the same way again. A system that uses both packs has evidence of decisions and reproducibility of behaviour, and the consistency between them is itself an audit-grade property.
SDLC governance (axiom-sdlc-engineering)
this pack produces 99-audit-pipeline-specification.md
→ sdlc-engineering manages spec lifecycle (versioning, ADR for material changes,
retention policy of the spec itself separate from retention of the trail)
Compliance frameworks
When a framework drives the requirement (SOC 2, HIPAA, PCI-DSS, GDPR, EU AI Act, NIS2), record the framework as the originating constraint in 00-scope-and-decisions.md. Trace it through 01- (which fields the framework requires), 06- (retention obligations), and 07- (the compliance-exposure threat).
Observability stack (separate skill)
Audit-grade pipelines and ordinary observability share infrastructure (storage, dashboards, alerts) but are different problems. Read 09-audit-vs-observability-boundary.md for the rule. Common failure mode: cramming audit obligations into the observability stack, or routing observability noise through the audit pipeline. Either kills both.
Quick Reference
| Need |
Use This |
| Define what counts as a decision |
decision-log-architecture |
| Pick canonical encoding (RFC8785 etc.) |
canonical-encoding-for-fingerprinting |
| Construct the chain (linked vs Merkle) |
fingerprint-chains-and-integrity |
| Sign exports / rotate keys / partial export |
signing-and-export-integrity |
| Bind decision to inputs + ruleset + code |
decision-provenance |
| Append-only storage at rest |
immutable-storage-patterns |
| Distinguish audit from observability |
audit-aware-logging-vs-observability |
| Threat-model the audit log itself |
threat-model-for-audit-logs |
| Reconcile retention with right-to-be-forgotten |
retention-expiry-and-rtbf |
| Replay state from N entries |
partial-replay-from-trail |
| Decide stream vs amortise |
performance-budget-for-audit-grade-pipelines |
| Verify an existing trail |
agent: integrity-auditor (/verify-integrity) |
| Find decision points lacking provenance |
agent: audit-architecture-reviewer |
| Drop in scaffolding for a new component |
command: /scaffold-audit-trail |
| Interactive: what counts as a decision |
command: /design-decision-log |
The Bottom Line
Decisions are evidence. Evidence is canonical bytes, chained fingerprints, signed exports, named retention, modelled adversaries, replayable scope, and budgeted performance — produced as a specification before code is written, gated for consistency before citation downstream.
Audit-Pipelines Specialist Skills Catalog
After routing, load the appropriate specialist sheet for detailed guidance:
- decision-log-architecture.md — What is a decision, mandatory fields, entry boundary, scope classification
- canonical-encoding-for-fingerprinting.md — RFC8785 JCS, deterministic JSON, gotchas (floats, maps, timezones, Unicode, integer width)
- fingerprint-chains-and-integrity.md — Linked-hash and Merkle constructions, gap recovery, partial-trust verification
- signing-and-export-integrity.md — HMAC and asymmetric signing, key rotation, signature granularity, exporting subsets without breaking proofs
- decision-provenance.md — Linking outputs to inputs + ruleset version + code version
- immutable-storage-patterns.md — Append-only, encryption-at-rest (SQLCipher and alternatives), write-once-verify-many
- audit-aware-logging-vs-observability.md — The boundary rule, what crosses, what doesn't
- threat-model-for-audit-logs.md — Tamper, replay, time-shift, partial deletion, key compromise, insider, regulator subpoena
- retention-expiry-and-rtbf.md — Cryptographic erasure, redaction-with-witness, segregated PII, legal-authority waivers
- partial-replay-from-trail.md — Reconstructing state from N entries, replay scope, state-coverage proofs
- performance-budget-for-audit-grade-pipelines.md — Stream-vs-amortise tradeoff, burst behaviour, write/read/verify budgets
1---2name: using-audit-pipelines3description: Use when a system makes procedural decisions that must be defensible after the fact — rule firings, governor decisions, state transitions, gate verdicts, eligibility determinations, automated approvals — and you need a verifiable provenance chain rather than ordinary observability. Use when an auditor, regulator, customer, or court might later ask "prove it" about a decision the system made. Use when retention, redaction, or right-to-be-forgotten obligations conflict naively with append-only storage. Do not use for ordinary observability or for system-level threat modelling.4---56# Using Audit Pipelines78## Overview910**Procedural decisions are first-class artifacts. Every decision has a verifiable provenance chain.**1112This pack treats *the decision* — not the log line that mentions it — as the unit of evidence. A decision-log entry binds together inputs, the rule or policy version, the code version, the output, and a timestamp; entries are canonically encoded, fingerprinted, and chained so that tampering, replay, partial deletion, or time-shift becomes detectable. Exports carry their own integrity proofs so a downstream consumer can verify a subset without re-trusting the producer.1314This is the *evidence* counterpart to security architecture's *controls*:1516- `ordis-security-architect` answers **what must be protected and how** — threat models of the system, controls at trust boundaries, defense-in-depth design.17- **`axiom-audit-pipelines` (this pack) answers what proves a decision happened, with what inputs, under which ruleset version and code version** — and how that proof survives review, export, partial deletion, and adversarial scrutiny.18- The **threat model OF the audit log itself** lives in this pack (because the log is the evidence, and adversaries who reach the log are attacking the evidence). System-level threat modelling stays in `ordis-security-architect`. Cross-link the two; do not duplicate STRIDE tables.1920## When to Use2122Use this pack when:2324- A system component decides something a regulator, auditor, customer, or court might later ask "prove it" about.25- Procedural decisions are produced by a rule engine, policy engine, governor, scheduler, or workflow engine, and the question "why did it do that?" must be answerable months later.26- You need to export a subset of decisions to an auditor, downstream system, or compliance pipeline *without breaking integrity proofs over the rest*.27- A regulator imposes retention, redaction, or right-to-be-forgotten obligations that conflict naively with append-only storage.28- You need to replay a state machine from a partial trail to investigate an incident, reconstruct a customer's experience, or test a fix against historical inputs.29- The team writes "we'll just log it" and you can already see the audit going wrong.3031Do **not** use this pack when:3233- You are designing system controls or threat-modelling the system → `/security-architect`34- You are debugging non-determinism in a simulator or replay-for-debugging → simulation-foundations / determinism guidance (replay-for-debugging is a different problem from replay-from-audit-trail; this pack handles the latter)35- You are designing application logging for ordinary observability (latency, errors, throughput) — read `audit-aware-logging-vs-observability.md` to understand why those are different problems, then use ordinary observability tooling36- You only need a tamper-evident commit log for engineers (use git, signed commits, and CI provenance)3738## Start Here3940If your input is a system that already makes decisions and you have not run this pack before:41421. Read `decision-log-architecture.md` — define what counts as a decision in *this* system, choose entry shape, emit `00-scope-and-decisions.md` and `01-decision-log-schema.md`.432. Read `canonical-encoding-for-fingerprinting.md` — pick the canonicalisation form (RFC8785 JCS unless you can defend an alternative), enumerate float / map / timezone gotchas, emit `02-canonical-encoding-spec.md`.443. Read `fingerprint-chains-and-integrity.md` — choose chain construction (linked hash vs Merkle), recovery-from-gaps strategy, partial-trust verification model, emit `03-chain-and-integrity-spec.md`.454. Use the **Routing** section below to walk the rest at the right depth for your tier.465. Run the **Consistency Gate** below before declaring `99-audit-pipeline-specification.md` ready.4748Steps 1–3 are the spike: if those three artifacts hold together, the rest is fill-in. If they don't, no later sheet can save you.4950## How to Access Reference Sheets5152All reference sheets are in the same directory as this `SKILL.md`. When you see a link like `[canonical-encoding-for-fingerprinting.md](canonical-encoding-for-fingerprinting.md)`, read the file from the same directory.5354## Pipeline Position5556```57ordis-security-architect (controls) axiom-audit-pipelines (evidence)58 threat-models the SYSTEM ←-cross-ref-→ threat-models the LOG59 designs controls at boundaries designs canonical encoding,60 chain, signing, retention61 replay, perf budget62 ─────────────────────────────────────────────────────────────────────63 ↓64 axiom-solution-architect picks up:65 17-risk-register.md cites threats from BOTH packs66 04-solution-overview.md cites the audit-pipeline spec67 ADRs cite chain construction, canonical-encoding choice68```6970## Expected Artifact Set7172The pack produces a numbered artifact set in an `audit-pipeline/` workspace:7374| # | Artifact | Producer skill |75|---|----------|----------------|76| 00 | `scope-and-decisions.md` | `decision-log-architecture` |77| 01 | `decision-log-schema.md` | `decision-log-architecture` |78| 02 | `canonical-encoding-spec.md` | `canonical-encoding-for-fingerprinting` |79| 03 | `chain-and-integrity-spec.md` | `fingerprint-chains-and-integrity` |80| 04 | `signing-and-export-spec.md` | `signing-and-export-integrity` |81| 05 | `provenance-bindings.md` | `decision-provenance` |82| 06 | `storage-and-retention.md` | `immutable-storage-patterns` + `retention-expiry-and-rtbf` |83| 07 | `threat-model.md` | `threat-model-for-audit-logs` |84| 08 | `replay-capability.md` | `partial-replay-from-trail` |85| 09 | `audit-vs-observability-boundary.md` | `audit-aware-logging-vs-observability` |86| 10 | `performance-budget.md` | `performance-budget-for-audit-grade-pipelines` |87| 99 | `audit-pipeline-specification.md` | router-owned consolidation (this SKILL.md) |8889## Spec Dependency Graph9091The numbered artifacts are not independent — changes propagate. Read this before editing any spec.9293```9402-canonical-encoding-spec.md (the bytes)95 │96 ▼9701-decision-log-schema.md (what fields, in what canonical bytes)98 │99 ▼10003-chain-and-integrity-spec.md (hash over those bytes, chain construction)101 │102 ▼10304-signing-and-export-spec.md (signature over hash, export format)104 │105 ▼10605-provenance-bindings.md (input/ruleset/code closure over the entry)107 │108 ▼10908-replay-capability.md (replay reads canonical bytes by version)110```111112**Coordinated re-emission rules:**113114| If you change | You also re-emit | Chain-breaking? |115|---------------|------------------|------------------|116| `02-` canonicalisation rule | `01-` (`entry_version` bump) and `03-` (chain-breaking event note) | Yes |117| `01-` mandatory field added/removed/renamed | `02-` if encoding rule affected, `03-` (chain-breaking event note) | Yes |118| `03-` hash function changed | `01-` if `inputs_commitment.ref.hash` was that function, `04-` signature-over-hash recomputation | Yes |119| `03-` chain construction changed (linked-hash → Merkle) | `04-` export format, `08-` replay traversal | Yes (with documented transition) |120| `04-` signature scheme changed | `06-` if signature material is held in storage, `07-` adversary update | No (chain-side unaffected) |121| `06-` retention class redrawn | `07-` partial-deletion threat, `08-` replay coverage shrinks | No |122123A change not listed above is *not exempt*; it gets evaluated against the chain-breaking-event rule in `03-` and against the consistency gate's affected checks. The default for ambiguity is "treat as chain-breaking" — it is cheap to over-document a transition and expensive to under-document one.124125## Scope Tier126127Every workflow is classified during `decision-log-architecture` and recorded in `00-scope-and-decisions.md`. The tier determines which artifacts are required by the consistency gate.128129| Tier | Trigger | Required artifacts |130|------|---------|--------------------|131| XS | Single decision type, single producer, no export, internal-only | `00, 01, 02, 03, 06`; `99` is a one-page memo |132| S | Multiple decision types under one ruleset, no cross-system export | XS set + `04, 07, 09` |133| M | Decisions consumed by a downstream system or persisted across deploys | S set + `05, 08, 10` |134| L | Decisions are subject to regulatory audit, external export, or legal hold | M set + full `07-threat-model.md` (not summary), explicit cryptographic agility plan in `04-`, documented incident-response runbook in `06-` |135| XL | Decisions feed an external regulator's pipeline, ATO/RMF process, or court evidence | L set + signed-export key-rotation runbook, third-party verifier compatibility statement, retention-vs-RTBF reconciliation memo with named legal authority |136137Tier is authoritative. If any sheet's guidance forces an artifact above your declared tier, that artifact becomes required — this is a tier promotion, not a waiver.138139## Routing140141### Scenario: "We have a system that makes decisions; design its audit pipeline"1421431. `decision-log-architecture` → `00-`, `01-` (also classifies the tier)1442. `canonical-encoding-for-fingerprinting` → `02-`1453. `fingerprint-chains-and-integrity` → `03-`1464. `signing-and-export-integrity` → `04-` (S tier and above)1475. `decision-provenance` → `05-` (M tier and above)1486. `immutable-storage-patterns` + `retention-expiry-and-rtbf` → `06-`1497. `threat-model-for-audit-logs` → `07-` (always at least summary; full document at L+)1508. `partial-replay-from-trail` → `08-` (M tier and above)1519. `audit-aware-logging-vs-observability` → `09-` (the delineation sheet — write last)15210. `performance-budget-for-audit-grade-pipelines` → `10-` (M tier and above)15311. Consolidate into `99-audit-pipeline-specification.md` and run the consistency gate below.154155### Scenario: "Verify the integrity of an existing trail"156157Use the `/verify-integrity` slash command, which dispatches the `integrity-auditor` agent against an existing trail directory.158159### Scenario: "Review a system for missing audit instrumentation"160161Use the `audit-architecture-reviewer` agent. Provide the system's design artifacts (a SAD, an HLD, or a code map) and it reports decision points lacking provenance, with severity.162163### Scenario: "Bootstrap audit-trail scaffolding for a new component"164165Use the `/scaffold-audit-trail` slash command. It drops in canonical-encoding, chain, and storage scaffolding aligned to your declared tier; it does not replace the design artifacts above — it implements them.166167### Scenario: "I'm not sure what counts as a decision in our system"168169Use the `/design-decision-log` slash command. It runs an interactive elicitation: which producers, which decision types, which fields are mandatory, where the boundary sits. Output feeds `decision-log-architecture` step 1.170171### Specialist Agents172173- **`agent: audit-architecture-reviewer`** — Reviews a system for decision points lacking provenance. Reads design artifacts, reports gaps with severity. Invoked via `/scaffold-audit-trail`'s gap-analysis option or directly via the `Task` tool.174- **`agent: integrity-auditor`** — Runs verification on a real trail and reports gaps, signature mismatches, chain breaks, and recovery scope. Invoked via `/verify-integrity`.175176**Agents vs. skills:** Skills *produce* design artifacts (the spec). Agents *audit or critique* either a design or a running trail. Load a skill when designing; dispatch an agent when reviewing.177178## Consistency Gate179180Run before emitting `99-audit-pipeline-specification.md`. Each check produces a pass/fail line in the gate report. Failures must be addressed or recorded as explicit waivers (with reactivation conditions); silent drops are the failure mode this pack exists to prevent.181182| # | Check | Question |183|---|-------|----------|184| 1 | Tier coverage | Every artifact required by the declared tier exists. |185| 2 | Schema completeness | Every field promised in `01-decision-log-schema.md` is producible by the system as described in `00-scope-and-decisions.md`. No "TBD" in mandatory fields. |186| 3 | Encoding determinism | `02-` names the canonicalisation form (RFC8785 JCS or alternative with rationale), and addresses every gotcha class enumerated in `canonical-encoding-for-fingerprinting.md`: floats, map ordering, timezones, Unicode normalization, integer width. |187| 4 | Chain integrity | `03-` specifies chain construction, gap-recovery procedure, partial-trust verification, and clock dependence — and `04-` (if present) is consistent with `03-` on signature granularity. |188| 5 | Provenance closure | `05-` (M+) closes the loop: every output in the schema can be traced to its inputs, ruleset version, and code version. No dangling outputs. |189| 6 | Retention / RTBF reconciliation | `06-` resolves the apparent contradiction between append-only and right-to-be-forgotten with a named mechanism (cryptographic erasure, redaction-with-witness, segregated PII, or legal-authority-recorded waiver). The mechanism is named, not hand-waved. |190| 7 | Threat coverage | `07-` covers the standard adversaries (tamper, replay, time-shift, partial deletion, key compromise, insider). Each has a control or an explicit accepted-risk entry. |191| 8 | Replay scope honesty | `08-` (M+) states what *can* and *cannot* be replayed from N entries, and where state outside the trail is required. No "fully replayable" claims without a state-coverage proof. |192| 9 | Boundary clarity | `09-` distinguishes audit-grade events from ordinary observability events with a stable rule, not a slogan. The rule is testable: a developer reading it can correctly classify a new event class. |193| 10 | Performance honesty | `10-` (M+) states amortisation strategy, write/read budgets, and the pipeline's behaviour under burst load. "Stream everything" or "batch everything" without numbers fails the check. |194| 11 | Cross-pack handoff | If `ordis-security-architect` artifacts exist for the same system, `07-` cross-references the system threat model rather than duplicating it. If `axiom-solution-architect` artifacts exist, `99-` is cited from `04-solution-overview.md` and from any ADR that touches the audit subsystem. |195196A `99-audit-pipeline-specification.md` whose gate report is older than its latest numbered artifact is stale and must be re-gated before downstream citation.197198## Update Workflows199200| Change shape | Re-run | Re-gate |201|--------------|--------|---------|202| New decision type | `00-`, `01-`, `05-` cross-ref | Checks 1, 2, 5 |203| New field on existing decision | `01-`, `02-` if encoding rule affected, `08-` if replay-relevant | Checks 2, 3, 8 |204| Canonicalisation form change | `02-`, `03-` (chain re-verification on legacy entries), `04-` | Checks 3, 4 |205| Chain construction change | `03-`, `04-`, `08-`, migration plan in `99-` | Checks 4, 8 |206| Key rotation event | `04-`, `06-` if rotation drives storage layout, `07-` adversary update | Checks 4, 6, 7 |207| Retention policy change | `06-`, `08-` (replay coverage shrinks), `07-` (partial-deletion threat) | Checks 6, 7, 8 |208| New regulator obligation | `00-` tier may promote, `06-`, `07-` | Re-gate at promoted tier |209| New downstream consumer of exports | `04-`, `05-` (exposure surface), `09-` (boundary may shift) | Checks 4, 5, 9 |210211Bump the `99-` semver on every re-emission. Re-gate before downstream citation.212213## Stop Conditions214215| Condition | Response |216|-----------|----------|217| The system makes no decisions a regulator/auditor/customer would ask "prove it" about | Stop. The system needs ordinary observability, not an audit pipeline. Record the determination in a one-page memo. |218| Decisions are too low-level to log atomically (per-tick simulation, per-microsecond control loop) | Aggregate to the meaningful decision boundary (the trade, the verdict, the dispatch) and log there. Log the aggregation rule. Do not log every tick. |219| Append-only conflicts with regulator's RTBF requirement and legal authority is unclear | Stop at `06-`. Escalate to legal/compliance owner. Do not improvise a redaction scheme. |220| Required cryptographic agility (post-quantum readiness) is unsettled | Record current choice in `04-` with explicit `crypto-agility-plan: deferred-to-vN+1`, raise risk in `07-`, proceed. Do not block on speculative cryptography. |221| Performance budget is impossible at the proposed entry shape | Return to `01-` and consider summary entries with on-demand detail expansion, or per-class entry shapes. Do not silently drop entries to fit. |222223## Decision Tree224225```226Does the system make decisions someone might later need to verify?227├─ No → wrong pack; use ordinary observability228└─ Yes → Continue229230Are decisions exposed to a regulator, auditor, or external party?231├─ No → tier XS or S likely232└─ Yes → tier M, L, or XL — full pipeline required233234Is there an existing trail you need to verify, not design?235├─ Yes → /verify-integrity (integrity-auditor agent)236└─ No → Continue237238Is there a system design you suspect is under-instrumented?239├─ Yes → audit-architecture-reviewer agent (gap report)240└─ No → /design-decision-log (interactive) → decision-log-architecture skill241```242243## Integration with Other Skillpacks244245### Security architecture (ordis-security-architect)246247```248ordis produces system threat model + control set249→ this pack reads them; threat-model-for-audit-logs cross-references rather than duplicates250→ this pack produces 07-threat-model.md (the log itself)251→ ordis can then add controls protecting log integrity (HSM, write-once media, signing service)252```253254The boundary: ordis owns *system* threat modelling and control design; this pack owns *audit-log* threat modelling and the design of the evidence itself. They cross-link.255256### Solution architecture (axiom-solution-architect)257258```259solution-architect's 04-solution-overview.md cites this pack's 99-260solution-architect's adrs/ cite specific choices (RFC8785, chain shape, signature scheme)261solution-architect's 17-risk-register.md cites threats from both this pack's 07- and ordis' threat model262```263264If solution-architect is in play and the system has procedural decisions, this pack's `99-` is a normal input to `04-` and to ADRs.265266### Determinism and replay (axiom-determinism-and-replay)267268```269axiom-determinism-and-replay designs replayable systems270 (seeds, RNG isolation, snapshots, divergence detection)271→ this pack designs the audit trail of decisions made by such systems272→ replay-from-audit (this pack's 08-) reconstructs decisions from the trail273→ replay-for-debugging (determinism pack) reconstructs system state from inputs274→ different questions, different scopes, cross-link in 99-275```276277The boundary: this pack records what was decided; the determinism pack arranges that, given recorded inputs, the system would behave the same way again. A system that uses both packs has *evidence* of decisions and *reproducibility* of behaviour, and the consistency between them is itself an audit-grade property.278279### SDLC governance (axiom-sdlc-engineering)280281```282this pack produces 99-audit-pipeline-specification.md283→ sdlc-engineering manages spec lifecycle (versioning, ADR for material changes,284 retention policy of the spec itself separate from retention of the trail)285```286287### Compliance frameworks288289When a framework drives the requirement (SOC 2, HIPAA, PCI-DSS, GDPR, EU AI Act, NIS2), record the framework as the originating constraint in `00-scope-and-decisions.md`. Trace it through `01-` (which fields the framework requires), `06-` (retention obligations), and `07-` (the compliance-exposure threat).290291### Observability stack (separate skill)292293Audit-grade pipelines and ordinary observability share infrastructure (storage, dashboards, alerts) but are different problems. Read `09-audit-vs-observability-boundary.md` for the rule. Common failure mode: cramming audit obligations into the observability stack, or routing observability noise through the audit pipeline. Either kills both.294295## Quick Reference296297| Need | Use This |298|------|----------|299| Define what counts as a decision | `decision-log-architecture` |300| Pick canonical encoding (RFC8785 etc.) | `canonical-encoding-for-fingerprinting` |301| Construct the chain (linked vs Merkle) | `fingerprint-chains-and-integrity` |302| Sign exports / rotate keys / partial export | `signing-and-export-integrity` |303| Bind decision to inputs + ruleset + code | `decision-provenance` |304| Append-only storage at rest | `immutable-storage-patterns` |305| Distinguish audit from observability | `audit-aware-logging-vs-observability` |306| Threat-model the audit log itself | `threat-model-for-audit-logs` |307| Reconcile retention with right-to-be-forgotten | `retention-expiry-and-rtbf` |308| Replay state from N entries | `partial-replay-from-trail` |309| Decide stream vs amortise | `performance-budget-for-audit-grade-pipelines` |310| Verify an existing trail | agent: `integrity-auditor` (`/verify-integrity`) |311| Find decision points lacking provenance | agent: `audit-architecture-reviewer` |312| Drop in scaffolding for a new component | command: `/scaffold-audit-trail` |313| Interactive: what counts as a decision | command: `/design-decision-log` |314315## The Bottom Line316317**Decisions are evidence. Evidence is canonical bytes, chained fingerprints, signed exports, named retention, modelled adversaries, replayable scope, and budgeted performance — produced as a specification before code is written, gated for consistency before citation downstream.**318319---320321## Audit-Pipelines Specialist Skills Catalog322323After routing, load the appropriate specialist sheet for detailed guidance:3243251. [decision-log-architecture.md](decision-log-architecture.md) — What is a decision, mandatory fields, entry boundary, scope classification3262. [canonical-encoding-for-fingerprinting.md](canonical-encoding-for-fingerprinting.md) — RFC8785 JCS, deterministic JSON, gotchas (floats, maps, timezones, Unicode, integer width)3273. [fingerprint-chains-and-integrity.md](fingerprint-chains-and-integrity.md) — Linked-hash and Merkle constructions, gap recovery, partial-trust verification3284. [signing-and-export-integrity.md](signing-and-export-integrity.md) — HMAC and asymmetric signing, key rotation, signature granularity, exporting subsets without breaking proofs3295. [decision-provenance.md](decision-provenance.md) — Linking outputs to inputs + ruleset version + code version3306. [immutable-storage-patterns.md](immutable-storage-patterns.md) — Append-only, encryption-at-rest (SQLCipher and alternatives), write-once-verify-many3317. [audit-aware-logging-vs-observability.md](audit-aware-logging-vs-observability.md) — The boundary rule, what crosses, what doesn't3328. [threat-model-for-audit-logs.md](threat-model-for-audit-logs.md) — Tamper, replay, time-shift, partial deletion, key compromise, insider, regulator subpoena3339. [retention-expiry-and-rtbf.md](retention-expiry-and-rtbf.md) — Cryptographic erasure, redaction-with-witness, segregated PII, legal-authority waivers33410. [partial-replay-from-trail.md](partial-replay-from-trail.md) — Reconstructing state from N entries, replay scope, state-coverage proofs33511. [performance-budget-for-audit-grade-pipelines.md](performance-budget-for-audit-grade-pipelines.md) — Stream-vs-amortise tradeoff, burst behaviour, write/read/verify budgets