connor / loot

connor/loot

Changes touching this path

  • the browser mints the seed and the account binds the key: Clerk in the site's own routes, variant-B onboarding, and the account tier's one producer (#753) Migration 0007 adds account_seed (the passphrase-wrapped envelope, opaque ciphertext the server cannot open) and forge_identity, a NOLOGIN role scoped to exactly the identity tier -- SELECT/INSERT on tenant, SELECT/INSERT plus a column-scoped UPDATE of retired_at on account_key, the full row on account_seed, and nothing else (pinned live by forge_identity_is_scoped_to_the_identity_tier). The producer lives in site/src/server/identity/ behind a verified Clerk session (verifyToken in the site's own route handlers, reusing the millerbyte Clerk instance and pattern, never the gateway service). Registration is one transaction: upsert tenant on the verified clerk_user_id, add the key, store the envelope, retire what rotation names -- and never zero live keys. The Rust service still writes none of the tier; tests/account_tier.rs now guards that boundary instead of a vacancy. Onboarding is #487's variant B, the two-column contract: the app owns the 32 bytes (crypto.getRandomValues -> 24-word BIP39 over the ENTROPY, never the 64-byte derivation -> ed25519 pubkey via @noble/curves, held to the engine's from_seed by the pinned RFC 8032 vector), a WebCrypto PBKDF2+AES-GCM envelope, a .txt download that excludes the passphrase, and two consent checkboxes that no download waives. Clerk mounts only under /account, which joins /k/ on the prerender deny-list; every static surface stays static. Follow-ons filed rather than folded: #926 (CLI raw-seed import, so BIP39 recovery reaches the CLI) and #927 (account-aware may_push, burn entitlement via account, and the #506 historical-key 301s the anonymous read tier deliberately cannot serve today). 278e1886 · dbf3dbe6…
  • a browser-minted identity reaches the CLI: loot id recover decodes the 24-word phrase to the exact seed, and a shared vector holds both implementations to the same bytes (#926) fd153402 · dbf3dbe6…diff
  • loot login connects a repo to a forge account with a device code, ADR 0103 decision 5: the CLI keeps a 32-byte secret, opens a login with its SHA-256, prints the code and opens the forge app /device page, where the signed-in owner approves it over Bearer; an account with no key then takes the repo key as its first, wrapped in the terminal in the envelope /account writes, and an account with a key hands over its live keys and envelopes once, the passphrase unwrapping the chosen one here unless the repo already holds one and the previous repo key archived; the repo gains an origin or forge remote. site/src/server/identity/device.ts owns the rules over the device_login and device_login_miss tables that migration 0036 grants to forge_identity: a login is spent on use, ends LOGIN_TTL_SECS after its start and keeps only the hash of its secret, codes that match nothing are counted per account under an advisory lock, and polls are paced with slow_down. loot_identity::seed_envelope is that envelope in Rust, held byte for byte to seedblob.ts by two vectors pinned on both sides. ADRs 0103, 0066 and 0074, CONTEXT.md and the README say so. red under named mutations, each restored: the Rust writer with salt and iv swapped, and its key drawn from other bytes than the passphrase (each 2 failed and 5 passed); the site writer with salt and iv swapped (2 failed and 18 passed); in the CLI, the unwrapped key left unchecked against the key named, the old key deleted rather than archived, an origin rewritten and slow_down ignored (each 1 failed and 8 passed); migration 0036 granting UPDATE on device_login_miss (2 failed and 73 passed, one the checksum pin); a case-sensitive code (1 failed and 3 passed); on Postgres 18, the miss limit gone, keys read without spending the login, a first key registered over a key the account has, the decision taking the cookie and slow_down gone (each 1 failed and 29 passed). cargo test green, 5067 passed over 146 test result lines with 15 ignored; ci/local.sh on Postgres 18 ran every database suite green, the site live suites at 120 passed; site gate green at 1186 passed. owes a forge release and deploy, which applies migration 0036, then a site deploy (zqppqokk) d2258a27 · dbf3dbe6…diff
  • a test is kept only for a bug whose damage outlives its detection (ADR 0105, docs/agents/testing.md): disclosure, durable bytes, signed history, silent-pass refusals and machine contracts keep their tests, everything else is trusted or fixed fast, and assertions are on outcomes, never prose. the implementer brief asks that question before a test is written and owes a mutation proof only for a must-test pin. the suite is cut to it in one pass, Rust test functions 4848 to 1665, site vitest cases 1307 to 258 and SDK cases 160 to 64, with the living docs and comments that named deleted tests corrected and ADRs, tickets and released migrations left as history. cargo test green at 1945 passed with 6 ignored, the site gate green at 240 passed, the SDK at 75 passed with its one known macOS path failure from before the cut (ruwknvpw) 61f0184b · dbf3dbe6…diff
  • site and sdk production comments cut by 71% to the docs/agents/writing.md standard: history, ticket numbers, rosters and ADR retellings removed, security reasoning, browser quirks and directives kept; comment-only, the TypeScript AST without comments identical, built bundles unchanged but for the build stamp (yrkykmsn) d8c01375 · dbf3dbe6…diff
  • docs/agents/writing.md is the standard for comments and docs: a comment says only the why the code cannot, rg and loot log answer who-calls, which-members and when-changed better than a cached comment, and history, ticket numbers, rosters and emphasis are deleted on sight. AGENTS.md links it. CONTEXT.md, AGENTS.md, docs/agents, the skills, specs, READMEs, research and evidence are cut by about 65% to it, every cited heading, § number and test-pinned string kept; files the yrkykmsn ticket (yrkykmsn) 8e3c7b83 · dbf3dbe6…diff
  • the ADRs are cut by 71% to the docs/agents/writing.md shape: Context, Decision and Consequences in about a page each, amendments folded into the decision they amend, function tours, test counts, sweeps and ticket archaeology removed; every title, Status section, cited § and numbered decision kept. ADR 0103 folds in the vmusyoxz, snmzospn and xrqwmovz amendments and restores the operator rulings of 3e1a10ce that the loot-core comment land reverted (yrkykmsn) 0fc947d9 · dbf3dbe6…diff

Renames are not followed. loot's tree maps a path to an address, so a rename is a delete and an add. This list is the history of the name, not of the bytes.