chore(cleanup): apply codebase-design deep-module pass across the monorepo

Merged
WA
17d ago
+1298-17546

Summary

  • Deep-module cleanup pass (deletion test, single-adapter seams, pass-throughs) applied repo-wide: delete modules that fail the deletion test, remove single-adapter seams and one-line pass-throughs, and concentrate logic that was copied across callers into one module
  • Dead code removed (mostly orphaned by the mothership v1.0.0 cutover): lib/platform-context, workflow VFS use cases, unreachable Copilot table/workflow handlers, credential-group invite use cases, table group/column/import use cases, workspace-file orchestration, scheduled-tasks/utils, ~150 unused exports and the mocks/tests that only covered them
  • Removed the dead isInternalRequest admission bypass in v2 routes — nothing in production marks requests internal, so every request already took the rate-limited path
  • Deepened shared modules:
    • resolvePrincipalWorkflowContext replaces 16 copies of the workflow context resolver
    • getCredentialAccessToken replaces 13 copies of the credential→token lookup in webhook subscriptions; toRecord replaces 26 providerConfig casts
    • buildJsonSchemaResponseFormat replaces the response_format literal in 11 providers
    • escapeLikePattern (@sim/utils/string) replaces 6 LIKE-escape copies; file sniffer reuses zip-guard EOCD parsing
    • Subflow node-id codec exports its functions directly; ~25 forwarders removed
    • App now uses @sim/workflow-persistence subflow helpers, @sim/auth/principal anonymous user, and @sim/workflow-renderer tile color instead of local copies
    • Shared @sim/utils helpers replace ~40 inline toRecord/isRecordLike/sleep/toError copies
  • Behavior change: a malformed (non-object) webhook providerConfig now reads as {}
  • Follow-up: the table-update background task now has no producer; kept one release so in-flight runs drain

Type of Change

  • Chore / refactor (no intended behavior change)

Testing

  • bunx turbo run type-check (26/26), bun run lint, bun run check:audits (54/54), block-registry check, docs-manifest:check
  • Full apps/sim vitest suite (3,255 files, 34,516 tests) and all package test suites (18/18)
  • Six independent audits re-verified reachability of every deletion (string ids, dynamic imports, mocks, Chat tool catalog) and byte-identical behavior of every consolidation; their fixes are included

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code