fix(next): crash-safety base red: constant regexes without try!, one process-info return

Merged
TE
17d ago
+54-30

Summary

check-crash-safety.sh failed on feat-cmux-next (Crash safety, in cmux-next checks) with 12 try! and one tuple returned from both an awaiting do and its catch. All 13 are gone, with no change for a pattern that compiles:

  • VerificationMessageParser, ErrorNormalizer and LogLineParser compile their constant regexes with try?. A pattern that ever failed to compile would find nothing instead of crashing the app.
  • ErrorRedactor fails closed: if any pattern is missing, it returns <redacted> for the whole text instead of journaling half-scrubbed text.
  • LiveWorkspaceCreation.runningPrograms (cnx-ios) assigns the process-info result to a local and returns once (swiftlang/swift#92698 drops the tuple's first element at -O).

The regex half follows #22360's approach; that PR bundles many other fixes and conflicts with the base, so this lands the crash-safety part alone.

Testing

bash scripts/cmux-next/check-crash-safety.sh Packages/macOS/CmuxNext:

  • base 2cd6ae166f69: check-crash-safety: 13 violation(s) (the 13 above), exit 1.
  • head: check-crash-safety: ok.

Observed / Not run

  • The step stays red after this for a different reason: with the try! exit gone, crash_ratchet.py now runs and reports a backlog of 35 modules/crates over its absolute baseline (banned unowned, assumeIsolated, iuo, index_subscript hits and counted classes) that the early exit was hiding. This PR adds none of them; the per-push cmux-next crash ratchet guard (relative to the base) stays green. Clearing or re-baselining that backlog needs the crash lead's sign-off on allowlist entries and is not in this PR.
  • Swift was not compiled locally (Linux). The fleet compile-check (cmux-ci compile-check --package CmuxNext) failed twice at source checkout (fatal: repository 'manaflow-ai/cmux' does not exist), so the PR's own CI compile lanes are the compile evidence.

Changelog

none

๐Ÿค– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the 13 crash-safety violations that check-crash-safety.sh reports on feat-cmux-next: 12 constant regexes compiled with try! and a tuple returned from both an awaiting do and its catch.

  • VerificationMessageParser, ErrorNormalizer, and LogLineParser compile their constant regexes with try?; a pattern that ever failed to compile now matches nothing instead of crashing.
  • ErrorRedactor fails closed: if any rule fails to compile, redact(_:) returns <redacted> for the whole text rather than journaling half-scrubbed output.
  • LiveWorkspaceCreation.runningPrograms assigns the process-info result to a local and returns it once, avoiding the Swift optimizer issue (swiftlang/swift#92698) that drops a tuple's first element at -O.

The regex changes follow #22360's approach, scoped here to the crash-safety part since that PR bundles other fixes and conflicts with the base. check-crash-safety.sh goes from 13 violations to ok; the step stays red only because crash_ratchet.py now reports a pre-existing backlog of 35 modules โ€” this PR adds none of them.