You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Health H-2: split the 137 source files over 1000 lines by responsibility #4521
The file-length guardrail (#4296) baselines 137 files over 1000 lines (75 non-test): packages/core 60, packages/client 40, apps/mobile 15, packages/browser 6, packages/computer 4, the rest in host-client, connect-relay and scripts. Long files mix concerns, which makes review and agent edits error-prone. / 超过 1000 行的文件混杂多种职责,难以审查和修改。
Smallest useful scope / 最小有用范围
This is a tracking issue: split each file by responsibility into modules that each own one concern, not by line count. Work package by package, a few files per PR, starting with non-test files that change most often (git log --since=3.months --format= --name-only | sort | uniq -c | sort -rn). After a file drops to 1000 lines or fewer, run node scripts/health.mjs --update. Moving code is not a behavior change: no logic edits in the same PR.
How to verify / 如何验收
Each PR lowers long-files in scripts/health-baseline.json and pnpm lint passes.
Replaced the legacy stylesheet with packages/core/src/diagnostics/diagnostic-log.ts on codex/4521-h2-diagnostic-log. Moving legacy CSS would require changes to path-scoped lint exemptions.
The Client store and entry-point slices are still in scope.
Each branch removes one long-files entry, from 134 to 133. The three removals together leave 131 entries on the checked base.
Local builds, typechecks, lint, health and package boundaries passed. Each Client package run passed 3,952 tests with one skip. The diagnostic-log head passed 179 focused Core tests. The full Core run before rebase had 7,339 passes, 49 skips and five failures. Three passed on rerun and two macOS temp-path assertions also failed on the base.
Suggested next files: Client actions.ts, Client bot-sidebar.tsx, Core channels/sqlite-store.ts, then Core bots/cli-live.ts. Legacy CSS needs its path-scoped lint debt addressed. Recheck active overlaps on locale and bridge files before splitting them.
The Bot sidebar split removes one long-files entry, from 131 to 130. All 12 files are under 1,000 lines. The 24 selected suites ran with two workers and reported 434 passes and one opt-in skip.
The isolated local Web run reached the wide sidebar. Compact and workspace exit attempts timed out before exercising the sidebar. GitHub smoke, visual and performance jobs passed.
BotRuntime went from 7,537 to 5,304 lines. All 110 SQL call sites matched byte for byte, including 40 moved.
Local lint, typecheck, commit hooks, all three boundary suites, 381 affected suite files, docs-site verification, and isolated DSH smoke passed. The smoke verified DM history after restart and released its eight Hosts and port.
Remaining: GitHub verification and review for this PR, and later H-2 slices.
#4963 at 59e9962eb6cbc58297403d8e6ca6c7b6fff4b22c. The RPC file went from 3,886 to 708 lines. All 443 prototype entries and 437 Typert registrations matched in order. The refreshed head includes the Group RPCs from Add bulk Group member selection on Desktop #4916.
#4965 at 37c55166010e4849623c16f7220dfc3c98812702. The Host Plugin entry went from 2,968 to 767 lines. The construction sequence, Cordis and Fetch registration sequence, async structure, and log and error strings matched.
Local lint, typecheck, feature-map and Core boundary checks, docs verification, and isolated DSH smoke passed on both heads. Affected results were 3,245 passed and 14 skipped for RPC, and 3,748 passed and 14 skipped for the Plugin, after focused reruns. Both smokes verified DM history after restart and released their Hosts and ports.
#4969, head c757f71683c6407ab6f4a2cfc1c608350a10a95f. The Operational Database owner went from 1,076 to 754 lines. All 23 SQL literals and templates matched byte for byte. Local lint, typecheck, the 601-file affected selection with documented timing retries, and docs verification completed. Hosted Verify passed after one shard rerun.
#4973, head 4618e784265589c381e51f9ea3d3c485c0f191df. The VRM stage went from 1,063 to 991 lines. The stage source comparison, local lint, typecheck, 117 affected tests, 40 VRM tests, docs verification, package build and hosted Verify passed.
Remaining: PR review and merge. The database PR lists three pre-existing follow-ups.
Issue scope: Split the six Client suites for Bridge, Bot sidebar, Bot main, Memory Git interaction, Window Companion and Avatar Appearance by behavior.
Activity
DoodleBears commentedon Nov 20, 2026
Agent work claim
codex/local/01a1f91d-b131-7503-b852-96b11bd9acabcodex/4521-h2-styles,codex/4521-h2-store,codex/4521-h2-client-indexDoodleBears commentedon Nov 20, 2026
Agent work claim update
codex/local/01a1f91d-b131-7503-b852-96b11bd9acabpackages/core/src/diagnostics/diagnostic-log.tsoncodex/4521-h2-diagnostic-log. Moving legacy CSS would require changes to path-scoped lint exemptions.DoodleBears commentedon Nov 20, 2026
Agent work outcome
codex/local/01a1f91d-b131-7503-b852-96b11bd9acablong-filesentry, from 134 to 133. The three removals together leave 131 entries on the checked base.actions.ts, Clientbot-sidebar.tsx, Corechannels/sqlite-store.ts, then Corebots/cli-live.ts. Legacy CSS needs its path-scoped lint debt addressed. Recheck active overlaps on locale and bridge files before splitting them.refactor(client): split store.ts by attention state (H-2) (#4725)
refactor(client): split index.ts by plugin registration responsibilit…
refactor(core): split diagnostic-log.ts by read and write responsibil…
DoodleBears commentedon Nov 20, 2026
Agent work claim
codex/local/01a1f9ec-1041-72f1-9aeb-88fc86b8dfd9codex/4521-h2-bot-sidebarrefactor(client): split bot-sidebar.tsx by responsibility (H-2)
DoodleBears commentedon Nov 20, 2026
Agent work outcome
codex/local/01a1f9ec-1041-72f1-9aeb-88fc86b8dfd9d3918935a4bbb74aef28232c86b0bc652cc15427. GitHub Verify passed and the PR is open for review.long-filesentry, from 131 to 130. All 12 files are under 1,000 lines. The 24 selected suites ran with two workers and reported 434 passes and one opt-in skip.243 remaining items
refactor(client): split bot-main.tsx (H-2) (#4957)
DoodleBears commentedon Nov 22, 2026
Agent work claim
codex/local/01a203f2-399b-74e3-bc92-3c06d9f5455f(not a DSH Session)t3/4521-bot-runtime-next-splitrefactor(client): split styles.ts (H-2) (#4959)
DoodleBears commentedon Nov 22, 2026
Agent work outcome
codex/local/01a203f2-399b-74e3-bc92-3c06d9f5455fc412fa4cd22811d8c2b87d00e2266054935d1580DoodleBears commentedon Nov 22, 2026
Agent work claim
codex/local/01a20415-9982-7ad0-ae66-61fdc76791e6(not a DSH Session)codex/4521-h2-rpcandcodex/4521-h2-pluginrefactor(core): move Assignment runtime and Inbox harvest out of Bot …
refactor(core): split rpc.ts (H-2)
DoodleBears commentedon Nov 22, 2026
Agent work outcome
codex/local/01a20415-9982-7ad0-ae66-61fdc76791e659e9962eb6cbc58297403d8e6ca6c7b6fff4b22c. The RPC file went from 3,886 to 708 lines. All 443 prototype entries and 437 Typert registrations matched in order. The refreshed head includes the Group RPCs from Add bulk Group member selection on Desktop #4916.37c55166010e4849623c16f7220dfc3c98812702. The Host Plugin entry went from 2,968 to 767 lines. The construction sequence, Cordis and Fetch registration sequence, async structure, and log and error strings matched.refactor(core): split plugin.ts (H-2) (#4965)
DoodleBears commentedon Nov 22, 2026
Agent work claim
codex/local/01a204a0-debd-7873-96f6-6afc9f2e48adcodex/4521-h2-database-ownerandcodex/4521-h2-vrm-stagerefactor(core): split rpc.ts (H-2) (#4963)
refactor(core): keep SQLite connections under the database owner
DoodleBears commentedon Nov 22, 2026
Agent work outcome
codex/local/01a204a0-debd-7873-96f6-6afc9f2e48adc757f71683c6407ab6f4a2cfc1c608350a10a95f. The Operational Database owner went from 1,076 to 754 lines. All 23 SQL literals and templates matched byte for byte. Local lint, typecheck, the 601-file affected selection with documented timing retries, and docs verification completed. Hosted Verify passed after one shard rerun.4618e784265589c381e51f9ea3d3c485c0f191df. The VRM stage went from 1,063 to 991 lines. The stage source comparison, local lint, typecheck, 117 affected tests, 40 VRM tests, docs verification, package build and hosted Verify passed.refactor(vrm-companion): split stage character lifecycle (H-2) (#4973)
DoodleBears commentedon Nov 22, 2026
Agent work claim
codex/local/01a204fb-ec15-7ad1-8c29-c0bcba9e6242codex/4521-h2-client-tests