connor / loot

connor/loot

Changes touching this path

  • every /private page rendered blank live because the private CSP, script-src self and wasm-unsafe-eval with no unsafe-inline, refused the two inline scripts TanStack writes into every page, its scroll restoration and the per-page $tsr SSR payload; each private document now gets a per-request nonce, minted by a request middleware in the new src/start.ts, stamped by the router on the scripts it writes through ssr.nonce read from that middleware context, and named in the policy the middleware sets on the response, so script-src still carries no unsafe-inline and injected markup cannot run. the start instance restates TanStack default CSRF middleware for server functions, which defining one would otherwise drop. the routes keep the nonce-less policy as the fail-closed fallback, /api/private/* and public pages carry no nonce, and /private now renders under vite dev too. a new test starts the built server and checks every inline script on three private pages carries the nonce its own response names, that nonces differ per response and that a public page has none; red under mutation, counts read each time: the router never given the nonce (3 failed, 2 passed), the middleware writing a policy without it (4 and 1), a constant nonce (1 and 7), unsafe-inline beside the nonce (1 and 7), the path test matching /privateer (1 and 7), each restored to green. ADR 0094 and CONTEXT.md are amended; 777 site tests pass; no migration and no forge change, site deploy only (#2335) aa34d4f1 · dbf3dbe6…
  • the private shell stops dying a minute after /account: it authenticated with Clerk 60-second __session cookie while no Clerk JS ran on /private to refresh it, so every private call 401d and a reload wiped the vault. per the operator grill (ADR 0096, reversing #930 dec. 4), Clerk JS now runs on the private routes, loaded on demand behind PrivateGate so public pages carry none, under the strict nonce CSP widened only for Clerk (its frontend API host read out of the publishable key, img.clerk.com, the Turnstile and protect hosts, and worker-src blob: for its session timers) with the request nonce passed to ClerkProvider; every private call goes through one privateFetch that sends a Bearer from getToken and retries once with a fresh token, and /api/private/* no longer accepts the cookie; the vault is wiped only when Clerk reports signed out or a different user, or on Lock, and an HTTP status never wipes it; signed-out /private renders SignIn in place and returns to the requested URL, and the private bar gains Sign out beside Lock. the vault, private shell and CSP comments and CONTEXT.md now say what is true: the wrap key can decrypt, so any script on this origin can recover the seed, and the wrap protects it at rest; the boundary is this origin script set, loot code plus Clerk. tests for the CSP, bearer lane, retry and wipe triggers and the built server, each red under a named mutation and restored; site gate 804 passed, every surface lighter; a CSP-enforcing signed-out load renders SignIn with no violation and /why loads no Clerk; workspace suite 4549 passed. the operator live check closes the ticket (#2396) 25ab3fa8 · dbf3dbe6…diff
  • the site loads clerk-js at the exact version the installed clerk-react was built with, not the floating major: both ClerkProviders asked the CDN for @clerk/clerk-js@5, which it answers with an uncached 307 to its newest release, so whatever Clerk published ran unreviewed on the page that holds the seed. vite.config.ts now defines __CLERK_JS_VERSION__ from tools/clerk-js-version.ts, which asks the @clerk/shared under @clerk/clerk-react for the clerk-js it was released with (5.127.1 today), and each ClerkProvider passes it as clerkJSVersion; the CDN serves that URL with no redirect and as immutable. no subresource integrity: the clerk-react loader takes no option for one. pinned in vitest: the version is exact, is the one the installed shared names, lands in the script URL clerk-react builds, every ClerkProvider under src passes it, and the build carries it. red under named mutations, each restored: the private gate without the prop (1 failed and 4 passed), the account page without it (1 and 4), the helper returning the major (3 and 2, and 2 and 3 with its check off), a typed 5.128.0 (1 and 4), shared resolved from the site (3 and 2), and the build without the define (1 failed and 7 passed). local trace, signed out, warm: the script comes from cache at 30 ms against 51 to 60 over the redirect, and Clerk.load still starts at about 137 ms either way, on the 100 ms poll in clerk-react. cargo test green, 4886 passed over 144 test result lines with 15 ignored, and the site gate green at 945 passed. CONTEXT.md and ADR 0096 say so. owes a site deploy (lzxtqwxq) f80b7345 · dbf3dbe6…diff
  • the site bundles @clerk/clerk-js 5.127.1 from the lockfile, pinned exactly at the version the installed clerk-react 5.61.9 was built with, and hands each ClerkProvider a Clerk that src/lib/clerk-instance.ts constructs once per document, through its Clerk prop, so clerk-react loads that instance at once where it inserted a CDN script with no integrity and polled window.Clerk every 100 ms. the clerk-js npm build is one module that carries its UI components and fetches no chunk at run time, 2.96 MB or 949 KB at gzip -9, which the private gate and /account load on demand; no public page fetches it, and on a build with a key each public surface weighs 21 to 29 B more for the import entry. the private CSP drops the Clerk frontend API from script-src and keeps it in connect-src. red under named mutations, each restored: the frontend API back in script-src (2 failed and 14 passed), a provider without the instance on the private gate or on /account (each 1 failed and 12 passed), clerkJSVersion beside the instance (1 and 12), a new Clerk per call or one kept across keys (each 1 and 12), /account constructing its own Clerk (1 and 12), clerk-js pinned at another version or at a range (each 1 and 12); on the built server, the frontend API in script-src and the instance imported eagerly by private.tsx (2 failed and 6 passed, one test each) and another expected version (1 failed and 7 passed). site gate green at 1142 passed; cargo test green, 5021 passed over 144 test result lines with 15 ignored. CONTEXT.md and ADR 0096 say so. owes a site deploy; also carries a comment on lnmntzxw with its live reading (svlsyqkr) 9388597a · dbf3dbe6…diff
  • the site writes every built asset URL under the origin VITE_LOOT_STATIC_ORIGIN names, when the deploy sets one, by making it the Vite base (site/tools/static-origin.mjs, which refuses a value that is not a bare https origin), so a Cloudflare-proxied static.loot.build can serve the scripts, stylesheets, fonts, images, the engine wasm and the bundled clerk-js while pages, /api/private and the forge stay on the VPS; the private CSP lists that origin in script-src, style-src, img-src, font-src and connect-src and in no other directive, and the byte gate and the tests that read the build map its hrefs back onto .output/public. unset, the build and the policy are as they were. ADR 0096, CONTEXT.md and the csp.ts header say Cloudflare is now inside the seed trust boundary, by the operator decision of 2026-10-01. red under named mutations, each restored: the origin out of connect-src (2 failed and 18 passed), in worker-src or in default-src (each 1 and 19), privateFetch built from BASE_URL and a path accepted as an origin (each 1 failed and 4 passed), hrefs on the origin left unmapped (the budget refuses, and 3 failed and 25 passed); on the built server with the origin set, a build that ignores it (5 failed and 9 passed) and a policy reading another variable (1 failed and 13 passed); unset, a base that defaults to the static host (6 failed and 13 passed). site gate green at 1158 passed both unset and with https://static.loot.build; cargo test green, 5026 passed over 145 test result lines with 15 ignored. owes a site deploy once the static host serves the assets with CORS (snmkuxnr) f8f0c71a · dbf3dbe6…diff
  • forge.loot.build serves the forge app beside the protocol and loot.build keeps the brochure, ADR 0103 decisions 1 and 2: site/tools/surface.mjs reads which routes are the forge app off each route import graph at build time, a route that reaches Clerk, the vault or a forge database other than the anonymous read tier, and the /k/ repo pages; one build serves both hosts, and start.ts sends a forge app route asked on any other host to the forge with a 308, a brochure page asked on the forge to loot.build with a 308 and the forge root to /private with a 307, while the root route beforeLoad makes a navigation that crosses a full page load and SurfaceLink writes a crossing link with the other origin. the loot.build header loses the Private tab and the key chip for one Open the forge door; the sign-in and the unlock card say a reader signs in and unlocks once more on the new host, and brochure pages delete the device database a browser kept on loot.build. the forge sets X-Content-Type-Options nosniff on every answer, and no_site_route_sits_at_a_path_the_forge_serves reads the site route tree against server::protocol_path_patterns, every Route at both mounts. ADRs 0096, 0099 and 0103 and CONTEXT.md say so. red under named mutations, each restored: a forge route served on any host, a brochure page sent to the forge and the forge root sent to the brochure (each 2 failed and 12 passed), dynamic imports unread (7 failed and 7 passed), the account capability gone (3 failed and 11 passed), the repo pages gone (1 failed and 13 passed); on the built server with a split, the host middleware dropped (3 failed and 2 passed); in loot-forge, nosniff off and a site route at a repo endpoint path (each 1 failed and 1 passed). site gate green at 1174 passed with no split and 1178 with one; cargo test green, 5048 passed over 146 test result lines with 15 ignored. owes a forge release and deploy, the scripts repo edge from setup-forge.js, then a site deploy (lrvstoyz) e1ddbc90 · dbf3dbe6…diff
  • the forge bar shows the signed-in account's Clerk avatar menu in place of the [ key ] chip (account and plan, this device's unlock and lock, sign out), reading who is signed in from the Clerk a page already loaded so a stranger's visit still fetches none, and fetched on the forge's pages alone (323 B per budgeted surface); the forge's / is its home, its /private sent there by a 307 so the rollback holds, with grants and the workbench left at /private; EXP marks the brochure's door and the forge's Repos and Grants by a data-exp attribute and never the account; ADR 0103 amended, CONTEXT.md Forge app, Private shell and Alpha build amended; site gate green at 1325 passed, the split and rollback builds' suites green, red under ten named mutations, each restored (vmusyoxz) 789f7003 · 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
  • an old /private/<owner>/<repo>/… address is a 307 to its /k/ workbench whatever shape the owner has: movedFromPrivate took only a 64-hex owner, so /private/o/r/… reached the handle route, whose database read answered the brochure's host a 500; private is a routed segment and so never a handle, and the home and plan page stay; the split build's 308 test and the nonce test ask for the workbench's current address, the 500 red-proved on a three-host build (rukvqypu) dd758825 · dbf3dbe6…diff
  • the two site tests that start the built server let it bind its own port: startBuilt in site/test/helpers.ts starts it on port 0 and reads the address it prints once it listens, where each test found a free port, released it and started the server on it, so a loopback server another test binary bound in between took the port, the built server exited, and that fixture answered /docs/quickstart with 404 inside a prove; reproduced with a 404 server on the picked port, which gives the sighting exactly; test files only, npm run gate 413 passed (wqspwslv) c30cebe5 · 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.