connor / loot

connor/loot

Changes touching this path

  • S4: operation log + undo (#146) Implement ADR 0031: an append-only, repo-wide, local-only operation log (`.loot/ops`) backing `loot undo` / `loot op log` / `loot op restore`, the safety net that makes ADR 0030's implicit auto-snapshot safe to trust. Core (`loot_core::oplog`): - `Operation` captures the resulting **view** — change-graph heads, each dock's working/tip pointers, the conflicts set, and the ambient-dock pointer — as raw pointer-file bytes, so restore is a pure pointer reset that never touches the object store or the append-only graph (nothing is ever deleted). - `record` appends one op per view-changing command; `undo` steps the view back one op and appends a compensating op (the log grows on undo, so redo lands); `op restore <n>` jumps to any op. A 1-based ordinal is the durable ref; a `pos` field walks the history back one step at a time. - Barriers: `push`/`grant`/`maroon`/`pull-grants` are recorded non-undoable; undo refuses to cross one and names the real remedy (keyring/manifest are one-way state a view reset cannot retract). CLI: - `loot undo`, `loot op log`, `loot op restore <n>` verbs + USAGE. - One `record_op` per view-changing command; read-only verbs record nothing. loot has no standalone snapshot op — S2 made `status` read-only, so every capture rides a mutating verb and that verb is the one op. - undo/restore reload from the restored files and re-materialize the ambient dock (writing the restored tree, pruning what the step removed). The oplog never enters a bundle (bundle serializes changes/objects/keys, never reads `.loot/ops`) — asserted by test. Tests cover append-on-undo, walk-back, barrier refusal, absent-pointer round-trip, and full CLI undo/redo. clippy clean. ce2f96a7 · dbf3dbe6…
  • Merge pull request #162 from Connor-Miller/s4-oplog-undo Git-Author: Connor Miller <53197564+Connor-Miller@users.noreply.github.com> 4204625fdiff
  • S3: divergent change — marker + loot abandon (#147) Surface and collapse a divergent change per ADR 0029/0030 — the last slice of the jj-ergonomics trio (map #142). A divergent change is one durable change id carrying more than one live version id (two writers rewriting one change id); it is data, not an error, and is detected per change id, not by head-counting. - Engine: `divergent_change_ids(abandoned)` scans every node (a divergence can sit under a single graph head, e.g. as merge parents, with identical trees) and returns change ids with >1 live version; `versions_of_change`; `abandon_head` drops a version from the live heads. `record_carrying` is now public — the amend primitive that makes divergence exist (and constructs it in tests). - `log`/`status` render a trailing `!` on a divergent change id and list each version (shared `change_col` helper). A log whose only multi-head reason is one divergent change stays the flat listing — routed by distinct change *lines*, not head count, so the "run `loot apply` to converge" branch never mis-claims a divergence apply cannot collapse (Act 3 reproduces flat, as in the prototype). - `loot abandon <version-id>` drops a version, leaving the other live version(s) under the change id. Nothing is deleted — the version stops being a live head and joins a local-only `.loot/abandoned` set the live view filters. It refuses a non-divergent change (never hides a change's sole version), and is one undoable operation: the oplog View now also captures `.loot/abandoned`, so `loot undo` brings the version back. `resolve`/`dock merge` are untouched. Tests: engine detection + abandon; workspace abandon→collapse→undo and the non-divergent refusal; store abandoned round-trip; `change_col` `!` rendering. Live-verified Act 3 (flat `!` listing → abandon → undo restores). clippy clean. 43d5cd72 · dbf3dbe6…diff
  • Merge pull request #168 from Connor-Miller/s3-divergent-abandon Git-Author: Connor Miller <53197564+Connor-Miller@users.noreply.github.com> dd573561diff
  • Catch up to git main 809ddfe: #260 smoke default, #271 arm64 build, loot diff (#1), ADR 0034 dock retirement (#253) 587684dd · dbf3dbe6…diff
  • Workspace accepts its clock; lane flag-gate goes pure so cmd_* tests never touch a real .loot (#322) 20ac82e1 · dbf3dbe6…diff
  • loot bisect: binary-search history to find a regression (#390) bec6bfc5 · dbf3dbe6…diff
  • loot-core durable decoders cap the reservation, never the count (#620) 537c4219 · dbf3dbe6…diff
  • a view step refuses over work no change records, and a primary finalize says so on stderr (#436) a3248ede · dbf3dbe6…diff
  • a resolution records which side it answered, so catching up after resolving no longer re-raises the path (#744); ADR 0039 says what the one-commit promise actually guarantees (#653) b837289e · dbf3dbe6…diff
  • every persisted artifact crosses the store as its own type, and raw paths retire to the four recorded owners (#863) Land A of #863 (decision #851): RepoStore gains a typed read/write pair per artifact — identity, graph, keyring/escrow and their shared halves, manifest, purges, attestations, burn log, conflicts, resolved — each owning the file, the atomic replace, and the absent-file semantics, with the codec staying where it lives. The engine's save_to/load_from/refresh_hold/gc/verify raw sites, the op log's capture/restore and ops file, and the bisect session all migrate through; the ops file and view restore gain the temp+rename atomicity they lacked, and the op-log capture now waits out the Windows replace window instead of recording a live file as absent. Absent is now NotFound alone everywhere but `resolved` (best-effort by contract): a torn read fails loudly rather than reading as an empty artifact. The migrated getters drop to pub(crate); `objects/`, the keypair/peers, `git-mirror/`, and doctor keep raw access as the recorded second owners. 0edf769d · dbf3dbe6…diff
  • the store grows the inventory: classification as data, an exhaustive save walk, and a View derived from the captured rows (#863) Land B of #863 (decision #851), closing the ticket. One static row per artifact in loot_core::store carries what the getters' doc comments said in prose: ownership class (ADR 0034's three), undo membership (captured at a pinned wire ordinal, or excluded with the reason as data — `lost` stays shared AND excluded, because a view reset must not un-acknowledge accepted loss), and the artifact's place in the walk. The engine's save_to persists the shared surface by one exhaustive dispatch over the table, so adding an artifact without deciding its persist story fails to compile; the op-log View's entries derive from the captured rows in ordinal order, with ordinals below the pinned inline count encoding inside each op and every later ordinal riding its own trailing section — the discipline bisect (#390) and resolved (#744) established by hand, now produced by the ordinals themselves, so old op logs decode unchanged and a new captured row is one inventory row whose existence IS its undo coverage. Structural tests pin the table: dense unique ordinals, capture implies position ownership, and every row's path agrees with its class (keyring/escrow project, ADR 0047). d05a0c46 · dbf3dbe6…diff
  • 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 · 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-core, loot-codec, loot-wasm, loot-hygiene, loot-identity, loot-revset, loot-ticket and loot-count production comments cut by 72% to the docs/agents/writing.md standard: history, ticket numbers, rosters and ADR retellings removed, contracts, formats and safety reasoning kept; comment-only, Rust token streams identical, test modules untouched (yrkykmsn) c1305a2b · 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
  • recording an operation appends one record instead of rewriting .loot/ops: the log becomes a header plus one self-contained, checksummed record per operation, and oplog::record reads only the tail and appends under a per-position lock instead of reading, decoding, re-encoding and rewriting the whole file; a legacy log is still read and is rewritten as records on its next append, keeping every operation, view and barrier; a torn final record is dropped and cut off by the next append, while other damage refuses the read; op_index reads only the tail and the harbor seal readers decode the log once; one record onto a 100-op and a 1,000-op log took 780 and 7,083 allocations and rewrote 10,827 and 107,127 bytes, and now takes 61 at both lengths and appends 129 bytes; the new allocation test fails 780 against 7,083 on the old record, the migration test goes red (0 passed, 1 failed) when the rewrite drops a barrier, the torn-tail test when damage reads as torn, the race test when appends skip the lock (43 of 80 operations kept), and the suite is green (vnkowyms) 61a36338 · dbf3dbe6…diff
  • op log fix-ups from the review sweep: a final record whose trailing length frames it whole is damage and refuses instead of reading as torn and being cut off, the store lock breaks a lock only when its age is known to be stale so a waiter no longer removes the next holder lock after a release, a test pins that the legacy decoder refuses a records file, ADR 0031 says the log is per position and when a broken lock can drop an operation, and encode_nodes says the working-change order is free; the torn-tail test went red on a grown length (0 passed, 1 failed), the older-reader test goes red when the sentinel is zero (0 passed, 1 failed), the race test lost an operation in 17 of 150 loaded runs on the old lock and 0 of 300 on the new, the undo guard against an unrecorded view is not built since loot status moves heads without an op, the gated counters do not move, and the suite is green (wyksxzom) c63b9f34 · dbf3dbe6…diff
  • op log fix-ups from review sweep 2: a final record counts as written whole only when the body its trailing length frames also passes the record checksum, so a describe record cut just after its command length is dropped as torn instead of refusing every later read and append, and a grown length still refuses; a store lock waiter that cannot read the lock age breaks it after waiting out the stale horizon instead of waiting forever, while the harbor lock already breaks a lock it cannot stat and is unchanged; the test-only Workspace offered_and_unheld is gone and its tests read the push plan, ADR 0031 says a snapshot records no operation of its own and stops naming the lock constant, and two docs and a test comment stop naming callers and a ticket; the torn-tail test went red without the checksum (0 passed, 1 failed), a new lock test with an injected stat and horizon timed out without the bound (0 passed, 1 failed), the gated counters do not move, and the suite is green (zwlvuuqz) 5fb0ca78 · dbf3dbe6…diff
  • 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 · dbf3dbe6…diff
  • 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 · dbf3dbe6…diff
  • 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 · dbf3dbe6…diff
  • the store, op-log and pack locks now watch a lock found stale for a further quarter of the horizon before breaking it, as the harbor does, so a waiter on a Mac that slept past the horizon no longer breaks a live holder mid-rewrite, and a lease breaks a lock without its breaker only where the kernel answers that locking is unsupported (Unsupported, ENOLCK, ENOTSUP, EOPNOTSUPP), waiting out a breaker error that passes (EINTR, EMFILE, ENFILE, EAGAIN); seek keeps the breaker when it clears a new cache position and judges a busy marker by the lease clock as its claim does, a crashed short proof salt is judged again under a kernel lock before it is removed, and lane new removes what it wrote on any failure before the entry is registered; a replaced shared file is written only when its handle changed it or never read it, a file written during a capture refuses with the code changed_while_recorded, the visible_object gate is one function the status read calls too, and LOOT_NET_TIMING lines drop any user:token from the host; ADR 0109, 0107 and 0076, CONTEXT and lease.rs say so, and some comment drift is cut; red before the fix: a holder beating inside the confirm window broken, a transient breaker error breaking the lock and a stale identity handle writing over a newer name (0 passed, 3 failed), and a timing line naming alice:hunter2 (0 passed, 1 failed); mutation proofs: the confirm window dropped with every breaker error read as unsupported (4 passed, 2 failed), no error read as unsupported (5 passed, 1 failed), the errno check dropped (0 passed, 1 failed); any other breaker error refuses with the code lock_breaker_unusable, naming the breaker file and its remedy, at once when permission is denied (EACCES, EPERM) and else once it has lasted the horizon, and never breaks the lock without the breaker, so a store lock taken with no deadline no longer waits forever on a breaker another user owns: lock_shared, lock_ops and the repack wait now return that refusal, pinned by refused rows in the injected-error table, which went red with a denied permission waited out for the horizon and with an unusable breaker broken through (4 passed, 1 failed each); loot-core is green at 364 passed, 0 failed, 1 ignored, and the suite at 2264 passed, 0 failed, 6 ignored (wttrstzz) 5f906127 · 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.