Skip to content

fix: keep PR provisioning startup logs out of operator home state - #201791

Merged
RomneyDa merged 2 commits into
mainfrom
openclaw/ci-pr-provisioning-isolation-nov19
Nov 19, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
openclaw/ci-pr-provisioning-isolation-nov19

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

PR worktree provisioning can create ~/.openclaw/logs during 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-state namespace. No application-facing behavior, schema migration, or user configuration change is required.

Why This Change Was Made

Set OPENCLAW_STATE_DIR at 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 mode 0700, 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

  • The startup-logger regression reproduced creation of the otherwise forbidden home-state directory before the process binding; the existing home-absence assertion passes with the fix.
  • Supplied focused validation passed all 23 cases under 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 mode 0700.
  • Supplied Bash syntax, type-aware lint, formatting, and scripts-test typecheck gates passed. These completed results are carried forward for the identical patch rather than rerunning expensive proof.
  • Local packaging verification: exact supplied patch match, reverse-apply check, git diff --check, and bash -n scripts/pr-lib/worktree.sh.
  • The supplied review is retained for patch SHA-256 4e9bb66448c6d2613312801708b2a1bfe3f4bba95016a18671f41bb789cfe7fe on base dbf41b9173f6c3eb128221387533a1096ab1c43a.
  • Fresh independent narrative review of the exact four-file snapshot found no actionable P0–P3 findings. It inspected the shell caller, provisioner, isolation fixtures, logger/config/temp-root owners, and wrapper contracts; no tests were rerun during that review.
  • Canonical autoreview completed for base dbf41b9173f6c3eb128221387533a1096ab1c43a through head 2306303de10f41c52f2f8ac80055a2c93b48c4aa: 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.

RomneyDa and others added 2 commits November 19, 2026 11:34
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
@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Nov 19, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review November 19, 2026 11:40
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Early logger initialization can create /home/operator/.openclaw/logs despite repository-bound database operations.
  • After: Default startup logs use /workspace/openclaw/.local/pr-state/logs.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported; validation evidence consists of reported regression runs and the inspected production-path fixture.
Proof confidence 🦐 gold shrimp (3/6) This internal provisioning-script repair has no application-facing behavior; the supplied validation exercises the real logger and provisioner through the existing fixture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A maintainer workflow can create startup logs in the operator's home state despite its repository-isolation contract.
Reason: The maintainer-authored direction restores an established isolation contract with minimal production code.

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
Reviewed head: 2306303de10f41c52f2f8ac80055a2c93b48c4aa

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Provisioner process launch keeps the original intent (387f698: Reuse managed checkout infrastructure while preserving wrapper trust, Git policy, and native recovery ownership.)
  • Repository-owned state and private fixture ancestors keeps the original intent (8c13f8c: Keep allocation state out of the operator Gateway database and exercise native and managed provisioning safely.)
  • Seeded legacy-state fixture permissions keeps the original intent (8f62210: Exercise preservation and credential cutover of existing private state; explicit private directory modes retain that purpose under a group-writable umask.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Raw commit 387f698 adds scripts/pr-lib/worktree.sh:287 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 387f69830a81; files: scripts/pr-lib/worktree.sh)

PR surface

Tests +5, Other +2. Total +7 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 7 2 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 1 +2
Total 4 10 3 +7

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The defect affects maintainer provisioning isolation with limited blast radius and no demonstrated application outage or data loss.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The defect affects maintainer provisioning isolation with limited blast radius and no demonstrated application outage or data loss.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 19, 2026, 6:57 AM ET / 11:57 UTC.

@RomneyDa
RomneyDa merged commit 2850784 into main Nov 19, 2026
194 checks passed
@RomneyDa
RomneyDa deleted the openclaw/ci-pr-provisioning-isolation-nov19 branch November 19, 2026 12:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant