Skip to content

test: retain bounded default-root-build watcher failure diagnostics - #451

Merged
Helweg merged 2 commits into
mainfrom
maint/watcher-failure-capture
Oct 19, 2026
Merged

Helweg merged 2 commits into
mainfrom
maint/watcher-failure-capture

Conversation

@Helweg

@Helweg Helweg commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add bounded, test-owned failure diagnostics only to the existing default-root-build watcher rejection scenarios; no production changes.
  • Use a real circular event ring, fixed first/last phase anchors, separate dropped-event and explicit detail-byte-cut counts, genuine initial Chokidar notifications, and bounded numeric statistics from the actual awaited index results.
  • Bind each teardown to its own capture. After watcher stops, handler-tail settlement, and indexer-close settlement, retain safe owned source fixtures before deletion; copy index fixtures only if all watcher stops and all indexer closes succeeded, otherwise mark the index snapshot MISSING.
  • Document private artifact handling and configure failure-only CI pickup using the existing pinned upload action, missing-file ignore, and 14-day retention.

Bounds and limits

512 tail events, at most 2 KiB per event, fixed first/last phase anchors, 256 visited fixture entries, 16 MiB combined snapshots, and 18 MiB total including metadata. The ring's ordered tail is materialized only for failure serialization. Success persists no diagnostic artifact.

Capture errors cannot replace the original test or cleanup outcome. Existing consumer assertions, search predicate, 20-second wait, test deadlines, selection, concurrency, callback arguments/promises, and error propagation are unchanged. No retries, sleeps, warmup, production telemetry, watcher fix, or loader shim.

Symlink, hardlink, special-file, and replaced-root refusal remain fail-closed. Stop/close success is a quiescence prerequisite, not proof of database consistency. POSIX mode/directory-FD guards may refuse Windows snapshots as MISSING; Windows snapshot coverage is unverified. Filtering, queueing, flushing, native notifications, and replacement-emitter coverage are explicitly unavailable rather than inferred.

Native provenance is ordinary-cache observation only; any digest means current disk, not previously executed bytes. Raw fixture index files can embed temporary paths; artifacts must not be committed or published unreviewed.

Verification

Latest refinement, each natural command run once on the frozen reviewed source:

  • New helper-only synthetic smoke: exact ring order after multiple wraps; stable anchors and dropped count; explicit byte-cut count; bounded synthetic numeric metadata; success no persistence and normal cleanup; index refusal with safe source retention after failed stop/successful close and successful stop/failed-or-unknown close.
  • Existing focused natural Chokidar test: 1 passed, 30 unselected.
  • npm run build && npm run typecheck && npm run lint && npm run test:run: 143 files passed, 1 skipped; 2,826 tests passed, 6 skipped.
  • Source hashes unchanged before/after validation; committed bytes match the reviewed manifest.
  • Original capture revision's separate synthetic safety/cap smoke and once-only gates were preserved unchanged.
  • CI run 39272905486 completed SUCCESS on exact head 8864f8a9f99fb2e4bc9df789a62018cc09f354c8: both Linux Node 22/24 full jobs and all six OS path-semantics jobs succeeded. All four CodeQL Analyze jobs succeeded; the separate aggregate CodeQL check was neutral, not a failed analyzer. Label and drafter checks succeeded.

Synthetic index/statistics examples are not a real database, Indexer measurement, or watcher-failure reproduction. No natural failure was deliberately induced or observed. Failure-artifact upload was skipped in both passing CI full-test jobs; actual upload-on-failure and Windows snapshot retention are not exercised. The six OS path-semantics jobs do not establish cross-platform artifact-helper coverage.

Review state

Parent source, local-evidence, exact five-file scope, and current-CI review accepted for this PR only. Passing runs are non-reproduction only: the historical watcher failure remains FAILED / root cause UNKNOWN, not fixed by this diagnostic PR. No failure waiver is applied here.

Independent of #450, which remains draft and on a separate HOLD with no accepted-risk exception. Feature base: f8261391ba95ecbd166a224379765f6f76d9f1f6; reviewed head: 8864f8a9f99fb2e4bc9df789a62018cc09f354c8, with ordinary followup parent ae52cf95a81f533a918d3c756641fc3c04682403.

@Helweg Helweg added test Test changes semver:patch Bug fix or patch labels Oct 19, 2026
@Helweg
Helweg marked this pull request as ready for review October 19, 2026 15:07
@Helweg
Helweg merged commit a5c6539 into main Oct 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch Bug fix or patch test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant