Changes touching this path
- Extract a Draft module: the working-change state as one state machine
The CLI's local state of the working change lived in two loose Workspace
fields — `working: Option<Oid>` and `next_change_id: Option<[u8;16]>` —
hand-mutated at ~19 sites, each owing the invariant that they move together.
Their legal combinations are a 3-state machine; the fourth (a working change
*and* a pending handle) is never valid, yet two Options made it representable —
`edit` from a Fresh state transiently built it, leaking the dead handle until
the next finalize overwrote it.
Model the state as `enum Draft { Clean, Fresh { next }, Active { working } }`,
making the illegal fourth state unconstructable and dropping the pending handle
on every transition into Active by construction. This is Position's precedent
(#324) applied to the state half of ADR 0034's "position is place, not state":
Position owns place (tip), Draft owns state.
Interface: `arm` / `activate` / `take` / `clear` + `load` / `flush` + accessors
`working` / `next` / `is_clean`. Minting stays in the caller, so Draft's whole
dependency surface is RepoStore, like Position. The composite dances that also
move the Position tip — restart-on-anchor (squash/absorb) and the finalize
hand-off — are named Workspace coordinators (`restart_on`, `finalize_working`)
over both modules; Draft never reaches into Position. `load` self-heals a
legacy on-disk (working, pending) pair to Active.
Behavior-preserving: the full workspace test suite passes unchanged. The only
change is the previously-dead pending handle now cleared eagerly on →Active.
e7b824f6 ·dbf3dbe6… - the store stops threading a dock nothing can ever produce through 43 signatures, because a store instance is already the position ADR 0034 retired named docks in favor of, and the sixteen path getters no caller outside loot-core reaches stop being public while the one main reservation that guards a git ref name stays (#1413)
23ab3abd ·diffdbf3dbe6… - a push against a forge head it does not hold refuses before any upload, and a long-running verb no longer writes an older position over a newer one: stow_batches reads the heads of a forge on /ref with the failure kept, where an unanswered /ref or a forge head this position does not hold read as a have of nothing and stowed the whole history into the nginx 413 of the PR 2531 land, and from a complete position it refuses a push past a forge head it neither holds nor retires with the first line of the forge refusal, which /ingest still makes; DagRepo::save_to and Workspace::persist write the heads, working change, conflict set, settled ledger and draft slots only when the handle changed them since it read them, and refuse when another command moved them in between, where every save wrote them from memory and a loot pull-grants open for forty minutes put the head back under a land adopt; pull-grants files its keys and saves once, before the ack, where it persisted once a grant; a save records what it wrote rather than reading the position back, so store_file_reads stays at 24 on the gated workload, where a read-back after each write took it to 28 and the land was refused. pinned: a_push_against_a_forge_head_it_does_not_hold_refuses_before_any_stow over a proxy logging each request, a_forge_whose_ref_cannot_be_read_refuses_the_push, a_pull_grants_opened_before_the_position_moved_does_not_move_it_back, a_save_that_did_not_move_the_position_leaves_a_newer_one_alone and a_save_that_moved_the_position_refuses_over_a_newer_one. red under named mutations, each restored: the forge heads swallowed as before (2 failed and 1 passed over the three sync tests), no unseen-head refusal (1 and 2), the old save that always writes (2 failed and 0 passed over the two engine tests), every position read as changed (1 and 1 over the engine tests, 1 and 2 over the sync tests), no moved check (1 and 1), the draft slots read as changed (1 and 2), the working change left out of the compare, so a finalize was not saved (2 failed and 1 passed over two deposit tests and a snapshot test), and an empty heads set held apart from no heads file (3 failed and 0 passed over a mergetool, a relay push and a dock-files test). a push to a namespace of another key is now refused at /ref, before /wants could name the ownership rule. cargo test green, 4876 passed over 144 test result lines with 15 ignored, and the site gate green at 915 passed. the change lane is still not bounded by the batch budget, so a first push of a history larger than the body cap to an empty forge still fails, left for a follow-up. the perf gate reads no move. owes no forge deploy; lands use the push refusal once the release binaries of the primary are rebuilt; it also files kqzkruyv, the unbounded change lane, and kzknpprm, the phantom deletions of folded files (kkpruryt)
868cea49 ·diffdbf3dbe6… - a refusal of a moved position now names each file another command moved, read off the fields of PositionState and of the draft slots, each destructured whole, where it named the heads, then the working change, and otherwise the conflict record, so a move of the settled ledger alone was named as the conflict record, and the draft check named every move its working change, a move of the pending handle included; a pool item whose run panicked is caught and finished, so the land test gate no longer names it as running until the pool ends, and the first such panic is carried out once the rest finish; a Tickets entry from Files while the manifest is still loading asks the list fetch from that manifest once it answers, unless the route answered first, where it asked only from a manifest already held. pinned: a_refusal_names_the_settled_ledger_when_only_it_moved, and the heads named in a_save_that_moved_the_position_refuses_over_a_newer_one, in loot-core; a_finalize_refused_over_a_moved_tip_names_the_heads, the arm tnlrmsmo named, and a_retry_over_unchanged_inputs_signs_the_version_id_the_refusal_left, which pins its version id claim, in loot-cli; a_panicked_item_is_not_named_as_still_running; and two site tests of a manifest in flight. red under named mutations, each restored, failed and passed: the ledger named as the conflict record (1 and 1), an unmoved working change named (2 and 0), the position check off (1 and 2), the pending handle named as the working change (1 and 2), a load that lets the pending handle win (1 and 2), the panic uncaught (1 and 14), a panicked item left unfinished (1 and 4), the panic not carried out (1 and 0), and of 29 site tests: an in-flight manifest ignored (1 and 28), a read that always waits for it (1 and 28, on a timeout), and no stop check (1 and 28). the ownership message is left at /wants for a pusher the custody list admits, decided and noted in forge_push.rs. doc fixes: save_to and persist no longer say each shared artifact merges, burned_under_lock names its lock as one of BURN_LOCKS, the disk record settles say what defines their callers, the grant cursor reads say what is pinned, the object cache says a repeat visit fetches a published object again and that the per-file bound is no share of the cache, vault.ts says what openDevice is exported for, the qktqvvzr sentences in CONTEXT.md and the land-change skill carry the dock condition, gc_keep_set names the leak a refused finalize leaves, .gitignore names .lootignore, and rewrap leftovers in orchestrator.rs, CONTEXT.md, workflow.md and grants.rs are joined. cargo test green, 4938 passed over 144 test result lines with 15 ignored, and the site gate green at 1028 passed. also closes qpxmrnxm and tzuxsroy. owes a site deploy (oxuypvlz)
f557daaf ·diffdbf3dbe6… - a grant deposit is now a type: loot_forge::grant::Deposit carries the blob it was parsed from, its fields are private to grant, parse_deposit verifies the blob before it builds one and the test constructor is compiled only under cfg(test), and Forge::deposit_grant takes the Deposit and no second blob, where the fields were public and the blob a separate argument, so a route could file a blob nobody verified and the peek would count it by the signer it names; migration 0030 is held to ENVELOPE_HEADER, ENVELOPE_VERSION and an envelope wrap writes by a test reading its text, which a land runs, where only a live Postgres case held it; ADR 0057 records that 0030 relies on its length test being evaluated before get_byte inside an AND, which Postgres does not order, and that a later migration touching the column should nest a CASE, and the signer conformance case now files an empty blob, which Postgres 18 files with a NULL signer; the draft refusal names a slot another command moved to what this one would write as having done so, where it named it as a move like any other. pinned by compile_fail examples beside a positive control, the migration text test, and draft label tests in loot-cli: red under named mutations, each restored, failed and passed: the fields public (1 and 2 of the doc tests), the test constructor public (1 and 2), a serving path calling the test constructor (the lib build fails), the header constant at 98, the version at 2, the substring offset at 3 and the version byte offset at 1 (1 and 0 each), the working change never matched (2 and 1), the draft check matching against what it read (1 and 2), the pending handle always matched (3 and 0). also names the trait as what defines the mailbox reads in inbox.rs and rejoins rewrap leftovers in mailbox.rs, inbox.rs and ADR 0057. cargo test green, 4946 passed over 145 test result lines with 15 ignored, with the forge suite live on a throwaway Postgres 18. owes no deploy (xwwrskls)
b7f03ea6 ·diffdbf3dbe6… - loot-cli production comments cut by 70% to the docs/agents/writing.md standard: history, ticket numbers, rosters and ADR retellings removed, contracts and safety reasoning kept; comment-only, Rust token streams identical, test modules untouched (yrkykmsn)
51eb5832 ·diffdbf3dbe6… - 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 ·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…
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.