Repository navigation
refactor(policy): share sandbox bind parsing - #140696
Conversation
|
🦞👀 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: blocked before merge. Reviewed September 7, 2026, 8:54 AM ET / 12:54 UTC. ClawSweeper reviewWhat this changesPolicy shares core sandbox bind parsing while preserving its Windows-path grammar, adds parser coverage and SDK documentation, and retires a deprecated resolver export. Merge readiness⛔ Blocked before merge - 1 item remains The refactor remains useful on current main, and no actionable correctness defect was found. The previous migration concern is resolved; the recorded acceptance of residual export compatibility risk does not require another approval cycle. Priority: P3 Review scores
Verification
How this fits togetherPolicy examines configured sandbox mounts and produces posture evidence for health checks. Core runtime callers use the same text parser before applying their own mount validation and filesystem rules. flowchart TD
A[Configured sandbox binds] --> B[Shared bind parser]
B --> C[Policy Windows grammar]
B --> D[Default runtime grammar]
C --> E[Mount posture and health findings]
D --> F[Mount validation and filesystem mapping]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -35, Tests +18, Docs +10. Total -7 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one lexical parser with explicit grammar selection and the documented typed resolver migration under the recorded retirement approval. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor; source comparison and existing boundary coverage establish the relevant parsing contracts. Is this the best way to solve the issue? Yes: sharing lexical parsing while keeping Policy classification local preserves the implementation boundary, and the retired resolver has a documented typed replacement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5990c8b8396c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
a00e55e to
28759dc
Compare
4d8eace to
eed3877
Compare
Core owns lexical bind parsing; Policy explicitly preserves Windows container drives while existing runtime callers keep their default grammar. Proof: 422 Policy tests and 7 bind-parser tests passed; independent review clean.
Preserve Windows bind grammar without growing the public SDK surface; retire the unused deprecated mode resolver re-export. Proof: 433 focused tests, SDK checks, and autoreview pass.
Keep the approved export retirement explicit about the private facade's missing packaged TypeScript declarations. Proof: node scripts/check-changed.mjs -- docs/plugins/sdk-runtime.md.
eed3877 to
058e949
Compare
|
Merged via squash.
|
* refactor(policy): share sandbox bind parsing Core owns lexical bind parsing; Policy explicitly preserves Windows container drives while existing runtime callers keep their default grammar. Proof: 422 Policy tests and 7 bind-parser tests passed; independent review clean. * refactor(policy): reuse existing SDK sandbox entrypoint Preserve Windows bind grammar without growing the public SDK surface; retire the unused deprecated mode resolver re-export. Proof: 433 focused tests, SDK checks, and autoreview pass. * docs(plugin-sdk): clarify exec runtime migration limits Keep the approved export retirement explicit about the private facade's missing packaged TypeScript declarations. Proof: node scripts/check-changed.mjs -- docs/plugins/sdk-runtime.md.
What Problem This Solves
Policy duplicated core's Docker bind-string parsing. Its Windows container-drive handling differs from the default runtime grammar, so simply replacing the parser would change existing posture evidence.
Why This Change Was Made
Policy consumes core
splitSandboxBindSpecthrough the existing publicopenclaw/plugin-sdk/agent-harness-runtimeentrypoint. TheallowWindowsContainerPathparser argument preserves Policy's existing Windows grammar; other core callers retain default parsing. Policy keeps read-only classification and evidence construction locally.Adding one helper is offset by retiring the unused deprecated
infra-runtime.resolveExecModePolicyexport. No public entrypoint or SDK budget is added. Canonical counts/max: 152/152 entrypoints, 4445/4445 exports, 2627/2627 callable exports, 1132/1138 deprecated exports, 50/50 wildcards. Production -35 lines; tests +18; documentation +10.User Impact
No intended behavior change. Policy preserves Windows container-drive paths, mixed-case read-only options, inheritance and evidence ordering. Core Docker/Podman validation keeps its existing grammar. The helper splits text; it does not authorize mounts or add a configuration option.
Evidence
841694048e1124530fe9d6555e34f78a06311f99, including worker-transfer repair fix(node-host): honor umask in Git transfer mode assertions #140771, Telegram test-size repair fix(telegram): unblock PR lint checks for progress-update tests #141148, and the landed exec algebra refactor(codex): reuse core exec policy algebra #140636. Reviewed head:058e949250cf52f166dcd228aef26348ddb54416.node scripts/run-vitest.mjs extensions/policy src/agents/sandbox/bind-spec src/plugins/doctor-contract-closure-guard.test.ts: all 459 tests passed (448 Policy, seven parser, four closure guards), in 31.02s.pnpm buildpassed in 7m08.1s, including 91 plugins and packaged declarations. This rebase preserves the runtime patch; conflict resolution only reconciles retired SDK exports and migration documentation.node scripts/check-changed.mjspassed all four typecheck lanes, SDK/ratchet guards, closure checks, dead-export scans and core lint, then reached only the expressly allowed nested-worktree extension-lintDeclaration input escapes checkoutlimitation. Hosted exact-head CI https://github.com/openclaw/openclaw/actions/runs/34122950529 passed on attempt 1. Native preparation accepted the evidence without changing the head; native merge landed as4bd1d6e305e5d0566838e0adcc5f0e83c600551c, verified ancestor of fetched main. No test retry was needed.Compatibility audit
Repository searches and the completed global/organization consumer audit found no actual consumer of the retired deprecated export. Ambiguous source candidates import their own core implementations. This unused-export retirement is maintainer-approved under that audit requirement. Indexed searches cannot establish absence of private or unindexed consumers.
The typed replacement is now
execPolicy.resolveExecModePolicyfrom the existing publicagent-harness-runtime, landed in #140636. The privateexec-approvals-runtimefacade and its callers remain intact. The publicinfra-runtimesubpath and retention record remain unchanged.The previous CI attempt was blocked by the unrelated Telegram max-lines failure fixed in #141148. The maintainer authorized fresh proof after that repair, ten-minute infrastructure startup retries, and one failed-job retry for an unrelated flaky test. No assertion, timeout, baseline, or required check is weakened.