refactor(shared): remove unused runtime helpers and exports#10166

merged4
main
cleanup-packages/shared-internals
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

Shared exports several implementation helpers that no consumer uses.

Remove the four unused model, composer, and source-control helpers and keep remaining implementation-only functions/constants private. Preserve exported types and Effect schemas under the revised Knip policy. Keep the public Net constructor required by the repository's Effect service convention.

Verification: shared typecheck and existing shared/source-control tests pass on the rebased stack. The integrated Knip gate passes. No existing tests were changed or removed.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.5 KiB13.6 KiB+71 B (+0.5%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB+6 B (+0.1%)7.3 KiB✅
CodexLive turn WebSocket wire6.5 KiB6.6 KiB+65 B (+1.0%)7.8 KiB✅
CodexLive turn WebSocket decoded57.0 KiB57.1 KiB+88 B (+0.2%)66.4 KiB✅
CodexLive turn messages810+2 (+25.0%)21✅
ClaudeTotal thread wire13.6 KiB13.6 KiB−3 B (−0.0%)15.1 KiB✅
ClaudeThread snapshot wire7.0 KiB7.0 KiB−8 B (−0.1%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB+5 B (+0.1%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB0 B (0.0%)66.4 KiB✅
ClaudeLive turn messages990 (0.0%)21✅

Baseline: cb9a694 · PR result: 56a7d66 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Approved at 56a7d66

Macroscope's review found this PR approvable — This is a contained shared-code cleanup that narrows unused exports and keeps all internally used implementations and values unchanged. No new capability, product-default change, deployment change, or sensitive-area modification is introduced.

You can add or adjust custom eligibility rules. Learn more.

packages/shared/src/Net.tsline 66Outdated · fd0c6e2Open thread
……@@ -63,7 +63,7 @@ export class NetService extends Context.Service<NetService, NetServiceShape>()(
6464) {}
6565
66-export const make = () => {
66+const make = () => {
MmacroscopeappBoton line 66Sep 5, 2026

src/Net.ts:66

Net.ts is the canonical module that owns construction of NetService, so make should stay part of its public shape (Net.NetService, Net.make, Net.layer) alongside layer. Consider keeping the export so consumers (e.g. tests or alternate layer constructors) can build the service without going through layer.

suggestion
1export const make = () => {

No longer relevant as of b74ac2585843050870808b875fdedfd05ef4695d

Restored Net.make in b74ac25. The adjacent @public comment explains the required service construction API. The expanded Knip check passes with this deliberate export retained.

Added 3 commits

  • refactor(shared): retain the public Net constructor7c857d6
  • refactor(shared): remove unused helpers and private exportsc5a2151
  • refactor(shared): retain exported types and schemasd5f8565
Synced from GitHub

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

packages/shared/src/schemaYaml.tsline 90Outdated · d5f8565Open thread
……@@ -89,9 +87,7 @@ export function parseYaml<E extends string>(
92-export function stringifyYaml(
93- options?: YamlStringifyOptions,
94-): SchemaGetter.Getter<string, unknown> {
90+function stringifyYaml(options?: YamlStringifyOptions): SchemaGetter.Getter<string, unknown> {
MmacroscopeappBoton line 90Sep 5, 2026

🟢 Low src/schemaYaml.ts:90

The retained examples import non-exported parseYaml and stringifyYaml, so following either documented recipe throws a module import error instead of producing a getter. Update the examples to use the exported APIs or restore those exports.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
text
1In file @packages/shared/src/schemaYaml.ts around line 90:
2
3The retained examples import non-exported `parseYaml` and `stringifyYaml`, so following either documented recipe throws a module import error instead of producing a getter. Update the examples to use the exported APIs or restore those exports.

Fixed in 56a7d66. Removed the stale public-import examples from the private YAML getters and kept the valid exported fromYamlString example. The existing YAML suite passes all five tests and the integrated Knip gate passes.

Added 1 commit

  • docs(shared): remove stale examples for private YAML helpers56a7d66