Skip to content

feat(workspace): watch disk changes and preserve drafts - #646

Merged
nixuuu merged 5 commits into
feat/workspace-highlightingfrom
feat/workspace-file-changes
Nov 13, 2026
Merged

nixuuu merged 5 commits into
feat/workspace-highlightingfrom
feat/workspace-file-changes

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Final integration rebase including history/fold recovery

Rebased all seven layers of stack #643 onto dev 8e78568c7e86c188039743dde6cb879c34de4a6e, including #671 provider warnings, #673 reconnect/backoff, #670 connector refresh, #674 deterministic steer recovery and #672 empty-work/history recovery. Two thread-page conflicts were resolved in their introducing stages: preserve the conversation/file tab wrapper together with history loading rows/actions, prefetch, fold synchronization/coverage, diagnostics and scroll anchors. Feed, history and fold implementation files retain the merged dev behavior. Earlier generated-descriptor conflicts were resolved through bun run gen; proto additions and field numbers are preserved. The independently confirmed five workspace fixes are unchanged. No pending Git or gh-stack rebase operation.

Verification scope on the final heads: install, explicit gen, gen:check, full typecheck, lint, format:check, production web build and focused workspace/feed tests at every stage. Commands run detached with setsid nohup and nice; heavy files run serially through check:tmp. Stage 5 integration files: thread-root-checkpoint.test.ts, thread-watch-cancellation.test.ts, thread-watch-relay.test.ts, thread-watch.test.ts. Existing feed logic files: feed-rows.test.ts, work-history-gaps.test.ts. No UI/component test suite added.

All seven PRs remain ready as requested. The maintainer merges the complete stack after CI is green on every head; no merge is performed here. Device check remains pending as previously authorized. No product copy change in this integration rebase.

Everything below is historical evidence from before this final integration rebase, including earlier draft statuses and export/fingerprint measurements.

Files now watch only the visible directories and active document. External changes refresh clean content and preserve dirty drafts, with Compare changes, Copy changes and a confirmed Discard and reload. The comparison switches between virtual read-only disk/draft versions; it never force-overwrites a file.

The additive WatchThreadFiles stream carries bounded invalidations, never source or a tree snapshot. Gateway ownership, path checks and home routing apply before subscription. Shared checkout watches have bounded replay, reconnect requests visible-scope revalidation, and cancellation/background releases the stream and retries. Save conflicts use a typed Connect code and HTTP 412 in the BFF. No database migration or native configuration change.

Stage 5 of 7 in stack #643, based on stage 4. Every implementation PR remains a draft until the whole stack is finished and verified; the maintainer merges the stack at once.

Related: #613

Pre-merge root, watch and relay corrections

  • Every file response carries its root identity. The document retains that checkpoint with its base and draft across watch stops. A changed root remains a conflict until explicit discard and reload, even with identical base bytes. Additive expected_root_identity fields reach the home worker for writes and deletes; a stale root yields Aborted. Unsupported workers cannot silently ignore a supplied checkpoint.
  • Released queued additions check cancellation inside the serialized operation and after reconciliation. Pending additions keep coordinator ownership until cleanup. The controlled slow-reconciliation regression with 35 released queued subscriptions leaves zero subscribers, zero directory watches and zero callbacks after release; a fresh subscription still works.
  • Supported onward routes advertise thread_files_watch_v1. A new three-gateway integration covers negotiation, delivery of a file change and cancellation at the home worker.

Rebased onto corrected stages 3–4 and dev 4bb71c80142e0c1d0616502ce428ca2bf19d8cad, preserving merged thread scroll memory and default tool-group folding. Current-head install, gen:check, full typecheck, lint, format:check, production web build and iOS/Android exports passed with nice. Both nightly native fingerprints match dev. Current-head CI is green, including all four test shards.

Serial integration files all passed with clean private temp directories: root checkpoint (2 tests / 30 assertions, both with and without a reopened watch) and queued cancellation (1 / 10) locally; three-gateway onward watch (1 / 5) and existing watches (6 / 43) on the otherwise idle review machine. The old draft cannot write or delete identical-byte replacement files; explicit discard/reload permits the new checkout. Thirty-five released queued subscriptions leave no subscribers, watches or callbacks.

Interrupted local full-suite attempts are not counted as passes. Before the last dev rebase, a detached full run continued beyond the tool timeout but failed existing computer-move reachability/discovery cases under load and was stopped with a clean private temp directory. The maintainer authorized green CI on every layer plus serial corrective/stack files as the fallback; #648 records the final evidence. Device check pending remains in effect. The final stack head received a fresh production-browser review in both themes at 1440/820/390 px; prior performance observations below remain historical. This PR stays a draft in stack #643.

Current initial thread JS is 770,777 gzip bytes versus dev 756,367: cumulative +14.07 KiB, within the 15 KiB budget.

Copy audit for this correction: “reopen the file” → “reload the file” names the explicit recovery action for a root conflict; an unsupported checkpoint asks the user to update the computer and reload before changing the file. Existing conflict copy is reused for rejected mutations. No new labels, layout, glossary terms or humorous copy.

Earlier implementation verification (historical)

  • Passed with nice: install, generation check, full typecheck, lint, formatting check, production web build and full check:tmp (nothing left in the private temp directory). CI is green.
  • New gateway/worker integration: 6 passed, 0 failed. Real local and linked-home streams cover owner isolation, traversal/symlink refusal, scope and envelope limits, replay, last-subscriber cancellation, burst recovery and dirty/hash conflicts without mutation replay.
  • Mobile typecheck and iOS/Android exports passed. Native fingerprints match the baseline with the nightly identity: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9.
  • Device check pending: Device support is unavailable. The maintainer authorized continuing with typecheck, exports and unchanged fingerprints. Consolidated iOS/Android device review remains required before the stack is merged; device CPU/FPS/IME and background results are not claimed.
  • Initial thread JS is 768,856 bytes gzip, cumulative +14,105 bytes / 13.77 KiB versus the dev baseline (15 KiB budget). File UI and watch adapters load on demand. On the isolated review machine, 30 opens of 100 KiB: plain text p50 48.7 ms / p95 52.1 ms; stable view p95 65.7 ms. 100 warm switches: p50 32.2 ms / p95 33.2 ms. Restarting a watch epoch revalidates the active file; these measurements do not claim zero network requests during switches. GC was unavailable, so the retained-heap budget is unverified.
  • Manual browser review covered light/dark, desktop/narrow/phone widths and long paths. A real worker filesystem watcher refreshed clean content, preserved a dirty draft, exposed both comparison versions, and reloaded the disk version only after discard confirmation. The save button is disabled for a known conflict.
  • No UI tests added. No full-tree or transcript snapshot recovery, polling of file contents, write replay or automatic overwrite.

Copy audit — docs/copy.md §8

  • Previously stale content → Changed on disk / Removed from disk, with explicit Compare changes, Copy changes and Discard and reload actions. The draft is preserved until confirmation.
  • Generic save rejection → a typed conflict with an explanation and an action; no hash, cursor, parser or transport jargon in UI errors.
  • Unavailable live changes → a plain explanation and Reload fallback. Short labels reserve status space and do not depend on color.
  • Comparison labels name the selected version; all destructive confirmations retain explicit verbs. No humorous copy or inspiration references. Light/dark and desktop/narrow/phone layouts preserve truncation and explicit actions.

@nixuuu
nixuuu added this pull request to stack #643 November 13, 2026 15:16
@nixuuu
nixuuu force-pushed the feat/workspace-file-changes branch from 07394c2 to 603f564 Compare November 13, 2026 17:23
@nixuuu nixuuu closed this Nov 13, 2026
@nixuuu nixuuu reopened this Nov 13, 2026
@nixuuu
nixuuu force-pushed the feat/workspace-file-changes branch 3 times, most recently from 5e83cc6 to 382666f Compare November 13, 2026 20:27
@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 20:39
@nixuuu
nixuuu force-pushed the feat/workspace-file-changes branch 2 times, most recently from ea2ba8a to 7a6f683 Compare November 13, 2026 22:29
@nixuuu
nixuuu force-pushed the feat/workspace-file-changes branch from 7a6f683 to 397413b Compare November 13, 2026 22:41
@nixuuu
nixuuu merged commit 37690b0 into dev Nov 13, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/workspace-file-changes branch November 13, 2026 23:01
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