Skip to content

fix(ci): isolate arbitrary-ref installer validation - #140729

Open
vincentkoc wants to merge 4 commits into
mainfrom
fix/ci-installer-ref-isolation-20260907
Open

vincentkoc wants to merge 4 commits into
mainfrom
fix/ci-installer-ref-isolation-20260907

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 7, 2026 •

Copy link
Copy Markdown
Member
Additional instructions

Maintainer edits are enabled through this same-repository branch.

What Problem This Solves

Resolves a problem where release-check dispatches for arbitrary refs could bypass the intended installer-only admission policy or execute candidate-controlled installer tooling with runner authority. Resolving a commit successfully did not, by itself, establish that the requested execution plan was admitted.

Why This Change Was Made

Resolve immutable identity independently of authority, then require the actual computed plan to be installer-only for unadmitted refs. Preserve the existing main, branch-history, and release-tag policies and arbitrary-ref installer coverage.

Use the verified workflow revision for host tooling and nested local actions. Keep candidate packaging, QR execution, and the complete Bun install/lifecycle/CLI/agent/Gateway flow inside isolated containers. Stage only the required trusted Bun closure, suppress candidate log commands, and require positive container absence before cleanup or fresh network-disabled sealing.

The shared candidate packer retains the existing installer payload and supports the reviewed package-plus-registry and registry-only contracts with exact public guest Git identity. An internal package-candidate install-policy opt-in preserves the package caller's existing lifecycle/engine flags without changing installer defaults. Package-acceptance and performance caller repairs remain separate work; this PR's net diff does not modify their workflows or shared composite actions.

The earlier seven-file test follow-up aligned existing tests with the repaired workflow, strengthened fixture shape checks and added QR cache exclusion coverage. The published signed merge preserves that history and integrates main at 77c45a9be74fe4860b0852519d28d690fc908449, including its native-contract resolver and installer-update compatibility assertion. The signed follow-up integrates captured main 0c890f5d4b8293bc8c54cd889bfcbf12d562c602 without rewriting that ancestry. It preserves incoming selected-source provenance checks, reconciles the test imports and local cleanup tracker, and checks provenance diagnostics across both captured output streams.

The new proof hook is restricted to the actual canonical standalone Install Smoke caller; release-checks is excluded even when Bun is enabled. Four fixed, serial CI-only cases reuse the production packer and actual Bun/QR launchers: containment, package-plus-registry, registry-only and empty-required registry. Ordinary unit collection does not start Docker. No new public workflow inputs are introduced.

The two proof-fixture findings in #140729 (comment) are addressed in the published candidate: QR expects the real wrapper's normalized failure status 1 while the synthetic child still exits 37; registry consumers use the host's numeric nonroot UID:GID with a private writable HOME and npm cache. Read-only registry mounts, hash checks, containment probes and log framing are preserved.

User Impact

Maintainers can continue validating arbitrary installer refs without granting them trusted release-runner execution. Admitted release plans keep their existing policy and smoke coverage; obsolete fast/no-op paths are removed rather than reporting empty successes.

No runtime configuration, schema, dependency, version, release, or shipped package contract changes.

Evidence

Published head: cca8f9c949d2b03a27a2a2179318aa415b62b5af. The normal merge commit passed native hooks; its SSH signature, tree 35683917b1aba04a4d49e57d7f452769ff05d6c0, parents 399cbf7d3553b7b239753ae67b2488cf33e77e4b and 0c890f5d4b8293bc8c54cd889bfcbf12d562c602, and all 15 net-diff paths against captured main were verified afterward. The normal fast-forward push to the existing PR branch succeeded. The task worktree is clean. No rebase, force-push, hook bypass or source change during commit.

Current exact-head hosted validation, September 8, 2026:

Current local proof:

  • Complete no-push workflow owner: 46 passed. The initial 44-pass/2-fail run exposed assertions tied to stderr despite the existing log barrier's exec 2>&1. The combined-diagnostics repair preserves status 2, positive Docker invocation, and negative no-Docker assertions.
  • Targeted test-project routing: 2 passed, 471 filtered.
  • Isolation assertion subset after the fixture repair: 26 passed, 66 filtered. This is not a complete payload-owner rerun.
  • QR boundary red/green ran the actual production workflow shell and wrapper with Docker stubbed. A real Node child still exited 37; the wrapper returned 1, failing the old expectation and satisfying the repaired expectation. Stop/resume framing remained intact. This is not real Docker or hostile-candidate isolation evidence.
  • Registry command proof extracted the actual fixture command. With npm stubbed, it verified the host numeric identity selection, read-only mount arguments, private writable HOME/cache modes 0700, and unchanged synthetic registry bytes/mode 0750. The mismatched-UID selector check is static, not execution as another UID. No real npm install or container ran.
  • Focused typed lint, formatting, fixture syntax and whitespace checks passed. Typed lint is not proof that the complete root TypeScript program compiled.
  • Fresh independent scoped review found no P0-P2 defects in the two fixture repairs. This is not a new whole-PR clean verdict. The earlier review's synthetic-canary umask P2 remains recorded as resolved by its separate fixture correction and three intended-red/green subprocess cases.

Historical proof retained from the earlier candidate:

  • Integration owner run: 281 passed across the payload, no-push workflow, ref-admission and installer Docker owner files. It preceded final support edits and is not a claim that the complete current suite was rerun.
  • Caller-selection tests exercise the real selector and reject release-checks/other callers. Existing actual Bun workflow-shell fixtures retain the explicit guest native contract and approved cleanup/closure assertions.
  • Three real-subprocess canary permission cases failed first under umasks 022, 002 and 077, then passed after explicitly setting the synthetic canary mode. They prove filesystem permission metadata, not live cross-UID guest access.
  • Executable resolver/admission fixtures: 30 passing cases, including fast/fallback admission bypass red controls and computed-plan rejection. Installer workflow fixtures: 29 passing cases covering log suppression and the real Bun launcher's staged closure, nonzero/timeout/signal propagation, removal/inventory failures, and positive cleanup.
  • Shared packer/payload tests cover immutable tuple/digest checks, clean Git/archive equivalence, default payload compatibility, extra manifest-described packages, registry-only behavior, and malformed/symlink inputs. The package-only policy regression failed before the fix; 17 focused selector/input cases passed afterward, and all seven selector variants passed after the test-only lint correction. These execute emitted guest-shell selectors with a recording package-manager function, not host candidate lifecycle code.
  • The earlier seven-file CI-repair run had 1,100 passes and two failures. One quoted-string assertion was corrected; the unchanged dispatch-provenance subprocess fixture returned status=null without a captured cause. Both selected cases then passed a focused 2/2 follow-up, without increased timeouts or weaker assertions. This was not an uninterrupted green batch.
  • The installer update/nonroot log-suppression sibling passed 2/2 selected cases with actual workflow bodies and statuses 0, 37 and 143. Earlier Bash/Python syntax, shellcheck and ratchet results belong to that earlier candidate.

Outstanding proof and limitations:

  • The actual root TypeScript program and changed-file gate remain unrun locally: the declaration-preparation guard rejects the shared dependency symlink. No guard bypass, dependency reconciliation or substitute compiler program was used. The exact-head hosted type lanes listed above succeeded; the failed Node shard and aggregate CI remain unresolved.
  • The complete local workflow checker remains incomplete. Using an existing Python 3.13 interpreter in a task-local environment resolved the earlier Python 3.9 compatibility problem and installed pre-commit 4.6.2. Installed actionlint 1.7.12 passed, but the unchanged checker's hook bootstrap could not install pinned zizmor==1.29.0 and exited 3. Zizmor and subsequent guards did not execute locally. No pin, shared dependency or global tool configuration was changed. Hosted Workflow Sanity and security-fast succeeded separately; that does not retroactively make the local command pass.
  • The planner owner suite is UNRUN for this integration. Related planner failures remain separately owned and are not waived.
  • Real smoke execution occurred, but successful registry/product jobs do not establish successful containment, host-canary denial, Actions-command isolation, writer termination before sealing or cancellation cleanup. The containment failure, unread detailed proof artifacts, and missing root-smoke parity remain critical gaps. Wrong-UID sealed-registry denial is not a required fixture-repair gate and is not claimed.
  • Required exact-head CI, successful isolation/parity proof, substantive review follow-up and native landing gates remain mandatory. No checks, proof requirements or security alerts are waived by these partial results.

@vincentkoc vincentkoc self-assigned this Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 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 docker Docker and sandbox tooling size: XL maintainer Maintainer-authored PR labels Sep 7, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 7, 2026 03:32
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 8, 2026, 3:11 AM ET / 07:11 UTC.

ClawSweeper review

What this changes

The PR restricts arbitrary-ref release checks to installer validation and moves candidate packaging, Bun, and QR execution behind trusted tooling and container boundaries.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: the isolation repair remains necessary, and both earlier fixture findings are addressed. Hosted validation now provides useful partial proof, but failed containment and incomplete root-image coverage prevent qualification. No new actionable code defect was established.

Priority: P2
Reviewed head: cca8f9c949d2b03a27a2a2179318aa415b62b5af

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The coherent repair and new hosted successes improve confidence, while unresolved authority-boundary qualification caps readiness.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the production packer and actual Bun/QR launchers change candidate execution authority. Exact-head standalone Install Smoke exercised real containers, with successful registry and normal product scenarios, but containment failed and root smokes did not run. The missing successful hostile-candidate and cancellation results remain the blocker; unavailable artifact inspection is a separate reviewer limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the production packer and actual Bun/QR launchers change candidate execution authority. Exact-head standalone Install Smoke exercised real containers, with successful registry and normal product scenarios, but containment failed and root smokes did not run. The missing successful hostile-candidate and cancellation results remain the blocker; unavailable artifact inspection is a separate reviewer limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 8 items Reviewed identity and introduced scope: The checkout matches pinned head cca8f9c. The complete introduced delta was inspected against 0c890f5. The supplied test merge is stale and was not used to infer removal of current-main behavior.
Admission checks the computed execution plan: The introduced guard requires an explicitly unadmitted revision to have an installer-only computed plan and rejects package, live, cross-OS, soak, and other execution paths. Ref-admission tests exercise branch/tag history, arbitrary revisions, moved refs, and incompatible plans.
Candidate execution and sealing boundary: The packer pins the container image, stages a restricted trusted harness, separates writable candidate outputs from sealed outputs, and confirms worker absence before starting a network-disabled sealer. Bun receives a restricted script closure and read-only payload; QR uses the trusted wrapper.
Findings None None.
Security Needs attention Containment and writer shutdown remain unqualified: Registry scenarios provide useful partial boundary evidence, but the dedicated containment case failed. Its hostile packaging, Bun/QR, timeout, and cancellation checks must establish rejection before host effects and writer termination before sealing.

How this fits together

Release validation accepts a selected source revision and produces installer packages and smoke-test results. Its trusted workflow must execute candidate code without exposing runner credentials, command channels, or persistent build state.

flowchart TD
  A[Selected source revision] --> B[Resolve identity and admit execution plan]
  B --> C[Admitted release checks]
  B --> D[Isolated installer validation]
  D --> E[Trusted container launchers]
  E --> F[Confirm candidate writers stopped]
  F --> G[Seal packages and report smoke results]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the production packer and actual Bun/QR launchers change candidate execution authority. Exact-head standalone Install Smoke exercised real containers, with successful registry and normal product scenarios, but containment failed and root smokes did not run. The missing successful hostile-candidate and cancellation results remain the blocker; unavailable artifact inspection is a separate reviewer limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security concern: Containment and writer shutdown remain unqualified - Registry scenarios provide useful partial boundary evidence, but the dedicated containment case failed. Its hostile packaging, Bun/QR, timeout, and cancellation checks must establish rejection before host effects and writer termination before sealing.
  • Resolve merge risk (P1) - The failed containment scenario leaves hostile candidate access to host resources and Actions command channels, plus cancellation stopping background writers before sealing, incompletely qualified.
  • Resolve merge risk (P1) - The disposable root builder replaces the previous build path, but its hosted build failed and downstream root smokes were skipped; the cause and retained smoke parity remain unresolved.
  • Complete next step (P2) - Inspect the failed containment and root-build evidence, resolve the demonstrated causes, and add successful containment/cancellation and root-smoke results. Redact credentials, IP addresses, private endpoints, and other private details. Update the PR body to trigger re-review; if needed, ask a maintainer to comment @clawsweeper re-review.

Findings

  • [medium] Containment and writer shutdown remain unqualified — test/scripts/fixtures/install-smoke-isolation.mjs:691
Agent review details

Security

Needs attention: No concrete introduced escape was established, but the changed candidate-authority boundary still lacks successful containment and cancellation qualification.

PR surface

Tests +2405, Config +133, Other +560. Total +3098 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 9 2528 123 +2405
Docs 0 0 0 0
Config 2 395 262 +133
Generated 0 0 0 0
Other 4 563 3 +560
Total 15 3486 388 +3098

Review metrics

Metric Value Why it matters
Production versus validation growth Production/tooling net +693 lines; tests and test support net +2,405 lines The stated justification is isolated execution and sealing, with most growth devoted to boundary validation.
Hosted isolation scenarios 3 succeeded; 1 failed Registry paths gained real execution evidence, while the containment case remains unqualified.

Merge-risk options

Maintainer options:

  1. Qualify containment and retained smoke coverage (recommended)
    Inspect the failed containment and builder receipts, resolve their actual causes, and retain successful production-boundary evidence before landing.

Technical review

Best possible solution:

Keep one trusted installer orchestration path that preserves existing smoke coverage while proving candidate execution cannot acquire runner authority or survive the sealing barrier.

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

Yes, at source level: current main directly runs the candidate Bun install/runtime smoke on the host, and the PR supplies executable admission fixtures. This review did not execute candidate code or reproduce an exploit.

Is this the best way to solve the issue?

Yes in direction: separating immutable identity from admission and containing execution at the launcher is appropriate. Successful containment and root-smoke qualification are still needed to validate the complete implementation.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded release-validation hardening change without evidence of an active user-facing emergency.
  • merge-risk: 🚨 security-boundary: The PR changes where candidate code executes, and hostile execution plus cancellation containment remains incompletely proven.
  • merge-risk: 🚨 automation: The replacement root-builder path has not completed hosted qualification, leaving installer validation coverage uncertain.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the production packer and actual Bun/QR launchers change candidate execution authority. Exact-head standalone Install Smoke exercised real containers, with successful registry and normal product scenarios, but containment failed and root smokes did not run. The missing successful hostile-candidate and cancellation results remain the blocker; unavailable artifact inspection is a separate reviewer limitation. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Containment and writer shutdown remain unqualified — test/scripts/fixtures/install-smoke-isolation.mjs:691
    Registry scenarios provide useful partial boundary evidence, but the dedicated containment case failed. Its hostile packaging, Bun/QR, timeout, and cancellation checks must establish rejection before host effects and writer termination before sealing.
    Confidence: 0.96

What I checked:

  • Reviewed identity and introduced scope: The checkout matches pinned head cca8f9c. The complete introduced delta was inspected against 0c890f5. The supplied test merge is stale and was not used to infer removal of current-main behavior. (cca8f9c949d2)
  • Admission checks the computed execution plan: The introduced guard requires an explicitly unadmitted revision to have an installer-only computed plan and rejects package, live, cross-OS, soak, and other execution paths. Ref-admission tests exercise branch/tag history, arbitrary revisions, moved refs, and incompatible plans. (.github/workflows/openclaw-release-checks.yml:815, cca8f9c949d2)
  • Candidate execution and sealing boundary: The packer pins the container image, stages a restricted trusted harness, separates writable candidate outputs from sealed outputs, and confirms worker absence before starting a network-disabled sealer. Bun receives a restricted script closure and read-only payload; QR uses the trusted wrapper. (scripts/docker/pack-candidate-in-container.sh:260, cca8f9c949d2)
  • Earlier fixture findings are addressed: The QR proof now expects wrapper status 1 while its synthetic child exits 37. Registry consumers use the host numeric UID:GID and private writable HOME/cache. These resolve the two retained earlier findings; no replacement finding is inferred from the failed containment job. (test/scripts/fixtures/install-smoke-isolation.mjs:790, cca8f9c949d2)
  • Captured proof body fully recovered: The public pull endpoint returned the same head and body SHA-256 ef0f6148b4204a9b783df3aa969bbc91c2db2fe51aebaf2099354835c96a8a0c. Reading its tail closed the supplied 505-unit omission. The body expressly retains containment, cancellation, detailed-artifact, and root-smoke gaps. (cca8f9c949d2)
  • Real hosted execution supplies partial proof: https://github.com/openclaw/openclaw/actions/runs/34190444317 ran the exact head. Package-registry, registry-only, empty-required, normal packaging, Bun, QR, nonroot, and update jobs succeeded. The registry fixture invokes the production packer and real Docker client, checks guest canaries and worker absence, and consumes sealed packages. Containment failed in its proof step; root-image construction failed before downstream root smokes. Public job metadata confirmed those failure locations. Artifact download returned no bytes, so detailed failure causes and receipts remain uninspected; this does not negate the successful scenarios. (test/scripts/fixtures/install-smoke-isolation.mjs:811, cca8f9c949d2)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide successful redacted production-path evidence for hostile candidate denial and explicit cancellation stopping writers before sealing.
  • Diagnose the root-builder failure and demonstrate retained root-image smoke coverage.

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 (4 earlier review cycles)
  • reviewed 2026-09-07T03:40:48.297Z sha 233b08e :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-07T04:19:02.438Z sha 1826f65 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-08T03:31:20.160Z sha 399cbf7 :: needs real behavior proof before merge. :: [P2] Expect the QR launcher's normalized failure status | [P2] Make the sealed registry readable by the proof consumer
  • reviewed 2026-09-08T05:23:08.034Z sha cca8f9c :: needs real behavior proof before merge. :: none

Punchcard-Session: coral-orchard-orchard-d4
Punchcard-Session: coral-orchard-orchard-d4
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Sep 8, 2026
Punchcard-Session: coral-orchard-orchard-d4
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant