Commit ea279cd
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_01CgaxNAaeD3taGdghbXn17w1 parent 63fdec9 commit ea279cd
34 files changed
Lines changed: 218 additions & 2358 deletions
File tree
- apps/sim
- app/api/copilot/chat
- lib
- api/contracts
- execution/remote-sandbox
- mothership
- application
- generated
- request
- go
- handlers
- lifecycle
- session
- tools
- tools
- client
- handlers
- agent-cli
- workflow
- server
- files
- packages/sim-cli/src
- commands
- protocol
- runtime
- scripts
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | 589 | | |
609 | 590 | | |
610 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
915 | 917 | | |
916 | | - | |
917 | | - | |
| 918 | + | |
918 | 919 | | |
919 | 920 | | |
920 | 921 | | |
| |||
1084 | 1085 | | |
1085 | 1086 | | |
1086 | 1087 | | |
1087 | | - | |
| 1088 | + | |
1088 | 1089 | | |
1089 | | - | |
1090 | | - | |
| 1090 | + | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 118 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
126 | 122 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 123 | + | |
| 124 | + | |
132 | 125 | | |
133 | 126 | | |
134 | 127 | | |
| |||
155 | 148 | | |
156 | 149 | | |
157 | 150 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
163 | 154 | | |
164 | 155 | | |
165 | 156 | | |
| |||
381 | 372 | | |
382 | 373 | | |
383 | 374 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
| 375 | + | |
388 | 376 | | |
389 | 377 | | |
390 | 378 | | |
| |||
399 | 387 | | |
400 | 388 | | |
401 | 389 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
| 390 | + | |
409 | 391 | | |
410 | 392 | | |
411 | 393 | | |
| |||
Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 0 additions & 14 deletions
This file was deleted.
0 commit comments