Commit graph

12 commits

Author SHA1 Message Date
1086a3ba02 course refresh: the notebooks enter the SLH-DSA era
The 14-notebook course predated the post-quantum campaign entirely
(coherence findings 10, 11). Now, authored in the GENERATOR and
regenerated (AGENTS.md rule):
- notebook 06: new section 'The second signature that actually shipped:
  SLH-DSA' — the deterministic co-signature since tree size 14, chosen
  because the log attests its own parameter set's verify path (leaf 18,
  11 certs); absent-not-failed for older heads; determinism as an audit
  primitive; verify-only always. Plus a runnable keygen/sign/verify/
  re-sign-byte-equality demo (honest skip below OpenSSL 3.5) and the
  --slhdsa-public-key consumer flag in the policy list.
- notebook 09: the 'post-quantum line' is now three-legged — Ed25519
  proven-verify dogfood, SLH-DSA shipped-and-attested, ML-DSA required-
  but-honest-unavailable — with the closing point that a slot stops
  being aspirational the day its verify path enters the log; stale
  16/16 provenance count -> 44/44 (leaf 13 re-attestation).
- notebook 07: policy exercise extended with the co-signature question;
  00 course map goal updated; README course listing for 06/09.
- GENERATOR DRIFT REPAIRED in passing: notebook 10's cockpit cell had
  been added to the .ipynb but never backported to the generator —
  regeneration would have silently dropped it; the cell is now IN the
  generator and round-trips (19 cells, content identical).
Suite 157 green.
2026-08-22 21:18:01 +02:00
2587cc018b publish assets: sync the fail-open time bomb; llms/course/test docs refreshed (doc audit 2026-07-19)
REAL DEFECT found by the operator-ordered doc-freshness audit:
published_assets.py still carried the PRE-HARDENING fail-open verify.py
and the pre-Tier-2 README as the templates that log-publish drops into
the mirror — the next publish would have silently overwritten the
round-13-hardened fail-closed verifier and the corrected README with
the old versions. Fixed:
- published_assets.py regenerated from the canonical mirror files
  (byte-identity verified by round-trip exec), now also carrying
  verify_selftest.py; SYNC RULE documented in the module docstring.
- transparency_log.publish() now writes verify_selftest.py too.
- NEW tests/test_published_assets.py pins the security-critical markers
  (fail-closed FATAL, RECEIPT_TYPE, verify_receipt, --all receipt
  coverage, required fingerprint) so template drift fails CI instead of
  shipping.
- test_web_and_witness updated to the hardened verifier's markers —
  the published test log now passes FULL signature mode end to end
  ('RESULT: OK [full]'), a stronger assertion than the old string.

Doc refresh in the same pass:
- llms.txt: thirteen leaves + entry-13 self-attestation + fail-closed
  verifier; paper line -> new title, 23 pages, v0.2/v0.1 archives.
- Course (generator + generated 06b notebook): 'the git hash IS the
  content hash' -> 'the commit pins the exact source tree';
  'irrevocably part of the log every other agent sees' -> 'committed to
  the log's signed view, which any agent can compare' (the two Tier-2
  scope corrections had never reached the teaching material).
- test_paper_verifiers.py docstring rescoped: its 164k counts are the
  archived v0.2 report's citation; the current paper cites the corpus
  harness and makes no extensional-equality claim.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 13:10:55 +02:00
ea80c99244 curriculum: lecture 11 - the customer's-eye view (requirements card, wish-meets-supply, grow-the-supply)
Consolidates the consumer-side trust framing that was scattered across
notebooks 05/06b and WALLET.md into one on-ramp: the allowed-axioms list
as a requirements card you own and can write yourself; measurement vs
publication vs judgment (operator/log/you); the three honest outcomes
when your card is stricter than the supply (relax itemized / walk away /
grow the supply). Executable: a self-written card is shown to equal the
real APEX_BOUNDARIES cone exactly (supply == wish: True), and a strict
no-oracle card is REFUSED with the real SHA-512/wire gap itemized.
Registered in course map + notebook test; 101 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 22:16:05 +02:00
65772b3d2e warden hardening round: policy engine, ledger rotation, MCP UX, treasury LIVE, ops docs
Tier 2:
- request_signature decomposed into named gates (latch, freshness,
  intent, policy, signer, firewall)
- ledger: O(1) tail-read appends under a dedicated lock file (survives
  rotation rename); hash-chained segment rotation at policy
  ledger.rotate_at; verify-ledger walks all segments to genesis;
  archive tampering detected (tested)
- docs/threat-model.md (attacker matrix 1-9, proven-vs-trusted, design
  invariants) + docs/runbook-latch.md (diagnose-first recovery)
- lecture 10: executable corrupt-a-member exercise (capsule pin catches
  one appended byte), honest note on what the pin does NOT stop

Lightweight policy engine (POLICY_DENIED wired):
- policy.json: per-request/per-day amount ceilings, counterparty
  allow/deny lists, per-identity overrides; rules make their intent
  fields mandatory; daily sums from the ledger
-

Agent UX:
- signed refusal receipts travel inside MCP errors (receipt +
  receipt_path in structuredContent)
- airgap over MCP: request_signature signer=airgap + request_id,
  new airgap_pending tool; park -> list -> device answers -> complete
  (tested end-to-end)
- all 8 tools carry readOnly/destructive annotations
- sliding-window rate limiter per tool class (custody/verify/liveness);
  RATE_LIMITED refusal code; surface control, not ledgered

warden-treasury LIVE:
- treasury.py: stdlib base58, compact-u16, legacy+v0 wire parsing;
  every required signature quorum-verified over exact message bytes;
  completeness gap named in every verdict; RPC fetch uses response as
  bytes only
-
- live-quorum test: synthetic Solana tx signed with wallet key ->
  authentic via 4 proven forks; flipped byte -> not authentic

100 tests green (was 85).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 13:38:42 +02:00
ba47aa435d warden docs + study material: WALLET.md, products lineup, llms.txt, lecture 10
- WALLET.md: the product manual (one idea, trust posture table, R4 gate,
  quickstart, MCP surface, self-proving card, firewall, taxonomy)
- docs/products.md: four production-ready deployment profiles
  (solo/airgap/treasury/choir) with honest built-vs-wired boundaries
- llms.txt: agent-native discovery manifest at repo root
- README: warden intro + lecture 10 pointer
- notebooks/10_verified_custody_wallet.ipynb: ratchet-rule lecture (toy
  3-of-3 -> real four proven forks -> counterparty recomputes a card's
  inclusion proof); course README + notebook test updated
- 83 tests green

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 23:46:27 +02:00
47dfb61a7f Move the log service to ltl.zkdefi.org (root path); keep path-mount support
- serve/webdocs/cli default to base_path='' (own subdomain, root serving)
- webdocs link builder handles the empty base like web.py already did
- all docs, paper, notebook 06b, and published-mirror README point at
  https://ltl.zkdefi.org; DEPLOY.md rewritten for subdomain + redirect
- tests: root mount is the production shape; one test keeps exercising
  the path-mounted variant

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 19:14:52 +02:00
fbe40c3dfe The log goes public: git-published mirror, online service, witnesses
Three synchronized faces of one log - transport orthogonal to trust:

- PUBLISHED GIT MIRROR: log-publish exports the public face (one file
  per leaf so git history mirrors log history; the FULL STH history as
  the witness channel; per-component attestations + receipts; the
  provider public key; a standalone stdlib-only verify.py and customer
  README). Live at github.com/saymrwulf/lean-transparency-log (genesis:
  8 leaves incl. the honest failed-run entries, dogfood-signed head).
- ONLINE SERVICE (pacta_provider serve): read-only, zero-dependency
  HTTP with CT-style endpoints under a base path for
  zkdefi.org/lean-transparency-log - /v1/sth, /v1/sth-history,
  /v1/sth-consistency?first=N, /v1/proof, /v1/attestation, /v1/entries,
  /v1/metadata, /healthz - plus self-contained customer documentation
  at /docs (current state, attested components, API, the verify-
  without-trusting-this-site path, and the means/does-NOT-mean
  boundary). The process never loads private keys: heads are signed
  offline; a compromised server can withhold or replay (pinning +
  freshness detect both) but never forge. STH history now recorded
  append-only by the provider (with a backfill head signed for the
  existing log).
- AGENT ONLINE CLIENT: pacta log-fetch (download evidence; explicitly
  UNVERIFIED until receipt-verify runs - transport is not trust) and
  pacta sth-refresh (fetch head, verify signature, advance the pin via
  an online consistency proof from the pinned size; fail closed).
- WITNESSES: pacta witness-audit over a clone of the published mirror
  recomputes every prefix root from the public leaves and checks every
  historical head + signature - no consistency proofs needed when the
  leaves are public. Tampering one published entry trips both the
  leaf-hash check and the prefix-root check (tested). verify.py gives
  customers the same audit with zero installation.
- DEPLOY.md: the complete server-session checklist for zkdefi.org -
  reconstruct the servable log FROM the published mirror (the server
  stays in witness trust-position), hardened systemd unit, nginx/Caddy
  path routing, Forgejo mirror setup, the provider->world update
  cycle, and remote smoke tests.

Validated end-to-end on the REAL log: all 10 endpoints, online-fetched
proof re-verified locally through the dogfood verifier with pinning,
online pin refresh, publish + witness audit green, tamper caught,
standalone verify.py green in the published clone. 54/54 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 16:05:20 +02:00
b6382dd0ad Lecture 9: dogfood now bidirectional (sign mode + provider self-inclusion); notebooks README course list updated
Completes the piece dropped from the previous commit by a failed patch
anchor. All cells re-executed; 50/50 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:27:16 +02:00
19d25458e8 Mirrored lectures 6a/6b: the authenticated structure, drawn and domain-separated
The trust architecture has exactly two roles and the curriculum now
mirrors that split structurally - the conceptual burden is the design,
stated as such to the student:

- 06a THE PROVIDER'S SIDE (singleton). Domain banner in the provider's
  voice. The full build pipeline run live in a scratch log made from
  the REAL attestations: verify (Lean replay = the leaf-making step,
  the only expensive one - the shipped evidence IS its output) -> leaf
  (0x00 domain separation) -> tree -> STH signed via the MERKLEIZED
  LIBRARY -> the self-inclusion check embedded in the signature block.
  A generated SVG draws the student's own tree: leaves, internal
  nodes, root, and the signature box, framed in the provider's domain
  color. Closes with the singleton-vs-many justification table
  (key/cost/obligation asymmetry) and exercises.
- 06b THE AGENT'S SIDE (one of many). Domain banner in the agent's
  voice: you own the public key, the evidence files, ~25 lines of
  hashing - and explicitly NO Lean. The COMPLETE RFC 9162 inclusion
  verifier is implemented from scratch in one cell (hashlib only, no
  pacta imports for the core) and run against the REAL dalek receipt
  (leaf 4 of 8, three siblings, dogfood-signed root); then the STH
  signature, the provider's signing_provenance read and interpreted
  (why the agent still re-checks inclusion itself), the pin store, and
  an SVG of the real log with the agent's path highlighted against the
  grey leaves it never needs. Cost line: ~4 hashes + 1 signature.
- Lecture 06 now routes students into the pair and states the mirror
  rule ("if you cannot say which notebook a step belongs to, you have
  not understood the step"); lecture 09 records that dogfood now runs
  in BOTH directions; course map + README updated.

Every cell of 06a/06b/09 executed against the real evidence before
commit (SVGs render in Jupyter, fail soft in plain exec). One
generation bug found and fixed: a single-backslash \\x00 in the
generator produced a literal NUL byte in a cell. 50/50 tests green
with the notebook inventory at twelve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:26:32 +02:00
71c670527c REAL EVIDENCE: guarded replay of all four repos, attested, logged, dogfooded
The provider ran its full honest replay against the four verified
repositories on this machine - every Lean compile and axiom audit routed
through lean-guard (memory-capped, core-pinned, single-flight, ~30 min
per fork) - and the results are now shipped under evidence/:

- 16/16 certificates proven per fork, every axiom cone boundary-exact
  (the four apex tiers carry their fork's documented SHA-512/wire
  boundary axiom-for-axiom), each attestation pinned to the exact repo
  commit (dalek 8ded7bc, anza 673c15e, risc0 98a13a6, betrusted
  81f614a) and Ed25519-signed.
- All four appended to the persistent transparency log. The log holds
  EIGHT leaves: the first four are the initial run's attestations,
  which honestly recorded an AUDIT FAILURE (the two pacta bugs fixed in
  e87f0e8) - an append-only trust ledger keeps its bad day, and the
  fixed run's leaves sit beside it.
- Every receipt re-verified through the FULL stack: dogfood verifier
  (backend verified-dalek-serial recorded), STH pin store, freshness
  policy. Receipts are freshly issued against the final tree (a stale
  mid-run receipt tripped the pin store's rollback defense exactly as
  designed; the rollback diagnostic now hints at idempotent re-issue).
- The capstone consequence ran for real: pacta agent with trusted
  provider + signature via the proven path + required receipt + pin
  store + --require-verified-verifier built the R4-gated library
  capsule from ATTESTED evidence (no local Lean replay needed by the
  consuming agent).

Docs and teaching updated against the real artifacts: evidence/README
(inventory + re-verify instructions), README "Real Evidence" section,
lecture 5 now re-derives 16/16 verdicts from the REAL dalek attestation
(signature checked on the proven path, provider labels ignored), and
lecture 6 verifies all four REAL receipts and walks a fresh pin store
over them. Every changed notebook cell executed before commit. 49/49
tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 14:54:48 +02:00
4a37da8fd9 Curriculum: the ratchet rule, the four-tier reality, and lecture 9 (dogfood)
The notebooks now carry the same didactic contract as the companion book
(the "ratchet rule", stated in the course map): every load-bearing idea
runs twice - napkin scale, then real scale - and every pair is EXECUTABLE
in the notebook, not narrated.

- Lecture 1: the truth boundary updated to the proven four-tier apex,
  with the what-is-still-NOT-proven list (SHA-512, parsers, signing,
  wallets) given equal weight.
- Lecture 2: napkin/real scoring pair - a two-certificate toy card
  scored in your head, then the shipped sixteen-certificate R4 fixture
  through the same function, residual blockers and per-tier boundary
  axioms printed.
- Lecture 6: new split-view section. A runnable equivocation drill:
  pin a two-leaf view, grow it honestly with a consistency proof, then
  present a forged same-size root and watch the pin store name the
  attack. Real-scale pointers to --sth-store, log-consistency,
  log-audit, and the freshness policy; a new exercise asks students to
  construct the lie a size-only anchor check would miss.
- Lecture 7: the wallet gate now swings BOTH ways on real evidence -
  a partial card denied at R3, the shipped R4 card allowed - both
  runnable.
- Lecture 8 capstone: "design R4" became "audit R4": read the shipped
  card like an auditor, then design the R5 discharge plan (parser
  specs, verified SHA-512, signing-side, per-fork production-path
  mapping).
- NEW Lecture 9, "Eat Your Own Dogfood": the honest coverage ledger of
  the proven-path verifier; a napkin PEM decode (the fixed 12-byte
  Ed25519 SPKI prefix, read with your eyes) paired with the mechanical
  extraction; live backend dispatch; the fail-closed
  --require-verified-verifier policy; and the hybrid-PQC section -
  proven-classical Ed25519 plus a required-but-honest ML-DSA slot
  ("blockers get fixed; placeholders get trusted").

Every code cell of the changed notebooks was executed end-to-end before
committing (outputs stripped per house rules). 49/49 tests green with
the notebook inventory updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 10:18:06 +02:00
5da353b31e add proof-aware crypto curriculum notebooks 2026-07-03 14:42:59 +02:00