fix(tests): use native smoke result descriptor - #155
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 11:31 AM ET / 15:31 UTC. ClawSweeper reviewWhat this changesThe PR updates the standalone native diagnostic to extract the numeric file descriptor returned by Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the one-line correction matches the current native binding contract, has recorded real smoke evidence, and remains necessary because fetched Priority: P3 Review scores
Verification
How this fits togetherThe native smoke script opens a test file through the package’s confinement-aware native binding, then uses the returned descriptor for identity checks and cleanup. It verifies native filesystem-boundary behavior separately from the CI mode-smoke path. flowchart LR
A[Temporary fixture] --> B[Native smoke script]
B --> C[Confinement-aware file open]
C --> D[Open result]
D --> E[Descriptor identity checks]
E --> F[Cleanup and PASS result]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Merge the narrow descriptor-contract correction after the remaining required checks complete. Do we have a high-confidence way to reproduce the issue? Yes: current-main source passes an object into descriptor-only operations, and the PR body records a built-addon before/after smoke run that changes from an argument-type failure to Is this the best way to solve the issue? Yes: destructuring AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a5354d30cde9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Resolves a problem where running the standalone native filesystem diagnostic failed during descriptor identity checking and cleanup.
openBeneath()returns{ fd, containment }, but this script still treated the entire result as a numeric descriptor. ItscloseSync()error also masked the original identity-check failure.This is a stale standalone script contract, not a broken CI path: current CI uses
scripts/native-mode-smoke.mjs.Why This Change Was Made
Destructure the numeric
fdat the call site and retain the existingtry/finallyownership. Keep the tiny diagnostic available without changing the binding, containment semantics, Windows lossless identities, or retained-directory staging. The return-contract migration in #65 missed this caller; current documentation already describes the object result.User Impact
Tooling only. The standalone diagnostic can complete its mkdir, open, identity, hardlink, rename, and collision checks again. No public API, package behavior, security policy, or compatibility change.
Evidence
Actual darwin-arm64 addon, built with
pnpm buildandpnpm native:build:Before:
node scripts/native-smoke.mjsexited 1 withERR_INVALID_ARG_TYPE: the fd argument received an Object.After: the same command exited 0 with
native smoke: PASS, including the later hardlink and rename/collision checks.Existing native descriptor/containment integration regression passed against the built addon.
pnpm check: lint, build, and documentation checks passed; tests hit 68 timeouts plus cleanup errors on a heavily loaded host.Full suite retried with
pnpm test --maxWorkers=2: 1,282 passed, 112 skipped, three archive-fuzz tests timed out. Test timeouts and repository configuration are unchanged. PR CI remains the full-suite landing gate.git diff --checkpassed. Independent Codex autoreview reported no actionable findings.Existing regression test and actual native before/after smoke exercised
Security and compatibility impact considered
CHANGELOG.mdupdated for the tooling correctionNo credentials, private paths, private hosts, or sensitive contents included