Repository navigation
refactor(update): reuse selected admission environment - #188189
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR passes the updater’s selected environment into run admission instead of discovering the service profile again. Example: The caller profile uses channel stable while the managed service profile uses channel beta.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused simplification that preserves admission safeguards, remains absent from current main, and has passing exact-head gates; no actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCLI update orchestration selects an installation and service environment, prepares database access and recovery capture, and admits a run into the existing update ledger before guarded execution. flowchart TD
A[Update CLI] --> B[Select service environment]
B --> C[Select database engine]
C --> D[Capture original state]
D --> E[Admit run with selected environment]
E --> F[Existing update ledger]
E --> G[Guarded update execution]
Technical reviewBest possible solution: Use the existing selected environment throughout preparation and admission while retaining live recovery, ownership, and effect checks. Do we have a high-confidence way to reproduce the issue? Source establishes duplicate environment discovery in the base and current main; no live user failure was reproduced or claimed. Is this the best way to solve the issue? The patch is the smallest complete change: thread the existing environment through the current helper, require it at admission, and migrate callers without adding state or a fallback path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5f6f15fed0d6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +100. Total +101 across 11 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 5:02 AM ET / 09:02 UTC. |
|
Merged via squash.
|
What Problem This Solves
The updater selects the managed service profile for database-engine selection and original-state capture, then discovers it again when admitting the run.
User Impact
Admission reuses the selected environment consistently. Recovery, state-write, foreground-claim and later native effect checks remain live. No configuration, storage schema or public API changes.
Why This Change Was Made
Carry the already selected environment through the admitted-run helper to the ledger owner and require it at that boundary. Remove the second discovery and its discovery-only arguments. No fallback resolver or parallel context object is added. Production net: one line, including the ownership comment; tests cover the shared selected-profile invariant.
Evidence
Exact-head CI (
0d514447a143d10a8384bc4297e5a58cac4f9093) shows 55 passing cases across five changed files: service ownership (19), mutable signals (18), contention (8), admission schema (3), and task delivery (7). See ownership/signals/contention, schema, and task delivery.The new real
updateCommandowned-command case passed in 9556 ms. Distinct caller/service configurations exercise the real engine, native-command reader, recovery capture, admission and ledger. Assertions prove one environment discovery, shared selected environment, captured database bytes predating the new admission row, and terminal publication only in the service database. An unsupported package target bounds execution before download, install or service mutation. Existing foreground-claim expiry tests remain unchanged; all direct callers, including child scripts, pass explicit environments.Local autoreview and a separate source review found no actionable P0–P3 defect. Targeted oxfmt,
git diff --checkand normal signed-commit hooks passed. The selected Testbox route queued during related proof, so execution used PR CI; this editor has no dependency install. Individual execution counts were not inspected forupdate-command-run.test.ts,update-dry-run-state.process.test.ts, orsrc/daemon/service.test.ts; no specific count is claimed for those files. No live operator service or state was changed.