chore(rest): @objectstack/rest 从 #4311 的 DEBT 台账毕业 —— 接进 turbo typecheck (#6905) - #6937
Merged
os-project-manager merged 1 commit intoAug 9, 2026
Merged
Conversation
PR #6895(#6307)修掉重复 `?version=` 把 `string[]` 喂进 `version?: string` 的缺陷后,`@objectstack/rest` 已零错编译,而 DEBT 台账仍记 2。门禁自己把这 个状态标成 graduation candidate 并明说 `--lower` 不会处理它 —— 0 不是更低的 天花板,而是毕业。 - `packages/rest/package.json` 增加 `"typecheck": "tsc --noEmit"`; - 删掉 `scripts/check-type-check-coverage.mjs` 里 DEBT 的 `@objectstack/rest` 条目。 两者必须同一个 PR:只删条目不加脚本会挂 COVERED,只加脚本不删条目会挂 RECONCILED。TEST_DEBT 是另一本账,本 PR 不动。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017uFVNMmTxLpmfQYiuKM1Yx
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 12 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-project-manager
marked this pull request as ready for review
August 9, 2026 05:28
os-project-manager
deleted the
claude/issue-6905-rest-typecheck-graduation
branch
August 9, 2026 05:44
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.
Fixes #6905
前置条件:自查通过
PR #6895(#6307)已合入
main:293476148 fix(rest): refuse a repeated ?version= on GET/DELETE /packages/:id (#6307) (#6895)。自己复测的读数(全闭包
turbo run build72/72 之后跑pnpm check:type-check-debt,不采信卡里的数字):实测 0,与卡一致。
两条路为什么选"加脚本"
门禁的提示把两条路并列,但它们属于两本不同的账,
scripts/check-type-check-coverage.mjs的头注写得很清楚:src 没被检查)的毕业方式是 —— "add"typecheck": "tsc --noEmit"to its package.json, and delete its entry here in the same PR";src 检查了、测试被藏起来)的毕业方式才是 —— "drop the exclusion from tsconfig.json and delete the entry here in the same PR"。本卡是 DEBT 卡,所以走加脚本这条。三条佐证:
packages/*里 16 个typecheck脚本,12 个逐字就是tsc --noEmit;放在test之后也是多数写法(lint / verify / formula / mcp / objectql)。lint、mcp、objectql、runtime、formula、verify六个包同时持有 TEST_DEBT 条目、且用的就是朴素的tsc --noEmit—— 直接证明这条路不会扰动另一本账。ci.yml有一条"测试文件不得进入发布产物"的闸门,头注也点名 build config 保留该 exclusion 是有理由的;真要修 TEST_DEBT,支持的做法是@ts-expect-error退役 pin 在packages/spec里是幽灵检查:tsconfig 把**/*.test.ts排除出唯一的tsc --noEmit#5286 的 siblingtsconfig.test.json,那是另一张卡的事。机制上也确认了不会污染:新脚本只点名
tsconfig.json,而它仍然exclude了**/*.test.ts,所以testsInvoked依旧为空,TESTS_COVERED 依旧要求TEST_DEBT['@objectstack/rest']存在 —— 该条目原封不动。改了什么
packages/rest/package.json:加"typecheck": "tsc --noEmit";scripts/check-type-check-coverage.mjs:删掉 DEBT 里的@objectstack/rest条目。两者必须在同一个 PR:只删条目会挂 COVERED,只加脚本会挂 RECONCILED。
实测数字(全部自测,非引用)
62/77 workspace packages type-checked,15 in DEBT(457 frozen)63/77,14 in DEBT(455 frozen)typecheck脚本的 turbo 任务turbo run typecheck实际执行的任务总数(含^build依赖)rest的 typecheck 命令< NONEXISTENT >tsc --noEmitpnpm --filter @objectstack/rest typecheck干净退出 0。双向实证:门禁真的开始看着这个包了
预测先写、再跑(记录在案)。注入的不是随手造的类型错,而是把 PR #6895 删掉的那条肢体原样装回去 ——
packages/rest/src/package-routes.ts的 GET / DELETE 两处,还原成const version = req.query?.version || 'latest'与const version = req.query?.version。req.query?.version是string | string[] | undefined,而packageService.get/delete收version?: string。这正是被删掉的台账条目所记的那笔债。预测 A —— 复现台账记的组成(
errors: 2, note: 'code-tier 2 (TS2345).'),数量和错误码都对得上。实测:命中。(另有 2 条 TS6133 —— 我的还原手法把
readSingleQueryValue/repeatedQueryParamMessage两个辅助函数留在原地成了未引用;那是注入手法的副产物,不属于原缺陷,如实记在这里。code-tier 那一档是精确的 2×TS2345。)预测 B ——
turbo run typecheck变红。实测红,退出码 2:这条红是有效力的:
lint.yml的 "Type check workspace packages" 步跑的正是turbo run typecheck --filter='./packages/*' …,packages/rest在其中。预测 C(与卡里的括号相反,先写下来的) ——
pnpm check:type-check-coverage不会变红,实测确实保持绿(退出 0)。它是门禁的结构那一半(头注自称 "structural, sub-second"),COVERED / REAL / RECONCILED / TESTS_COVERED / PINS_CHECKED / RUNNABLE 读的全是 package.json、tsconfig 与 workflow 文本,从不启动编译器,所以任何类型错都推不动它。跑编译器的是check:type-check-debt(--re-measure),而它只编译有台账条目的包 —— 本 PR 删掉 rest 的 DEBT 条目后,它也不再编译 rest 的 src。这恰好是"加脚本"不可省的理由,也是本卡最该说清的一句话: 毕业前,看着
rest/src的是台账条目(记 2,实测 4 就会超顶变红);毕业后,看着它的唯一东西就是turbo run typecheck。所以只删条目、不加脚本,才真的会把这个包从"记录在案的欠债"挪成"没人检查"——而加了脚本之后,上面那条退出码 2 的红就是接管完成的证据。预测 D —— 撤掉注入后恢复绿。实测
turbo run typecheck --force18/18,退出 0,工作区git status干净;注入自始至终只在工作区,从未提交。packages/rest/src/rest-server.ts(#6601 的同事正在那里)。注入落在package-routes.ts。合并后复跑(main 当时又前进了 6 个提交)
merge → 重建全闭包(72/72)→ 复测,一趟连续做完:
台账条目 34 → 33,rest 的 DEBT graduation-candidate 提示行消失;rest 的 TEST_DEBT 行仍在、数字未动。
changeset:不加,走
skip-changeset纯构建/工具改动:没有任何运行时行为变化,
scripts/不发布,package.json里新增的typecheck脚本对使用者没有语义。先例是 #4311 同族里最贴近的一次 —— PR #5045 给
@objectstack/runtime做同样的毕业,它的 changeset 是为@objectstack/spec的真实类型契约变更而写的,并在正文里明说毕业这半件事不发布:本 PR 只有那"半件事",没有随附的 spec/源码改动(rest 已零错,无债可修),所以按同一句话的口径,没有可发布的东西。另一条先例 #6376 / PR #6510(纯改这个门禁脚本)同样没有 changeset。
按 #5471 / #4898,空 frontmatter 的 changeset 是禁止的,所以这里用
skip-changeset标签而不是空文件。Generated by Claude Code