test(project-connection): un-skip ownership-claim race test (lr-a7b03e) - #399
Conversation
|
PEACHES — clean (no findings)
Checked: clagentic-console brand rules (peaches.yaml), test integrity, comment accuracy against task context (lr-a7b03e task comment #3, holden authoritative brief). |
|
Diff scope: test/project-connection-ownership-claim-lr-768c9e.test.js only (1 file, +7/-8 lines). Removes a quarantine skip and updates the explanatory comment to record that lr-795882 (merge-gate fail-open, node --test --test-force-exit silently dropping ESM test files while exiting 0) was fixed at 863f359 (2026-08-15), predating this PR head by 4 days per git log, and that the flake was re-measured on the repaired harness across 8 full-suite runs without reproducing. No lib/ or production source changed. gitleaks and trufflehog: no secrets in origin/main..9b7f06f. semgrep flagged 4 path-traversal WARNING hits (path.join with locally-generated tmpHome/sessionsDir at lines 55, 75, 101) but all are pre-existing lines outside the changed hunk (lines 143-156 only), LOW confidence, and operate on test-fixture temp paths, not attacker-controlled input -- not diff-introduced, not reportable. osv-scanner not applicable: no dependency manifest touched by this diff. Exception-check for the negative-result framing: this change strictly increases active security-regression assertion count (re-enables a previously-quarantined ownership-claim/history-truncation race test) and sits chronologically after the harness fail-open fix that would have undermined trust in the re-measurement basis. No coverage or trust regression identified. PEACHES already covered code-craft (comment 5348277057); this review is security-exposure-scoped only. Early-exit: only a test-quarantine-comment change, no reachable sink altered. |
|
Merged via clagentic-loadout v0.2.0
|
What
Un-skips test/project-connection-ownership-claim-lr-768c9e.test.js:153 per HOLDEN comment #3 on lr-a7b03e, which is the explicit authorization the skip comment demanded (do not remove this skip without lr-a7b03e being resolved first).
Why
The original ~1/19 flake rate that justified quarantining this test was measured on a broken harness (node --test --test-force-exit), which MILLER proved (lr-a7b03e comment #1) could silently drop entire ESM test files while still exiting 0. That defect is fixed as of lr-795882 / PR #395 (main 863f359): npm test no longer uses --test-force-exit, and scripts/check-test-count.js now enforces a per-file completion guard.
Per HOLDENs next-step sequence: un-skip first, then re-measure the flake rate empirically on the repaired harness BEFORE diagnosing anything, since the race may have been a symptom of the same handle-leak rot that lr-795882 fixed.
Measurement (the deliverable)
Ran npm test (full suite, 1429 tests) 8 times consecutively with the test un-skipped:
Every run registered exactly 1429 tests (the per-file completion guard held; no silent truncation). The lr-768c9e ownership-claim test passed every time it was inspected, including runs that had a failure elsewhere.
The only failure observed across all 8 runs, in 3 of the 8, was test/daemon-bootstrap-guard.test.js:48 (the EX_CONFIG 78 exit-code test). That test spawns lib/daemon.js as a subprocess with a 5000ms timeout and got status: null under this sandboxs load, consistent with the spawn hitting its own timeout rather than the daemon actually misbehaving. This is a different file, different mechanism, and pre-existing (tracks lr-dec3, unrelated to lr-a7b03e). Per the tasks instruction not to conflate distinct races (also called out for lr-2fcf59), this is left untouched and unfiled here as a timing-sensitive test-environment flake, not a code defect.
Outcome
The ~1/19 ownerId-is-null race named in this tasks title/description did NOT reproduce across 8 full-suite runs on the repaired harness. Per the tasks OUTCOME BRANCHES: this is the deliverable when the race does not reproduce -- ship the un-skip alone with the measurement evidence, which is what this PR does. No fix is included because nothing was observed to fix. MILLERs hypothesis that the race was a symptom of the handle-leak rot fixed under lr-795882 is consistent with this result, though not proven by it.
MILLERs negative results in comment #1 Finding 3 (module-cache freezers, canAccessSessions synchronous path, lib/sessions.js CONFIG_DIR read timing) and the residual fire-and-forget-write hypothesis (lib/users.js:69, lib/user-presence.js:25) were reviewed per the task instructions but not independently re-tested, since the race did not reproduce to diagnose.
Test status
npm test: PASS overall (see measurement table above -- 3 of 8 runs had one unrelated pre-existing failure in daemon-bootstrap-guard.test.js, 5 of 8 fully green).
TASK: lr-a7b03e