feat: plumb daemon IDs through to identify a process - #1145
Conversation
📝 WalkthroughWalkthroughThe change adds optional daemon IDs to daemon state, context configuration, sandbox configuration, orchestration, operation options, and check execution. Sandbox directories use the daemon ID when configured and otherwise use the process ID. ChangesDaemon identity propagation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ServerState
participant Context
participant LocalBackend
participant OperationOptions
participant CheckCtx
participant SandboxConfig
ServerState->>Context: configure daemon_id
Context->>LocalBackend: pass daemon_id to orchestrator
LocalBackend->>OperationOptions: pass daemon_id to build operations
Context->>CheckCtx: construct with daemon_id
CheckCtx->>OperationOptions: pass daemon_id to standalone tests
OperationOptions->>SandboxConfig: apply daemon_id
SandboxConfig->>SandboxConfig: name sandbox directory with daemon_id or process ID
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/op/src/lib.rs (1)
13-19: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPass
daemon_idto every production sandbox configuration. Add.with_daemon_id(...)incrates/op/src/specs.rs,crates/op/src/standalone_test.rs, andcrates/minimald/src/env.rs. These paths currently fall back tostd::process::id(), which can break daemon-scoped cleanup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/op/src/lib.rs` around lines 13 - 19, Propagate Options.daemon_id into every production sandbox configuration by calling with_daemon_id(...) in the configuration flows in specs.rs, standalone_test.rs, and minimald’s env.rs. Use the available daemon ID rather than allowing these paths to fall back to std::process::id(), preserving daemon-scoped cleanup behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/op/src/lib.rs`:
- Around line 13-19: Propagate Options.daemon_id into every production sandbox
configuration by calling with_daemon_id(...) in the configuration flows in
specs.rs, standalone_test.rs, and minimald’s env.rs. Use the available daemon ID
rather than allowing these paths to fall back to std::process::id(), preserving
daemon-scoped cleanup behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 591235ee-10bc-4ee8-9f95-19eb0b6c9413
📒 Files selected for processing (19)
crates/check/src/lib.rscrates/check/src/outputs.rscrates/check/src/sources.rscrates/mctx/src/config.rscrates/mctx/src/env.rscrates/mctx/src/lib.rscrates/minimald/src/env.rscrates/minimald/src/server.rscrates/minimald/src/session_sop.rscrates/mip/src/cmd_check.rscrates/mip/src/cmd_materialize.rscrates/mip/src/cmd_pkg_patched_build.rscrates/op/src/lib.rscrates/op/src/materialize.rscrates/op/src/specs.rscrates/op/src/subsets.rscrates/orchestrator/src/lib.rscrates/orchestrator/src/local_backend.rscrates/sandbox2/src/config.rs
bd72ff5 to
7d0e35d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/minimald/src/session.rs`:
- Line 1427: Update the minimald test configuration built by
sessions.rs::manager() to set a test daemon ID with with_daemon_id(...) before
session tests reach workspace_config. Preserve the existing daemon_id unwrap in
session.rs, since the test configuration should provide the required value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 89b1db36-0f7e-43ef-9bae-c6ab8c779802
📒 Files selected for processing (21)
crates/check/src/lib.rscrates/check/src/outputs.rscrates/check/src/sources.rscrates/mctx/src/config.rscrates/mctx/src/env.rscrates/mctx/src/lib.rscrates/minimald/src/env.rscrates/minimald/src/server.rscrates/minimald/src/session.rscrates/minimald/src/session_sop.rscrates/mip/src/cmd_check.rscrates/mip/src/cmd_materialize.rscrates/mip/src/cmd_pkg_patched_build.rscrates/op/src/lib.rscrates/op/src/materialize.rscrates/op/src/specs.rscrates/op/src/standalone_test.rscrates/op/src/subsets.rscrates/orchestrator/src/lib.rscrates/orchestrator/src/local_backend.rscrates/sandbox2/src/config.rs
🚧 Files skipped from review as they are similar to previous changes (20)
- crates/op/src/specs.rs
- crates/mip/src/cmd_materialize.rs
- crates/op/src/lib.rs
- crates/minimald/src/session_sop.rs
- crates/check/src/outputs.rs
- crates/orchestrator/src/local_backend.rs
- crates/mip/src/cmd_pkg_patched_build.rs
- crates/check/src/lib.rs
- crates/minimald/src/env.rs
- crates/minimald/src/server.rs
- crates/op/src/subsets.rs
- crates/mip/src/cmd_check.rs
- crates/sandbox2/src/config.rs
- crates/mctx/src/env.rs
- crates/op/src/materialize.rs
- crates/mctx/src/config.rs
- crates/orchestrator/src/lib.rs
- crates/check/src/sources.rs
- crates/mctx/src/lib.rs
- crates/op/src/standalone_test.rs
7d0e35d to
0a1f61f
Compare
|
Lgtm |
Fixes: #1001
Temporary files are now minted using a
daemon_idsuffix, which if not provided defaults toPIDlike before.Needed to fix cache/implement clean under minimald.
Note
Plumb daemon IDs through sandbox, build, and check operations to identify processes
daemon_idinminimald::ServerStateand propagates it throughmctx::Configto all downstream components.daemon_id: Option<String>toop::Options,CheckCtx,sandbox2::config::Config, and the orchestrator, threading the ID through builds, checks, materializations, and standalone tests.sandbox2::config::Config.buildto usedaemon_idas a suffix when set, falling back to the current PID.cmd_check,cmd_materialize,cmd_pkg_patched_build) forwardctx.daemon_id()into their respective operations.minimald, which affects any tooling that parses sandbox directory names.Macroscope summarized 0a1f61f.
Summary by CodeRabbit