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.

Internal foundation contracts used by existing exported Modules; these helpers have no standalone package entry or independent adoption claim. They start no work and acquire no storage, process, clock, network or authority port.

canonical-json.ts owns three distinct freezing profiles. deepFreeze freezes enumerable data parent first and skips already frozen parents. deepFreezeOwnProperties includes symbol and non-enumerable keys, reads trusted accessors and has the same cycle shortcut. freezeJsonTree freezes validated acyclic JSON children first, including children of an already frozen parent. All preserve identity. These are trusted-data helpers; boundary validation remains separate.

milestone-values.ts owns the shared Milestone date grammar and immutable /1 digest preimage. Caller readers preserve bounds, instant ranges and errors: reversed dates remain INVALID in Milestones/Research and CONFLICT in work briefs. Civil zones are syntax checked, without host-zone resolution. The Dashboard presentation grammar remains separate. Hashing excludes only pin.digest and retains the original commission digest and protocol string.

promise-observation.ts owns passive native Promise observation through createPromiseObserver(profile, seen?). Profiles explicitly choose visit, descriptor, object or combined object/key accounting; depth, fault continuation, function handling, native own-property traversal and snapshot order stay caller-owned. observePromises charges objects and keys. observePromiseData charges every value visit, including primitives and repeated values, plus missing/accessor descriptors. Callers retain their original visit/depth limits. All settlements share the original allowance and seen set. Default identity tracking uses a WeakSet, so visited objects are not retained solely by that tracker; callbacks may still retain references. An explicitly supplied seen set is preserved.

Caller profileWork accountingTraversal/fault policy
Milestone/Notification values; Dashboard presentationValue visitsExisting stop or caught-fault policy; native data visited
Proposal ownership; Guidance acceptance/toolsValue visitsExisting stop or propagation; native own data skipped
SubscriptionsValue visits, depth 16Finite work allowance; bounded descriptor snapshot; synchronous faults propagate; native own data skipped
Events RPCObjects and descriptor work, depth 18Bounded descriptor snapshot; synchronous faults propagate; functions and native own data skipped
Operational SignalsSeparate native/regular object caps and descriptor workInitial symbol exclusion and native-before-depth behaviour retained; bounded snapshot; faults propagate
DiagnosticsDescriptor workStateful across roots/faults/settlements; later descriptor faults observed and siblings continue
Work briefs; Research; Milestone ResearchValue visitsOriginal reset points and limits retained; fault values observed and later siblings continue
DeliveryValue visitsFault values and native own data visited; nested rejection reasons observed

Every profile observes both fulfilment values and rejection reasons. Later settlement faults are caught. Getters, user thenables and caller functions are not invoked; native species lookup and Proxy traps may run. Unobservable species and values beyond bounds may stay unobserved. Observation neither validates data nor grants authority.

Descriptor snapshots preserve the former bulk readers' key and fault order, but obtain individual descriptors only while work remains. Reflective own-key lists and Proxy traps still depend on host behaviour; these are traversal allowances, not hard reflection-memory or execution-time limits. Subscriptions/RPC validators retain separate descriptor-reading contracts.

The shared libraries' compiler-derived closures and forbidden-effect mutation tests are in test/module-graph.test.ts. Existing installed-consumer matrices remain independent. Refactoring scope and remaining debt; historical evidence and refinement snapshot and current verification. Historical receipts and resource pins are immutable. Changes to canonical JSON source bytes legitimately stale Repository collector recipes; no automatic re-pin occurs.

Source: docs/shared-values.md