Deus Witness - evidence pack
============================

What this is
  A copy of ONE tenant's append-only ledger (ledger/ledger.cose: one hex COSE_Sign1 entry per line, SHA-256 hash chain,
  every entry signed by the witness key in manifest.json), the signed checkpoints, the signed receipts (AAR) of allowed actions,
  the key registry record of the owner's passkey, and - when present - OpenTimestamps proofs of the checkpoints.

How to check it (offline, Python 3.10+, `pip install cbor2 cryptography`; `opentimestamps` is optional for anchors)
  python -I verify_pack.py .                (add --offline to skip the block-explorer cross-check)
  IMPORTANT: take verify_pack.py (and its modules) from a SOURCE YOU TRUST - the wheel deus-witness or the file whose SHA-256 the
  service publishes - NOT from this pack: a pack can carry a doctored checker. The copy in verify/ is for reference; compare its
  hashes with the published ones. Running it from here needs the flag --use-pack-code and trusts the pack's author.
  Last line: RESULT: VALID or RESULT: INVALID. Exit code 0 / 1. A line "complete as of <UTC> (seq N)" says up to which ledger entry
  the pack is complete (manifest.cose is signed by the witness key; the ledger must end with that checkpoint).
  An independent checker written in Swift: aarc-wa verify-pack <folder>  (does not check anchors).

What it proves
  - the ledger is intact: no entry removed, reordered or altered (hash chain, witness signatures);
  - every mandate and approval in it was signed by the passkey pinned in registry.json (WebAuthn profile of draft-deus-aar-04,
    verify/wa_profile.py) and every decision of the witness is reproducible from the ledger (verify/svidetel_v4);
  - the pack is complete as of the time and checkpoint printed by the checker (nothing after it is shown, nothing before it was cut);
  - each receipt in receipts/ is signed by the witness and is the RECEIPT entry at its position in the ledger;
  - an anchor, once Bitcoin-confirmed, shows that the checkpoint existed before that block.

Team packs (folder org/ present; checker lines "org policy", "quorum", "batch approvals")
  - org/policy-v<N>.cbor is the signed policy of the organisation (members by key id and label, roles, rules), org/policy-v<N>.env.cbor
    its signature: version 1 by the owner's pinned passkey, every next version by the quorum that the PREVIOUS version requires;
    org/chain.json gives for each version the witnessed time it took effect and the registry_log row that recorded it.
  - Proved: the chain is unbroken and starts at the pinned key; every mandate, approval, revocation and ceiling in the ledger carries
    signatures of members that, together, meet the rule of the policy IN FORCE AT THE ENTRY'S TIME (second pass), approval rules taken
    from the action of the matching RECEIPT; a batch approval (one passkey ceremony for up to 20 items) is counted in "batch approvals".
  - NOT proved: the TIME at which a policy version took effect rests on the witness's clock and honesty (the same trust as the time
    of any ledger entry); who pressed "reject" before a quorum was reached; observers; the names behind labels.
  - Only the Python checker understands team envelopes (wq, wb): the Swift checker (aarc-wa) answers INVALID WA_MALFORMED on a team
    pack - that is expected in 0.2.
Coverage and advice
  - coverage/<agent>.json is what the operator's proxy DECLARED about its own set-up (level C0..C3, bypasses): a statement, not evidence.
  - advisory/<rid>.json: a human's signed decision to release (or reject) an action held by the advisor; the checker verifies the
    signature; the advisor's opinion itself is heuristic and proves nothing.
Time-stamps (RFC 3161, second anchor)
  - anchors/<batch>.tsr.<tsa> is a time-stamp token of a third-party TSA over the same batch root as the Bitcoin anchor; the checker
    verifies it offline against anchors/tsa-ca/<tsa>.pem. A TSA is a TRUSTED third party (unlike Bitcoin): compare the root
    certificates with the ones the TSA publishes, or pass --tsa-ca=<dir> with roots you trust. No revocation check (offline).
    These stamps are NOT qualified time stamps (eIDAS): they show when the TSA saw the root, as far as you trust that TSA.

What it does NOT prove
  - that the witness key in manifest.json is the real service key: compare kid_hex/pub_hex with https://<service>/v1/witness;
  - what the human saw when signing (see section "honest limits" of the profile: the page is served by the witness);
  - that the owner's passkey was pinned to the right person at registration (pin source: webauthn-registration);
  - that an agent did not bypass the proxy; DLP is a literal match and a paraphrase evades it;
  - actions the witness was never asked about.
