Skip to content

improve: safely reuse qualified offline compositions - #188678

Merged
roboclaw-bot merged 24 commits into
mainfrom
openclaw/p2c-composition-qualified-reuse
Oct 31, 2026
Merged

roboclaw-bot merged 24 commits into
mainfrom
openclaw/p2c-composition-qualified-reuse

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #188661, now landed. This follow-on targets main and preserves exact prerequisite f3bdcadb948e1b873b59066cbd0994192da50a42 in its history. Its effective change against reviewed main adb58af237c2079d8eae388b22b9ce439d19e081 is exactly the five qualified-reuse files.

What Problem This Solves

Repeated offline compositions rehash every dependency payload, while skipping verification of a mutable donor or Docker's app/ input would admit stale or changed bytes.

User Impact

Release tooling can opt into qualified dependency reuse and an archive-bound image recipe without changing the strict defaults. Reuse receipts explicitly report partial input verification; neither mode replaces Linux target acceptance.

Why This Change Was Made

A trusted, digest-bound receipt from a prior strict composition qualifies the dependency manifest, not the current donor. Reuse still checks complete topology, modes, sizes, link targets/containment and package manifests, then verifies the actual selected copies against that inventory. Unselected payload bytes are not rehashed, and partial receipts cannot qualify another reuse. No caller-written operation report serves as authority.

The landed composition owner's repairs are retained: builtin-named npm dependencies use package lookup and nearest-ancestor deduplication, and legitimate implementation files under paths such as src/node_modules are copied and verified. Those prerequisite fixes are not reintroduced as independent owners here.

The optional --image-input archive recipe checks the receipt-bound archive/manifest and the small admission inputs without rehashing all of app/. Docker copies the archive, checks its exact SHA-256 inside the build, and only then extracts it. The existing finalizer remains the single lifecycle owner. Directory recipes and full-inventory verification remain the defaults.

Source implementation contributed by @galiniliev. Relative to main, this adds no cache, competing operation-report owner, dependency, lockfile or tool pin. Net production growth remains 176 lines. The scoped allocation is still exactly 140 for the +140 test-line delta; the shared scalar was not changed.

Evidence

  • Published head 712cf21f051338520e61849fa4c7d43acfa1ef3a preserves tested commit 63593cf109f5737ed238603dec0f1c73d583553c and tree dcc577f3532a53cb300ee278b730e4947adc7060. The exact prerequisite was merged history-preservingly in aa52afa9975e8cfe3b8eecaec51bf3418a3ae214. Four squash-lineage conflicts were then resolved against main only after proving all four main-side blobs equal the reviewed prerequisite. No rebase or age-only refresh was performed.
  • 53 relevant tests have passing main-context evidence: 32 composition, 14 bundled-link helper, 4 offline dependency-planner and 3 Docker-digest tests. The first main-context run exposed a test-fixture clone that traversed unavailable unrelated history in a partial checkout. The fixture now clones the real runtime commit at depth one; that case and the four planner tests passed in a focused 59.19s follow-up, including 41.66s cold worker compilation. Unaffected passing cases were reused rather than blanket-rerun. The complete pre-main integration run also passed all 53 tests in 78.46s.
  • Builtin-name admission is exercised through the real composition fixture using an npm package named fs. Restoring the old lookup makes composition fail with openclaw requires fs; the repair passes while retaining nested versions. The existing implementation-file tamper case still fails with the old copy filter and passes with the repair. Genuine first strict receipts, relocation/tampering, partial-receipt rejection, CLI archive admission and native-finalizer boundaries remain covered.
  • Fresh main-relative scripts, tooling-test and extensions-test typechecks passed. Targeted lint reported zero warnings/errors; formatting, normal isolated commit hooks and diff checks passed. Frozen dependencies were reconciled only in the task-owned isolated installation; shared caches were unchanged.
  • Fresh main-relative ratchet passed: 6,315,807 test lines, ceiling 6,347,775, slack 31,968. The earlier 1,042-line overage was measured on the pre-main snapshot and is not stamped onto this checked main-based tree. No allocation was inflated to hide it.
  • Fresh independent local autoreview of the final five-file candidate against main adb58af237c2079d8eae388b22b9ce439d19e081: P0–P2 scoped-clean, no actionable findings. The final candidate was committed unchanged. The dirty local ClawSweeper checkout required the documented autoreview route. The earlier hosted review also found no actionable defects; it is prior-head evidence, not a current-head approval.
  • Retained real offline Podman admission proof remains source-bound to the unchanged Dockerfile: the archive-input stage consumed the original archive despite changed app/ bytes; archive tampering failed checksum verification before extraction. No broad rebuild was repeated solely for metadata or ancestry changes.
Retained archive-consumption trace — unchanged Docker stage

Successful admission and container readback, while mutable app/ contained different bytes:

/tmp/installed-runtime.tgz: OK
archive bytes consumed; mutable app excluded

After changing that archive while retaining the expected digest:

/tmp/installed-runtime.tgz: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match

The maintained build step orders checksum verification before extraction with &&; the tampered build exited 1. This is archive admission proof, not full release-image qualification.

Current-head CI is green: the CI gate passed for 712cf21f051338520e61849fa4c7d43acfa1ef3a; final readback found no failed or running checks. Full release-image acceptance remains target-owned. Receipts retain compositionOnly: true, ABI/libc requires-target-acceptance, and lifecycle target-required. No live cloud operations were performed.

Worked on by

Work sessions

roboclaw-bot and others added 8 commits October 30, 2026 19:43
Preserve explicit npm profiles and their lock/reuse path while carrying qualified target dependencies in bundle archives.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 65d6807d-2851-4dba-9916-f4bc1496596b
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: abb5a92a-2552-4be8-91fc-4258059363e4
Scope Node-only setup to bundle enrollment, fix narrowed bundle fixture metadata, and reuse the validated package manifest owner instead of unsafe assertions. Prove missing npm/Corepack repair and retained npm runtime compatibility.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 92b05551-9794-42c5-b0ea-0dbd82702c99
Verify graph metadata and copied dependency content against a prior strict qualification, and consume fast image recipes from an archive checked inside Docker.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 672e26e5-f84b-42fd-920c-dea068b3f456
@clawsweeper

clawsweeper Bot commented Oct 30, 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 docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts docker Docker and sandbox tooling extensions: crabbox size: XL labels Oct 30, 2026
@roboclaw-bot
roboclaw-bot changed the base branch from main to openclaw/p2c-linux-composition-final October 30, 2026 20:24
Keep fixture loops explicit without changing their behavior, and account for their exact test-line delta.

Co-authored-by: galiniliev <[email protected]>
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 30, 2026 20:24
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 4b152785-ec9c-414f-90c7-2368b3a060b3
roboclaw-bot and others added 2 commits October 30, 2026 20:35
…sites

Merge the reviewed offline runtime prerequisite without rewriting history. Recognize already-declared Docker stages while keeping digest enforcement for all external images.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 7f0ad263-49b7-4178-96a2-c1d101a61593
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds qualified dependency reuse and an archive-bound Docker recipe that verifies the consumed archive before extraction.

Example: Build from installed-runtime.tgz after app/dist/entry.js has changed.

  • Before: The directory recipe rejects the changed application inventory.
  • After: The opt-in archive recipe consumes the original checksum-bound archive and rejects archive tampering before extraction.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused implementation with meaningful boundary coverage; inspectable evidence is primarily harness-based, and inherited CI remains unresolved on the reviewed stack.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor-proof gate; supplied evidence describes real composition fixtures and an offline Podman archive-stage run, with full Linux runtime qualification explicitly deferred.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Release operators repeatedly hash unused dependency payloads and need an efficient image handoff that still rejects changed consumed bytes.
Reason: The maintainer-authored direction explicitly authorizes opt-in partial verification, documents its limits, and preserves strict defaults and target acceptance.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it adds useful opt-in composition optimizations, preserves strict defaults, and has no independently established introduced defect; the failing checks also fail on its prerequisite.

Priority: P2
Reviewed head: 5e364d9bae4174a99703fdd6a984af3ccc2cdbad

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The body describes an offline Podman admission run, but provides no inspectable terminal trace linking qualification, archive checksum rejection, and Docker consumption.
Agent review details

How this fits together

Offline release tooling combines a portable package and inventoried Linux dependencies into installed assets that Docker passes through the existing finalizer.

flowchart LR
  A[Portable package] --> D[Composition owner]
  B[Dependency inventory] --> D
  C[Prior strict receipt] --> D
  D --> E[Installed archive and receipt]
  E --> F[Docker checksum admission]
  F --> G[Existing runtime finalizer]
Loading

Technical review

Best possible solution:

Retain the opt-in optimizations within the existing composition and finalization owners, alongside the prerequisite’s general digest-validator repair.

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

This is an optimization feature; source inspection establishes the changed paths, and exact-head CI independently reports failures also present on the pinned prerequisite.

Is this the best way to solve the issue?

The change uses the existing inventory, dependency planner, receipt, and finalizer owners; its essential invariant is that reduced donor hashing must still verify selected output bytes and the archive Docker actually consumes.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Dependency qualification changes intended behavior with a stated reason (d882dc3: The prerequisite required complete dependency inventories to prevent mutable donors from supplying unverified bytes.)
  • Installed-output verification changes intended behavior with a stated reason (d882dc3: The prerequisite verified the complete application directory before image consumption; the new explicit archive mode instead binds admission to the archive and verifies it again inside Docker.)
  • Docker lifecycle ownership keeps the original intent (d882dc3: Installed assets use the existing offline finalizer rather than rebuilding packages or introducing another installer.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Galin Iliev: Raw commit db01f6d adds scripts/docker/copy-bootstrap-scripts.mjs:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: db01f6d520b8; files: scripts/docker/copy-bootstrap-scripts.mjs)
  • Peter Steinberger: Raw commit 3a4e7ae adds Dockerfile:30 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3a4e7aefd743; files: Dockerfile)

PR surface

Tests +140, Docs +21, Other +178. Total +339 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 140 0 +140
Docs 1 23 2 +21
Config 0 0 0 0
Generated 0 0 0 0
Other 3 209 31 +178
Total 5 372 33 +339

Review metrics

Metric Value Why it matters
Production versus test growth Production +176 net lines; tests +140 lines Growth implements two distinct admission modes and regression coverage without adding a cache, dependency, or competing lifecycle owner.
New operator inputs 3 CLI options and 2 Docker build arguments The inputs explicitly select qualification evidence or archive ingestion while preserving existing defaults.

Labels

Label changes:

  • add P2: Useful release-tooling improvement with opt-in behavior and limited direct user blast radius.
  • 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: Useful release-tooling improvement with opt-in behavior and limited direct user blast radius.
  • 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.

Rank-up moves

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

  • Attach a redacted composition-CLI-to-container trace showing selected-content rejection and archive checksum rejection.

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 October 30, 2026, 4:41 PM ET / 20:41 UTC.

roboclaw-bot and others added 9 commits October 30, 2026 21:30
Merge d16cdab without changing the qualified-reuse patch. Adopt the shared Docker stage classifier and repaired worker fixture types; retain selected-copy and archive-consumption guards.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 2919158f-36e4-40ef-88d0-b3bd5c5c07eb
Merge main 65acdfd to resolve the real executable-entry conflict while preserving both declaration sets. Retain private implementation trees below src/node_modules, leaving dependency-root placement with its existing planner.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: ea39c266-fd27-4fd1-8151-4387b09a4a77
Merge final Linux composition prerequisite e3e3497, preserving its reviewed main integration and direct node_modules filter repair. Exercise the existing qualified-reuse tamper regression against src/node_modules implementation content; retain the exact 140-line allocation.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 9bdac577-c78d-45b4-9fe6-b164b6c94914
Use the already-admitted root fs-safe0.26.15 pin so selected Codex packages satisfy the canonical single-version contract. Regenerate only the Codex lockfile importer.

Co-authored-by: galiniliev <[email protected]>
(cherry picked from commit 79daa9c)
Resolve declared package names and ancestor placements with package-style lookups. Preserve nested versions, source links and required dependency guards.

Co-authored-by: galiniliev <[email protected]>
(cherry picked from commit d4e71ba)
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 6c5dbb4e-05b9-4de2-96c2-b7c9e83ecb02
Base automatically changed from openclaw/p2c-linux-composition-final to main October 30, 2026 23:46
roboclaw-bot and others added 3 commits October 30, 2026 23:48
Merge exact Linux prerequisite f3bdcad, retaining builtin lookup, ancestor deduplication and Codex fs-safe alignment. Exercise builtin-name package resolution in the existing composition fixture without increasing the 140-line reuse allocation. Scoped tests, typechecks and P0-P2 review pass; the measured pre-main test-line ceiling still has inherited debt.

Co-authored-by: galiniliev <[email protected]>
Resolve four squash-lineage conflicts against main adb58af after verifying its conflict-side blobs equal prerequisite f3bdcad. Preserve exactly the five-file qualified-reuse delta and 140-line test credit. Bound the native-image-input fixture to its real runtime commit instead of unrelated partial history. Main-relative tests, static checks, ratchet and fresh P0-P2 review pass.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 202b16e6-c0eb-4e9e-9b9e-9ed55a6df7ed
@roboclaw-bot
roboclaw-bot merged commit 05b5ac4 into main Oct 31, 2026
116 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/p2c-composition-qualified-reuse branch October 31, 2026 00:58
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
Add opt-in qualified dependency reuse and archive-bound image input while preserving strict verification defaults.

A digest-bound prior strict receipt qualifies the dependency manifest. Recheck donor topology and package manifests, then hash the selected copied payload. Partial receipts cannot qualify subsequent reuse.

The archive recipe verifies the exact Docker-consumed archive before extraction, so unchecked mutable app bytes cannot enter that route. Preserve the existing target lifecycle and acceptance requirements.

Validated with 53 affected tests, meaningful tamper controls, offline archive-consumption proof, static checks, independent review, current-head CI, and conflict-free current-main composition. Allocate exactly 140 lines for 140 added regression-test lines.

Co-authored-by: galiniliev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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