@remnic/core 10.0.185 → 10.0.186
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/access-admin-ops-surface.js +1 -1
- package/dist/access-cli.js +1 -1
- package/dist/access-extraction-force-flush-preempt.js +1 -1
- package/dist/access-extraction-force-flush.js +1 -1
- package/dist/access-http-briefing.js +1 -1
- package/dist/access-http-query.js +1 -1
- package/dist/access-http.js +1 -1
- package/dist/access-identity-continuity-surface.js +1 -1
- package/dist/access-lcm-surface.js +1 -1
- package/dist/access-mcp.js +1 -1
- package/dist/access-observe-write-surface.js +1 -1
- package/dist/access-operations-batch.js +1 -1
- package/dist/access-operations.js +1 -1
- package/dist/access-recall-concurrency.js +1 -1
- package/dist/access-recall-response.js +1 -1
- package/dist/access-recall-surface.js +1 -1
- package/dist/access-service.js +1 -1
- package/dist/{chunk-EWLOIHAZ.js → chunk-3GD5SFDT.js} +2 -2
- package/dist/{chunk-TCSY74IN.js → chunk-LALPM2DN.js} +43 -6
- package/dist/chunk-LALPM2DN.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/explicit-capture.js +1 -1
- package/dist/index.js +1 -1
- package/dist/orchestration/backlog-scheduler.js +2 -2
- package/dist/orchestration/buffer-drain-runner.js +2 -2
- package/dist/orchestration/extraction-queue-coordinator.d.ts +20 -0
- package/dist/orchestration/extraction-queue-coordinator.d.ts.map +1 -1
- package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
- package/dist/orchestrator.js +1 -1
- package/dist/recall-navigation.js +1 -1
- package/package.json +2 -2
- package/src/orchestration/extraction-queue-coordinator.ts +64 -3
- package/src/orchestration/extraction-queue-lane-bias.test.ts +185 -0
- package/src/orchestration/turn-ingestion.ts +7 -1
- package/dist/chunk-TCSY74IN.js.map +0 -1
- /package/dist/{chunk-EWLOIHAZ.js.map → chunk-3GD5SFDT.js.map} +0 -0
package/dist/access-cli.js
CHANGED
package/dist/access-http.js
CHANGED
package/dist/access-mcp.js
CHANGED
package/dist/access-service.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ExtractionDrain,
|
|
3
3
|
TurnIngestionCoordinator,
|
|
4
4
|
shouldSkipImplicitExtraction
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LALPM2DN.js";
|
|
6
6
|
import {
|
|
7
7
|
headerConnector,
|
|
8
8
|
renderExtractionConversation,
|
|
@@ -447,4 +447,4 @@ export {
|
|
|
447
447
|
ClaimBufferStorage,
|
|
448
448
|
BufferDrainRunner
|
|
449
449
|
};
|
|
450
|
-
//# sourceMappingURL=chunk-
|
|
450
|
+
//# sourceMappingURL=chunk-3GD5SFDT.js.map
|
|
@@ -4863,7 +4863,7 @@ var TierMigrationCoordinator = class {
|
|
|
4863
4863
|
};
|
|
4864
4864
|
|
|
4865
4865
|
// src/orchestration/extraction-queue-coordinator.ts
|
|
4866
|
-
var ExtractionQueueCoordinator = class {
|
|
4866
|
+
var ExtractionQueueCoordinator = class _ExtractionQueueCoordinator {
|
|
4867
4867
|
/** Maximum tasks that run at the same time (config `extractionQueueConcurrency`). */
|
|
4868
4868
|
concurrency;
|
|
4869
4869
|
/**
|
|
@@ -4886,6 +4886,15 @@ var ExtractionQueueCoordinator = class {
|
|
|
4886
4886
|
/** Preempt slots of the currently running tasks, keyed by slot identity. */
|
|
4887
4887
|
preemptSlots = /* @__PURE__ */ new Map();
|
|
4888
4888
|
preemptSeq = 0;
|
|
4889
|
+
/** Running tasks per lane — the backlog share and the foreground floor. */
|
|
4890
|
+
activeBacklog = 0;
|
|
4891
|
+
activeForeground = 0;
|
|
4892
|
+
/**
|
|
4893
|
+
* Slots kept available for foreground (non-backlog) tasks while backlog
|
|
4894
|
+
* work also waits. A floor of one keeps live sessions extracting even at
|
|
4895
|
+
* full backlog pressure; backlog tasks fill the rest.
|
|
4896
|
+
*/
|
|
4897
|
+
static FOREGROUND_FLOOR = 1;
|
|
4889
4898
|
/** Resolves the processor's park while a new task arrives mid-drain. */
|
|
4890
4899
|
wake;
|
|
4891
4900
|
constructor(concurrency = 2) {
|
|
@@ -4912,7 +4921,7 @@ var ExtractionQueueCoordinator = class {
|
|
|
4912
4921
|
enqueue(task, options) {
|
|
4913
4922
|
if (!this.accepting) return false;
|
|
4914
4923
|
const key = options?.key;
|
|
4915
|
-
const entry = { run: task, key };
|
|
4924
|
+
const entry = { run: task, key, backlog: options?.backlog, front: options?.front };
|
|
4916
4925
|
if (options?.front) {
|
|
4917
4926
|
this.preemptRunning(options.key);
|
|
4918
4927
|
this.queue.unshift(entry);
|
|
@@ -4968,7 +4977,8 @@ var ExtractionQueueCoordinator = class {
|
|
|
4968
4977
|
const armed = Array.from(this.preemptSlots.values()).filter((slot) => slot.armed !== void 0);
|
|
4969
4978
|
if (armed.length === 0) return;
|
|
4970
4979
|
const preferred = preferredKey !== void 0 ? armed.find((slot) => slot.key === preferredKey) : void 0;
|
|
4971
|
-
const
|
|
4980
|
+
const victims = armed.some((slot) => slot.backlog !== true) ? armed.filter((slot) => slot.backlog !== true) : armed;
|
|
4981
|
+
const chosen = preferred ?? victims.reduce((a, b) => (b.armed?.seq ?? -1) > (a.armed?.seq ?? -1) ? b : a);
|
|
4972
4982
|
const abort = chosen.armed?.abort;
|
|
4973
4983
|
chosen.armed = void 0;
|
|
4974
4984
|
abort?.();
|
|
@@ -5053,11 +5063,30 @@ var ExtractionQueueCoordinator = class {
|
|
|
5053
5063
|
}
|
|
5054
5064
|
/** Take the next queue entry whose key is not already running or reserved (FIFO within a key). */
|
|
5055
5065
|
takeRunnable() {
|
|
5066
|
+
if (this.queue[0]?.front === true) {
|
|
5067
|
+
const front = this.takeFirstMatching((entry) => entry.front === true);
|
|
5068
|
+
if (front) return front;
|
|
5069
|
+
}
|
|
5070
|
+
if (this.activeForeground < _ExtractionQueueCoordinator.FOREGROUND_FLOOR) {
|
|
5071
|
+
const foreground = this.takeFirstMatching((entry) => entry.backlog !== true);
|
|
5072
|
+
if (foreground) return foreground;
|
|
5073
|
+
}
|
|
5074
|
+
if (this.activeBacklog < Math.max(this.concurrency - 1, 1)) {
|
|
5075
|
+
const backlog = this.takeFirstMatching((entry) => entry.backlog === true);
|
|
5076
|
+
if (backlog) return backlog;
|
|
5077
|
+
}
|
|
5078
|
+
return this.takeFirstMatching((entry) => entry.backlog !== true);
|
|
5079
|
+
}
|
|
5080
|
+
/** First queue entry satisfying `match` whose key is free to run. */
|
|
5081
|
+
takeFirstMatching(match) {
|
|
5056
5082
|
for (let index = 0; index < this.queue.length; index += 1) {
|
|
5057
5083
|
const entry = this.queue[index];
|
|
5084
|
+
if (!match(entry)) continue;
|
|
5058
5085
|
if (entry.key !== void 0 && (this.activeKeys.has(entry.key) || this.reservedKeys.has(entry.key))) continue;
|
|
5059
5086
|
this.queue.splice(index, 1);
|
|
5060
5087
|
if (entry.key !== void 0) this.activeKeys.add(entry.key);
|
|
5088
|
+
if (entry.backlog === true) this.activeBacklog += 1;
|
|
5089
|
+
else this.activeForeground += 1;
|
|
5061
5090
|
return entry;
|
|
5062
5091
|
}
|
|
5063
5092
|
return void 0;
|
|
@@ -5065,13 +5094,15 @@ var ExtractionQueueCoordinator = class {
|
|
|
5065
5094
|
/** Run one entry with its own preempt slot; failures are classified + logged. */
|
|
5066
5095
|
async runEntry(entry) {
|
|
5067
5096
|
const slot = {};
|
|
5068
|
-
this.preemptSlots.set(slot, { key: entry.key });
|
|
5097
|
+
this.preemptSlots.set(slot, { key: entry.key, backlog: entry.backlog });
|
|
5069
5098
|
try {
|
|
5070
5099
|
await entry.run(this.createPreemptHandle(slot));
|
|
5071
5100
|
} catch (err) {
|
|
5072
5101
|
this.logExtractionQueueFailure(err, "task");
|
|
5073
5102
|
} finally {
|
|
5074
5103
|
this.preemptSlots.delete(slot);
|
|
5104
|
+
if (entry.backlog === true) this.activeBacklog -= 1;
|
|
5105
|
+
else this.activeForeground -= 1;
|
|
5075
5106
|
if (entry.key !== void 0) this.activeKeys.delete(entry.key);
|
|
5076
5107
|
}
|
|
5077
5108
|
}
|
|
@@ -22113,7 +22144,13 @@ var TurnIngestionCoordinator = class {
|
|
|
22113
22144
|
if (sharingNode) this.snapshotSharing.release(sharingNode);
|
|
22114
22145
|
exit.report();
|
|
22115
22146
|
}
|
|
22116
|
-
}, {
|
|
22147
|
+
}, {
|
|
22148
|
+
front: options.preemptRunning === true,
|
|
22149
|
+
key: bufferKey,
|
|
22150
|
+
// Claim/drain tasks (options.execution carries the claim-backed buffer)
|
|
22151
|
+
// take the backlog lane: biased to fill all-but-foreground-floor slots.
|
|
22152
|
+
backlog: options.execution !== void 0
|
|
22153
|
+
});
|
|
22117
22154
|
if (!accepted) {
|
|
22118
22155
|
if (sharingNode) this.snapshotSharing.release(sharingNode);
|
|
22119
22156
|
settleTask(new Error("extraction queue is stopped"));
|
|
@@ -68044,4 +68081,4 @@ export {
|
|
|
68044
68081
|
EngramAccessService,
|
|
68045
68082
|
AccessAdminOpsSurface
|
|
68046
68083
|
};
|
|
68047
|
-
//# sourceMappingURL=chunk-
|
|
68084
|
+
//# sourceMappingURL=chunk-LALPM2DN.js.map
|