Skip to content

feat(workspace): bound resources and recover scoped file access - #647

Merged
nixuuu merged 3 commits into
feat/workspace-file-changesfrom
feat/workspace-resources
Nov 13, 2026
Merged

nixuuu merged 3 commits into
feat/workspace-file-changesfrom
feat/workspace-resources

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 6 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.

Workspace now releases read work, live streams and cached bytes when a paired scope or thread access ends. A replaced worktree root preserves the old draft and requires explicit discard/reload. Clean content is bounded to four warm files on web and two on mobile, in addition to byte budgets; inactive files receive invalidation markers without background reads.

This also forwards file-read cancellation through the BFF, fences late responses after cleanup, clears mobile token caches and excludes IME composition from workspace shortcuts. No database migration or native configuration change.

Stage 6 of 7 in stack #643, based on stage 5. All implementation PRs remain drafts. The maintainer merges the whole stack at once.

Related: #613

Pre-merge root-checkpoint correction

Rebased onto corrected stages 3–5 and dev 4bb71c80142e0c1d0616502ce428ca2bf19d8cad, preserving merged thread scroll memory and default tool-group folding. Root identities are checked for every retained document in a thread, including hidden tabs. Resource/access guards retain the new expected-root argument through writes and deletes; explicit discard and reload remain necessary after a root replacement.

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 on the otherwise idle review machine passed with clean private temp directories: root checkpoint (2 tests / 30 assertions), queued cancellation (1 / 10), onward relay (1 / 5), and expanded watch/resource/access coverage (9 / 58). Stages 3 and 5 also passed the three blocker regressions locally on their introducing heads.

Current initial thread JS is 771,163 gzip bytes versus dev 756,367: cumulative +14.45 KiB, within the 15 KiB budget. No UI text or web layout changed in this correction. The final stack head received a fresh production-browser review in both themes at 1440/820/390 px, including long names, Files panel/sheet and summary dock/float/sheet. Earlier performance observations below remain historical; Device check pending remains in effect.

Interrupted local full suites 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. This PR remains a draft in stack #643.

Earlier implementation verification (historical)

  • Gateway/worker integration: 9 passed, 0 failed. Real local and linked-home streams cover owner/path safety, bounded replay, paired-scope cleanup, thread access revocation, root replacement and preservation of drafts.
  • Passed with nice: install, generation check, full typecheck, lint, formatting, production web build and iOS/Android exports. Full check:tmp: 2,785 passed, 166 skipped, 0 failed; nothing left in the temp directory.
  • CI is green. The first run had one existing remote thread-sequence recovery assertion returning the previous title after home reconnection. The unchanged test passed in isolation (1 passed, 0 failed, clean temp directory), then the failed CI shard passed on rerun.
  • Nightly native fingerprints match baseline: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9.
  • Browser review: light/dark, 1440/820/390 px widths, short and long file names, virtual source and line ranges, docked summary, Files panel, floating summary and phone sheet. No added UI suite.
  • On the isolated review machine: 100 warm switches p50 31.8 ms / p95 32.9 ms and 0 additional Files requests (including subscriptions). After warmup and 20 edit/discard/close cycles with GC exposed, retained JS heap grew 517,260 bytes / 0.49 MiB (5 MiB budget).
  • Initial thread JS: 769,295 bytes gzip, cumulative +14,544 bytes / 14.20 KiB against dev (15 KiB budget). This measures the static import closure; editor/grammar loading remains deferred.
  • These stage-6 measurements do not verify RSS/bitmap memory or native runtime budgets. Final cumulative streaming/navigation pairs, controlled transport probes and the 30-minute file/Undo/offline endurance run are reported in stage 7 (feat(workspace): complete file viewer migration #648), including the browser HTTP/1.1 emulation outlier and remaining measurement gaps; those results do not relabel the stage-6 head as separately measured.
  • Device check pending: Device support is unavailable. The maintainer authorized typecheck, iOS/Android exports and unchanged native fingerprints while continuing the stack. Consolidated device review is still required before merge.
  • No UI tests, database migrations or native dependency changes.

Copy audit — docs/copy.md §8

  • Stale/inaccessible content → “File access ended. Reopen the thread to check access.” The action matches the cleared scope.
  • A changed root → an explanation followed by Copy changes / Reload; an old draft never silently becomes a new-root edit.
  • Existing short labels and conflict confirmations are preserved. IME input is excluded from shortcuts. Responsive/theme review preserves explicit actions and truncation at desktop, narrow and phone widths.

@nixuuu
nixuuu added this pull request to stack #643 November 13, 2026 15:38
@nixuuu
nixuuu force-pushed the feat/workspace-resources branch 3 times, most recently from 0949200 to 3f01749 Compare November 13, 2026 18:01
@nixuuu nixuuu closed this Nov 13, 2026
@nixuuu nixuuu reopened this Nov 13, 2026
@nixuuu
nixuuu force-pushed the feat/workspace-resources branch 3 times, most recently from fb739a2 to 9f2ad9f 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-resources branch 2 times, most recently from a78cab8 to 0ce3f2b Compare November 13, 2026 22:29
@nixuuu
nixuuu force-pushed the feat/workspace-resources branch from 0ce3f2b to e164087 Compare November 13, 2026 22:41
@nixuuu
nixuuu merged commit 9ff340d into dev Nov 13, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/workspace-resources 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