/**
 * ws2SendWiring — the SEND-side wiring manifest + the wiring-integrity ratchet
 * (WS2 send-side, docs/specs/WS2-SEND-SIDE-EMISSION-SPEC.md §6/§7).
 *
 * THE INVARIANT THIS ENFORCES: every replicated store registered in the
 * `ReplicatedKindRegistry` (the RECEIVE/advert half) must be CONSCIOUSLY classified
 * as either SEND-WIRED (its manager's emit hooks are attached to the journal-backed
 * emitter) or SEND-PENDING (a known, enumerated follow-up). A new replicated kind
 * added to the registry WITHOUT placing it in one of these sets fails the ratchet —
 * which is the EXACT gap this workstream fixes: a kind shipped receive-only (advert +
 * apply machinery) with the SEND half silently a no-op. The ratchet makes that a CI
 * failure, not a memory item (Structure > Willpower).
 *
 * Pure data + a pure check — no I/O, no deps. The server's wiring + the
 * wiring-integrity test BOTH read these sets, so they cannot drift.
 */
/** Stores whose manager emit hooks ARE attached to the journal-backed emitter (their
 *  records actually cross). The learnings slice ships first; the other seamed stores
 *  follow on the SAME emitter (WS2-SEND-2). */
export const WS2_SEND_WIRED_STORES = Object.freeze([
    'learnings',
    'relationships',
    'knowledge',
    'evolutionActions',
    'topicOperator',
    'userRegistry',
    'preferences',
]);
/**
 * Stores registered for RECEIVE but whose SEND wiring is a KNOWN, enumerated
 * follow-up — NOT a silent omission. EMPTY: all 7 replicated memory/PII stores are now
 * SEND-WIRED (learnings, relationships, knowledge, evolutionActions, topicOperator,
 * userRegistry, preferences). A future replicated store registered for RECEIVE before its
 * SEND wiring lands goes here with a stated reason (the ratchet keeps it from being a
 * silent omission).
 */
export const WS2_SEND_PENDING_STORES = Object.freeze([]);
/** Classify a registered store's send-wiring status. */
export function ws2SendStatus(store) {
    if (WS2_SEND_WIRED_STORES.includes(store))
        return 'wired';
    if (WS2_SEND_PENDING_STORES.includes(store))
        return 'pending';
    return 'unclassified';
}
/**
 * Audit a set of registered store keys against the wiring manifest. `ok` is false iff
 * any registered store is unclassified (neither wired nor pending) — the exact
 * receive-only gap this workstream closes. Also flags a store in BOTH sets (a manifest
 * authoring error) as unclassified-style failure via a thrown precondition is avoided;
 * instead WIRED takes precedence and the overlap is surfaced by the caller's own
 * disjointness assertion in the test.
 */
export function auditWs2SendWiring(registeredStores) {
    const wired = [];
    const pending = [];
    const unclassified = [];
    for (const store of registeredStores) {
        const status = ws2SendStatus(store);
        if (status === 'wired')
            wired.push(store);
        else if (status === 'pending')
            pending.push(store);
        else
            unclassified.push(store);
    }
    return { wired, pending, unclassified, ok: unclassified.length === 0 };
}
//# sourceMappingURL=ws2SendWiring.js.map