Skip to content

refactor(node-host): share execution policy result fields - #140446

Merged
steipete merged 1 commit into
mainfrom
steipete/deletion-node-policy-results
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deletion-node-policy-results

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Node-host execution policy repeats the same decision facts in four result branches and carries a separate success return for durable approval. Keeping those projections in sync adds maintenance work to the execution gate.

Why This Change Was Made

Construct the common result fields once and use the existing success return for durable approval. Explicit deny still short-circuits approval evaluation; mandatory approval, Windows shell-wrapper handling, denial reasons, and result fields remain unchanged. invoke-system-run.ts is the only production consumer, at the initial decision and approved re-evaluation.

This removes duplicated implementation, not a compatibility contract. git log -S durableApprovalSatisfied -- src/node-host/exec-policy.ts confirms the durable-approval branch's history; its behavior remains covered and unchanged. Follow-up deletion work for #135868. Production +28/−48, net −20; tests/tooling/docs unchanged.

User Impact

No intended behavior change. Node-host commands keep the same execution permissions and diagnostic results.

Evidence

  • Existing policy and system-run invocation suites: 96 tests passed.
  • Local before/after comparison across 5,184 combinations of security, ask, approval decision, durable approval, and six boolean inputs: byte-identical result JSON.
  • Existing coverage remains unchanged: src/node-host/exec-policy.test.ts:52 (deny), :68 (ask-always despite durable trust), :96 (unapproved allowlist miss), :113 (Windows guidance), and src/node-host/invoke-system-run.test.ts:3101 (durable trust rerun).
  • Independent Codex review: scoped-clean through P2. Full node scripts/check-changed.mjs: exit 0, including typechecks, lint, dead exports, import cycles, and repository guards.
  • Windows policy cases use fixture inputs; no Windows node-host runtime was executed locally.
  • ClawSweeper reviewed exact head 8875e438d6b7c795423da21e516936c16120d481: no findings, security concerns, or requested rank-up changes. Maintainer source review agrees.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@steipete
steipete marked this pull request as ready for review September 6, 2026 21:05
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:18 PM ET / 21:18 UTC.

ClawSweeper review

What this changes

Shares common node-host execution decision fields and consolidates durable-approval success while preserving command permissions and denial messages.

Merge readiness

✅ Ready for maintainer review

Keep open as a useful, behavior-preserving cleanup. No actionable correctness or security findings remain; current main still contains the duplication, and the maintainer-authored PR is protected from automatic closure.

Priority: P3
Reviewed head: 8875e438d6b7c795423da21e516936c16120d481

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable simplification with equivalent branches, retained coverage, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored exemption applies: this changes result construction in the node-host policy evaluator without materially changing authority. Reported tests and the before/after comparison support equivalence but are not represented as live node-host proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored exemption applies: this changes result construction in the node-host policy evaluator without materially changing authority. Reported tests and the before/after comparison support equivalence but are not represented as live node-host proof.
Evidence reviewed 10 items Pinned introduced change: The complete base-to-head diff changes only result construction and equivalent branching. Explicit deny still short-circuits approval evaluation; durable approval reaches the existing success return only after mandatory approval checks.
Current main still contains the cleanup opportunity: Fetched main retains repeated decision fields and a separate durable-approval success return. The submitted consolidation is not already present.
Latest supplied release comparison: The source at the supplied v2026.9.2 release commit also retains the repeated fields and separate success branch; this review makes no implemented-or-shipped claim.
Findings None None.
Security None None.

How this fits together

The node host evaluates command requests against execution policy, allowlist analysis, and approval facts. Its decision feeds the command invocation pipeline, which either reports a denial or continues through execution safeguards.

flowchart TD
  A[Command request] --> B[Node host invocation]
  C[Execution policy and approval facts] --> D[Policy evaluation]
  B --> D
  D --> E{Command allowed?}
  E -->|No| F[Denial reason and message]
  E -->|Yes| G[Execution safeguards and command run]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -20. Total -20 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 28 48 -20
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 28 48 -20

Review metrics

None.

Technical review

Best possible solution:

Keep one shared decision context and one success return while retaining the existing approval precedence, diagnostics, and consumer safeguards.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR reports duplicated implementation rather than a runtime defect; the duplication is directly visible on current main.

Is this the best way to solve the issue?

Yes. A local shared result object and equivalent denial predicate remove repetition without introducing another API or changing the execution contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 59294ea45379.

Labels

Label justifications:

  • P3: This is a bounded internal cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored exemption applies: this changes result construction in the node-host policy evaluator without materially changing authority. Reported tests and the before/after comparison support equivalence but are not represented as live node-host proof.

Evidence

What I checked:

  • Pinned introduced change: The complete base-to-head diff changes only result construction and equivalent branching. Explicit deny still short-circuits approval evaluation; durable approval reaches the existing success return only after mandatory approval checks. (src/node-host/exec-policy.ts:98, 8875e438d6b7)
  • Current main still contains the cleanup opportunity: Fetched main retains repeated decision fields and a separate durable-approval success return. The submitted consolidation is not already present. (src/node-host/exec-policy.ts:99, 59294ea45379)
  • Latest supplied release comparison: The source at the supplied v2026.9.2 release commit also retains the repeated fields and separate success branch; this review makes no implemented-or-shipped claim. (src/node-host/exec-policy.ts:99, 3928bad9badf)
  • Approval precedence: The shared approval predicate returns true for ask=always before considering durable trust. The refactor preserves that predicate and its inputs. (src/infra/exec-approvals-policy.ts:11, 8875e438d6b7)
  • Production consumer and implementation boundary: The invocation owner supplies plain decision facts at initial evaluation and approved re-evaluation, then handles denial and Windows wrapper safeguards. The changed evaluator uses OpenClaw's own approval predicate; no changed behavior depends on a Codex runtime contract. (src/node-host/invoke-system-run.ts:616, 8875e438d6b7)
  • Retained policy coverage: Existing tests cover explicit deny, mandatory approval despite durable trust, unapproved allowlist misses, explicit approval, and POSIX/Windows wrapper distinctions. These tests were inspected, not executed. (src/node-host/exec-policy.test.ts:51, 8875e438d6b7)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • ngutman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-06T21:10:48.102Z sha 8875e43 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit d1215c3 into main Sep 6, 2026
221 checks passed
@steipete
steipete deleted the steipete/deletion-node-policy-results branch September 6, 2026 21:20
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '294df333c58f2da104eccffc623ccb3c4d43d4d8': (1802 commits)
  fix: clear stale diagnostics after Gateway changes (#140426)
  fix: keep plugin catalogs intact after discovery timeouts (#140441)
  perf(tui): prepare session picker rows once per overlay (#140462)
  refactor(config): reuse environment substitution for write-back (#140460)
  refactor(discord): remove retired auto-presence templates (#140463)
  fix(ui): finish roster refreshes during session activity (#140459)
  fix(setup): match prepared credentials to the model provider (#140461)
  fix: keep MiniMax discovery on the selected credential (#140438)
  refactor(tests): remove unused parent context cache reset (#140456)
  fix: avoid repeated xAI OAuth refresh during discovery (#140434)
  perf(routing): reuse prepared event session targets (#140454)
  fix(media): keep deferred audio and extraction providers discoverable (#139231)
  refactor(codex): remove redundant app-server forwarding (#140451)
  fix(test): avoid false native polling timeouts (#140119)
  test(gateway): retain saved source in reload fixtures (#140453)
  fix(gateway): reduce repeated model work when listing sessions (#140414)
  fix(feishu): fall back to post mode over table limit (#136382)
  fix: use the bundle-compatible Proxyline runtime under Bun (#140411)
  refactor(trace): reuse the canonical usage counter type (#140444)
  refactor(node-host): share execution policy result fields (#140446)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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