RAIA™ Specification

3.41 Work-Item Audit Dossier — Proof of What Was Done, Who Did It and Who Reviewed It

When we finish a piece of property-admin work, that work leaves a receipt. The receipt is a single zip file you can hand to a customer, an insurer, a solicitor or a tribunal: it says what the job was, which person or AI produced it, and which human approved it, and it carries a fingerprint so anyone can check the file was not altered after it was issued. Checking it takes one command and no internet connection. It is a record of our own work, not a certificate from a third party — so if you need to prove nothing was changed, keep the fingerprint we give you when you download it.

← Back to Developer Hub TEXTBOOK SPECIFICATION
🧩 In Plain English

When we finish a piece of property-admin work, that work leaves a receipt. The receipt is a single zip file you can hand to a customer, an insurer, a solicitor or a tribunal: it says what the job was, which person or AI produced it, and which human approved it, and it carries a fingerprint so anyone can check the file was not altered after it was issued. Checking it takes one command and no internet connection. It is a record of our own work, not a certificate from a third party — so if you need to prove nothing was changed, keep the fingerprint we give you when you download it.

1
Dossier per work item — one immutable zip, scoped to a single job_id
6
Files inside: manifest, three dossier records, the verifier and a README
1
Command to verify offline — node verify-audit-dossier.mjs .
0
Dependencies and no network access needed by the verifier

Part 1 · ELI5 What a Work-Item Audit Dossier Is

Every job we do — chasing a certificate, serving a notice, reconciling a rent ledger — is stored as one work item. The audit dossier is that work item turned into a file you can keep. It is not a screenshot and not a PDF export: it is a small zip containing machine-readable records plus a fingerprint chain over every byte, so a stranger can confirm nothing inside was edited after we issued it.

The artefact is called a dossier. Our vocabulary rules make “dossier” the canonical noun and forbid “bundle” as a synonym for the artefact. The download URL and the button label still say “audit-bundle” — that spelling is frozen by a CI check and is not an accident. Same thing, two spellings for historical reasons.

ONE WORK ITEM → ONE DOSSIER → ONE ROOT HASH WORK ITEM tbl_actions.job_id status · class · origin mandate block THE ZIP (stored, not compressed) manifest.json · bundle_hash dossier/work-item.json dossier/producer-attribution.json dossier/human-reviews.json README.txt · verify-audit-dossier.mjs five hashed entries, chained in this order SHA256 CHAIN chain = sha256(prev + ":" + file) genesis = sha256(schema) any changed byte fails ROOT HASH PASS … root_hash=… recorded out-of-band from X-Audit-Bundle-Root-Hash NOT signed · no PKI · no trusted timestamp · no blockchain anchor — integrity only, so keep the header
Figure 1: One work item becomes one dossier; five hashed entries chain to a root hash that is also sent in the download response.

Part 1 · ELI5 What the Dossier Proves

  1. 1
    The work item existed, and in what state

    Its identifier, organisation, reference, status, whether it has reached a terminal state, its readable work class and type, the timestamps, and who or what produced it at source.

  2. 2
    What produced it, row by row

    Every AI usage ledger row attached to that work item: producer origin, model, billable class, tokens, outcome and attempt count. The copy is taken from the ledger column, never inferred by the exporter.

  3. 3
    Which human reviewed it, and when

    The review decision, how long it sat in the queue before a decision, a pseudonym for the reviewer, and the rule version that was in force when the reviewed message went out.

  4. 4
    That the file you hold is the file we issued

    A sha256 chain runs over every entry in order and ends in one root hash. Change one byte anywhere and the chain check fails. The same root hash is also sent back in a response header when you download the dossier, so you can keep it somewhere else.

Part 1 · ELI5 What the Dossier Does Not Prove

Read this before you rely on a dossier in a dispute

A dossier proves that the contents are internally consistent — that the files match the fingerprint chain and the manifest that came with them. It is not signed. There is no public-key signature, no certificate authority, no trusted timestamping service and no blockchain anchor in this format.

  • No signature, no PKI. Nothing in the zip is cryptographically signed. If you edit a payload and recompute the whole chain and manifest, the verifier will report PASS. The verifier proves integrity against the manifest it is given, not authorship.
  • The verifier ships inside the artefact it verifies. That is why the root hash from the download matters: it is the one piece of evidence we give you through a separate channel.
  • No external timestamp authority. Timestamps inside the manifest are the issuing server’s clock, nothing more.
  • No mandate enforcement. The dossier records the authority under which a write happened, but the mandate service is not live yet — so today that block honestly reads unavailable. See the mandate block.
  • It attests exactly the files the manifest names — no more, no fewer. The verifier reads the entry list inside manifest.json and checks those files. It does not compare the folder you were given against that list. So a file added to the folder after the dossier was issued is invisible to it: the run still prints PASS. Nothing chained is weakened, but do not read a pass as “this folder contains nothing else”. This is recorded as defect F1 in ADR-453 §D8 and closes before the first third-party issue.

Part 1 · ELI5 The One Thing You Must Do: Keep the Root Hash

When the dossier is downloaded, the response carries the header X-Audit-Bundle-Root-Hash. Record that value outside the zip at the moment of download — in the ticket, in an email to the other side, in a ledger, or in a signed letter. It is the only anchor the export offers, and it is what turns “the file verifies” into “this is the file we were given on that date”. And never treat the root_hash printed inside manifest.json as corroboration — it travels with the file, so a forged dossier carries a matching one. Compare against the value you recorded, never against the value the artefact hands you.

# Save the dossier and its root hash in one step
curl -OJ -D headers.txt \
  -H 'Cookie: <your staff session>' \
  'https://app.estateaigents.com/api/work-items/<work-item-id>/audit-bundle'

grep -i x-audit-bundle-root-hash headers.txt
# → X-Audit-Bundle-Root-Hash: 5f0c…  (put this in the ticket, not in the zip)

Part 1 · ELI5 How a Third Party Verifies It Offline, in One Command

  1. 1
    Unzip it

    Any unzip tool. The archive is stored, not compressed, so it is readable by anything.

  2. 2
    Run the verifier

    node verify-audit-dossier.mjs . from inside the unzipped folder. Node 18 or newer. No packages to install, no network call, no RAIA (Real estate Artificial Intelligence Agent) software.

  3. 3
    Read the answer

    Either PASS raia.audit-dossier/1 work_item=… root_hash=… with exit code 0, or FAIL: <reason> with exit code 1. The root hash printed on a pass should equal the one you recorded out-of-band.

Part 1 · ELI5 What “Unavailable” Mandate State Means Today

A write made on someone’s behalf should be able to show the authority it was made under: which mandate, granted by which principal, and in what state at the moment of execution. The dossier has a place for exactly that — but the mandate service is a later build step, so in every dossier issued today the block reads:

"mandate": {
  "mandate_id": null,
  "principal_id": null,
  "mandate_state_at_execution": "unavailable",
  "captured_at_execution": false
}

That is a statement about our own plumbing, not a finding about the work. It does not mean the work was unauthorised; it means we cannot yet stamp the authorisation into the artefact. We would rather show an honest gap than a field that looks filled in. When the mandate service lands, dossiers will carry the real values and the schema stays at version 1, because no dossier has been issued from a branch.

Part 2 · User Guide Where the Button Is

Export audit bundle

On the work-item card in the actions list, next to “View conversation”. One click downloads the zip for that single work item. The filename is audit-bundle-<job_ref or job_id>.zip, with anything outside letters, digits, dot, dash and underscore replaced by an underscore.

Who can export

Any signed-in staff member with inbox scope. A non-admin is pinned to their own organisation and gets 403 Forbidden for a work item in another organisation. There is no public or agent-facing route to this endpoint.

What it does to the system

Nothing. Export is read-only: no state change, no queue entry, no notification, no ledger row. It is safe to export the same work item repeatedly; each download is a fresh build with a fresh generated_at and a fresh root hash, so record the header every time.

Part 2 · User Guide Sending a Dossier to a Customer or Insurer

  1. 1
    Export the specific work item, not the conversation

    One dossier covers one work item. If the dispute spans several jobs, send several dossiers and say so; do not describe a dossier as covering a whole tenancy.

  2. 2
    Record the root hash out-of-band

    Copy X-Audit-Bundle-Root-Hash from the download into the ticket and, ideally, into the covering email. The recipient needs it from a channel other than the zip to say anything about integrity — the same value is written inside manifest.json, so a value read from the artefact proves nothing.

  3. 3
    Say what it is, and what it is not

    “A hash-chained record of one work item we can both verify offline” — not “signed”, not “sealed”, not “notarised”, not “blockchain-anchored”. Those words are wrong and will cost you credibility in front of anyone technical.

  4. 4
    Point them at the README, not at us

    README.txt inside the zip states the contents, the verify command, the redaction posture and the review-linkage caveat. A recipient who needs no support from us is the point of the design.

Part 2 · User Guide What Is Redacted, and Why

Live work-item titles carry tenant names and addresses — flat numbers, building names. So the title is not exported in readable form. Nothing an operator needs in order to explain the work is lost: the readable label is the work class and action type, and the identifiers stay stable.

FieldIn the dossierWhy
Work-item titletitle_sha256 digest onlyTitles contain tenant names and flat numbers.
Description, notes, contextsha256 digests onlyFree text can carry anything; a digest still lets the two sides compare a known original.
Person and conversation idssha256:… pseudonymsProves linkage without disclosing who.
Reviewer and approval idssha256:… pseudonymsProves a distinct human decided, without naming them.
Work class, action type, status, terminal flag, timestampsVerbatimThese describe the work, not the people in it.
AI usage ledger rowsVerbatim, per rowModel, tokens, outcome and attempt count are the attribution evidence.
Review decision, queue seconds, rule_id_at_sendVerbatimWhat was decided, how fast, under which rule version.
Compliance valuesCopied from the databaseNever asserted by the exporter (L3-8).

Part 2 · User Guide Explain Review Linkage Carefully

Two things that get read wrongly

Human reviews are attached through the work item’s conversation — review message, then conversation, then work item — because the review queue table has no work-item column populated in live data. So a review listed in a dossier may concern a sibling work item in the same conversation. And review_linkage: "unavailable" means no review could be linked, never “no human reviewed this”.

Read the field before you characterise it:

review_linkageWhat it means for the reader
message→conversationReviews were resolved through the work item’s conversation. Each listed review belongs to that conversation; it may belong to a sibling work item in it.
unavailableThe work item has no conversation, so nothing could be linked. It is not evidence that no human reviewed the work.

Part 2 · User Guide Which Tables Feed a Dossier

TableWhat it contributes
tbl_actionsThe work item itself: status, class, producer origin, timestamps, mandate context captured at execution.
tbl_ai_usage_ledgerProducer attribution, row by row — model, tokens, outcome, attempt count.
tbl_conversation_messagesThe bridge from the work item’s conversation to review messages.
tbl_human_review_queue_metricsReview decisions, queue seconds, reviewer pseudonym source.
tbl_message_approvalsThe rule version in force when the reviewed message went out (rule_id_at_send) and the approval action.

Every read is fully paged. A read that would exceed the page cap fails the request rather than shipping a total taken from a truncated result — so a dossier is never silently short.

Part 3 · Developer Guide The Endpoint

GET /api/work-items/{id}/audit-bundle
  ?org_id=<optional organisation id>     # non-admin callers are pinned to their own org
PropertyValue
Path parameterid — the work item id (tbl_actions.job_id), UUID. Anything else is 400.
GuardrequireInboxScope — staff session only. Organisation isolation is enforced in the handler because the service-role client bypasses RLS.
Statuses400 invalid id · 403 work item in another organisation · 404 not found · 500 read failure (never a partial artefact).
Content typeapplication/zip, Content-Disposition: attachment, Cache-Control: no-store.
Anchor headerX-Audit-Bundle-Root-Hash — the root hash of the chain, for out-of-band recording.
CompressionZIP entries are stored, not deflated — bundles are small text and deflate would only add a dependency.
Runtimenodejs, dynamic = force-dynamic.

Part 3 · Developer Guide What Is Inside the Zip

PathContentsHashed entry
manifest.jsonSchema version, generation stamp, entry list with per-file sha256 and chain hash, root hash, canonicalisation and redaction declarations, and its own bundle_hash.No — it carries the chain
dossier/work-item.jsonThe PII-minimised work-item record, including the mandate block.Yes
dossier/producer-attribution.jsonWork-item producer origin, ledger counts by origin, and every ledger row verbatim.Yes
dossier/human-reviews.jsonreview_linkage plus its explanatory note, review count, and each decision with queue seconds, reviewer and approval pseudonyms, rule_id_at_send and approval action.Yes
README.txtContents, the verify command, redaction posture, review-linkage caveat, completeness and mandate notes.Yes
verify-audit-dossier.mjsThe offline verifier. Zero dependencies, no network.Yes

The five hashed entries are chained in exactly that order — work-item.json, producer-attribution.json, human-reviews.json, README.txt, verify-audit-dossier.mjs. manifest.json is not an entry; it is protected by bundle_hash instead.

Part 3 · Developer Guide Canonical JSON and the Hash Chain

Schema version, stamped inside the manifest and re-checked by the verifier:

raia.audit-dossier/1

Canonical JSON and chain, verbatim:

canonical JSON = sorted object keys, JSON.stringify scalars, array order preserved
chain_hash_n   = sha256(chain_hash_{n-1} + ":" + file_sha256_n)
genesis        = sha256("raia.audit-dossier/1")
bundle_hash    = sha256(canon(manifest minus bundle_hash))
  • The canonicaliser is deliberately simple — not RFC 8785 / JCS — so a third party can re-implement it in any language from these four lines.
  • root_hash is the last chain hash. bundle_hash covers the chain entries and every manifest field, so tampering with the manifest’s own metadata is caught too.
  • Do not change the algorithm or the canonicaliser without bumping BUNDLE_SCHEMA: dossiers already issued must keep verifying forever.

Part 3 · Developer Guide The Verifier Contract

node verify-audit-dossier.mjs [dossier-dir]     # default: .
PASS raia.audit-dossier/1 work_item=<id> root_hash=<hex>      exit 0
FAIL: <reason>                                                exit 1
BehaviourDetail
RuntimeNode 18 or newer, ES module, imports only node:crypto, node:fs, node:path.
InputsThe unzipped directory. Reads manifest.json and each entry path named in manifest.entries.
Checks, in orderschema version → entry file present → per-file sha256 → chain continuity → root_hash → bundle_hash over the manifest without that field.
Failure modescannot read manifest.json, unexpected schema_version, missing <path>, content hash mismatch for <path>, chain broken at <path>, root hash mismatch, manifest hash mismatch.
NetworkNone. Verification works air-gapped.
GuaranteeAny changed byte fails. Proven by a tamper test in the test suite, and the verifier is executed against a fixture dossier there so it cannot rot silently.
Non-guaranteeAuthorship. A full re-forge — payload edited and chain recomputed — verifies PASS. The external anchor is the response header, nothing else.

Part 3 · Developer Guide dossier/work-item.json Field by Field

FieldShape
job_id, organisation_id, job_refVerbatim identifiers.
title_sha256sha256:… over the canonical form of the title. The verbatim title is never exported.
status, terminalStatus string, and true for completed or cancelled.
priority, work_kind, action_type, producer_origin, ai_ownedVerbatim — the readable label for the work.
created_at, updated_at, closed_at, closed_reasonVerbatim timestamps and terminal reason.
subject_refs.person, subject_refs.conversationsha256:… pseudonyms.
redacted_digests.description_sha256, notes_sha256, context_sha256sha256:… over the canonical form of each value, or null.
mandatemandate_id, principal_id, mandate_state_at_execution, captured_at_execution.

Part 3 · Developer Guide The Mandate Block

Required by §4.3 of the A2A write-scope brief: a dossier that cannot prove the authority under which a write happened is not tribunal-grade. There is no dedicated mandate column yet, so the three values are read from what the execution path captured on the work item at execution time — never reconstructed from a mutable grant row.

  • Nothing captured ⇒ mandate_state_at_execution: "unavailable", captured_at_execution: false. Never “granted” by default.
  • The mandate service is a later step in that brief; until it lands, every dossier reports unavailable. Nothing else in this page should be read as mandating being live.

Part 3 · Developer Guide How Reviews Are Resolved

tbl_actions.conversation_id
  → tbl_conversation_messages.message_id
    → tbl_human_review_queue_metrics (by message_id, scoped by organisation_id)
      → tbl_message_approvals.approval_id  (rule_id_at_send, action)

Use this join rather than tbl_human_review_queue_metrics.work_item_id, which is NULL in every live row. Reviews are sorted by decided_at, and approval ids are fetched in chunked in (…) queries so no list of ids becomes an unbounded request URL.

Vocabulary, frozen on purpose

The artefact noun is dossier — canonical in the raia-protocol glossary, where bundle is a forbidden synonym. The URL path /api/work-items/{id}/audit-bundle and the button label “Export audit bundle” keep the old word because the card and a CI probe froze those exact strings. Do not “fix” one without the other.

Part 3 · Developer Guide Provenance and Open Items

ItemState
BuildShipped in PR #3868 for issue #3865. Route, builder and verifier live in the portal.
CanonicaliserFollows ADR-375 §Determinism contract item 3 — sorted keys, UTF-8, no insignificant whitespace, schema version stamped.
Chain modelThe sha256 predecessor chain already used by the evidence log (ADR-003, ADR-010) and the append-only hash-chained ledger (ADR-431). The format is normative in this module and restated in manifest.chain_format.
Rule version at sendrule_id_at_send per ADR-452 K6 — the rule in force when the reviewed message went out, not today’s rule.
Mandate block§4.3 of 03_technology/architecture/briefs/a2a-write-capabilities-scope-2026-11.md.
Format ratificationRatified by ADR-453 (Accepted 2026-11-03, merged as PR #3877) — raia.audit-dossier/1 is accepted as built, with the canonicaliser (§D2), the chain (§D3) and the manifest hash (§D4) normative. ADR-453 §D8 records four defects (F1–F4), of which F1 (the verifier does not assert the file set) and F2 (the anchor is not independent) block the first third-party issue; both are verifier/producer hardening within /1, so no schema bump is involved. The earlier “architect-reviewed under ADR-452” claim was withdrawn from the source and must not be repeated: ADR-452 contains no chain-format section (card t_640b64c4, which was believed to cover it, became ADR-452 and does not), and ADR-453 is the plate that closed that gap.
Known limitNo signature or external anchor. A full re-forge verifies PASS; the response header is the only out-of-band evidence. Deliberate for v1, stated in the README inside every dossier.
Known limit — file setThe dossier attests exactly the files the manifest names. The shipped verifier walks manifest.entries and does not compare the delivered directory against that set, so a file added to the folder after issue is not detected (ADR-453 §D5, measured P4b). Integrity of the chained files is unaffected; the claim “this is everything that was attested” is what needs the fix, and it lands as verifier hardening within /1 before the first third-party issue (ADR-453 §D8 F1).

References Sources

  • PR #3868 · issue #3865 — the build this page documents
  • 03_technology/11_frontend/portal/src/app/api/work-items/[id]/audit-bundle/route.ts — the endpoint
  • 03_technology/11_frontend/portal/src/lib/audit-bundle.ts — builder, canonicaliser, ZIP writer, embedded verifier
  • 03_technology/11_frontend/portal/src/lib/__tests__/audit-bundle.test.ts — build, verify and tamper tests
  • 03_technology/architecture/decisions/ADR-453-audit-dossier-hash-chain-format.md — raia.audit-dossier/1 ratified format: §D1 ratification, §D2 canonicaliser, §D3 chain, §D4 manifest hash, §D5 artefact set, §D6 anchor posture, §D8 recorded defects
  • 03_technology/architecture/briefs/a2a-write-capabilities-scope-2026-11.md §4.3 — mandate block and ledger-as-accountability-record
  • 03_technology/architecture/decisions/ADR-452-future-proofing-amendments.md — K6 (evidence-authority failure) rule-version-at-send; also §D3, where the audit-and-evidence console and the audit-bundle export action sit inside the UI-investment-freeze exemption. It contains no chain-format section.
  • 03_technology/architecture/decisions/ADR-375-graph-engineering-reduce-deterministic-fan-in.md §Determinism contract item 3 — sorted keys, UTF-8, no insignificant whitespace, schema version stamped (the canonicaliser binds this item to a byte-level definition; see ADR-453 §D2)
  • 03_technology/architecture/decisions/ADR-003-property-diary.md §3 (the Hash: field) and ADR-010-future-proofing-principle.md — the predecessor-chain integrity model this format reuses, and the principle that keeps the anchor value shaped so a signature can be attached later without redesign
  • 03_technology/architecture/decisions/ADR-431-autonomous-remediation-authority-boundary.md D1 item 3 — signed manifest where a machine claims authority; cited as the boundary that makes an unsigned /1 coherent, not as a requirement on it