Skip to content

chore(startup): remove server-init.ts, a module nothing imports - #10780

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
maxmad64bis:fix/server-init-dead-code
Aug 20, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
maxmad64bis:fix/server-init-dead-code

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #9985

Summary

Related Issues

Validation

  • Change type: other (dead-code removal)
  • Focused tests and category gates from the golden path: the four suites that asserted on the
    module (82 pass, 2 skipped), npm run test:vitest (368/368), npm run check:docs-all
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR
  • SonarQube is temporarily opt-in while the private project has no quota; it is not a PR gate.

Tests Added Or Updated

  • tests/integration/integration-wiring.test.ts
  • tests/integration/security-hardening.test.ts
  • tests/unit/lib/jobRegistry/boot-wiring.test.ts
  • tests/unit/cleanup-column-fix.test.mjs
  • tests/unit/thinking-budget-hydration-5312.test.ts (comment only)

Assertions that only read the server-init.ts source are removed, or redirected to the live path
(instrumentation-node.ts, initCloudSync.ts), so they now cover the module that actually runs.

Coverage Notes

  • No production code is added: a file is deleted together with the assertions that only described
    it. The live boot path keeps its coverage and is now asserted directly instead of through the
    dead module.

Reviewer Notes

  • No behavior change — the module never executed.
  • Localized copies under docs/i18n/ still name the file. They are generated and catch up on the
    next translation run.
  • Overlaps with chore(security): drop the unused enforceSecrets() duplicate #10775 on src/server-init.ts and two test files. Both are independently
    mergeable; whichever lands second needs a trivial rebase.
  • npm run check:docs-all still reports two failures (BOT_TOKEN / BOT_URL absent from
    .env.example, executors count in ARCHITECTURE.md). Both are pre-existing and outside this
    diff — the diff touches one line in each of .env.example and ENVIRONMENT.md.

src/server-init.ts (183 lines) imported 20 modules and started 17
initializations, but nothing ever imported it — the real boot path is the
Next.js instrumentation hook (src/instrumentation-node.ts), which already
wires every job it registered. Four comments across the codebase pointed
contributors at "server-init.ts" as the place a job runs from; corrected
them to name instrumentation-node.ts instead.

Updated the tests that asserted on the dead module directly (its own
wiring-check suite, a security-hardening probe, and two scheduler-wiring
guards) to assert on instrumentation-node.ts / initCloudSync.ts, the paths
that actually run in production.
@maxmad64bis
maxmad64bis force-pushed the fix/server-init-dead-code branch from 6379d57 to a4cc241 Compare August 20, 2026 10:37
@maxmad64bis

Copy link
Copy Markdown
Contributor Author

Rebased onto bc6129bcb — the conflict is gone (MERGEABLE).

The conflict came from #10775, which landed first and touched the same module: it removed enforceSecrets() from src/server-init.ts and dropped the matching assertions. Resolution kept this PR's intent, which is a superset — the whole module goes:

  • src/server-init.ts — deleted (modify/delete).
  • tests/integration/integration-wiring.test.ts — the Pipeline Wiring — server-init.ts block is removed entirely rather than trimmed.
  • tests/integration/security-hardening.test.ts — dropped from the diff: chore(security): drop the unused enforceSecrets() duplicate #10775 already applied those 6 lines. The PR is now 17 files instead of 18.

Re-ran after the rebase: the 7 affected test files pass (105 tests, 0 failing, 4 skipped), npm run test:vitest 368/368, npm run lint 0 violations.

All 7 red checks on this run are inherited base-red, none of them from this diff:

Check Cause
Docs Gates (fast-path) 5 strict drifts, all the provider count 342 vs the live 343 (PROVIDER_REFERENCE.md + 4 SVGs) — files this PR does not touch. Named in the #9985 verdict for the 3810a6c52..bc6129bcb range.
Fast Quality Gates same failure on unrelated PRs cut from the same base.
Unit Tests fast-path 1/4 … 4/4 same four shards fail on unrelated PRs cut from the same base.
No new ESLint warnings the ratchet fails on i18nUiCoverage.pct: 99.4 < baseline 100. This diff contains no UI file and no locale file, so it cannot move that metric.

⚠️ base-red inherited: #9985

@diegosouzapw
diegosouzapw merged commit ff8b7b1 into diegosouzapw:release/v3.8.50 Aug 20, 2026
5 checks passed
@maxmad64bis
maxmad64bis deleted the fix/server-init-dead-code branch August 20, 2026 16:38
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…osouzapw#10780)

Merged — validated together with a batch of related maxmad64bis PRs in one combined worktree (typecheck:core clean, complexity/cognitive-complexity/file-size/changelog gates green, focused tests passing). Thanks for the contribution!
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.

2 participants