refactor(server): classify source control registry API#10280

merged1
main
cleanup-server/source-control-registry
openedSep 6, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

The source-control registry's alternate constructor is part of the module-owned Effect service API even though the runtime currently uses the default constructor. This marks it explicitly public so Knip preserves the construction seam without a broad ignore.

This is layer 7 of 9 in the server Knip cleanup stack.

Verification after rebasing onto current main: server typecheck and the server-only Knip export audit pass. Changed-file lint and formatting pass, with one existing lint warning. Focused auth, provider, source-control, preview toolkit, orchestration, and Knip preprocessor tests pass: 90 tests across 9 files. This changes server export visibility and static analysis; screenshots do not apply.

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

Summary by CodeRabbit

  • Documentation
    • Added public API documentation for service construction.

Note

Tighten module exports and add API docs to sourceControl services

  • Removes export from many internal helpers, constants, error guards, and factory functions across the server, making them module-private. The public service constructors and manifest exports remain.
  • Adds public API documentation annotations to Effect service constructors throughout apps/server/src, especially in sourceControl provider and registry modules.
  • Removes unused Layer imports and the exported layer wrappers in AzureDevOpsSourceControlProvider.ts, BitbucketSourceControlProvider.ts, GitHubSourceControlProvider.ts, and GitLabSourceControlProvider.ts; the provider constructors themselves remain exported.
  • Removes formatSchemaError imports and the exported format*JsonDecodeError aliases in the Azure DevOps, GitHub, and GitLab pull-request JSON helper modules.
  • Risk: consumers importing any of the now-private symbols (e.g. defaultTextGenerationPolicy, makeServerLayer, isGitLabCliError, defaultInstanceIdForDriver) will fail to compile. All in-tree references are updated, but out-of-tree or downstream code relying on these exports will break.

Macroscope summarized b0e2bc4.

Synced from GitHub

Approvability

Verdict: Approved at 7569305

Macroscope's review found this PR approvable โ€” The PR only adds an established @public documentation annotation to an existing Effect service constructor. It changes API metadata rather than executable behavior, configuration, defaults, or production workflows.

No code changes detected at c0a3f57. Prior analysis still applies.

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

Synced from GitHub

Thread transfer impact

โœ… Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.6 KiB13.6 KiBโˆ’12 B (โˆ’0.1%)15.1 KiBโœ…
CodexThread snapshot wire7.0 KiB7.1 KiB+9 B (+0.1%)7.3 KiBโœ…
CodexLive turn WebSocket wire6.6 KiB6.6 KiBโˆ’21 B (โˆ’0.3%)7.8 KiBโœ…
CodexLive turn WebSocket decoded57.1 KiB57.1 KiB0 B (0.0%)66.4 KiBโœ…
CodexLive turn messages10100 (0.0%)21โœ…
ClaudeTotal thread wire13.6 KiB13.6 KiBโˆ’18 B (โˆ’0.1%)15.1 KiBโœ…
ClaudeThread snapshot wire7.0 KiB7.0 KiBโˆ’6 B (โˆ’0.1%)7.3 KiBโœ…
ClaudeLive turn WebSocket wire6.6 KiB6.6 KiBโˆ’12 B (โˆ’0.2%)7.8 KiBโœ…
ClaudeLive turn WebSocket decoded57.9 KiB57.9 KiB0 B (0.0%)66.4 KiBโœ…
ClaudeLive turn messages10100 (0.0%)21โœ…

Baseline: 3b6ce93 ยท PR result: c0a3f57 ยท 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.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

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

Synced from GitHub

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. ๐ŸŽ‰

โ„น๏ธ Recent review info
โš™๏ธ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a546249f-ed43-44af-87ab-8b5ab40eb60d

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 3006c8731afadb92c6bda06891c29bfe01387539 and b0e2bc4a9f407af4b55224e32a61e04060d0747e.

๐Ÿ“’ Files selected for processing (1)
  • apps/server/src/sourceControl/SourceControlProviderRegistry.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


๐Ÿ“ Walkthrough

Walkthrough

The change adds a JSDoc @public comment above the exported makeWithProviders function. Runtime behavior and exported declarations remain unchanged.

Changes

Source control API documentation

Layer / File(s)Summary
Document makeWithProviders construction
apps/server/src/sourceControl/SourceControlProviderRegistry.ts
The exported function now documents service construction as part of the canonical Effect module API.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: โšช Minimal ยท up to c0a3f

This change documents the source-control registry construction API without changing runtime behavior or exported declarations. It is ready to merge.

๐Ÿšฅ Pre-merge checks | โœ… 4 | โŒ 1

โŒ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverageโš ๏ธ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
โœ… Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues checkโœ… PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkโœ… PassedCheck skipped because no linked issues were found for this pull request.
Title checkโœ… PassedThe title clearly identifies the source-control registry API classification and matches the main change.
Description checkโœ… PassedThe description explains what changed, why it changed, scope, verification results, and why UI evidence does not apply. It does not use the template headings, but it provides the required information โ€ฆ
โœจ Finishing Touches ๐Ÿ’ก 1
๐Ÿ“ Generate docstrings ๐Ÿ’ก
  • Create stacked PR
  • Commit on current branch
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-server/source-control-registry

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

Added 1 commit

  • refactor(server): classify source control registry APIc0a3f57