Skip to content

(test): BT5/BT6 enumerate+concurrent; decouple 2 refactor-fragile assertions - #54

Merged
JeanBaptisteRenard merged 1 commit into
mainfrom
test/bt5-bt6-decouple
Jun 10, 2026
Merged

(test): BT5/BT6 enumerate+concurrent; decouple 2 refactor-fragile assertions#54
JeanBaptisteRenard merged 1 commit into
mainfrom
test/bt5-bt6-decouple

Conversation

@JeanBaptisteRenard

Copy link
Copy Markdown
Collaborator

Completes the behavior-test plan (Phase BT follow-ups + the safe coupled-test loosenings).

Added (behavior tests)

  • BT5 read-session-file.test.js: enumerateSessionFiles over a large folder (100 sessions + 5 subagents/ subdirs) — asserts total count + subagent-child discovery.
  • BT6 session-transitions.test.js: concurrent monitoring of 2 distinct sessions — each emits its own IPC events, no cross-contamination.

Decoupled (refactor-resilient, same observable intent)

  • session-transitions.test.js: the _stableStart-seeding test rewritten to drive the lifecycle via a fake Date clock (t.mock.timers) instead of poking private state.
  • reconcile-cache.test.js: assertion moved off the fake DB's internal indexed Set onto the observable setFolderMeta seam.

Untouched

  • main-ctx-db-wiring.test.js left as-is — its source-regex assertion guards a witnessed silent worker crash; not weakened.

195 tests, all green; suite exits cleanly (verified in the primary checkout).

Generated with Claude Code

…ile assertions

BT5: extend read-session-file.test.js with a 100-session + 5-subagent-subdir
large-fixture test for enumerateSessionFiles. Asserts total count and that each
subagent parent contributes exactly 3 children with correct filePaths.

BT6: extend session-transitions.test.js with:
- concurrent monitoring test: 2 independent sessions, no cross-contamination
  on knownSubagents state or IPC events
- rewritten completion test: drives lifecycle through observable inputs using
  t.mock.timers fake Date (enable with now=realNow to avoid epoch=0 falsy trap)
  instead of directly seeding the internal _stableStart field

Decouple reconcile-cache.test.js: replace fake.indexed Set (internal
bookkeeping) with folderMetaCalls assertions on setFolderMeta observable seam
(which folders got stamped with non-zero indexMtimeMs). Same intent, less
coupling to upsertCachedSessions implementation details.

test/main-ctx-db-wiring.test.js: left entirely untouched per spec.
@JeanBaptisteRenard
JeanBaptisteRenard merged commit 73af4ea into main Jun 10, 2026
7 checks passed
@JeanBaptisteRenard
JeanBaptisteRenard deleted the test/bt5-bt6-decouple branch June 10, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant