Skip to content

Commit c999ef2

Browse files
committed
refactor(mothership): sim-side quality pass + dead-code sweep from the parity hill-climb
Quality (25 verified findings from the review pass): the embedded CLI's soft-fail exit code rode the process-global exitCode two parallel invocations raced on — it now rides the EmbedContext (setSoftExitCode seam, global fallback for the standalone CLI). Model-authored wire params lose their bare as-casts for typeof guards (run segments, run-tool params, output-file declarations, function-execute refs via one refField helper); the six copy-pasted cancel-settlement blocks in the tool executor fold into one settleCancelled; five error-completion literals into one builder; three title-casing humanizers into one; the sandbox image cache moves from a hand-rolled TTL map to lru-cache; sleepWithAbort yields to interruptibleSleep; plus dead re-exports, a pass-through wrapper, a dead param, an unreachable busy-spin branch made an invariant, and misc rule violations (inline sleep/getErrorMessage/truncate, mid-file import, retired-tool literal). Dead code (verified-unreferenced, from the Go-era audit): four delegated use-cases replaced by sim_cli, the file-subagent doc raster pipeline, env secret-ref resolution, workflow-state prompt formatting, the runtime stream-schema mirror (sync script trimmed to match), the workflow checkpoint/revert feature (routes + contracts; table drop deferred), and five orphaned copilot routes (update-messages, models, credentials, rename, and the duplicate chat mount — /api/mothership/chat is the live path). LONG_RUNNING_TOOL_IDS trimmed to the live tool surface with tests re-anchored. Go-decommission-gated routes (tools/execute, key/byok validate, inbandOwned) and policy items (steering chain, Go-era replay titles) deliberately kept — listed in the audit doc for Sid. Claude-Session: https://claude.ai/code/session_01CgaxNAaeD3taGdghbXn17w
1 parent 6ed6ec3 commit c999ef2

43 files changed

Lines changed: 219 additions & 4908 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/sim/app/api/copilot/chat/rename/route.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)