connor / loot

connor/loot

Changes touching this path

  • Forge service skeleton: /ingest, the sync surface, and CLI forge remotes (#502) A new `loot-forge` crate and binary, sibling to the relay and never a mutation of it: `loot-net` is a dependency of `loot-cli`, so a storage driver in the relay would ship inside the released CLI binary (ADR 0041:53-57). The ban runs one way -- the forge may use the other crates; none of them may gain a driver. Every endpoint is envelope-authenticated, where a relay authenticates only /stow. The one declared exception is GET /info: a client reads the capability probe before it knows how to authenticate. POST /ingest = envelope_sign(bundle || head_declaration), one signature over both, so a genuine bundle can never be replayed under someone else's head claim. CAS first; nothing is written before the generation compare. A lost CAS answers with a 409 BODY carrying the current generation and head set -- behind, not bounced -- so the client re-carries with no extra round trip. /stow keeps relay parity and moves no ref, and consumes no generation either, since a client reads the generation once and then stows N batches. It DEFERS a change whose objects have not all arrived; /ingest REFUSES one, because a declared head whose objects are missing is a repo no pull can complete. That asymmetry is what keeping /stow is for. Bundles are filtered PER OBJECT by the caller's access class, closing the leak the ticket names: bundle_impl ships a key for every ANYONE-granted object, i.e. every Internal object. Change metadata rides the second #494 axis and gates the whole walk -- a ChangeNode carries the full tree, so shipping one while withholding its bytes still discloses every path, address, message and author. Validation before any write: author signatures, and a tree whose visibility contradicts its objects is rejected. vis_tag is derived from the SealedObject and never trusted from the tree, which is what makes content-addressed upserts safe. Forge purge policy: burn iff burner == object.introduced_by, recorded at first arrival as introducing.author else the envelope pubkey; maroon read off grant_log, global and exact. Both are judged before any object is stored and outside the CAS transaction. Repos are pubkey-addressed at /k/<pubkey>/<repo>, auto-created on first push, and may_push holds iff the signer owns the namespace. resolve_remote is untouched -- still no default host. CORS from day one. Storage sits behind three narrow traits with in-process reference implementations the whole suite runs against; the Postgres DDL they mirror is checked in at docs/sql/forge-schema.sql and its driver is #516. CLI: /info capability detection, the live head declaration off the Liveness view, and a refusal to push a lane -- v1 ingests the primary position only. verify_authored_change moves to loot-codec so the forge runs the identical gate without linking the fs-hardwired engine. Recorded in ADR 0041, the spec and CONTEXT.md: the forge stores no content key but a published one, because filing the ANYONE key lane would let the server read every Internal object, and the keystone is that only Published is server-readable. The cost is stated rather than hidden -- a fresh clone of your own Internal content from a forge is ciphertext you cannot open until #488 lands. Closes #502. 300e06ff · dbf3dbe6…
  • Forge publish ingest: file the published key the bundle already carries (#499) 417aaf83 · dbf3dbe6…diff
  • Give the forge an operator channel, with one redaction rule (#522) f9ca9f91 · dbf3dbe6…diff
  • the forge grows an operator door list, so its first public ingress refuses all but listed keys with a typed 403 (#690) 0541e431 · dbf3dbe6…diff
  • the forge's metadata pool caps every connection it opens, so a burst queues for one instead of being refused by Postgres (#611) f2d8ee80 · dbf3dbe6…diff
  • the two servers share one auth preamble, and a forge handler reaches the router only through the crossing (#865) a10e310f · dbf3dbe6…diff
  • a contributor can offer work to a repo they do not own: loot propose over a three-path family - posture, propose and withdraw - and none of them is the ref-moving endpoint, which stays single because ADR 0075 refused putting the contribution path one flag away from the path that advances someone's tip. The bytes ride /stow unchanged, since the forge's stow literally calls the same push, so the batches are byte-identical and there is no new transport. One premise had to be WIDENED and the reason is a real replay: the ticket says sign the claim exactly as the head declaration does, but a head declaration names no repo and does not have to, because require_pusher catches a replay at another namespace - while a proposal is BY DEFINITION a write by a non-owner, so every repo with an open door admits the same signer, and a tip-and-base-only envelope is replayable by any observer at every one of them, in the contributor's name. The claim therefore carries the repo path and the server compares it against the URL's namespace, proved by RUNNING the replay and watching the second namespace admit it rather than by arguing it. The disclosure is an ORDERING rule and the posture route exists only to make it one: a client that learned metadata_public from the act's own answer could only ever speak afterwards, so posture comes first, the disclosure is printed second, and only then the ref read, the stow and the claim. It is pinned twice - once by a transport that records every call into the SAME trace as the output lines, so the assertion compares positions rather than presence, and once by byte offsets in real CLI stdout against a real forge - and a shut door still discloses first and sends nothing at all. Withdrawal is the tip change's AUTHOR and only them, where visibility admits three readers, because seeing is not acting and the carrier's remedies are the author's withdrawal or the owner's decline; it does not consult the door, since a shut door must not strand what is already offered, and absent and concealed refuse in byte-identical sentences. The lane refusal keeps every one of its old assertions, including that nothing reaches the forge before it fires, and gains the sentence naming the alternative. Twelve breaks were each run and read before being restored byte-identical, and the ones worth naming are the replay above, deleting the author check so a presenter can withdraw work they did not write, adding the door to the withdraw path so a shut door strands an offer already disclosed, and declaring the tip as a head so the CAS counter moves. The ref-moving path is asserted untouched rather than described as untouched: a proposal leaves generation and head set alone, and the SAME fixture then lands a change the ordinary way and the generation does move, which is the control (#1651) 83c5afa5 · dbf3dbe6…diff
  • the forge refuses an /ingest that would drop a current head it neither descends from nor retires by name (ADR 0098 section 3, map #2422): ingest::heads_this_push_drops judges the declared heads against the heads read at the push generation, before the store transaction, so the CAS makes it sound and a push at a stale generation still loses the swap as before; the walk over the push own changes answers an ordinary push with one read, the head set, and only a head that walk does not reach costs the repo graph, through the landed closure propose already has. a refusal is a 412 whose text body names the count, the remedy (loot pull first) and each head, so a client from before this reads a sentence and this client prints the count it read with the same remedy. retirements ride the signed head declaration as a trailer after the kinds, written only when a push names one, so a push retiring nothing is the old bytes and a forge from before this reads past the names and replaces its heads wholesale as it always did. the client names each forge head its declaration does not reach and that this position has seen, holding the change or naming it in its abandoned record, so abandon --head and supersession are covered with no list of verbs, and never names a head it has not seen. four conformance cases run on the memory store and on Postgres through the assembled forge: a fast-forward carried or already held, a dropped unseen head refused and named with the ref unmoved, an explicit retire that lifts only the head it names, and a racing push that still loses the CAS; a runners test that replaced its root with a new root now retires it by name. red under ten named mutations, each 0 passed and 1 failed (2 failed for the trailer) and restored: no refusal, no generation guard, retirements ignored, no overlay fast path (an existing pin saw the graph read), the overlay alone, the client retiring nothing, the client retiring unseen heads, a view-only seen, the kinds left out ahead of the names, and the client not reading the 412. bash ci/local.sh is green against Postgres 18, 4599 passed over 143 binaries with 13 ignored and the site pg suite at 67 passed. no migration; the forge behaviour changes, so this owes a forge deploy (#2426) e1e5c828 · dbf3dbe6…diff
  • forge.loot.build hands every request that is not the forge protocol to the forge app, split by what the forge router routes and by the envelope, with no list of protocol paths: the router fallback answers a request it does not route 421, server::NOT_THE_PROTOCOL, unless its body verifies as a signed envelope, which keeps the empty 404 an old host answers, and it sits outside the CORS layer so the forge answers no preflight for a path it does not mount; in the scripts repo the edge hands only a 421 to a named location, for now a temporary 307 to the same path on loot.build until lrvstoyz moves the pages, and setup-forge reads that back over the public name. red under named mutations, each restored: the fallback gone (4 failed and 23 passed), the fallback inside the CORS layer (2 failed and 25 passed), a signed request handed on (1 failed and 26 passed), a refusal at 421 (1 failed and 8 passed); on the edge, a 404 intercepted too and the inheritance check dropped (each 1 failed and 7 passed). owes a forge release and deploy and a setup-forge edge run. cargo test green, 5020 passed over 144 test result lines with 15 ignored (novxrtxz) 217ac11b · dbf3dbe6…diff
  • the forge operator can take a namespace down, the technical half of ADR 0061 section 4 that ADR 0103 decision 9 builds: loot-forge --take-down <owner> [--apply], run with the superuser url and refused as the service role by Pg::with_operator, in one transaction records the takedown in migration 0034 namespace_takedown, removes the namespace repos with every row their cascades take, evicts into evicted_object each address its trees named that no other repo tree names, deletes their published_key rows, and removes the versions and manifests no other repo holds; without --apply the same transaction rolls back. server::require_pusher refuses the namespace own keys by name after the write rule and before any byte is stored, and ensure_repo refuses again inside the write transaction. an evicted address reads as destroyed wherever a burned one does, so it is refused on any later push, served to nobody, and the burn delete job deletes its bytes and drops every grant naming it. ADR 0048 section 4 no longer holds for a forge, and ADRs 0048, 0061, 0103 and 0046 and CONTEXT.md say what it drops, what it cannot reach and the policy choices it made. red under named mutations, each restored: on memory, the request door gone or asked before the write rule, the store refusal gone, a shared address or version evicted, a listing applied, no key row deleted, manifests kept (each 1 failed and 16 passed), repos kept and an eviction owing no delete (each 3 failed and 14 passed), evicted not read as destroyed (4 failed and 13 passed); on Postgres 18, the store refusal gone, the takedown unread, a shared address or version evicted, the grant drop blind to evictions, the role check gone, a listing committed, no key row deleted (each 1 failed and 6 passed), an eviction owing no delete (3 failed and 4 passed), evicted not destroyed (4 failed and 3 passed). cargo test green, 5045 passed over 146 test result lines with 15 ignored; ci/local.sh green on Postgres 18 with the same counts and the site live suites 112 passed. owes a forge release and deploy, which applies migration 0034 (vutntmlm) 15463c8f · dbf3dbe6…diff
  • a push past the storage bound of a plan is admitted and starts a seven-day grace for the account, and once the grace is over the forge refuses it with a typed 402 the CLI renders, ADR 0103 decisions 7 and 8: plan::require_room runs inside ingest::prepare for /stow and /ingest, after the write rule admits the key and after the purges of the push are honored, so a burn frees space before the account is measured, and before any blob or row of the push is stored; no read route and not /wants asks it, and nothing is deleted. it compares the measured bytes of the referenced footprint of the account with the stored_bytes of the plan the site mirrors into account_plan, free without a row. migration 0039 adds plan_grace, keyed on the namespace whose push started the grace and written by the forge, outside the account tier, read for an account as the earliest start among the namespaces of its keys and ended by a push that finds the account under its bound; the forge role holds SELECT, INSERT and DELETE on it and UPDATE of object.bytes. a measuring job in the serving forge files the blob length of each object row that holds none, read from the bucket by HEAD a batch at a time, and until it does such an address counts nothing toward the bound. versions a /stow filed count toward the footprint, by decision. the refusal names the plan, its bound, the usage and the grace, and the CLI adds the /account page of the forge that refused and loot burn. the ADR 0103 amendment, CONTEXT.md Plan and Referenced footprint, store.rs and account_tier.rs say so; the collaborator and runner caps are left to a follow-up. red under named mutations, each restored: the grace boundary moved by a second (2 failed and 21 passed), the refusal removed (3 failed and 20 passed), the check moved before the burns (1 failed and 22 passed), a read route checked (1 failed and 22 passed), a grace never ended (2 failed and 21 passed), unmeasured addresses counted (1 failed and 22 passed), the refusal at 403 (3 failed and 20 passed), a filed length overwritten (1 failed and 22 passed), the CLI remedy removed (1 failed and 9 passed); on Postgres 18, forge granted UPDATE on plan_grace (1 failed), the grace delete removed (1 failed and 1 passed), the mirror ignored (2 failed) and a filed length overwritten (1 failed and 3 passed). cargo test green, 5093 passed over 146 test result lines with 15 ignored; ci/local.sh green on Postgres 18 with the site live suites at 128 passed. owes a forge release and deploy, which applies migration 0039 (oozvwvkm) 14ed9529 · 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
  • loot-forge, loot-net, loot-first, loot-perf, loot-relayd, loot-relay-contract, loot-s3 and loot-bench production comments cut by 70% to the docs/agents/writing.md standard: history, ticket numbers, rosters and ADR retellings removed, wire contracts, security and safety reasoning kept; comment-only, Rust token streams identical, test modules untouched (yrkykmsn) a94b3d35 · 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
  • forge: a per-agent rate limit at the agent door, ADR 0119 §4 — a token bucket per signing key, never the address, 120 at once refilled at 20 a second for every agent key on every plan, chosen from measured SDK and MCP agent sessions and recorded in the ADR; past it a typed 429 with Retry-After and the wait in its sentence; nginx's per-address limit filed as twsvnxsy, which the hosted launch now waits on (nptsyzum) bb93066f · dbf3dbe6…diff
  • a refusal an agent branches on has its own code under --json where it said error: a forge refusal by its status and the label its body leads with (not_allowlisted, forbidden, taken_down, over_plan, would_drop_head, rate_limited, unauthenticated), a relay 403 as not_allowlisted, naming on a shared primary as primary_does_not_author, a selector that names nothing or too much as no_such_version and ambiguous_version; the code is recorded beside the message where the refusal is built (loot_codec::refusal) and found again by the text that reaches the dispatcher, since most errors travel as String; a forge test holds each variant to the code a client reads from it; a census refuses a shipped message that names a verb loot does not dispatch; the agent debt line tells the keys this machine lacks from the ones it holds that a deposit does not carry, where it named a second deposit either way; the exit-codes page lists the codes; cli_smoke red before the change (0 passed, 1 failed); cargo test 2606 passed (rptnzzyw) e352908b · 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.