diff --git a/docs/decisions/design-kit/sessions-and-drafts.md b/docs/decisions/design-kit/sessions-and-drafts.md index 24b295a01f..6f5caff12c 100644 --- a/docs/decisions/design-kit/sessions-and-drafts.md +++ b/docs/decisions/design-kit/sessions-and-drafts.md @@ -22,11 +22,20 @@ of the [six-part #943 design](https://github.com/schlessera/brain-kit/issues/943 (2026-10-04) with its four residual answers, R1–R4 (2026-10-05). Where those later rulings do not replace it, the supplied navigation and parallel-session designs still bind; §8 lists what carries over. The measured input is -[`docs/plans/navigation-recovery.md`](../../plans/navigation-recovery.md) +[`docs/plans/navigation-recovery.md`](https://github.com/schlessera/brain-kit/blob/5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0/docs/plans/navigation-recovery.md) (#942). The row's adopted geometry is the [shared-row design](https://github.com/schlessera/brain-kit/issues/929#issuecomment-5998113323), which amends the #943 strip. +> **2026-11-02 — The measured input left `docs/plans/` ([#2511](https://github.com/schlessera/brain-kit/issues/2511)).** +> #942, #943, #964, #965, #910, #951 and #979 are closed, and the Sessions +> destination, host-backed drafts and latest-turn recovery are in source +> (`const destinations`, `packages/ui-react/src/components/layout/desktop-routes.ts`; +> `packages/ui-server/src/drafts/`). The report held measurements and +> follow-up ownership, not rulings; every ruling it fed is in this entry. Read +> it unchanged at the pinned link above. Its probes stay in the tree at +> `scripts/probes/navigation-recovery/`. + **What this amends.** D37 §1's destinations and New chat placement; D22's ≥1280 list pane and the space between transcript and composer; and the drawing of #93's New chat disc. It replaces the supplied tracker rules diff --git a/docs/decisions/design-kit/storage.md b/docs/decisions/design-kit/storage.md index f1fa704115..80952101f2 100644 --- a/docs/decisions/design-kit/storage.md +++ b/docs/decisions/design-kit/storage.md @@ -11,14 +11,28 @@ approval; it is a design, not evidence of a shipped pane or removal operation. The screenshots in the original brief illustrate the proposal; the rulings and layouts here control where the proposal differs. -The [accounting model](../../plans/storage-accounting.md) supplies ownership, -object identity, capacity scopes and coverage. The [lifecycle model](../../plans/storage-lifecycle.md) +The [accounting model](https://github.com/schlessera/brain-kit/blob/5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0/docs/plans/storage-accounting.md) supplies ownership, +object identity, capacity scopes and coverage. The [lifecycle model](https://github.com/schlessera/brain-kit/blob/5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0/docs/plans/storage-lifecycle.md) supplies action eligibility and recovery. Read both with the later [native storage decision](../native-brain-storage.md): immutable native checkpoints, writable output staging, turn temp and retained recovery objects have distinct owners and capacity. A lower-only deletion does not release writable-upper headroom. Neither discovery authorizes a new retention policy. +> **2026-11-02 — Both discoveries left `docs/plans/` ([#2511](https://github.com/schlessera/brain-kit/issues/2511)).** +> #1779, #1780, #1781 and #2013 are closed, and the inventory, owner +> maintenance and recoverable removal they informed are built (#2009 in #2017, +> #2010–#2013 in #2172). Their recommendations and constraints that +> still bind are in this entry, chiefly under +> [Maintenance and ongoing management](#maintenance-and-ongoing-management) and +> [Implementation boundaries and deferred capabilities](#implementation-boundaries-and-deferred-capabilities); +> the shipped command and HTTP shapes are in the integration contract +> (`docs/integration-contract/cli.md`, `docs/integration-contract/http.md`). +> Read the discoveries unchanged at the pinned links above. The accounting +> experiment moved to the +> [measurement archive](../measurement-archive.md#storage-design-experiments-2511); +> the lifecycle experiment is still `experiments/storage-lifecycle.ts`. + ### Placement and alternatives Storage is the eighth Settings pane, in **This brain**, immediately after diff --git a/docs/decisions/measurement-archive.md b/docs/decisions/measurement-archive.md index 0ec9d3aff3..2f75a2df46 100644 --- a/docs/decisions/measurement-archive.md +++ b/docs/decisions/measurement-archive.md @@ -192,6 +192,34 @@ a date. - **Measured source:** not recorded. **Introduced by:** `e8f94c6c1f1f`. - **Files:** [probe.py](https://github.com/schlessera/brain-kit/blob/48227b09076b350d70d9d20b8492ffcfb5b95771/scripts/policy-boundary-spike/probe.py), [worker.ts](https://github.com/schlessera/brain-kit/blob/48227b09076b350d70d9d20b8492ffcfb5b95771/scripts/policy-boundary-spike/worker.ts) +### Archived later + +> **2026-11-02 — Files removed from `main` after the original archive commit.** +> Each was added to `archive/measurements` as a new commit on top of the +> branch, at its original path, byte for byte. The 94-file count above and the +> branch's top-level `manifest.json` and `SHA256SUMS` describe only the original +> commit; each later bundle carries its own manifest and checksums. + +#### Unreferenced CI selection replays (#2512) + +- **Path:** `docs/process/evidence/independent-test-replay.json`, `docs/process/evidence/browser-input-closure-replay.json` +- **Role:** historical output (100-PR replays of independent Bun test-leaf selection and of browser proof input discovery, both at the 2026-10-16 cutoff). +- **Consumers before removal:** none. No document, test, script or CI step named either file; one note inside `docs/process/evidence/test-wait-review-partition.json` mentions `independent-test-replay.json` in passing, which is a pointer, not a consumer. +- **Disposition:** archived in commit [`c24a848238724b797386fdd9e9dbdbf2bb254d59`](https://github.com/schlessera/brain-kit/tree/c24a848238724b797386fdd9e9dbdbf2bb254d59/scripts/measurements/retired-docs-2542-2026-11-02), copied from main commit `5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0`. +- **Measured source:** `626a03af4a9db064751230a84732755b8afa961e` (browser-input-closure-replay.json sourceBase); not recorded for independent-test-replay.json. **Introduced by:** `d6b527290fe2` (#2147), `b6d7391de6ba` (#2152). +- **SHA-256:** `4b5cd6bd74882b34893b958cca88ff90c5d1c3e60a28115712e5966062b1a496` (independent-test-replay.json), `6cf33fd312f82c3a0b4ec43274a2d714b45995720a40363beae62e662b35adaf` (browser-input-closure-replay.json). +- **Files:** [independent-test-replay.json](https://github.com/schlessera/brain-kit/blob/c24a848238724b797386fdd9e9dbdbf2bb254d59/docs/process/evidence/independent-test-replay.json), [browser-input-closure-replay.json](https://github.com/schlessera/brain-kit/blob/c24a848238724b797386fdd9e9dbdbf2bb254d59/docs/process/evidence/browser-input-closure-replay.json) + +#### Storage design experiments (#2511) + +- **Path:** `docs/plans/storage-accounting-experiment.py`, `docs/plans/storage-growth-experiment.ts` +- **Role:** finished experiments (the #1780 fixture inventory prototype and the #2014 offline rule-qualification traces). +- **Consumers before removal:** run only from `docs/plans/storage-accounting.md` and `docs/plans/storage-growth.md`, which were retired in the same change. No test, script or CI step runs either file, and neither sits under a TypeScript or lint root. The shipped storage code carries its own tests. +- **Disposition:** archived in commit [`c24a848238724b797386fdd9e9dbdbf2bb254d59`](https://github.com/schlessera/brain-kit/tree/c24a848238724b797386fdd9e9dbdbf2bb254d59/scripts/measurements/retired-docs-2542-2026-11-02), copied from main commit `5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0`. The plans that record their conditions and results stay readable at that main commit. +- **Measured source:** not recorded. **Introduced by:** `1ed6e3d431fa` (#1785), `65ed23dc942e` (#2020). +- **SHA-256:** `e614e2887bbc470df39830d8432414ffced2d8559ad9b21b781be799b8b48bdf` (storage-accounting-experiment.py), `409624b52f10098f110f8d8e047679099dc9cfe2c9e4effa3cb1abe0007e0050` (storage-growth-experiment.ts). +- **Files:** [storage-accounting-experiment.py](https://github.com/schlessera/brain-kit/blob/c24a848238724b797386fdd9e9dbdbf2bb254d59/docs/plans/storage-accounting-experiment.py), [storage-growth-experiment.ts](https://github.com/schlessera/brain-kit/blob/c24a848238724b797386fdd9e9dbdbf2bb254d59/docs/plans/storage-growth-experiment.ts) + ### Retained in place (241 files) > **2026-10-10 — #838 spike harnesses removed.** The maintainer ruled the @@ -313,6 +341,12 @@ git restore --source 48227b09076b350d70d9d20b8492ffcfb5b95771 -- Each record keeps its measurements, failures and limits. Only the location of the evidence changed. +> **2026-11-02 — `docs/plans/policy-write-boundary.md` retired ([#2511](https://github.com/schlessera/brain-kit/issues/2511)).** +> The plan left `main` once its work shipped. Read it, with its links to this +> archive, at main commit +> [`5a0ce18f`](https://github.com/schlessera/brain-kit/blob/5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0/docs/plans/policy-write-boundary.md); +> [the all-writer decision](policy-write-boundary.md) links it there. + ## Keeping new output out `.gitignore` ignores the archived paths and their dated siblings: diff --git a/docs/decisions/policy-write-boundary.md b/docs/decisions/policy-write-boundary.md index 3fe86900e3..1526c2faab 100644 --- a/docs/decisions/policy-write-boundary.md +++ b/docs/decisions/policy-write-boundary.md @@ -9,11 +9,21 @@ The maintainer's three 2026-10-02 rulings on These choices bind implementation. They do not establish production containment, enable autonomous execution or make a release commitment. The -[finite investigation](../plans/policy-write-boundary.md) remains evidence about +[finite investigation](https://github.com/schlessera/brain-kit/blob/5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0/docs/plans/policy-write-boundary.md) remains evidence about its measured fixture. The [async collaboration decision](async-collaboration.md) and [voice decision](voice-permission.md#containment-shared-with-51-deliberately-not-identical) continue to bind authority and tool membership. +> **2026-11-02 — The investigation left `docs/plans/` ([#2511](https://github.com/schlessera/brain-kit/issues/2511)).** +> #672, #674 and #676 are closed, and the workers and validated application +> route this record selects are built, so the investigation is no longer a +> plan. Every ruling it asked for is recorded below, and its six measured +> escapes are retained as proof obligations in +> [Evidence the implementation still owes](#evidence-the-implementation-still-owes). +> Its measurements, mutation receipt and recorded environment are unchanged at +> the pinned link above; the spike it ran is on the +> [measurement archive](measurement-archive.md#policy-write-boundary-spike-750). + ## Every writer enters through the boundary Both first-party runtimes run in isolated workers, confined **before** SDK, diff --git a/docs/decisions/storage-guidance.md b/docs/decisions/storage-guidance.md index 9dc3799359..23ab3c0cf0 100644 --- a/docs/decisions/storage-guidance.md +++ b/docs/decisions/storage-guidance.md @@ -4,9 +4,17 @@ The maintainer approved the [reconciled bundle](https://github.com/schlessera/brain-kit/issues/2014#issuecomment-6212070681) after comparing the layered proposal in #2044 with the concurrent policy review. -The [design](../plans/storage-growth.md) specifies its encoding, qualification, +The [design](https://github.com/schlessera/brain-kit/blob/5a0ce18fdcecf0a6c5b83487c865a3f73806d5d0/docs/plans/storage-growth.md) specifies its encoding, qualification, recovery and delivery rules. This decision records policy, not runtime delivery. +> **2026-11-02 — The design left `docs/plans/` ([#2511](https://github.com/schlessera/brain-kit/issues/2511)).** +> #2058 and #2059 delivered it in #2172. The shipped history and guidance +> shapes are in the integration contract +> ([Storage history and pressure guidance](../integration-contract/http.md#storage-history-and-pressure-guidance-additive-2058)); +> the policy stays here. Read the design unchanged at the pinned link above. +> Its offline trace experiment moved to the +> [measurement archive](measurement-archive.md#storage-design-experiments-2511). + Keep 64 six-hour, 90 daily and 32 weekly endpoints: 186 records, four capacity scopes and a 256 KiB serialized history ceiling. The same observations update all three tiers without extra scans or catch-up work. Actual timestamps, gaps and diff --git a/docs/plans/README.md b/docs/plans/README.md index 8c601bfce5..bddc01ea57 100644 --- a/docs/plans/README.md +++ b/docs/plans/README.md @@ -10,20 +10,15 @@ judge any part of it. Once it ships, the plan stops being a plan: the durable half moves to [`../decisions/`](../decisions/README.md) and the rest is deleted, because the code has become the better answer to "what does this do". -| Plan | Design | -| --- | --- | -| [async-collaboration.md](async-collaboration.md) | The cross-package containment and collaboration design. | -| [async-collaboration-requirements.md](async-collaboration-requirements.md) | The requirements it came from. | -| [policy-write-boundary.md](policy-write-boundary.md) | U10's measured filesystem boundaries, escape cases and worker/effect-route ruling required before implementation. | -| [index-query-api.md](index-query-api.md) | Consumer migration using supported query results, approved optional-peer/root-bound context boundaries, reader inventory and safe SQL retirement. | -| [navigation-recovery.md](navigation-recovery.md) | Measured navigation reach, cold-session evidence and draft races informing the tracker design. | -| [storage-accounting.md](storage-accounting.md) | Proposed local storage ownership, deduplicated capacity and bounded measurement model, with synthetic evidence. | -| [voice-conversation.md](voice-conversation.md) | Proposed turn-taking, screen and interruption model; requirements for the later speech-architecture ruling. | -| [storage-growth.md](storage-growth.md) | Proposed bounded aggregate history, comparable growth and capacity-specific guidance, with explicit policy choices. | -| [storage-lifecycle.md](storage-lifecycle.md) | Storage cleanup eligibility, recovery boundaries and synthetic byte-lifecycle evidence for the storage design. | -| [host-owned-web-search.md](host-owned-web-search.md) | Pinned MCP/full-extension comparison, offline worker prototypes and authority boundaries for executor selection. | -| [module-renderers.md](module-renderers.md) | The content-renderer seam, Mermaid on it, the diagram spec, computed geometry, the brain-kit skin, surface and print matrix, ordering, and the upstream sync procedure. | -| [chat-history-deletion.md](chat-history-deletion.md) | Approved local deletion policy with unbuilt lifecycle design, retained-record boundaries and proof obligations. | +| Plan | Design | Open work | +| --- | --- | --- | +| [async-collaboration.md](async-collaboration.md) | The cross-package containment and collaboration design. | [#51](https://github.com/schlessera/brain-kit/issues/51) | +| [async-collaboration-requirements.md](async-collaboration-requirements.md) | The requirements it came from. | [#51](https://github.com/schlessera/brain-kit/issues/51) | +| [index-query-api.md](index-query-api.md) | Consumer migration using supported query results, approved optional-peer/root-bound context boundaries, reader inventory and safe SQL retirement. | [#701](https://github.com/schlessera/brain-kit/issues/701) | +| [voice-conversation.md](voice-conversation.md) | Proposed turn-taking, screen and interruption model; requirements for the later speech-architecture ruling. | [#54](https://github.com/schlessera/brain-kit/issues/54) | +| [host-owned-web-search.md](host-owned-web-search.md) | Pinned MCP/full-extension comparison, offline worker prototypes and authority boundaries for executor selection. | [#1863](https://github.com/schlessera/brain-kit/issues/1863) | +| [module-renderers.md](module-renderers.md) | The content-renderer seam, Mermaid on it, the diagram spec, computed geometry, the brain-kit skin, surface and print matrix, ordering, and the upstream sync procedure. | [#2079](https://github.com/schlessera/brain-kit/issues/2079) | +| [chat-history-deletion.md](chat-history-deletion.md) | Approved local deletion policy with unbuilt lifecycle design, retained-record boundaries and proof obligations. | [#3234](https://github.com/schlessera/brain-kit/issues/3234) | ## What does not live here diff --git a/docs/plans/navigation-recovery.md b/docs/plans/navigation-recovery.md deleted file mode 100644 index 7442d97504..0000000000 --- a/docs/plans/navigation-recovery.md +++ /dev/null @@ -1,416 +0,0 @@ -# Navigation and background-session recovery evidence - -Discovery for [#942](https://github.com/schlessera/brain-kit/issues/942), supplying -[#943](https://github.com/schlessera/brain-kit/issues/943) under -[#929](https://github.com/schlessera/brain-kit/issues/929). This is measured input -to the design, not a navigation amendment or an implemented recovery contract. -The [navigation ruling](https://github.com/schlessera/brain-kit/issues/929#issuecomment-5973564827) -and later [parallel-session ruling](https://github.com/schlessera/brain-kit/issues/929#issuecomment-5973572791) -provide the projected placements. The latter takes precedence. The later -maintainer decisions in [#929](https://github.com/schlessera/brain-kit/issues/929) -select authoritative host recovery A and per-session host-backed draft storage C. -They supersede the earlier discard-confirm proposal; the measurements below -describe incumbent behavior, and the selected contracts still require implementation. -The adopted design built on this evidence is -[D52 in the design-kit record](../decisions/design-kit/sessions-and-drafts.md#2026-10-06--d52-sessions-is-a-destination-work-left-running-is-tracked-until-seen-and-every-session-keeps-its-own-draft-943). - -## Evidence boundary and reproduction - -Package source measured: `94c3719608d68a7ccbe99d8ca6a7b0028b5c357d`. -The checked-in probes under `scripts/probes/navigation-recovery/` use public -package exports, built styles, the shared Odysseus raft fixture and the real -`createApp`/WebSocket/SQLite paths with a scripted `AgentBackend`. No model, -provider credential, private application, deployed host or usage telemetry is -involved. Sync and briefing endpoints return fixture SSE rather than performing -repository sync or paid generation. Search, stats and session/history/activity -routes use the real disposable fixture host. Opening Add is measured; submitting -it is not part of this probe. - -The consumer composition mounts ChatPage, ActivityPage or GraphPage according -to `activeView`, inside AppShell/BrainUiProvider. It deliberately holds a root -connection lease across those mounts. Consequently, composer unmount observations -apply to this composition; AppShell accepts children and does not prescribe a -consumer's page-retention policy. Files and Settings are currently owned by -ChatPage. Visiting them from Actions/Graph needs a Chat activation in this -composition; changing a store flag alone is not proof of a visible destination. - -Run from an installed checkout with built packages and real Chromium: - -```sh -bun run build -bun scripts/probes/navigation-recovery/store.ts /tmp/brain-navigation-recovery -bun scripts/probes/navigation-recovery/navigation.ts /tmp/brain-navigation-recovery -bun scripts/probes/navigation-recovery/paths.ts /tmp/brain-navigation-recovery -bun scripts/probes/navigation-recovery/live.ts /tmp/brain-navigation-recovery -bun scripts/probes/navigation-recovery/away.ts /tmp/brain-navigation-recovery -bun scripts/probes/navigation-recovery/terminal.ts /tmp/brain-navigation-recovery -bun scripts/probes/navigation-recovery/races.ts /tmp/brain-navigation-recovery -``` - -The optional last argument is the output directory. Each phase writes its own -JSON receipt; navigation also writes screenshots. Output records the checkout -SHA and browser version. The browser permits only its loopback fixture origin; -external attempts are counted and blocked. No remote fonts are loaded. Viewports -are CSS pixels with a viewport meta tag, height 900, reduced motion, fine versus -coarse pointer, and dark versus light theme. The six widths are 320, 390, 480, -900, 1280 and 1440. Keyboard injection into a coarse-pointer context proves the -registered keyboard route, not a physical phone keyboard or operating-system -soft-keyboard geometry. - -Receipts: 24 layout cases, 84 act paths plus 60 destination paths, 37 handler/store -scenarios, 17 draft paths, 20 live-host observations, two offline-completion -observations, two terminal/pruning observations and four delayed-frame races. -Inputs include nonempty streams, one pending approval, all four pending question -kinds, real 64×64 image attachments and nonempty draft text. Chromium 140.0.7339.127 reported no page errors or attempted external requests. A zero-message or zero-question input is not used as proof of retention. -The handler-only matrix calls the actual root/demux but is not a browser or host -restart. JSON observations are evidence, not a new application wire format. - -Existing controls: 20 tests/65 assertions across session-demux and root-isolation; -85 tests/379 assertions across parallel sessions, history, failure replay, -approval persistence, list/rank/form, revocation and multi-backend session routes; -33 tests/169 assertions across turn correlation, Activity routes and boot sweep. -The last group verifies pruned rollup resolution, unknown-run 404 and orphan -interruption. These are existing behavioral tests, not new implementation guards; -no fix or failing-first mutation is claimed by this documentation spike. - -## Destinations, acts and frequency provenance - -S means session-level, D daily, O occasional. These classes come from the -maintainer's supplied preferences, not observed counts. Search's S is provisional; -Graph's O includes the explicit preference that it is never used. No quantitative -frequency distribution was collected or inferred. - -| Destination | Current rail / phone | Projected rail / phone | Availability and effect | Class | -| --- | --- | --- | --- | --- | -| Chat | slot 1 / slot 1 | slot 1 / slot 1 | Local view change; no turn dispatch | S preference | -| Sessions | palette / More | slot 2 / slot 2 | Opens session selection; history reads on selection; no turn dispatch | S preference | -| Actions | slot 2 / slot 2 | slot 3 / slot 3 | Activity/decision destination; its own actions retain their authority checks | No measured class | -| Files | slot 3 / slot 3 | slot 4 / slot 4 | Opens file browser; reads are distinct from edits | O preference | -| Graph | slot 4 / slot 4 | palette / More | Opens graph; graph edits are separate actions | O preference | -| Settings | slot 5 / More | slot 5 / More | Opens settings; saving configuration is separate | No measured class | - -Sessions is currently one of the palette's seven acts, and becomes a destination -in the ruling. This is one command with two inventory roles, not an eighth act. - -| Act | Current visible homes | Projected homes | Availability and actual effect | Class | -| --- | --- | --- | --- | --- | -| New chat | occupied Chat disc, Sessions New conversation, desktop palette | occupied Chat below 1280; Sessions pane at ≥1280; palette/selection | Local transcript selection resets; no cancel/send. Current local composer is retained | S preference | -| Sessions | desktop palette; phone More | destination; wide pane | Opens history list; selecting replays history, does not restart the agent | S preference | -| Search | empty welcome, slash, desktop palette | both rails; occupied phone disc; welcome | Opening remains allowed during streaming/socket loss. REST search still requires a reachable authorized host. No model dispatch or write | S provisional preference | -| Add a note | slash, desktop palette | both rails; welcome; phone More | Opening has no write, including during streaming/socket loss. Submit writes/indexes and retains its own errors/authority | D preference | -| Daily briefing | welcome, slash, More, desktop palette | expanded rail; welcome; More; palette on collapsed rail | Handler requires connected/quiet active buffer; opening starts its streaming job. Paid-generation possibility must keep `spends` visible | D preference | -| Sync | slash, More, desktop palette | More and palette | Handler requires connected/quiet active buffer; opening starts repository sync. Keep `sync` visible when unavailable | O preference | -| Brain statistics | welcome, slash, More, desktop palette | More/palette | Quiet active buffer; REST data plus local software identity, no inference. Adds a local exchange and can persist it to the host; no Markdown write | O preference | - -The expanded rail currently contains no dedicated act rows. The desktop palette -has 12 commands: five destinations and seven acts in Jump to / Ask / Run groups. -The five slash commands are sync/search/whatsup/add/stats; slash provides neither -New chat nor Sessions. Current More has Settings/Sessions/Sync/briefing/stats, -without Search/Add. Current welcome has briefing/Search/stats, without Add. - -Opening a Search/Add panel is not evidence of executing its operation. Conversely, -Sync/briefing opening starts a job; the harness substitutes those two job responses -and therefore makes no claim about real job success or cost. - -## Browser reach and activation counts - -A count is an activation of a control, including opening the palette or More; -setup/reset and typing a slash query are excluded. Slash paths therefore include -an explicit typing prerequisite and are not equivalent to one visible tap. -Each counted route was executed without forced clicks. Panel dismissal counts. - -| CSS width | Visible primary controls | Observed target dimensions | ⌘K cap click/tap | Keyboard palette | -| --- | --- | --- | --- | --- | -| 320, 390 | Chat/Actions/Files/Graph/More | Tabs: 48.06–59.16 wide, 50.5 high | No cap | Hidden, including after modifier-K | -| 480 | Collapsed five-destination rail | Every destination 43×36 | 0 palette openings | 12 commands | -| 900, 1280, 1440 | Expanded five-destination rail | Every destination 183×36 | 0 palette openings | 12 commands | - -Both themes and pointer modes gave the same control geometry. Fine pointers -print chords; coarse pointers omit printed destination chords but the injected -keyboard still opens the desktop palette. The passive cap's glyph box is -23.40625×17.5, not a button. Its position is x=17.796875 at 480, x=12 at expanded -widths, y=866.5. The occupied New chat target is 44×44 at x=`width−60`, y=11 at all -six widths. Welcome Search opened the Search panel in every layout case. -The More dialog wrapper has zero height because its docked sheet child is -absolutely positioned; measuring the child/rows proves visibility. Treating the -wrapper's `isVisible()` as proof that the sheet failed to open was a harness -error, corrected before recording the matrix. - -Current observed act paths at 390 (coarse), from the six entry states: - -| Entry | New chat | Sessions | Search | Add | Briefing | Sync | Stats | -| --- | --- | --- | --- | --- | --- | --- | --- | -| Empty Chat | 3: More → Sessions → New conversation | 2 | 1: welcome | 1 + slash typing | 2 via More | 2 | 2 | -| Occupied Chat | 1: disc | 2 | 1 + slash typing | 1 + slash typing | 2 | 2 | 2 | -| Actions | 2: Chat → disc | 2 | 2 + slash typing | 2 + slash typing | 2 | 2 | 2 | -| Files open over Chat | 2: close → disc | 3 | 2 + slash typing | 2 + slash typing | 3 | 3 | 3 | -| Graph | 2: Chat → disc | 2 | 2 + slash typing | 2 + slash typing | 2 | 2 | 2 | -| Settings open over Chat | 2: close → disc | 3 | 2 + slash typing | 2 + slash typing | 3 | 3 | 3 | - -At 900, modifier-K plus the act row takes two activations from all six states; -`inChat` closes the other panels through the UI view setter. The occupied Chat -disc separately takes one. These keyboard measurements do not establish a -pointer-only desktop route: clicking the cap never opens anything. Welcome or -slash alternatives require Chat/composer access. Sync/briefing/stats cannot -execute merely because a visually present row was clicked when the handler's -availability guard refuses it. - -Current destination paths at 390: Chat/Actions/Graph take one activation from -uncovered pages; Files takes one from Chat and two from Actions/Graph in this -composition; Settings takes More plus its row, with an extra Chat activation -from Actions/Graph. Dismissing an open Files/Settings drawer adds one. At 900, -rail Chat/Actions/Graph takes one; Files/Settings takes one over Chat, or Chat -then the destination from Actions/Graph. These distinctions are recorded in -`paths.json`, including the resulting UI state, not inferred from labels. - -Projected counts below are source/ruling projections, not runtime measurements: - -| Width/view | Search | Add | Briefing | Sessions | New chat | Rare commands | -| --- | --- | --- | --- | --- | --- | --- | -| 320/390 occupied Chat | 1 disc | 2 via More | 2 via More | 1 destination | 1 disc | 2 via More | -| 320/390 empty Chat | 1 welcome | 1 welcome | 1 welcome | 1 destination | Selection → New conversation; a reset of an already empty view needs no act | 2 via More | -| 320/390 Actions/Graph | Chat → Search, 2 | More → Add, 2 | More → briefing, 2 | 1 destination | Chat → disc or Sessions → New conversation, 2 | 2 via More | -| 480 collapsed rail | 1 rail | 1 rail | 2 visible palette | 1 destination | 1 occupied Chat; selection needed from other views | 2 visible palette | -| 900 expanded rail | 1 rail | 1 rail | 1 rail | 1 destination | 1 occupied Chat; selection needed from other views | 2 visible palette | -| 1280/1440 Chat | 1 rail | 1 rail | 1 rail | Visible Sessions pane | 1 pane action | 2 visible palette | - -Open-panel dismissal, already active Sessions behavior, New chat from other -views at ≥1280 and focus/selection outcomes need the exact table in #943. -The report does not assume that a hidden or covered control fulfills reach. -The later ruling's two-activation phone daily acts and collapsed briefing are -settled exceptions, not grounds for adding unspecified controls. - -## Session and run recovery matrix - -The 36 primary store cases cross running, queued, approval, question, list, -rank, form, success and failure with A→B, New chat, twelve idle buffers and a -fresh root. The 37th verifies nonempty background A completion leaves B untouched. - -| Transition | Actual evidence | Consequence | -| --- | --- | --- | -| A→B / New chat | Running A and all pending cards remain in its in-memory buffer; terminal success/failure remain too. Live backend-start count does not change | Navigation does not abort or redispatch work | -| Twelve idle buffers | Six real live sessions, including approval and all four ask kinds, survive; idle buffers evict down to eight. Handler-only queued/terminal A can evict while queued runStates remains | Buffer presence and badge presence are different facts; MAX_BUFFERS is not a tracker retention policy | -| Fresh root without a connection | Stored selected ID survives with a stable prefix; transcripts/runStates/cards do not | Local storage currently holds resume identity, not history or a pending-card snapshot | -| Same-root reconnect, six open turns | Host retains and resends all pending kinds; existing question buffers retain cards | Warm reconnect is stronger than cold reload, but history replacement can overwrite live content | -| Fresh root / reload, six open turns | Only selected running session history materializes; other pending frames leave run badges but no cards because their buffers do not exist | Multiple-open-turn reconnect does not reconstruct every background transcript | -| Background session_resume | History materializes without changing selected running transcript; backend starts remain 6 before/after. It does not resend interactive requests | Replaying history is not restarting work, nor complete pending-request recovery | -| Reconnect after background histories | Question/list/rank/form cards return. Approval still does not appear when replay ends in a user-only message | Approval rendering needs an assistant target; it cannot rely on a later delta existing | -| Success/failure reload | Finished selected session replays two nonempty history messages; no new turn starts | Successful replay does not by itself correlate every historical message to its original turn | -| A succeeds/B fails while socket is closed, C still running | Activity records success/error; warm client can retain stale A/B running badges. Explicit background replay clears their run state without selecting them or starting a turn | Missed terminal frames require authoritative per-turn reconciliation | -| Cancel pending approval | Host Activity run ends cancelled, distinctly from error; client badges can remain stale after interactive cleanup | A badge is not terminal proof; cancelled must not be guessed to mean succeeded/failed | -| Missing backend history | Scoped SESSION_LOAD_ERROR; selected transcript preserved | Show unavailable/unknown with recovery action; do not fabricate empty successful history | -| Pruned Activity detail | Actual fixture REST returns 200, detailPruned=true and terminal rollup; never-existing run returns 404 | Pruning is not deletion or an unknown outcome | - -The scripted backend's partial running history deliberately ends in a user row. -This is a valid `getHistory` result and exposes the approval target dependency; -it is not a claim that a particular live provider always persists that shape. -All four question kinds were nonempty before transition. The existing -[#910](https://github.com/schlessera/brain-kit/issues/910) already owns question -identity/deduplication, post-resume redelivery and honest submitted-answer -recovery. Its approved policies are not reopened here. Tool approval recovery is -outside its scope and needs separate scoping with the tracker prerequisites. - -The browser fixture uses ambient loopback authorization, not a browser login -claim. The host's real revocation tests establish authorization leases, pending -reply refusal after revocation and no history emission after async revocation. -The API auth guard covers session and Activity routes. Session IDs and turn IDs -are correlation, never grants. session_resume rechecks connection authorization -after asynchronous history/replay waits. Rehydration must remain read-only and -must not reply to questions/approvals, create a turn or restore revoked authority. - -A root recreation is not a host process restart. Host pending interactions and -queued follow-ups live in coordinator maps. Boot-sweep tests prove that persisted -orphan Activity roots become interrupted after reopening the database, not that -pending backend execution or interactive prompts resume. No host restart or -browser reload should claim to resurrect those maps. - -## Terminal and seen-turn proof - -The real host probe observes a turn's session_info `turnId` equal to Activity's -`runId`. The same ID progresses from live (outcome/endedAt null) to terminal -success. A second request updates catalog lastActiveAt and creates a different -live run with null outcome/endedAt while the old success remains in history. -A queued follow-up also leaves the earlier live Activity root in place while the -client session badge becomes queued. Queue acceptance is not terminal success, -and its requestId is not yet a new executing turnId. - -Thus `lastActiveAt > leftAt`, a missing runStates entry, history existence, -replay-generated message IDs and lastTouched cannot prove latest-turn completion -or visibility. Both catalog stub and result persistence update lastActiveAt. -Activity already provides terminal identity/outcome/end time for a known run, -including after detail pruning. It does not prove which accepted queued request -is latest, that successful history contains that turn, or that it was on screen. - -Recommended minimal truthful strategy: - -1. Persist root-scoped tracker identity and known request/turn IDs, never - credentials, transcripts or a global unpartitioned `brain-trackers` key. - A default root gets a random prefix; an embedder needs an explicit stable - prefix for reload continuity. Changing principal must remove replay authority. -2. Use a current authorized pending request for **needs you**; a current queue - entry for **queued**; a live matching Activity turn for **running**. Use a - matching terminal rollup for **done** or **failed**, with its actual endedAt. - A known old success cannot hide a newer queued/running/unknown request. -3. Preserve **unknown/unavailable** when the latest accepted identity, authorized - pending state or replay linkage is unproved. Missing Activity support is - unknown, not done. Existing failure taxonomy includes error/timeout/interrupted; - cancelled and denied are user dispositions. Revocation is an authority event, - not an additional Activity terminal outcome: work can continue after it. -4. Clear a tracker only after the recovered latest turn is rendered at the - adopted foreground/viewport position. Guard that observation with the exact - identity so a newer request cannot be erased by an older visibility callback. - Merely selecting a session or reaching the bottom of an unrelated replay - does not establish this proof. - -For full cold latest-turn semantics, selected recovery A requires executable -identity proof while retaining honest unknown states when evidence is absent. -#943 supplies the exact design and durable amendment; #964 implements the selected read-only -`GET /api/sessions/:id/recovery` envelope with: - -```ts -{ - sessionId: string; - backendId: string | null; - revision: number; // host-owned per-session accepted-work ordering - latest: { - requestId: string | null; - turnId: string | null; // absent/null before queued work dispatches - state: "queued" | "running" | "terminal" | "unknown"; - outcome: ActivitySpanOutcome | null; - startedAt: number | null; - endedAt: number | null; - }; - pending: Array<{ - kind: "approval" | "ask_user" | "ask_user_list" | "ask_user_rank" | "ask_user_form"; - requestId: string; - turnId: string; - }>; -} -``` - -This is selected future scope under recovery A, not an existing endpoint. Latest/revision provenance must be -host acceptance plus the coordinator and durable catalog/Activity records; -backend mtime is insufficient. Unknown remains explicit after lost queue state -or uncorrelated imported history. Successful `session_history` messages need an -optional host-proven `turnId` (or an equivalent replay boundary) before a cold -viewport can claim that turn seen. Do not manufacture linkage from message count, -content equality or timestamp ordering. Missing evidence omits linkage. - -Authorization must cover the whole envelope and every pending identity; denial -must not disclose protected work. Recheck leases after asynchronous reads and -retain interactive principal/session/turn binding. The endpoint grants no action. -A compatible host advertises optional recovery support; unsupported peers keep -unknown state. New endpoint/optional history fields/capability require the SDK -schemas, HTTP reference, same-commit integration contract, CONTRACT: commit and -minor changeset. No such machine surface changes in this evidence PR. - -## Draft measurements and design input - -The ordinary draft cases run at 390/coarse and 900/fine; each starts with `Unsent raft plan` and one valid image. - -| Path | Text / image after navigation | Transcript result | -| --- | --- | --- | -| New chat disc | Preserved / 1 | Active session null | -| Sessions New conversation | Preserved / 1 | Active session null | -| Palette New chat | Preserved / 1 | Active session null | -| Drawer A→B selection, including background row | Preserved / 1 | B selected and history replayed | -| Files or Settings and back | Preserved / 1 | A remains selected | -| Actions or Graph and back | Empty / 0 | A's store survives; this composition remounts Composer | - -The store's clearMessages does not clear Composer's useState input/images and -does not clear pendingDraftId. Current New chat therefore does not discard an -ordinary unsent local draft, while session selection can carry its text into B. -The later maintainer choice replaces discard confirmation with a separate draft -per session: New chat saves A and opens empty; returning to A restores its text -and attachments. #943 supplies exact restore/delete/focus behavior, #951 owns -composer/send correlation, and #979 owns selected authenticated host storage C -with revision/idempotency, durable attachment bytes and cross-device conflict handling. -Preserved content must not be labelled lost or described as saved before acceptance. - -The delayed-frame probe holds actual host frames after a first Composer send: - -| Race | Observed result | -| --- | --- | -| Edit a newer draft before acceptance | Newer text remains; submitted image is removed; matching session announcement binds the first turn | -| New chat before acceptance | Newer text remains, old submitted image is consumed on receipt; new view remains unbound but pendingDraftId remains stale | -| New chat, then local stats creates a draft | Old matching announcement adopts the recreated stats draft and selects the old session, undoing New chat; newer text remains | -| Attempt another send while acknowledgement is held | Pending-send guard prevents a second dispatch; it is not evidence of two simultaneous first sends | - -The selected per-session draft lifecycle must coordinate local input lifetime, -accepted versus unconfirmed send ownership, correlation invalidation and receipt consumption. Preserve an -unknown send for review rather than silently resending it. A background result -cannot own a new draft. Explicit draft removal and accepted-send consumption must target the matching -identity/revision, retaining newer unsent edits and another session's attachments. -No discard confirmation for preserved drafts or streaming-only backend cancel -is selected by the later ruling. - -## Source anchors - -The ranges below describe the measured package snapshot, not an inferred future -implementation. Any PR moving these lines owns their citation repairs. - -- Palette commands: [`const jumpTo: PaletteItem[] = [`](https://github.com/schlessera/brain-kit/blob/18d5ddee154b5dbebb3dbd6c487bc8ea1fc036db/packages/ui-react/src/components/layout/desktop-palette.tsx#L84-L117), before #946 moved the destinations into `desktop-routes.ts`. - -- Palette opening: [`function onKey(e: KeyboardEvent) {`](https://github.com/schlessera/brain-kit/blob/18d5ddee154b5dbebb3dbd6c487bc8ea1fc036db/packages/ui-react/src/components/layout/desktop-palette.tsx#L52-L59), before #946 moved the open state into the root's UI store. - -- Phone destinations/More: (`const items: TabItem[] = [`, `packages/ui-react/src/components/layout/mobile-tab-bar.tsx:93-150`). - -- Command availability/effects: (`export function useChatCommands(): (command: string) => void {`, `packages/ui-react/src/components/chat/use-chat-commands.ts:18-56`). - -- Stats local exchange: (`export async function runStats(root: BrainUiRoot, sessionId: string | null): Promise {`, `packages/ui-react/src/components/chat/use-chat-commands.ts:70-156`). - -- Welcome alternatives: (`label="Start with"`, `packages/ui-react/src/components/chat/welcome-state.tsx:46-55`). - -- Session selection: (`const handleSessionResume = useCallback(`, `packages/ui-react/src/components/chat/chat-page.tsx:497-504`). - -- New chat: (`{hasMessages && !wide && (`, `packages/ui-react/src/components/chat/chat-page.tsx:702-709`). - -- Buffer eviction: (`function evictStale(`, `packages/ui-react/src/stores/chat-state.ts:1086-1102`). - -- Root namespace: (`const prefix = options.storagePrefix ??`, `packages/ui-react/src/root.ts:182-237`). - -- Clear transcript selection: (`clearMessages: () => {`, `packages/ui-react/src/stores/chat-state.ts:2139-2148`). - -- Composer draft/acknowledgement: [`const [input, setInput] = useState("");`](https://github.com/schlessera/brain-kit/blob/7bfdc71074f4ff6243e0d7133e83dbb36eb2a971/packages/ui-react/src/components/chat/composer.tsx#L62-L85), before #951 moved the draft into the root's draft store (`stores/draft-state.ts`). - -- Receipt consumption: [`if (!receipt || !pendingSend) return;`](https://github.com/schlessera/brain-kit/blob/7bfdc71074f4ff6243e0d7133e83dbb36eb2a971/packages/ui-react/src/components/chat/composer.tsx#L161-L176), before #951 moved send settlement into the draft client (`lib/draft-client.ts`). - -- Draft announcement correlation: (`function isOurDraftAnnouncement(`, `packages/ui-react/src/connection.ts:95-106`). - -- Demux: (`const frameSessionId = (msg as { sessionId?: string }).sessionId;`, `packages/ui-react/src/connection.ts:500-574`). - -- History replay: (`session_history: (msg, context) => {`, `packages/ui-react/src/hooks/websocket-handlers/chat.ts:437-448`). - -- Single background drawer row: [`const backgroundSessionId =`](https://github.com/schlessera/brain-kit/blob/ea8506b0eb511a3e16dba685d250d34e5340afa4/packages/ui-react/src/components/chat/session-drawer.tsx#L59-L60), before #950 replaced it with the Working group. - -- Host reconnect: (`const runningTurns = [...coordinator.running].filter((t) => t.sessionId);`, `packages/ui-server/src/ws/connection.ts:128-193`). - -- Host resume: (`case "session_resume": {`, `packages/ui-server/src/ws/dispatch.ts:648-712`). - -- Catalog activity: (`persistSessionStub(sessionId, promptText, providerId, backendId) {`, `packages/ui-server/src/ws/session-catalog.ts:479-486`). - -- Session summary shape: (`export interface ChatSession {`, `packages/ui-sdk/src/protocol.ts:1576-1592`). - -- Run identity: (`const runId = turn.turnId;`, `packages/ui-server/src/activity/recorder.ts:154-155`). - -- Outcome vocabulary: (`export type ActivitySpanOutcome =`, `packages/ui-sdk/src/protocol.ts:2983-3006`). - -- Activity resolution: (`.get("/activity/runs", (c) => {`, `packages/ui-server/src/routes/activity.ts:145-283`). - -- API authorization: (`app.use("/api/*", authGuard(authMode, auth, db));`, `packages/ui-server/src/app.ts:905`). - -- Queued acceptance: (`// Queue it as the session's next turn; report queued immediately.`, `packages/ui-server/src/ws/run-session.ts:1102-1147`). - -- Approval target: (`function mutateLastAssistant(`, `packages/ui-react/src/stores/chat-state.ts:1233-1263`). - -## Bounded follow-up ownership - -[#964](https://github.com/schlessera/brain-kit/issues/964) implements the selected -latest-turn/replay proof and pending-approval recovery after #943 supplies its exact design. -[#910](https://github.com/schlessera/brain-kit/issues/910) retains the four ask -recovery paths; #951 retains New chat draft/receipt coordination. -[#965](https://github.com/schlessera/brain-kit/issues/965) records the currently -unnamed Files drawer close button found while measuring dismissal. These scopes -consume the later recovery A and draft-storage C rulings in #929. This report -implements neither contract and does not waive their separate design, compatibility -or runtime proof requirements. diff --git a/docs/plans/policy-write-boundary.md b/docs/plans/policy-write-boundary.md deleted file mode 100644 index 327a8e6313..0000000000 --- a/docs/plans/policy-write-boundary.md +++ /dev/null @@ -1,197 +0,0 @@ -# Policy-write boundary investigation - -R35 requires every agent runtime, including ordinary interactive turns, to be -unable to write `context/policies/**`. V1 also reads no policies for authority -(R33). This investigation for [#672](https://github.com/schlessera/brain-kit/issues/672) -preserves [the full autonomous scope](../decisions/async-collaboration.md) and -[the voice rule](../decisions/voice-permission.md#containment-shared-with-51-deliberately-not-identical): -one tool-enforcement mechanism with different named voice/unattended memberships. - -**Result:** no measured boundary meets R35 in the current server/adapter -architecture while retaining ordinary direct brain writes. A Linux whole-worker -experiment protects policy bytes, including aliases and inherited-descriptor -attempts, by mounting the entire brain read-only and giving the worker a separate -scratch filesystem. Applying that shape requires a ruling on worker isolation -and how interactive edits reach the authoritative brain. This is a recommendation, -not that ruling, a shipping guard, or production containment evidence. - -**2026-10-02 ruling:** [The durable decision](../decisions/policy-write-boundary.md) -records the subsequently approved worker architecture, editing/application policy -and Linux-first host/refusal scope. The result above and the recommendation below -describe the experiment before those rulings; their measurements and proof limits -remain unchanged. Approval is not production containment evidence. - -## Why a tool hook or child-only wrapper is insufficient - -Claude assembles the ordinary SDK turn, project settings and in-process bridge -tools (`createClaudeSdkTurn`, `packages/ui-backend-claude/src/sdk-options.ts:110-499`). -The installed SDK exposes `spawnClaudeCodeProcess`; at the investigation baseline, -the adapter wrapped the child with piped stdio -([historical `createWrappedSpawn`](https://github.com/schlessera/brain-kit/blob/ca1facc1e7086bd2119c260150e9f091e16817f1/packages/ui-backend-claude/src/spawn-wrapper.ts)). -#1037 subsequently made worker execution unconditional, and #1808 retired the -unused adapter. This paragraph preserves the earlier child-only boundary analysis. -Parent-side MCP/bridge -handlers are outside a boundary around that child. Their effects must be audited -and validated separately; this report does not claim they currently write policies. - -At the investigation baseline, pi created sessions directly in the server. -The same SDK construction is now worker-local (`async newSession`, -`packages/ui-backend-pi/src/native-session-runtime.ts:41-72`). Its resource loader -initializes extensions (`createSessionResources`, -`packages/ui-backend-pi/src/session-resources.ts:29-116`). The permission extension -registers a tool-call handler (`createPermissionGate`, -`packages/ui-backend-pi/src/permission-gate.ts:96-120`); it cannot interpose arbitrary -filesystem calls during extension initialization or execution. The experiment -loads a real pi inline extension and observes its parent-side initialization -changing the policy. Sandboxing only its spawned shell cannot repair that. - -Upstream [pi's security policy](https://github.com/earendil-works/pi/security) -places extensions inside the local user's trust boundary. Claude's -[Bash sandbox documentation](https://code.claude.com/docs/en/sandboxing#scope) -distinguishes shell/descendant confinement from built-in file tools and other -execution paths. A Bash sandbox plus path predicates therefore does not establish -the requested all-writer boundary. The repository's Bash classifier documents -indirection as accepted write-lock exposure (`A Bash command the classifier misses`, -`packages/ui-backend-claude/src/tool-policy.ts:226-231`), rather than containment. - -## Executable evidence - -The private experiment is [probe.py](https://github.com/schlessera/brain-kit/blob/48227b09076b350d70d9d20b8492ffcfb5b95771/scripts/policy-boundary-spike/probe.py) -with [worker.ts](https://github.com/schlessera/brain-kit/blob/48227b09076b350d70d9d20b8492ffcfb5b95771/scripts/policy-boundary-spike/worker.ts). It creates and -destroys its own fictional Odysseus files; it never opens a content repository, -uses provider credentials, or makes an inference request. Both files now live -on the [measurement archive](https://github.com/schlessera/brain-kit/tree/48227b09076b350d70d9d20b8492ffcfb5b95771/scripts/policy-boundary-spike) -([#1385](https://github.com/schlessera/brain-kit/issues/1385)); the archive's -README records the historical runtime. `worker.ts` imports repository source, -so a checkout of `9adc62e70b4f5eac9b5e3ef779552cd1858a6bd2`, the last main -commit that contains them, is the faithful setting. To try them on another -checkout, restore them at their original path, then run from the repository -root after a frozen dependency install: - -```sh -git fetch origin 48227b09076b350d70d9d20b8492ffcfb5b95771 -git restore --source 48227b09076b350d70d9d20b8492ffcfb5b95771 -- scripts/policy-boundary-spike -set -o pipefail -python3 scripts/policy-boundary-spike/probe.py 2>&1 | tee /tmp/policy-boundary-proof.log -python3 scripts/policy-boundary-spike/probe.py --mutation 2>&1 | tee /tmp/policy-boundary-mutation.log -python3 scripts/policy-boundary-spike/probe.py 2>&1 | tee /tmp/policy-boundary-restored.log -``` - -The mutation is expected to exit 1. It replaces the brain's read-only binding with -a writable binding. The installed pi Write executor succeeds, scratch writing -still succeeds, and the controller's `POLICY_BYTES_UNCHANGED failed: write under -mutation` assertion fails. This is an observed byte-integrity failure after the -writer executes, rather than a module-load failure. Restoring the normal profile -passes again. - -Measured on 2026-10-01: Linux x86_64, kernel -`6.18.33.2-microsoft-standard-WSL2`, Bun `1.3.14`, Python `3.12.3`, bubblewrap -`0.9.0`, Landlock ABI `7`, installed pi coding-agent `0.99.2`, and installed Claude -Agent SDK `0.3.283`. Versions come from the running tools and installed manifests. -The Claude adapter's real spawn function executes a fixture Bun program; the -experiment does **not** run a Claude model turn or its built-in Write/Edit/ -NotebookEdit implementations. Notebook serialization and nested subagent-like -processes are fixtures. Installed pi Write/Edit/Bash and extension loading/custom -executors run directly without replacing their filesystem operations. This -distinction limits the proof to the measured boundary and named writers. - -The protected profile uses bubblewrap namespaces, a read-only root and brain, -fresh `/proc` and `/dev`, a separate scratch tmpfs, dropped capabilities and a -cleared environment. The launcher closes inherited descriptors above 2. Protocol -stdout/stderr must be pipes; no policy-backed stdio is admitted. No -agent code runs before confinement. This is a reproducible filesystem experiment, -not an R28 network/credential/configuration sandbox: it has no inference egress, -still exposes readable host files, and does not measure hostile Unix sockets, -resource exhaustion or kernel exploits. - -The controller checks nonempty original bytes and directory membership from -outside the sandbox, independently of tool return values. Sixteen protected -attempts cover installed Write/Edit, notebook serialization, an indirect Bash -script, nested execution, the Claude spawn adapter, relative traversal, symlink -and preexisting hardlink aliases, creation of a scratch hardlink, new policy -creation, unlink, directory rename, extension initialization/custom execution, -and a descriptor closed before entry. None changes policy bytes or directory -membership. New scratch hardlinks fail across filesystems. Six permitted probes -use the same Write/Bash/nested/Claude-spawn/extension executors in scratch and -read back the expected nonempty payload; they prove the writers were functional. - -Six deliberately insufficient configurations produce actual policy changes: - -| Configuration | Observed escape | Consequence | -| --- | --- | --- | -| Writable brain with only the policy directory mounted read-only | Installed Write follows a preexisting hardlink in `notes/` to the policy inode | Protecting a pathname does not protect every writable alias. | -| Read-only brain plus a writable host scratch directory | A preexisting policy hardlink in scratch remains writable | Use an isolated scratch filesystem; merely choosing a fresh path is an assumption about its contents and other writers. | -| Whole-worker mounts with an inherited writable descriptor 3 | `write(3, ...)` changes the original file | Explicit closure belongs in the launcher; bubblewrap is not a descriptor sanitizer. | -| Whole-worker mounts with policy-backed stdout | `write(1, ...)` changes the original file | Validate protocol descriptors, including stdio, rather than closing only descriptors above 2. | -| Pi extension initialized in the unsandboxed parent | Installed loader runs the extension factory's filesystem write | Confining a child shell leaves the in-process writer privileged. | -| Landlock applied after a policy descriptor is opened | New policy opens are denied, scratch writes work, but the old descriptor writes | Enter before loading untrusted code and close inherited authority. | - -The [Landlock kernel interface](https://www.kernel.org/doc/html/latest/userspace-api/landlock.html#filesystem-flags) -documents the preopened-descriptor limitation. The native x86_64 probe requires -ABI >=3, restricts write/create/remove/refer/truncate rights to scratch, observes -a denied new open, and then writes through the old descriptor. Applying Landlock -late to a live server also cannot split JavaScript closures into different trust -domains or undo earlier opens/mappings. This investigation does not endorse that -as an in-process pi solution. - -## Architecture ruling required for implementation - -**2026-10-02 correction:** the three choices requested by this historical section -are now recorded in [the decision](../decisions/policy-write-boundary.md). Its -approved read-only workers and validated application route bind implementation; -the unproved direct-write alternative below remains rejected. GitHub owns -implementation dependencies and completion evidence. - -Recommend a concrete worker boundary shared by both adapters, managed inside the -existing server lifecycle. Pi SDK sessions and extension initialization/execution -would live inside workers; the Claude process and any runtime-owned local MCP -executors would also live inside them. No new daemon or extension seam is proposed. -Every worker receives a read-only authoritative brain view and a separate writable -attempt filesystem, pipe-only protocol descriptors and no inherited file/socket -authority. Workers cannot request privileged filesystem handles through the bridge. - -The ruling must choose how ordinary interactive effects reach Markdown: - -1. **Recommend server-validated effects:** existing curated brain operations run - through a narrow server-owned path, with explicit operation/path/principal - authority, descriptor-based race/alias protection, policy and ancestor denial, - and preserved locking/indexing. Shell/custom-extension edits happen in a - disposable view and require a bounded validated application step. This changes - ordinary shell behavior and must be expressly approved; this proof has no - broker, merge algorithm or ordinary-turn integration to claim ready. -2. **Direct-write alternative:** choose a real separately privileged worker - identity, policy inode/ancestor ownership and stable mount topology that still - permits other authoritative brain writes. Prove hardlinks, rename/replacement, - `/proc`, inherited descriptors, supplementary groups/capabilities and privileged - bridge effects on the chosen platform. Changing only the numeric UID inside a - user namespace is not proof of a different host filesystem identity. No such - layout was implemented or proved here. - -Approve the worker model, effect route, supported platforms and refusal behavior -before #674 becomes ready. The measured candidate is Linux/WSL2 with namespaces -and bubblewrap available. macOS and native Windows have no measured result here; -upstream support for a Bash sandbox is not support for this all-writer design. -An implementation must visibly refuse an unsupported mode before SDK/extension -initialization, with no automatic unsandboxed fallback. Preserve one shared tool -availability/enforced-membership mechanism for voice and unattended execution; -the filesystem boundary applies independently to every agent turn. - -## Concrete implementation and verification obligations - -#674 must incorporate the selected ruling and isolate all runtime initialization -before dispatch. Use the existing AgentBackend interface and server lifecycle for -internal worker communication, retain cancellation/session history and ordinary -turn semantics explicitly, and audit parent-side bridge effects. Assess SDK/wire/ -CLI/MCP/HTTP contract impact rather than presuming the worker implementation needs -no contract change. Changed package behavior needs changesets; breaking semantics -need their explicit ruling and same-commit contract documentation. - -Its proof must enter through both installed adapters' actual ordinary-turn paths, -using a keyless fixture inference transport, and cover allowed authoritative edits -under the selected effect route. Run all the measured escapes plus mappings, -descriptor/socket transfer, `/proc`/parent process access, topology races and -extension startup before any tool event. Observe original policy bytes and -unrelated permitted results, mutate the integrated guard, and verify unsupported -runtime/platform refusal before code initialization. #676 separately proves the -complete R28/R29/R31 credentials, ambient configuration and egress envelope. -Neither task may treat this finite fixture experiment as autonomous enablement. diff --git a/docs/plans/storage-accounting-experiment.py b/docs/plans/storage-accounting-experiment.py deleted file mode 100644 index 42bfce38a4..0000000000 --- a/docs/plans/storage-accounting-experiment.py +++ /dev/null @@ -1,202 +0,0 @@ -"""Fixture-only storage experiment for #1780; accepts no external scan roots. - -Run with python3 -B docs/plans/storage-accounting-experiment.py. All writes, -including Git setup/packing and permission changes, stay in fresh temporary -Odysseus trees. Measurement reads metadata, not attachment contents. This -single-process prototype does not establish race-safe production traversal. -""" -import json -import os -from pathlib import Path -import stat -import subprocess -import tempfile -import time - - -def command(args, env=None): - return subprocess.run(args, env=env, check=True, text=True, - capture_output=True, timeout=10).stdout.strip() - - -def inventory(roots, limit=10000, seconds=2, cancelled=lambda: False): - started = time.monotonic() - objects, errors, visited = {}, [], 0 - stack = list(reversed(roots)) - while stack: - if cancelled() or visited >= limit or time.monotonic() - started >= seconds: - errors.append("budget_or_cancel") - break - path = stack.pop() - visited += 1 - try: - info = path.lstat() - key = (info.st_dev, info.st_ino) - if key in objects: - continue - objects[key] = (info.st_size, info.st_blocks * 512, info.st_mode, - info.st_mtime_ns, info.st_ctime_ns, info.st_nlink) - if stat.S_ISDIR(info.st_mode): - with os.scandir(path) as entries: - # Incremental read avoids materializing an unbounded directory. - for entry in entries: - if len(stack) + visited >= limit: - errors.append("entry_budget") - break - stack.append(Path(entry.path)) - except OSError as error: - errors.append(error.__class__.__name__) - return {"logical": sum(v[0] for v in objects.values() if not stat.S_ISDIR(v[2])), - "directory_stat_bytes": sum(v[0] for v in objects.values() if stat.S_ISDIR(v[2])), - "allocated": sum(v[1] for v in objects.values()), - "entries": len(objects), "errors": errors, - "elapsed_ms": round((time.monotonic() - started) * 1000, 3)}, objects - - -def capacity(path): - fs = os.statvfs(path) - return {"identity": path.stat().st_dev, - "total": fs.f_blocks * fs.f_frsize, - "used": (fs.f_blocks - fs.f_bfree) * fs.f_frsize, - "available": fs.f_bavail * fs.f_frsize} - - -def run(): - with tempfile.TemporaryDirectory(prefix="odysseus-storage-") as temporary: - root = Path(temporary) - home, brain, state = (root / name for name in ("home", "brain", "state")) - for path in (home, brain, state): - path.mkdir() - env = {"PATH": os.environ["PATH"], "HOME": str(home), - "GIT_CONFIG_NOSYSTEM": "1", "GIT_CONFIG_GLOBAL": "/dev/null", - "GIT_OPTIONAL_LOCKS": "0", "LC_ALL": "C"} - git = lambda *args: command(["git", "-C", str(brain), *args], env) - git("init", "-q", "-b", "main") - git("config", "user.name", "Odysseus") - git("config", "user.email", "odysseus@example.invalid") - (brain / "voyage.md").write_text("# Voyage\nSail from Ithaca.\n") - (brain / ".gitignore").write_text("ignored.pdf\nworkspaces/\n.brain/\n") - git("add", "voyage.md", ".gitignore") - git("commit", "-qm", "Voyage") - (brain / "voyage.md").write_text("# Voyage\nConsult Athena.\n") - git("commit", "-qam", "Consult Athena") - loose = git("count-objects", "-v") - git("repack", "-ad") # Setup only: never part of the observation pass. - packed = git("count-objects", "-v") - worktree = root / "worktree" - git("worktree", "add", "-q", "-b", "athena", str(worktree)) - common = command(["git", "-C", str(worktree), "rev-parse", - "--path-format=absolute", "--git-common-dir"], env) - assert Path(common) == brain / ".git", "worktree shares Git common directory" - separate = root / "separate" - separate.mkdir() - command(["git", "init", "-q", "--separate-git-dir", str(root / "git-store"), - str(separate)], env) - assert (separate / ".git").is_file(), "alternate Git directory is a gitfile" - for name, size in (("map.pdf", 6000000), ("boundary.pdf", 5000000), - ("binary-boundary.PDF", 5242880), ("ignored.pdf", 7000000)): - with (brain / name).open("wb") as file: - file.truncate(size) - file.seek(0) - file.write(b"%PDF-Odysseus\n") - workspace = brain / "workspaces" - workspace.mkdir() - (workspace / "raft.txt").write_text("Raft plans\n") - (brain / ".brain").mkdir() - (brain / ".brain" / "scratch").mkdir() - (state / "brain-ui.db").write_bytes(b"synthetic operational bytes") - os.link(brain / "map.pdf", state / "map-alias.pdf") - (brain / "loop").symlink_to(brain, target_is_directory=True) - (brain / "external").symlink_to(state, target_is_directory=True) - many = brain / "crew" - many.mkdir() - for index in range(2000): - (many / f"oar-{index}.txt").write_text("row\n") - - before, baseline = inventory([root]) - overlap, _ = inventory([root, brain, workspace, state, worktree]) - assert overlap["allocated"] == before["allocated"], "overlapping roots counted once" - assert overlap["logical"] == before["logical"], "hard links counted once" - du_alloc = int(command(["du", "-s", "-B1", str(root)]).split()[0]) - du_logical = int(command(["du", "-s", "--apparent-size", "-B1", str(root)]).split()[0]) - assert before["allocated"] == du_alloc, "allocated aggregate agrees with du" - assert before["logical"] == du_logical, f"logical aggregate agrees with du: metadata={before['logical']} du={du_logical}; directory bytes={sum(v[0] for v in baseline.values() if stat.S_ISDIR(v[2]))}" - sparse = (brain / "map.pdf").stat() - assert sparse.st_blocks * 512 < sparse.st_size, "sparse logical differs from allocation" - pdfs = [p for p in brain.iterdir() if p.suffix.lower() == ".pdf" - and p.lstat().st_size > 5000000] - assert len(pdfs) == 3, "PDF > 5 MB includes ignored and uppercase, excludes exact boundary" - assert sum(p.stat().st_size for p in pdfs) == 18242880, "PDF logical total" - assert git("check-ignore", "ignored.pdf", "workspaces/raft.txt").splitlines() == [ - "ignored.pdf", "workspaces/raft.txt"], "ignored files remain inventory candidates" - short, _ = inventory([root], limit=10) - assert short["errors"], "entry budget reports partial" - cancelled, _ = inventory([root], cancelled=lambda: True) - assert cancelled["errors"] and cancelled["entries"] == 0, "cancellation is visible" - timed, _ = inventory([root], seconds=0) - assert timed["errors"], "time budget reports partial" - denied = root / "denied" - denied.mkdir() - (denied / "secret.txt").write_text("Odysseus fixture\n") - denied.chmod(0) - try: - refused, _ = inventory([denied]) - # A root run cannot demonstrate ordinary permission denial. - assert "PermissionError" in refused["errors"], "real EACCES must be visible (run unprivileged)" - finally: - denied.chmod(0o700) - (denied / "secret.txt").unlink() - denied.rmdir() - # Root directory timestamps changed during the separate denial probe; - # every descendant measured in the observation pass must be unchanged. - after, observed = inventory([root]) - root_key = (root.stat().st_dev, root.stat().st_ino) - assert {k: v for k, v in baseline.items() if k != root_key} == { - k: v for k, v in observed.items() if k != root_key}, "measurement did not mutate fixture" - changing = state / "changing.txt" - changing.write_text("Athena\n") - first = changing.stat() - changing.write_text("Consult Athena before sailing.\n") - last = changing.stat() - assert (first.st_size, first.st_mtime_ns, first.st_ctime_ns) != ( - last.st_size, last.st_mtime_ns, last.st_ctime_ns), "changing metadata invalidates a stable observation" - changing.unlink() - filesystem = capacity(brain) - df_values = command(["df", "-B1", "--output=size,used,avail", str(brain)]).splitlines()[-1].split() - df_capacity = dict(zip(("total", "used", "available"), map(int, df_values))) - assert df_capacity["total"] == filesystem["total"], "capacity total agrees with df" - df_delta = {k: df_capacity[k] - filesystem[k] for k in df_capacity} - assert capacity(state)["identity"] == filesystem["identity"], "colocated capacity deduplicates" - second = None - if Path("/dev/shm").is_dir(): - with tempfile.TemporaryDirectory(prefix="odysseus-storage-", dir="/dev/shm") as other: - other_root = Path(other) - (other_root / "raft.txt").write_text("Raft\n") - second = capacity(other_root) - assert second["identity"] != filesystem["identity"], "two real capacity identities" - (brain / "other-volume").symlink_to(other_root, target_is_directory=True) - local, _ = inventory([brain]) - combined, _ = inventory([brain, other_root]) - assert combined["logical"] > local["logical"], "cross-volume symlink not traversed" - (brain / "other-volume").unlink() - packs = list((brain / ".git" / "objects" / "pack").glob("*.pack")) - pack_logical = sum(p.stat().st_size for p in packs) - packed_fields = dict(line.split(": ", 1) for line in packed.splitlines()) - pack_disk = sum(p.stat().st_blocks * 512 for p in (brain / ".git" / "objects" / "pack").iterdir() - if p.suffix in (".pack", ".idx")) - pack_git_bytes = int(packed_fields["size-pack"]) * 1024 - print(json.dumps({"versions": {"python": command(["python3", "--version"]), - "git": command(["git", "--version"]), - "du": command(["du", "--version"]).splitlines()[0]}, - "inventory": before, "overlap": overlap, "du_allocated": du_alloc, - "du_logical": du_logical, "sparse": {"logical": sparse.st_size, - "allocated": sparse.st_blocks * 512}, "pdf_count": len(pdfs), - "pdf_logical": 18242880, "loose_git": loose, "packed_git": packed, - "pack_logical": pack_logical, "pack_and_index_allocated": pack_disk, "git_pack_report_bytes": pack_git_bytes, - "capacity": filesystem, "df_delta_bytes": df_delta, "second_capacity": second, - "denied": refused, "budget": short, "cancelled": cancelled, - "timed": timed, "readonly_descendants": True}, indent=2)) - - -if __name__ == "__main__": - run() diff --git a/docs/plans/storage-accounting.md b/docs/plans/storage-accounting.md deleted file mode 100644 index dba10175e0..0000000000 --- a/docs/plans/storage-accounting.md +++ /dev/null @@ -1,391 +0,0 @@ -# Storage ownership and capacity accounting - -Discovery for [#1780](https://github.com/schlessera/brain-kit/issues/1780), -informing [#1779](https://github.com/schlessera/brain-kit/issues/1779) and the -design in [#1782](https://github.com/schlessera/brain-kit/issues/1782). -Source reviewed at `f2c98da6093c9e1731f061625ba7302f51bf7340`. -This is a proposed model, with a fixture experiment, not a shipped collector, -retention decision or cleanup authorization. Existing stats and MCP meanings -remain unchanged. Cleanup/recovery policy is the separate #1781 discovery. - -## Recommendation - -Use one inventory of permitted storage objects, with separate **ownership -views**, **capacity scopes**, and **measurement evidence**. Brain and deployment -are views over that inventory, not two quantities to add. Keep filesystem -allocation estimates separate from logical file sizes and actual volume usage. -Start with local metadata and configured application stores; leave remote -storage, quotas and host runtime stores unknown unless explicitly observable. - -Core owns deterministic content/Git measurement through a later supported CLI -JSON operation. ui-server resolves its effective configuration, adds its stores, -merges duplicate identities and serves authenticated inventory. It must not -import core internals or put operational state into `brain.db`. Backends retain -their transcript layout and lifetime ownership. No storage-provider seam, -privileged host browser or worker-accessible inventory is proposed. - -The binding constraints are [the roadmap](../../ROADMAP.md#what-binds-future-work), -[governed writable workers](../decisions/governed-writable-workers.md), -[worker writable areas](../decisions/worker-writable-areas.md), -[the recovery guide](../inbox-recovery.md), and the existing -[machine contract](../integration-contract.md). Navigation and presentation -remain for #1782 under [navigation](../decisions/design-kit/navigation.md) and -[sessions and drafts](../decisions/design-kit/sessions-and-drafts.md). - -## Current stores and source owners - -In the matrix, `B` is the effective canonical brain root; `D` is the effective -UI database path. `C(path)` is a resolved capacity identity, not a path string. -Every location is configuration-derived or an explicitly permitted root; -environment defaults are resolved by the existing owner, not reconstructed by -the collector. Each row uses the anchors below. Lifetime describes current -ownership, not permission to delete. - -| Category / source | Owner and location resolution | Persistence / authority | Measurement and capacity identity | Existing API / maintenance and limitations | -| --- | --- | --- | --- | --- | -| Tracked, untracked and ignored notes, attachments, configuration / A | Core; `B` from context | Markdown/files are authoritative; Git tracking is an independent facet | `lstat` per entry; logical `size`, allocation `blocks`; `C(B)` or approved nested mount | `brain stats`, read/tree, capture/update/archive; stats is a filtered corpus, not all files. Index/type/reference metadata may be absent or stale. | -| Git objects, packs, indexes, refs, reflogs, administrative files / B | Core; Git resolves per-worktree git-dir, common-dir, object directories and alternates | History/refs/reflogs have separate recoverability; not disposable index data | Inventory distinct resolved directories; `count-objects -v` supplemental counts; capacity for each physical store | `brain doctor` storage check and `brain maintain` packing; never expire reflogs/delete refs. Pack bytes cannot be apportioned exactly to current files. External alternates need explicit permission. | -| Derived content index and SQLite sidecars / A | Core; context `dbPath`, ordinarily `B/brain.db`; `-wal`, `-shm`, `-journal` | Regenerated by force indexing | Metadata for existing files once; their actual `C(path)` | `brain index --force`; current stats includes main DB and WAL bytes, not a complete deployment total. Tables/vector slots are counts, not additive bytes. | -| Corpus stats history / C | Core; canonical `B/.stats-history.jsonl` | Historical observations, not content/index authority | File metadata, `C(B)` | `brain stats --record/--history`; no server state belongs here. Daily/weekly thinning has no lifetime byte cap. | -| UI operational DB, sidecars and associated quarantine / D | ui-server; effective `D`, including explicit app override; sibling `brain-ui-quarantine` | Sessions, drafts including image bytes, principals, settings, budgets, inbox and schedules are authoritative operational state | DB/sidecar/quarantine file metadata; `C(D)`; in-memory DB has no disk file | Whole-store operational export/restore, not core index rebuild. DB page/table approximations must not be added to file bytes; quarantine evidence is not automatically disposable. | -| Claude native transcripts and compressed archives / E | Claude backend; resolved config directory, encoded canonical brain project; live `projects`, cold `transcript-archive` | Native transcripts and archive manifests retain conversation authority across turns | On-disk compressed bytes for archives; live metadata; each root's capacity | Existing list/history/idle archival. Count live, committed archive and conflict/pending files as separate physical objects; archived logical uncompressed length is a different metric. Never scan the entire home/config directory. | -| Pi native transcripts / F | Pi backend; explicit session directory or canonical brain hash under its state default | Persistent conversation state | Only resolved session store metadata, `C(store)` | Existing list/history; Pi archival remains #1637. Production resolver rejects brain/ancestor aliases; fixture session-factory fallback is not a production location contract. Credential files must not become inventory details. | -| Share/upload staging / G | ui-server; `B/.brain-ui/inbox`, including partial publications | Staged bytes may be required for durable inbox settlement/recovery | Metadata of allowed staging subtree; `C(B)` | Share staging/prune and inbox cleanup; live/settlement guards apply. Files physically in `B` can be server-owned. Inline uploads saved in drafts/DB are counted there; finalized attachments count at their final location. | -| Persistent scratch and workspaces / H | Core policies and ui-server pin coordinator; `B/.brain/scratch`, `B/workspaces` | Scratch has bounded lifetime/pins; workspace files can be intentional user work and nested repositories | Metadata including hidden/nested Git data; dedupe hard links/shared object stores; `C(path)` | `brain scratch prune`, pin-aware server timer, maintain. Index exclusion does not imply storage absence or permission to remove workspaces. | -| Turn temp, runtime state, startup/output staging and maintenance temp / I | ui-sdk launcher/host ledger, backend workers; resolved private per-turn roots and tmpfs mounts | Temporary working bytes, bounded admissions; some state is promoted/persisted by its owner | Live host-observed mount/counter evidence where available; tmpfs capacity and ledger reservations separate from allocated bytes | Existing admission/status/teardown, not a recursive scan of host `/tmp`. A configured allowance is a limit, a reservation is not usage; discarded home overlays may be unobservable. | -| Journal and revert objects / J | ui-server; sibling `${basename(D)}.journal`, and the journal metadata database `${D}.journal.db` with its sidecars (#2789); temporary root for ephemeral DB | Before/after/revert bytes support review and recovery; not the disposable content index | Object/temporary metadata plus existing accounting evidence, `C(root)`; hash dedup is within this store | Journal/revert routes and guarded object accounting. Operational backup scope does not automatically include this external directory. No inventory-triggered reaping. | -| Backups / K | Generated host/operator; explicitly selected artifact root(s), Git backups independently | Retained recovery points, additional physical copies | Artifact metadata only; distinct capacity or remote evidence; count copies even when content is identical | `brain-ui-inbox export/restore`; whole DB plus checksummed required staging. Does not back up external transcripts/journal by implication. No reading/decompressing artifacts for size. | -| Runtime caches, logs, images and layers / I | Generated host/runtime, outside package authority; only expressly configured roots | Host-selected persistent or disposable state | Ordinary readable app-owned files if declared; runtime shared layers/provider quotas unknown | No general prune, Docker socket, privileged host inventory or guessed layer attribution. Stdout logs and runtime-host stores may be outside the app mount namespace. | - -Source anchors, checked against the reviewed commit: - -- A: root and index resolution (`initContext`, `packages/core/src/lib/context.ts:36-50`); - existing corpus exclusions (`corpusSize`, `packages/core/src/lib/stats.ts:164-215`), - available capacity (`freeSpaceBytes`, `packages/core/src/lib/stats.ts:219-230`). -- B: loose report (`looseObjects`, `packages/core/src/lib/git-storage.ts:57-66`) - and safe packing (`packRepository`, `packages/core/src/lib/git-storage.ts:78-86`). - The completed #94 and #398 provide existing stats/maintenance foundations. -- C: snapshot fields (`snapshotOf`, `packages/core/src/lib/stats-history.ts:132-172`), - thinning (`thin`, `packages/core/src/lib/stats-history.ts:232-244`). -- D: effective path/journal resolution (`createApp`, `packages/ui-server/src/app.ts:301-337`), - WAL store (`createUiDb`, `packages/ui-server/src/db/client.ts:27-44`), and - private locations (`statePaths`, `packages/ui-server/src/brain/operational-state.ts:108-114`). -- E: live/archive paths (`transcriptPaths`, `packages/ui-backend-claude/src/transcript-archive.ts:30-39`). -- F: session location (`piSessionDirectory`, `packages/ui-backend-pi/src/session-storage.ts:8-28`). -- G: staging location (`shareStagingRoot`, `packages/ui-server/src/share/staging.ts:143-145`) - and settlement-aware cleanup (`function claim`, `packages/ui-server/src/inbox/lifecycle-writes.ts:42-61`). - [#807](https://github.com/schlessera/brain-kit/issues/807) supplies live-work - and settlement protection for staging cleanup. -- H: scratch defaults (`SCRATCH_DIR`, `packages/core/src/lib/scratch.ts:52-61`), - scheduled prune (`startScratchPrune`, `packages/ui-server/src/cron/scratch-prune.ts:41-49`), - and the [writable-area decision](../decisions/worker-writable-areas.md). - [#1656](https://github.com/schlessera/brain-kit/issues/1656) supplies retained - scratch conversation pins. -- I: [server configuration](../../packages/ui-server/README.md) and worker-area/governed-worker - decisions distinguish the independent configured limits and mounts. Delivered - #1703 adds scoped turn-temp usage/purge and promotion protection; those - measurements do not include the separate runtime-state tmpfs. -- J: private object store (`createJournalObjects`, `packages/ui-server/src/brain/journal-objects.ts:35-50`) - and D's path resolution. Existing journal/revert accounting owns reservations. -- K: consistent export (`exportInboxSnapshot`, `packages/ui-server/src/inbox/snapshot.ts:292-309`) - and [operational recovery](../inbox-recovery.md); delivered #686 and its - [generated-host counterpart](https://github.com/schlessera/brain-hosting-template/issues/9). - -## Three identities and honest units - -An **entry identity** represents a visible name within a permitted root. Use an -opaque stable root ID plus normalized relative path; rename/replacement needs a -new revision or explicit continuity evidence. Do not publish inode numbers or -absolute private paths as stable public IDs. An **object identity** deduplicates -the bytes: on tested Linux local filesystems, `(device, inode)` for the scan -epoch, validated again when reopening. Inode reuse, remounts and remote/overlay -filesystems limit cross-scan stability. A **capacity identity** represents one -allocation/quota pool in the process mount namespace, with provenance. - -Canonical paths deduplicate nested roots and aliases, but are insufficient for -hard links or bind mounts. Use mount information plus device/filesystem evidence; -bind mounts of the same filesystem normally share capacity even when mount IDs -or root strings differ. Separate quota domains need separate quota identities. -Unknown equivalence must remain unknown, not cause guessed capacity addition. -An overlay's backing-store relation is not inferred from its device number. -Nested repositories/worktrees have their own ownership boundaries, and may share -a Git common directory or alternate object store: resolve those via -[Git path operations](https://git-scm.com/docs/git-rev-parse), never by assuming -`.git` is a directory. Do not follow alternates outside approved roots. - -For regular files, logical bytes are `st_size`; on Linux allocated bytes are -`512 * st_blocks`, not `st_blksize * st_blocks`. Directory allocation and link -objects belong in a metadata bucket. Directory `st_size` is not user content. -Sparse files can have large logical size with tiny allocation. Compression, -reflinks, snapshots and shared extents prevent inode-based sums from proving -exclusive physical usage or reclaimable space. Report the allocation basis and -its limits. No content hash read or per-blob history analysis is necessary. -See [Linux stat fields](https://man7.org/linux/man-pages/man3/stat.3type.html). - -For a supported filesystem observation, using its reported allocation unit `b`: - -```text -total = blocks * b -used = (blocks - bfree) * b -free = bfree * b -available_to_caller = bavail * b -reserved_or_unavailable_free = free - available_to_caller (if meaningful) -``` - -`used + available` need not equal `total`. Keep quota used/limit/remaining as -separate nullable measurements; do not infer quotas from `bavail`, or substitute -a worker admission budget. Tmpfs has its own finite mount capacity and may -consume memory/swap; it is not extra persistent disk. Remote repository usage, -remote limits, and local Git bytes remain different scopes. A provider may -report repository logical storage rather than physical allocation; unsupported -remote measurement is unknown, without issuing a network request. Capacity -semantics follow [Linux statfs](https://man7.org/linux/man-pages/man2/statfs.2.html). - -## Worked accounting - -These numbers illustrate the model in MiB; they are not installation evidence. -Assume ordinary non-shared allocation for these examples. - -One volume V: content 100, Git 40, index 10, scratch 5, staging 8, UI DB 12, -transcripts 20, journal 15, backups 30. The resolved object union totals 240. - -```text -V capacity: total 1000; used 600; free 400; available 350; reserved free 50 -app inventory allocated: 240 - brain ownership: content 100 + Git 40 + index 10 + scratch 5 = 155 - server ownership: staging 8 + DB 12 + transcripts 20 + journal 15 = 55 - operator backups: 30 -volume used outside attributed inventory: 360 (only under these assumptions) -``` - -Staging is physically under the brain root. A whole-root physical view is -163, while server ownership is 55. Adding them with backups gives 248 and -duplicates staging. Likewise, including scratch in a deployment view and in -the brain view duplicates scratch. The inventory union is 240, and available -capacity is shown once as 350, not once per store. A 6 MiB file hard-linked into -scratch remains one object: its two entry rows show the alias relationship; -physical rollups allocate it to one primary bucket or a shared bucket, never -two parents. Content-path logical filter totals can still count both visible -names, explicitly labeled as file entries rather than unique objects. - -Separate volumes: move brain/scratch/staging to V1, DB/transcripts/journal/backups -to V2, and turn temp to tmpfs T: - -```text -V1: inventory 163; total 500; used 300; free 200; available 180 -V2: inventory 77; total 800; used 400; free 400; available 350 -T: inventory 4; total 64; used 4; free/available 60 -persistent attributed union = 163 + 77 = 240 -``` - -An upload to V1 has 180 available, not `180 + 350 + 60`. A journal write to -V2 uses its 350; a turn additionally meets T's limit and the host ledger's -admission rules. A bind alias of V1 adds no capacity. A separately mounted Git -object store adds its own permitted store/capacity row, not imaginary space -under V1. Shared extents or uncertain mount equivalence make sums estimated; -do not show a negative residual or call it exact host-wide attribution. - -## Inventory needed by the treemap and file workflow - -Proposed fields, to review before naming any CLI command or HTTP route: - -| Field group | Meaning | -| --- | --- | -| Identity | Inventory/scan ID, stable root ID, opaque entry ID, parent ID, revision, scan-local object ID, aliases/shared-accounting bucket, capacity ID or unknown | -| Ownership | Core/server/backend/operator owner, category, persistence/authority, permitted operation capability supplied by owner; no deletion inferred from category | -| Hierarchy | Permitted relative path, display name, parent/children or paginated continuation, explicit nested-store boundary; ancestors hold aggregates, not additional bytes | -| Classification | Regular/directory/link/special; normalized extension and its provenance; MIME only if already recorded; tracking facet tracked/untracked/ignored/unknown; indexing facet indexed/excluded/unindexed/unknown with reason | -| Values | Decimal integer byte strings for safe JSON precision; logical bytes, allocated bytes nullable; entry count and unique object count; subtree totals with a declared metric/basis; no mixture of compressed/uncompressed or logical/allocated values | -| Evidence | Method/source, exact/estimated/unknown accuracy, complete/partial coverage, observation start/end, owner revision where available, observed-at, cached-at, stale-after, errors/reasons and omitted entry count when knowable | -| Capacity | Total/used/free/available, quota identity/values nullable, tmpfs limits, remote scope/provider capability if observable; units and identity confidence | - -Use logical **regular-file entry** size for `PDF > 5 MB`: MB means 1,000,000 -bytes, comparison is strictly `> 5,000,000`, and MiB is a separate choice -(`> 5,242,880`). Case-insensitive extension classification is explicitly -filename-based, not verified MIME. Do not read attachment contents for size or -type sniffing. Exact-boundary files fail the strict filter. Show matching entry -count and logical total, plus unique objects/allocated estimate when known; -symlinks are link rows, not PDF targets. Filtering partial inventory shows a -known subtotal with a visible incomplete warning, not a complete result count. - -Ignored/unindexed PDFs appear in this inventory without changing indexing -policy. Existing indexed IDs/types/references may enrich results, with their -index freshness; absent references are unknown, not proof of no incoming links. -No comparison between stale metadata and a current file authorizes cleanup. -The treemap switches a single size basis at a time and represents unknown/ -unattributed storage outside proportional known tiles. It must not render an -unknown zero-sized tile as though nothing occupies space. #1782 owns visual -design; #1781 owns inspection/consequence/operation rules. - -## Bounded read-only collection - -Resolve an allowlist from existing owner configuration. Never accept a request -path as a scan root. Do not scan home, `/tmp`, runtime-host storage, credentials -or unknown mounts to fill a gap. Explicitly approved root aliases are resolved -once; descendants use descriptor-relative no-follow directory traversal and -inode/device checks before reading metadata. No FIFO/device opens, symlink -target traversal, implicit automount exploration or filesystem-crossing recursion. -Same-device bind mounts need mount-boundary checks as well as device checks. -An approved nested mounted store gets a separate root and is merged by identity. - -Production proposal: one scan per app, two metadata workers maximum, 100,000 -visited/queued entries, 30 seconds elapsed, bounded page/error buffers, maximum -depth 64, and cancellation at directory iteration and before each I/O/process -operation. Budgets are candidate defaults to qualify, not established runtime -promises. Kill/reap any bounded Git subprocess on timeout/cancel; a blocking -filesystem call may need a separately cancellable child process, because an -AbortSignal alone cannot interrupt kernel I/O. Git observations disable optional -locks, run with controlled config/environment/hooks authority, and never invoke -maintenance. No writes, checkpointing, index rebuild, packing or creation of -missing store directories happen during measurement. - -Writes continue during observation. Validate metadata when opening directories -and before emitting inspected files; detect disappearance/replacement and record -changing evidence, not a snapshot guarantee. A coherent point-in-time DB byte -inventory is not obtained by copying the live main file; opening a new writable -SQLite handle could create sidecars. Read filesystem metadata only, and use -existing owner counters if read-only. Cache successful/partial scans with scan -IDs and a proposed 60-second freshness window; bound cache entries/bytes and -coalesce refresh requests. Low-space checks can refresh capacity alone. - -Accuracy and completeness are independent: - -| Observation | Required report | -| --- | --- | -| Stable regular file on supported local FS | Exact observed logical bytes; filesystem-reported allocation, estimated exclusive physical attribution | -| Sparse/compressed/reflink file | Logical exact at observation; reported allocation with basis; reclaimable space unknown | -| EACCES directory | Partial parent subtree, known bytes lower bound, inaccessible child count unknown; no zero-size claim | -| File changed/disappeared during scan | Partial/changing with interval/reason; bounded retry optional, no silent omission | -| Time/entry/depth/cancellation limit | Partial with continuation only if safely resumable; never call cached subtotal complete | -| Capacity permission failure or unsupported identity | Unknown capacity/identity; preserve known store bytes without invented available space | -| Quota unavailable | Unknown quota; known `bavail` remains filesystem availability, not quota headroom | -| Packed Git | Exact observed pack/index file sizes, coarse Git KiB report, unknown exact per-file/history attribution | -| Remote provider unimplemented/unavailable | Unknown remote usage/limit, no local substitute or default zero | -| Root absent vs unreadable | Absent may be exact empty only after successful parent resolution; permission errors remain unknown | - -## Growth and low-space evidence - -The later [growth proposal](storage-growth.md) specifies candidate fields, bounds, -cadence, guidance and synthetic decisions without approving production policy. - -Reuse concepts from core stats history (nullable values, date/version provenance, -UTC buckets and thinning), not its schema/file or core authority. That file stores -corpus/index figures and lacks capacity IDs, coverage/basis and server ownership; -blindly reusing it would change the existing stats contract. Recommend a server -owned aggregate history, initially capped at 128 samples / 256 KiB, recording -per-category and per-capacity values with scan IDs, interval, basis, partial -reasons and metric version. No per-file histories, private paths or complete -inventory snapshots in history. Its own bytes count in server storage. - -Only comparable scopes/bases produce growth rates. Unknown or partial samples -break the rate rather than contribute zero; deleting/adding a root or changing -capacity identity also breaks comparability. Capacity-only observations and -reservations remain distinct. Refresh after an owner-reported completed mutation -and on explicit request, with coalescing; a rate-based exhaustion estimate is -estimated and unavailable with insufficient comparable evidence. Low-space -signals name the affected write target's capacity/quota, freshness and margin. -Alert thresholds, cadence and persistence require later design; this spike does -not authorize automatic cleanup or a new retention policy. - -## Synthetic experiment and evidence - -Run `python3 -B docs/plans/storage-accounting-experiment.py` as an unprivileged -Linux user. The script accepts no external roots and creates only temporary -Odysseus fixtures. Git initialization, commits, packing, linked worktree, separate -Git directory, hard links, permissions and attachment writes are **fixture -setup**, not collection. Measurements use metadata and bounded local subprocesses; -no provider/network, attachment reads or real deployment corpus is involved. - -Observed with Python 3.15.0, Git 2.55.0, GNU du 9.11, Bun 1.4.2: - -- 2,103 distinct entries including 2,000 small crew files: 23,309,497 logical - bytes and 8,478,720 allocated bytes; baseline 18.919 ms, overlapping-root - scan 19.155 ms. Both exactly matched independent `du -s --apparent-size -B1` - and `du -s -B1`. Root/path-dependent Git fixture sizes and timings may vary. -- Initial naive inclusion of directory `st_size` overcounted apparent bytes by - 43,460. Excluding directory logical sizes restored agreement; directory - allocation remains in the allocation total. This mismatch is why the model - distinguishes directory metadata from content. -- The 6,000,000-byte sparse PDF occupied 4,096 allocated bytes. The strict - decimal PDF filter returned three entries / 18,242,880 logical bytes, - including ignored and uppercase-extension files, excluding exactly 5 MB. - A hard-linked server alias did not duplicate union allocation/logical bytes. -- Seven loose Git objects became seven packed objects in one pack during setup. - `count-objects -v` then reported `size-pack: 1` KiB (1,024 bytes), while - pack plus index allocated 8,192 bytes; the pack file alone had 593 logical - bytes. This deliberate mismatch disproves treating Git's coarse report as - full allocated Git-directory usage. See [Git's report units](https://git-scm.com/docs/git-count-objects). -- Actual linked worktree resolution shared the main Git common directory; - separate-git-dir produced a `.git` file. Shared/overlapping roots measured - once. Symlink loops/external targets were not traversed. `/dev/shm` permitted - a second real capacity identity, and its file was counted only when its - temporary root was explicitly included. No mounts were created. -- `statvfs` total/used/available agreed with independent - `df -B1 --output=size,used,avail` (all three deltas zero in this receipt). - Live host writes can change used/available between calls; the experiment - records deltas rather than demanding a stable whole-filesystem snapshot. - A separately changed fixture file invalidated size/mtime/ctime continuity. -- Real mode-000 directory enumeration returned `PermissionError`, preserving - partial semantics; entry/time limits and cancellation were visibly partial. - Before/after descendant metadata (identity, size, blocks, mode, mtime, ctime, - link count) agreed across the observation pass. Atime is intentionally not - a read-only invariant. The separate permission probe changes only its own - temporary fixture; root timestamps are excluded from that comparison. - -Three restored mutations demonstrated live assertions: replacing inode identity -with path identity failed `allocated aggregate agrees with du`; changing `>` -to `>=` failed the strict PDF count/boundary assertion; ignoring cancellation -failed `cancellation is visible`. The restored script passed. These qualify the -fixture observations, not a shipped production guard. - -The script is a single-process prototype: it does not qualify descriptor races, -mount/bind traversal, exclusive extent accounting, real quotas, compression, -remote providers, live DB coherence, hostile directory renames, process-kill -cancellation, long blocking I/O or production-scale performance. It uses -scan-epoch Linux device IDs as its capacity proxy; that is not the complete -production capacity resolver. Other platforms and a root execution require -separate qualification (root cannot demonstrate ordinary EACCES). - -## Alternatives, open decisions and implementation boundaries - -An index-only report is cheap but misses unindexed/ignored attachments and -server state. Summing `du` per store is simple but double-counts aliases and -capacity and cannot express authority. Host-wide/runtime API scanning offers -more coverage but exceeds ordinary app access and requires a separately approved -host contract. Detailed historical Git attribution is expensive, often inexact -with deltas/shared objects, and unnecessary for the first honest overview. - -Recommend the local permitted-object model above. Remaining choices for later -review are metric defaults in the treemap, snapshot/refresh/alert cadence, -history byte/sample caps, large-corpus pagination and resumability, platform -support and allocation terminology, capacity identity on overlays/quotas, and -whether remote-provider or runtime-host metrics are worth a separate scope. -These do not block this discovery deliverable; they must not be silently decided -by a future implementation. - -Proposed implementation slices, not commitments or status: - -1. Core local content/Git metadata inventory and bounded traversal, preserving - stats; additive CLI JSON contract plus fixture/mutation proof for aliases, - budgets, unknowns and Git path resolution. -2. ui-server owner-root registration and backend-owned transcript resolution, - object/capacity merge and authenticated cached transport. No new public SDK - seam; inventory access needs host/operator authorization reviewed separately - from ordinary content read permission. Public health remains minimal - (`createStatusRoutes`, `packages/ui-server/src/routes/health.ts:60-82`). -3. Server-owned bounded aggregate history/capacity refresh and low-space signals, - after cadence/threshold design; no persistence in core `brain.db`. -4. The #1782 treemap/list/filter/inspection design, followed by separately scoped - implementation with real browser/accessibility proof. Cleanup uses #1781's - reviewed owner operations and independent confirmation/recovery rules. - -Each new supported command/JSON/HTTP/config surface requires same-commit contract -documentation, appropriate `CONTRACT:` changes and consumer changesets when it -ships; none is introduced here. Names and schemas are intentionally unselected. - -No concrete generated-host change is established: current configured stores and -ordinary `stat`/Git access are enough for this first model. The existing hosting -template #9 already owns backup scheduling/storage policy. If later discovery -requires mounted metric files, declared host capacity identity or a runtime -collector, file a bounded `brain-hosting-template` counterpart then; no Docker -socket or privileged inventory is implied by this document. diff --git a/docs/plans/storage-growth-experiment.ts b/docs/plans/storage-growth-experiment.ts deleted file mode 100644 index 99ffc913c9..0000000000 --- a/docs/plans/storage-growth-experiment.ts +++ /dev/null @@ -1,198 +0,0 @@ -/** Offline synthetic design qualification for #2014. No production imports, collection or delivery. */ -import { strict as assert } from "node:assert"; - -const hour = 3_600_000, day = 24 * hour; -const start = Date.parse("2026-07-12T00:00:00Z"); -type Sample = { total?: number; gap?: boolean; at: number; scope: string; basis: number; complete: boolean; bytes: number | null; available: number | null }; -function rate(samples: Sample[]): number | null { - const last = samples.at(-1); - if (!last?.complete || last.gap || last.bytes === null) return null; - const window: Sample[] = [last]; - for (let i = samples.length - 2; i >= 0; i--) { - const value = samples[i], next = window[0]; - if (!value.complete || value.gap || value.bytes === null || value.scope !== last.scope || value.basis !== last.basis || next.at <= value.at || next.at - value.at > 12 * hour || last.at - value.at > 7 * day) break; - window.unshift(value); - } - const first = window[0], span = last.at - first.at; - return window.length >= 5 && span >= 2 * day ? (last.bytes - first.bytes!) / (span / day) : null; -} -const trace = (value: (i: number) => number): Sample[] => Array.from({ length: 13 }, (_, i) => ({ at: start + i * 6 * hour, scope: "ithaca", basis: 1, complete: true, bytes: value(i), available: 8_000_000_000 })); -const steady = trace(i => 1_000_000_000 + i * 30_000_000); -const burst = trace(i => 1_000_000_000 + (i >= 4 ? 600_000_000 : 0)); -const reclaim = trace(i => 1_000_000_000 - i * 10_000_000); -const changed = steady.map((s, i) => ({ ...s, scope: i >= 8 ? "new-ithaca" : s.scope })); -const partial = steady.map((s, i) => ({ ...s, complete: i !== 8 })); -const unknown = steady.map((s, i) => ({ ...s, bytes: i === 8 ? null : s.bytes })); -const concurrent = trace(() => 1_000_000_000).map((s, i) => ({ ...s, available: 8_000_000_000 - i * 100_000_000 })); -assert.equal(rate(steady), 120_000_000); -assert.equal(rate(burst), 200_000_000); -assert.equal(rate(reclaim), -40_000_000); -assert.equal(rate(steady.map((sample, i) => ({ ...sample, at: i === 10 ? start + 80 * hour : sample.at }))), null); -assert.equal(rate(steady.map((sample, i) => ({ ...sample, gap: i === 8 }))), null); -assert.equal(rate(changed), null); assert.equal(rate(partial), null); assert.equal(rate(unknown), null); -assert.equal(rate(concurrent), 0); assert.equal(concurrent[0].available! - concurrent.at(-1)!.available!, 1_200_000_000); - -type Severity = "observed" | "low" | "critical"; -function episode(values: { at: number; available: number | null; fresh: boolean; refused?: boolean }[]): Severity[] { - let state: Severity = "observed", qualifying: number | null = null; - return values.map(sample => { - const ratio = sample.available === null ? null : sample.available / 100; - if (sample.refused || (sample.fresh && ratio !== null && ratio <= 0.05)) { state = "critical"; qualifying = null; } - else if (sample.fresh && ratio !== null) { - if (state === "observed" && ratio <= 0.10) state = "low"; - const clears = state === "critical" ? ratio > 0.07 : state === "low" ? ratio > 0.12 : false; - if (!clears) qualifying = null; - else if (qualifying === null) qualifying = sample.at; - else if (sample.at - qualifying >= 60_000) { state = state === "critical" ? "low" : "observed"; qualifying = null; } - } else qualifying = null; - return state; - }); -} -const oscillation = [9, 11, 9, 13, 13, 4, null, 8, 8].map((available, i) => ({ at: start + i * 60_000, available, fresh: true })); -const states = episode(oscillation); -assert.deepEqual(states, ["low", "low", "low", "low", "observed", "critical", "critical", "critical", "low"]); -assert.deepEqual(episode([{ at: start, available: null, fresh: true, refused: true }]), ["critical"]); -assert.deepEqual(episode([{ at: start, available: 4, fresh: true }, { at: start + hour, available: 90, fresh: false }]), ["critical", "critical"]); - -const max = Number.MAX_SAFE_INTEGER; -// At most 12 nullable byte fields per capacity, all at their longest representation. -const capacity = [743, max, max, max, max, 2, max, max, max, max, max, max, max, max]; -const worst = [1, 2, 1, max, max, 2, 185, 2, 5, Array.from({ length: 4 }, () => capacity)]; -const sampleBytes = Buffer.byteLength(JSON.stringify(worst)); -assert.ok(sampleBytes <= 1152, `sample ${sampleBytes} exceeds 1152 bytes`); -const payloadBound = 186 * 1152 + 40960 + 187; -assert.ok(payloadBound <= 256 * 1024); -type Tier = "recent" | "daily" | "weekly"; -type Point = Sample & { tier: Tier; gap: boolean }; -const widths = { recent: 6 * hour, daily: day, weekly: 7 * day }; -const limits = { recent: 64, daily: 90, weekly: 32 }; -const epoch = Date.parse("1970-01-05T00:00:00Z"); // Monday -const bucket = (at: number, tier: Tier) => Math.floor((at - epoch) / widths[tier]); -const history = new Map>( - (["recent", "daily", "weekly"] as Tier[]).map(tier => [tier, new Map()]), -); -let last: Sample | null = null; -function retain(sample: Sample): boolean { - if (last && sample.at < last.at) return false; - for (const [tier, points] of history) { - const key = bucket(sample.at, tier), previous = points.get(key); - // Closing a bucket with no observation in its final six-hour interval is a gap. - for (const [oldKey, point] of points) { - if (oldKey < key && bucket(point.at, "recent") < (oldKey + 1) * widths[tier] / widths.recent - 1) point.gap = true; - if (oldKey < key - limits[tier] + 1) points.delete(oldKey); - } - const missed = previous - ? bucket(sample.at, "recent") - bucket(previous.at, "recent") > 1 - : bucket(sample.at, "recent") > key * widths[tier] / widths.recent; - const changed = !!last && (last.scope !== sample.scope || last.basis !== sample.basis); - const gap = !!previous?.gap || missed || changed || !sample.complete || sample.bytes === null; - // A failed refresh preserves complete evidence, but never erases its gap. - points.set(key, { ...(previous?.complete && !sample.complete ? previous : sample), tier, gap }); - assert.ok(points.size <= limits[tier]); - } - last = sample; - return true; -} -for (let i = 0; i < 365 * 4; i++) retain({ ...steady[0], at: start + i * 6 * hour }); -assert.deepEqual([...history.values()].map(points => points.size), [64, 90, 32]); -const weekly = [...history.get("weekly")!.values()]; -assert.ok(weekly.at(-1)!.at - weekly[0].at >= 210 * day); -const beforeReverse = JSON.stringify([...history.values()].map(points => [...points])); -assert.equal(retain(steady[0]), false); -assert.equal(JSON.stringify([...history.values()].map(points => [...points])), beforeReverse); -// Three missed intervals within the next UTC day remain visible after a good endpoint. -const nextDay = start + 365 * day; -retain({ ...steady[0], at: nextDay }); -retain({ ...steady[0], at: nextDay + 18 * hour }); -assert.equal(history.get("daily")!.get(bucket(nextDay, "daily"))!.gap, true); -retain({ ...steady[0], at: nextDay + 19 * hour }); -assert.equal(history.get("daily")!.get(bucket(nextDay, "daily"))!.gap, true); -const afterOutage = nextDay + 400 * day; -retain({ ...steady[0], at: afterOutage }); -assert.deepEqual([...history.values()].map(points => points.size), [1, 1, 1]); - -// Distinct available-capacity endpoint windows; no production implementation is imported. -type Forecast = { kind: "depleting"; days: number } | { kind: "non-depleting" } | { kind: "unavailable" }; -function forecast(samples: Sample[], now: number, long = false): Forecast { - const latest = samples.at(-1), points: Sample[] = []; - if (!latest || latest.at > now || now - latest.at > 6 * hour) return { kind: "unavailable" }; - for (let i = samples.length - 1; i >= 0; i--) { - const point = samples[i], next = points[0]; - if (!point.complete || point.gap || point.available === null || point.scope !== latest.scope || point.basis !== latest.basis || point.total !== latest.total - || latest.at - point.at > (long ? 30 : 7) * day || (next && (next.at <= point.at || next.at - point.at > (long ? 48 : 12) * hour))) break; - points.unshift(point); - } - if (points.length < (long ? 15 : 5) || latest.at - points[0].at < (long ? 14 : 2) * day) return { kind: "unavailable" }; - const changes = points.slice(1).map((point, i) => points[i].available! - point.available!); - const net = points[0].available! - latest.available!; - if (net === 0) return { kind: changes.every(value => value === 0) ? "non-depleting" : "unavailable" }; - if (changes.filter(value => value * Math.sign(net) >= 0).length / changes.length < 2 / 3 - || Math.max(...changes.map(Math.abs)) > Math.abs(net) / 2) return { kind: "unavailable" }; - if (net < 0) return { kind: "non-depleting" }; - const days = latest.available! / (net / ((latest.at - points[0].at) / day)); - return Number.isFinite(days) ? { kind: "depleting", days } : { kind: "unavailable" }; -} -const capacityTrace = (count: number, spacing: number, available: (i: number) => number) => Array.from({ length: count }, (_, i) => ({ ...steady[0], at: start + i * spacing, available: available(i), total: 10_000_000_000 })); -const short = capacityTrace(13, 6 * hour, i => 3_000_000_000 - i * 25_000_000).map(p => ({ ...p, at: p.at + 18 * day })); -const long = capacityTrace(22, day, i => 3_750_000_000 - i * 50_000_000); -const shortResult = forecast(short, short.at(-1)!.at), longResult = forecast(long, long.at(-1)!.at, true); -assert.deepEqual(shortResult, { kind: "depleting", days: 27 }); -assert.deepEqual(longResult, { kind: "depleting", days: 54 }); -// The approved 30-day window includes the early change 29 days ago, while -// excluding the preceding 31-day-old endpoint. A 28-day window loses it. -const month = capacityTrace(32, day, i => 4_000_000_000 - Math.min(i, 2) * 100_000_000 - Math.max(0, i - 2) * 50_000_000); -assert.deepEqual(forecast(month, month.at(-1)!.at, true), { kind: "depleting", days: 2_350_000_000 / (1_550_000_000 / 30) }, "STORAGE_DESIGN_USES_30_DAY_POLICY"); -assert.equal(forecast(short.map((p, i) => ({ ...p, total: i === 8 ? p.total + 1 : p.total })), short.at(-1)!.at).kind, "unavailable"); -assert.equal(forecast(short, short.at(-1)!.at + 7 * hour).kind, "unavailable"); -assert.equal(forecast(short, short.at(-1)!.at - 1).kind, "unavailable"); -assert.equal(forecast(short.map((p, i) => ({ ...p, gap: i === 8 })), short.at(-1)!.at).kind, "unavailable"); -assert.equal(forecast(short.map((p, i) => ({ ...p, scope: i === 8 ? "troy" : p.scope })), short.at(-1)!.at).kind, "unavailable"); -assert.equal(forecast(capacityTrace(13, 6 * hour, i => 3e9 - (i >= 4 ? 1e9 : 0)), start + 3 * day).kind, "unavailable"); -assert.equal(forecast(capacityTrace(13, 6 * hour, i => 3e9 + i * 1e7), start + 3 * day).kind, "non-depleting"); -assert.equal(forecast(capacityTrace(13, 6 * hour, () => 3e9), start + 3 * day).kind, "non-depleting"); -assert.equal(forecast(capacityTrace(13, 6 * hour, i => 3e9 + (i % 2 ? 1e9 : 0)), start + 3 * day).kind, "unavailable"); -assert.equal(forecast(long.slice(0, 14), long[13].at, true).kind, "unavailable"); -assert.equal(forecast(long.map((p, i) => ({ ...p, complete: i !== 17 })), long.at(-1)!.at, true).kind, "unavailable"); -const unknownForecast: Forecast = { kind: "unavailable" }; -const depletion = (days: number): Forecast => ({ kind: "depleting", days }); -const within = (f: Forecast, days: number) => f.kind === "depleting" && f.days <= days; -const beyond = (f: Forecast, days: number) => f.kind === "non-depleting" || f.kind === "depleting" && f.days > days; -function severity(ratio: number | null, a: Forecast, b: Forecast, refused = false): Severity { - if (refused || ratio !== null && ratio <= .05 || within(a, 7) && within(b, 7)) return "critical"; - if (ratio !== null && ratio <= .10 || within(a, 30) || within(b, 30)) return "low"; - return "observed"; -} -assert.equal(severity(.5, depletion(6), unknownForecast), "low"); -assert.equal(severity(.5, depletion(6), depletion(7)), "critical"); -assert.equal(severity(.04, unknownForecast, unknownForecast), "critical"); -assert.equal(severity(null, unknownForecast, unknownForecast, true), "critical"); -assert.equal(severity(.5, shortResult, longResult), "low"); -const recoverForecast = (state: "low" | "critical", a: Forecast, b: Forecast) => state === "critical" ? beyond(a, 10) || beyond(b, 10) : beyond(a, 45) && beyond(b, 45); -assert.equal(recoverForecast("critical", unknownForecast, depletion(9)), false); -assert.equal(recoverForecast("critical", unknownForecast, depletion(11)), true); -assert.equal(recoverForecast("low", unknownForecast, depletion(100)), false); -assert.equal(recoverForecast("low", { kind: "non-depleting" }, depletion(46)), true); -// Every active cause must recover. Missing refusal evidence never disappears in a good scan. -const clears = (ratio: number | null, forecastRecovered: boolean, refused: boolean, matchingSuccess: boolean) => ratio !== null && ratio > .07 && forecastRecovered && (!refused || matchingSuccess); -assert.equal(clears(.9, true, true, false), false); -assert.equal(clears(.9, false, false, true), false); -assert.equal(clears(null, true, true, true), false); -assert.equal(clears(.08, true, true, true), true); - -// Model durable notification intent/receipt, with no transport or network call. -type Delivery = { phase: "pending" | "sending" | "accepted" | "unknown" | "rejected"; attempts: number }; -function deliver(row: Delivery, input: { owner: boolean; active: boolean; fresh: boolean; hour: number | null; outcome: "accepted" | "unknown" | "rejected" }): boolean { - if (!input.owner || !input.active || !input.fresh || input.hour === null || input.hour >= 22 || input.hour < 8 || row.attempts >= 3 || ["sending", "accepted", "unknown"].includes(row.phase)) return false; - row.phase = "sending"; row.attempts++; row.phase = input.outcome; return true; -} -const eligible = { owner: true, active: true, fresh: true, hour: 12, outcome: "accepted" as const }; -const receipt: Delivery = { phase: "pending", attempts: 0 }; -for (const input of [{ ...eligible, owner: false }, { ...eligible, active: false }, { ...eligible, fresh: false }, { ...eligible, hour: 22 }, { ...eligible, hour: 7 }, { ...eligible, hour: null }]) assert.equal(deliver(receipt, input), false); -assert.equal(deliver(receipt, { ...eligible, hour: 8 }), true); -assert.equal(deliver(JSON.parse(JSON.stringify(receipt)), eligible), false); // restart -assert.equal(deliver({ phase: "unknown", attempts: 1 }, eligible), false); -assert.equal(deliver({ phase: "sending", attempts: 1 }, eligible), false); // crash after intent -const retries: Delivery = { phase: "pending", attempts: 0 }; -for (let i = 0; i < 3; i++) assert.equal(deliver(retries, { ...eligible, outcome: "rejected" }), true); -assert.equal(deliver(retries, eligible), false); -console.log(JSON.stringify({ fixture: "Odysseus, 2026-07-12", sampleBytes, payloadBound, tierLimits: limits, weeklySpanDays: (weekly.at(-1)!.at - weekly[0].at) / day, scenarios: { shortResult, longResult }, states, delivery: "offline model only; no notifications sent" }, null, 2)); diff --git a/docs/plans/storage-growth.md b/docs/plans/storage-growth.md deleted file mode 100644 index de637db92c..0000000000 --- a/docs/plans/storage-growth.md +++ /dev/null @@ -1,443 +0,0 @@ -# Storage growth and low-space guidance - -This design implements the maintainer's [reconciled ruling](https://github.com/schlessera/brain-kit/issues/2014#issuecomment-6212070681), -recorded durably in [Storage guidance](../decisions/storage-guidance.md). -It specifies a later extension; it does not activate runtime collection or -notifications. The [initial Storage design](../decisions/design-kit/storage.md) -keeps its complete inspect/select/review/remove/result journey and does not wait -for history. No cleanup or retention policy is changed by a pressure warning. - -## Boundaries and ownership - -The UI server owns aggregate observation history in its existing operational -state, under the same human-owner boundary as Storage inventory. Agents and -ordinary content readers receive neither history nor capacity targets. No -new core database, `.stats-history.jsonl` fields or filesystem-provider seam. -Operational backup/restore includes the new server table through its existing -versioned migration/export machinery; restoring history never restores files. - -Core corpus history is intentionally different (`snapshotOf`, -`packages/core/src/lib/stats-history.ts:132-172`) records filtered corpus and -health fields; thinning (`thin`, `packages/core/src/lib/stats-history.ts:232-244`) retains -recent days and older weekly observations. Neither contract supplies server -capacity identity or a lifetime byte bound. Caller availability alone -(`freeSpaceBytes`, `packages/core/src/lib/stats.ts:219-230`) is not quota headroom. -[Accounting discovery](storage-accounting.md) and -[native brain storage](../decisions/native-brain-storage.md) bind all quantities. - -## Bounded record and encoding - -Schema `storage_history_v1` retains **186 aggregate samples** globally, with at -most four capacities per sample. Its canonical UTF-8 JSON payload uses compact -tuples, capped at **1,152 bytes per sample**, plus at most **40,960 bytes** for a -shared descriptor dictionary and singleton warning/scheduler state. Including -array framing (187 bytes), the maximum is **255,419 bytes**, below **256 KiB**. -Notification delivery receipts have their own bounded operational table; they -are not smuggled into this history-payload claim. Their physical charge is part -of the operational DB inventory, as are SQLite pages and WAL. - -The conceptual fields are preserved by this exact tuple schema (no rounding, -lossy packing or silently dropped values): - -```ts -type Quantity = number | null; // safe, nonnegative byte integer; null is unknown -type Capacity = [ - descriptor: number, // integer 0..743; dictionary holds identity and root scope - total: Quantity, used: Quantity, free: Quantity, available: Quantity, - coverage: 0 | 1 | 2, // complete, partial, unknown - brainLogical: Quantity, brainAllocated: Quantity, - appLogical: Quantity, appAllocated: Quantity, - operatorLogical: Quantity, operatorAllocated: Quantity, - unionLogical: Quantity, unionAllocated: Quantity, -]; -type Sample = [ - version: 1, tier: 0 | 1 | 2, gap: 0 | 1, - at: number, start: number, // actual UTC epoch milliseconds; safe nonnegative - source: 0 | 1 | 2, // scheduled, refresh, operation - descriptor: number, // integer 0..185: collector, global scope and basis - coverage: 0 | 1 | 2, - reason: 0 | 1 | 2 | 3 | 4 | 5, // none, partial, capacity, scope-limit, budget, changed - capacities: Capacity[], // at most four -]; -``` - -Dictionary entries are fixed tuples. A sample descriptor holds package version -(at most 32 ASCII characters), 32-character scope hash and basis version 1. -A capacity descriptor holds a 32-character identity hash and 32-character root -scope hash. The combined serialized dictionary and singleton must fit 40,960 -bytes; do not reserve an independent budget per dictionary kind. Descriptor IDs -are local immutable references while used by retained samples, never reused -under an existing sample. Garbage-collect unreferenced descriptors in the same -transaction as tier replacement. If churn exhausts this budget, pause history -and expose the reason while preserving the previous valid set. The maximum -field-length experiment separately qualifies four capacities and 186 samples; -it does not pretend worst-case unique scope churn fits the dictionary forever. -No per-file names, paths or content are retained. Public JSON uses named fields -and documented versioning; compact tuples are private persistence encoding. - -`owners` are attribution views, not additive physical partitions. `union` is -computed once from object identities; never sum overlapping owners. Shared -extents remain qualified charges. Capacity fields retain native provenance and -unknown semantics in the schema/basis version; unsupported overlay/quota -identities cannot become comparable capacities. There is no per-file/path -history, reservation estimate, transcript content, filename, provider key or -host pathname. The server maps opaque IDs to current authorized display names. - -At most four capacities have retained history. Select their stable order once -per scope epoch, rather than rotating capacities. Additional capacities remain -visible in inventory with “History not recorded for this capacity.” Global -coverage becomes partial with `scope-limit`; individually complete retained -scopes can still be compared. Reconfiguration starts a new epoch. - -SQLite page/index/WAL overhead is **outside the serialized-payload bound**; -it is not claimed to fit in 256 KiB. The operational DB already appears once in -App storage, including history. Do not add payload bytes to measured DB bytes. -Report the payload charge separately as explanation. Insufficient operational -headroom preserves the previous valid tiers and reports “History paused.” Never -force vacuum, truncate WAL, expire journal objects or delete backups to fit -history. Sampling failure must not destroy recovery. - -## Cadence, replacement and cost - -Sample **once per six-hour UTC bucket**, at the first eligible opportunity while -the server runs. No catch-up scans after restart/sleep. No startup admission or -worker hot-path scans. A cross-process owner lease coalesces scheduled, explicit -refresh and operation requests into one collection; callers share its result. -It does not exclude file writers; operations keep their existing mutation locks. - -A successful Refresh or completed operation may replace the current bucket. -Persist at most one history transaction per minute; requests during that minute -retain only the newest pending aggregate. A crash loses that pending observation, -not content. A partial observation may be retained only if no complete sample -exists in the bucket; otherwise expose the failure without erasing good evidence. - -Retain three overlapping UTC tiers, with **186 total slots**, including current -buckets: - -| Tier | Bucket width | Slots | Nominal retained horizon | -| --- | --- | --- | --- | -| Recent | Six hours | 64 | 16 days | -| Daily | One UTC day | 90 | 90 days | -| Weekly | Seven days, Monday 00:00 UTC | 32 | 224 days (about seven months) | - -Each collected observation updates the current bucket in all three tiers in -**one transaction**. Each tier retains the latest actual observation in its -bucket, with its original timestamp and values; these are endpoints, not sums, -averages or peaks. The same observation may occupy three slots. Overlap is -intentional and included in the 186-slot bound, not added to the horizon. -No scans run for compaction, and no raw history is retained behind these tiers. -Updating three bounded records replaces the old single-record write while the -scan cadence and transaction rate remain unchanged. - -Expire buckets by UTC age as well as slot count: retain bucket indexes from -current index minus (slots minus one) through current index. On restart, prune -old records during the next eligible transaction without backfilling empty -buckets. Thus a long outage cannot turn 32 weekly slots into an unbounded age -claim. Current buckets are labelled provisional; actual endpoint timestamps -remain visible. Clock reversal pauses persistence until the last accepted time -is reached, rather than overwriting a newer bucket with an older measurement. - -`gap` is sticky within each bucket. Set it when an observation is partial, -unknown, has a changed scope/basis, or a scheduled six-hour bucket is missing. -For a bucket first observed after its first six-hour interval, set it immediately. -When closing a bucket, a missing final interval also sets it. Retaining a prior -complete endpoint after a failed refresh does not clear this flag. A whole -missing day/week has no invented record. Reconfiguration never combines values -across identities; retain the newest endpoint but mark the affected bucket. -This conservative flag applies to all capacity series in that sample. - -The table labels Recent/Daily/Weekly and the actual observation time. Older -history uses discrete points, without interpolating daily or weekly endpoints -or implying that peaks between them were retained. Missing buckets and flagged -buckets are visibly incomplete. Observed recent rates use only Recent samples with `gap: false`. Forecasts use -the separately qualified windows below. A coarse point cannot fill a recent gap -or count as an extra recent observation; weekly history is inspection-only. - -The bounded dictionary/singleton records schema, last attempted bucket, last persisted -time and current episode states for four scopes. Tier indexes derive from -sample timestamps, and gap flags live in the capped samples. No unbounded event -log or separate rollup staging buffer. - -A full sample reuses inventory budgets: one scan/app, at most two metadata -workers, finite entries/depth/time/output/errors. No Git maintenance, attachment -hashes, unapproved stores or writable content DB. Capacity-only refresh can update -current guidance but is not an aggregate-history sample: it cannot repeat an old -store total under a new timestamp. - -Maximum scheduled cost is four bounded scans and four small transactions per -running day. A tick coalesces with an active scan and never queues a backlog. -Explicit refresh retains owner-coordinator rate limits. This is a cost -ceiling, not proof that large-corpus scanning is cheap. Implementation needs -real runtime/cancellation evidence and no-stall proof for concurrent turns. - -## Comparability and growth - -Compare only equal capacity identity, root-set scope, basis version, complete -coverage, no gap flag and available fields. A collector patch is comparable only when its -measurement semantics are unchanged; a basis change starts a new epoch. Unknown -allocation, unsupported identity, overflow, root changes and partial samples -create labelled gaps. Never interpolate across them. Reflink allocation is a -qualified charge, not exclusive physical usage or reclaimable space. - -The observed rate is **observed endpoint change divided by elapsed -time** across the latest contiguous comparable Recent window, at most seven days. -Require five complete samples spanning at least 48 hours and no gap over -12 hours. Display signed decimal bytes/day, basis and interval: -“App allocation +120 MB/day observed over 3 days.” Negative values say decreased; -a flat observed window can show zero. Insufficient evidence cannot. - -Capacity availability is a separate series. Other writers, retained objects, -filesystem overhead and delayed reclamation can change it independently of the -known-store union. Never label all capacity loss as App growth or all observed -post-operation gain as reclaimed by that operation. - -### Qualified exhaustion scenarios - -Compute depletion from **available capacity**, independently of the known-store -union. A capacity's total, identity, permitted-root scope and basis must match -throughout a window. Never use logical/allocated App growth to forecast capacity. - -| Window | Evidence | -| --- | --- | -| Short | Recent points within seven days; at least five distinct endpoints spanning 48 hours; no interval over 12 hours. | -| Long | Completed Daily endpoints within 30 days plus the latest Recent endpoint; at least 15 distinct endpoints spanning 14 days; no interval over 48 hours. | - -Deduplicate identical timestamps. The latest point must be the current complete -capacity observation and at most six hours old, with no future timestamp. Walk -back only through a contiguous compatible suffix: partial, unknown, gap, changed -identity/total/basis, invalid ordering or excess interval breaks the window. -Coarse gap flags reject incomplete daily buckets; weekly points never qualify. -The current day's provisional daily point supplies no extra evidence. - -For each qualified window, observed depletion/day is `(first.available - -last.available) / elapsedDays`. Require at least two-thirds of intervals to -move in the net direction (flat intervals qualify), and no single interval's -absolute change to exceed half the absolute net change. This rejects a lone -burst/cleanup and inconsistent reversals; it does not establish statistical -accuracy. A perfectly flat window qualifies as non-depleting. A mixed window -with zero net change is unavailable. A smoothly replenishing qualified window -also reports **No depletion observed**, without a numeric exhaustion horizon. - -For positive depletion, horizon is `latest.available / depletionPerDay` in days, -with finite arithmetic. Keep exact values for severity comparisons; round only -copy. Zero available bytes can yield zero days. Qualified non-depleting evidence -is distinct from missing/incompatible evidence and may satisfy forecast recovery; -it never says unlimited space or guarantees a write will fit. - -Show both labelled window scenarios and their actual intervals. If both finite -estimates differ, show their min–max range with “If these observed rates continue.” -If one is unavailable, show the other with the missing window's reason; a sole -projection can trigger Low, never forecast-driven Critical. If one is -non-depleting and the other positive, show the finite scenario and “No depletion -observed in the other window,” not a numeric range to infinity. Rapid acceleration -may remain underpredicted: capacity thresholds and owner refusals remain independent. -No probabilistic confidence, countdown promise or causal cleanup-savings claim. - -## Low-space states and hysteresis - -Evaluate each resolved capacity independently. Fresh means a complete trustworthy -observation no older than six hours. Unknown capacity has no inferred percentage, -zero meter or healthy verdict. Preserve warning age when evidence goes stale. - -| State | Entry | Copy/action | -| --- | --- | --- | -| Unknown | Missing trustworthy total/available/identity | “Capacity unavailable. Refresh or inspect host capacity.” | -| Observed | No active cause | “Capacity observed … ago.” No promise an operation fits. | -| Low | Available at or below 10%, or either qualified finite scenario at or below 30 days | “Low space. Review capacity and observed trends.” | -| Critical | Available at or below 5%, both finite scenarios at or below seven days, or an owner-confirmed no-space refusal | “Very low space. Some writes may be refused.” | -| Stale | Current evidence older than six hours | “Refresh before planning maintenance.” Preserve active warnings. | - -Track causes separately within a capacity episode; never clear one cause using -another cause's unrelated evidence. Worsening takes one qualifying observation. -Recovery takes two successive qualifying fresh observations at least 60 seconds -apart; intervening failure, incompatible evidence or reversal resets that pair. -Critical drops to Low first; two additional observations are needed to clear Low. - -- Capacity recovery: above 7% to leave Critical; above 12% to leave Low. -- Forecast recovery: to leave Critical, at least one qualified scenario beyond - ten days (or qualified non-depletion) breaks the two-scenario Critical condition. - To leave Low, both must be qualified beyond 45 days or non-depleting. Missing - evidence cannot be the recovering scenario. -- Refusal recovery: require a subsequent owner-reported successful write in the - same affected target and resource class, after the last refusal, plus the two - fresh above-7% observations. No synthetic write probe, empty-file test or - disappearance of the failing operation establishes recovery. Unresolved quota, - inode or unknown-target refusals stay explicit until the owning operation can - provide matching recovery evidence. After downgrade, the capacity Low rule - still applies. A new refusal resets recovery. - -Every active cause must satisfy its own exit rule before severity falls. -Clock reversal, unknown/partial/stale data and scope changes cannot clear an -old episode. A changed scope is Unknown; retain the unresolved prior episode -as requiring inspection, without transferring its measurements into the new scope. -Explicit Refresh can provide the recovery pair without extra background scans. - -## Indicator and Critical Web Push - -Storage shows capacity-specific evidence; a persistent app indicator shows the -highest active severity and opens Storage. Neither adds a main destination or -shortcut. Unknown/stale state is labelled, never silently green. Storage and the -indicator remain usable without push permission. Repeated scans update the same -state without repeated assertive announcements; explicit Refresh announces its -completion once politely. Critical text is associated with the capacity heading. - -Use only existing authenticated, opt-in **owner** Web Push subscriptions, with -revocation rechecked at dispatch. Ordinary content readers and agents must not -receive operational information. Send at most one successful transport submission -per Critical episode/subscription; no daily reminders initially. An episode starts -on entry to Critical and ends only after confirmed downgrade. A later re-entry is -a new episode. Persist episode and destination receipt identities across restarts. -Bound episode state to the four tracked capacities; purge retired episodes after -all pending delivery is terminal, retaining active and latest resolved identity -per capacity. Destination rows cannot outlive their existing subscription. - -Use a unique durable `(episode, subscription)` intent before transport. Cap all -attempts at three per pair, with retry delays of one and five minutes only for -known non-delivery/rejection. An ambiguous timeout or crash after dispatch is -**unknown**, not a reason to resend; expose that delivery state in Storage. -No exactly-once device-display claim: push transport acceptance is not delivery. -A browser notification tag derived from the opaque episode coalesces replacement -at the destination, but is not used to justify duplicate server submissions. - -All attempts respect device-local **[22:00, 08:00)** quiet hours, without refusal -exceptions. Use authenticated timezone reporting; an absent/invalid zone keeps -delivery pending without guessing. Recompute eligibility after timezone/clock -changes. When eligible, revalidate current owner access, subscription, active -Critical state and fresh supporting evidence. A stale/unknown warning stays -visible but sends no push until refreshed; confirmed recovery suppresses pending -notices. Coalesce multiple eligible capacities into one generic notification, -recording every included episode's receipt. No backlog replay or new scans solely -for delivery. Contents say only “Storage needs attention. Open Storage for details.” -Do not expose capacity IDs, amounts, paths or filenames on a lock screen. - -A status never authorizes writes. Packing, index rebuild/compaction, pin refresh, -retained binary removal/Undo and backups may need headroom. Label those actions -“Needs headroom.” Owner preflight remains final; refusal and manual capacity -provision are legitimate. Never discard history, pins, sessions or backups as an -automatic cure. Scratch/staging cleanup uses existing policies. Retained-only -pressure must be able to say “No eligible cleanup found.” - -## Layouts and accessible copy - -At 320px (296px content), cards stack with wrapping text/actions and 44px targets. -Units are decimal with exact-byte details. Labels/icons/text convey states in -dark, paper and grey; colour is supplementary. - -```text -Storage -Capacity · Brain volume -! Low space -1.80 GB available of 20.0 GB -Observed 4 minutes ago -Writes: Brain files, Git, -retained file history -[Refresh] - -Growth · On disk -App: +120 MB/day observed -Over 3 days · 13 samples -Shared extents may overlap -Capacity scenarios: 18–42 days -If observed rates continue -[View observations] - -Review cleanup -[Prune eligible scratch] -Pinned answers stay -[Pack Git objects] -Needs headroom -No eligible cleanup found? -Add capacity through your host. -``` - -Desktop keeps capacity-specific cards above the existing treemap/list. Do not -combine capacities. Expand details inline without losing filters, selection or -focus; alerts never displace a selected-file review. - -```text -Storage [Refresh] Observed 4 minutes ago -+----------------------------------+----------------------------------+ -| ! Low space · Brain volume | App volume · Capacity observed | -| 1.80 GB available / 20.0 GB | 8.00 GB available / 40.0 GB | -| Writes: files, Git, retained | Writes: sessions, inbox, UI DB | -| history | | -+----------------------------------+----------------------------------+ -Growth · On disk App +120 MB/day over 3 days · 13 samples -[View observations] Shared extents may overlap · Capacity scenarios 18–42 days -If observed rates continue · Short 3 days / long 21 days -Treemap / equivalent table Existing inspect/remove flow -Maintenance: [Prune eligible scratch] [Pack Git objects · Needs headroom] -``` - -Unknown and retained-only pressure have complete phone states: - -```text -Capacity · Brain volume -? Capacity unavailable -Last observation: 8 hours ago -Writes: Brain files, Git, -retained file history -[Refresh] -Growth unavailable -Need comparable observations - -! Very low space · App volume -Owner refused a write -Available bytes unknown -Retained data uses this store -No eligible cleanup found -Add capacity through your host. -[Refresh] [View retained usage] -``` - -An observation table supplies time/age, scope, basis, coverage and nullable values -as an equivalent to any sparkline. Missing points are gaps, not zeros. Keyboard -users reach all actions and return from details; refresh never moves focus. -At 200% zoom the layout stacks without clipping. Reduced motion disables chart -animation. Runtime/browser/accessibility proof belongs to implementation. - -## Synthetic decision examples - -The companion [trace experiment](storage-growth-experiment.ts) evaluates these -rules offline using Odysseus observations anchored to 2026-07-12. It is -not production history, implemented runtime or a benchmark. - -| Trace | Required interpretation | -| --- | --- | -| Steady growth, 13 samples over three days | Signed rate; no long-window scenario until its evidence minimum is met. | -| Burst then steady size | Signed rate; burst-dominated depletion window yields no projection. | -| Reclamation | Negative observed change; no causal savings claim. | -| Capacity/root change | New epoch; old observations cannot supply a rate. | -| Partial/unknown midpoint | Break the window; too little new evidence means no rate. | -| Retained-only pressure | Low/Critical plus no eligible cleanup; capacity provision is legitimate. | -| Concurrent unowned writer | Capacity falls while store usage is flat; do not attribute loss to App. | -| Year of six-hour observations | At most 64/90/32 slots; weekly history reaches approximately seven months without extra scans. | -| Missing interval inside a daily/weekly bucket | Sticky gap survives replacement by a later complete endpoint. | -| Long outage | Empty periods remain empty; age-expired buckets disappear without catch-up scans. | -| Threshold oscillation | Worsen immediately; clear only with two qualifying observations 60 seconds apart. | - -The experiment checks maximum-width numeric tuple encoding for four capacities, -the 186-record payload ceiling, all tier caps and seven-month weekly reach. It -also checks forecast windows, burst/reclamation rejection, divergent scenarios, -missing evidence, direct warnings, cause-specific recovery, refusal evidence and -restart/deduplication/quiet-hours suppression with a deterministic local model. -These traces qualify rules, not real-world forecast error bounds or transport -reliability. Implementation issues require genuine runtime/browser/migration proof -and physical SQLite/WAL measurements. No fixture sends a notification. - -## Implementation boundaries - -Server history/state/delivery and UI guidance are separate native children of -#1779, after this design spike. The server issue owns migration, bounded payload -and receipts, authoritative owner checks, shared scan coalescing, timers, -cancellation, recovery and versioned HTTP/config contracts. The UI issue owns -history tables/charts, labelled scenarios, persistent indicator, accessible -capacity guidance and notification navigation. Initial pane delivery is #2013; -these additions must not introduce an incomplete public pane before it. - -Remote/provider usage needs an authenticated provider-specific scope/quota -contract. Host/container stores need explicit owner-approved roots and safe -measurement evidence. Per-file Git attribution needs a bounded meaningful model. -Derivative grouping needs provenance. Workspace cleanup needs its own lifecycle -and use-case ruling. New journal/history/backup expiry needs an explicit loss -and recovery ruling. Pressure does not authorize any of them. diff --git a/docs/plans/storage-lifecycle.md b/docs/plans/storage-lifecycle.md deleted file mode 100644 index a2586ab417..0000000000 --- a/docs/plans/storage-lifecycle.md +++ /dev/null @@ -1,331 +0,0 @@ -# Storage cleanup and retention discovery - -Recommendation for [#1781](https://github.com/schlessera/brain-kit/issues/1781), -under [#1779](https://github.com/schlessera/brain-kit/issues/1779). This is design -input for [#1782](https://github.com/schlessera/brain-kit/issues/1782), coordinated -with the accounting discovery in [#1780](https://github.com/schlessera/brain-kit/issues/1780). -It approves no deletion policy, new retention default or runtime API. - -Source inspected at `f2c98da6093c9e1731f061625ba7302f51bf7340`. -Final lifecycle review also includes `2ea27697850dfffe956f2aa8471a720ea738f2bb`: -[#1778](https://github.com/schlessera/brain-kit/issues/1778)'s delivered correction -separates immutable startup inputs from bounded copy-on-write output staging. -The synthetic measurement below retains its original source/conditions. -The [governed-worker decision](../decisions/governed-writable-workers.md), -[writable-area decision](../decisions/worker-writable-areas.md), and -[all-writer boundary](../decisions/policy-write-boundary.md) bind execution. -The governed record supersedes older read-only defaults and HOME overlays. - -## Recommendation - -Build storage inspection first, then expose existing bounded housekeeping -through its owners. Offer selected canonical attachment removal only after a -dedicated, stale-safe, journaled application operation exists. The current -file routes read files; they have no deletion endpoint. The curated application -route accepts ordinary Markdown, not arbitrary binaries -(`function validatePath`, `packages/ui-server/src/brain/application.ts:37-55`). -Document archive changes visibility/relevance and may move Markdown; it does -not remove an attachment or reclaim its history. Do not present it as Delete. - -Use maintenance workers for repository code, the CLI and Git. Host routes may -perform narrowly validated descriptor operations, as the journal/revert do; -they must not evaluate brain configuration, hooks, filters or executables. -The existing brain client supplies boundary execution -(`async function execBrain`, `packages/ui-server/src/brain/client.ts:261-315`). -Do not turn the new surface into a host command runner or an extension seam. - -Reuse existing authorization. A requested reversible, fully journaled edit -needs no extra approval solely because it appears under Storage. An unjournaled -delete is irreversible under the governing ruling and cannot masquerade as -that edit. Outward sync retains G5 policy/approval; command rules still apply -to shell actions. Protected policy paths retain R35. UI execution is bound to -the authenticated principal, exact selection and operation; revocation and -profile authority are checked again at execution. Restricted autonomous work -and voice gain no new tools from this recommendation. - -## Operation matrix - -Logical bytes, allocated bytes and available volume capacity are separate -measurements. Every row requires fresh after-state even when the operation -fails. A removed-byte count is not a volume-reclamation receipt. Temporary -space entries below are requirements to assess, not reservations implemented -by this spike. - -| Operation / owner / primitive | Data and eligibility | Protection, revalidation and authority | Recovery / temporary space | Expected effect and after-measurement | -| --- | --- | --- | --- | --- | -| Selected content removal; core deterministic content semantics + ui-server application/journal; **proposed binary operation** | Canonical tracked/untracked attachments, individually selected. Ignored, unindexed and external-link cases need explicit classification. | Recheck exact root/parent/file identity, bytes/hash, permissions, protected paths, references and live ownership under the applicable gate/lock. Authenticated requested edit; no arbitrary host Git. | Retained, verified before-version required for reversible removal; current journal exclusions can make a file ineligible. CAS capture may copy its entire bytes and uses charged temporary capacity. | Current file count/bytes decrease; references can break. Measure working-tree bytes/status, retained journal bytes, local Git and per-volume availability separately. History/remotes can remain unchanged. | -| Attachment sidecars; core conversion/export owners + same application boundary; **proposed grouped selection** | Derived previews/OCR/Markdown/metadata only where provenance demonstrates the relationship. A filename suffix alone is insufficient. | Preview siblings and references; recheck each selected version. Never delete an independently edited or shared derivative automatically. Same authority as each selected content edit. | Each non-rebuildable selected file needs recovery bytes. Rebuildable sidecars still need a declared generator and resource/cost implications. | Report each removed, kept or conflicted sibling and actual aggregate delta. Regeneration can consume disk/CPU or paid services; no automatic paid rebuild. | -| Git packing; core `packRepository`, #398 | Local objects and refs, valid Git worktree. | Existing Git maintenance lock; worker boundary and existing Git locks. No ref deletion, reflog expiry, history rewrite or configuration mutation. | No history restoration needed because reachable content remains. Packs and old loose data coexist during packing; disk headroom and maintenance tmpfs admission are both required. | Loose count often drops; packs can grow before duplicate loose copies disappear. Measure loose+pack bytes, refs and availability after both passes; savings are workload-dependent. | -| Derived index refresh/rebuild/compaction; core index machinery, existing maintain/index entry points | `brain.db` and its owned sidecars only; content remains authority. | Run supported command in maintenance worker; use its locking and indexing configuration. Never infer that `ui.sqlite` or its sidecars are disposable. | Rebuild from Markdown; semantic data may require provider calls. Rebuild, WAL and vector compaction need headroom and can initially grow. | Index correctness/health is the goal, not guaranteed space savings. Report actual DB/sidecar bytes and failures, keeping existing stats contracts. | -| Eligible persistent scratch prune; core `pruneScratch`, server timer/pin bridge; #1656/#1691 | `.brain/scratch`; existing seven-day / 1 GiB policy for unpinned candidates. | Managed pins must be complete/readable; reread pins before each removal. Linked retained answers survive age and cap. Current writers pin their outputs for their own post-write pass. Use existing CLI boundary. | Unlinked scratch is ephemeral; no general Undo promise. Explicit `scratch clean` bypasses pin protection and must **not** back an ordinary safe-prune button. Pin refresh itself can need disk. | Existing report includes removals, failures, remaining/pinned bytes and overage. Show suspension/overage, never release pins merely to make the meter smaller. Re-measure allocated bytes/capacity independently. | -| Settled share staging cleanup; ui-server `createInboxCleanup`, #807/#686 | Server intake staging and partial directories associated with durable cleanup work. | Recovery gate, Queue/Action status, attempts, waits, lease/version and actual originating lifetime/settlement. Age or a terminal Queue row alone is insufficient. | Durable lease acknowledged after idempotent filesystem removal; restart resumes claimed work after recovery. Database writes still need headroom. | Existing sweep counts completed cleanup items, not exact bytes. Measure staged bytes after settlement; preserve attributable item outcomes instead of claiming everything in the directory was discarded. | -| Claude idle compression; backend `archiveIdleSessions`, #1621 | Native session trees idle strictly more than 30 days; at most daily. | Active IDs read after asynchronous metadata; checksum/source comparison before deleting live bytes. Private roots outside brain. Existing backend housekeeping, no session deletion implied. | Durable gzip/manifest/index precede source removal; restore before read/resume, conflicts keep newer live files. Full source and compressed copy coexist; code reads full individual files in memory. Not an emergency no-space operation. | Conversations remain listed. Measure combined live+archive+pending/conflict bytes; later restore can expand usage again. Compression is not guaranteed to save much for already compressed data. | -| Pi idle compression; backend #1637, **unavailable** at inspected source | Native Pi SessionManager trees. | #1637 owns same active-session/30-day/crash-safe policy; this spike does not implement it. | No shipped equivalent archive primitive verified. | Show unavailable, link existing work; do not promise Pi savings or create a duplicate task. | -| Workspace cleanup; ui-server journal + SDK writable areas, **proposed selective operation** | `workspaces/` may contain clones, uncommitted work, ignored build outputs and nested repositories. Index exclusion is not disposability. | Recheck running processes/jobs/locks, Git worktree/common-dir relationships, outside links/mounts, dirty/untracked state and journal coverage. No universal lease exists proving all arbitrary commands are idle. Unknown ownership is ineligible for unattended cleanup. | A recreatable clone still may contain unique work; copy/export guarantees must cover it before removal. Large directory copies are not admitted implicitly. | Report exact selected scope and excluded live/unknown work. Nested Git common storage must not be counted or removed as private to this workspace. No blanket age-based `rm -rf`. | -| Journal collection; ui-server `createTurnJournal` / accounting | Private CAS, journal-owned SQLite pages, manifests, reservations and quarantine/revert evidence. Existing 10 GiB cap / completed-detail retention. | Existing owner collects completed detail oldest-first under cap; active windows, shared refs and reader reservations protect objects. Do not offer a manual “cache clear” that circumvents ownership. | Detail expiry loses Undo; summaries can remain, and no pre-expiry deletion receipt extends retention. Existing cap collection is already approved; **new expiry rules are unresolved**. WAL/checkpoint needs safe headroom and can refuse reader contention. | Measure CAS and owned DB/WAL allocation, not just deleted rows. SQLite free pages may remain allocated. Label expired detail and remaining recovery window honestly. | -| Operational backups; ui-server export/restore + generated host scheduling/retention, #686 and hosting-template #9 | Full operational DB image and matching staging bytes; separate Git content backup. | Capture consistency checks; restore requires stopped writers, empty targets and matching checksum/recovery marker. Backup retention must preserve an operator-tested compatible recovery point. | At least 24-hour successful capture objective; replacement export has private temporary bytes. Retention policy and remote/provider deletion belong to host configuration, not a package default. | List known age/completeness/size; unknown remote or older artifacts stay unknown. Never delete recovery material to make an export fit. Report local and remote outcomes separately. | -| Runtime maintenance; SDK owned turn temp vs externally managed logs/images/layers | `turn_temp` only reaches the current worker's private `/tmp`; runtime state is excluded. Host/container caches and other users' data are outside ordinary app authority. | Existing scoped tool skips output-linked paths; named force may override, all+force refused; no-follow/device checks. No approval for this already-authorized scoped tool. No Docker socket or global prune. | Turn temp expires at exit; linked files promote via held descriptor. Purge is not Undo; runtime transcripts/settings/memory are not its targets. | Tool measures tmpfs usage/limit/actual delta and records governance; persistent storage reclamation is a separate metric. Host logs/images/volumes show externally managed/unavailable and generic operator guidance only. | -| Immutable native inputs and output staging; ui-sdk, #1790 | Short-lived read-only Btrfs checkpoints and separately bounded writable output. These are neither canonical content nor agent turn temp. | Durable owner leases and live references protect inputs and publication material. No storage-UI sweep of host temporary paths or deletion by guessed prefix. | Checkpoints consume the operator-configured hard managed-volume capacity. Recovery releases owned stages before their lower checkpoints; unknown ownership remains retained. Writable upper bytes/metadata use the existing staging allowance. | Measure managed-volume reclamation, writable upper allocation and canonical post-publication state separately. Removing a lower-only input does not free upper write capacity; whiteout metadata can consume it. No promise that canonical deletion fixes a staging-capacity refusal. | - -Source foundations for the matrix: - -- Packing runs two passes and deletes only loose duplicates already held in - packs (`export function packRepository`, `packages/core/src/lib/git-storage.ts:78-86`). - The upstream [maintenance manual](https://git-scm.com/docs/git-maintenance) - explains these tasks; broad `gc` has different expiry behavior. -- Staging eligibility, removal and acknowledgment are separate - (`export function createInboxCleanup`, `packages/ui-server/src/inbox/cleanup.ts:18-82`). -- Scratch pin loading and per-entry revalidation sit inside pruning - (`export function pruneScratch`, `packages/core/src/lib/scratch.ts:626-707`); - explicit clean is different - (`export function cleanScratch`, `packages/core/src/lib/scratch.ts:710-728`). - Server refresh refuses incomplete enumeration and confirms missing histories - before releasing links (`function openScratchPins`, `packages/ui-server/src/cron/scratch-pins.ts:72-195`). -- Claude publishes and verifies cold copies before deleting the live source - (`export async function archiveIdleSessions`, `packages/ui-backend-claude/src/transcript-archive.ts:217-274`). -- Journal collection requires no refs/reservations and only expires ended - turns (`function collectObjects`, `packages/ui-server/src/brain/turn-journal.ts:300-320`). - Retention is applied at admission - (`begin(turnId: string`, `packages/ui-server/src/brain/turn-journal.ts:418-454`). - Object copies reserve temporary bytes before writing - (`async putFileAsync`, `packages/ui-server/src/brain/journal-objects.ts:95-150`). -- Turn-temp purge has its own scope and measured result - (`export function purgeTurnTemp`, `packages/ui-sdk/src/server/worker-turn-temp.ts:450-533`), - and tool validation/recording - (`export function handleTurnTemp`, `packages/ui-sdk/src/server/bridge-tools/turn-temp.ts:19-41`). - [Operational recovery](../inbox-recovery.md) specifies backup consistency and - restart behavior; it is not an index rebuild. -- Startup input ownership is separate from writable staging - (`export async function prepareNativeWorkerStartupView`, `packages/ui-sdk/src/server/worker-startup-view.ts:98-150`). - The [native storage decision](../decisions/native-brain-storage.md) supersedes - complete user-space startup copies and defines checkpoint recovery ownership. - The staged-write limit states the separation - (`export function outputStagingLimit`, `packages/ui-sdk/src/server/worker-state-limits.ts:144-150`). - -## PDF larger than 5 MB: review and execution - -Use decimal MB explicitly: strict `sizeBytes > 5_000_000`. Offer MiB separately -as 1,048,576 bytes. File count and total logical bytes belong to the current -filtered inventory. The accounting discovery owns physical identity, overlap, -volume scopes, partialness and freshness; cleanup consumes that model rather -than summing content and deployment totals. - -1. Inspect authenticated file metadata/preview using the existing file reader. - Display tracked/untracked/ignored status and reference evidence with its - timestamp/completeness. Query indexed links, but also inspect bounded - Markdown references and report unindexed/unsupported sources as unknown. - A zero from the index is not proof of no attachments referenced in Markdown, - retained conversations, external consumers or another workspace. Do not - read every PDF's contents just to filter sizes. -2. Select exact files, then review references, related derivatives, current - Git state and available recovery coverage. For a referenced PDF, offer Keep - or an explicit removal selection with the broken-link consequence shown; - editing the referencing note is a separately selected, version-bound effect. - Do not silently rewrite references or cascade delete sidecars. Unknown - dependencies remain disclosed and can make automated removal ineligible. -3. The proposed server operation uses principal/session/operation-bound - idempotency and a durable selected-version manifest. Under the writer gate - and appropriate content locks, recheck parent descriptors/device identity, - existence/type/mode/link count, content hash, protected paths, active work, - reference/provenance changes and journal eligibility. A changed file or - changed consequence is a conflict requiring refreshed review; never widen - the set after selection. Do not follow aliases or nested mounts. -4. Retain verified before bytes and record intent before unlink. Use the - journal's own charged CAS/reader ownership; do not bypass retention to promise - permanent Undo. Ignored files only listed by name/size, incomplete snapshots - and unretained versions cannot qualify as reversible. Report refusal rather - than upgrading authority. A new binary route must define this integration; - the existing Markdown route cannot be reused by passing a `.pdf` path. -5. Unlink the exact eligible entry; reconcile observations and per-item durable - status. Queue supported index refresh through its maintenance boundary. - Worker/maintenance coordination must prevent a concurrent writer replacing - the selected entry between validation and unlink. Existing shared gate - admission alone is **not** an exclusive cleanup lock. -6. Report removed/conflicted/protected/failed/not-started separately, references - left broken, sidecars kept, recovery receipt and expiry/partialness. Offer - existing journal/revert only where eligible and version-verified. A restart - reads the original operation receipt; it never blindly reissues deletion. - Current content deletion and index refresh are distinct outcomes. -7. Git status initially shows deletion; supported sync may later commit and - push through its credentialed maintenance boundary and G5 authority. A failed - sync does not undo successful local removal. Report local, committed and - remote-sync state independently. Previous commits still reach the PDF blob; - a normal deletion commit is not historical/remote erasure. Git's - [object traversal](https://git-scm.com/docs/git-rev-list) and - [GC documentation](https://git-scm.com/docs/git-gc) distinguish reachability - from storage optimization. Remote provider reclamation is not observed here. - -## Pressure, cancellation and recovery - -Before execution, classify headroom on **each actual capacity scope**: content, -private journal, operational DB, Git storage, maintenance tmpfs and backup -destination can differ. Logical admission is not proof that disk allocation -will succeed. Preflight cannot eliminate ENOSPC races, quotas or concurrent -writes. Use bounded batches, item/byte/time budgets and cancellation between -items; no recursive unbounded copy or “delete whatever is oldest” fallback. - -Include immutable startup-copy disk headroom separately from the bounded -copy-on-write output upper. #1778 corrects the former accidental charging of -the whole input tree to output staging. A lower-only deletion can reduce a -published canonical tree without releasing upper write capacity, so candidate -file bytes cannot predict staging-limit relief. Input copy, staged writes, -turn temp and runtime state keep their own owners and capacity evidence. - -At low space, prefer known eligible existing scratch/staging/turn-temp work -where its owner can safely record the outcome. Packing, archive compression, -index rebuilding and backup export need temporary space and must not be offered -as guaranteed immediate rescue. Deleting a journaled PDF may initially use -more storage if its before-version was not already retained. - -At zero allocatable space, a new recovery manifest or CAS object can fail. -Refuse new reversible removals that cannot establish durable intent/recovery. -Do not purge journal objects, leases, WAL, authentication state, unsettled staging -or the last complete backup to make the operation succeed. Existing compensation -may remove already authorized eligible bytes but an acknowledgment can fail; -its durable original lease, not a success toast, governs restart. If safe -owned housekeeping cannot progress, show the refused store and required -headroom, and direct the operator to add capacity or manage externally owned -storage. This is an honest manual boundary, not a new privilege grant. - -A proposed cleanup receipt must distinguish pre-unlink failure, successful -unlink awaiting reconciliation, complete local mutation awaiting indexing/sync, -and ambiguous result. After a crash, compare the selected before-version and -current entry under the same gate: an absent entry can complete reconciliation; -a replacement never gets deleted on retry. Reconcile intent against the actual -journal and source identity before reporting success. A mixed selection keeps -successful outcomes and does not roll them back automatically; retry only -unstarted eligible items. Cancellation stops admission of more items, finishes -the current critical reconciliation, and keeps completed receipts. Lost responses -read the original receipt. Undo is a fresh stale-safe operation, not a blind copy -over a newer file. Such a receipt protocol is proposed, not implemented here. - -The writer gate is cross-process and tracks process identity, not age -(`export function gateProcedures`, `packages/ui-server/src/brain/writer-gate.ts:198-289`). -Use that primitive alongside lifecycle ownership; do not interpret stale leases -as proof an actually running backend is dead. Locks, retained readers and backups -can deliberately prevent immediate reclamation. - -## Synthetic evidence - -Run from a dependency-installed checkout: - -```sh -bun experiments/storage-lifecycle.ts -bun run test packages/core/tests/scratch-pins.test.ts packages/ui-server/tests/inbox-unwind.test.ts packages/ui-backend-claude/tests/transcript-archive.test.ts packages/ui-server/tests/turn-journal.test.ts packages/ui-server/tests/journal-accounting.test.ts packages/ui-sdk/tests/turn-temp-tool.test.ts -``` - -The manual experiment mutates only a newly created temporary Odysseus brain, -bare local remote and operational store, then removes them. It uses the real -packing and journal primitives, local-only Git subprocesses, fixed synthetic -`2026-07-12` content/commit dates and deterministic PDF-shaped bytes. These are -binary lifecycle fixtures, not valid PDF-rendering proof. No service/network, -real corpus, cleanup API or retention change is exercised. - -Observed with Bun 1.4.2, Git 2.55.0 on the local filesystem: - -| Measurement | Before | After removal + other PDF edit + local commit | After existing Git packing | -| --- | ---: | ---: | ---: | -| Current PDF count | 2 | 1 | 1 | -| Current logical PDF bytes | 12,000,000 | 6,000,027 | 6,000,027 | -| Attachment allocated bytes | 12,001,280 | 6,000,640 | 6,000,640 | -| Local `.git` allocated bytes | 6,447,104 | 12,787,712 | 6,447,104 | -| Journal object allocated bytes | 6,012,928 | 12,001,280 | 12,001,280 | -| Local bare-remote allocated bytes | 6,430,720 | 6,430,720 | 6,430,720 | -| Loose object count | 5 | 9 | 0 | -| Objects in packs | 0 | 0 | 9 | - -Both initial PDFs share identical bytes, so Git and journal deduplicate them. -The second gains 27 bytes after preview. Its hash differs, proving stale -selection evidence; the script observes that conflict but does not implement -the future executor. The first loses its working-tree entry while its referenced -Markdown link remains. A retained journal before-version matches all 6,000,000 -original bytes. `rev-list --objects --all` still includes its blob and -`cat-file -s` returns 6,000,000 before and after packing, locally and in the -bare remote. Ref identities are unchanged by packing. There is no remote push. - -The three selected local category deltas after removal sum to a **growth of -6,328,320 allocated bytes**: attachment -6,000,640, Git +6,340,608, journal -+5,988,352. Packing later saves 6,340,608 Git allocated bytes; that is neither -historical deletion nor guaranteed volume recovery. These figures exclude DB, -WAL, other files and filesystem metadata. They are `st_blocks * 512` category -observations on a quiescent fixture, not exact exclusive physical attribution -on CoW/compressed/shared storage, nor a free-volume or remote-quota measurement. -They must not be generalized into a savings estimator. - -The existing six focused test files execute 66 passing cases / 439 assertions. -They demonstrate: ten-day pinned scratch survives while its unlinked peer expires; -missing/corrupt pins suspend deletion; active Claude sessions are excluded after -async metadata; archive/index/restore interruptions preserve session bytes; -a real gated backend after denial keeps staging until unwind/settlement; -SIGKILL recovery settles cost before one cleanup; journal capacity refuses an -initial snapshot and labels later missing observations partial; interrupted CAS -publication remains charged and recovered; and actual turn-temp purge refuses -runtime-state mounts. These are current primitive receipts, not proof of the -proposed storage UI or binary removal endpoint. They do not simulate a physically -full disk for all operations; no-space execution semantics above require future -ENOSPC/crash injection and actual constrained-volume verification. - -Mutation receipt: replacing the archive's post-metadata active-session set with -an empty set makes `running sessions are checked after asynchronous SDK metadata -arrives` fail on `expect(listArchivedSessions(options)).toEqual([])` (one running -session was archived). The original source was restored; the same named test -then passed with both archive-empty and live-source assertions. No runtime -source change is part of this discovery. - -## Design inputs, alternatives and unresolved decisions - -Recommend the first operation set as inspection, existing non-destructive Git -packing, eligible pin-aware scratch prune and lifecycle-owned staging cleanup. -Backend compression remains existing transparent upkeep, with unavailable Pi -support owned by #1637. Runtime `turn_temp` remains scoped to its own admitted -worker. Generic scratch clean, session deletion, workspace sweeping, backup -purge, ref/reflog expiry, history rewriting/force push and broad container prune -are excluded from initial storage actions. - -Prefer an explicit bounded binary content application over assembling shell -commands from user-selected paths: it can bind versions, consequences, journal -coverage and per-file recovery. Ordinary governed agent requests remain available -within their existing policy; this recommendation does not replace that flow or -claim arbitrary shell deletion is a storage API. A trash directory alone is not -a complete alternative: it still retains bytes, needs its own expiry/authority, -and can double storage across filesystems. A plain unlink without a retained -before-version cannot promise Undo. - -Longer-term growth handling should reuse #1780's bounded snapshots and capacity -scopes: show which category is growing and which safe owned action can affect it. -Keep snapshot/receipt storage itself bounded. No alert threshold, polling cadence, -new retention duration, session eviction or backup expiry is selected here. -Packing/compression reduce representation costs; attachments, journal evidence -and backups may continue growing. Capacity provisioning remains a legitimate -outcome when protected content accounts for the usage. - -Maintainer decisions remain explicit for any permanent loss of history, refs, -reflogs, journal detail beyond existing policy, session data or backup evidence. -Such proposals must specify affected copies/remotes, recovery loss, active/read -protections, rollback feasibility and required authority. Changing a retention -default is not approved by accepting this discovery. #1782 owns visible placement, -interaction, responsive/accessibility design and the final reviewed initial scope. - -Proposed implementation slices, for #1782 to turn into scoped tracker work after -review (not a status checklist): - -- **Accounting-to-review handoff:** consume #1780 identities, units, hierarchy, - freshness, known/partial/unknown metrics and distinct volume deltas; add an - operation eligibility/consequence view without changing existing stats. -- **Existing upkeep orchestration:** server-owned authenticated dispatch and - attributable bounded results through current worker/pin/staging owners; - prove live work, revocation, overlap, partial failure and zero-space refusals. -- **Canonical binary removal:** core-supported deterministic selection semantics - and server application/journal receipt integration; exact-version locks, - sidecar/reference policy, retained binary before-version, crash/restart, - mixed-success and stale-safe Undo proof. Stable CLI/JSON/API additions need - their own contract review, changeset and acceptance tests before shipping. -- **Growth and capacity guidance:** bounded history/refresh/cost model from - #1780, honest unavailable/manual operations, no unreviewed retention defaults. - #1637 continues independently; #686 and hosting-template #9 retain recovery - ownership. No concrete additional generated-host change is established by - this discovery, so no speculative hosting issue is filed. - -These slices depend on the existing sibling design issue, rather than creating -parallel deletion policy or archive projects. Closing #1781 supplies evidence -and recommendations; it does not complete #1779 or authorize those slices. diff --git a/docs/process/evidence/browser-input-closure-replay.json b/docs/process/evidence/browser-input-closure-replay.json deleted file mode 100644 index 1dc1646ff4..0000000000 --- a/docs/process/evidence/browser-input-closure-replay.json +++ /dev/null @@ -1,2179 +0,0 @@ -{ - "version": 1, - "sourceBase": "626a03af4a9db064751230a84732755b8afa961e", - "snapshotSha256": "ac31b09adf903d3c9483d5c9be55188010577a113d087d90fd2cea90c404dbbd", - "window": { - "cutoff": "2026-10-16T10:49:55Z", - "order": "number descending, first 100 merged PRs at cutoff", - "oldest": 1741, - "newest": 2071 - }, - "sourceSha256": { - "scripts/browser-input-closure.ts": "01b950bfa3b3174da2f81b9776c5786e4a2009102eef41c4bf19913583d1a1ba", - "scripts/replay-browser-selection.ts": "cb7559c20c678f4a4364e756904f000c6a63b63e49d2b972c80e6c4afc4c108f", - "scripts/ci-plan.ts": "0c1d4b717cc833d5425a12a048f2fb6fdc8f0818dd8ed0e45df157cd46f59e1b", - "scripts/check-pr.ts": "91ed2ac967d2e8241eca2513f07129b7af2e89f10c13d708ef30111bba360001", - "packages/ui-kit/tests/proof-inputs.json": "70253abfa88198b9262e3b8310ebf3c7360e65cc1375a77690fc50b2e7a5190e", - "scripts/captures/proof-inputs.json": "858ae956418048a354e7e18fcc3c15fe29779c5871340de6659f8acfecb073e1" - }, - "fullDiagnosticSha256": "12367004e3eeb7bec15326d17e5ce458bd7d07812f2f5ae0612943b51891c41a", - "browserBefore": 85, - "browserAfter": 85, - "noLongerBrowser": [], - "limits": [ - "Current planner over immutable historical changed paths, not historical-source execution or elapsed speedup.", - "Closure hashes describe graph structure and diagnostics, not source byte identity or passing-proof fingerprints.", - "Actual configured dispatch fixture reaches every current server route.", - "Unresolved runtime config/module/backend dependencies preserve the broad category.", - "Exhaustive actual-merged-SHA browser-domain proof remains required before issue closure." - ], - "domains": { - "browser": { - "files": 1239, - "directories": 16, - "unresolved": 721, - "closureSha256": "faac35cb6a39499adedb1fa0ac40ae801e534c40eb0ebeca3086eb0171af342d", - "runtimeVariableExamples": [ - "Computed import packages/core/src/lib/config.ts: import(tsPath)", - "Computed import packages/core/src/lib/module-loader.ts: import(specifier.startsWith(\"/\") ? specifier : Bun.resolveSync(specifier, root))", - "Computed import packages/ui-server/src/agent/backend.ts: import(specifier)" - ] - }, - "layout": { - "files": 1108, - "directories": 16, - "unresolved": 715, - "closureSha256": "daa333bd7c3e4820ac05c572f2053e88180adee19fc7735b9493406f5acc030d", - "runtimeVariableExamples": [ - "Computed import packages/core/src/lib/config.ts: import(tsPath)", - "Computed import packages/core/src/lib/module-loader.ts: import(specifier.startsWith(\"/\") ? specifier : Bun.resolveSync(specifier, root))", - "Computed import packages/ui-react/tests/browser/error-boundaries.layout.tsx: import(/* @vite-ignore */ `${location.origin}/__missing-chunk-${Math.random().toString(36).slice(2)}__.js`)", - "Computed import packages/ui-server/src/agent/backend.ts: import(specifier)" - ] - }, - "endurance": { - "files": 883, - "directories": 16, - "unresolved": 713, - "closureSha256": "b910ea8787757faa190f2a5b6a565357c295708c677f1c492fd10fbc77d6b4e8", - "runtimeVariableExamples": [ - "Computed import packages/core/src/lib/config.ts: import(tsPath)", - "Computed import packages/core/src/lib/module-loader.ts: import(specifier.startsWith(\"/\") ? specifier : Bun.resolveSync(specifier, root))", - "Computed import packages/ui-server/src/agent/backend.ts: import(specifier)" - ] - }, - "captures": { - "files": 1020, - "directories": 40, - "unresolved": 720, - "closureSha256": "2977e46ba3b13060331fe248dd648eb53452eade51bea0bde72ed10f69972bac", - "runtimeVariableExamples": [ - "Computed import packages/core/src/lib/config.ts: import(tsPath)", - "Computed import packages/core/src/lib/module-loader.ts: import(specifier.startsWith(\"/\") ? specifier : Bun.resolveSync(specifier, root))", - "Computed import packages/ui-server/src/agent/backend.ts: import(specifier)" - ] - } - }, - "plans": [ - { - "number": 2071, - "mergeCommit": "53258a203d37ab32ae211c5f645cb32e2b3898d1", - "changedSha256": "e989d0e8ac7f40a330b537843fe6ac95f808ce08cf95565b78868786af0a50ed", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2060, - "mergeCommit": "fec9a379da878c59d2e7577c6c940dc6ee5d4a03", - "changedSha256": "00a2f4b118adeddaf751426478d9ad4f7779cc146ff21ea1c65421640d6be68b", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 2057, - "mergeCommit": "44a8ab0be7e48a73f61bc794e65ea3f8e84e4289", - "changedSha256": "f18072450df46facc9b08ea91f5dca2653bf8702829767d43ae351249b3a8a0d", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2044, - "mergeCommit": "b8be3819e93fa3bd60f7dd990030775716c5bdce", - "changedSha256": "8436533a26c91ffa556f2d44a4e7ace43e905fd0b844844f21a366b73c16a5d6", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 2043, - "mergeCommit": "d194625395eb200f68d1ec05bc27f262ba75579c", - "changedSha256": "51f22f4207cc5f45fc339a1ea1ebb4a83b6581763b5cecebe118bf549a124d5a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2020, - "mergeCommit": "65ed23dc942ecaccbe86ae1beb4af6eeb3ad3eb5", - "changedSha256": "fba20c723e25304f0068feee8e1c457e7787a6ab974280e80b9c21d3074cd0e9", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 2019, - "mergeCommit": "abe5086df48883bc270a36edb127b05519398332", - "changedSha256": "6d76bb31f46f8645eb6ebfe413387779629050ea74332b6e843ac28c12985606", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2018, - "mergeCommit": "ed6b0c5f09ada1b6f899bf245f3f1b176352bf77", - "changedSha256": "a493ded98aeb9b6667d143438872ea3724c05afb5f201b42437851e4171a7cbd", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2017, - "mergeCommit": "493127587508f305db86e1a1db2d042fa666845b", - "changedSha256": "635d6d5e55eb2cd896f6de1acea89980203f9fa810f2fd1206a32a4f29bdc622", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2015, - "mergeCommit": "9fc02d5fc5a7f62f13063c04ce68b3cbe12948c9", - "changedSha256": "636d60de9212826acddf905eedab11bfd36ae6001d2d5a8edd37f1e6ab9eb270", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 2008, - "mergeCommit": "11655e165474578801b7a2425f0f4a070419157c", - "changedSha256": "f3214057139552383870e77f77a20a2f13f047d47f6ab7998bdfa80c3702404c", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2007, - "mergeCommit": "04ef3552190d8f56eab09dd6c3580101b6385ba4", - "changedSha256": "44a184a6c6ca2101669da04b92fca4d3522c65e4b1d121ab0c0c44d8a6a2f24d", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 2006, - "mergeCommit": "5e9854b2e53ab7cfb4364008cf9cd2065b369404", - "changedSha256": "0f94e198ae00f929befbe13d43042483a88486f81fcd9038457691e3724a9a31", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2005, - "mergeCommit": "ab0e9fb77a236cefbe5a0b19424836acf9205bde", - "changedSha256": "af6b3222ad189f0a4a7eee22f0cf4a519844aca3a3f89c9daa7e9979e523fff3", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2002, - "mergeCommit": "4e4a663f98054d86f2dc90154b42ffbe8f8b7692", - "changedSha256": "56cf24fb32062e4ff19270ccafa67bbbfbcba8dd077e982a283acffb23ff6e61", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2001, - "mergeCommit": "9cf4aa5f37a33d40f53f783ecd0e8344f920f9ec", - "changedSha256": "cf5001238a3596c6b824ffecc8100bdf656921a96bb8480014b434f8f7a216c4", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 2000, - "mergeCommit": "45908608df63b07ee3d10d84ac608d132aa21caa", - "changedSha256": "e6fa3a4a3730fee65387aa66b37842f2739479237258c36636d4d31cab424f6e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1998, - "mergeCommit": "6863804ef9095cc0b984fed8d8e0ba4c3c9e93c1", - "changedSha256": "f40e25b26ea597cd88dadab03644a30942f272900a74b5405be6f60dff6d09dc", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1995, - "mergeCommit": "61399d103bd59445c6d4dfa183173ba12bbf0f4e", - "changedSha256": "d23a1f3a0d6b2e19e361840d04a370e443416e6adda639bcbfbf51433a952ee4", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1994, - "mergeCommit": "d9ac37b82700d7b45406ba47c0850ae46251fa9b", - "changedSha256": "cf4a0ad080e8b83f67390aa6656deb9697fda4bdc8bcb67ed97864d3ec8aaf9d", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1992, - "mergeCommit": "090c8a5463effe6811742259bc27af2b5ff6e66c", - "changedSha256": "91c73d73da9281b69997f40c6a16f2db666629610c51ee51dacfdc43e6229321", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1991, - "mergeCommit": "74d48eaafc1921032f8027efc082a0e3319408b4", - "changedSha256": "14e88cbf81dbe04b32bc6dea886632a7374b83cafefb2b56634812513ab6135d", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1986, - "mergeCommit": "b4609b961084268309287fff807b1dbd2687d607", - "changedSha256": "06e9e20b1fd6798e6d7b4974e970b8276493080e7a06ceafe9d457a338ce62ab", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1985, - "mergeCommit": "9274b8a06db43932e17b5d401fcfb900306e97cd", - "changedSha256": "8374e1e353cd81a3982e66aee8fee8318b777b20dc04313f901de40c25fe3cab", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1984, - "mergeCommit": "131f3a7d70c829bd27a3fa8ddac9fda0261918b9", - "changedSha256": "a7765712ca24e832b6c8f5177667e6357a084794593f059d1147869474c8d598", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1983, - "mergeCommit": "c857a5db365b7725df24f0c00be8dd082fb68794", - "changedSha256": "af6b3222ad189f0a4a7eee22f0cf4a519844aca3a3f89c9daa7e9979e523fff3", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1981, - "mergeCommit": "e75f9af2ee058b3e43059d92daf78064db467fe2", - "changedSha256": "1a96294a6c41161b5c46b8327a3afc2b68b30dbc43bfc1ccc98dad2b8af37f5a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1979, - "mergeCommit": "cbf2bb87f8eee79f971099aa4858262888f087ae", - "changedSha256": "013163e724ddc1a1bdd493ddea5d39de01fcced0fa4644d5f5161a703e33f61e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1977, - "mergeCommit": "82c1f211ee2ebabf44ed819e4a6bae47c93fca51", - "changedSha256": "78d43f852ccf8946c7e4b76ab223043d4d24f18f8a49f2d746a5af3413cadcaf", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1972, - "mergeCommit": "9355d1bd6ec91915e07aff184080bd48bb85fc2c", - "changedSha256": "40a32fb17a8bd96c2dbf96927e2a84f49f275809a27652d753faa26c598514a1", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1968, - "mergeCommit": "66c370b54e65151c6b56a0466347b609b31571b1", - "changedSha256": "a441049cf9a005ca65c07d3ee1095cc6b392efff0828a56c136832ae9ba3521a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1966, - "mergeCommit": "f2e0fcee7de537c26e218bbc0b7c508c54da76b6", - "changedSha256": "c720f7e2ffb3a7c3a1115ec8b4849a10b89b2bffaeb647b207ad5954d841f708", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1965, - "mergeCommit": "7139f116d1994cac9d47a4c59356c9f220c61f47", - "changedSha256": "cba6a12cdd6b9b33ed79578f1b10075e9b2bd98e1277d785a40a50f302aee2a3", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1964, - "mergeCommit": "3100afa2b8efa25ea31114cdee1f2a89a48dd013", - "changedSha256": "097395eb907d8fe7294cec46e5d0092924cf6c3ec52d4f2284b9ce0d27877a04", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1963, - "mergeCommit": "838f05d2ff611c72bdea8405c46f2504dccb6f24", - "changedSha256": "7394bd61d837089a868af71a79188376613e74f551c3393a331a2063bc03c9c8", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1962, - "mergeCommit": "9bebef7bfed47139792ccaf1d22d4ac7f5f093e9", - "changedSha256": "1bca5bab89e6b4817ced0ee882b6a5e9acf2f2d6ab3fd206192ced648490883c", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1961, - "mergeCommit": "1cc1b34a802f0894391b9bb445fed39fed610230", - "changedSha256": "955a65aa243d01b4c670e90c02a1135660075a1f774b5dad41c3ff1003791f97", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1960, - "mergeCommit": "c95223333a83fd3049749a2e68fb0c07963b7ba5", - "changedSha256": "cf3e5b0cb6adcd95fe5b12fbf586ee40642f95dcde23e02ac07834f14dbdc800", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1959, - "mergeCommit": "1b2a2e816effe05f4e4c69bb0df94afc2f648061", - "changedSha256": "5d31fc44944b55ddeb4695164b4218a6aa20193d58283695e0fbfffefd79e410", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1958, - "mergeCommit": "6090132d964c8ccde4ee43fc5e85382f7ac40640", - "changedSha256": "eef391e71aaaf9f49d6decd26ef6ac3d3a4ddddd91d47e41428f87584b455320", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1957, - "mergeCommit": "95b951aa122424f7d171d16ca16b3cc94f8c8545", - "changedSha256": "f40dd8c8b500805a9eec2aa2b4ee64e8c31e190c30fc3bbcbb7ca675bc8415dc", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1955, - "mergeCommit": "bb4578a71953ed8130c9d6a8a929e75f1530d4fd", - "changedSha256": "f53837c7796d2627dad4c3a09d2fa795ef4b89d93e784d54e09254e8327d2f0d", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1954, - "mergeCommit": "5c453d865d55993c86861da3f428d324405bf506", - "changedSha256": "bcc15e9a6bcc21a6080590302fc5ed779914d26feb9d6bb414ce903bd423e8b3", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1953, - "mergeCommit": "085d8ccf4a76f58b48640800ee9e86cb573aa2be", - "changedSha256": "70a49820709611210f26de5c9081563b563b03a416c0142bfff453fc26cb0635", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1952, - "mergeCommit": "0c68c2b2c9c06e3f0bdc6a52577d3ce66710f49c", - "changedSha256": "9e9e8392b948811dd9788e4e16057afc39db9d8d1671d0de4e87698fb3cbd66e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1951, - "mergeCommit": "4db852bb7482877d2e72eb3d23078bdd591023cf", - "changedSha256": "e2754efa5ba393a898627340d4324b86f915a507d0005fc3317ab4b13a2b3b63", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1949, - "mergeCommit": "c40200d920353a3a158c9a577bdfbce26751bf68", - "changedSha256": "e037618c2b70b6275cb8ec8e16ad7167e3e6a430fbfca7c786b76a982c8ccee6", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1941, - "mergeCommit": "400c50ed231f33eeca875ec9223b24ad535b2b22", - "changedSha256": "eb5642fb7aa190d0f46d1019d4cec8cb474d1224e55e1ad42b3293a21434d84e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1934, - "mergeCommit": "cc3fa3a209e0f7f6d9a0ac33778e514fcff69f07", - "changedSha256": "6c8e12ca63f24e2f23bb829b99fad3f0bd9a62902fa9f014d731ed75465cc423", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1932, - "mergeCommit": "f691c5b62a0ffcca67bedfee0be6557631d0930d", - "changedSha256": "448cff054b0b23ede4d56deac65a5607766aa8504fce3ca7f8e7b6933f78cee9", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1930, - "mergeCommit": "615b97f50e7a22a011b31839f04e17c6ccd20f10", - "changedSha256": "0f8a8e2c98645a18af60b8da4c0b391e3af1eb3d1de8fb003c05170ea14c3476", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1928, - "mergeCommit": "155dffdd8237a1543da3109f3de0b659cfac5c93", - "changedSha256": "7804baf77791a1cf2965d7ad926f165255fdaa93c6c93dd97cbcb3a4707c384f", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1927, - "mergeCommit": "21b1527b9eb235d3f5c82ec8d1a945fb36d57cdf", - "changedSha256": "fc3be35721726cf451d2967e1237576221fd4a3ef7c267049e841fb89dd4bb94", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1926, - "mergeCommit": "43c6b9a96fe230504ae4adb6c33eb72283778ec7", - "changedSha256": "9c7c1e53fe0a53bc354e2cec724acd13451152cba27da49b30910d26c9196a31", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1924, - "mergeCommit": "26d972ad066d5ecde72222942e8ffe5d28e647d7", - "changedSha256": "a27efbcf7a695f860d78ca6744a7433f67c5be6ef7b08d44a00ce60db1c39a51", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1923, - "mergeCommit": "d83e4381a2f9a84245b7bf176e3f09d065301937", - "changedSha256": "b75393d0be603898d97af29834d14a3133d47b36ce12d5fa6f9df5a2a35ba9a3", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1920, - "mergeCommit": "009e45714701844a632101a181be2d5e8d66afbb", - "changedSha256": "80a1a47b0dc2f19ba630f9278ded33249b313c0de0e8cd09b67d20e65ebcf262", - "before": { - "fullTests": true, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": true - } - }, - { - "number": 1916, - "mergeCommit": "5fd5c24810dd5fdecea1bc378bfed7155b9cd911", - "changedSha256": "7470e8ec939281988e9c47722e73ede27ac2df869765ff702837c4c635e7b811", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1914, - "mergeCommit": "cf18e810c5c60a1b10f67ba0ee28f7e0cbf0502b", - "changedSha256": "e119957872105155d208d50cecc0fe1cbe3f15d0938f200931aebfb520d4040a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1911, - "mergeCommit": "58f572c4d2f86fe55d76ff053fb315b83e549158", - "changedSha256": "052d270db26065c391854342ecde4bad4ae23935f1ae60bdd73025107f6d66c2", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1909, - "mergeCommit": "200efc8d4e5e2ef6bd7c5385440a9289bd14c774", - "changedSha256": "9e1d8162380b17ebdf344b671f790f247d3502daab94a598a3a430bbe2b49f5e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1908, - "mergeCommit": "932d2b3066a34f725531b70ef108cc6c05a0b5ae", - "changedSha256": "77608a2bbed39dd0fd246f350d152c781120a676df593d32393a6637ac5927e2", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1907, - "mergeCommit": "603a754b9e229f9b96c1aaf2b18917374b6483b0", - "changedSha256": "1d1a85f8b619a2168d7522330e37e6c601e7ccaee1585de57623d82ce18e4039", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1906, - "mergeCommit": "5d1580e74c991941397c46bacb60d2cfe8cfb2f3", - "changedSha256": "fc738f4292af0cf7b4b7bc14d6146c2c5634eca7bec062628adcfcf92dd80577", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1905, - "mergeCommit": "52f85a1721910ca560fce38cf47eb3096ae97562", - "changedSha256": "32a2f7f370622e4c2f5a13dbacc226952f8a5fc4bd7818006811b60c72d7e2f4", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1900, - "mergeCommit": "4bcfb45135e4191dfd8a009a48805f319ffb6822", - "changedSha256": "4e5bc589fe8b0e0bdbf1f38fd807a8e381827507d3283dc77ddec0c63e0e30da", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1899, - "mergeCommit": "fb219e069a8afd7fbc5eac6524b7a77ec08a7560", - "changedSha256": "f02f194cb5524840cd8653f8a5bb8090f1d7013380a4f08fa682e98d15b5359a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1896, - "mergeCommit": "d2b4cf941498d1276deee8acf42f411b7d1c8090", - "changedSha256": "ad758479cb0dec8343492da236e2019f2958a16acc2c04311be717806b2ea544", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1893, - "mergeCommit": "fd8f030f5e90f5cd3d3ab4aaa40f25fb64f328f8", - "changedSha256": "871634cc945a458bf8501d59b11adec4a0df428a2f2f6a99dbd282625ee7dcf2", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1892, - "mergeCommit": "f48c83d613ca63400f5e384373fdd81992b33de8", - "changedSha256": "45a1ddb5cdb14d4e302f33a29c2909940ebb685ea6e635a63e4e9f6eafe99cc1", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1891, - "mergeCommit": "d08bbf8be72f4143aaa28e9a22d53524968d50f2", - "changedSha256": "ac6928c934fd068493737ec2233c4454c0f98846d3f11938ad780290059d7e09", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1888, - "mergeCommit": "f6f5c713b2c52b400a5d34fc1d04120d3ea54107", - "changedSha256": "455f6e410e87fa19660a8fa3839fd1fe0b9762ea96e9344e97b9ad2aaa22c1d2", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1886, - "mergeCommit": "d6ad60a26119978e70a5ad1f1dbcb8fbbf3a9fae", - "changedSha256": "7c121326430307bcec00f177b2a27ad513bdccac8bfc15a17c579c263bdca887", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1882, - "mergeCommit": "25899b1e5829b9d7593ed56e2ae3f6fe271b72f0", - "changedSha256": "5032c1b3cb2afbc6b45932a5e1065094d61e63c59928fa5ca38e1030225faa99", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1881, - "mergeCommit": "04a659593379a0c8da9c049fa649124d6fd54f70", - "changedSha256": "3c733e80d84f90906b3a6cd52e533a39c3efed2979a4ee19886122ade149d64e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1880, - "mergeCommit": "a754ad02273beb2625d5bce528149028243528cf", - "changedSha256": "5ef56b1555f466f462b2b9186da71a27060b86da0e28b09565e8d3846910a935", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1879, - "mergeCommit": "210b35c52259454952a060644980aabd83c64e7a", - "changedSha256": "ea2aef27aa99ac99c43f983e7b2fd047854c6b3ca9119b94811fd6f47548b24d", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1878, - "mergeCommit": "c68bd6965e381c2a35478e555882b84894a84985", - "changedSha256": "c26bb5a59788325a2338bcfc0d6bbea61fb71a0351d80cc0a27089e7bc0948fd", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1876, - "mergeCommit": "08b4f15fc494749349c94c8352b9c6ae824faa89", - "changedSha256": "772e845be50549f741177714ad2e446789b87fd75c4247f54baa5a37209f8383", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1875, - "mergeCommit": "1a217d72295c66edd7c2b759f2c6a761f8c0a8da", - "changedSha256": "3a74add63094d95606bddf2c4da002f4e6d3d0b9a60881cea59fd884c8b189ce", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1874, - "mergeCommit": "27a368b6ed7c8e80b33613da0c33af6776d74f75", - "changedSha256": "049963ce4d25a3c98db179ea62a2c46f1c1bcf5e2ab7912d07e7354ccb72a956", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1864, - "mergeCommit": "ca1facc1e7086bd2119c260150e9f091e16817f1", - "changedSha256": "16c931daf9b32e247d107f921cabb49ea76c538ce0e767c87a69b70c9286699a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1862, - "mergeCommit": "5af94530672aec0999c571b3f8774a71f4f97729", - "changedSha256": "76023b6364be16775a70e78c5331f7b64bc7d8a651ed27f230dd73f28de3665b", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1861, - "mergeCommit": "2f244e2c2e31b4ce9cc489601430a3dd94f9088b", - "changedSha256": "af0d9bf2843fa785541922ed3cf289f9231aaa7c3c86863baa5d19032d465efa", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1860, - "mergeCommit": "4317fab88eeb550d4c12248ac4ebcc3d087f53e1", - "changedSha256": "149bfa207911c91ed7b6a5755f8da5d3c9ebadb5a4728882f33023581b6c0fba", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1848, - "mergeCommit": "5869996f186dd730b4dc56e8bea60664a04aa232", - "changedSha256": "dd24bbc0a5a3108a7145d39de74b084b46164fca09a68f3eeb2f0f15eb3bcc06", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1839, - "mergeCommit": "5dc2595ca07042f2e2024c95bbc361f31637559f", - "changedSha256": "3df892bb2e10d70913afb8f417a52b70c6d0ca034f736003e8c0fbadf6e2ed7d", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1832, - "mergeCommit": "5cf1d548f7bd3a314eb36394dc5db0268db97da6", - "changedSha256": "d0c05b100253fcbe49962a159c54fdb3b2e6b4630eb1375921172955e6f1fde3", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1793, - "mergeCommit": "4af7b2f20a43d23260c2ee5e3bac3896aee971bd", - "changedSha256": "b0d30f9eb2724539f556d35defcc08f79c01589b880034bb9658e6e4251a4460", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1789, - "mergeCommit": "79d54278f1b2f35e929f4c6f182089360ab7759f", - "changedSha256": "19fccb02e86d9a7f3cf42b5085ac101eee73ab5b712e0d89950b532fd70838f9", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1786, - "mergeCommit": "2ea27697850dfffe956f2aa8471a720ea738f2bb", - "changedSha256": "e8c7157618d5c970b8fa547fe8c03a200ad90d38da45f7058a7f586a4d534215", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1785, - "mergeCommit": "1ed6e3d431fac8fa28c217d695a8ab412dd22fe4", - "changedSha256": "8403797dca35ff0a177a0bb3401bc17910bbdc584c31574d5a9e7ca60e2c9e12", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1784, - "mergeCommit": "42cfc0eaa24464d3c165ca62a800a45a3e16b6ce", - "changedSha256": "79cb6b1ad4a580f177f4a5aca462636068dd3a868528de7d43c1b1ed03b812b4", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1776, - "mergeCommit": "665bf5e4e7dca4fcaba5e9cf6b341fbef95c9f4c", - "changedSha256": "e474496fdf7ca5f9076f45886d4125fa1635ff3a00eba7bebf5654a7b352af75", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1769, - "mergeCommit": "f2c98da6093c9e1731f061625ba7302f51bf7340", - "changedSha256": "452f2e4e597621bdc3b69b3a4bfcdad45e19895a6e41183bdea23f6dc0049c56", - "before": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - }, - "after": { - "fullTests": false, - "browser": false, - "layout": false, - "captures": false, - "endurance": false, - "runtime": false - } - }, - { - "number": 1761, - "mergeCommit": "7bb7e0ccb0fd660bbdd6019773951ad54d205b38", - "changedSha256": "026f93c01f16c8e89b5f1e5bd349f6f53e715e260b9acd8eef739a63a681389a", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1753, - "mergeCommit": "857ab01d1f9cb591f928755f5be516ab7f73338e", - "changedSha256": "ba6245dcc114827820f35eab507c93a5e3baea87696f42f8a44c3451014e35ed", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1748, - "mergeCommit": "f5433b33e5ed5f8b280049909e3577783cc72953", - "changedSha256": "837403a6cefd787d1d3eaf06110e3f94b0f01bcb3fae682d34efcd68e4da0f8b", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1747, - "mergeCommit": "52cbd1db182b618706cd7edca72159ba62768a63", - "changedSha256": "96809deb0cdc0bc5242523f792fa87461ea6eeed79f566abf6078510fd82b004", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - }, - { - "number": 1741, - "mergeCommit": "185803c4a67e1074a06007c88402cd3fdcfee0c2", - "changedSha256": "ab69a14408b95fec6c78791d7d7cfe2fd8769b7364a891c78ba5be6de7e0e45e", - "before": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - }, - "after": { - "fullTests": true, - "browser": true, - "layout": true, - "captures": true, - "endurance": true, - "runtime": true - } - } - ] -} diff --git a/docs/process/evidence/independent-test-replay.json b/docs/process/evidence/independent-test-replay.json deleted file mode 100644 index c22d0fc330..0000000000 --- a/docs/process/evidence/independent-test-replay.json +++ /dev/null @@ -1,1375 +0,0 @@ -{ - "cutoff": "2026-10-16T10:49:55Z", - "ordering": "descending PR number among merged-at-cutoff,100", - "inputNumbers": [ - 2071, - 2060, - 2057, - 2044, - 2043, - 2020, - 2019, - 2018, - 2017, - 2015, - 2008, - 2007, - 2006, - 2005, - 2002, - 2001, - 2000, - 1998, - 1995, - 1994, - 1992, - 1991, - 1986, - 1985, - 1984, - 1983, - 1981, - 1979, - 1977, - 1972, - 1968, - 1966, - 1965, - 1964, - 1963, - 1962, - 1961, - 1960, - 1959, - 1958, - 1957, - 1955, - 1954, - 1953, - 1952, - 1951, - 1949, - 1941, - 1934, - 1932, - 1930, - 1928, - 1927, - 1926, - 1924, - 1923, - 1920, - 1916, - 1914, - 1911, - 1909, - 1908, - 1907, - 1906, - 1905, - 1900, - 1899, - 1896, - 1893, - 1892, - 1891, - 1888, - 1886, - 1882, - 1881, - 1880, - 1879, - 1878, - 1876, - 1875, - 1874, - 1864, - 1862, - 1861, - 1860, - 1848, - 1839, - 1832, - 1793, - 1789, - 1786, - 1785, - 1784, - 1776, - 1769, - 1761, - 1753, - 1748, - 1747, - 1741 - ], - "scope": "Historical merged source replay; planning results are not runtime speedup measurements.", - "results": [ - { - "number": 2071, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 8 - } - ] - }, - { - "number": 2060, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 2057, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 2044, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 2043, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 2020, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 2019, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 8 - } - ] - }, - { - "number": 2018, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 4 - } - ] - }, - { - "number": 2017, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 9 - } - ] - }, - { - "number": 2015, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "prose only", - "inputCount": 0 - } - ] - }, - { - "number": 2008, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 2007, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "prose only", - "inputCount": 0 - } - ] - }, - { - "number": 2006, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-renderer-phase-clock.json", - "packages/ui-render-puppeteer/tests/phase-budgets.test.ts" - ] - } - ] - }, - { - "number": 2005, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 2002, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 2001, - "briefCandidate": false, - "qualifies": true, - "merge": "9cf4aa5f37a33d40f53f783ecd0e8344f920f9ec", - "unitTests": [ - "tests/browser-shards.test.ts", - "tests/candidate-proof.test.ts", - "tests/changeset-gate.test.ts", - "tests/ci-pack.test.ts", - "tests/ci-plan.test.ts", - "tests/ci-runner.test.ts", - "tests/ci-workflows.test.ts", - "tests/contract-gate.test.ts", - "tests/decision-citations.test.ts", - "tests/dependency-edges.test.ts", - "tests/export-native-rejection-runtime.test.ts", - "tests/frontmatter-parse-gate.test.ts", - "tests/hosted-proof.test.ts", - "tests/local-checks.test.ts", - "tests/lockfile.test.ts", - "tests/measurement-fixture-lifetime.test.ts", - "tests/proof-inventory.test.ts", - "tests/proof-reuse.test.ts", - "tests/release-manifest.test.ts" - ], - "categories": { - "fullTests": true, - "browser": false, - "layout": false, - "captures": false, - "runtime": false, - "endurance": false - }, - "reasons": [] - }, - { - "number": 2000, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1998, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1995, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1994, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1992, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "prose only", - "inputCount": 0 - } - ] - }, - { - "number": 1991, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 4 - } - ] - }, - { - "number": 1986, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1985, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 7 - } - ] - }, - { - "number": 1984, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1983, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1981, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 5 - } - ] - }, - { - "number": 1979, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1977, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 6 - } - ] - }, - { - "number": 1972, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1968, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 11 - } - ] - }, - { - "number": 1966, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1965, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1964, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 29 - } - ] - }, - { - "number": 1963, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1962, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1961, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 7 - } - ] - }, - { - "number": 1960, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-html-download-completion.json", - "packages/ui-react/tests/html-preview-runtime.test.ts" - ] - } - ] - }, - { - "number": 1959, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1958, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-browser-pacing-completion.json", - "docs/process/evidence/test-wait-browser-robots-completion.json", - "docs/process/evidence/test-wait-search-deadlines.json", - "packages/core/tests/search-reliability.test.ts", - "packages/scrape/tests/browser-politeness.test.ts" - ] - } - ] - }, - { - "number": 1957, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-html-form-boundaries.json", - "docs/process/evidence/test-wait-html-popup-boundaries.json", - "docs/process/evidence/test-wait-html-top-boundary.json", - "packages/ui-react/tests/html-preview-runtime.test.ts" - ] - } - ] - }, - { - "number": 1955, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-html-navigation-boundaries.json", - "packages/ui-react/tests/html-preview-runtime.test.ts" - ] - } - ] - }, - { - "number": 1954, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-agent-runner-observations.json", - "docs/process/evidence/test-wait-consumed-draft-completion.json", - "docs/process/evidence/test-wait-consumed-draft-observations.json", - "docs/process/evidence/test-wait-index-observations.json", - "docs/process/evidence/test-wait-maintenance-gates.json", - "docs/process/evidence/test-wait-politeness-boundaries.json", - "packages/ui-react/tests/draft-client.test.ts", - "packages/ui-react/tests/draft-runtime.test.ts" - ] - } - ] - }, - { - "number": 1953, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "docs/process/evidence/test-wait-native-child-observations.json", - "packages/ui-react/tests/html-preview-runtime.test.ts" - ] - } - ] - }, - { - "number": 1952, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 45 - } - ] - }, - { - "number": 1951, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1949, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1941, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 47 - } - ] - }, - { - "number": 1934, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1932, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 20 - } - ] - }, - { - "number": 1930, - "briefCandidate": true, - "qualifies": false, - "merge": "615b97f50e7a22a011b31839f04e17c6ccd20f10", - "reasons": [ - { - "file": "packages/ui-kit/tests/ghost-text.test.tsx", - "reason": "tracked basename references", - "references": [ - "docs/decisions/design-kit/loading.md", - "docs/process/evidence/test-wait-native-observations.json", - "docs/process/evidence/test-wait-operational-basis.json", - "docs/process/evidence/test-wait-sites.tsv", - "docs/process/test-waits.md", - "packages/ui-kit/src/tokens.css", - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json", - "tests/dom-global-restoration.test.ts" - ] - }, - { - "file": "tests/dom-global-restoration.test.ts", - "reason": "tracked basename references", - "references": [ - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - } - ] - }, - { - "number": 1928, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1927, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1926, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1924, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1923, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 35 - } - ] - }, - { - "number": 1920, - "briefCandidate": true, - "qualifies": false, - "merge": "009e45714701844a632101a181be2d5e8d66afbb", - "reasons": [ - { - "file": "packages/scrape/tests/client.test.ts", - "reason": "tracked basename references", - "references": [ - "docs/decisions/experiment-tier.md", - "docs/decisions/runtime-requirements.md", - "docs/http-api-coverage.md", - "docs/process/evidence/test-wait-sites.tsv", - "docs/process/test-waits.md", - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - } - ] - }, - { - "number": 1916, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1914, - "briefCandidate": true, - "qualifies": false, - "merge": "cf18e810c5c60a1b10f67ba0ee28f7e0cbf0502b", - "reasons": [ - { - "file": "packages/ui-react/tests/association-signout-runtime.test.ts", - "reason": "tracked basename references", - "references": [ - "docs/process/evidence/test-wait-observations.json", - "docs/process/evidence/test-wait-sites.tsv", - "docs/process/test-waits.md", - "docs/process/theme-parity.md", - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - }, - { - "file": "packages/ui-react/tests/turn-journal-runtime.test.ts", - "reason": "tracked basename references", - "references": [ - "docs/http-api-coverage.md", - "docs/process/evidence/test-wait-observations.json", - "docs/process/evidence/test-wait-sites.tsv", - "docs/process/theme-parity.md" - ] - } - ] - }, - { - "number": 1911, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1909, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1908, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 95 - } - ] - }, - { - "number": 1907, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 42 - } - ] - }, - { - "number": 1906, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1905, - "briefCandidate": true, - "qualifies": false, - "merge": "52f85a1721910ca560fce38cf47eb3096ae97562", - "reasons": [ - { - "file": "packages/ui-react/tests/connection-continuity-runtime.test.ts", - "reason": "tracked basename references", - "references": [ - "docs/process/evidence/test-wait-sites.tsv", - "docs/process/test-waits.md", - "docs/process/theme-parity.md", - "packages/ui-react/tests/reconnect-reattach.test.ts", - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - } - ] - }, - { - "number": 1900, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 5 - } - ] - }, - { - "number": 1899, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 17 - } - ] - }, - { - "number": 1896, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 6 - } - ] - }, - { - "number": 1893, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 6 - } - ] - }, - { - "number": 1892, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 21 - } - ] - }, - { - "number": 1891, - "briefCandidate": true, - "qualifies": false, - "merge": "d08bbf8be72f4143aaa28e9a22d53524968d50f2", - "reasons": [ - { - "file": "packages/ui-react/tests/draft-client.test.ts", - "reason": "tracked basename references", - "references": [ - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - } - ] - }, - { - "number": 1888, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 13 - } - ] - }, - { - "number": 1886, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1882, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1881, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 45 - } - ] - }, - { - "number": 1880, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1879, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 5 - } - ] - }, - { - "number": 1878, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1876, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 2 - } - ] - }, - { - "number": 1875, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 4 - } - ] - }, - { - "number": 1874, - "briefCandidate": true, - "qualifies": false, - "merge": "27a368b6ed7c8e80b33613da0c33af6776d74f75", - "reasons": [ - { - "file": "packages/ui-react/tests/tracker-runtime.test.ts", - "reason": "tracked basename references", - "references": [ - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - } - ] - }, - { - "number": 1864, - "briefCandidate": true, - "qualifies": false, - "merge": "ca1facc1e7086bd2119c260150e9f091e16817f1", - "reasons": [ - { - "file": "packages/ui-server/tests/inbox-snapshot.test.ts", - "reason": "export token" - }, - { - "file": "packages/ui-server/tests/inbox-snapshot.test.ts", - "reason": "tracked basename references", - "references": [ - "docs/plans/async-collaboration.md", - "scripts/test-shard-costs.json", - "scripts/unit-shard-observation.json" - ] - } - ] - }, - { - "number": 1862, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 24 - } - ] - }, - { - "number": 1861, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 7 - } - ] - }, - { - "number": 1860, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 4 - } - ] - }, - { - "number": 1848, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 25 - } - ] - }, - { - "number": 1839, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 22 - } - ] - }, - { - "number": 1832, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 3 - } - ] - }, - { - "number": 1793, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 70 - } - ] - }, - { - "number": 1789, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 20 - } - ] - }, - { - "number": 1786, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 14 - } - ] - }, - { - "number": 1785, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1784, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 1 - } - ] - }, - { - "number": 1776, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 100 - } - ] - }, - { - "number": 1769, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "prose only", - "inputCount": 0 - } - ] - }, - { - "number": 1761, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 28 - } - ] - }, - { - "number": 1753, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 53 - } - ] - }, - { - "number": 1748, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 53 - } - ] - }, - { - "number": 1747, - "briefCandidate": false, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputCount": 62 - } - ] - }, - { - "number": 1741, - "briefCandidate": true, - "qualifies": false, - "reasons": [ - { - "reason": "non-test changed inputs or root test inputs", - "inputs": [ - "bun.lock", - "packages/common/package.json", - "packages/common/src/governance-policy.ts", - "packages/common/src/protected-paths.ts", - "packages/core/src/cli/brain.ts", - "packages/core/src/cli/commands/index.ts", - "packages/core/src/cli/commands/policy.ts", - "packages/core/src/cli/core-command-names.ts", - "packages/core/src/internal.ts", - "packages/core/src/lib/config.ts", - "packages/core/src/lib/governance-policy.ts", - "packages/core/src/lib/scratch.ts", - "packages/core/tests/governance-policy.test.ts", - "packages/core/tests/policy-cli.test.ts", - "packages/ui-sdk/src/server/protected-paths.ts", - "packages/ui-sdk/src/server/worker-protection.ts", - "packages/ui-server/migrations/041_turn_governance_policy.sql", - "packages/ui-server/src/app.ts", - "packages/ui-server/src/brain/application.ts", - "packages/ui-server/src/brain/governance-policy.ts", - "packages/ui-server/src/brain/governed-turn.ts", - "packages/ui-server/src/brain/mask-application.ts", - "packages/ui-server/src/brain/protected-target.ts", - "packages/ui-server/src/ws/bridge.ts", - "packages/ui-server/src/ws/run-session.ts", - "packages/ui-server/tests/governance-policy-application.test.ts", - "packages/ui-server/tests/governance-policy.test.ts", - "scripts/check-ui-server-query-package.ts", - "scripts/ci-pack.ts", - "tests/allowed-edges.ts" - ] - } - ] - } - ] -} diff --git a/scripts/check-citations.ts b/scripts/check-citations.ts index 2a7d657640..31bbfbcea7 100644 --- a/scripts/check-citations.ts +++ b/scripts/check-citations.ts @@ -437,11 +437,6 @@ export const CITATION_EXCEPTIONS: Record = { "docs/plans/index-query-api.md|https://github.com/schlessera/brain-kit/blob/33af7e2972873286144dbcc93c232c904e3ced47/packages/ui-server/package.json#L70": "verified commit-pinned source-audit evidence before the supported-query consumer migrations; the historical SQL/package/context implementation is intentionally preserved", "docs/plans/index-query-api.md|https://github.com/schlessera/brain-kit/blob/33af7e2972873286144dbcc93c232c904e3ced47/tests/allowed-edges.ts#L92": "verified commit-pinned source-audit evidence before the supported-query consumer migrations; the historical SQL/package/context implementation is intentionally preserved", "docs/plans/index-query-api.md|https://github.com/schlessera/brain-kit/blob/33af7e2972873286144dbcc93c232c904e3ced47/packages/ui-server/src/graph/reader.ts#L33": "verified commit-pinned source-audit evidence before the supported-query consumer migrations; the historical SQL/package/context implementation is intentionally preserved", - "docs/plans/navigation-recovery.md|https://github.com/schlessera/brain-kit/blob/18d5ddee154b5dbebb3dbd6c487bc8ea1fc036db/packages/ui-react/src/components/layout/desktop-palette.tsx#L84": "verified commit-pinned palette baseline before #946 moved destinations to desktop-routes.ts and opening state to the root UI store", - "docs/plans/navigation-recovery.md|https://github.com/schlessera/brain-kit/blob/18d5ddee154b5dbebb3dbd6c487bc8ea1fc036db/packages/ui-react/src/components/layout/desktop-palette.tsx#L52": "verified commit-pinned palette baseline before #946 moved destinations to desktop-routes.ts and opening state to the root UI store", - "docs/plans/navigation-recovery.md|https://github.com/schlessera/brain-kit/blob/7bfdc71074f4ff6243e0d7133e83dbb36eb2a971/packages/ui-react/src/components/chat/composer.tsx#L62": "verified commit-pinned composer draft and receipt handling before #951 moved them to the draft store and draft client", - "docs/plans/navigation-recovery.md|https://github.com/schlessera/brain-kit/blob/7bfdc71074f4ff6243e0d7133e83dbb36eb2a971/packages/ui-react/src/components/chat/composer.tsx#L161": "verified commit-pinned composer draft and receipt handling before #951 moved them to the draft store and draft client", - "docs/plans/navigation-recovery.md|https://github.com/schlessera/brain-kit/blob/ea8506b0eb511a3e16dba685d250d34e5340afa4/packages/ui-react/src/components/chat/session-drawer.tsx#L59": "verified commit-pinned single background-session drawer row before #950 replaced it with the Working group", "docs/investigations/turn-surface-routing-investigation.md|https://github.com/schlessera/brain-kit/blob/91995dcf1bbf0dbbc3aa7b0f3b2fda6a07c63e6a/packages/ui-backend-claude/src/sdk-options.ts#L54": "verified source-pinned measured eight-tool assembly before application tools and worker spawn changed the current implementation", "docs/investigations/turn-surface-routing-investigation.md|https://github.com/schlessera/brain-kit/blob/91995dcf1bbf0dbbc3aa7b0f3b2fda6a07c63e6a/packages/ui-backend-claude/src/ask-user-tool.ts#L91": "verified source-pinned measured eight-tool assembly before application tools and worker spawn changed the current implementation", // A dependency's installed source, at the version the record measured.