Skip to content

test(skills): restore bounded-read growth hook after fs-safe upgrade - #150419

Merged
steipete merged 1 commit into
mainfrom
ci-burden/skill-read-fs-safe-0-13
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-burden/skill-read-fs-safe-0-13

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150263.

What Problem This Solves

Fixes the deterministic plugin skill bundle test failure on main after the fs-safe 0.12.0 → 0.13.1 upgrade: expected 0 to be greater than 1048576 in charges failed bounded reads before admitting another file.

User Impact

No runtime behavior changes. This restores the regression test that proves failed bounded reads consume the aggregate bundle budget before another file is admitted.

Why This Change Was Made

fs-safe 0.13.1 routes Root reads through dedicated admission hooks, so the old afterOpenedPathIdentityCheck callback never runs for this test: the files never grow and the read spies are never installed. Move the fixture to the awaited beforeRootReadFinalFence hook, after the pinned stat, matching the migration already made for package-dist-inventory.test.ts in #150263. Production already reserves maxBytes + 1 before reading and refunds only successful reads; every existing byte-budget, z-after.txt: too-large, and 15-file inventory assertion remains intact.

The published npm tarballs show this change in dist/root-impl.js (excerpt):

- const { opened } = await openVerifiedLocalFile(resolved, {
+ const { handle, stat, identity } = await openLocalFileDescriptor(resolved, {
      symlinks: params.symlinks,
  });
+ const admitted = await admitRootReadHandle({
+     root, filePath: resolved, opened: { handle, stat }, identity,
+     hardlinks: params.hardlinks, symlinks: params.symlinks,
+     beforeFinalFence: fsSafeTestHooks?.beforeRootReadFinalFence,
+     afterPathIdentityCheck: fsSafeTestHooks?.afterRootReadFinalPathIdentityCheck,
+ });

dist/bounded-read.js and dist/read-opened-file.js are byte-for-byte unchanged between 0.12.0 and 0.13.1. The 0.13.0 changelog documents stronger Root admission fences; the current test-hook documentation explicitly limits afterOpenedPathIdentityCheck to standalone local-file/copy-source reads. The 0.13.1 changelog concerns native descriptor cleanup.

Evidence

  • Original failure reproduced locally: 23 passed, 1 failed, with the exact CI assertion.
  • Fixed node scripts/run-vitest.mjs src/skills/loading/plugin-skill-read.test.ts: 24 passed.
  • Direct installed-dependency probe: the old hook received 0 calls, left a 1-byte file, and observed 0 bytes; the replacement received 1 call, grew the file to 1,048,577 bytes, observed all 1,048,577 bytes, and returned too-large.
  • All 22 test files using fs-safe hooks inspected; the other old-hook use in playback-transcode.staging.test.ts correctly exercises openLocalFileSafely and stays unchanged.
  • node scripts/check-changed.mjs: passed, including core test types, static guards, dead-export scans, and changed-file lint.
  • Broader run of all 114 test files returned by rg -l "__setFsSafeTestHooksForTest|fs-safe" src test --glob "*.test.ts": still running; its full E2E runtime prerequisite build passed.
  • oxfmt --check, git diff --check, and pnpm check:line-cap-ratchet --base origin/main: passed. One test file, two lines replaced, no line growth.
  • Independent Codex review: scoped-clean at P1, no actionable findings.

Original failing CI: run 35166207851, job 105028016150, head 6dbf1873f98a1154b06d1a3c39efc26b41dbcce9, shard core-unit-src-security-2.

Root reads in fs-safe 0.13.1 use dedicated final-admission hooks. Move the post-stat growth fixture to beforeRootReadFinalFence so its real read instrumentation and aggregate-budget assertions execute again.

Related: #150263.
@clawsweeper

clawsweeper Bot commented Sep 17, 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 size: XS maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:16 PM ET / September 17, 2026, 01:16 UTC (Revision 2).

ClawSweeper review

What this changes

Updates the plugin skill bundle test to inject file growth through fs-safe’s current read hook while preserving its byte-budget assertions.

Merge readiness

✅ Ready for maintainer review

The repair remains necessary on inspected main and has no actionable findings. Maintainer coordination explicitly preserves this change in the related integration candidate; neither that work nor the protected maintainer label supports automated closure.

Priority: P3
Reviewed head: 56b55225f540d8d5700bc3b78c5a715c9d02a81b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, source-supported fixture repair with preserved assertions, relevant supplied validation, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies a MEMBER-authored test-only repair, so the external contributor runtime-proof gate does not apply; the supplied focused test and dependency-probe results directly cover the changed fixture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies a MEMBER-authored test-only repair, so the external contributor runtime-proof gate does not apply; the supplied focused test and dependency-probe results directly cover the changed fixture.
Evidence reviewed 8 items Verified introduced change: The pinned merge-base comparison changes only the growth hook and its explanatory comment; all read-volume, aggregate-budget, final-file status, and inventory assertions remain intact. The previous review used this same head and reported no findings.
Current-main necessity: Inspected main still installs afterOpenedPathIdentityCheck in the failing test. Its production reader already reserves maxBytes + 1 before reading and refunds only successful reads, so the needed repair belongs in the fixture.
Dependency boundary: The test directly imports @openclaw/fs-safe/test-hooks, and the production bundle reader calls the fs-safe Root facade. This establishes an affirmative fs-safe dependency contract; no Codex runtime contract is involved.
Findings None None.
Security None None.

How this fits together

The plugin skill reader turns installed skill files into an inventory with readable content and per-file status. It uses fs-safe to bound filesystem reads and charges failed reads against the bundle’s aggregate budget.

flowchart LR
  A[Installed skill files] --> B[Skill bundle reader]
  B --> C[Reserve byte budget]
  C --> D[Bounded filesystem read]
  E[Test injects file growth] --> D
  D --> F[Content or too-large status]
  F --> G[Complete bundle inventory]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Retain the existing production budget owner and restore fault injection through the dependency’s supported Root-read hook.

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

Yes, source inspection establishes why the old hook leaves the read observations empty, and the supplied before/after test results match that mechanism. Tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes. Moving the fixture to the awaited Root-read hook preserves the intended growth race and all existing assertions without changing production code.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a focused test-fixture repair with no production behavior 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 repository state identifies a MEMBER-authored test-only repair, so the external contributor runtime-proof gate does not apply; the supplied focused test and dependency-probe results directly cover the changed fixture.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base comparison changes only the growth hook and its explanatory comment; all read-volume, aggregate-budget, final-file status, and inventory assertions remain intact. The previous review used this same head and reported no findings. (src/skills/loading/plugin-skill-read.test.ts:426, 56b55225f540)
  • Current-main necessity: Inspected main still installs afterOpenedPathIdentityCheck in the failing test. Its production reader already reserves maxBytes + 1 before reading and refunds only successful reads, so the needed repair belongs in the fixture. (src/skills/loading/plugin-skill-read.test.ts:426, a90b969ae261)
  • Dependency boundary: The test directly imports @openclaw/fs-safe/test-hooks, and the production bundle reader calls the fs-safe Root facade. This establishes an affirmative fs-safe dependency contract; no Codex runtime contract is involved. (src/skills/loading/plugin-skill-bundle.ts:114, 56b55225f540)
  • Verified replacement hook: At v0.13.1, Root opening captures handle, stat, and identity before passing beforeRootReadFinalFence to admission. Admission awaits that hook, preserves the captured stat, and then performs its final identity fence; the subsequent reader uses the original stat before bounded I/O. The release tag resolves to the cited commit. (src/root-impl.ts:624, 7022a0a10c53)
  • Real bounded-read contract: The dependency reads through FileHandle.read and caps consumed bytes at maxBytes + 1, throwing too-large on overflow. The fixture observes this real read path rather than replacing its results. (src/bounded-read.ts:98, 7022a0a10c53)
  • Validation and integration context: The captured PR body reports the original 23-pass/1-fail result, 24 passing tests after repair, and a dependency probe observing 1,048,577 bytes with the replacement hook. The maintainer comment at test(skills): restore bounded-read growth hook after fs-safe upgrade #150419 (comment) explicitly consumes this commit unchanged in fix(channels): stop reinstalling loaded channel plugins from setup fallback #150026; that candidate also reports all 24 bundle tests passing. These are supplied observations, not reviewer executions. (56b55225f540)

Likely related people:

  • Patrick Erichsen: Raw commit a11a431 adds src/skills/loading/plugin-skill-read.test.ts:414 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a11a431e380f; files: src/skills/loading/plugin-skill-read.test.ts)
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-17T00:53:51.333Z sha 56b5522 :: needs maintainer review before merge. :: none

@fuller-stack-dev

Copy link
Copy Markdown
Member

Coordinating required-CI repair for #150026: this exact prerequisite fix (56b55225f540d8d5700bc3b78c5a715c9d02a81b) matches its failing gate. I am consuming the existing change unchanged in the #150026 integration candidate, preserving its commit ancestry and running delta qualification. I will not edit this branch or duplicate its source repair. The separate native-wrapper extraction-manifest omission is being repaired in #150026.

fuller-stack-dev added a commit to LiuwqGit/openclaw that referenced this pull request Sep 17, 2026
Integrate current main and the unchanged lazy-preview and bounded-read fixes from openclaw#150424 and openclaw#150419. Complete the native wrapper extraction manifest with its existing validation and plugin availability dependencies. Preserve contributor ancestry and keep openclaw#149672 open.
@steipete
steipete merged commit 09ad16a into main Sep 17, 2026
111 checks passed
@steipete
steipete deleted the ci-burden/skill-read-fs-safe-0-13 branch September 17, 2026 01:19
@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 17, 2026
…penclaw#150419)

Root reads in fs-safe 0.13.1 use dedicated final-admission hooks. Move the post-stat growth fixture to beforeRootReadFinalFence so its real read instrumentation and aggregate-budget assertions execute again.

Related: openclaw#150263.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants