Repository navigation
fix: keep PR provisioning startup logs out of operator home state - #201791
Conversation
Bind startup diagnostics to repository-owned state and keep private test ancestors secure under group-writable umasks. Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: ad46ae42-0342-4156-9997-6bb100fca796
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR binds provisioner startup logging and descendants to repository-owned state and makes private test fixtures independent of the host umask. Example: Provisioning PR 42 from /workspace/openclaw with HOME=/home/operator.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a source-confirmed provisioning isolation gap with a focused change; no introduced correctness defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe PR shell wrapper launches a Node provisioner that creates Git worktrees using repository-owned allocation state; the process-global logger also needs that state location before imports execute. flowchart TD
A[PR shell wrapper] --> B[Provisioner process environment]
B --> C[Startup logger]
B --> D[Worktree provisioner]
C --> E[Repository PR state]
D --> E
D --> F[Git worktree]
Technical reviewBest possible solution: Keep the process-boundary state binding and existing regression assertions, preserving the current storage, permission, and recovery owners. Do we have a high-confidence way to reproduce the issue? The logger reads process.env before explicit storage bindings apply, establishing the failure path in source; the PR reports a matching red/green regression, which was not rerun during this read-only review. Is this the best way to solve the issue? Binding the existing state namespace before process startup fixes the producer boundary without another storage owner, fallback, or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7af6c4fc31b6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +5, Other +2. Total +7 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 19, 2026, 6:57 AM ET / 11:57 UTC. |
…enclaw#201791) * fix: isolate PR provisioning startup state Bind startup diagnostics to repository-owned state and keep private test ancestors secure under group-writable umasks. Co-authored-by: RomneyDa <[email protected]> * fix: keep PR provisioning startup logs out of operator home state OpenClaw-Publication: ad46ae42-0342-4156-9997-6bb100fca796 --------- Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
PR worktree provisioning can create
~/.openclaw/logsduring startup even though its explicit stores are bound to repository-owned state. The process-global logger initializes before those store bindings, allowing a maintainer workflow to touch the operator’s home state.User Impact
PR provisioning keeps startup diagnostics and descendant processes in the repository’s existing
.local/pr-statenamespace. No application-facing behavior, schema migration, or user configuration change is required.Why This Change Was Made
Set
OPENCLAW_STATE_DIRat the provisioner process boundary rather than relying only on explicit storage bindings. The isolation fixture now exercises the real logger before storage initialization. Private fixture ancestors and seeded state directories are created with mode0700, so a group-writable host umask does not invalidate the intended private-directory setup. Production permission checks remain unchanged.This is a focused four-file change: tooling +3/−1 lines and tests/support +7/−2 lines. It reuses the existing state owner and adds no new storage or fallback mechanism.
Evidence
umask 0002: 15 provisioning-state cases and 8 interruption cases. The three schema cases that failed with group-writable fixture ancestors changed from red to green after creating the private ancestors with mode0700.git diff --check, andbash -n scripts/pr-lib/worktree.sh.4e9bb66448c6d2613312801708b2a1bfe3f4bba95016a18671f41bb789cfe7feon basedbf41b9173f6c3eb128221387533a1096ab1c43a.dbf41b9173f6c3eb128221387533a1096ab1c43athrough head2306303de10f41c52f2f8ac80055a2c93b48c4aa: P0–P3 coverage,scoped-clean, report produced, exit 0, no findings. Engine: OpenClaw; effective model:openai/gpt-6.1-sol. This review was limited to the supplied diff, without surrounding implementation or test execution, and supplements the independent full-context review and focused proof above. Local ClawSweeper was unavailable; the selected fallback is canonical autoreview plus one hosted review when ready.Limitations: the original historical CI artifact was not reproduced with the same source and runtime, so this proves the startup-isolation defect and focused fix, not definitive attribution of that historical failure. Exact-head PR CI is attached and pending; no broad CI pass is claimed.