connor / loot

connor/loot

Changes touching this path

  • the site reads forge trees through database functions of each read family and names no storage table: forge migration 0064 creates tree_at, entry_at, tree_under and bands for forge_read, forge_owner and forge_member, SECURITY INVOKER sql over that family views with EXECUTE for the family role alone, which Postgres inlines, so each statement plans byte for byte as the view query it replaced, and site/src/server/read/tree.ts calls them for the tree listing, the one-path read, the Tickets files and the History bands. measured as each tier on a throwaway Postgres 18 with 7.2M tree entries and a 7,240-path head, the answers equal before and after, server execution medians of 200 unchanged (listing 23.7 and 23.5 ms, one path 30 and 23 us, ticket files 0.62 and 0.57 ms, bands of a 50-version page 16.6 and 15.6 ms), planning up to about 0.1 ms more per statement for the inlining, and the tier reads through the site modules within noise over three interleaved rounds of 21. pinned by tree-functions.pg, which compares each tier view query with its function over a metadata-public and a metadata-private repo for the anonymous reader, the owner, a stranger and a member and refuses another family role the functions, and by forge-storage-boundary, which fails on tree_entry anywhere in site/src; red under mutations, each restored, 3 failed of 3: the owner one-path function without its path filter, the anonymous role granted the owner tree function, and tree_entry back in a site comment. cargo test green at 2268 passed over 69 test result lines with 6 ignored, the site live suites 92 passed through ci/local.sh, the site gate 365 passed. CONTEXT.md names the tree read functions. owes a forge deploy with --migrate, then a site deploy (nqlxwuzz) 56659d21 · dbf3dbe6…
  • the forge writer and tree reads for delta manifests, slice R2b of tlupspqp: migration 0066 rebuilds a tree from either layout in tree_at, entry_at, tree_under and bands of each read family through new gated views of tree_delta and of the base link, in an ungated manifest_tree the forge reads use, and in the published index; a repo_change trigger rewrites whole a delta whose base the arriving repo does not hold, the repo object trigger takes the upserts of a delta, a takedown deletes ops and keeps a base still named, and an index on repo_change by version keeps the family gate a probe; the forge files a new manifest as ops over the first parent manifest when the repo holds it, the base is below depth 63 and the ops are at most half the entries, behind LOOT_FORGE_MANIFEST_DELTAS, off unless on; on a Postgres 18 fixture of 7.3M tree_entry rows the anonymous head listing took 21.8 ms whole and 23.8 ms over 55 deltas, one path 0.04 and 0.25 ms, bands of 50 versions 3.6 and 12.6 ms, and the forge read of 760 trees 3.0 s and 0.34 s; red under mutation, each restored: the trigger skipping its rewrite (1 failed of 1), the family walk letting the farthest op win (1 of 1 forge, 1 of 3 site), the anonymous delta view ungated (1 of 3), the published index on whole rows only (1 of 3), the forge rebuild over an empty base so change ids stop recomputing (1 of 1), the writer dropping removes (1 of 1), a takedown keeping ops (1 of 1), the repo object set skipping upserts (1 of 1), the restore not copying ops (1 of 12) and an empty switch turning the writer on (1 of 1); cargo test green at 2381 passed, 0 failed, 6 ignored, ci/local.sh green on Postgres 18.6 with the site live suites at 93 passed, site gate 365 passed; owes a forge deploy with --migrate (tlupspqp) 4c1d2293 · dbf3dbe6…diff
  • the online backfill of delta manifests, slice R2c of tlupspqp: migration 0067 adds manifest_to_delta, which stores one whole manifest as ops over its first parent manifest under its row lock by the writer rule (each repo naming it holds the base, the base below depth 63, the ops at most half the entries, a manifest some delta names as its base kept whole) and compares the rebuilt tree with the rows it replaces before deleting them, a manifest_backfill row per repo walked to its end, and a key-share lock in the repo_change trigger on each whole manifest an arriving version names, which the backfill skips; loot-forge --backfill-manifest-deltas [--batch N] [--limit-seconds S] walks each repo parents first, one transaction per batch, as the superuser; a takedown or account deletion takes the batch advisory lock, the writer key-share locks the base whose depth it reads, and the account restore puts back no row of one layout under a manifest the live forge holds in the other; on a Postgres 18 fixture of 7.22M tree_entry rows (760 versions of a 9,500-path tree) it converted 748 manifests in 20.7 s (36 a second), leaving 114,000 whole rows and 8,228 ops, while the anonymous head listing and one-path read kept their medians (3.79 and 0.59 ms against 3.77 and 0.56 ms) and every listing read during the run answered the whole tree, so the production 1,986 manifests project to under a minute on this machine; red under mutation, each restored: ops ignoring a tier change (the run refuses, 1 failed of 1), the same with the comparison off (1 of 1), a stopped run recording its repo (1 of 1), the trigger without its lock (the other owner reads no tree, 1 of 1), the writer reading its base depth unlocked (the child filed at depth 1, 1 of 1), the repo-holds-base rule off (1 of 1 takedown), the restore filter off (1 of 13) or off for ops alone (1 of 1), and ops ignoring a reveal time in the site family test (1 of 4); cargo test green at 2384 passed, 0 failed, 6 ignored, ci/local.sh green on Postgres 18.6 with the site live suites at 94 passed, site gate 365 passed; owes a forge deploy with --migrate, after which the scripts step runs the backfill (tlupspqp) 2ae5da83 · 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.