@remnic/core 9.3.653 → 9.3.655
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-cli.js +24 -24
- package/dist/access-http.d.ts +4 -4
- package/dist/access-http.js +17 -17
- package/dist/access-mcp.d.ts +4 -4
- package/dist/access-mcp.js +16 -16
- package/dist/access-schema.d.ts +12 -12
- package/dist/{access-service-CdJFd3_b.d.ts → access-service-BEJvriUt.d.ts} +11 -2
- package/dist/access-service.d.ts +4 -4
- package/dist/access-service.js +15 -15
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +3 -3
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +4 -4
- package/dist/{chunk-GI45G4BK.js → chunk-2RCGZ67B.js} +4 -4
- package/dist/{chunk-BEMWL2FZ.js → chunk-54LOUIBE.js} +2 -2
- package/dist/{chunk-E3J6O6N7.js → chunk-55ZMNKMQ.js} +20 -9
- package/dist/{chunk-E3J6O6N7.js.map → chunk-55ZMNKMQ.js.map} +1 -1
- package/dist/{chunk-7WEB3FLJ.js → chunk-5PLUC5OB.js} +2 -2
- package/dist/{chunk-SPMZZUEJ.js → chunk-5QD3QD76.js} +2684 -401
- package/dist/chunk-5QD3QD76.js.map +1 -0
- package/dist/{chunk-WLGE6KEO.js → chunk-67G4T7KI.js} +3 -3
- package/dist/{chunk-JX2RINDR.js → chunk-6G5JEN55.js} +2 -2
- package/dist/{chunk-R3PQUPQ4.js → chunk-6IMKOIZ6.js} +85 -3
- package/dist/chunk-6IMKOIZ6.js.map +1 -0
- package/dist/{chunk-KJDKZVF3.js → chunk-A3Y37UWI.js} +3 -3
- package/dist/{chunk-CFOCZPIQ.js → chunk-BGKXTVNG.js} +2 -2
- package/dist/{chunk-QQHIQ7JD.js → chunk-COVZLGMR.js} +87 -18
- package/dist/chunk-COVZLGMR.js.map +1 -0
- package/dist/{chunk-JVRPJ7D4.js → chunk-EKQMQQ3U.js} +48 -12
- package/dist/chunk-EKQMQQ3U.js.map +1 -0
- package/dist/{chunk-H3PHZLMF.js → chunk-GKKAXVAJ.js} +20 -11
- package/dist/chunk-GKKAXVAJ.js.map +1 -0
- package/dist/{chunk-JBHXMCYN.js → chunk-GRYAECRV.js} +2 -2
- package/dist/{chunk-EHQLDFSH.js → chunk-IQ53ZSXV.js} +2 -2
- package/dist/{chunk-C63WC454.js → chunk-KOI765XP.js} +125 -1
- package/dist/chunk-KOI765XP.js.map +1 -0
- package/dist/{chunk-IVYSVAC6.js → chunk-KZZ4YAEC.js} +2 -2
- package/dist/{chunk-2DGQLOOM.js → chunk-M3VYPE2H.js} +1 -1
- package/dist/{chunk-2DGQLOOM.js.map → chunk-M3VYPE2H.js.map} +1 -1
- package/dist/{chunk-JF7SFXTG.js → chunk-NCSJKK23.js} +2 -2
- package/dist/{chunk-XMN6MMTU.js → chunk-NRBGRZW4.js} +2 -2
- package/dist/{chunk-NOBL7OUP.js → chunk-OKW6F5S5.js} +12 -5
- package/dist/{chunk-NOBL7OUP.js.map → chunk-OKW6F5S5.js.map} +1 -1
- package/dist/{chunk-BNFRL6QW.js → chunk-PTMJ2FH2.js} +2 -2
- package/dist/{chunk-KWM33SPU.js → chunk-PVE7KSQP.js} +2 -2
- package/dist/{chunk-EW52H5EM.js → chunk-QDVQ4AN2.js} +12 -5
- package/dist/chunk-QDVQ4AN2.js.map +1 -0
- package/dist/{chunk-PYWNNF2I.js → chunk-QRSKPI62.js} +99 -66
- package/dist/chunk-QRSKPI62.js.map +1 -0
- package/dist/{chunk-YM3LR4LS.js → chunk-SSSXWIBP.js} +5 -5
- package/dist/{chunk-C43KEWEV.js → chunk-TDZSSJV4.js} +1 -1
- package/dist/chunk-TDZSSJV4.js.map +1 -0
- package/dist/{chunk-Y7NWBBHV.js → chunk-TEO46GMM.js} +2 -2
- package/dist/{chunk-AJE7FJVE.js → chunk-UCEABZZN.js} +2 -2
- package/dist/{chunk-IENGGY2C.js → chunk-UCEDY5M7.js} +2 -2
- package/dist/{chunk-PRQXUSQV.js → chunk-UYNFWZWG.js} +2 -2
- package/dist/{chunk-V4UDXYGG.js → chunk-WDTUYOLS.js} +2 -2
- package/dist/{chunk-RZOBQ23O.js → chunk-XOFXKASO.js} +2 -2
- package/dist/chunk-XRKQOQLY.js +212 -0
- package/dist/chunk-XRKQOQLY.js.map +1 -0
- package/dist/{chunk-WTI35CVJ.js → chunk-YYN3LIYA.js} +5 -5
- package/dist/{cli-DDo7Qgs-.d.ts → cli-BGahB_d3.d.ts} +3 -3
- package/dist/cli.d.ts +5 -5
- package/dist/cli.js +29 -29
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +3 -3
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +3 -3
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +19 -1
- package/dist/contradiction/index.js +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +3 -3
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +3 -3
- package/dist/explicit-capture.js +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +37 -35
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +4 -4
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +15 -4
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.d.ts +52 -3
- package/dist/namespaces/storage.js +9 -5
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +14 -14
- package/dist/{orchestrator-8fTZsa0y.d.ts → orchestrator-BgzZlWxH.d.ts} +500 -3
- package/dist/orchestrator.d.ts +3 -3
- package/dist/orchestrator.js +20 -20
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +5 -1
- package/dist/qmd.js +2 -2
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/{resolution-3SAP4SH2.js → resolution-IDTEBJFS.js} +2 -2
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +2 -2
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/schemas.d.ts +22 -22
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +6 -6
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +6 -6
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +17 -1
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-DKdYzQOg.d.ts → semantic-consolidation-Z8d_uMq8.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +2 -2
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/types.d.ts +12 -12
- package/dist/{types-D8yUmSik.d.ts → types-2OPlQWJG.d.ts} +23 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +3 -3
- package/package.json +1 -1
- package/src/access-http.ts +7 -0
- package/src/access-mcp.ts +7 -0
- package/src/access-service.ts +12 -0
- package/src/cli.ts +104 -0
- package/src/config.test.ts +109 -0
- package/src/config.ts +164 -0
- package/src/contradiction/contradiction.test.ts +284 -0
- package/src/contradiction/resolution.ts +151 -4
- package/src/explicit-capture.ts +31 -10
- package/src/index.ts +10 -0
- package/src/maintenance/namespace-planner.test.ts +1120 -0
- package/src/maintenance/namespace-planner.ts +893 -0
- package/src/namespaces/catalog.test.ts +3356 -0
- package/src/namespaces/catalog.ts +2123 -0
- package/src/namespaces/search.test.ts +130 -2
- package/src/namespaces/search.ts +71 -10
- package/src/namespaces/storage.ts +210 -30
- package/src/orchestrator-flush.test.ts +720 -0
- package/src/orchestrator.ts +881 -239
- package/src/qmd-client.test.ts +59 -0
- package/src/qmd.ts +124 -84
- package/src/search/port.ts +16 -0
- package/src/types.ts +23 -0
- package/dist/chunk-C43KEWEV.js.map +0 -1
- package/dist/chunk-C63WC454.js.map +0 -1
- package/dist/chunk-EW52H5EM.js.map +0 -1
- package/dist/chunk-H3PHZLMF.js.map +0 -1
- package/dist/chunk-JVRPJ7D4.js.map +0 -1
- package/dist/chunk-ORGWWNJG.js +0 -131
- package/dist/chunk-ORGWWNJG.js.map +0 -1
- package/dist/chunk-PYWNNF2I.js.map +0 -1
- package/dist/chunk-QQHIQ7JD.js.map +0 -1
- package/dist/chunk-R3PQUPQ4.js.map +0 -1
- package/dist/chunk-SPMZZUEJ.js.map +0 -1
- /package/dist/{chunk-GI45G4BK.js.map → chunk-2RCGZ67B.js.map} +0 -0
- /package/dist/{chunk-BEMWL2FZ.js.map → chunk-54LOUIBE.js.map} +0 -0
- /package/dist/{chunk-7WEB3FLJ.js.map → chunk-5PLUC5OB.js.map} +0 -0
- /package/dist/{chunk-WLGE6KEO.js.map → chunk-67G4T7KI.js.map} +0 -0
- /package/dist/{chunk-JX2RINDR.js.map → chunk-6G5JEN55.js.map} +0 -0
- /package/dist/{chunk-KJDKZVF3.js.map → chunk-A3Y37UWI.js.map} +0 -0
- /package/dist/{chunk-CFOCZPIQ.js.map → chunk-BGKXTVNG.js.map} +0 -0
- /package/dist/{chunk-JBHXMCYN.js.map → chunk-GRYAECRV.js.map} +0 -0
- /package/dist/{chunk-EHQLDFSH.js.map → chunk-IQ53ZSXV.js.map} +0 -0
- /package/dist/{chunk-IVYSVAC6.js.map → chunk-KZZ4YAEC.js.map} +0 -0
- /package/dist/{chunk-JF7SFXTG.js.map → chunk-NCSJKK23.js.map} +0 -0
- /package/dist/{chunk-XMN6MMTU.js.map → chunk-NRBGRZW4.js.map} +0 -0
- /package/dist/{chunk-BNFRL6QW.js.map → chunk-PTMJ2FH2.js.map} +0 -0
- /package/dist/{chunk-KWM33SPU.js.map → chunk-PVE7KSQP.js.map} +0 -0
- /package/dist/{chunk-YM3LR4LS.js.map → chunk-SSSXWIBP.js.map} +0 -0
- /package/dist/{chunk-Y7NWBBHV.js.map → chunk-TEO46GMM.js.map} +0 -0
- /package/dist/{chunk-AJE7FJVE.js.map → chunk-UCEABZZN.js.map} +0 -0
- /package/dist/{chunk-IENGGY2C.js.map → chunk-UCEDY5M7.js.map} +0 -0
- /package/dist/{chunk-PRQXUSQV.js.map → chunk-UYNFWZWG.js.map} +0 -0
- /package/dist/{chunk-V4UDXYGG.js.map → chunk-WDTUYOLS.js.map} +0 -0
- /package/dist/{chunk-RZOBQ23O.js.map → chunk-XOFXKASO.js.map} +0 -0
- /package/dist/{chunk-WTI35CVJ.js.map → chunk-YYN3LIYA.js.map} +0 -0
- /package/dist/{resolution-3SAP4SH2.js.map → resolution-IDTEBJFS.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveEnsureCollectionArgs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M3VYPE2H.js";
|
|
4
4
|
import {
|
|
5
5
|
launchProcess
|
|
6
6
|
} from "./chunk-O75CRYGF.js";
|
|
@@ -877,9 +877,14 @@ var QmdClient = class _QmdClient {
|
|
|
877
877
|
resetUpdateThrottles() {
|
|
878
878
|
this._lastUpdateFailAtMs = null;
|
|
879
879
|
this.lastUpdateRunAtMs = null;
|
|
880
|
+
this.lastEmbedFailAtMs = null;
|
|
880
881
|
const gs = getGlobalQmdState();
|
|
881
882
|
gs.lastGlobalUpdateRunAtMs = null;
|
|
882
883
|
gs.lastGlobalUpdateFailAtMs = null;
|
|
884
|
+
gs.lastGlobalEmbedRunAtMs = null;
|
|
885
|
+
gs.lastGlobalEmbedFailAtMs = null;
|
|
886
|
+
gs.lastEmbedByCollectionMs = {};
|
|
887
|
+
gs.lastEmbedFailByCollectionMs = {};
|
|
883
888
|
}
|
|
884
889
|
updateTimeoutMs;
|
|
885
890
|
updateMinIntervalMs;
|
|
@@ -1814,6 +1819,13 @@ var QmdClient = class _QmdClient {
|
|
|
1814
1819
|
execution?.signal
|
|
1815
1820
|
);
|
|
1816
1821
|
}
|
|
1822
|
+
async updateStrict(execution) {
|
|
1823
|
+
await this.runUpdateForCollection(
|
|
1824
|
+
this.collection,
|
|
1825
|
+
{ perCollectionThrottle: false, strict: true },
|
|
1826
|
+
execution?.signal
|
|
1827
|
+
);
|
|
1828
|
+
}
|
|
1817
1829
|
async updateCollection(collection, execution) {
|
|
1818
1830
|
await this.runUpdateForCollection(
|
|
1819
1831
|
collection,
|
|
@@ -1824,7 +1836,7 @@ var QmdClient = class _QmdClient {
|
|
|
1824
1836
|
async updateCollectionStrict(collection, execution) {
|
|
1825
1837
|
await this.runUpdateForCollection(
|
|
1826
1838
|
collection,
|
|
1827
|
-
{ perCollectionThrottle: true, strict: true },
|
|
1839
|
+
{ perCollectionThrottle: true, strict: true, force: true },
|
|
1828
1840
|
execution?.signal
|
|
1829
1841
|
);
|
|
1830
1842
|
}
|
|
@@ -1847,36 +1859,43 @@ var QmdClient = class _QmdClient {
|
|
|
1847
1859
|
}
|
|
1848
1860
|
const globalState = getGlobalQmdState();
|
|
1849
1861
|
const now = Date.now();
|
|
1850
|
-
if (!options.
|
|
1862
|
+
if (!options.force && options.perCollectionThrottle) {
|
|
1851
1863
|
if (globalState.lastGlobalUpdateFailAtMs && now - globalState.lastGlobalUpdateFailAtMs < QMD_UPDATE_BACKOFF_MS) {
|
|
1852
1864
|
log.debug("QMD update: suppressed by global failure backoff");
|
|
1865
|
+
if (options.strict) throw new Error("QMD update skipped by global failure backoff");
|
|
1853
1866
|
return;
|
|
1854
1867
|
}
|
|
1855
1868
|
const lastCollectionRun = globalState.lastUpdateByCollectionMs[name];
|
|
1856
1869
|
if (Number.isFinite(lastCollectionRun) && now - lastCollectionRun < this.updateMinIntervalMs) {
|
|
1857
1870
|
log.debug(`QMD update: suppressed by per-collection min-interval gate (${name})`);
|
|
1871
|
+
if (options.strict) throw new Error("QMD update skipped by per-collection min-interval gate");
|
|
1858
1872
|
return;
|
|
1859
1873
|
}
|
|
1860
1874
|
const lastCollectionFail = globalState.lastUpdateFailByCollectionMs[name];
|
|
1861
1875
|
if (Number.isFinite(lastCollectionFail) && now - lastCollectionFail < QMD_UPDATE_BACKOFF_MS) {
|
|
1862
1876
|
log.debug(`QMD update: suppressed by per-collection failure backoff (${name})`);
|
|
1877
|
+
if (options.strict) throw new Error("QMD update skipped by per-collection failure backoff");
|
|
1863
1878
|
return;
|
|
1864
1879
|
}
|
|
1865
|
-
} else if (!options.
|
|
1880
|
+
} else if (!options.force) {
|
|
1866
1881
|
if (this.lastUpdateRunAtMs && now - this.lastUpdateRunAtMs < this.updateMinIntervalMs) {
|
|
1867
1882
|
log.debug("QMD update: suppressed due to min-interval gate");
|
|
1883
|
+
if (options.strict) throw new Error("QMD update skipped by min-interval gate");
|
|
1868
1884
|
return;
|
|
1869
1885
|
}
|
|
1870
1886
|
if (this._lastUpdateFailAtMs && now - this._lastUpdateFailAtMs < QMD_UPDATE_BACKOFF_MS) {
|
|
1871
1887
|
log.debug("QMD update: suppressed due to recent failures (backoff)");
|
|
1888
|
+
if (options.strict) throw new Error("QMD update skipped by recent failure backoff");
|
|
1872
1889
|
return;
|
|
1873
1890
|
}
|
|
1874
1891
|
if (globalState.lastGlobalUpdateRunAtMs && now - globalState.lastGlobalUpdateRunAtMs < this.updateMinIntervalMs) {
|
|
1875
1892
|
log.debug("QMD update: suppressed by global min-interval gate");
|
|
1893
|
+
if (options.strict) throw new Error("QMD update skipped by global min-interval gate");
|
|
1876
1894
|
return;
|
|
1877
1895
|
}
|
|
1878
1896
|
if (globalState.lastGlobalUpdateFailAtMs && now - globalState.lastGlobalUpdateFailAtMs < QMD_UPDATE_BACKOFF_MS) {
|
|
1879
1897
|
log.debug("QMD update: suppressed by global failure backoff");
|
|
1898
|
+
if (options.strict) throw new Error("QMD update skipped by global failure backoff");
|
|
1880
1899
|
return;
|
|
1881
1900
|
}
|
|
1882
1901
|
}
|
|
@@ -1919,98 +1938,112 @@ var QmdClient = class _QmdClient {
|
|
|
1919
1938
|
}
|
|
1920
1939
|
}
|
|
1921
1940
|
async embed() {
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1941
|
+
await this.runEmbedForCollection(this.collection, { perCollectionThrottle: false });
|
|
1942
|
+
}
|
|
1943
|
+
async embedStrict() {
|
|
1944
|
+
await this.runEmbedForCollection(this.collection, { perCollectionThrottle: false, strict: true });
|
|
1945
|
+
}
|
|
1946
|
+
async embedCollection(collection) {
|
|
1947
|
+
await this.runEmbedForCollection(collection, { perCollectionThrottle: true });
|
|
1948
|
+
}
|
|
1949
|
+
async embedCollectionStrict(collection) {
|
|
1950
|
+
await this.runEmbedForCollection(collection, { perCollectionThrottle: true, strict: true });
|
|
1951
|
+
}
|
|
1952
|
+
async runEmbedForCollection(collection, options) {
|
|
1953
|
+
if (this.available === false) {
|
|
1954
|
+
if (options.strict) throw new Error("QMD unavailable");
|
|
1926
1955
|
return;
|
|
1927
1956
|
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1957
|
+
const name = collection.trim();
|
|
1958
|
+
if (!name) {
|
|
1959
|
+
if (options.strict) throw new Error("QMD collection name is required");
|
|
1930
1960
|
return;
|
|
1931
1961
|
}
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1962
|
+
const globalState = getGlobalQmdState();
|
|
1963
|
+
const now = Date.now();
|
|
1964
|
+
if (options.perCollectionThrottle) {
|
|
1965
|
+
if (globalState.lastGlobalEmbedFailAtMs && now - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
|
|
1966
|
+
log.debug(`QMD embed: suppressed by global failure backoff (${name})`);
|
|
1967
|
+
if (options.strict) throw new Error("QMD embed skipped by global failure backoff");
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
const lastCollectionRun = globalState.lastEmbedByCollectionMs[name];
|
|
1971
|
+
if (Number.isFinite(lastCollectionRun) && now - lastCollectionRun < this.updateMinIntervalMs) {
|
|
1972
|
+
log.debug(`QMD embed: suppressed by per-collection min-interval gate (${name})`);
|
|
1973
|
+
if (options.strict) throw new Error("QMD embed skipped by per-collection min-interval gate");
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1976
|
+
const lastCollectionFail = globalState.lastEmbedFailByCollectionMs[name];
|
|
1977
|
+
if (Number.isFinite(lastCollectionFail) && now - lastCollectionFail < QMD_EMBED_BACKOFF_MS) {
|
|
1978
|
+
log.debug(`QMD embed: suppressed by per-collection failure backoff (${name})`);
|
|
1979
|
+
if (options.strict) throw new Error("QMD embed skipped by per-collection failure backoff");
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
} else {
|
|
1983
|
+
if (this.lastEmbedFailAtMs && now - this.lastEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
|
|
1984
|
+
log.debug("QMD embed: suppressed due to recent failures (backoff)");
|
|
1985
|
+
if (options.strict) throw new Error("QMD embed skipped by recent failure backoff");
|
|
1986
|
+
return;
|
|
1987
|
+
}
|
|
1988
|
+
if (globalState.lastGlobalEmbedRunAtMs && now - globalState.lastGlobalEmbedRunAtMs < this.updateMinIntervalMs) {
|
|
1989
|
+
log.debug("QMD embed: suppressed by global min-interval gate");
|
|
1990
|
+
if (options.strict) throw new Error("QMD embed skipped by global min-interval gate");
|
|
1991
|
+
return;
|
|
1992
|
+
}
|
|
1993
|
+
if (globalState.lastGlobalEmbedFailAtMs && now - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
|
|
1994
|
+
log.debug("QMD embed: suppressed by global failure backoff");
|
|
1995
|
+
if (options.strict) throw new Error("QMD embed skipped by global failure backoff");
|
|
1996
|
+
return;
|
|
1997
|
+
}
|
|
1935
1998
|
}
|
|
1936
1999
|
try {
|
|
1937
2000
|
const startedAtMs = Date.now();
|
|
1938
|
-
await this.runQmdCommand(this.buildEmbedArgs(
|
|
2001
|
+
await this.runQmdCommand(this.buildEmbedArgs(name), 3e5);
|
|
1939
2002
|
const durationMs = Date.now() - startedAtMs;
|
|
1940
2003
|
if (this.slowLog?.enabled && durationMs >= this.slowLog.thresholdMs) {
|
|
1941
2004
|
log.warn(`SLOW QMD embed: durationMs=${durationMs}`);
|
|
1942
2005
|
}
|
|
1943
|
-
globalState.lastGlobalEmbedRunAtMs = Date.now();
|
|
1944
|
-
log.debug("QMD embed completed");
|
|
1945
|
-
} catch (err) {
|
|
1946
|
-
if (isVectorDimensionMismatchError(err)) {
|
|
1947
|
-
try {
|
|
1948
|
-
log.warn("QMD embed hit a vector dimension mismatch; retrying with force re-embed");
|
|
1949
|
-
await this.runQmdCommand(this.buildEmbedArgs(this.collection, true), 3e5);
|
|
1950
|
-
globalState.lastGlobalEmbedRunAtMs = Date.now();
|
|
1951
|
-
this.lastEmbedFailAtMs = null;
|
|
1952
|
-
globalState.lastGlobalEmbedFailAtMs = null;
|
|
1953
|
-
log.warn("QMD embed recovered by forcing a full vector rebuild");
|
|
1954
|
-
return;
|
|
1955
|
-
} catch (retryErr) {
|
|
1956
|
-
const retryMsg = retryErr instanceof Error ? retryErr.message : String(retryErr);
|
|
1957
|
-
log.warn(`QMD force re-embed failed after dimension mismatch: ${retryMsg}`);
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
const now = Date.now();
|
|
1961
|
-
this.lastEmbedFailAtMs = now;
|
|
1962
|
-
globalState.lastGlobalEmbedFailAtMs = now;
|
|
1963
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
1964
|
-
log.warn(`QMD embed failed: ${msg}`);
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
async embedCollection(collection) {
|
|
1968
|
-
if (this.available === false) return;
|
|
1969
|
-
const name = collection.trim();
|
|
1970
|
-
if (!name) return;
|
|
1971
|
-
const globalState = getGlobalQmdState();
|
|
1972
|
-
const now = Date.now();
|
|
1973
|
-
if (globalState.lastGlobalEmbedFailAtMs && now - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
|
|
1974
|
-
log.debug(`QMD embed: suppressed by global failure backoff (${name})`);
|
|
1975
|
-
return;
|
|
1976
|
-
}
|
|
1977
|
-
const lastCollectionRun = globalState.lastEmbedByCollectionMs[name];
|
|
1978
|
-
if (Number.isFinite(lastCollectionRun) && now - lastCollectionRun < this.updateMinIntervalMs) {
|
|
1979
|
-
log.debug(`QMD embed: suppressed by per-collection min-interval gate (${name})`);
|
|
1980
|
-
return;
|
|
1981
|
-
}
|
|
1982
|
-
const lastCollectionFail = globalState.lastEmbedFailByCollectionMs[name];
|
|
1983
|
-
if (Number.isFinite(lastCollectionFail) && now - lastCollectionFail < QMD_EMBED_BACKOFF_MS) {
|
|
1984
|
-
log.debug(`QMD embed: suppressed by per-collection failure backoff (${name})`);
|
|
1985
|
-
return;
|
|
1986
|
-
}
|
|
1987
|
-
try {
|
|
1988
|
-
await this.runQmdCommand(this.buildEmbedArgs(name), 3e5);
|
|
1989
2006
|
const at = Date.now();
|
|
1990
|
-
|
|
2007
|
+
if (options.perCollectionThrottle) {
|
|
2008
|
+
globalState.lastEmbedByCollectionMs[name] = at;
|
|
2009
|
+
}
|
|
1991
2010
|
globalState.lastGlobalEmbedRunAtMs = at;
|
|
2011
|
+
log.debug(`QMD embed completed for collection=${name}`);
|
|
1992
2012
|
} catch (err) {
|
|
2013
|
+
let failure = err;
|
|
1993
2014
|
if (isVectorDimensionMismatchError(err)) {
|
|
1994
2015
|
try {
|
|
1995
2016
|
log.warn(`QMD embed for collection ${name} hit a vector dimension mismatch; retrying with force re-embed`);
|
|
1996
2017
|
await this.runQmdCommand(this.buildEmbedArgs(name, true), 3e5);
|
|
1997
2018
|
const recoveredAt = Date.now();
|
|
1998
|
-
|
|
2019
|
+
if (options.perCollectionThrottle) {
|
|
2020
|
+
globalState.lastEmbedByCollectionMs[name] = recoveredAt;
|
|
2021
|
+
delete globalState.lastEmbedFailByCollectionMs[name];
|
|
2022
|
+
} else {
|
|
2023
|
+
this.lastEmbedFailAtMs = null;
|
|
2024
|
+
}
|
|
1999
2025
|
globalState.lastGlobalEmbedRunAtMs = recoveredAt;
|
|
2000
|
-
delete globalState.lastEmbedFailByCollectionMs[name];
|
|
2001
2026
|
globalState.lastGlobalEmbedFailAtMs = null;
|
|
2002
2027
|
log.warn(`QMD embed for collection ${name} recovered by forcing a full vector rebuild`);
|
|
2003
2028
|
return;
|
|
2004
2029
|
} catch (retryErr) {
|
|
2030
|
+
failure = retryErr;
|
|
2005
2031
|
const retryMsg = retryErr instanceof Error ? retryErr.message : String(retryErr);
|
|
2006
2032
|
log.warn(`QMD force re-embed failed for collection ${name}: ${retryMsg}`);
|
|
2007
2033
|
}
|
|
2008
2034
|
}
|
|
2009
2035
|
const at = Date.now();
|
|
2010
|
-
|
|
2036
|
+
if (options.perCollectionThrottle) {
|
|
2037
|
+
globalState.lastEmbedFailByCollectionMs[name] = at;
|
|
2038
|
+
} else {
|
|
2039
|
+
this.lastEmbedFailAtMs = at;
|
|
2040
|
+
}
|
|
2011
2041
|
globalState.lastGlobalEmbedFailAtMs = at;
|
|
2012
|
-
const msg =
|
|
2042
|
+
const msg = failure instanceof Error ? failure.message : String(failure);
|
|
2013
2043
|
log.warn(`QMD embed failed for collection ${name}: ${msg}`);
|
|
2044
|
+
if (options.strict) {
|
|
2045
|
+
throw failure;
|
|
2046
|
+
}
|
|
2014
2047
|
}
|
|
2015
2048
|
}
|
|
2016
2049
|
async checkCollection(collectionOrExecution, execution) {
|
|
@@ -2103,4 +2136,4 @@ export {
|
|
|
2103
2136
|
getQmdCommandName,
|
|
2104
2137
|
QmdClient
|
|
2105
2138
|
};
|
|
2106
|
-
//# sourceMappingURL=chunk-
|
|
2139
|
+
//# sourceMappingURL=chunk-QRSKPI62.js.map
|