instar 1.3.590 → 1.3.592
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 +39 -12
- package/dist/commands/server.js.map +1 -1
- package/dist/core/OwnershipApplier.d.ts +10 -1
- package/dist/core/OwnershipApplier.d.ts.map +1 -1
- package/dist/core/OwnershipApplier.js +11 -1
- package/dist/core/OwnershipApplier.js.map +1 -1
- package/dist/core/QuotaAwareScheduler.d.ts +25 -0
- package/dist/core/QuotaAwareScheduler.d.ts.map +1 -1
- package/dist/core/QuotaAwareScheduler.js +36 -0
- package/dist/core/QuotaAwareScheduler.js.map +1 -1
- package/dist/core/ownershipApplierWiring.d.ts +44 -0
- package/dist/core/ownershipApplierWiring.d.ts.map +1 -0
- package/dist/core/ownershipApplierWiring.js +20 -0
- package/dist/core/ownershipApplierWiring.js.map +1 -0
- package/dist/monitoring/QuotaTracker.d.ts +56 -0
- package/dist/monitoring/QuotaTracker.d.ts.map +1 -1
- package/dist/monitoring/QuotaTracker.js +112 -4
- package/dist/monitoring/QuotaTracker.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +2 -1
- package/dist/scaffold/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/src/scaffold/templates.ts +2 -1
- package/upgrades/1.3.591.md +34 -0
- package/upgrades/1.3.592.md +40 -0
- package/upgrades/side-effects/ownership-applier-meshself-ordering-fix.md +52 -0
- package/upgrades/side-effects/pool-aware-quota-throttle.md +123 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAu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sB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -9173,6 +9173,24 @@ export async function startServer(options) {
|
|
|
9173
9173
|
if (subscriptionPool.size() > 0) {
|
|
9174
9174
|
console.log(pc.green(` Subscription pool: ${subscriptionPool.size()} account(s) registered`));
|
|
9175
9175
|
}
|
|
9176
|
+
// POOL-AWARE QUOTA THROTTLE wiring (docs/specs/POOL-AWARE-QUOTA-THROTTLE-SPEC.md):
|
|
9177
|
+
// give the global quota brake the SAME placeability predicate the placement layer
|
|
9178
|
+
// (selectAccount) uses, reading the LIVE SubscriptionPool. Effect: the brake never
|
|
9179
|
+
// stops the whole agent while a placeable account has headroom (the 2026-06-15
|
|
9180
|
+
// "one maxed account stalls everything while reserves sit idle" bug), and never
|
|
9181
|
+
// allows work placement can't land (the 90–95% respawn-loop band — selectAccount's
|
|
9182
|
+
// soft threshold is stricter than the shutdown threshold). Only for a genuine pool
|
|
9183
|
+
// (>1 account); a solo agent keeps the legacy single-account gating untouched.
|
|
9184
|
+
if (quotaTracker && subscriptionPool.size() > 1) {
|
|
9185
|
+
const { poolHeadroom } = await import('../core/QuotaAwareScheduler.js');
|
|
9186
|
+
// poolHeadroom shares placement's exact eligibility predicate, so a throttle
|
|
9187
|
+
// "allow" always corresponds to a placeable account, AND it gates on the
|
|
9188
|
+
// MOST-HEADROOM account (not the use-it-or-lose-it drain-first winner) — so
|
|
9189
|
+
// non-critical work runs whenever ANY account has room, while placement still
|
|
9190
|
+
// drains the soonest-to-reset account. Clamps + degraded signal are built in.
|
|
9191
|
+
quotaTracker.setPoolQuotaProvider(() => poolHeadroom(subscriptionPool.list(), { nowMs: Date.now() }));
|
|
9192
|
+
console.log(pc.green(' Pool-aware quota throttle: wired (placement-shared eligibility, most-headroom gating)'));
|
|
9193
|
+
}
|
|
9176
9194
|
// ── Live credential re-pointing — census consumer re-routing (WS5.2 Step 6) ──
|
|
9177
9195
|
// The CredentialLocationLedger is the machine-local source of truth for "which account is in
|
|
9178
9196
|
// which config-home slot" once re-pointing is enabled. The CredentialLocationGate re-routes
|
|
@@ -14127,23 +14145,32 @@ export async function startServer(options) {
|
|
|
14127
14145
|
// resolves the right owner on the next message — the step the in-memory store
|
|
14128
14146
|
// never had. Off the hot path: ticked on an interval + once at boot (to adopt
|
|
14129
14147
|
// a transfer that landed while we were down). Only when the durable store is
|
|
14130
|
-
// active
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14148
|
+
// active; InMemory has no cross-machine replication to apply.
|
|
14149
|
+
//
|
|
14150
|
+
// Construction is gated on the durable store ALONE — NOT on `_meshSelfId`. The
|
|
14151
|
+
// old `&& _meshSelfId` guard ran here, ~650 lines before `_meshSelfId` is assigned
|
|
14152
|
+
// in the boot sequence, so it was always null at this point and the applier was
|
|
14153
|
+
// never wired (the boot-ordering bug the live test caught). `selfMachineId` is now
|
|
14154
|
+
// a late-bound getter (label-only; materialization never needs it), so an early
|
|
14155
|
+
// tick is correct and later ticks label SELF/peer once the id resolves. The wiring
|
|
14156
|
+
// factory is extracted + unit-tested so this condition can never silently regress.
|
|
14157
|
+
// Spec: docs/specs/ownership-applier-meshself-ordering-fix.md.
|
|
14158
|
+
const { CoherenceJournalReader } = await import('../core/CoherenceJournalReader.js');
|
|
14159
|
+
const { wireOwnershipApplier } = await import('../core/ownershipApplierWiring.js');
|
|
14160
|
+
const ownershipApplier = wireOwnershipApplier({
|
|
14161
|
+
durableOwnershipStore,
|
|
14162
|
+
reader: new CoherenceJournalReader({ stateDir: config.stateDir }),
|
|
14163
|
+
getSelfMachineId: () => _meshSelfId,
|
|
14164
|
+
logger: (m) => console.log(pc.dim(` ${m}`)),
|
|
14165
|
+
});
|
|
14166
|
+
if (ownershipApplier) {
|
|
14140
14167
|
try {
|
|
14141
|
-
|
|
14168
|
+
ownershipApplier.tick();
|
|
14142
14169
|
}
|
|
14143
14170
|
catch { /* @silent-fallback-ok — boot tick best-effort; the interval converges */ }
|
|
14144
14171
|
const applierTimer = setInterval(() => {
|
|
14145
14172
|
try {
|
|
14146
|
-
const r =
|
|
14173
|
+
const r = ownershipApplier.tick();
|
|
14147
14174
|
if (r.materialized)
|
|
14148
14175
|
console.log(pc.dim(` [OwnershipApplier] materialized ${r.materialized}/${r.examined} topic(s) from replicated placements`));
|
|
14149
14176
|
}
|