Remove process env mutation (#177) (#221) - #223
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can activate billing to continue. Comment |
aaacec5 to
519396a
Compare
Reviewer's GuideThe PR establishes Sequence diagram for injected environment configurationsequenceDiagram
participant EntryPoint
participant Env as mockable::Env
participant Configuration
EntryPoint->>Configuration: load_with_env(Env)
Configuration->>Env: string(variable)
Env-->>Configuration: configured value or None
Configuration-->>EntryPoint: resolved configuration
Note over EntryPoint,Env: Production supplies DefaultEnv, tests supply MockEnv
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Replace process-global HNSW test mutation with MockEnv-backed configuration injection, so property tests can run concurrently without unsafe access. Route environment-variable reads through mockable::Env across the workspace and deny the direct std::env methods to prevent regression.
Regenerate the lockfile for the lint-policy branch dependency graph and resolve the rebased test configuration lint findings. Record the isolated property-test timeout experiment and the shared test-binary reader decision for the active lint-policy plan.
Keep the parent branch's `map_or` policy parsing while preserving the injected mockable environment reader. The previous rebase replay left both loader bodies in the implementation block, preventing the test-support crate from compiling.
519396a to
f3c778f
Compare
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Failed
Enforce advisory code health rules
(1 file with String Heavy Function Arguments)
Our agent can fix these. Install it.
Gates Passed
5 Quality Gates Passed
Reason for failure
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| process.rs | 1 advisory rule | 9.69 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| tests.rs | 9.39 → 10.00 | Code Duplication |
Absence of Expected Change Pattern
- chutoro/chutoro-core/src/hnsw/tests/property/types.rs is usually changed with: chutoro/chutoro-core/src/hnsw/tests/property/strategies.rs
- chutoro/chutoro-providers/dense/src/simd/tests.rs is usually changed with: chutoro/chutoro-providers/dense/src/simd/kernels.rs
Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
Summary
This change removes process-global environment mutation from the HNSW property
tests. Configuration now flows through injected
mockable::Envobjects, andtests use
MockEnv, so they can execute independently and in parallel.It applies the same injection boundary to the workspace remaining
environment-variable readers and denies direct
std::envmethods that wouldbypass it.
Closes #177
Closes #221
Review walkthrough
DefaultEnv; tests supplyMockEnv.Validation
make check-fmtmake test(1,082 passed; 1 skipped)make typecheckmake lintmake markdownlintmake nixiecoderabbit review --agent --committed --base origin/feat/align-workspace-lint-policy(0 findings)References