Skip to content

Health H-2: split the 137 source files over 1000 lines by responsibility #4521

Open

Description

@DoodleBears

Problem and context / 问题与背景

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.
  • Tests covering the split files pass unchanged.

Harness / Model

Harness: Claude Code
Model:

Activity

  1. DoodleBears commented on Nov 20, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex
    • Task: codex/local/01a1f91d-b131-7503-b852-96b11bd9acab
    • Issue scope: Split the Client legacy stylesheet, state store and plugin entry point in three independent H-2 PRs.
    • Branches: codex/4521-h2-styles, codex/4521-h2-store, codex/4521-h2-client-index
    • Started: 2026-11-20 13:21 UTC
    • State: active
  2. added
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    on Nov 20, 2026
  3. DoodleBears commented on Nov 20, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim update

    • Task: codex/local/01a1f91d-b131-7503-b852-96b11bd9acab
    • 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.
  4. DoodleBears commented on Nov 20, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

  5. removed
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    on Nov 20, 2026
  6. DoodleBears commented on Nov 20, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex
    • Task: codex/local/01a1f9ec-1041-72f1-9aeb-88fc86b8dfd9
    • Issue scope: Split the Client Bot sidebar by responsibility while preserving behavior and public exports.
    • Branch: codex/4521-h2-bot-sidebar
    • Started: 2026-11-20 17:06 UTC
    • State: active
  7. added
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    on Nov 20, 2026
  8. DoodleBears commented on Nov 20, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a1f9ec-1041-72f1-9aeb-88fc86b8dfd9
    • State: handed-off
    • PR: refactor(client): split bot-sidebar.tsx by responsibility (H-2) #4731 at d3918935a4bbb74aef28232c86b0bc652cc15427. GitHub Verify passed and the PR is open for review.
    • 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.
  9. 243 remaining items

  10. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

  11. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a203f2-399b-74e3-bc92-3c06d9f5455f
    • State: handed-off
    • PR: refactor(core): move Assignment runtime and Inbox harvest out of Bot runtime (H-2) #4960
    • Head: c412fa4cd22811d8c2b87d00e2266054935d1580
    • 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.
  12. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex
    • Task: codex/local/01a20415-9982-7ad0-ae66-61fdc76791e6 (not a DSH Session)
    • Issue scope: two independent H-2 pure moves for Core Typert RPC adapters and Host feature wiring.
    • Branches: codex/4521-h2-rpc and codex/4521-h2-plugin
    • Started: 2026-11-22 16:28 UTC
    • State: active
  13. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a20415-9982-7ad0-ae66-61fdc76791e6
    • State: handed-off
    • #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.
    • Both PRs target main and GitHub reports them mergeable. GitHub Verify passed on refactor(core): split plugin.ts (H-2) #4965. Verification is running on the refreshed refactor(core): split rpc.ts (H-2) #4963 head, which carries needs-human.
  14. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex
    • Task: codex/local/01a204a0-debd-7873-96f6-6afc9f2e48ad
    • Issue scope: H-2 pure moves for the Operational Database owner and the VRM Companion stage.
    • Branches: codex/4521-h2-database-owner and codex/4521-h2-vrm-stage
    • Started: 2026-11-22 19:00 UTC
    • State: active
  15. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a204a0-debd-7873-96f6-6afc9f2e48ad
    • State: handed-off
    • #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.
  16. DoodleBears commented on Nov 22, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex
    • Task: codex/local/01a204fb-ec15-7ad1-8c29-c0bcba9e6242
    • Issue scope: Split the six Client suites for Bridge, Bot sidebar, Bot main, Memory Git interaction, Window Companion and Avatar Appearance by behavior.
    • Branch: codex/4521-h2-client-tests
    • Started: 2026-11-22 20:40 UTC
    • State: active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions