Factory docs, home
Page navigation

Pre-release documentation. Proposed designs are labelled in the page; acceptance evidence is maintained in the build review. Local paths appear as placeholders. Current state: Build review.

This is the fixed /2 notification mode of proposal ownership, using the same public entry and original Journal aggregate. It records finite ownership before possible contact. It supplies no sender, listener, subscription host, credentials or receiver acceptance. Existing /1 histories and API remain unchanged; the two modes refuse each other's histories.

Environment and passive inspection

Use Node.js 26.8.1 or later, ESM, a trusted local SQLite filesystem and the staged private tarball. There are no runtime npm dependencies. Public declarations support strict ES2024 with types:[]. This complete example runs without a repository, database or external authority:

import { notificationOwnershipValues } from 'software-factory/proposal-ownership';

const retained = notificationOwnershipValues.replay([]);
console.log(retained === null ? 'No retained ownership' : retained.digest);

An empty replay is only an inspection result. It does not prove a virgin store or authorise provisioning. For nonempty history, use parseEvent, parseState and replay; replay checks exact transition order, identities, admissions, body and state digests. Constructors capture methods without calling them. Passive methods neither repair history nor make remote calls. read({actorId}) also needs current read authority and returns a delivery view only after first offer.

Supply one qualified physical host

Construct NotificationOwnership(journal, originalBinding, qualifiedFence) with an existing Command Journal. Select the original mode once in persistent caller-owned provisioning metadata for the actual private-store incarnation. Keep the same producer/store/namespace/Product and physical Journal/store handles. Original loss, replacement or rollback is unavailable/corrupt; it never starts a new allowance. The binding is provisioning identity, not an attempt ledger.

The typed QualifiedNotificationFence has two synchronous methods. run acquires the common non-expiring local outer lock and calls its decision once under current authority. It honestly returns R | NotificationRefusal: current permission may return the exact fixed FORBIDDEN/authority refusal without invoking the decision. verifyHeld never acquires or re-enters that lock. It verifies its captured physical handles, live private frame and independently reconstructed current admission, then invokes the marker decision once. A remembered token, public boolean or matching ID is insufficient. Both methods return the exact callback result when a callback runs. Promises, thenables, getters, late callbacks and substituted acknowledgements are refused; possible commits remain unknown.

Passive rejection observation follows native fulfilled data through own string and symbol descriptors, sharing one seen set, at most 24 nested levels and 221,184 descriptor/value steps. The step ceiling reuses the complete-state limit; it grants no extra input capacity. No getter or generic thenable is invoked. An observation fault cannot replace the original synchronous refusal or turn an uncertain commit into a retry; fulfilled data never becomes permission.

Every ownership writer, private subscription/ACL/key/epoch change and later actual contact must share this outer lock before their own database locks. This package cannot authenticate a dishonest trusted port or make multiple databases and a network request one transaction. Qualify the concrete host arrangement independently; never copy a permissive in-memory example into a real caller. This component package does not include the EV2 subscription host; that is a separate accepted dependency to compose and qualify explicitly.

One occurrence, one generation, three attempts

The closed mutation API accepts initialise, propose, first-offer, cancel and expire. It fixes one reviewed rule, one root/occurrence and target subscription epoch, at most eight complete sorted causes, and an actual Branch health event projection. Guidance and supersession stay outside this mode. At queue, offer and each marker the caller re-reads the committed source with current permission and the actual pinned/current filter. A suppressed event adds no operation or marker; later suppression never erases earlier ownership.

The module itself parses EV1 and derives the canonical body {eventId,name,timestamp,data,cursor:null}. Its source poll-start time, event ID and body remain fixed. Original send deadline is the minimum of commission/occurrence/subscription/permission expiry and source time plus five minutes. Every committed current grant/verification expiry may shorten its contact ceiling. Later renewal never restores time or capacity.

markUnderFence(request, admission) can return one fresh marker after an exact, synchronous Journal acknowledgement. Replayed, lost or uncertain acknowledgement grants no contact. Marker identity contains the original operation/body/epoch and lifetime ordinal. Unsettled ownership excludes another marker even without a separate unknown observation. Never retry with a new command, scope or namespace.

An unavailable original-command replay or secondary aggregate read returns the existing storage refusal rather than claiming corruption. Returned receipt values and history are still checked for CORRUPT/history; Journal command conflicts and stale versions use the existing refusal classifier. These refusals create no marker or contact permission. A fault after a possible new commit still requires reconciliation of the original command.

observe appends one immutable unknown and one terminal per attempt under separate maintenance authority, including after cancellation, expiry or private cleanup. Unknown, timeout, abort and process death never reclaim an ordinal. A terminal retryable HTTP result or proved no-contact connection failure permits the next ordinal only after fixed backoff: one second, then two. The anchor is actual contact start; only affirmative no-contact uses the original marker admission. All original deadlines still apply. Terminal-unknown remains excluded permanently. A 2xx result is only a transport receipt; a late receipt preserves any prior unknown and never acknowledges a domain command.

Bounds and evidence limits

This mode reserves 16 transitions and permits at most 13: three initial controls, three markers each with optional unknown and terminal, and one closure. It permits one operation/generation, no parents, and three lifetime attempts. Commission lifetime is at most 60 seconds. State is capped at 221,184 canonical UTF-8 bytes; transport at 65,536; generation at 24,576; body at 16,384; markers at 4,096; observations at 2,048. Intersecting input/parser bounds may be tighter. Overflow refuses before ownership rather than truncating or evicting originals. The full remaining terminal/closure reserve is checked before admission.

The view always reports cursor:null and everything outside the pinned event as unobserved. It has no contiguous-delivery checkpoint, dispatcher or receiver inbox. Current builder evidence includes fixed histories, strict rejected-Promise processes and two real local private-store arrangements with process races and killed boundaries. The corrected component and retained package passed separate independent review. Current independent same-package physical proof separately covers Journal, EV2 and notification ownership. This local proof establishes no live provider qualification or deployment.

Source: docs/how-to/adopt-notification-ownership.md