docs(flush): the ES-private note reads after the gate's contract, not through it
Some checks are pending
CI / Node 22 (push) Waiting to run
CI / Node 24 (push) Waiting to run
CI / Integration + conformance (Node 22) (push) Waiting to run
CI / Bun (latest) (push) Waiting to run
Delta Gate / Delta gate — candidate vs control (push) Waiting to run

The #-private rationale landed spliced into the middle of each method's
description, cutting one sentence in half. Same words, moved below the
behaviour they annotate.
This commit is contained in:
David Snelling 2026-09-02 14:11:27 -07:00
parent 72c8ee6acd
commit e49a73e529

View file

@ -13347,18 +13347,17 @@ export class Brainy<T = any> implements BrainyInterface<T> {
/**
* @description Run one flush body as the leader and install it as
* `_flushInFlight`.
*
* ECMAScript-private (`#`), not TypeScript `private`: `private` is erased at
* compile time, so the method still lands on the prototype and the contract
* manifest which reads the surface the BUILD exposes emitted it as a
* door. A door is a promise every engine implementing the contract must
* keep, and this is the flush gate's own bookkeeping, not a promise. `#`
* keeps it off the prototype, so the emitter cannot see it.
* On settle resolved OR rejected the gate opens and
* `_flushInFlight`. On settle resolved OR rejected the gate opens and
* the ONE queued waiter (if any) is promoted. The `finally` callback returns
* nothing on purpose: a callback that returned the promoted run's promise
* would make the leader await its own follower.
*
* ECMAScript-private (`#`), not TypeScript `private`: `private` is erased at
* compile time, so the method would still land on the prototype and the
* contract manifest reads the surface the BUILD exposes, so it would emit
* this as a contract door. A door is a promise every engine implementing the
* contract must keep; this is the flush gate's own bookkeeping. `#` keeps it
* off the prototype, where the emitter cannot see it.
* @returns The leader's own promise, settling on its own body alone.
*/
#startFlushLeader(): Promise<void> {
@ -13376,11 +13375,12 @@ export class Brainy<T = any> implements BrainyInterface<T> {
/**
* @description Promote the single queued waiter (if one is waiting) to
* leader and settle its deferred from that run. ECMAScript-private for the
* same reason as {@link flush}'s leader starter: internals are not doors.
* Never throws into the
* leader and settle its deferred from that run. Never throws into the
* leader's `finally`: a synchronous failure starting the promoted run is
* reported to the waiter, which must be settled on every path.
*
* ECMAScript-private for the same reason as the leader starter above:
* internals are not doors.
* @returns Nothing.
*/
#promoteQueuedFlush(): void {