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… - the collaborator can read someone else's namespace: migration 0015 adds the fourth role forge_member and eleven forge_member views, one per relation 0009 serves, so the shared prefix-parameterised TreeReader reads either family unchanged - and the gate is strictly stronger than 0009's, because the app names only the account the Clerk session resolved to while the membership join sits INSIDE the barrier view, so the application cannot name a repo it is not a member of even by mistake. metadata_public is absent as both column and predicate, and repo_member is named exactly once, by the gate. Two premises did not survive, and the first is a defect in the decision itself: ADR 0077's and the ticket's literal current_setting of loot.reader_tenant cast to bigint DOES NOT fail closed. It fails closed for an UNSET parameter and not for a CLEARED one, because set_config with NULL leaves the empty string behind and casting that to bigint RAISES - which 0009 never met because decoding an empty string as hex does not. Proved by removing the fold from the shipped migration and reading invalid input syntax for type bigint, so the gate ships as nullif and then the cast, malformed values still raise deliberately, and withMember validates a positive decimal with the pin on both sides. The second is a defect in #1727, which landed earlier tonight: its exact-set spelling, that the views naming repo_member equal the forge_member family, is satisfiable ONLY by a family of one, because the ten chained views name the GATE view and never the base table - so a second member view gaining the roster, which is precisely the disclosure ADR 0077 forbids, read as CORRECTNESS under the old spelling. It is re-spelled to exactly forge_member_repo whenever the family exists, its vacuity guard extended to require the member family non-empty, and its positive control now plants four breaks where it planted two. The row-level-security interaction is proved rather than assumed, as three readings on one database in one moment: the seven enabled tables this family reads really carry relrowsecurity, read as a set; the role handed a direct SELECT on repo reads ZERO rows, which is 0014's own named accident and shows the policy system live for that role; and the same role on the same connection at the same moment reads its repo through the gate view and gets one. The mechanism is then named from the catalogue and red-proved by setting security_invoker, which takes the read to insufficient_privilege, and the failure text names the non-superuser deployment case so a future deploy diagnoses itself. The isolation break is ADR 0077's own named careless shape rather than an invented one - the gate keeps its repo_member join and loses only the correlation to repo, which passes every text guard in migrate.rs - and seven of eight tests fire on it. Rows are planted from tests and from the site, outside account_tier.rs's scan of src, the way rls.rs already recorded, so the tripwire is untouched and green. forge_member ships NOLOGIN and provisioning is a different repo, so the class answers 404 rather than 500 and is not an existence oracle (#1726)
e76ca863 ·diffdbf3dbe6… - two concurrent key rotations can no longer leave an account with no live key, which is a lockout because a key that is not live is refused the sync read, the push and the burn: the floor in site/src/server/identity/identity.ts is a count, the BEGIN it runs inside is the postgres default READ COMMITTED, and two registrations that each retire the key the other leaves live write different rows, wait for nothing, each count the other as live and both commit. registerKey now selects the key rows of that account in account_key under FOR UPDATE, ordered so two waiters take them in the same order, before it writes any of them, so the second registration waits and then counts a state that has stopped moving; and identity/db.ts stops rewrapping a refusal raised inside a transaction as a plain Error, which had been answering every one of them with the anonymous 500 rather than the 422 that carries the sentence the account page renders. the ticket preferred a database constraint and that was the right thing to prefer, but a floor of this kind says a row must EXIST, which a declarative postgres constraint does not say, and the trigger that would say it was measured failing on a throwaway cluster: with a DEFERRABLE INITIALLY DEFERRED constraint trigger counting live rows over a table shaped like account_key, two sessions each retiring the row the other left live both committed and zero live rows were left, because a deferred trigger fires at commit and still reads its own snapshot. what closes the race is a lock either way, so it is taken where it needs no migration, the forge release chain no-migration-since-v0.4.20 state stands, and this owes a site deploy and no forge deploy. red first against a throwaway postgres with the counts read: with the locking clause dropped the new concurrent test ends with the account on zero live keys and neither session refused (1 failed and 10 passed), with the refusal rewrapped the two class pins go red (2 failed and 9 passed), and with the pause keyed on a statement that never matches it refuses on zero arrivals rather than passing vacuously (1 failed and 10 passed). ADR 0038 records the decision beside the #2004 amendment whose argument rests on this invariant, and names what the lock does not cover. bash ci/local.sh is green against a postgres 18 it created (3977 passed over 122 binaries, 7 ignored, and 67 passed over the seven site live files with none skipped) and the site gate is green end to end (668 passed and 62 skipped over 61 files, 62 surfaces) with no ceiling moved (#2015)
18aca67b ·diffdbf3dbe6… - the rename census gives each rename its own row and reads a function header as a qualifier run, so a second rename written into a function it already names arrives red: store_rename_census.rs keyed every hit as path plus enclosing fn into a set, so the twelve fs::rename sites under crates/*/src collapsed into nine rows with three of them carrying two renames each, and the property the file states, that a new rename arrives red until somebody says which end of it can be held, was already false at rows the file itself holds, while the section saying what it cannot catch did not name that limit. the key is now the file, the fn and which rename it is under that name in source order, and not the line number, because a line moves under any edit above it and the repair for that is retyping a digit in the table, which is the habit the file exists to refuse. a header is now a run of qualifier-shaped tokens and then fn, a bare word or a pub restriction or an extern abi string read as shapes rather than as the four visibility prefixes it held, so async fn, const fn, unsafe fn and extern fn key to themselves instead of to the function above them; no rename in the tree sits behind such a qualifier today, so a fixture over sample lines carries that half rather than the walk. proved as the ticket asked, with a thirteenth rename added inside a function the census already names: green before the change (2 passed and 0 failed) and red after it on the extra row (2 passed and 1 failed), and the fixture goes red under its own mutations, the ordinal dropped from the key (0 passed and 1 failed) and the visibility-prefix header reading restored (0 passed and 1 failed). sentences wider than their code are narrowed where a reader meets them: identity.ts and the ADR 0038 amendment said the property is that every write happens under the account lock, where a lock over an account with no key rows holds nothing, so two concurrent first registrations do not wait for each other and are safe for a different reason, neither retiring anything and a duplicate meeting the pubkey primary key; docs.$.tsx said a status added to DocStatus later renders no body, where it takes the written path and renders whatever is filed under that slug, blank only because the content gate refuses a body filed against a page the registry does not call written; and that gate now keys its filed set on what react renders rather than on nullishness, so a body of false or the empty string no longer counts as filed, pinned by a fixture that is red under the old reading (1 failed and 8 passed). type-program.test.ts seeds its import walk recursively, so a test moved into a subdirectory stays in the program it reads, measured at 62 files flat and 63 deep with one moved down. no migration, no wire or format byte moves, and the site half is comments and tests, so this owes no deploy. the workspace suite is green (4001 passed over 124 binaries, 7 ignored) and the site gate is green end to end (669 passed and 62 skipped over 61 files, 62 surfaces, no ceiling moved) (#2117)
0c90a730 ·diffdbf3dbe6… - key management on the site: a key can be retired by itself, named, and chosen at unlock. per the operator grill on #2398 (ADR 0100): POST /api/identity/retire retires one key of the signed-in account, refusing the last live key under the account-row lock registration takes and never re-dating a retirement, with no route to un-retire and no deletion, since #506 keeps every key resolvable; /account lists live keys and folds retired ones under a collapsed section, and the retire confirmation names the repos the key owns. names live in a new owner-only account_key_label table (migration 0027) that only forge_identity reaches, trimmed, at most 40 characters, with control, line-separator and direction characters refused and a CHECK repeating the cap; they reach only /account, the unlock picker and the private bar, always beside the fingerprint. the unlock picker lists every live key, defaulting to the key that owns the URL namespace, then the key this device last unlocked, then the only live key, and a key with no stored passphrase asks for its 24 words and can save one. both routes are Bearer only and refuse a key of another account; /api/identity/me stops returning the internal tenant id. rebased by hand over migration 0026 and ADR 0099. pg tests pin the role reach, route and picker tests pin the rules, each red under a named mutation; bash ci/local.sh green against Postgres 18 (4568 passed), site gate 842 passed. owes the setup-forge tripwire update, a forge deploy, then a site deploy (#2398)
a90c85fb ·diffdbf3dbe6… - each statement of a private route is named in its Server-Timing: a pool query takes the name of its statement beside its SQL and records it under the pool prefix, owner.tickets.graph for one, where every statement of a pool summed under one name such as owner.query; the transaction statements are begin, bind, commit and rollback, the identity transaction is timed too, the anonymous read pool takes the names as well, json times writing the answer as answer, and the Tickets fold is tickets.first. the Tickets read reads what it answers by key: the head ticket files from tickets/ on in the tree key, in byte order and without the published flag it never answered, the history as the parent edges walked from the head, and the touches from tickets/ on in the repo touches, each id as hex from Postgres, where it read the whole head tree, every change and parent edge of the repo through views that read every change on the forge, and every touch of the repo, and turned each id into hex in the site. the answer is the same but for the order of its files. measured on a throwaway Postgres 18 shaped like this tracker, 5,463 ticket files at a head 1,400 changes deep with 3.8M ticket entries in the history trees, the read and its JSON took 78 ms before and 33 ms after, medians of 15 in two rounds, and with a second repo of 200,000 changes 151 and 152 ms before and 32 ms after; the two answers compared equal, files as a set. pinned in the new owner.pg tests that count a generation across a merge and past a parent the repo does not hold and that read the Tickets view files, history and touches through keys, in the pool timing tests now expecting each statement by name, and in private-timing, which names the writing of its answer. red under named mutations, each restored, over the 5 selected live tests: roots taken without asking the change view (1 failed and 4 passed), the walk step without OFFSET 0 (1 and 4), the step as a plain join (1 and 4), the touches without their bound (1 and 4), the files without their bound (1 and 4), the owner pool under one name (1 and 4); and the answer untimed (2 failed and 8 passed of the 10 private-timing tests). not taken: grouping the touches by change in the answer, since writing the whole answer took about 2 ms. the site gate green at 914 passed and the site live suites 92 passed; no Rust changed. CONTEXT.md says so. owes a site deploy; it also carries comments on uyzzknlm, zsxqmrtm, woyvmtwq and kwlxstko (ylrvoopz)
2a747a82 ·diffdbf3dbe6… - 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 ·diffdbf3dbe6… - an account claims a handle on /account, once, and forge.loot.build/<handle>/<repo> resolves to the newest live key of the account, ADR 0103 decision 3: migration 0040 adds account_handle, keyed on the account and written by the site identity module, which may insert a claim and never change or release one, and forge_read_handle, the read tier half of the seam 0008 gives a retired key; the forge role reads account_handle and writes none of it. the forge rewrites /<handle>/<repo>/<endpoint> onto the /k/ mount of that key ahead of its router (loot-forge handle.rs), so a clone, pull or push through a handle is the /k/ request, the write rule included, and a handle nobody claimed is handed to the web as before; the site route /$handle/$ answers a 307 to the same path under /k/<key>, or the 404, on either host. a claim refuses a handle equal to any first path segment the host serves, read off the site route tree, the forge router through a copy a forge test holds equal to handle::served_first_segments, and the client asset directory. every answer to a request the forge rewrote and every answer of the /$handle/$ route carries X-Loot-Log-Path, the path with the handle and repo as :handle and :repo, a remainder of lowercase words kept and any other as /:path, never the query, so the edge can log it in place of a repo name. the ADR 0103 amendment and CONTEXT.md Handle say so. red under named mutations, each restored: the served-segment guard removed (1 failed and 1 passed of the handle unit pins, 1 failed and 2 passed over http), the rewrite layer removed (3 failed), a handle let match a literal in the overlap matcher (1 failed), the site copy short a segment (1 failed), a handle route sent to the forge from the brochure (2 failed and 17 passed), the reserved set without the forge segments (1 failed and 10 passed), handleHref matching inside a longer segment (1 failed and 10 passed), a 301 for the 307 (1 failed and 2 passed), the forge logging any remainder (1 failed and 2 passed), a rewritten answer untagged (1 failed and 2 passed), the site logging any remainder (1 failed and 12 passed), the route without its log-path middleware (1 failed and 3 passed); on Postgres 18, the forge handle read keeping retired keys (1 failed and 2 passed) and a second claim answering the old handle (1 failed of 27). cargo test green before the log header, 5104 passed over 148 test result lines with 15 ignored, and loot-forge green after it, 851 passed over 14 with 2 ignored; ci/local.sh green on Postgres 18 with the site live suites at 136 passed; site gate green at 1257 passed, every surface under its ceiling. owes a forge release and deploy, which applies migration 0040, and a site deploy (pkwrxnly)
6aa831db ·diffdbf3dbe6… - 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 ·diffdbf3dbe6… - 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 ·diffdbf3dbe6… - 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 ·diffdbf3dbe6… - a handle may be renamed or released on /account, its old name retired forever in retired_handle and still resolving to the account, and handle/repo resolves to the newest live key holding the repo, else an older live key holding a public one, in the forge's rewrite and the read tier alike; migration 0043; a restore withholds a released handle; forge and site live suites green against Postgres 18, red with the retired-name refusal removed (rzzzklmz)
767ac89f ·diffdbf3dbe6… - a handle the operator removes over a trademark or impersonation claim is revoked: loot-forge --revoke-handle <handle> [--apply], run as superuser, releases the account claim when the name is current and files the name in retired_handle with a new revoked_at (migration 0058), so no account can claim it again, and the forge handle rewrite and the forge_read_handle view the web app reads resolve a revoked name to nothing whichever table names it, so every address under it answers 404 while the account repos stay at their /k/ addresses; the identity writer can no longer insert revoked_at, and a standing revocation keeps its time so a restore can replay it; ADR 0077 decision 2 is amended so an operator act run as superuser may write the account tier; new live tests went red when handle_keys still resolved a revoked name (3 passed, 1 failed), when a revocation released the claim without retiring the name (3 passed, 1 failed) and when the view still resolved it (7 passed, 1 failed); the scripts repo revocation journal does not carry it yet, the gated counters do not move, and the suite is green (vuymqvmo)
579e4aa8 ·diffdbf3dbe6… - files the two amend edges xysopyyo left open: a non-root amend gates its capture against its parent tree rather than the version it replaces (vzuzpspr), and loot edit of a root change on a pinned position loses the pin (vlsmounz)
4d1ef5fb ·diffdbf3dbe6… - restore the 71 files 430a057a reverted to 385bcb40's bytes: a tickets-only land (vzuzpspr, vlsmounz) recorded stale copies in the Mac primary, which held the desktop's newer versions sealed with keys it had not pulled, and a loot fetch there had left the disk behind loot's view; the keys are pulled now, the lane equals 385bcb40 outside tickets/ but for that land's benchmark entry, and mmzxtyyt records the mechanism
Perf-Baseline: reset 430a057a's baseline measured the reverted code; restoring 385bcb40's brings object_gets, store_file_reads and graph_sorts back down
7806746e ·diffdbf3dbe6… - a .lootattributes that is not UTF-8, such as the UTF-16 Windows PowerShell 5.1 writes with >, is now a malformed rule naming its encoding at the disk load, the ferry ingest and the recorded-tree vet, so loot new and a ferry ingest of a self-authored commit refuse instead of signing plan.txt internal with exit 0, and a line opening with a byte-order mark, which made the first rule match nothing, is malformed too; the unreadable recorded rules refusals carry the code unreadable_attrs, which the SDK classes as a guard error and the tests assert, and ADR 0038 states the costs of passing over a signed parent rules file and an unsigned ingested parent, and its wrap is fixed; the new cases went red without the fix (0 passed, 2 failed), again with the disk load reading text (1 passed, 1 failed), with the ferry reading text (1 passed, 1 failed) and with the byte-order mark unrecorded (1 passed, 1 failed), the code assertions went red without the code (0 passed, 3 failed), the gated counters do not move, the SDK typecheck passes, and the suite is green at 2103 passed (ymmvvvxq)
9d623289 ·diffdbf3dbe6… - the browser writes as the name minted on its key: loot login sends the <name>@loot comment of the key it registers first and of the key it holds on each poll, the forge keeps it once per live account key in account_key_name (migration 0070, SELECT and INSERT for forge_identity alone, named by no read role or view) and serves it to the owner beside the label, and nameOf passes it to the lockout check through writerName, falling back to the label, then the hex; a key registered before this or minted in a browser takes its name at the next loot login from a machine holding it; the move rail shows a refused space disabled with its reason beneath it, naming who the rule restricts it to; red without it: the web writer pin went 0 passed 1 failed with the label refusing tickets/security under restricted=connor and again with the label fallback dropped, and the restricted space pin 0 passed 1 failed with refused spaces omitted; ADR 0098 and CONTEXT say how; the site gate passes at 366 passed, 93 skipped, ci/local.sh is green on Postgres 18, and the suite is green at 2511 passed, 0 failed, 7 ignored (xynoxvlw)
144970ca ·diffdbf3dbe6… - loot member add and remove name a collaborator by handle as well as by key, and watches and notification settings have verbs: the roster route takes handle in place of pubkey, reads it as the oldest live key of the account that holds the name now and answers the key it stood for, with a name no account holds refused 422; loot account watch [on|off] reads or sets this account watch on one repo, and loot account notify [<toggle>=on|off]... reads the notification toggles or changes the ones named, writing the settings whole as the route takes them and refusing a toggle the forge does not have before anything is written; each prints porcelain and JSON, and the member change gains a handle field; the binary test against a stub of the routes went red with the notify write sending only the changed toggles (0 passed, 1 failed); checked end to end on a throwaway Postgres with the site server and two keyed accounts; cargo test -p loot-cli -p loot-net passed, 594 and 188 among them, the site gate 413 passed and the site live suites 103 passed against Postgres 18 (utyrrmys)
77adb646 ·diffdbf3dbe6… - a repo and a keyed account are deleted on their owner signed request, which the operator tool carries out (ADR 0103 decision 10 amended, migration 0076): loot repo delete asks the forge over /repo/delete, behind the owner door, and the forge files a repo_deletion row and deletes nothing; loot account delete asks over the key lane, a keyed account by its live key and a signed-up one signed in, as a time on its tenant row; --cancel takes either back and --status and loot account read how it stands, each with porcelain and JSON; loot-forge --delete-requested, as the superuser and dry unless --apply, lists and then removes each requested repo by the takedown walk narrowed to that repo with no refusal recorded, and each account that asked as --delete-account does, keeping every other repo, every address another repo names, the account and its keys, and a repo pushed to since its request, which settles as moved; an act names its signing millisecond and is taken only later than the one on file, so a request sent again after its cancel or its deletion deletes nothing, and a restore does not put a deleted repo back; ADR 0062 fifth clause says carrying out a deletion its owner asked for is an agent to apply from the dry listing; repo becomes a served segment; with a moved repo deleted, the whole namespace cleared and the restore rule off the live tests went red (18 passed, 1 failed, then 16 passed, 3 failed); cargo test and ci/local.sh green against Postgres 18, the site gate 413 passed and the site live suites 104 passed (kvmrozqr)
2e682fec ·diffdbf3dbe6… - every write answers --json with what it wrote, and every verb form takes a machine format or a written exemption held by a census test (ADR 0122): 78 forms without one become 13 exemptions; the refusals an agent branches on carry their own codes, two of them the forge app's to say; plan refusals name loot plan upgrade; unlock and id lock take --passphrase-file; pull --json counts the paths it left sealed; the login refusal names the keyed route; loot update refuses over a linked build and a ticket write refuses in a primary that lanes share (rkumrwrk, mmppxtww, tvonnmqo, koqxltqm, svrkqxqu, sptuokrx, lvqmsuzl, utokolzp)
e7002bc6 ·diffdbf3dbe6…
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.