Skip to content

chore(repo): remove dead code and repository noise#294

Merged
RtlZeroMemory merged 1 commit intomainfrom
codex/dead-code-sweep
Mar 18, 2026
Merged

chore(repo): remove dead code and repository noise#294
RtlZeroMemory merged 1 commit intomainfrom
codex/dead-code-sweep

Conversation

@RtlZeroMemory
Copy link
Copy Markdown
Owner

@RtlZeroMemory RtlZeroMemory commented Mar 18, 2026

Summary

  • Removed or relocated proven dead/misplaced code.
  • Kept runtime behavior unchanged.

Evidence

  • Deleted packages/core/src/constraints/aggregation.ts: repo-wide search found no imports or re-exports; npx --yes --package knip knip --reporter compact reported it as an unused file; sibling aggregation behavior remains implemented directly in packages/core/src/constraints/resolver.ts and is still covered by the existing constraint tests.
  • Deleted packages/core/src/renderer/renderToDrawlist/overflowCulling.ts: repo-wide search found no imports or re-exports; Knip reported it as an unused file; overflow handling used at runtime remains in renderTree.ts and widgets/containers.ts.
  • Deleted packages/ink-compat/src/_bench_layout_profile.ts: repo-wide search found no imports, exports, or script references; Knip reported it as an unused file; it was shipping in the publishable source tree without any wired benchmark path.
  • Moved packages/core/src/widgets/tests/protocol.test.ts to packages/core/src/widgets/__tests__/protocol.test.ts: the test had no runtime imports, compiled into dist/widgets/tests, and sat outside the package exclusion pattern for __tests__; after the move it builds into dist/widgets/__tests__ and is picked up by the normal test discovery path.
  • Moved packages/node/src/worker/testShims/* to packages/node/src/__tests__/worker/testShims/*: repo-wide search showed these shims are referenced only from packages/node/src/__tests__/worker_integration.test.ts and packages/node/src/__e2e__/runtime-reduced.e2e.test.ts; path rewrites preserve behavior while moving them under package-excluded test output.
  • Reworded stale temporary-profiling comments in packages/core/src/layout/engine/layoutEngine.ts and packages/core/src/pipeline.ts without changing the exported __layoutProfile hook.
  • Knip after cleanup no longer reports packages/core/src/constraints/aggregation.ts, packages/core/src/renderer/renderToDrawlist/overflowCulling.ts, or packages/ink-compat/src/_bench_layout_profile.ts as unused files. It still reports the relocated node test shims as unused-file false positives because they are loaded only via test URL strings and dynamic imports.
  • npx depcruise ... resolves to the wrong published package in this environment, so I used the allowed dependency-cruiser / madge fallbacks. npx -y dependency-cruiser --no-config packages/core/src packages/node/src packages/jsx/src --output-type err reported no violations but only cruised 3 modules / 2 dependencies, so I cross-checked with npx -y madge --circular --extensions ts,tsx,mjs --exclude '(^|/)dist/' --ts-config tsconfig.json packages/core/src packages/node/src packages/jsx/src, which reported 7 pre-existing cycles in packages/core/src/widgets/types*.ts and no cleanup-induced cycles.

Validation

  • npm run lint
  • npm run typecheck
  • npm run build
  • node scripts/run-tests.mjs
  • npx --yes --package knip knip --reporter compact
  • npx -y dependency-cruiser --no-config packages/core/src packages/node/src packages/jsx/src --output-type err
  • npx -y madge --circular --extensions ts,tsx,mjs --exclude '(^|/)dist/' --ts-config tsconfig.json packages/core/src packages/node/src packages/jsx/src
  • find packages/core/dist -path '*/widgets/tests/*' -o -path '*/widgets/__tests__/protocol.test.js' | sort
  • find packages/node/dist -path '*/worker/testShims/*' -o -path '*/__tests__/worker/testShims/*' | sort
  • find packages/ink-compat/dist -name '*bench_layout_profile*' | sort

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

This PR performs cleanup across multiple packages: removes aggregation constraints and overflow culling modules, updates profiling infrastructure documentation, eliminates temporary benchmarking utilities, and corrects relative import paths in test files.

Changes

Cohort / File(s) Summary
Removed constraint and rendering utilities
packages/core/src/constraints/aggregation.ts, packages/core/src/renderer/renderToDrawlist/overflowCulling.ts
Deleted two utility modules: aggregation constraints (AggregationRequest, computeSiblingAggregations, aggregationKey, collectAggregationRequests, SiblingMetricReader types) and overflow culling predicates (subtreeCanOverflowBounds and related helpers).
Profiling infrastructure updates
packages/core/src/layout/engine/layoutEngine.ts, packages/core/src/pipeline.ts
Updated comments clarifying profiling infrastructure intent: changed from "Temporary profiling (remove after investigation)" to permanent descriptions like "Layout profiling counters exposed via the pipeline API" and "Layout profiling hooks".
Removed temporary benchmarking utilities
packages/ink-compat/src/_bench_layout_profile.ts
Deleted benchmarking module containing layoutCounters object, resetLayoutCounters(), and dumpLayoutCounters() utility functions along with perf_hooks dependency.
Test import path corrections
packages/node/src/__e2e__/runtime-reduced.e2e.test.ts, packages/node/src/__tests__/worker_integration.test.ts
Updated relative import paths for test shims: changed ../worker/... patterns to correct paths (../__tests__/worker/... and ./worker/...).

Possibly related PRs

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Culling away the clutter we go,
Aggregations and profiles let them go! 🐰✨
Paths now corrected, cleaner the way,
Profiling persists—here to stay!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(repo): remove dead code and repository noise' directly and clearly describes the main purpose of the PR, which is removing unused files and organizational cleanup.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/dead-code-sweep
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@RtlZeroMemory RtlZeroMemory merged commit 8f3a1c2 into main Mar 18, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant