instar 1.3.553 → 1.3.555

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 (41) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +56 -11
  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 +78 -85
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/PostUpdateMigrator.d.ts +23 -0
  8. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  9. package/dist/core/PostUpdateMigrator.js +69 -0
  10. package/dist/core/PostUpdateMigrator.js.map +1 -1
  11. package/dist/core/devAgentGate.d.ts +27 -0
  12. package/dist/core/devAgentGate.d.ts.map +1 -1
  13. package/dist/core/devAgentGate.js +32 -0
  14. package/dist/core/devAgentGate.js.map +1 -1
  15. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  16. package/dist/core/devGatedFeatures.js +66 -35
  17. package/dist/core/devGatedFeatures.js.map +1 -1
  18. package/dist/core/types.d.ts +26 -0
  19. package/dist/core/types.d.ts.map +1 -1
  20. package/dist/core/types.js.map +1 -1
  21. package/dist/scheduler/JobLeaseClaimStore.d.ts +105 -0
  22. package/dist/scheduler/JobLeaseClaimStore.d.ts.map +1 -0
  23. package/dist/scheduler/JobLeaseClaimStore.js +165 -0
  24. package/dist/scheduler/JobLeaseClaimStore.js.map +1 -0
  25. package/dist/scheduler/JobLeaseCutoverGate.d.ts +73 -0
  26. package/dist/scheduler/JobLeaseCutoverGate.d.ts.map +1 -0
  27. package/dist/scheduler/JobLeaseCutoverGate.js +66 -0
  28. package/dist/scheduler/JobLeaseCutoverGate.js.map +1 -0
  29. package/dist/scheduler/JobScheduler.d.ts +53 -0
  30. package/dist/scheduler/JobScheduler.d.ts.map +1 -1
  31. package/dist/scheduler/JobScheduler.js +136 -20
  32. package/dist/scheduler/JobScheduler.js.map +1 -1
  33. package/dist/server/routes.d.ts.map +1 -1
  34. package/dist/server/routes.js +10 -2
  35. package/dist/server/routes.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/data/builtin-manifest.json +64 -64
  38. package/upgrades/1.3.554.md +79 -0
  39. package/upgrades/1.3.555.md +71 -0
  40. package/upgrades/side-effects/mm-stores-devgate.md +92 -0
  41. package/upgrades/side-effects/ws43-journal-lease-cutover.md +132 -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;AAy3CD,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,U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CACpB;AAy3CD,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,CA+zbtE;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"}
@@ -16,7 +16,7 @@ import pc from 'picocolors';
16
16
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
17
17
  import { loadConfig, ensureStateDir, detectTmuxPath, detectGeminiPath } from '../core/Config.js';
18
18
  import { isNonFatalUncaught, shouldLogStackForUncaught } from '../core/uncaughtExceptionPolicy.js';
19
- import { resolveDevAgentGate } from '../core/devAgentGate.js';
19
+ import { resolveDevAgentGate, resolveStateSyncStores } from '../core/devAgentGate.js';
20
20
  import { parseProfileTrigger, platformMessageIdFrom } from '../core/topicProfileIngress.js';
21
21
  import { TopicProfileOrchestrator, resolvedToApplied, } from '../core/TopicProfileOrchestrator.js';
22
22
  import { CodexResumeMap } from '../core/CodexResumeMap.js';
@@ -3442,9 +3442,18 @@ export async function startServer(options) {
3442
3442
  maxSnapshotBytes: stateSync.maxCacheBytes,
3443
3443
  });
3444
3444
  void storeSnapshotEngine; // consumed by the state-snapshot mesh handler below + the store PRs (WS2.1+)
3445
+ // The 7 stateSync memory stores follow the developmentAgent dark-feature gate
3446
+ // (operator directive 2026-06-13, topic 13481): their ConfigDefaults OMIT
3447
+ // `enabled` so the gate decides — LIVE on a dev agent, DARK on the fleet. Resolve
3448
+ // the gate ONCE here so every consumer funnel below (selfStateSyncReceive, the 7
3449
+ // union readers, checkPoolFlagCoherence) receives a stores map whose per-store
3450
+ // `enabled` is already the resolved boolean — the funnels keep their unchanged
3451
+ // `enabled === true` semantics but now see a live flag on a dev agent. An explicit
3452
+ // operator `enabled` in config still wins (force-dark false / fleet-flip true).
3453
+ const _stateSyncStoresResolved = resolveStateSyncStores(config);
3445
3454
  const selfStateSyncReceive = () => {
3446
3455
  const out = {};
3447
- const stores = config.multiMachine?.stateSync;
3456
+ const stores = _stateSyncStoresResolved;
3448
3457
  for (const store of replicatedKindRegistry.stores()) {
3449
3458
  // Advertise the receive capability iff the machinery exists (kind
3450
3459
  // registered) AND the store is enabled here — so a peer never forwards a
@@ -3503,7 +3512,7 @@ export async function startServer(options) {
3503
3512
  const { prefEntryToOriginRecord, prefTierOf, PREF_STORE_KEY } = await import('../core/PreferencesReplicatedStore.js');
3504
3513
  const preferencesUnionReader = new ReplicatedStoreReader({
3505
3514
  registry: replicatedKindRegistry,
3506
- stores: config.multiMachine?.stateSync,
3515
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
3507
3516
  tierOf: prefTierOf,
3508
3517
  loadOriginRecords: (store, recordKey) => {
3509
3518
  if (store !== PREF_STORE_KEY || _meshSelfId === null)
@@ -3542,7 +3551,7 @@ export async function startServer(options) {
3542
3551
  const { relationshipTierOf, relationshipToOriginRecord, deriveRelationshipRecordKey, mergeUnionToRelationships, renderForeignRelationshipContext, RELATIONSHIP_STORE_KEY } = await import('../core/RelationshipsReplicatedStore.js');
3543
3552
  const relationshipsUnionReader = new ReplicatedStoreReader({
3544
3553
  registry: replicatedKindRegistry,
3545
- stores: config.multiMachine?.stateSync,
3554
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
3546
3555
  tierOf: relationshipTierOf,
3547
3556
  loadOriginRecords: (store, recordKey) => {
3548
3557
  if (store !== RELATIONSHIP_STORE_KEY || _meshSelfId === null || !relationships)
@@ -7700,7 +7709,7 @@ export async function startServer(options) {
7700
7709
  const { learningTierOf, learningToOriginRecord, deriveLearningRecordKey, LEARNING_STORE_KEY } = await import('../core/LearningsReplicatedStore.js');
7701
7710
  const learningsUnionReader = new ReplicatedStoreReader({
7702
7711
  registry: replicatedKindRegistry,
7703
- stores: config.multiMachine?.stateSync,
7712
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
7704
7713
  tierOf: learningTierOf,
7705
7714
  loadOriginRecords: (store, recordKey) => {
7706
7715
  if (store !== LEARNING_STORE_KEY || _meshSelfId === null)
@@ -7748,7 +7757,7 @@ export async function startServer(options) {
7748
7757
  const { knowledgeTierOf, knowledgeToOriginRecord, deriveKnowledgeRecordKey, KNOWLEDGE_STORE_KEY, } = await import('../core/KnowledgeReplicatedStore.js');
7749
7758
  const knowledgeUnionReader = new ReplicatedStoreReader({
7750
7759
  registry: replicatedKindRegistry,
7751
- stores: config.multiMachine?.stateSync,
7760
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
7752
7761
  tierOf: knowledgeTierOf,
7753
7762
  loadOriginRecords: (store, recordKey) => {
7754
7763
  if (store !== KNOWLEDGE_STORE_KEY || _meshSelfId === null)
@@ -7794,7 +7803,7 @@ export async function startServer(options) {
7794
7803
  const { evolutionActionTierOf, evolutionActionToOriginRecord, deriveEvolutionActionRecordKey, EVOLUTION_ACTION_STORE_KEY, } = await import('../core/EvolutionActionsReplicatedStore.js');
7795
7804
  const evolutionActionsUnionReader = new ReplicatedStoreReader({
7796
7805
  registry: replicatedKindRegistry,
7797
- stores: config.multiMachine?.stateSync,
7806
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
7798
7807
  tierOf: evolutionActionTierOf,
7799
7808
  loadOriginRecords: (store, recordKey) => {
7800
7809
  if (store !== EVOLUTION_ACTION_STORE_KEY || _meshSelfId === null)
@@ -7838,7 +7847,7 @@ export async function startServer(options) {
7838
7847
  const { userTierOf, userToOriginRecord, deriveUserRecordKey, USER_STORE_KEY } = await import('../core/UserRegistryReplicatedStore.js');
7839
7848
  const userRegistryUnionReader = new ReplicatedStoreReader({
7840
7849
  registry: replicatedKindRegistry,
7841
- stores: config.multiMachine?.stateSync,
7850
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
7842
7851
  tierOf: userTierOf,
7843
7852
  loadOriginRecords: (store, recordKey) => {
7844
7853
  if (store !== USER_STORE_KEY || _meshSelfId === null)
@@ -7882,7 +7891,7 @@ export async function startServer(options) {
7882
7891
  const { topicOperatorTierOf, topicOperatorToOriginRecord, deriveTopicOperatorRecordKey, TOPIC_OPERATOR_STORE_KEY } = await import('../core/TopicOperatorReplicatedStore.js');
7883
7892
  const topicOperatorUnionReader = new ReplicatedStoreReader({
7884
7893
  registry: replicatedKindRegistry,
7885
- stores: config.multiMachine?.stateSync,
7894
+ stores: _stateSyncStoresResolved, // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
7886
7895
  tierOf: topicOperatorTierOf,
7887
7896
  loadOriginRecords: (store, recordKey) => {
7888
7897
  if (store !== TOPIC_OPERATOR_STORE_KEY || _meshSelfId === null)
@@ -12998,6 +13007,42 @@ export async function startServer(options) {
12998
13007
  });
12999
13008
  const poolSelfId = machineHeartbeat?.config?.machineId ??
13000
13009
  (poolIdMgr.hasIdentity() ? poolIdMgr.loadIdentity().machineId : null);
13010
+ // WS4.3 journal-lease cutover (MULTI-MACHINE-SEAMLESSNESS-SPEC §WS4.3,
13011
+ // "Cutover discipline"). Wired HERE (not at setRoleGuard) because the
13012
+ // gate needs the machinePoolRegistry — declared after the scheduler is
13013
+ // built. The gate-input is read LIVE at each claim boundary: the flag +
13014
+ // dry-run from config, this machine's lease epoch from the coordinator,
13015
+ // and the pool peers' advertised ws43JournalLease capability from their
13016
+ // last heartbeat (absent = older peer = non-participant → the whole pool
13017
+ // stays on the bus). Single-machine (no peers) is a strict no-op inside
13018
+ // the gate. The cutover guarantees the journal-lease and the legacy bus
13019
+ // broadcast are NEVER both live for a job set (the named migration hazard).
13020
+ if (poolSelfId && scheduler) {
13021
+ const leaseMod = await import('../scheduler/JobLeaseClaimStore.js');
13022
+ const leaseStore = new leaseMod.JobLeaseClaimStore({
13023
+ machineId: poolSelfId,
13024
+ stateDir: config.stateDir,
13025
+ });
13026
+ const registryForCutover = machinePoolRegistry;
13027
+ scheduler.setJournalLeaseCutover(leaseStore, () => ({
13028
+ enabled: config.multiMachine?.seamlessness?.ws43JournalLease === true,
13029
+ dryRun: config.multiMachine?.seamlessness?.ws43JournalLeaseDryRun !== false,
13030
+ epoch: coordinator.getLeaseEpoch(),
13031
+ peers: registryForCutover
13032
+ .getCapacities()
13033
+ .filter((c) => c.machineId !== poolSelfId)
13034
+ .map((c) => ({
13035
+ machineId: c.machineId,
13036
+ online: c.online,
13037
+ ws43JournalLease: c.seamlessnessFlags?.ws43JournalLease === true,
13038
+ })),
13039
+ }), (slug, decision) => {
13040
+ if (decision.reason === 'peers-incoherent' && decision.incoherentPeers.length > 0) {
13041
+ console.log(pc.dim(` [scheduler] WS4.3 cutover withheld for "${slug}" — pool not flag-coherent (peers without ws43JournalLease: ${decision.incoherentPeers.join(', ')}); staying on the legacy bus path.`));
13042
+ }
13043
+ });
13044
+ console.log(pc.dim(' [scheduler] WS4.3 journal-lease cutover wired (engages only when flag on + pool coherent).'));
13045
+ }
13001
13046
  if (poolSelfId) {
13002
13047
  try {
13003
13048
  poolIdMgr.recordSelfHardware(poolSelfId, poolMod.captureHardware());
@@ -13081,7 +13126,7 @@ export async function startServer(options) {
13081
13126
  // WS1.1 capability advertisement (spec invariant 5): a bounded
13082
13127
  // fixed-size summary, never an inventory. Reported live each
13083
13128
  // heartbeat so a queue going dark withdraws the capability.
13084
- seamlessnessFlags: { ws11DeliverReceive: !!_inboundQueue, ws12DrainReceive: !!_drainRunner, ws44PoolLinks: !!_poolLink, ws44PoolCache: !!_poolPollCache, stateSyncReceive: selfStateSyncReceive() },
13129
+ seamlessnessFlags: { ws11DeliverReceive: !!_inboundQueue, ws12DrainReceive: !!_drainRunner, ws44PoolLinks: !!_poolLink, ws44PoolCache: !!_poolPollCache, ws43JournalLease: config.multiMachine?.seamlessness?.ws43JournalLease === true && config.multiMachine?.seamlessness?.ws43JournalLeaseDryRun !== true, stateSyncReceive: selfStateSyncReceive() },
13085
13130
  // Durable Inbound Message Queue §5.1: depth + oldest + tenure +
13086
13131
  // bounded top-K — the survivor's loss-SUSPECTED item, capped
13087
13132
  // re-placement arm, and supersede-dedupe key all read these.
@@ -13144,7 +13189,7 @@ export async function startServer(options) {
13144
13189
  online: c.online,
13145
13190
  stateSyncReceive: c.seamlessnessFlags?.stateSyncReceive,
13146
13191
  }));
13147
- const stores = config.multiMachine?.stateSync;
13192
+ const stores = _stateSyncStoresResolved; // gate-resolved (dev-live / fleet-dark) per operator directive 2026-06-13
13148
13193
  const verdict = checkPoolFlagCoherence(replicatedKindRegistry, stores, peers);
13149
13194
  if (verdict.mixedStores.length > 0) {
13150
13195
  // Surface ONCE (coalesced): one log line listing every mixed store.