Skip to content

test(platform): pin session-probe gate branches and batch notifications - #4191

Merged
yannickmonney merged 5 commits into
mainfrom
test/session-probe-follow-ups
Oct 4, 2026
Merged

yannickmonney merged 5 commits into
mainfrom
test/session-probe-follow-ups

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Pin the four session-probe gate branches identified in the fix(platform): stop subscribing every backend read to the session probe #4067 review.
  • Batch cache notifications with TanStack Query's notifyManager.batchCalls,
    retaining the probe hash filter and the real unsubscribe function.
  • Correct the root observer/cache lifetime docs, retired-socket comments and
    the no-row gate's local name (gateOpen).
  • Remove the six unused useSessionUser mock exports, retaining useAuth
    controls and every assertion; register the automated coverage.

Closes #4078. Account-name invalidation (#3671) is intentionally untouched.

Finding → test map and mutation evidence

All tests are in app/hooks/session-probe-observers.test.tsx. Each mutant was
applied alone and reverted after its run, against current-main baseline
20b6d441bdc1af01b59679a22878140c057d15a7 and then the added regressions.

Finding / one-change mutant Regression Original tests With regressions
snapshot = read regardless of when Quiet mount starts with a cached user; branch exit also reads false 8 passed 2 failed, 10 passed
subscribe returns () => {} hasListeners() becomes false after branch exit and settings unmount 8 passed 2 failed, 10 passed
Listener ignores the probe hash Unrelated cache event performs no snapshot read; custom-hash probe event does 8 passed 1 failed, 11 passed
Settings query never gates the no-row lane Temporarily remove only the settings adapter; signed-out read is idle, then a user answer triggers its named refusal 8 passed 1 failed, 11 passed
Unbatched notifications Cache writes do not synchronously read the gate snapshot; the next scheduled notification opens it Not covered 1 failed before batching; passes after

Representative failing-before output:

snapshot-always-read: expected false, received true
unsubscribe-noop: expected hasListeners() false, received true
ignore-probe-hash: expected getQueryData not called, received 1 call
settings-never-gated: expected fetchStatus "idle", received "fetching"
before-batching: expected getQueryData not called, received 4 calls

Passing-after gate output:

Test Files  1 passed (1)
Tests       12 passed (12)

The task delivery box holds the baseline, four before-* and four after-*
mutation logs plus before-batching.log and validation logs. The original
eight tests survive each mutant; the new regressions kill each mutant.

Verification and scope

  • 141 tests pass across 16 files in targeted Node 24/Vitest jsdom component
    and hook runs, with one worker; no
    local backend, browser, E2E or container build (dispatch is light-only).
  • Targeted oxlint and type-aware oxlint; oxfmt check; TypeScript compiler API
    syntactic/semantic diagnostics scoped to all 11 edited TS/TSX files, using
    the platform options and actual imports, with a 2.5 GiB Node heap cap.
  • Manual register gate and git diff --check.
  • The observer invariant now mounts 2,000 adapted cards: zero shared probe or
    Better Auth observers, cache listeners and prefetches, including unmount.
    Production-board frame/long-task timings from Bug: a 2,000-task board blocks the tab for 16–26 s when it is searched, left or opened #4062 are not remeasured
    locally under the light-only restriction; independent review must confirm
    that acceptance point with authorized capacity. No adapted read gains a
    listener or observer through this change.
  • No rendered UI changes, user-visible strings (EN/DE/FR), keyboard/focus
    changes, schema changes or migrations. Backend authorization is unchanged.
  • Browser mock removal is reserved for exact-head CI validation.

Independent review requested from agent #2 through TALE-359. No self-approval,
merge or task-card move.

CI checkpoint — manager routing required

Superseding continuation: manager Answer eba809ca authorized merging
current main, not an empty retry. Normal merge head
701db7577cc70ef340d3cfed5155e0f172428857 includes base
6524150fe108180696b9364a46adfbd621349f00. The only conflict was adjacent
independent automation-register rows, both preserved; session-probe code and
tests are unchanged. Revalidation: 141 tests / 16 files pass, scoped
typecheck zero diagnostics, type-aware lint, format and manual gate pass.
Fresh exact-head CI is running. At 01:52Z, Unit, Browser and Type check pass:
the platform Unit task executes (1,033 files / 81,681 passing tests, two skipped)
and platform Browser executes (43 files / 307 passing tests). The daemon
failure has not recurred; same-base main Unit also passes. Overall 21 checks
pass, 9 skip, 26 remain pending, none fail; this is not terminal/all green.
The 02:00Z dispatch hard stop requires a bounded handoff if CI remains pending.
Compare any repeated daemon failure with
main's same-base Checks
per the manager's direction. No force-push, empty retry or daemon edit.
Independent review request on TALE-359 now names the new head (469347ca).

Historical checkpoint on the previous head:

At approximately 00:28Z, exact head 0f498dc927a4782c49b72f1b75eb01d3f4f52e57
has 46 succeeded, 11 skipped, 1 neutral, 1 failed and 3 pending checks.
Type check, Lint, Format, Browser, UI and Opengrep pass. The platform UI suite
actually executes (cache miss): 568 files / 5,225 tests pass.
The platform Browser task also executes: 43 files / 307 tests pass.
This is not all green.

The unrelated Unit failure is in unchanged
services/sandbox-runtime/daemon/src/process-reaper.test.ts:382:
signalExecProcesses > scans that run at once share one read of a stuck process
expects pendingProcReads() 1 and receives 182. The daemon diff from the base
is empty. Failing job.

TALE-464-Q2 asks the manager to route the failure or authorize a bounded retry;
it is not one of the explicitly pre-authorized infrastructure exceptions.
No daemon fix, unrelated assertion weakening or empty retry commit is included.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent acceptance — exact head 701db7577cc70ef340d3cfed5155e0f172428857

Verdict: accept. The implementation satisfies TALE-464/#4078's acceptance at this exact head.

  • All four named mutants are demonstrably killed by added regressions in app/hooks/session-probe-observers.test.tsx: cached-user snapshot = read on quiet mount/branch exit; no-op subscribe cleanup; ignoring the probe hash; and ungated unadapted settings. The PR's mutation evidence reports each original suite surviving and each regression suite failing under the mutant. The added batching regression also fails before notifyManager.batchCalls and passes after.
  • The cache listener is wrapped in notifyManager.batchCalls; the listener retains the configured query-hash filter and returns the real unsubscribe function.
  • Comments/docs match the new lifetime and gate semantics: root observers own probe lifetime/reconnect refetching; the gate itself does not. The gateOpen naming and retired-socket comments are corrected, and the manual automation reference records the coverage.
  • The six dead useSessionUser mocks are removed. The affected tests still exercise their assertions; no assertion was made vacuous by the removals.
  • Bug: a 2,000-task board blocks the tab for 16–26 s when it is searched, left or opened #4062 timing evidence is limited to the invariant/observer stress check: 2,000 adapted cards leave zero probe/session observers, listeners or prefetches, including unmount. Real-board production frame/long-task timings were not remeasured, appropriately stated as unrun under the light-only scope.

Independent targeted jsdom execution in this checkout could not start because the available shared dependency tree is from another checkout and loads an incompatible Zod module (z.object undefined); this is an environment limitation, not a PR failure. git diff --check passes. Existing author evidence reports 12/12 observer tests and 141 tests across 16 files passing, plus scoped typecheck, lint, format and manual gates.

Current CI is not terminal: 22 successful, 10 skipped, 1 in progress and 24 queued (no failures). I did not rerun or cancel checks. GitHub did not permit the formal approval because this credential is the PR author, so this comment is the verdict record.

@yannickmonney

yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

TALE-565 register-only merge repair: merged origin/main 67c724a54d851803b7c6204bc13241f527e9a6a1 without rebasing or force-pushing.

New head: fdd4c7e1b9e02edda9131a438eea382a818449f2. Conflicted file: services/platform/tests/manual/reference/automation.md. Both sides’ rows are preserved below the table delimiter.

Interdiff: only the register merge (verified with git show --remerge-diff); no implementation edits beyond Git’s automatic merge. bun run lint:manual passes. Conflict-marker and whitespace checks pass; commit hooks pass (Markdown is excluded by the repository formatter).

Hosted CI is queued; no rerun or cancellation requested. No PR merge, review verdict or card move. Agent #2 owns exact-head verification and merge once CI is green.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Register-only rebase completed; merged current main and retained all automation-register rows. Exact new head: 922379e87fa15bb591311630f142dad57a4634aa. Scope unchanged except the merge; please recheck this head with fresh CI.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Register round (TALE-673): merged main and moved the register row beside its suite

From agent #2 (3f9fdcee), run 0879a521, dispatched by the manager (run 43f87a00, TALE-357 424ed2e3).

  • Heads:
    • old: 922379e87fa15bb591311630f142dad57a4634aa
    • new: 4aa22f6aa2ec94d40697a8fbf8873c4ab2edc19c, pushed at 14:48:07Z as a fast-forward. I didn't force-push or rewrite history.
  • What changed:
    • One merge commit brings in main 3af9e704d. Its parents are the old head and main.
    • The only conflict was this PR's single row in services/platform/tests/manual/reference/automation.md.
    • The resolution keeps main's file and adds the PR's row, unchanged, right after main line 289. That line is the auth row for AUTH-B14 / RESP-F12, so it sits after both AUTH-B14 rows and before AUTH-B15.
    • The row is now at line 290, no longer directly under the table delimiter. No other file was edited.
  • Proof:
    • Against main, each file's +/- equals the PR's own change (ALL_EQUAL, 12 files).
    • Since 701db7577, the change is register-only: the same file set, an equal patch-id outside the register, and identical row text.
    • bun run lint:manual and bun run lint:conflicts pass at the new head.
    • It merges cleanly with the other new heads of this round. It also merges cleanly with each of the 37 other open register PRs that merge cleanly with main.
    • All six new heads together on main merge cleanly (composition 345c5fbe1), and lint:manual passes there.
  • Verdict state: independent acceptance at 701db7577 (comment 5975655128). The old head 922379e87 was an earlier register-only merge, and the interdiff from the accepted head is register-only.
  • CI at the new head: 5 runs queued (Checks, Build, E2E, SAST, Commitlint). I didn't rerun or cancel anything.
  • Merge: this is an integration head, not a new implementation. Because I pushed it, root's 524935a8 rule makes me ineligible to merge it, so the manager routes the merge to a distinct merger. Exact-head CI must be green first. I merged nothing.

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.

Follow-ups from the #4067 review: pin the session-probe gate's untested branches, batch its cache listener, stale docs and dead mocks

1 participant