Repository navigation
[Decision] protocol.ts split: replace the per-member series with a section-level big-chunk plan (preamble wholesale, one machine-checked rewrite set, five section cuts under a hot-file freeze) — or keep cutting member by member #28142
Description
director#1 · os-bill · session_01Utp6CbQLcy8yg6vhJVXXi8
Ruled: 6537939895 · letter E · 2026-10-31T02:44Z
Ruling-ref: 6537939895
Filing gate ②: the maintainer, in the director summon (2026-10-30), on batch #432's #25467 presentation, verbatim: 「33,000 行的 protocol.ts 已拆到 29,114 行(cut 35 刚合并) 整个拆分过程是不是动作太小了,有没有大切块的方案」. This card is the big-chunk plan, as a decision beside #25467 (the series card stays the execution card under whichever letter). Filed by the director seat (summon #54 continuation 2, ledger objectstack#12708). ⛔ Not a claim. domain:server expected (triage sets it).
维护者速读
- 为什么到现在都是小步: 系列的规则是「只搬函数体、一字不改」加五道筛查(函数体不得读私有静态成员、不得读
this.constructor、读取缝普查、两个按路径读源码的 pin、.d.ts字节一致)。能一字不改就搬走的成员一次只有几个,所以 35 次切片、8 天、约每周 4,000 行;每个 PR 都带一整套证明(AST 逐 token 相同、.d.ts哈希、全套测试)。还有一个结构事实:成员声明留在类里当一行桩,只有函数体搬走,所以文件的终态不是 0,是「约 2,000 行的薄类 + 一个瘦前言」。 - 现状实测(origin/main
121d1a5f): 29,114 行 = 前言 6,374 行(177 个顶层声明,其中 3,938 行是注释)+ 类及尾部 22,740 行(this.读 833 处、私有静态读 46 处)。按现在的速度,到终态还要约 6–7 周、上百个 PR。 - 大切块方案 E,三步: E0 前言整体按主题搬成模块(不需要宿主对象,一个 PR 约 4,000–5,000 行);E1 一次性放开一组机器可核的机械改写(
this.x→host.x、私有静态 → 宿主暴露、this.constructor→ 宿主),并把两个按路径 pin 与普查一次性改成跨模块解析;E2 按卡面自己的分区表切 5 块(元数据读 2,872 · 查询校验 1,643 · 数据 CRUD 1,393 · 批处理 1,067 · 发现与诊断 1,578 · 类头 1,961),每块一个 PR、1,000–3,000 行、各占一天热文件冻结。结果:约两周到终态,PR 数约 8 个而不是 100 个。 - 代价: 每个 PR 更大、评审更重(但 AST 比对工具让「搬了什么」机械可核);冻结期间其他碰
protocol.ts的 PR 排队一天;E1 放开的改写集要在裁决里逐条点名,不能开成「随便改」。 - 请回:
E / A,席位推荐 E。A = 维持逐成员系列([maintainer] refactor(metadata-protocol): splitsrc/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 批 [WIP] Update action run status for job #432 的 A 照走)。
Governing text
- [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 ruling A (6270097840): one
[maintainer]card per file over 10,000 lines, move-only slices,protocol.tsfirst; [maintainer] refactor(rest): splitpackages/rest/src/rest-server.ts(13,701 lines, 70 commits in 30 days) along itsregister*Endpointsseams, one move-only slice per PR,/metaafter #22877 stage 2 #23050 shape B (the host pattern: moved code reaches the class through one named context object). - Ruling 6348891160: the series'
.d.tsbar — identity after sorting union members, same export list (the stubs keep every member declaration, so the bar holds under E too). - Cut 34 ruling B (6520565826) and the cut-36 question on [maintainer] refactor(metadata-protocol): split
src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 (6523456539): the per-member levers are now the two by-path pins and the private-static reads — exactly the screens E1 resolves once instead of per cut. - AGENTS.md Prime Directive 12 (contract-first) is untouched: E moves implementation only;
packages/specis not in any cut.
Protocol statement. Clause-②: no, Metadata-protocol: none: no published surface changes (the .d.ts bar stays); E1 is an edit to private implementation text under a machine-checked rewrite set.
Premises (read at origin/main 121d1a5f)
protocol.ts29,114 lines; the class starts at L6375. Re-check:git show origin/main:packages/metadata-protocol/src/protocol.ts | grep -n '^export class ObjectStackProtocolImplementation'.- The preamble holds 177 top-level declarations (85 exported) and 3,938 comment-ish lines. Re-check: the same file's first 6,374 lines through
grep -c -E '^(export )?(async )?(function|const|let|class|type|interface|enum) '. - The class text reads
this.833 times andObjectStackProtocolImplementation.<static>(46 times. Re-check:grep -o 'this\.[a-zA-Z_]*' | wc -landgrep -c 'ObjectStackProtocolImplementation\.[a-zA-Z_]*('over lines ≥ 6375. - Pace: 35 cuts between 2026-10-23 and 2026-10-30 moved 33,065 → 29,114 lines (−3,951). Re-check: the card's body (33,065 on
b2c0752900) against premise 1. - The census already resolves a host call from a
protocol-*.tsmodule back intoprotocol.ts(check-durability-degradation-log-level.mjs L3029–3058, PR fix(scripts): the read-seam census follows a moved protocol.ts body across its host split (#25467 census extension) #28058) — the resolution E1 extends to the two pins.
Options
| What it does | Result | Effort / risk | |
|---|---|---|---|
| E section-level plan | E0 preamble → themed modules (no host); E1 one ruled, machine-checked rewrite set inside moved bodies + the two pins and the census resolve through modules once; E2 five section cuts by the card's table, each PR 1,000–3,000 lines under a one-day protocol.ts freeze; proofs per PR: AST identity modulo the ruled rewrite set (tool-checked, with a negative control), .d.ts bar 6348891160, tsc, full package suite, the census and pins green |
protocol.ts ≈ 2,000–3,000 lines (stubs + class head) in about two weeks and about 8 PRs |
server · 8 PRs · each L · larger reviews; freeze days; the rewrite set must be closed and named in the ruling |
| A keep the series | cut 36 under #25467's A, then per-member cuts as members pass the screens | the same end state in about 6–7 weeks and ~100 PRs | server · many S PRs · each fully proven; hot-file queue tax continues |
业务含义:E 是「把仓库按货架整层搬,搬之前先统一换好货架编号,搬那天封路一天」;A 是「每次搬几箱,不封路,但要搬两个月」。
四维分析
- ① 项目长远合理性(领起)。 终态相同:薄类压在主题模块上。E 以 8 个 PR 到达,A 以上百个到达;热文件串行队列是今天每个 server PR 都在付的税,早两个月结束就是早两个月不付。E1 放开的改写是机械的、可被工具逐 token 核对的,不是「允许改逻辑」。
- ② 实际业务拉动。 间接:
protocol.ts在热文件队列里,所有碰它的 PR 串行;无客户可见变化。 - ③ 防 AI 犯错。 风险从「每次小切片的筛查」转为「一次放开的改写集」:改写集封闭、每条带反向对照,AST 工具对比搬前搬后,才能响亮地抓到越界;冻结期防止并发改动把大 diff 搞脏。
- ④ 创业阶段不扩散。 不加门禁、不加协议面;E1 是对现有普查与 pin 的一次性解析扩展(fix(scripts): the read-seam census follows a moved protocol.ts body across its host split (#25467 census extension) #28058 已做了普查那一半)。
os-decision-facets
① 长远:同一终态,8 个 PR 两周 vs 上百个 PR 两个月;改写集机械可核
② 拉动:热文件串行税,每个 server PR 都在付
③ 防错:改写集封闭、带反向对照、AST 工具逐 token 核;冻结日防脏 diff
④ 不扩散:不加门禁不加协议面;pin 与普查一次性解析扩展
Prior rulings read: protocol.ts split, move-only, host pattern, .d.ts bar, cut 34 → 6270097840, #23050 B, 6348891160, 6520565826; thread: #25467 6523456539; repo: objectstack-ai/objectstack
Recommendation
E. 只看①选 E;②③④ 是否翻转:否(③ 只加「改写集封闭 + 反向对照」的条件). Confidence gaps: the five section sizes are the card's 2026-10-23 table re-read against today's 29,114 lines (the reads section has since lost members to cuts 33–35; the dev re-measures each section before its PR); the freeze mechanism is the lane's hot-file queue, not a new gate — the seat posts the freeze day on the seat post and the queue serialises.
After the ruling
- E: [maintainer] refactor(metadata-protocol): split
src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 stays the execution card; the server lane's card thread runs E0 first (one PR), then E1 (pins + census + the rewrite-set checker, one PR), then E2 (five PRs, one per section, each on a declared freeze day); [maintainer] refactor(metadata-protocol): splitsrc/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467's cut-36 letter A folds into E2. This card closescompletedwith the pointer once E's plan is on [maintainer] refactor(metadata-protocol): splitsrc/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467's body. - A: this card closes
not_planned; [maintainer] refactor(metadata-protocol): splitsrc/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 continues under its own ruling.
Related
#25467 · #24586 · #23050 · PR #28058 · PR #28090 · ruling 6348891160 · packages/metadata-protocol/src/protocol.ts
Activity
objectstack-fleet commentedon Oct 30, 2026
triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U
Path: none
Triage: p2 ·
domain:server· decision · 2026-10-30T15:04Z⛔ Not a claim. The decision card is well-formed: it has a 维护者速读 section, it names its governing rulings, and it asks for
E / A.src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 stays the execution card. No seat acts on it until aRuled:line appears.Generated by Claude Code
objectstack-fleet commentedon Oct 31, 2026
director#1 · os-bill · session_01Utp6CbQLcy8yg6vhJVXXi8
Ruling: batch #432 item 2 · letter E · maintainer 「同意」 2026-10-31T02:42Z
Director seat, summon #54 continuation 2 (ledger objectstack#12708, opening mark 6523423511). The maintainer asked 「整个拆分过程是不是动作太小了,有没有大切块的方案」 on #25467's cut-36 presentation; this card carried the big-chunk plan; the maintainer answered, verbatim: 「同意」 — letter E.
What the ruling binds (letter E — the section-level plan replaces the per-member series):
packages/metadata-protocol/src/protocol.ts(177 top-level declarations, 85 exported, 3,938 comment-ish lines) moves wholesale into themed modules — no host object needed — in one PR; the by-path pins and the census learn the new module paths in the same PR if they read any preamble symbol.this.<member>→host.<member>; a private staticObjectStackProtocolImplementation.<fn>(…)→host.<fn>(…)with the static exposed on the host;this.constructor→ the host. Nothing else changes in a moved body (AST identity modulo exactly that set). The two by-path pins (protocol.read-verb-canonical-fold.test.ts,protocol.lookup-artifact-item-call-sites.test.ts) and the read-seam census resolve through the host split for every module, once, as fix(scripts): the read-seam census follows a moved protocol.ts body across its host split (#25467 census extension) #28058 did for the census — each with a negative control that a body that skips the checked property still fails.src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467's own table (metadata reads · query validation · data CRUD · batch and*Many· discovery and diagnostics, then the class head), one PR per section (1,000–3,000 lines), each on a declaredprotocol.tsfreeze day posted on the server seat post; other PRs touching the file queue behind it for that day. Member declarations stay on the class as stubs, so the.d.tsbar (ruling 6348891160: identity after sorting union members, same export list) holds;tsc, the full package suite, the census and the pins are green on every PR.src/protocol.ts(33,065 lines, +10,169 in 30 days) along itsObjectStackProtocolImplementationseams, one move-only slice per PR #25467 stays the execution card; its cut-36 question (A / S / D) is answered by E: the six read-verb members and the three that already pass move inside E2's reads section, not as a separate cut 36. Not taken: A (the per-member series to the same end state in ~6–7 weeks and ~100 PRs).Governing text: #24586 ruling A (6270097840); #23050 shape B (the host pattern); ruling 6348891160 (
.d.tsbar); cut 34 ruling B (6520565826) and #25467's 6523456539 — the per-member levers E1 resolves once. Premises re-read atorigin/main121d1a5f(this card's body).Workload of the letter:
domain:server· about 8 PRs (E0 one · E1 one · E2 five or six) · each L · the same card thread under the server seat's landing grant ·Clause-②: no,Metadata-protocol: none(no published surface change;packages/specuntouched). The dev re-measures each section against today's file before its PR; the freeze day is the lane's hot-file queue, not a new gate.Execution: this card closes
completedin this act, its plan recorded on #25467 (ruling pointer there); #25467needs-user-decision→pm:dispatched(assigneeos-elon-musk, the seat's claim stands); the server lane's card thread runs E0 → E1 → E2 withRuling-ref:naming this comment.os-decision-facets
① 长远:同一终态,约 8 个 PR 两周 vs 上百个 PR 两个月;改写集封闭、机械可核
② 拉动:
protocol.ts在热文件串行队列,每个 server PR 都在付③ 防错:改写集逐条点名、带反向对照、AST 工具逐 token 核;冻结日防脏 diff;
.d.ts门槛不动④ 不扩散:不加门禁不加协议面;pin 与普查一次性解析扩展
objectstack-fleet commentedon Oct 31, 2026
director#1 · os-bill · session_01Utp6CbQLcy8yg6vhJVXXi8
Closed
completed· 2026-10-31T02:45Z · ruling 6537939895 (letter E); the plan is recorded on the execution card #25467 (pointer 6537947529), which runs E0 → E1 → E2 under the server seat.needs-user-decisionleaves with the close.