Skip to content

[Decision] Split the platform's largest, fastest-growing source files (protocol.ts 32,428 lines, +10,002 in 30 days) the way rest-server.ts was split, or leave them #24586

Open

Description

@objectstack-fleet

Filing gate ②, a decision only the maintainer can make. The maintainer's word in domain:cli seat 1's session chat, verbatim: 「应该立决策卡研究如何分解这些大的文件」. It followed this seat's measurement of packages/metadata-protocol/src/protocol.ts while #24535 waited on a same-function PR.

Filed by domain:cli seat 1 (seat post #6024) · zhuangjianguo · session session_01SYEJqDL3NXxrJRBVqaMu9T. ⛔ Not a claim. Reader who acts: the maintainer, who decides here; then the owning lanes' seats, one card per file.

维护者速读

Measured (on origin/main ba4afcc23, 2026-10-19)

file lines change in 30 days commits 7d / 30d open PRs on it now owning lane
packages/metadata-protocol/src/protocol.ts 32,428 +10,002 (from 22,426) 67 / 184 PR #24533 domain:engine
packages/objectql/src/engine.ts 22,232 +6,195 20 / 111 none domain:engine
packages/drivers/driver-sql/src/sql-driver.ts 21,570 +2,193 4 / 52 none domain:engine
packages/spec/src/conversions/registry.ts 17,722 +7,760 23 / 77 none domain:spec
packages/services/service-automation/src/engine.ts 13,530 +2,067 11 / 44 PR #24527 domain:services
packages/rest/src/rest-server.ts (split by #23050) 6,196 −7,816 — — domain:cli

Governing text: none found. git grep -n -i -E "max-lines|file size|god (file|class)|split (the|a) (file|module)|monolith" over AGENTS.md, docs/NORTH-STAR.md, docs/adr and the ESLint configs finds no source-file size rule. The hits are about package and ownership monoliths (ADR-0028, ADR-0029), not file size. No protocol (spec) declaration changes in any option.

Prior rulings read: #23050, the maintainer's 「这个文件经常改,为什么不分拆?rest-server.ts」, then 「立卡,等 #22877 后 (推荐)」. One move-only slice per PR, with gates and doc anchors migrated in the same PR; /meta was held until the conflicting engine PR merged. It landed 18 slices (#23116 … #24304, d1f082d94), +17,258 / −9,553 including the moved tests and anchors.

Options

what it does what a customer notices workload
A One [maintainer] card per file over 10,000 lines, in its owning lane, split along the file's existing seams by move-only slices, #23050's rules. protocol.ts first, then objectql/engine.ts and conversions/registry.ts, then the other two. Each slice is serial with the file's in-flight PRs. Nothing directly. Fixes stop queuing behind unrelated work in the same file sooner, and agents' edits are made with the whole module in view. Measured precedent: #23050, 18 PRs in about 6 days for 13,701 → 6,196 lines (one lane). protocol.ts is 2.4× rest-server's starting size, so there is no precedent at that size; expect several lanes in parallel over weeks, with each lane's queue share going to move-only PRs.
B A, plus a new gate: no non-test source file may grow past a line ceiling (a ratchet, as check-skill-line-ratchet does for SKILL.md). The same as A, and the files cannot grow back. A, plus one gate script, its ceiling table and its CI wiring. 「新增门禁默认否」: this needs the maintainer to name it.
C Split only where it hurts: when a card is held by a same-file or same-function serial wait, its seat first moves that seam out in a move-only PR, then does the fix. No program. Slower relief: only the hot spots get smaller, as they are hit. No upfront program. Each such card grows by one move-only PR. No precedent.
D Leave the files as they are. Same-file waits keep growing with the files: protocol.ts gained 10,002 lines in 30 days. None now.

四轴分析

os-decision-facets

自检:只看①选 A;②③④ 是否翻转:否(④ 只调时序:先 protocol.ts,其余随车道余量分期)。

推荐:A。 回退:C(若车道余量不足以支撑分片计划)。置信缺口: protocol.ts 内部的接缝还没有像 #23050 那样逐段实测(哪些方法簇可以按职责独立搬出、彼此的私有依赖有多深);规模是 rest-server 起点的 2.4 倍,分片数和周期是估计,不是实测。

裁后执行


Generated by Claude Code

Activity

  1. objectstack-fleet commented on Oct 19, 2026

    @objectstack-fleet
    ContributorAuthor

    Ruled: A · recorded by domain:cli seat 1 (seat post #6024) · zhuangjianguo · session session_01SYEJqDL3NXxrJRBVqaMu9T · 2026-10-19T14:49Z

    The maintainer's words, verbatim, in this session's chat: 「24586 同意A,是否建议这波分拆等 v18 发布之后再处理。」

    On the timing question, the seat recommends: yes, start the splits after 18.0.0 GA is published. Read in this act:

    After the restart:

    Restart-when: npm view @objectstack/spec dist-tags.latest prints 18.0.0 or a later 18.x version

    In the stroke after this comment, needs-user-decision becomes pm:on-hold. If the maintainer prefers to start before GA, a word here reopens it.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions