instar 1.3.547 → 1.3.549

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +112 -0
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +29 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/CoherenceJournal.d.ts +1 -1
  8. package/dist/core/CoherenceJournal.d.ts.map +1 -1
  9. package/dist/core/CoherenceJournal.js +23 -2
  10. package/dist/core/CoherenceJournal.js.map +1 -1
  11. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  12. package/dist/core/PostUpdateMigrator.js +27 -1
  13. package/dist/core/PostUpdateMigrator.js.map +1 -1
  14. package/dist/core/TopicOperatorReplicatedStore.d.ts +250 -0
  15. package/dist/core/TopicOperatorReplicatedStore.d.ts.map +1 -0
  16. package/dist/core/TopicOperatorReplicatedStore.js +413 -0
  17. package/dist/core/TopicOperatorReplicatedStore.js.map +1 -0
  18. package/dist/core/UserRegistryReplicatedStore.d.ts +287 -0
  19. package/dist/core/UserRegistryReplicatedStore.d.ts.map +1 -0
  20. package/dist/core/UserRegistryReplicatedStore.js +527 -0
  21. package/dist/core/UserRegistryReplicatedStore.js.map +1 -0
  22. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  23. package/dist/core/devGatedFeatures.js +10 -0
  24. package/dist/core/devGatedFeatures.js.map +1 -1
  25. package/dist/scaffold/templates.d.ts.map +1 -1
  26. package/dist/scaffold/templates.js +3 -1
  27. package/dist/scaffold/templates.js.map +1 -1
  28. package/dist/server/routes.d.ts.map +1 -1
  29. package/dist/server/routes.js +40 -0
  30. package/dist/server/routes.js.map +1 -1
  31. package/dist/users/TopicOperatorStore.d.ts +24 -0
  32. package/dist/users/TopicOperatorStore.d.ts.map +1 -1
  33. package/dist/users/TopicOperatorStore.js +28 -0
  34. package/dist/users/TopicOperatorStore.js.map +1 -1
  35. package/dist/users/UserManager.d.ts +27 -0
  36. package/dist/users/UserManager.d.ts.map +1 -1
  37. package/dist/users/UserManager.js +44 -0
  38. package/dist/users/UserManager.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/data/builtin-manifest.json +63 -63
  41. package/src/scaffold/templates.ts +3 -1
  42. package/upgrades/1.3.548.md +24 -0
  43. package/upgrades/1.3.549.md +36 -0
  44. package/upgrades/side-effects/multi-machine-replicated-store-ws26-user-topicop.md +123 -0
  45. package/upgrades/side-effects/ws52-incb-b4-livetest-route.md +42 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiH7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAsBtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAm3CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,W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ID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAm3CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CA8eN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA0sbtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -3385,6 +3385,28 @@ export async function startServer(options) {
3385
3385
  // is `status`: a peer must SEE an action was already completed/in_progress elsewhere.
3386
3386
  const { EVOLUTION_ACTION_KIND_REGISTRATION } = await import('../core/EvolutionActionsReplicatedStore.js');
3387
3387
  replicatedKindRegistry.register(EVOLUTION_ACTION_KIND_REGISTRATION);
3388
+ // WS2.6 (multi-machine-replicated-store-foundation) — register the SIXTH concrete replicated
3389
+ // kind, `user-record`, onto the registry: the SECOND PII kind (after WS2.3 relationships).
3390
+ // Dual-registry's dynamic half (the static half is CoherenceJournal.JOURNAL_KINDS, which now
3391
+ // lists 'user-record'). Registration is INERT — emission/serve/pull stay gated behind
3392
+ // `multiMachine.stateSync.userRegistry.enabled` (default false ⇒ strict no-op, NO user PII ever
3393
+ // crosses a machine boundary). With it registered, selfStateSyncReceive self-reports
3394
+ // `userRegistry:true` IFF the store is enabled, and the rollback-unmerge resolves its
3395
+ // contributing kind via getByStore. The local userId is NEVER replicated — the recordKey is the
3396
+ // channel-set identity surface (UserRegistryReplicatedStore.deriveUserRecordKey).
3397
+ const { USER_KIND_REGISTRATION } = await import('../core/UserRegistryReplicatedStore.js');
3398
+ replicatedKindRegistry.register(USER_KIND_REGISTRATION);
3399
+ // WS2.6 (multi-machine-replicated-store-foundation) — register the SEVENTH concrete replicated
3400
+ // kind, `topic-operator-record`, onto the registry: the THIRD PII kind, completing the WS2
3401
+ // memory family. Dual-registry's dynamic half (the static half is CoherenceJournal.JOURNAL_KINDS,
3402
+ // which now lists 'topic-operator-record'). Registration is INERT — emission/serve/pull stay
3403
+ // gated behind `multiMachine.stateSync.topicOperator.enabled` (default false ⇒ strict no-op). The
3404
+ // recordKey is sha256(topicId + ":" + verified-uid), NEVER a content-name
3405
+ // (TopicOperatorReplicatedStore.deriveTopicOperatorRecordKey). THE LOAD-BEARING INVARIANT: a
3406
+ // replicated topic-operator record is UNTRUSTED peer data — NEVER this machine's authoritative
3407
+ // answer to "who is my verified operator?" (only the local authenticated setOperator binds it).
3408
+ const { TOPIC_OPERATOR_KIND_REGISTRATION } = await import('../core/TopicOperatorReplicatedStore.js');
3409
+ replicatedKindRegistry.register(TOPIC_OPERATOR_KIND_REGISTRATION);
3388
3410
  // Snapshot-then-tail engine (Component 4 / build-order step 3,
3389
3411
  // multi-machine-replicated-store-foundation §6). The cache (FIXED ceiling,
3390
3412
  // §8.2 — NOT pool-scaled), the per-peer rebuild breaker (§6.3), and the engine
@@ -7770,6 +7792,96 @@ export async function startServer(options) {
7770
7792
  });
7771
7793
  void evolutionActionsUnionReader; // consumed by the evolution-actions peer-read surface + the journal-apply rollout stage (WS2.5+)
7772
7794
  void evolution.setEvolutionActionReplicationEmitter; // the emit seam exists (unit-tested + dark by default); the journal-backed emitter is attached in a later rollout stage, mirroring the WS2.2 learnings sibling
7795
+ // WS2.6 — the bypass-proof union reader for the `userRegistry` store (the SECOND PII kind). The
7796
+ // single funnel every replicated user read routes through, so no caller reads a raw replica
7797
+ // around the no-clobber rule. `loadOriginRecords` materializes the OWN user registry as the
7798
+ // single origin today (via userToOriginRecord, keyed on the channel-set identity surface — the
7799
+ // local userId is NEVER replicated); when the journal apply path lands peer `user-record`
7800
+ // replicas (a later rollout stage), the seam extends to read those peer namespaces too. With
7801
+ // only the own origin the union is a strict no-op. tierOf returns HIGH (append-both-and-flag
7802
+ // never silently clobbers two divergent profiles; the READ layer is advisory — a replicated
7803
+ // user is a HINT, never the authoritative inbound-resolution answer, which is LOCAL-ONLY). The
7804
+ // emit seam is attached ONLY when stateSync.userRegistry.enabled is true (default false ⇒ NOT
7805
+ // injected ⇒ strict no-op, byte-identical single-machine behavior).
7806
+ const { UserManager: _UMForUnion } = await import('../users/UserManager.js');
7807
+ const { userTierOf, userToOriginRecord, deriveUserRecordKey, USER_STORE_KEY } = await import('../core/UserRegistryReplicatedStore.js');
7808
+ const userRegistryUnionReader = new ReplicatedStoreReader({
7809
+ registry: replicatedKindRegistry,
7810
+ stores: config.multiMachine?.stateSync,
7811
+ tierOf: userTierOf,
7812
+ loadOriginRecords: (store, recordKey) => {
7813
+ if (store !== USER_STORE_KEY || _meshSelfId === null)
7814
+ return [];
7815
+ const mgr = new _UMForUnion(config.stateDir, config.users);
7816
+ for (const u of mgr.listUsers()) {
7817
+ if (deriveUserRecordKey(u.channels) === recordKey) {
7818
+ const o = userToOriginRecord(u, _meshSelfId);
7819
+ return o ? [o] : [];
7820
+ }
7821
+ }
7822
+ return [];
7823
+ },
7824
+ listRecordKeys: (store) => {
7825
+ if (store !== USER_STORE_KEY)
7826
+ return [];
7827
+ const mgr = new _UMForUnion(config.stateDir, config.users);
7828
+ const keys = [];
7829
+ for (const u of mgr.listUsers()) {
7830
+ const k = deriveUserRecordKey(u.channels);
7831
+ if (k !== null)
7832
+ keys.push(k);
7833
+ }
7834
+ return keys;
7835
+ },
7836
+ droppedOrigins: droppedOriginRegistry,
7837
+ conflictStore,
7838
+ });
7839
+ void userRegistryUnionReader; // consumed by the user-registry peer-read surface + the journal-apply rollout stage (WS2.6+)
7840
+ // WS2.6 — the bypass-proof union reader for the `topicOperator` store (the THIRD PII kind). The
7841
+ // single funnel every replicated topic-operator read routes through. `loadOriginRecords`
7842
+ // materializes the OWN topic-operator store as the single origin today (via
7843
+ // topicOperatorToOriginRecord, keyed on sha256(topicId + ":" + verified-uid) — never a
7844
+ // content-name); when the journal apply path lands peer `topic-operator-record` replicas (a
7845
+ // later rollout stage), the seam extends to read those peer namespaces too. With only the own
7846
+ // origin the union is a strict no-op. tierOf returns HIGH (append-both-and-flag). THE
7847
+ // LOAD-BEARING INVARIANT: the READ layer is ADVISORY — a replicated topic-operator record is a
7848
+ // HINT about what a peer machine bound, NEVER this machine's authoritative principal (only the
7849
+ // local authenticated setOperator binds it; there is no apply path back into TopicOperatorStore).
7850
+ const { TopicOperatorStore: _TOSForUnion } = await import('../users/TopicOperatorStore.js');
7851
+ const { topicOperatorTierOf, topicOperatorToOriginRecord, deriveTopicOperatorRecordKey, TOPIC_OPERATOR_STORE_KEY } = await import('../core/TopicOperatorReplicatedStore.js');
7852
+ const topicOperatorUnionReader = new ReplicatedStoreReader({
7853
+ registry: replicatedKindRegistry,
7854
+ stores: config.multiMachine?.stateSync,
7855
+ tierOf: topicOperatorTierOf,
7856
+ loadOriginRecords: (store, recordKey) => {
7857
+ if (store !== TOPIC_OPERATOR_STORE_KEY || _meshSelfId === null)
7858
+ return [];
7859
+ const tos = new _TOSForUnion(config.stateDir);
7860
+ const all = tos.all();
7861
+ for (const [topicId, op] of Object.entries(all)) {
7862
+ if (deriveTopicOperatorRecordKey(topicId, op.uid) === recordKey) {
7863
+ const o = topicOperatorToOriginRecord(topicId, op, _meshSelfId);
7864
+ return o ? [o] : [];
7865
+ }
7866
+ }
7867
+ return [];
7868
+ },
7869
+ listRecordKeys: (store) => {
7870
+ if (store !== TOPIC_OPERATOR_STORE_KEY)
7871
+ return [];
7872
+ const tos = new _TOSForUnion(config.stateDir);
7873
+ const keys = [];
7874
+ for (const [topicId, op] of Object.entries(tos.all())) {
7875
+ const k = deriveTopicOperatorRecordKey(topicId, op.uid);
7876
+ if (k !== null)
7877
+ keys.push(k);
7878
+ }
7879
+ return keys;
7880
+ },
7881
+ droppedOrigins: droppedOriginRegistry,
7882
+ conflictStore,
7883
+ });
7884
+ void topicOperatorUnionReader; // consumed by the topic-operator peer-read surface + the journal-apply rollout stage (WS2.6+)
7773
7885
  // Start MemoryPressureMonitor (platform-aware memory tracking)
7774
7886
  const { MemoryPressureMonitor } = await import('../monitoring/MemoryPressureMonitor.js');
7775
7887
  const memoryMonitor = new MemoryPressureMonitor({ stateDir: config.stateDir });