Repository navigation
test(skills): restore bounded-read growth hook after fs-safe upgrade - #150419
Conversation
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.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:16 PM ET / September 17, 2026, 01:16 UTC (Revision 2). ClawSweeper reviewWhat this changesUpdates 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests 0. Total 0 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Coordinating required-CI repair for #150026: this exact prerequisite fix ( |
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.
|
Merged via squash.
|
…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.
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 1048576incharges 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
afterOpenedPathIdentityCheckcallback never runs for this test: the files never grow and the read spies are never installed. Move the fixture to the awaitedbeforeRootReadFinalFencehook, after the pinned stat, matching the migration already made forpackage-dist-inventory.test.tsin #150263. Production already reservesmaxBytes + 1before 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):dist/bounded-read.jsanddist/read-opened-file.jsare 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 limitsafterOpenedPathIdentityCheckto standalone local-file/copy-source reads. The 0.13.1 changelog concerns native descriptor cleanup.Evidence
node scripts/run-vitest.mjs src/skills/loading/plugin-skill-read.test.ts: 24 passed.too-large.playback-transcode.staging.test.tscorrectly exercisesopenLocalFileSafelyand stays unchanged.node scripts/check-changed.mjs: passed, including core test types, static guards, dead-export scans, and changed-file lint.rg -l "__setFsSafeTestHooksForTest|fs-safe" src test --glob "*.test.ts": still running; its full E2E runtime prerequisite build passed.oxfmt --check,git diff --check, andpnpm check:line-cap-ratchet --base origin/main: passed. One test file, two lines replaced, no line growth.Original failing CI: run 35166207851, job 105028016150, head
6dbf1873f98a1154b06d1a3c39efc26b41dbcce9, shardcore-unit-src-security-2.