Skip to content

fix(modules): no unjustified unwraps (55 -> 0) - #5167

Closed
joelteply wants to merge 2 commits into
canaryfrom
sonnet/no-unwraps-modules
Closed

joelteply wants to merge 2 commits into
canaryfrom
sonnet/no-unwraps-modules

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

modules/: 55 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit for file-level #![cfg(test)]).

  • 32 were in two files that only compile under cargo test (plasticity/validation.rs behind #[cfg(test)] mod; airc_runtime_e2e_tests.rs whose mod is commented out): now marked #![cfg(test)], counted as test code
  • 2 poisoned lock unwraps -> PoisonError::into_inner with reason
  • 5 justified in place (3 constant regex literals, resolve_continuum_root + SentinelModule::new need HOME or the process has no persistent state; resolve_continuum_root has 20+ callers in persona/ cognition/ ipc/, so its signature is left for a coordinated change)
  • 16 structural/typed: embedding SIMD uses slice::as_chunks::<8>() (no try_into); generator name/ live.rs/ grid handlers let-else or if-let; AIProviderModule logger falls back to the component logger (std OnceLock::get_or_init) instead of panicking before initialize; DMR/ds4 probe addresses built as SocketAddr literals; nav serialize failure logged; plasticity compactor builds one Vec of tensors (no HashMap re-lookup) and serialize_tensors propagates TensorView errors with ?; sentinel checkpoint dir returns Result (all callers already Result); vdd module artifact_root is Option and the module exposes no commands (logged) when there is no home
    Tests: cargo test -p continuum-core --lib modules:: = 1107 passed, 1 ignored; source-hygiene unwrap_justification = pass, count 2078.

Behavior change: panics become typed, handled outcomes. Needs a real review, not only CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 2 commits October 18, 2026 14:05
…duction

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
modules/: 55 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 32 were in two files that only compile under cargo test (plasticity/validation.rs behind #[cfg(test)] mod; airc_runtime_e2e_tests.rs whose mod is commented out): now marked #![cfg(test)], counted as test code
- 2 poisoned lock unwraps -> PoisonError::into_inner with reason
- 5 justified in place (3 constant regex literals, resolve_continuum_root + SentinelModule::new need HOME or the process has no persistent state; resolve_continuum_root has 20+ callers in persona/ cognition/ ipc/, so its signature is left for a coordinated change)
- 16 structural/typed: embedding SIMD uses slice::as_chunks::<8>() (no try_into); generator name/ live.rs/ grid handlers let-else or if-let; AIProviderModule logger falls back to the component logger (std OnceLock::get_or_init) instead of panicking before initialize; DMR/ds4 probe addresses built as SocketAddr literals; nav serialize failure logged; plasticity compactor builds one Vec of tensors (no HashMap re-lookup) and serialize_tensors propagates TensorView errors with ?; sentinel checkpoint dir returns Result (all callers already Result); vdd module artifact_root is Option and the module exposes no commands (logged) when there is no home
Tests: cargo test -p continuum-core --lib modules:: = 1107 passed, 1 ignored; source-hygiene unwrap_justification = pass, count 2078.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Folded into #5172 (one branch, one CI run). The review and test receipts are there.

@joelteply joelteply closed this Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant