Skip to content

refactor(types): move routing-profile config types out of src/types/config.ts - #8830

Merged
lidge-jun merged 3 commits into
devfrom
chore/config-types-headroom
Nov 16, 2026
Merged

lidge-jun merged 3 commits into
devfrom
chore/config-types-headroom

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

src/types/config.ts is 1,996 lines on dev. The file-size ratchet fails any untracked file that reaches 2,000 lines, and queued #8788 adds 4 lines to it, which would put it at exactly 2,000 and turn the ratchet red.

This moves the ten routingProfiles declarations (OcxRoutingProfileConfig and the nine types it is built from, 88 lines with their doc comments) into a new sibling module, src/types/routing-profile.ts. The group is self-contained: it references nothing else in config.ts, and config.ts uses it only for the routingProfiles field. config.ts imports OcxRoutingProfileConfig for that field and re-exports all ten names, so no import site changes.

It is a pure move. The moved block is byte-identical to lines 1578–1665 of origin/dev (checked with diff), with no renames and no behaviour change. config.ts drops from 1,996 to 1,912 lines.

A small source test, tests/config/routing-profile-types-reexport.test.ts, guards the re-export contract: config.ts must re-export exactly the names routing-profile.ts declares and must not re-declare any of them, and routing-profile.ts must stay import-free. It is registered in scripts/test-layout/layout-config.json (at the top of the file, so it does not collide with #8788's append) and tests/fixtures/test-layout-expected.json.

structure/manifest.json already owns src/types/ at directory level, and no structure doc names the file holding these types, so no structure update was needed.

Verification

All test commands ran under /usr/bin/lockf -k /tmp/ocx-test.lock because the machine is under heavy load.

  • bun run typecheck: no type errors in 2,552 files.
  • bun run structure:check: structure/ SSOT checks passed.
  • bun test tests/config/routing-profile-types-reexport.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts: 41 pass, 0 fail.
  • The new test goes red when one name is dropped from the re-export (1 fail) and green on this tree.
  • git merge-tree --write-tree HEAD origin/pull/8788/head: clean, no conflicts. The merged src/types/config.ts is 1,916 lines.

Not run: the full bun run test suite, because of host load. The source change is type-only and the typecheck covers every import site; CI's test changed covers the import graph.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (None needed: this is an internal type move.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No security-sensitive surface touched.)

Summary by CodeRabbit

  • New Features
    • Added reusable routing-profile configuration types, covering candidates, requirements, optimization, limits, unknown-evidence policies, and compatibility settings.
    • Made these types available through the existing configuration type exports.

…ting-profile.ts

Pure move of the ten routingProfiles declarations out of src/types/config.ts, re-exported from config.ts so no import site changes. Restores headroom under the 2,000-line file-size ratchet (1,996 -> 1,912 lines).
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 16, 2026 12:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T12:55:24.819693Z 896a606 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the intake: hygiene-blocked Deterministic PR hygiene checks failed label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • missing_regression_test — Behavior changed under src/ or gui/src/ without a test change. Add focused coverage or obtain test-exception-approved.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft November 16, 2026 12:54
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Routing-profile configuration types now live in a dedicated module. The config types module re-exports them. New tests check the re-export arrangement and are included in the test-layout mappings.

Changes: Routing-profile types

Layer / File(s) Summary
Define routing-profile contracts
src/types/routing-profile.ts
Adds exported types for candidates, requirements, optimization weights, limits, unknown-evidence policies, compatibility settings, and the profile configuration.
Expose and verify routing-profile types
src/types/config.ts, tests/config/routing-profile-types-reexport.test.ts, scripts/test-layout/layout-config.json, tests/fixtures/test-layout-expected.json
Re-exports the dedicated module's types from config.ts in place of its local declarations. Tests check that the exports match, that config.ts has no duplicate declarations, and that routing-profile.ts has no imports. The test-layout mappings include the new test.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: Minimal · up to fa0cb

This refactor moves routing-profile type declarations into their own module and keeps existing imports working through re-exports. No runtime behavior changes, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: moving the routing-profile config types out of src/types/config.ts. The raw summary confirms config.ts now re-exports these types from routing-profile.ts and routing-p…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: moving the routing-profile config types out of src/types/config.ts. The raw summary confirms config.ts now re-exports these types from routing-profile.ts and routing-profile.ts holds the declarations. The title is specific, concise, and uses a conventional refactor(types) prefix. It omits the re-export and test-guard details, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e62140c and fa0cbeb.

Files selected for processing: 5

  • scripts/test-layout/layout-config.json
  • src/types/config.ts
  • src/types/routing-profile.ts
  • tests/config/routing-profile-types-reexport.test.ts
  • tests/fixtures/test-layout-expected.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@github-actions github-actions Bot removed the intake: hygiene-blocked Deterministic PR hygiene checks failed label Nov 16, 2026
@github-actions
github-actions Bot marked this pull request as ready for review November 16, 2026 12:55
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration of #8830 at fa0cbeb.

  • Why: src/types/config.ts was 1,996 lines, and queued feat(codex): give Luna Reserve its own setting, seeded once from authless #8788 adds 4. The file is not in the size baseline, so it fails at 2,000. This PR moves the ten routing-profile declarations (OcxRoutingProfileConfig and the nine types it is built from) into src/types/routing-profile.ts, which brings config.ts to 1,912 lines.
  • Pure move: the moved block is identical to dev lines 1578–1665; the only addition is a one-line file header. config.ts re-exports all ten names, so no import site changes. A small test pins that the re-export set is exactly what routing-profile.ts declares, that nothing is declared twice, and that routing-profile.ts imports nothing; it fails when a name is dropped. The PR hygiene gate required a test for the src/ change.
  • CI on this exact head: all 33 checks passed, including enforce-target. assert-mergeable-review: OK. Simulated merge onto the dev of this moment: clean. git merge-tree with feat(codex): give Luna Reserve its own setting, seeded once from authless #8788: clean, and the merged config.ts is 1,916 lines.

@lidge-jun
lidge-jun merged commit a8d1491 into dev Nov 16, 2026
38 of 41 checks passed
@lidge-jun
lidge-jun deleted the chore/config-types-headroom branch November 16, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant