Skip to content

fix(testbox): retain comparison base for native capsule sync - #154796

Merged
steipete merged 1 commit into
mainfrom
codex/capsule-native-base-20260921
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/capsule-native-base-20260921

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Testbox source runs falling back to a full upload because native sync cannot resolve the capsule's comparison branch.

User Impact

Developer tooling only: source-capsule runs can use Blacksmith's targeted sync path. No product behavior or configuration changes.

Why This Change Was Made

The private transport checkout retains detached source HEAD and now exposes its captured comparison base as main, which native Blacksmith uses for its diff. Committed changes remain in the delta; source selection, exclusions, the original index, and receiver verification keep their existing ownership.

Evidence

  • Extended the existing real sender/receiver fixture for committed, dirty, deleted, staged ignored, untracked, excluded, and unchanged source; it also checks detached HEAD, the comparison base, and bundle inclusion. The pre-fix owner fails specifically on git diff --name-only --no-renames main (4.23 seconds wall).
  • On one Blacksmith Testbox lease, native targeted sync completed in 16.448 seconds. The receiver verified the bound source/tree/carrier and exact changed-file hashes; downloaded final source still matched. The wrapper completed with exit 0 and the lease was stopped. The Actions run is the lease/hydration record, not a PR CI result.
  • pnpm test test/scripts/crabbox-wrapper.test.ts --maxWorkers=1: 346 passed, one Windows-only case skipped; 143.97 seconds test duration, 145.09 seconds wall. This extends the existing fixture rather than adding another test. Its real Git/process boundary protects transport and receiver behavior that helper-only tests cannot prove.
  • Hosted PR CI run 35596964166 passed for head a23434887cf5 (merge checkout 7351e35589b8). In the wrapper-file job, test/scripts/crabbox-wrapper.test.ts passed 346 cases with the same one Windows-only skip: 167.54 seconds for the one-file Vitest invocation and 168.55 seconds including its test wrapper. The extended Blacksmith transport fixture took 1.566 seconds for shallow history and 7.420 seconds for full history.
  • Explicit changed-file checks passed, including formatting, scripts and test-root typechecks, all dead-export scans, focused lint, and repository guards. git diff --check and fresh managed P2 review passed.

Bind the private capsule main ref to its captured comparison base so native Blacksmith can select committed and dirty source without falling back to a full sync. Preserve detached source HEAD, source policy and receiver authority.

Extend the existing real sender/receiver fixture. Remote proof: expected pre-fix failure, 346 passing wrapper tests, all changed-file checks, native targeted sync and exact receiver hashes. Managed P2 review is clean.
@clawsweeper

clawsweeper Bot commented Sep 21, 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 size: XS maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 11:59
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 8:12 AM ET / 12:12 UTC.

ClawSweeper review

What this changes

The PR preserves the captured comparison base in Testbox’s temporary source checkout so native sync can transfer changed files without falling back to a full upload.

Merge readiness

✅ Ready for maintainer review

Keep open: the fix remains necessary on pinned main, and the reviewed patch has no actionable correctness findings. Its scope is confined to developer source transport.

Priority: P2
Reviewed head: a23434887cf5f93fb4ac5d7ed06b85ee214fe261

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with meaningful regression assertions and no identified merge-blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its body reports targeted native sync and verified receiver hashes; the inspected lease record supports provisioning and shutdown, but does not independently expose that runtime transcript.
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 PR is exempt from the external-contributor proof gate. Its body reports targeted native sync and verified receiver hashes; the inspected lease record supports provisioning and shutdown, but does not independently expose that runtime transcript.
Evidence reviewed 9 items Pinned introduced change: The introduced production change creates refs/heads/main at the already resolved baseSha after installing detached source HEAD. It changes neither source selection nor the original checkout.
Still necessary on main and latest release: Pinned main retains detached HEAD without creating the comparison branch. Inspection of the supplied latest release commit likewise found no refs/heads/main update in the capsule constructor.
Release source check: The v2026.9.5 source has the original detached-HEAD and capsule-ref writes, but no native comparison branch.
Findings None None.
Security None None.

How this fits together

The Crabbox wrapper packages local source for remote Testbox execution. Native transport uploads that package, and a separate receiver verifies and installs the selected source before running the requested command.

flowchart LR
  A[Local source and comparison base] --> B[Freeze selected source]
  B --> C[Temporary checkout with main ref]
  C --> D[Native targeted sync]
  D --> E[Receiver verifies source bundle]
  E --> F[Run requested command]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +41, Other +3. Total +44 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 41 0 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 3 0 +3
Total 2 44 0 +44

Review metrics

None.

Technical review

Best possible solution:

Keep the captured base available to native transport while preserving detached source identity and independent receiver verification.

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

Yes, at source level: the current constructor creates detached HEAD without the literal main ref used by the comparison command. The extended real-Git fixture targets that failure; this review did not execute it.

Is this the best way to solve the issue?

Yes. Adding the ref in the existing capsule constructor supplies the missing transport metadata without changing source-selection policy or introducing another synchronization owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This fixes unnecessary full uploads in developer Testbox runs with a narrowly scoped transport change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its body reports targeted native sync and verified receiver hashes; the inspected lease record supports provisioning and shutdown, but does not independently expose that runtime transcript.

Label justifications:

  • P2: This fixes unnecessary full uploads in developer Testbox runs with a narrowly scoped transport 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 PR is exempt from the external-contributor proof gate. Its body reports targeted native sync and verified receiver hashes; the inspected lease record supports provisioning and shutdown, but does not independently expose that runtime transcript.

Evidence

What I checked:

  • Pinned introduced change: The introduced production change creates refs/heads/main at the already resolved baseSha after installing detached source HEAD. It changes neither source selection nor the original checkout. (scripts/crabbox-source-capsule.mts:276, a23434887cf5)
  • Still necessary on main and latest release: Pinned main retains detached HEAD without creating the comparison branch. Inspection of the supplied latest release commit likewise found no refs/heads/main update in the capsule constructor. (scripts/crabbox-source-capsule.mts:273, 8df13399d71d)
  • Release source check: The v2026.9.5 source has the original detached-HEAD and capsule-ref writes, but no native comparison branch. (scripts/crabbox-source-capsule.mts:187, ec9c1a13db89)
  • Regression coverage: The existing sender/receiver fixture now executes the native comparison command against real Git state, checks detached HEAD and the captured base, includes committed-only and dirty source plus the bundle, and excludes unchanged and private files. The transport executable remains a fixture; this is supplemental boundary coverage. (test/scripts/crabbox-wrapper.test.ts:5032, a23434887cf5)
  • Execution integrity remains separately owned: The receiver still verifies the bound bundle digest, carrier, tree, base, filesystem bytes and index before executing the payload. The new local comparison ref does not grant authority or replace those checks. (scripts/crabbox-source-receiver.mts:72, a23434887cf5)
  • Reported runtime evidence and independently checked lease: The captured PR body reports native targeted sync in 16.448 seconds, matching receiver and downloaded-source hashes, exit zero, and lease shutdown. The linked Actions run confirms successful provisioning and hydration followed by cancellation; it is a lease record, not independently inspected sync output or PR CI. The body also reports 346 passing tests and a 145.09-second wall time. No target code or tests were executed during this read-only review.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

@steipete
steipete merged commit 34a3d4a into main Sep 21, 2026
142 checks passed
@steipete
steipete deleted the codex/capsule-native-base-20260921 branch September 21, 2026 12:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
Bind the private capsule main ref to its captured comparison base so native Blacksmith can select committed and dirty source without falling back to a full sync. Preserve detached source HEAD, source policy and receiver authority.

Extend the existing real sender/receiver fixture. Remote proof: expected pre-fix failure, 346 passing wrapper tests, all changed-file checks, native targeted sync and exact receiver hashes. Managed P2 review is clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS 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