chore(cleanup): drop verified dead exports and unused types - #4938
chore(cleanup): drop verified dead exports and unused types#4938orangeCatDeveloper wants to merge 2 commits into
Conversation
38becc1 to
5a0e2b5
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the cleanup. Two fresh deep reviewers checked the deletion consumers and protocol semantics at 5a0e2b5cad84e85cf23555dd344bcc07e9383a9d; no additional correctness defect survived cross-checking. One optional simplification is noted inline. Separately, the compatible-change declarations still use epoch 121: when updating this branch onto current main, synchronize them with its current epoch (123 at review time) and rerun the gate. Existing green checks use the earlier base. This review was AI-assisted and cross-checked by the coordinating AI reviewer.
中文
谢谢清理。两位独立深审检查了删除项的消费者和协议语义,未确认新增正确性缺陷;行内提出一条可选精简意见。另外,兼容声明仍为 epoch 121,更新到当前 main 时需同步当时的 epoch(本次检查时为 123)并重跑门禁;已有绿灯基于较早的基线。本次由 AI 协助审查并由主审 AI 交叉验证。
Remove the dead code that the knip sweep across every workspace and the repository root surfaced, with each symbol verified consumer-free by a repo-wide grep spanning .ts, .tsx, .mjs, .ps1, .py and workflow files: - unused exported functions, types and helpers in runtime (context-budget-helpers, model-history's text-only projection subtree, agent-run-inspect, stream-graph-supervisor-tools, runtime-event-backfill, model-adapter, workspace-executor, compaction-boundary, memory-extraction-proposal, filesystem-authority, plugin-runtime's alias), runtime-host (agent-graph-coordinator, host-kernel, client-capability-coordinator's type re-export, peer-mesh), storage (workspace-version-authority-internal, a fixture's unused helper), cli (workspace-root's type re-exports, an unused wrapper, an unused union) and core (the computer-use action-type alias); - the storage readHead registration plumbing that only fed the deleted readWorkspaceHeadInternal (the live store method and its tests stay); - two dead root-script exports and two ambient .d.mts declarations that no module resolution reaches; - two project-catalog path-limit constants unexported, declared as a compatible extension at the current epoch (123, rebased onto main). Kept deliberately: the decode/encode and PAGE/RANGE codec alias pairs whose both names have live consumers stay as plain aliases so the page and range bounds and the wire contract remain true by construction. Their knip duplicates finding is handled by a scoped ignoreIssues exception for the three alias files in the follow-up gate PR instead of restructuring the declarations. The website keeps its exact cookie@2.0.1 pin: astro's prerenderer resolves it through the website root. The scan configuration that surfaced these (knip.json workspaces) and the CI wiring live in the follow-up gate PR; this PR is deletions only. No behaviour change. Generated-by: Claude Code
5a0e2b5 to
cd60f4b
Compare
Generated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the cleanup. The reviewed removals remain consumer-free, and the unnecessary codec wrapper changes have been removed. I synchronized the branch with current main and re-pinned the compatible-change declaration from 123 to 125: the synthetic merge failed this guard before the adjustment and passes afterward. No product logic was changed by this integration fix.
Approving head 77a8ed5d8a6d20604cc4af850db958b046ea1cfe; merging remains conditional on the new required checks. The earlier independent reviews covered deletion consumers and protocol semantics. This follow-up was AI-assisted source/integration review, not a fresh full-suite run.
中文
感谢清理。已审查的删除项仍无消费者,不必要的 codec wrapper 改动已移除。我同步了当前 main,并将兼容声明从 123 调整到 125;调整前合并结果的协议门禁失败,调整后通过,本次整合未改变产品逻辑。
批准上述 head,合并仍等待新的必要检查。此前独立评审覆盖了删除消费者与协议语义;本轮为 AI 辅助源码及整合核对,没有重新跑全仓测试。
Summary
Removes the dead code that a knip sweep across every workspace and the repository root surfaced, with each symbol verified consumer-free by a repo-wide grep spanning
.ts,.tsx,.mjs,.ps1,.pyand workflow files: 28 files, +15/−371 (rebased onto current main).runtime(context-budget-helpers,model-history's text-only projection subtree,agent-run-inspect,stream-graph-supervisor-tools,runtime-event-backfill,model-adapter,workspace-executor,compaction-boundary,memory-extraction-proposal,filesystem-authority,plugin-runtime's alias),runtime-host(agent-graph-coordinator,host-kernel,client-capability-coordinator's type re-export,peer-mesh),storage(workspace-version-authority-internal's orphan plus a fixture's unused helper),cli(workspace-root's type re-exports, an unused wrapper, an unused union) andcore(the computer-use action-type alias);storagereadHeadregistration plumbing that only fed the deletedreadWorkspaceHeadInternal(the live store method and its tests stay);.d.mtsdeclarations that no module resolution reaches;project-catalogpath-limit constants unexported, declared as a compatible extension at the current epoch (123).Kept deliberately: the
decode/encodeandPAGE/RANGEcodec alias pairs whose both names have live consumers stay as plain aliases, so the page/range bound coupling and the result-frame wire-shape symmetry remain true by construction. Their knipduplicatesfinding is accepted with a file-scopedignoreIssuesentry for the three alias files, shipped in the gate PR #4942 (probe-verified there: an injected unused export inartifact.tsis still reported and the fullnpx kniprun is clean). The wire contract stays recorded in the operations spec tables. The website keeps its exactcookie@2.0.1pin: astro's prerenderer resolves it through the website root.The scan configuration that surfaced these and the CI wiring for the gate live in the follow-up draft #4942 (stacked); this PR is deletions only.
No behaviour change.
Verification
Review follow-ups addressed (four review rounds)
readWorkspaceHeadInternaland thereadHeadregistration plumbing that only fed it are deleted; the livereadWorkspaceHeadstore method and its direct tests are untouched.Unused
readFileandSTORAGE_ROOT_MARKER_FILEimports removed from the control-directory-hygiene fixture; orphaned section banners and JSDoc removed frommodel-history.ts(including the leftoverstripSteeringMessagesblock).The
LIFECYCLE_LABELSexport is restored: the nightly issue-pr-lifecycle workflow loads this module through an actions/github-scriptwith:script, which knip's plugin does not see. The workflow is unaffected and the module is registered as a gate entry in chore(ci): run the knip dead-code gate for the repository root and every workspace #4942.The two ambient
.d.mtsdeclarations are restored (TS module resolution consumes sibling declarations without an import statement); the root project glob excludes**/*.d.mtsin chore(ci): run the knip dead-code gate for the repository root and every workspace #4942.Round 4: the three protocol alias files (
artifact.ts,session-transcript.ts,usage-pricing.ts) are restored to plain aliases per review (no wrapper functions, no duplicate-bound test, noprotocol-codec-encode-wrappers.jsoncompatibility declaration); the scoped knipduplicatesexception for them ships in chore(ci): run the knip dead-code gate for the repository root and every workspace #4942 instead. Rebased onto current main; the remaining compatible-change declaration is synced to the current epoch (123). Five files main touched since the original base were re-checked to still carry the intended deletions.Known follow-up, preserved here per review: the deleted
FilesystemTargetDescriptorcarried a security-rationale comment (a discriminated union making "the target has no identity to compare" an explicitmissingcase, closing the "no identity → CAS passes" regression class). That hardening was never landed:file-stable-write.tsstill skips the compare-and-delete when the captured identity is absent. A tracked issue should restore the decision record and land the union infile-stable-write.ts.AI use
Tool(s) and scope: Claude Code — the scan/verification loop, the removals, the rebase and epoch sync, the review-follow-up rework, and this description. Every deletion was verified consumer-free by grep before removal; pre-commit gates (biome, ASF headers, protocol epoch) pass on the tree.
Checklist
Generated-by: Claude CodeDoes this PR entail a change in behavior?