instar 1.3.548 → 1.3.550
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.
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +122 -5
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +29 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/CoherenceJournal.d.ts +1 -1
- package/dist/core/CoherenceJournal.d.ts.map +1 -1
- package/dist/core/CoherenceJournal.js +23 -2
- package/dist/core/CoherenceJournal.js.map +1 -1
- package/dist/core/CredentialRebalancerSnapshot.d.ts +17 -0
- package/dist/core/CredentialRebalancerSnapshot.d.ts.map +1 -1
- package/dist/core/CredentialRebalancerSnapshot.js +24 -0
- package/dist/core/CredentialRebalancerSnapshot.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +27 -1
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/TopicOperatorReplicatedStore.d.ts +250 -0
- package/dist/core/TopicOperatorReplicatedStore.d.ts.map +1 -0
- package/dist/core/TopicOperatorReplicatedStore.js +413 -0
- package/dist/core/TopicOperatorReplicatedStore.js.map +1 -0
- package/dist/core/UserRegistryReplicatedStore.d.ts +287 -0
- package/dist/core/UserRegistryReplicatedStore.d.ts.map +1 -0
- package/dist/core/UserRegistryReplicatedStore.js +527 -0
- package/dist/core/UserRegistryReplicatedStore.js.map +1 -0
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +10 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +3 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/users/TopicOperatorStore.d.ts +24 -0
- package/dist/users/TopicOperatorStore.d.ts.map +1 -1
- package/dist/users/TopicOperatorStore.js +28 -0
- package/dist/users/TopicOperatorStore.js.map +1 -1
- package/dist/users/UserManager.d.ts +27 -0
- package/dist/users/UserManager.d.ts.map +1 -1
- package/dist/users/UserManager.js +44 -0
- package/dist/users/UserManager.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +19 -19
- package/src/scaffold/templates.ts +3 -1
- package/upgrades/1.3.549.md +36 -0
- package/upgrades/1.3.550.md +23 -0
- package/upgrades/side-effects/multi-machine-replicated-store-ws26-user-topicop.md +123 -0
- package/upgrades/side-effects/ws52-busyness.md +38 -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,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAi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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,CAotbtE;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"}
|
package/dist/commands/server.js
CHANGED
|
@@ -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 });
|
|
@@ -8650,21 +8762,26 @@ export async function startServer(options) {
|
|
|
8650
8762
|
// (dev-gate-resolved AND the §2.10 env-token gate), and the executor's own dryRun keeps it a
|
|
8651
8763
|
// dry-run dogfood on a dev agent (full decision loop + audit, ZERO writes) until dryRun:false.
|
|
8652
8764
|
const { CredentialRebalancer } = await import('../core/CredentialRebalancer.js');
|
|
8653
|
-
const { mapSlots: credMapSlots, mapAccounts: credMapAccounts, resolveRebalancerConfig: credResolveBalancerConfig } = await import('../core/CredentialRebalancerSnapshot.js');
|
|
8765
|
+
const { mapSlots: credMapSlots, mapAccounts: credMapAccounts, resolveRebalancerConfig: credResolveBalancerConfig, computeBusynessBySlot: credComputeBusyness } = await import('../core/CredentialRebalancerSnapshot.js');
|
|
8654
8766
|
const CRED_DEFAULT_SLOT = '~/.claude';
|
|
8655
8767
|
const credentialRebalancer = new CredentialRebalancer({
|
|
8656
8768
|
// Same gate as the location gate: dev-gate-resolved AND not env-token-refused.
|
|
8657
8769
|
isEnabled: () => resolveDevAgentGate(config.subscriptionPool?.credentialRepointing?.enabled, config) &&
|
|
8658
8770
|
!credentialEnvTokenGate.evaluate().refused,
|
|
8659
8771
|
isDryRun: () => config.subscriptionPool?.credentialRepointing?.dryRun !== false,
|
|
8660
|
-
|
|
8772
|
+
// Busyness = count of RUNNING claude-code sessions per slot (the drain "busiest slot"
|
|
8773
|
+
// signal), resolved from the live session list through the ledger's account→slot map.
|
|
8774
|
+
listSlots: () => credMapSlots(credentialLocationLedger.getAssignments(), {
|
|
8775
|
+
defaultSlot: CRED_DEFAULT_SLOT,
|
|
8776
|
+
busynessBySlot: credComputeBusyness(state.listSessions(), (accountId) => credentialLocationLedger.slotOf(accountId), CRED_DEFAULT_SLOT),
|
|
8777
|
+
}),
|
|
8661
8778
|
listAccounts: () => credMapAccounts(subscriptionPool.list(), Date.now()),
|
|
8662
8779
|
resolveConfig: () => credResolveBalancerConfig({
|
|
8663
8780
|
...(config.subscriptionPool?.credentialRepointing?.balancer ?? {}),
|
|
8664
8781
|
slotCount: credentialLocationLedger.getAssignments().length,
|
|
8665
|
-
// Dry-run dogfood
|
|
8666
|
-
// default (objective-0 keeps it alive). An explicit operator default-account config
|
|
8667
|
-
//
|
|
8782
|
+
// Dry-run dogfood default: keep the account currently in ~/.claude as the desired
|
|
8783
|
+
// default (objective-0 keeps it alive). An explicit operator default-account config
|
|
8784
|
+
// is a refinement <!-- tracked: 20905 -->.
|
|
8668
8785
|
desiredDefaultAccountId: credentialLocationLedger.tenantOf(CRED_DEFAULT_SLOT) ?? null,
|
|
8669
8786
|
}),
|
|
8670
8787
|
swap: async (a, b) => {
|