Skip to content

fix: allow older source on newer Testbox checkouts - #138782

Merged
steipete merged 1 commit into
mainfrom
codex/team-testbox-tracked-source-20260904
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/team-testbox-tracked-source-20260904

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Related: #138612.

What Problem This Solves

Fixes an issue where developers testing an older source revision on a newer hydrated Testbox would fail source verification before their command ran. Files added by the newer workflow checkout survived in the execution workspace although they were absent from the selected source.

Why This Change Was Made

The receiver uses the prepared checkout's committed tree solely to prove cleanup ownership. An obsolete, nonignored file is removed only when its bytes, kind and executable mode match that committed entry. The frozen capsule remains the sole authority for the source that executes.

Ancestor ignore rules are retired before their descendants, and Git recomputes eligibility after each removal. This preserves newly protected caches and rejects newly exposed unknown or modified files. Cleanup and final source validation share the existing raw-file verifier.

User Impact

Older revisions can run against newer Testbox hydration while unrelated untracked, ignored and modified extra data remains intact. Unexpected or modified nonignored source still stops the command. No configuration, dependency or protocol change.

Evidence

Configured Blacksmith Testbox run 33937838286, lease tbx_01m1qmqrsh3dwrkhwb08cbt4aa, Node 24.19.0 / pnpm 12.1.0:

  • Real staging passed from workflow 578cb8b9 to selected source 6c63f671 plus this repair. Both previously reported obsolete files were removed; hydrated runtime remained present.
  • The original receiver failed both Testbox history cases in the extended regression (2 failed, 2 direct-provider cases passed). The final candidate passed all 307 tests across crabbox-wrapper.test.ts and testbox-lease-freshness.test.ts.
  • The full scripts/check-changed.mjs --base 06759eabcbdd33b24ad131627d354e95fbf6cd93 gate passed for both changed files, including script/root-test types, lint and source guards. The normal frozen install and module resolution used a private candidate node_modules.
  • Final independent Codex review was scoped clean through P2. Tests cover stale indexes, inherited Git routing, raw bytes/mode/kind, symlink parents, unknown/index-only extras, and nested ignore transitions preserving unchanged, modified and untracked cache rules.

The wrapper and proof controller exited 0. The complete 17,204-byte archive and all nine log hashes were verified locally before stop/status confirmed lease completion. Artifact SHA-256: 3e121327c67450bff827df18d1db333c8ad98a21b41b36c841dc231b39e43821.

Limits and retained failures: two local attempts hit existing deadlines on the loaded macOS host. The first Linux run passed staging/owner tests but failed test lint and relative artifact retrieval; both were corrected for the final run. Its immutable manifest retains an outdated descriptive patch checksum, explicitly qualified by the final asserted source-file hashes and selected Git tree. Linux proof is pinned to 06759eab; current-main qualification separately covers the incoming artifact-preservation sibling changes and dependency update, with hosted integration CI still required.

Tooling: +32/-8 (net +24); tests: +130/-1. Growth represents the missing prior-source ownership boundary and reuses the existing verifier and Git ignore policy.

@clawsweeper

clawsweeper Bot commented Sep 5, 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: S maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 02:14
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 10:44 PM ET / September 5, 2026, 02:44 UTC.

ClawSweeper review

What this changes

The PR lets older source run on newer prepared Testbox checkouts by removing verified obsolete source files while preserving ignored runtime data and rejecting unknown or modified extras.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, focused repair missing from fetched main. No blocking correctness or security defect was found.

Priority: P2
Reviewed head: a1eb82d4778c5cfa4536e33985f2472b32449e19

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with meaningful real-Git rejection coverage and a specific after-fix Testbox record; no actionable blocking defect was found.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The supplied Testbox record exercises the production receiver against newer hydration and reports removal of both obsolete files while retaining runtime and reaching successful command completion. This changed-path observation, not the test count alone, supports proof sufficiency; linked logs could not be independently retrieved.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The supplied Testbox record exercises the production receiver against newer hydration and reports removal of both obsolete files while retaining runtime and reaching successful command completion. This changed-path observation, not the test count alone, supports proof sufficiency; linked logs could not be independently retrieved.
Evidence reviewed 11 items Verified introduced scope: The pinned merge-base-to-head delta changes only the receiver and its wrapper tests. The inspected test merge has the recorded base parent followed by the exact PR head, and its delta against that base contains the same two paths; unrelated endpoint drift is not attributed to this PR.
Cleanup ownership and verification: The receiver reads the prepared checkout's committed tree independently of its index. Extra-file removal requires a matching prior entry, reachable real-directory parents, matching file kind and executable mode, and matching raw bytes or symlink target. Removing ancestor ignore files triggers a fresh Git inventory before further cleanup.
Caller, producer, and sibling boundaries: The wrapper constructs the receiver bootstrap before the payload and exits when verification fails. The capsule producer remains responsible for selected source and privacy-filtered deletions. Prior-checkout cleanup is enabled only for the prepared Testbox workspace; direct-provider capsule execution retains rejection of unexpected extras. These paths use OpenClaw's receiver and Git, not a Codex runtime or protocol.
Findings None None.
Security None None.

How this fits together

OpenClaw's remote-testing wrapper packages selected source into a frozen Git bundle. The receiver applies that bundle to a prepared Testbox workspace before running the requested command, without replacing its hydrated dependencies and caches.

flowchart TD
  A[Selected local source] --> B[Frozen source bundle]
  B --> C[Source receiver]
  D[Prepared Testbox checkout] --> C
  C --> E[Verify source and cleanup eligibility]
  E --> F[Preserve runtime and run command]
  E --> G[Reject unexpected or modified source]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Tests +129, Other +24. Total +153 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 130 1 +129
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 32 8 +24
Total 2 162 9 +153

Review metrics

Metric Value Why it matters
Production versus test growth Production/tooling net +24 lines; tests net +129 lines Production growth supplies previously missing receiver-side ownership knowledge and reuses the existing verifier; the producer cannot identify files unique to a newer remote checkout.

Stored data model

Persistent data-model change detected: unknown-data-model-change: scripts/crabbox-source-receiver.mts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one receiver-owned cleanup flow that distinguishes obsolete committed source from runtime data, using the shared byte verifier and Git's ignore policy rather than broad workspace cleaning.

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

Yes, source inspection establishes the failure: a nonignored file present only in the newer prepared checkout reaches main's unconditional extra-file rejection before the payload. This review did not execute it; the supplied evidence reports the corresponding failing and repaired Testbox cases.

Is this the best way to solve the issue?

Yes. The receiver is the boundary with both the selected capsule and prior remote tree; moving this decision into the producer cannot account for remote-only files, while broad cleaning would endanger hydrated runtime.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 116c6c3be399.

Labels

Label changes:

  • add P2: The defect blocks a bounded developer-testing workflow when selected source predates Testbox hydration, rather than ordinary bot operation.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied Testbox record exercises the production receiver against newer hydration and reports removal of both obsolete files while retaining runtime and reaching successful command completion. This changed-path observation, not the test count alone, supports proof sufficiency; linked logs could not be independently retrieved.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The supplied Testbox record exercises the production receiver against newer hydration and reports removal of both obsolete files while retaining runtime and reaching successful command completion. This changed-path observation, not the test count alone, supports proof sufficiency; linked logs could not be independently retrieved.

Label justifications:

  • P2: The defect blocks a bounded developer-testing workflow when selected source predates Testbox hydration, rather than ordinary bot operation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The supplied Testbox record exercises the production receiver against newer hydration and reports removal of both obsolete files while retaining runtime and reaching successful command completion. This changed-path observation, not the test count alone, supports proof sufficiency; linked logs could not be independently retrieved.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Testbox record exercises the production receiver against newer hydration and reports removal of both obsolete files while retaining runtime and reaching successful command completion. This changed-path observation, not the test count alone, supports proof sufficiency; linked logs could not be independently retrieved.

Evidence

What I checked:

  • Verified introduced scope: The pinned merge-base-to-head delta changes only the receiver and its wrapper tests. The inspected test merge has the recorded base parent followed by the exact PR head, and its delta against that base contains the same two paths; unrelated endpoint drift is not attributed to this PR. (a1eb82d4778c)
  • Cleanup ownership and verification: The receiver reads the prepared checkout's committed tree independently of its index. Extra-file removal requires a matching prior entry, reachable real-directory parents, matching file kind and executable mode, and matching raw bytes or symlink target. Removing ancestor ignore files triggers a fresh Git inventory before further cleanup. (scripts/crabbox-source-receiver.mts:94, a1eb82d4778c)
  • Caller, producer, and sibling boundaries: The wrapper constructs the receiver bootstrap before the payload and exits when verification fails. The capsule producer remains responsible for selected source and privacy-filtered deletions. Prior-checkout cleanup is enabled only for the prepared Testbox workspace; direct-provider capsule execution retains rejection of unexpected extras. These paths use OpenClaw's receiver and Git, not a Codex runtime or protocol. (scripts/crabbox-wrapper.mts:3674, a1eb82d4778c)
  • Boundary-level regression coverage: The existing real-Git fixture now exercises newer prepared source with stale indexes across both Testbox history variants, retaining direct-provider controls. Nine rejection cases cover changed bytes, modes, kinds, links, parent replacement, untracked/index-only extras, and files exposed by ignore-rule removal. Assertions check payload suppression, retained affected data, unchanged prior HEAD, and external canaries. Tests were inspected, not executed in this read-only review. (test/scripts/crabbox-wrapper.test.ts:4185, a1eb82d4778c)
  • Current main still contains the failure: Fetched main still rejects every nonignored extra outside the receiver's temporary directory. Its receiver and capsule producer are byte-identical to the pinned PR merge base, so the obsolete-file repair remains necessary. (scripts/crabbox-source-receiver.mts:177, 116c6c3be399)
  • Release boundary: The supplied latest release tag resolves to the stated release commit and does not contain the source receiver. This repair concerns newer main-branch testing infrastructure; no released fix is established. (ad6fe23aecb9)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed the completed ClawSweeper review and its remaining data-model checklist item. No persistent data-model change is present: the production diff only reads the prepared checkout's existing committed Git tree, verifies unchanged obsolete source entries, and retires those entries before executing the selected source capsule. It adds no database, schema, migration, configuration, retention, or runtime state format.

The compatibility boundary is prepared source plus ignored runtime files. The existing real-Git cases cover newer prepared source with stale indexes, unknown/modified extras, file modes/kinds/symlinks, and ignore-rule transitions. The recorded Linux Testbox run exercised older selected source on newer hydration, preserved runtime files, completed all 307 owner tests and the full changed gate. Direct-provider rejection behavior remains covered. This addresses the review's compatibility-proof request; no data migration applies. No other actionable findings or rank-up moves were listed.

@steipete
steipete merged commit c748cd5 into main Sep 5, 2026
188 checks passed
@steipete
steipete deleted the codex/team-testbox-tracked-source-20260904 branch September 5, 2026 02:54
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
vincentkoc added a commit to LiuwqGit/openclaw that referenced this pull request Sep 5, 2026
* refs/remotes/origin/main: (602 commits)
  fix(plugins): trace trust refusals and repair legacy provenance (openclaw#138746)
  perf(sqlite): reuse compiled plugin state point reads (openclaw#138758)
  refactor: type chat prefetch dependencies and clean loading tests (openclaw#138793)
  ci: reduce Doctor test startup and core lint jobs (openclaw#138796)
  feat(update): retain run history and share outcome reports (openclaw#138690)
  chore(deps): update @openclaw/fs-safe to 0.8.1 (openclaw#138500)
  fix: preserve global board ownership from pinning to notifications (openclaw#138675)
  fix(gateway): deliver session catalog updates from slow hosts (openclaw#138674)
  perf(sessions): index pending conversation replies (openclaw#127182)
  perf(auth): reuse ordered provider alias entries (openclaw#138805)
  docs(diagnostics): clarify whole-process CPU metrics (openclaw#138804)
  perf(memory): narrow source reads and stream embedding cache rows (openclaw#138766)
  fix: allow older source on newer Testbox checkouts (openclaw#138782)
  fix(agents): preserve recovered task progress and lifecycle ownership (openclaw#138785)
  perf(codex): reduce rollout tail scan CPU (openclaw#138784)
  perf(gateway): stop projecting history deltas at the byte budget (openclaw#138655)
  fix(build): bound native declaration inputs to checkout (openclaw#138742)
  fix(cli): preserve foreground Gateway argument handling (openclaw#138765)
  fix(ui): align task toolbar with side-panel tabs (openclaw#138769)
  fix(logbook): drain accepted work before closing SQLite (openclaw#138754)
  ...

# Conflicts:
#	src/agents/embedded-agent-runner/compact.queued.ts
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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