Repository navigation
Split devCoder.ts into domain modules under src/dev/ (#1447 pass M) - #1466
Merged
Merged
Conversation
Pure move of the workflow/session tick helpers, usage bumps and RunState, plus the shared now/id/capitalize/TRAILER helpers into src/dev/util.ts. Bodies verbatim; only export prefixes and imports change. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pure move of the seeded projects, threads, transcript, providers, crew tasks, spec artifacts and fake diff. Bodies verbatim. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds src/dev/context.ts: DevCtx carries the state buildDevCoder shares with domain modules. Reassigned lets are get/set accessors over the core's own variables, so the core's bodies stay verbatim and domains read ctx.x at call time. createMemory(ctx) returns the memory namespace; the seeded rows still initialise in the core at their original position. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createMcp(ctx) owns the pending-import preview; the user server list is shared with settings and pairing through ctx.mcpServers. redactDevMcp is pure and hoisted to module scope. devCoder.ts re-exports the catalog for test/support/fakeCoder.ts. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createSkills() owns the skill list, pending previews and the ponytail plugin fixtures; nothing else reads them, so it takes no ctx. Bodies verbatim. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createSettings(ctx) owns every settings variable and the budget/settle patch parsers. dailyBudgetUsd and quotaWaitAutoResume stay core state (the run budget guard and thread resume read them) and are reached via ctx; shorthand properties for those become `x: ctx.x`. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The template list stays core state (runs and git read it) behind ctx.templates; the builtin template and normalisers move verbatim. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createAutomations(ctx) owns the automation list; it starts runs through ctx.api(), read lazily at call time. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createProjects(ctx) owns the space list; projects/threads/memory rows stay core state behind ctx accessors. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createThreads(ctx) owns the trash map and its TTL; thread rows, details and run maps stay core state. cloneDetail moves to src/dev/util.ts since the core's emitDetail uses it too. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…/runs.ts createRunEngine(core) holds tickRun/startRunTimer/clearRunTimer and the spend guards over the core state; ctx = Object.assign(core, engine). The ctx block moves above the seeded-timer loop, which still runs at the same point of buildDevCoder (after every seed, before the api object), so timer start order is unchanged. createRuns(ctx) returns the namespace. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createGit(ctx) owns the GC-reclaimed set and the synthetic PR counter; the PR map (seeded at boot) and checkpoints stay core state. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createUsage(ctx) returns activity, usage, fleet, insights and digest; it only reads core state. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…/issues.ts createSourceControl() and createIssues(ctx) are separate because the namespaces are not adjacent in the api object and its key order is kept. createIssues owns the Planboard label moves. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createPairing(ctx) owns the paired-device list (Settings > Remote). Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
createWorkspace() owns the demo dev servers and terminal scrollback and returns servers, simulator, preview, devserver, terminal, files, fs, attachments and shell. Part of #1447. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 5, pass M of #1447.
src/devCoder.tsis the in-browser fake backend (npm run dev:browser, and theVITE_TRAILER=1seed behind the site screenshots). It was one 6,696-line factory closure. It's now split into 16 domain modules undersrc/dev/, anddevCoder.tsstays the entry point (512 lines) with the same exports.runs.tsmemory.tsthreads.tsmcp.tsgit.tsissues.tssettings.tsautomations.tsseed.tsworkflows.tsusage.tscontext.tsskills.tsutil.tsworkspace.tsprojects.tsHow the state moved. The closure's 8 reassigned variables (
threads,projects,templates,mcpServers,memoryEntries,spendTodayUsd,dailyBudgetUsd,quotaWaitAutoResume) stay where they were. Actxexposes them through getters and setters, soctx.threads = …still writes the original variable. Maps and helpers go onctxas-is, and each domain module is acreate<Domain>(ctx)factory. State initialisation and timer start order are unchanged.Checked
ctx.rewrite: I strippedctx./ctx.api()from the added lines, then compared them with the removed lines (ignoring indentation). Everything left is wiring: thectxconstruction, its getters and setters, and destructures.seedThreads(projects), a top-level function outside the closure. It still uses its own parameter, with noctxreferences.VITE_TRAILER=1seed, the thread view after the seeded run completes, Insights › Usage and Kanban are byte-identical (cmp).npm run typecheckandnpx vite buildare clean. Renderer suite: 2701/2701, 0 cancelled (TAP count).🤖 Generated with Claude Code