Skip to content

Thin the Fork's layer (spec #107) - #46

Merged
ziyadakl merged 46 commits into
custom-v2from
spec107/integration
Nov 3, 2026
Merged

ziyadakl merged 46 commits into
custom-v2from
spec107/integration

Conversation

@ziyadakl

@ziyadakl ziyadakl commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Each custom feature moves out of Upstream's files into the Fork's own files. Upstream's files keep only seam lines (one import, one call, one case, one field). Spec ziyadakl/tokenmaxxing#107; decision ziyadakl/tokenmaxxing docs/adr/0003-fork-features-in-own-files.md. No behaviour change.

Slice (PR into this branch) Ticket New own files (main ones)
Footprint count in sync-upstream.sh check (#41) pingdotgg#114 scripts/custom/*
Test Web: attachment-preview file alone, rest in parallel (#44) pingdotgg#115 ci.yml only
Archive projects (#43) pingdotgg#116 client-runtime/state/archivedProjects.ts, web + mobile state/archivedProjects.ts
Auto-archive (#45) pingdotgg#117 ThreadArchiveQueries.ts, AutoArchiveSettingsRows.tsx, mobile AutoArchiveSection.tsx
Rewind 1/5 contracts (#42) pingdotgg#118 contracts/threadRewind.ts, rpcThreadRewind.ts, provider-core/ProviderRewind.ts
Machine filter + Archive (N) (#49) pingdotgg#119 useSidebarEnvironmentFilter.tsx, environmentFilterStore.ts, bulk-archive hook
Rewind 2/5 server (#50) pingdotgg#120 ThreadRewindCommands.ts, ThreadRewindService.ts
Rewind 3/5 Claude adapter (#47) pingdotgg#121 Adapters/ClaudeRewind.ts
Rewind 4/5 web (#48) pingdotgg#122 useMessageRewind.ts, messageRewind*.ts, docs/user/rewind.md
Sidebar project groups, nothing dropped (#52) pingdotgg#123 sidebar/projectGroups/*, docs/user/sidebar-project-groups.md
Rewind 5/5 imported chats (#51) pingdotgg#124 ImportedClaudeTranscript.ts, ImportedThreadRecords.ts
Seams column in CUSTOM.md (#53) pingdotgg#125 CUSTOM.md
Code-review fixes (#54) — thinner machine-filter seams, rewind layer bundle, sync rules for copied Upstream code
 Orchestrator.ts   switch (command.type)
-  case "thread.rewind": { …200 lines… }
+  case "thread.rewind":
+    yield* rewindCommands.dispatchThreadRewind(command, events, effects);
+    break;

Evidence

  • Footprint (bash scripts/custom/sync-upstream.sh footprint HEAD, Upstream files the Fork edits):
    Before (custom-v2 3171cb0): 181 files, +13,889 −2,908
    After: 160 files, +8,042 −2,316 (lines changed −42%)
  • Tests: every slice ran its feature's existing tests before and after the move with assertions unchanged (moved tests changed only imports). Each slice PR passed CI on GitHub (Node 26.12.1) and an Opus review for behaviour change; this branch passed CI with all slices combined.
  • Test Web on a web change: 11 min 11 s → 8 min 44 s (ci: Test Web runs the attachment-preview file alone, the rest in parallel #44).
  • Not proven by a test: the full Sidebar render with the machine menu and groups together (no such test exists before or after); covered by line-by-line review.

Merge Danger

Door: two-way

No database migration is added or changed (migration 076's add-only-when-missing guard is kept). One small one-way effect: the sidebar machine filter's saved choice moves to its own browser storage key. Going back to an older build after switching resets that filter to "All machines" once.

Blast Radius: sidebar

Sidebar (groups, Needs you, machine filter, Archive (N)), rewind (menu, code restore, Esc, imported chats), auto-archive worker and its settings, archived-project hiding, and the sync script. Two trace spans differ: ThreadRewindTargets.rollbackAfterOrdinals is new; the rest keep their names.

Part of ziyadakl/tokenmaxxing#107, tickets pingdotgg#114–pingdotgg#125.

🤖 Generated with Claude Code

claude and others added 12 commits November 2, 2026 23:59
…t subcommand

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
orchestrationV2.ts re-exports threadRewind.ts and keeps one field, one spread, three union members and one rpc schema entry; rpc.ts imports the rpc definition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ProviderAdapter.ts re-exports the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commands.ts re-exports the command; threadCommands.ts and orchestration.ts each spread one builder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt-runtime files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
withoutArchivedProjects/isProjectArchived, the web hook and the two mobile hooks
leave Upstream's projects.ts and entities.ts files, which return to Upstream's
content. Behaviour is unchanged. Migration 076's guard stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… parallel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn files

ThreadArchiveQueries.ts takes the candidate and subagent-child SQL out of
ProjectionStore.ts. The web rows, search entries and mobile section move into
fork files; Upstream files keep seam lines. Behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…till runs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync check: report the Upstream footprint, add a footprint subcommand
Thin Fork: rewind 1/5, contracts, provider-core and client commands in own files
@github-actions github-actions Bot added size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Nov 3, 2026
claude and others added 13 commits November 3, 2026 00:38
The rewind-files runner, the restore-only process, the prompt-uuid
recording and the rollback resume-at resolver now live in ClaudeRewind.ts;
ClaudeAdapterV2.ts keeps one-line seams. The file-restore and rewind-cursor
tests move to ClaudeRewind.test.ts unchanged, and the test file's shared
layer constant goes back to Upstream's inline text.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The rewind menu, code restore and Esc-to-stop-or-rewind logic leave
Upstream's ChatView.logic.ts, session-logic.ts, state/queries.ts,
chatViewSend.ts, useTimelineRewind.ts and MessagesTimeline.logic.ts for
useMessageRewind.ts, messageRewind.logic.ts, messageRewindSend.ts and
MessageRewindOverlays.tsx. ChatView calls both hooks and renders one
overlay element. Tests for the moved functions move with them; the rewind
section of composer.md moves to docs/user/rewind.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ci: Test Web runs the attachment-preview file alone, the rest in parallel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Archive projects: hidden-project helpers move into their own files
Sidebar.tsx keeps hook calls: useSidebarBulkArchive (prepare/run) and
useSidebarEnvironmentFilter/useSidebarEnvironmentFilterUi. The filter's logic,
its tests and its saved choice leave Sidebar.logic.ts, uiStateStore.ts and their
tests; the choice has its own store and key and adopts the old saved value once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:XXL and removed size:XL labels Nov 3, 2026
The archive filter call moves into useSidebarEnvironmentFilter (archive first,
then machine), using the archived-projects module path. CUSTOM.md keeps
integration's table with this feature's two rows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
claude and others added 20 commits November 3, 2026 01:35
… move into their own files

thread.rewind, the imported-session bind and the rewind-finished record move to ThreadRewindCommands.ts; the orchestrator keeps one case per command. The rewind effect path gets ThreadRewindService.ts and EffectWorker gets Upstream's rollback case back. CheckpointRollbackService keeps the shared conversation rollback and exposes it on its shape, so rollback fixes still reach rewind. The after-target query leaves ProjectionStore; the ws handler moves next to the code-rewind service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Machine filter and Archive (N) become two hooks in their own files
… files

Pure Claude transcript helpers move out of AgentSessionImporter.ts and
AgentSessionScanner.ts into ImportedClaudeTranscript.ts; the records, sync and
heal block moves to ImportedThreadRecords.ts. The importer's API is unchanged.
The scanner's Claude turn-id tests move to ImportedClaudeTranscript.test.ts.

Part of ziyadakl/tokenmaxxing#124.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and contracts/sidebarProjectGroups

Upstream files keep seam lines only. SidebarThreadRow returns to Upstream's
status ternary, SidebarListMarkers and Sidebar.drag.test.ts return to Upstream
text. Behaviour is unchanged; the existing tests moved with the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewind 5/5: imported-chat transcript helpers and records in their own files
…d the rule for new features

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CUSTOM.md: Seams column for every feature row
…ines

useSidebarEnvironmentFilter now reads Upstream's project groups itself and
returns `threads` (every machine's) under Upstream's name; the sidebar narrows
it with visibleThreads() at the one call that needs the filtered list. The
draft-scope check moves behind environmentFilter.showsDraft(). Behaviour is
unchanged (snooze wake clock input, order keys and return stamps included).

Sidebar.tsx diff against the Upstream merge-base: +154 -40 -> +125 -38.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the import alias

It clashed with Upstream's hooks/useSidebarProjectGroups.ts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AGENTS.md: preserve existing span names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…on store, runtimeLayer passes its layers

Same layer graph: runtimeLayer hands over the layers it already builds, so no
service is built twice.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Neither is Upstream text at the merge-base or a feature's; both came back with an old sync.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CUSTOM.md's Seams column records the seams. Kept the migration 076 note: it
explains code a sync would otherwise change back. Comments that explain a
non-obvious line stay, without the prefix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… still shows it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… in-place rewrite reasons

Also updates the machine filter, rewind and archive rows for the new seams.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code-review fixes for the thin-layer integration branch
@ziyadakl
ziyadakl marked this pull request as ready for review November 3, 2026 08:15
@ziyadakl
ziyadakl merged commit 9b85905 into custom-v2 Nov 3, 2026
30 of 33 checks passed
@ziyadakl
ziyadakl deleted the spec107/integration branch November 3, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants