Skip to content

feat(threads): expose bounded cache warming and head signals - #622

Merged
nixuuu merged 1 commit into
devfrom
perf/background-thread-warming
Nov 13, 2026
Merged

nixuuu merged 1 commit into
devfrom
perf/background-thread-warming

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Opening an inactive thread currently waits for message catch-up. This layer adds owner-scoped head signals to the existing overview stream and a finite sequence reader for bounded cache warming.

  • Additive protobuf fields: at most 32 head IDs per overview; one scalar probe every two seconds, emitting changed heads only. Qualified IDs advertise the committed mirror checkpoint.
  • Background reads resume per-thread seq, return at most four 64-record/64-KiB batches, and use the existing bounded recent window for absent, distant or invalid checkpoints. Older history remains pageable.
  • Linked homes without THREAD_RANGES cannot fall back to full-history reads. The Polish API documentation describes the contract.

Validation on the final stack: install, gen:check, full typecheck, lint, format:check and web build passed with nice. Focused check:tmp passed cache warming 6 tests / 41 assertions, linked mirrors 1/36, schema 23/85, sidebar ordering 5/22 and client diagnostics 9/70, with empty temp directories. Warming covers head owner scoping, bounded tails, delta reconnect, persistent mobile restart and recency independent of sidebar sort/manual order. Current-head CI static checks, web/Linux build and commitlint passed; all four test shards are still running. A previous full local attempt was stopped after 1,092 passing tests and green CI on the preceding stack; it is not a completed local full pass for these heads.

Stack 624 is based on dev cfb9846, including the merged sidebar-sorting stack and #628 citations. The generated protobuf was regenerated from both contracts, preserving ReorderThread, sidebar_order_key and last_reply_at alongside the warming fields. Migration 0133 remains in the base; the final layer adds 0134. gh stack rebase completed and left no rebase state. Current head: 86397a3. All PRs remain draft. Native measurement and the one-frame target remain unverified in the later layers.

Copy audit (§8): no product copy changes in this layer. No merge requested.

@nixuuu
nixuuu added this pull request to stack #624 November 13, 2026 09:37
@nixuuu
nixuuu force-pushed the perf/background-thread-warming branch 2 times, most recently from 1f10671 to 3e44c63 Compare November 13, 2026 10:33
@nixuuu
nixuuu force-pushed the perf/background-thread-warming branch from 3e44c63 to 86397a3 Compare November 13, 2026 10:44
@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 10:56
@nixuuu
nixuuu merged commit 2b158e6 into dev Nov 13, 2026
11 checks passed
@nixuuu
nixuuu deleted the perf/background-thread-warming branch November 13, 2026 10:57
nixuuu added a commit that referenced this pull request Nov 13, 2026
## Projekt workspace'u — zaakceptowany układ v2

Podgląd plików przechodzi z modala do zakładek jednego wątku. Sygnet
projektu, skracany tytuł i karty dzielą rząd nagłówka, z aktywną kartą
zawsze widoczną i przełącznikiem overflow. Prawy rail obsługuje jeden
minimalny moduł. Bez modułu podsumowanie jest dokowane i widoczne; z
modułem jest zamkniętą domyślnie kartą pływającą. Na wąskich ekranach
obie powierzchnie używają arkuszy.

Użytkownik zaakceptował układ v2 i udzielił jawnej zgody na
implementację. Przyjęte decyzje: jeden zastępowalny czysty preview,
utrwalany przez Edit/Keep tab/dwuklik, zakres cwd/worktree wątku i
mobilna edycja natywna bez kolorów podczas pisania (kolory w viewerze i
Preview changes). Usunięto sekcję otwartych decyzji.

Dokument uwzględnia jeden przycisk menu wiersza (#608), zachowanie
treści PR przy odświeżaniu (#611), bounded warming/cache transkryptu
(#622/#623/#629), niezależne sortowanie sidebara (#617/#619/#626),
kompaktowy tekst stanów preview (#634), poprawne stany ChoiceControl
(#637), kolejkę kontynuacji (#630) i podsumowania jej wierszy (#633).
Nie dodaje pełnych snapshotów ani prefetch plików podczas warming.

Siedem kompletnych warstw będzie osobnym stosem z podstawą dev.
Wszystkie PR implementacyjne pozostaną draftami do ukończenia i
weryfikacji całości oraz wspólnego scalenia przez maintenera. Migracje
muszą zachować monotoniczność względem aktualnego dev. Dokumentacyjny PR
po zielonym CI jest gotowy do scalenia przez maintenera.

## Weryfikacja i ograniczenia

- Rebase na dev `1626a3e6b05494e7aec77942bd818950468a3b58` bez
konfliktów.
- `nice -n 10 bun run format` i `nice -n 10 bun run format:check`
przeszły. Konfiguracja pomija Markdown; dokument sprawdzono ręcznie.
`git diff --check` bez błędów po usunięciu pustej linii końcowej.
- Brak zmian kodu aplikacji i kontraktów; testy wykonania oraz pomiary
budżetów należą do stosu implementacyjnego.
- Samodzielna makieta v2 poza repozytorium, 32 435 bajtów, przezroczyste
html/body, trzy stany × trzy szerokości × dwa motywy. Poprzednio
wyrenderowana i obejrzana bez błędów konsoli.

## Copy audit (§8)

Brak zmian produkcyjnych etykiet. Projekt zachowuje `Thread`, `Keep
tab`, `Thread details`, `Open in tab`, `Collapse panel` / `Show panel`
oraz dostępne nazwy obu kontekstów `+`. Zachowuje jeden przycisk menu
wiersza i kompaktowy tekst statusów pliku. Krótkie i długie etykiety są
pokazane w makiecie; rzeczywiste powierzchnie i stany będą audytowane w
każdej warstwie UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant