Repository navigation
fix(image): record every applied patch in runtime provenance - #3415
Conversation
Provenance recorded four of the eight patches the runtime Dockerfile applies; the browser-reconnect bridge from #3044, preserve-on-request, full-access-profile and the worker-authority regression patch were missing, so images with and without them looked the same there (finding 2290). build-runtime-assets.mjs now keeps one ordered list of applied patches, writes it as provenance `patches` (file -> SHA-256), and derives the four existing per-patch fields from it, so their names and values stay stable. runtime-assets.test.mjs checks the list against the Dockerfile's verified and applied patches.
|
🦞👀 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. |
Review nits: match each COPY to its verify-and-apply step by name, require every deploy/runtime/*.patch to be applied in that form so a format the pattern misses fails instead of passing silently, and check each pinned hash against the file.
|
Codex review: needs maintainer review before merge. What this changesThis PR records all eight Dockerfile patches in runtime provenance and checks their order and hashes against the build recipe. Example: An operator inspects an image containing openclaw-control-ui-browser-reconnect.patch.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a verified provenance gap on current main, preserves existing metadata, and introduces no actionable defect found in review. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe runtime image build applies verified patches to pinned OpenClaw source, then packages the runtime and its provenance for operator inspection and runtime identity reporting. flowchart TB
A[Pinned source and patches] --> B[Dockerfile build]
B --> C[Runtime asset assembler]
C --> D[Packaged runtime]
C --> E[Provenance JSON]
E --> F[Operator inspection]
Technical reviewBest possible solution: Land the focused provenance inventory and its packaging checks while retaining the existing metadata values. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the mismatch between eight applied patches and four recorded hashes on current main; no target code or tests were run during this review. Is this the best way to solve the issue? The existing asset assembler is the appropriate owner, and checking its generated metadata against the Dockerfile and patch contents directly protects against another omitted entry. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 25b004874c3a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
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 October 24, 2026, 3:28 AM ET / 07:28 UTC. |
Problem
Finding 2290 (post-land review of #3044).
deploy/runtime/Dockerfileapplies eight patches, but/opt/oce/runtime/provenance.jsonrecorded hashes for only four. The browser-reconnect bridge from #3044,openclaw-codex-preserve-on-request.patch,openclaw-codex-full-access-profile.patchand the worker-authority regression patch were missing, so images built with and without them had identical patch fields; onlyruntimeContentsSha256differed. Whoever acts on a "remove this bridge" TODO could not tell from provenance which images carry a patch, and nothing stopped the next patch from being forgotten the same way. The runtime README's patch list also omitted two.Change
scripts/build-runtime-assets.mjskeeps one orderedappliedPatcheslist (file, SHA-256, optional legacy field). Provenance gainspatches: file name to SHA-256, in apply order.openclawBridgePatchSha256,openclawConnectPatchSha256,codexDependencyPinPatchSha256,openclawRequiredWorkerAuthorityPatchSha256) are derived from the same list, so their names and values are unchanged. The only in-repo consumers of provenance readsource/commit(runtime-entrypoints.ts, Dockerfile label check) andruntimeContentsSha256/codex; none read patch fields.patches.Verification
tests/integration/runtime-assets.test.mjs(checks-baseline-2) now parses the Dockerfile's COPY +sha256sum --check+git applysteps and assertsprovenance.patchesequals them in order, that everydeploy/runtime/*.patchis applied in that form (a layout the pattern misses fails instead of passing silently), that each pinned hash is the file's own, and that the legacy fields match. Mutants (dropping the browser-reconnect entry;COPY --linkon one patch) fail it.tests/integration/runtime-image-startup.test.mjspins the four newly recorded hashes in the built image.Internal review: approve with nits; nits applied.
Risks