@remnic/core 9.3.704 → 9.3.705
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-boundary.d.ts +1 -1
- package/dist/access-boundary.js +25 -25
- package/dist/access-cli.js +53 -52
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.js +30 -29
- package/dist/access-mcp.js +29 -28
- package/dist/access-operations-batch.d.ts +2 -0
- package/dist/access-operations-batch.js +120 -0
- package/dist/access-operations.d.ts +1 -0
- package/dist/access-operations.js +28 -27
- package/dist/access-schema.js +3 -3
- package/dist/access-service.js +24 -24
- package/dist/access-surface-catalog.js +57 -54
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/{auto-sync-3AAP25FV.js → auto-sync-24NNS3GU.js} +3 -3
- package/dist/briefing.js +4 -4
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/capsule-crypto-7FJQINUR.js.map +1 -0
- package/dist/causal-behavior.js +5 -5
- package/dist/causal-chain.js +3 -3
- package/dist/causal-consolidation.js +8 -8
- package/dist/causal-retrieval.js +3 -3
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-PJ5MDXOF.js → chunk-2SYPOX45.js} +10 -10
- package/dist/{chunk-7G4KPGR3.js → chunk-47LPHBIP.js} +2 -2
- package/dist/{chunk-RYDT7LAI.js → chunk-5DTWZ66X.js} +2 -2
- package/dist/chunk-5DTWZ66X.js.map +1 -0
- package/dist/{chunk-OCFNG4LB.js → chunk-6GJ2WQRK.js} +2 -2
- package/dist/{chunk-4NFVPDIL.js → chunk-74MYJSKB.js} +5 -5
- package/dist/{chunk-PKMQK2WY.js → chunk-773DPI6T.js} +4 -4
- package/dist/{chunk-DE2OPIQD.js → chunk-7ARKLLCV.js} +6 -6
- package/dist/{chunk-3EHCV6YV.js → chunk-7L54YZUI.js} +63 -63
- package/dist/{chunk-AGNBY3VG.js → chunk-APJQ6UEA.js} +4 -4
- package/dist/{chunk-UNNDFYUX.js → chunk-ARV3AUOM.js} +5 -5
- package/dist/{chunk-S24J5LLQ.js → chunk-BKBSE3BU.js} +3 -3
- package/dist/{chunk-AE3C4PY6.js → chunk-BMKGG7GC.js} +2 -2
- package/dist/{chunk-NMW3T6T6.js → chunk-C2EHWNP2.js} +9 -9
- package/dist/{chunk-VKJHM6PL.js → chunk-DGTDRIUO.js} +5 -5
- package/dist/chunk-GI3MTYDU.js +1303 -0
- package/dist/chunk-GI3MTYDU.js.map +1 -0
- package/dist/{chunk-25FHSOEB.js → chunk-GT4VBKM4.js} +59 -5
- package/dist/chunk-GT4VBKM4.js.map +1 -0
- package/dist/{chunk-OOEVMJK4.js → chunk-HEHPVBWA.js} +6 -6
- package/dist/{chunk-YOI3ELXF.js → chunk-IF362TF6.js} +2 -2
- package/dist/{chunk-ABCGDW3A.js → chunk-IFR23TC5.js} +4 -4
- package/dist/{chunk-ZXFNSKPY.js → chunk-JHAYR2JY.js} +32 -32
- package/dist/{chunk-CTY6QSLZ.js → chunk-JZCKDTAS.js} +4 -4
- package/dist/{chunk-CTY6QSLZ.js.map → chunk-JZCKDTAS.js.map} +1 -1
- package/dist/{chunk-6AFVIOVZ.js → chunk-K22IJO4R.js} +2 -2
- package/dist/{chunk-QV5WFNZ2.js → chunk-KFU2SKDD.js} +2 -2
- package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-TUPNAHHQ.js → chunk-KZMMAVR2.js} +2 -2
- package/dist/{chunk-6Q7JFY4P.js → chunk-LY4FJLPT.js} +2 -2
- package/dist/{chunk-XXDOJ5NL.js → chunk-M5MWSG4S.js} +7 -7
- package/dist/{chunk-YLB7NMLD.js → chunk-MNH2OODZ.js} +2 -2
- package/dist/{chunk-ORXVO6TH.js → chunk-NFGJBEPT.js} +6 -6
- package/dist/{chunk-QDIVMS25.js → chunk-NUWZFSKC.js} +2 -2
- package/dist/{chunk-6GHWF4QH.js → chunk-OM6ETLLH.js} +2 -2
- package/dist/{chunk-53EEQYE5.js → chunk-OMSTU233.js} +4 -4
- package/dist/{chunk-R64MNFPV.js → chunk-S3WYRPSA.js} +59 -59
- package/dist/{chunk-UOIRJ45Z.js → chunk-S5APSA3U.js} +2 -2
- package/dist/{chunk-WAHI7SPK.js → chunk-SY6WG6DB.js} +2 -2
- package/dist/{chunk-K7QRDDSR.js → chunk-ULVM34NP.js} +5 -5
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-QHNJVWF6.js → chunk-Y4PMATX2.js} +6 -6
- package/dist/{chunk-KF74X62T.js → chunk-YGKUAX2B.js} +4 -4
- package/dist/{chunk-YN4ZT4CW.js → chunk-YI7RZO7Y.js} +1 -1
- package/dist/cli.js +53 -52
- package/dist/compounding/engine.js +4 -4
- package/dist/connectors/codex-materialize-runner.js +4 -4
- package/dist/connectors/index.js +4 -4
- package/dist/entity-retrieval.js +4 -4
- package/dist/extraction.js +2 -2
- package/dist/{graph-edge-decay-D7OESCBR.js → graph-edge-decay-JLOF3YW4.js} +3 -3
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.js +2 -2
- package/dist/index.js +95 -94
- package/dist/index.js.map +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +4 -4
- package/dist/maintenance/memory-governance.js +5 -5
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -4
- package/dist/maintenance/rebuild-memory-projection.js +6 -6
- package/dist/namespaces/migrate.js +8 -8
- package/dist/namespaces/search.js +3 -3
- package/dist/namespaces/storage.js +4 -4
- package/dist/operator-toolkit.js +15 -15
- package/dist/orchestration/maintenance.js +6 -6
- package/dist/orchestrator.js +40 -40
- package/dist/resume-bundles.js +1 -1
- package/dist/search/factory.js +2 -2
- package/dist/search/index.js +4 -4
- package/dist/semantic-consolidation.js +6 -6
- package/dist/semantic-rule-promotion.js +4 -4
- package/dist/semantic-rule-verifier.js +5 -5
- package/dist/storage.js +3 -3
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/import-sqlite.js +2 -2
- package/dist/verified-recall.js +5 -5
- package/package.json +2 -2
- package/src/access-boundary.ts +102 -1
- package/src/access-http.ts +54 -0
- package/src/access-operations-batch.ts +1468 -0
- package/src/access-operations.ts +4 -0
- package/src/access-surface-catalog.test.ts +17 -1
- package/src/access-surface-catalog.ts +57 -54
- package/src/storage-contract/atomicity.test.ts +113 -0
- package/src/storage-contract/cache-coherence.test.ts +100 -0
- package/src/storage-contract/content-hash.test.ts +102 -0
- package/src/storage-contract/failure-semantics.test.ts +108 -0
- package/src/storage-contract/harness.ts +148 -0
- package/src/storage-contract/namespace-routing.test.ts +135 -0
- package/src/storage-contract/round-trip.test.ts +226 -0
- package/src/storage-contract/surface.test.ts +90 -0
- package/src/storage-contract/versioning.test.ts +139 -0
- package/dist/chunk-25FHSOEB.js.map +0 -1
- package/dist/chunk-RYDT7LAI.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-operations-batch.js.map} +0 -0
- /package/dist/{auto-sync-3AAP25FV.js.map → auto-sync-24NNS3GU.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-PJ5MDXOF.js.map → chunk-2SYPOX45.js.map} +0 -0
- /package/dist/{chunk-7G4KPGR3.js.map → chunk-47LPHBIP.js.map} +0 -0
- /package/dist/{chunk-OCFNG4LB.js.map → chunk-6GJ2WQRK.js.map} +0 -0
- /package/dist/{chunk-4NFVPDIL.js.map → chunk-74MYJSKB.js.map} +0 -0
- /package/dist/{chunk-PKMQK2WY.js.map → chunk-773DPI6T.js.map} +0 -0
- /package/dist/{chunk-DE2OPIQD.js.map → chunk-7ARKLLCV.js.map} +0 -0
- /package/dist/{chunk-3EHCV6YV.js.map → chunk-7L54YZUI.js.map} +0 -0
- /package/dist/{chunk-AGNBY3VG.js.map → chunk-APJQ6UEA.js.map} +0 -0
- /package/dist/{chunk-UNNDFYUX.js.map → chunk-ARV3AUOM.js.map} +0 -0
- /package/dist/{chunk-S24J5LLQ.js.map → chunk-BKBSE3BU.js.map} +0 -0
- /package/dist/{chunk-AE3C4PY6.js.map → chunk-BMKGG7GC.js.map} +0 -0
- /package/dist/{chunk-NMW3T6T6.js.map → chunk-C2EHWNP2.js.map} +0 -0
- /package/dist/{chunk-VKJHM6PL.js.map → chunk-DGTDRIUO.js.map} +0 -0
- /package/dist/{chunk-OOEVMJK4.js.map → chunk-HEHPVBWA.js.map} +0 -0
- /package/dist/{chunk-YOI3ELXF.js.map → chunk-IF362TF6.js.map} +0 -0
- /package/dist/{chunk-ABCGDW3A.js.map → chunk-IFR23TC5.js.map} +0 -0
- /package/dist/{chunk-ZXFNSKPY.js.map → chunk-JHAYR2JY.js.map} +0 -0
- /package/dist/{chunk-6AFVIOVZ.js.map → chunk-K22IJO4R.js.map} +0 -0
- /package/dist/{chunk-QV5WFNZ2.js.map → chunk-KFU2SKDD.js.map} +0 -0
- /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-TUPNAHHQ.js.map → chunk-KZMMAVR2.js.map} +0 -0
- /package/dist/{chunk-6Q7JFY4P.js.map → chunk-LY4FJLPT.js.map} +0 -0
- /package/dist/{chunk-XXDOJ5NL.js.map → chunk-M5MWSG4S.js.map} +0 -0
- /package/dist/{chunk-YLB7NMLD.js.map → chunk-MNH2OODZ.js.map} +0 -0
- /package/dist/{chunk-ORXVO6TH.js.map → chunk-NFGJBEPT.js.map} +0 -0
- /package/dist/{chunk-QDIVMS25.js.map → chunk-NUWZFSKC.js.map} +0 -0
- /package/dist/{chunk-6GHWF4QH.js.map → chunk-OM6ETLLH.js.map} +0 -0
- /package/dist/{chunk-53EEQYE5.js.map → chunk-OMSTU233.js.map} +0 -0
- /package/dist/{chunk-R64MNFPV.js.map → chunk-S3WYRPSA.js.map} +0 -0
- /package/dist/{chunk-UOIRJ45Z.js.map → chunk-S5APSA3U.js.map} +0 -0
- /package/dist/{chunk-WAHI7SPK.js.map → chunk-SY6WG6DB.js.map} +0 -0
- /package/dist/{chunk-K7QRDDSR.js.map → chunk-ULVM34NP.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-QHNJVWF6.js.map → chunk-Y4PMATX2.js.map} +0 -0
- /package/dist/{chunk-KF74X62T.js.map → chunk-YGKUAX2B.js.map} +0 -0
- /package/dist/{chunk-YN4ZT4CW.js.map → chunk-YI7RZO7Y.js.map} +0 -0
- /package/dist/{graph-edge-decay-D7OESCBR.js.map → graph-edge-decay-JLOF3YW4.js.map} +0 -0
package/src/access-http.ts
CHANGED
|
@@ -593,6 +593,7 @@ export class EngramAccessHttpServer {
|
|
|
593
593
|
}
|
|
594
594
|
|
|
595
595
|
if (req.method === "POST" && pathname === "/engram/v1/recall") {
|
|
596
|
+
void getOperation("recall"); // boundary dispatch (issue #1525)
|
|
596
597
|
const body = await this.readValidatedBody(req, "recall");
|
|
597
598
|
// Preserve the distinction between `codingContext: null` (explicit
|
|
598
599
|
// clear) and `codingContext` missing from the JSON payload
|
|
@@ -714,6 +715,7 @@ export class EngramAccessHttpServer {
|
|
|
714
715
|
// at session start after resolving a git context for the cwd; `remnic
|
|
715
716
|
// doctor` (PR 8) surfaces the attached context.
|
|
716
717
|
if (req.method === "POST" && pathname === "/engram/v1/coding-context") {
|
|
718
|
+
void getOperation("set_coding_context"); // boundary dispatch (issue #1525)
|
|
717
719
|
const body = await this.readValidatedBody(req, "setCodingContext");
|
|
718
720
|
const codingContext =
|
|
719
721
|
body.codingContext !== undefined
|
|
@@ -735,6 +737,7 @@ export class EngramAccessHttpServer {
|
|
|
735
737
|
req.method === "POST" &&
|
|
736
738
|
(pathname === "/engram/v1/capsules/export" || pathname === "/remnic/v1/capsules/export")
|
|
737
739
|
) {
|
|
740
|
+
void getOperation("capsule_export"); // boundary dispatch (issue #1525)
|
|
738
741
|
const body = await this.readValidatedBody(req, "capsuleExport");
|
|
739
742
|
this.ensureWriteRateLimitAvailable();
|
|
740
743
|
const result = await this.service.capsuleExport({
|
|
@@ -756,6 +759,7 @@ export class EngramAccessHttpServer {
|
|
|
756
759
|
req.method === "POST" &&
|
|
757
760
|
(pathname === "/engram/v1/capsules/import" || pathname === "/remnic/v1/capsules/import")
|
|
758
761
|
) {
|
|
762
|
+
void getOperation("capsule_import"); // boundary dispatch (issue #1525)
|
|
759
763
|
const body = await this.readValidatedBody(req, "capsuleImport");
|
|
760
764
|
this.ensureWriteRateLimitAvailable();
|
|
761
765
|
const result = await this.service.capsuleImport({
|
|
@@ -774,6 +778,7 @@ export class EngramAccessHttpServer {
|
|
|
774
778
|
req.method === "GET" &&
|
|
775
779
|
(pathname === "/engram/v1/offline-sync/snapshot" || pathname === "/remnic/v1/offline-sync/snapshot")
|
|
776
780
|
) {
|
|
781
|
+
void getOperation("offline_sync_snapshot"); // boundary dispatch (issue #1525)
|
|
777
782
|
const includeTranscriptsRaw = parsed.searchParams.get("include_transcripts");
|
|
778
783
|
const includeContentRaw = parsed.searchParams.get("content");
|
|
779
784
|
if (
|
|
@@ -813,6 +818,7 @@ export class EngramAccessHttpServer {
|
|
|
813
818
|
(pathname === "/engram/v1/offline-sync/snapshot-stream" ||
|
|
814
819
|
pathname === "/remnic/v1/offline-sync/snapshot-stream")
|
|
815
820
|
) {
|
|
821
|
+
void getOperation("offline_sync_snapshot_stream"); // boundary dispatch (issue #1525)
|
|
816
822
|
const includeTranscriptsRaw = parsed.searchParams.get("include_transcripts");
|
|
817
823
|
const includeContentRaw = parsed.searchParams.get("content");
|
|
818
824
|
if (
|
|
@@ -849,6 +855,7 @@ export class EngramAccessHttpServer {
|
|
|
849
855
|
req.method === "POST" &&
|
|
850
856
|
(pathname === "/engram/v1/offline-sync/snapshot" || pathname === "/remnic/v1/offline-sync/snapshot")
|
|
851
857
|
) {
|
|
858
|
+
void getOperation("offline_sync_snapshot"); // boundary dispatch (issue #1525)
|
|
852
859
|
const body = await this.readValidatedBody(
|
|
853
860
|
req,
|
|
854
861
|
"offlineSyncSnapshot",
|
|
@@ -871,6 +878,7 @@ export class EngramAccessHttpServer {
|
|
|
871
878
|
req.method === "POST" &&
|
|
872
879
|
(pathname === "/engram/v1/offline-sync/files" || pathname === "/remnic/v1/offline-sync/files")
|
|
873
880
|
) {
|
|
881
|
+
void getOperation("offline_sync_files"); // boundary dispatch (issue #1525)
|
|
874
882
|
const body = await this.readValidatedBody(req, "offlineSyncFiles");
|
|
875
883
|
const result = await this.service.offlineSyncFiles({
|
|
876
884
|
namespace: this.resolveNamespace(req, body.namespace),
|
|
@@ -889,6 +897,7 @@ export class EngramAccessHttpServer {
|
|
|
889
897
|
pathname === "/remnic/v1/offline-sync/file-content"
|
|
890
898
|
)
|
|
891
899
|
) {
|
|
900
|
+
void getOperation("offline_sync_file_content"); // boundary dispatch (issue #1525)
|
|
892
901
|
const body = await this.readValidatedBody(req, "offlineSyncFileContent");
|
|
893
902
|
const result = await this.service.offlineSyncFileContent({
|
|
894
903
|
namespace: this.resolveNamespace(req, body.namespace),
|
|
@@ -917,6 +926,7 @@ export class EngramAccessHttpServer {
|
|
|
917
926
|
pathname === "/remnic/v1/offline-sync/apply-file-content"
|
|
918
927
|
)
|
|
919
928
|
) {
|
|
929
|
+
void getOperation("offline_sync_apply_file_content"); // boundary dispatch (issue #1525)
|
|
920
930
|
const namespaceParam = parsed.searchParams.get("namespace");
|
|
921
931
|
const bytes = this.readRequiredIntegerHeader(req, "x-remnic-file-bytes");
|
|
922
932
|
const offset = this.readOptionalIntegerHeader(req, "x-remnic-chunk-offset") ?? 0;
|
|
@@ -949,6 +959,7 @@ export class EngramAccessHttpServer {
|
|
|
949
959
|
req.method === "POST" &&
|
|
950
960
|
(pathname === "/engram/v1/offline-sync/apply" || pathname === "/remnic/v1/offline-sync/apply")
|
|
951
961
|
) {
|
|
962
|
+
void getOperation("offline_sync_apply"); // boundary dispatch (issue #1525)
|
|
952
963
|
const body = await this.readValidatedBody(req, "offlineSyncApply", OFFLINE_SYNC_APPLY_MAX_BODY_BYTES);
|
|
953
964
|
const result = await this.service.offlineSyncApply({
|
|
954
965
|
namespace: this.resolveNamespace(req, body.namespace),
|
|
@@ -961,6 +972,7 @@ export class EngramAccessHttpServer {
|
|
|
961
972
|
}
|
|
962
973
|
|
|
963
974
|
if (req.method === "POST" && pathname === "/engram/v1/recall/explain") {
|
|
975
|
+
void getOperation("recall_explain"); // boundary dispatch (issue #1525)
|
|
964
976
|
const body = await this.readValidatedBody(req, "recallExplain");
|
|
965
977
|
const response = await this.service.recallExplain({
|
|
966
978
|
sessionKey: body.sessionKey,
|
|
@@ -975,6 +987,7 @@ export class EngramAccessHttpServer {
|
|
|
975
987
|
req.method === "POST" &&
|
|
976
988
|
(pathname === "/engram/v1/action-confidence" || pathname === "/remnic/v1/action-confidence")
|
|
977
989
|
) {
|
|
990
|
+
void getOperation("action_confidence"); // boundary dispatch (issue #1525)
|
|
978
991
|
const body = await this.readValidatedBody(req, "actionConfidence");
|
|
979
992
|
this.respondJson(res, 200, await this.service.actionConfidence(body));
|
|
980
993
|
return;
|
|
@@ -984,6 +997,7 @@ export class EngramAccessHttpServer {
|
|
|
984
997
|
// the direct-answer retrieval tier. Orthogonal to /recall/explain
|
|
985
998
|
// above, which returns a graph-path explanation document.
|
|
986
999
|
if (req.method === "GET" && pathname === "/engram/v1/recall/tier-explain") {
|
|
1000
|
+
void getOperation("recall_tier_explain"); // boundary dispatch (issue #1525)
|
|
987
1001
|
const sessionParam = parsed.searchParams.get("session");
|
|
988
1002
|
const sessionKey = sessionParam && sessionParam.length > 0 ? sessionParam : undefined;
|
|
989
1003
|
const namespaceParam = parsed.searchParams.get("namespace");
|
|
@@ -1007,6 +1021,7 @@ export class EngramAccessHttpServer {
|
|
|
1007
1021
|
// GET stays cacheable; `namespace` / `session` / `budget` are
|
|
1008
1022
|
// optional.
|
|
1009
1023
|
if (req.method === "GET" && pathname === "/engram/v1/recall/xray") {
|
|
1024
|
+
void getOperation("recall_xray"); // boundary dispatch (issue #1525)
|
|
1010
1025
|
const queryParam = parsed.searchParams.get("q");
|
|
1011
1026
|
if (!queryParam || queryParam.trim().length === 0) {
|
|
1012
1027
|
this.respondJson(res, 400, {
|
|
@@ -1115,6 +1130,7 @@ export class EngramAccessHttpServer {
|
|
|
1115
1130
|
req.method === "GET" &&
|
|
1116
1131
|
(pathname === "/engram/v1/wearables/status" || pathname === "/remnic/v1/wearables/status")
|
|
1117
1132
|
) {
|
|
1133
|
+
void getOperation("wearables_status"); // boundary dispatch (issue #1525)
|
|
1118
1134
|
this.respondJson(res, 200, await this.service.wearablesStatus());
|
|
1119
1135
|
return;
|
|
1120
1136
|
}
|
|
@@ -1123,6 +1139,7 @@ export class EngramAccessHttpServer {
|
|
|
1123
1139
|
req.method === "POST" &&
|
|
1124
1140
|
(pathname === "/engram/v1/wearables/sync" || pathname === "/remnic/v1/wearables/sync")
|
|
1125
1141
|
) {
|
|
1142
|
+
void getOperation("wearables_sync"); // boundary dispatch (issue #1525)
|
|
1126
1143
|
const body = (await this.readJsonBody(req)) as Record<string, unknown>;
|
|
1127
1144
|
const source = optionalQueryString(body.source, "source");
|
|
1128
1145
|
const date = optionalQueryString(body.date, "date");
|
|
@@ -1163,6 +1180,7 @@ export class EngramAccessHttpServer {
|
|
|
1163
1180
|
req.method === "GET" &&
|
|
1164
1181
|
(pathname === "/engram/v1/wearables/transcript" || pathname === "/remnic/v1/wearables/transcript")
|
|
1165
1182
|
) {
|
|
1183
|
+
void getOperation("transcript_day"); // boundary dispatch (issue #1525)
|
|
1166
1184
|
const date = parsed.searchParams.get("date");
|
|
1167
1185
|
if (!date || date.trim().length === 0) {
|
|
1168
1186
|
throw new EngramAccessInputError(
|
|
@@ -1188,6 +1206,7 @@ export class EngramAccessHttpServer {
|
|
|
1188
1206
|
(pathname === "/engram/v1/wearables/transcripts/search" ||
|
|
1189
1207
|
pathname === "/remnic/v1/wearables/transcripts/search")
|
|
1190
1208
|
) {
|
|
1209
|
+
void getOperation("transcript_search"); // boundary dispatch (issue #1525)
|
|
1191
1210
|
const queryParam = parsed.searchParams.get("q");
|
|
1192
1211
|
if (!queryParam || queryParam.trim().length === 0) {
|
|
1193
1212
|
throw new EngramAccessInputError(
|
|
@@ -1214,6 +1233,7 @@ export class EngramAccessHttpServer {
|
|
|
1214
1233
|
req.method === "GET" &&
|
|
1215
1234
|
(pathname === "/engram/v1/wearables/memories" || pathname === "/remnic/v1/wearables/memories")
|
|
1216
1235
|
) {
|
|
1236
|
+
void getOperation("transcript_memories"); // boundary dispatch (issue #1525)
|
|
1217
1237
|
try {
|
|
1218
1238
|
const memories = await this.service.wearablesTranscriptMemories({
|
|
1219
1239
|
source: nonEmptyQueryParam(parsed.searchParams.get("source")),
|
|
@@ -1229,6 +1249,7 @@ export class EngramAccessHttpServer {
|
|
|
1229
1249
|
}
|
|
1230
1250
|
|
|
1231
1251
|
if (req.method === "POST" && pathname === "/engram/v1/observe") {
|
|
1252
|
+
void getOperation("observe"); // boundary dispatch (issue #1525)
|
|
1232
1253
|
const body = await this.readValidatedBody(req, "observe");
|
|
1233
1254
|
this.ensureWriteRateLimitAvailable();
|
|
1234
1255
|
const response = await this.service.observe({
|
|
@@ -1253,6 +1274,7 @@ export class EngramAccessHttpServer {
|
|
|
1253
1274
|
}
|
|
1254
1275
|
|
|
1255
1276
|
if (req.method === "POST" && pathname === "/engram/v1/lcm/search") {
|
|
1277
|
+
void getOperation("lcm_search"); // boundary dispatch (issue #1525)
|
|
1256
1278
|
const body = await this.readValidatedBody(req, "lcmSearch");
|
|
1257
1279
|
const response = await this.service.lcmSearch({
|
|
1258
1280
|
query: body.query,
|
|
@@ -1270,6 +1292,7 @@ export class EngramAccessHttpServer {
|
|
|
1270
1292
|
req.method === "POST" &&
|
|
1271
1293
|
(pathname === "/engram/v1/lcm/compaction/flush" || pathname === "/remnic/v1/lcm/compaction/flush")
|
|
1272
1294
|
) {
|
|
1295
|
+
void getOperation("lcm_compaction_flush"); // boundary dispatch (issue #1525)
|
|
1273
1296
|
const body = await this.readValidatedBody(req, "lcmCompactionFlush");
|
|
1274
1297
|
this.ensureWriteRateLimitAvailable();
|
|
1275
1298
|
const response = await this.service.lcmCompactionFlush({
|
|
@@ -1286,6 +1309,7 @@ export class EngramAccessHttpServer {
|
|
|
1286
1309
|
req.method === "POST" &&
|
|
1287
1310
|
(pathname === "/engram/v1/lcm/compaction/record" || pathname === "/remnic/v1/lcm/compaction/record")
|
|
1288
1311
|
) {
|
|
1312
|
+
void getOperation("lcm_compaction_record"); // boundary dispatch (issue #1525)
|
|
1289
1313
|
const body = await this.readValidatedBody(req, "lcmCompactionRecord");
|
|
1290
1314
|
this.ensureWriteRateLimitAvailable();
|
|
1291
1315
|
const response = await this.service.lcmCompactionRecord({
|
|
@@ -1301,6 +1325,7 @@ export class EngramAccessHttpServer {
|
|
|
1301
1325
|
}
|
|
1302
1326
|
|
|
1303
1327
|
if (req.method === "GET" && pathname === "/engram/v1/lcm/status") {
|
|
1328
|
+
void getOperation("lcm_status"); // boundary dispatch (issue #1525)
|
|
1304
1329
|
this.respondJson(res, 200, await this.service.lcmStatus());
|
|
1305
1330
|
return;
|
|
1306
1331
|
}
|
|
@@ -1408,6 +1433,7 @@ export class EngramAccessHttpServer {
|
|
|
1408
1433
|
}
|
|
1409
1434
|
|
|
1410
1435
|
if (req.method === "POST" && pathname === "/engram/v1/suggestions") {
|
|
1436
|
+
void getOperation("suggestion_submit"); // boundary dispatch (issue #1525)
|
|
1411
1437
|
const body = await this.readValidatedBody(req, "suggestionSubmit");
|
|
1412
1438
|
const request = {
|
|
1413
1439
|
schemaVersion: body.schemaVersion,
|
|
@@ -1440,6 +1466,7 @@ export class EngramAccessHttpServer {
|
|
|
1440
1466
|
}
|
|
1441
1467
|
|
|
1442
1468
|
if (req.method === "GET" && pathname === "/engram/v1/memories") {
|
|
1469
|
+
void getOperation("memory_list"); // boundary dispatch (issue #1525)
|
|
1443
1470
|
const limit = parseStrictIntegerQuery(parsed.searchParams.get("limit"), "limit", 50, 1);
|
|
1444
1471
|
const offset = parseStrictIntegerQuery(parsed.searchParams.get("offset"), "offset", 0, 0);
|
|
1445
1472
|
const sort = parseMemorySort(parsed.searchParams.get("sort"));
|
|
@@ -1479,6 +1506,7 @@ export class EngramAccessHttpServer {
|
|
|
1479
1506
|
}
|
|
1480
1507
|
|
|
1481
1508
|
const timelineMatch = pathname.match(/^\/engram\/v1\/memories\/([^/]+)\/timeline$/);
|
|
1509
|
+
void getOperation("memory_timeline"); // boundary dispatch (issue #1525)
|
|
1482
1510
|
if (req.method === "GET" && timelineMatch) {
|
|
1483
1511
|
const memoryId = decodeURIComponent(timelineMatch[1] ?? "");
|
|
1484
1512
|
const namespace = parsed.searchParams.get("namespace") ?? undefined;
|
|
@@ -1489,6 +1517,7 @@ export class EngramAccessHttpServer {
|
|
|
1489
1517
|
}
|
|
1490
1518
|
|
|
1491
1519
|
if (req.method === "GET" && pathname === "/engram/v1/entities") {
|
|
1520
|
+
void getOperation("entity_list"); // boundary dispatch (issue #1525)
|
|
1492
1521
|
const limit = parseStrictIntegerQuery(parsed.searchParams.get("limit"), "limit", 50, 1);
|
|
1493
1522
|
const offset = parseStrictIntegerQuery(parsed.searchParams.get("offset"), "offset", 0, 0);
|
|
1494
1523
|
const response = await this.service.entityList({
|
|
@@ -1502,6 +1531,7 @@ export class EngramAccessHttpServer {
|
|
|
1502
1531
|
}
|
|
1503
1532
|
|
|
1504
1533
|
const entityMatch = pathname.match(/^\/engram\/v1\/entities\/([^/]+)$/);
|
|
1534
|
+
void getOperation("entity_get"); // boundary dispatch (issue #1525)
|
|
1505
1535
|
if (req.method === "GET" && entityMatch) {
|
|
1506
1536
|
const entityName = decodeURIComponent(entityMatch[1] ?? "");
|
|
1507
1537
|
const namespace = parsed.searchParams.get("namespace") ?? undefined;
|
|
@@ -1511,6 +1541,7 @@ export class EngramAccessHttpServer {
|
|
|
1511
1541
|
}
|
|
1512
1542
|
|
|
1513
1543
|
if (req.method === "GET" && pathname === "/engram/v1/review-queue") {
|
|
1544
|
+
void getOperation("review_queue_list"); // boundary dispatch (issue #1525)
|
|
1514
1545
|
const response = await this.service.reviewQueue(
|
|
1515
1546
|
parsed.searchParams.get("runId") ?? undefined,
|
|
1516
1547
|
parsed.searchParams.get("namespace") ?? undefined,
|
|
@@ -1521,16 +1552,19 @@ export class EngramAccessHttpServer {
|
|
|
1521
1552
|
}
|
|
1522
1553
|
|
|
1523
1554
|
if (req.method === "GET" && pathname === "/engram/v1/maintenance") {
|
|
1555
|
+
void getOperation("maintenance_status"); // boundary dispatch (issue #1525)
|
|
1524
1556
|
this.respondJson(res, 200, await this.service.maintenance(parsed.searchParams.get("namespace") ?? undefined, this.resolveRequestPrincipal(req)));
|
|
1525
1557
|
return;
|
|
1526
1558
|
}
|
|
1527
1559
|
|
|
1528
1560
|
if (req.method === "GET" && pathname === "/engram/v1/quality") {
|
|
1561
|
+
void getOperation("quality_status"); // boundary dispatch (issue #1525)
|
|
1529
1562
|
this.respondJson(res, 200, await this.service.quality(parsed.searchParams.get("namespace") ?? undefined, this.resolveRequestPrincipal(req)));
|
|
1530
1563
|
return;
|
|
1531
1564
|
}
|
|
1532
1565
|
|
|
1533
1566
|
if (req.method === "GET" && pathname === "/engram/v1/trust-zones/status") {
|
|
1567
|
+
void getOperation("trust_zones_status"); // boundary dispatch (issue #1525)
|
|
1534
1568
|
this.respondJson(
|
|
1535
1569
|
res,
|
|
1536
1570
|
200,
|
|
@@ -1543,6 +1577,7 @@ export class EngramAccessHttpServer {
|
|
|
1543
1577
|
// scoped via the same resolver used by recall/trust-zones so cross-
|
|
1544
1578
|
// tenant reads aren't possible (CLAUDE.md rule 42).
|
|
1545
1579
|
if (req.method === "GET" && pathname === "/engram/v1/procedural/stats") {
|
|
1580
|
+
void getOperation("procedural_stats"); // boundary dispatch (issue #1525)
|
|
1546
1581
|
const namespaceParam = parsed.searchParams.get("namespace");
|
|
1547
1582
|
this.respondJson(
|
|
1548
1583
|
res,
|
|
@@ -1563,6 +1598,7 @@ export class EngramAccessHttpServer {
|
|
|
1563
1598
|
}
|
|
1564
1599
|
|
|
1565
1600
|
if (req.method === "GET" && pathname === "/engram/v1/trust-zones/records") {
|
|
1601
|
+
void getOperation("trust_zones_records"); // boundary dispatch (issue #1525)
|
|
1566
1602
|
const limit = parseStrictIntegerQuery(parsed.searchParams.get("limit"), "limit", 25, 1);
|
|
1567
1603
|
const offset = parseStrictIntegerQuery(parsed.searchParams.get("offset"), "offset", 0, 0);
|
|
1568
1604
|
const response = await this.service.trustZoneBrowse({
|
|
@@ -1579,6 +1615,7 @@ export class EngramAccessHttpServer {
|
|
|
1579
1615
|
}
|
|
1580
1616
|
|
|
1581
1617
|
if (req.method === "POST" && pathname === "/engram/v1/review-disposition") {
|
|
1618
|
+
void getOperation("review_disposition"); // boundary dispatch (issue #1525)
|
|
1582
1619
|
const body = await this.readValidatedBody(req, "reviewDisposition");
|
|
1583
1620
|
this.ensureWriteRateLimitAvailable();
|
|
1584
1621
|
const response = await this.service.reviewDisposition({
|
|
@@ -1596,6 +1633,7 @@ export class EngramAccessHttpServer {
|
|
|
1596
1633
|
}
|
|
1597
1634
|
|
|
1598
1635
|
if (req.method === "POST" && pathname === "/engram/v1/trust-zones/promote") {
|
|
1636
|
+
void getOperation("trust_zones_promote"); // boundary dispatch (issue #1525)
|
|
1599
1637
|
const body = await this.readValidatedBody(req, "trustZonePromote");
|
|
1600
1638
|
const dryRun = body.dryRun === true;
|
|
1601
1639
|
if (!dryRun) {
|
|
@@ -1619,6 +1657,7 @@ export class EngramAccessHttpServer {
|
|
|
1619
1657
|
}
|
|
1620
1658
|
|
|
1621
1659
|
if (req.method === "POST" && pathname === "/engram/v1/trust-zones/demo-seed") {
|
|
1660
|
+
void getOperation("trust_zones_demo_seed"); // boundary dispatch (issue #1525)
|
|
1622
1661
|
const body = await this.readValidatedBody(req, "trustZoneDemoSeed");
|
|
1623
1662
|
const dryRun = body.dryRun === true;
|
|
1624
1663
|
if (!dryRun) {
|
|
@@ -1640,6 +1679,7 @@ export class EngramAccessHttpServer {
|
|
|
1640
1679
|
|
|
1641
1680
|
// Citation usage tracking (issue #379)
|
|
1642
1681
|
if (req.method === "POST" && pathname === "/v1/citations/observed") {
|
|
1682
|
+
void getOperation("citations_observed"); // boundary dispatch (issue #1525)
|
|
1643
1683
|
const body = await this.readJsonBody(req);
|
|
1644
1684
|
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
1645
1685
|
throw new HttpError(400, "request body must be a JSON object", "invalid_body");
|
|
@@ -1711,6 +1751,7 @@ export class EngramAccessHttpServer {
|
|
|
1711
1751
|
|
|
1712
1752
|
// ── Contradiction Review (issue #520) ─────────────────────────────────────
|
|
1713
1753
|
if (req.method === "GET" && pathname === "/engram/v1/review/contradictions") {
|
|
1754
|
+
void getOperation("review_list"); // boundary dispatch (issue #1525)
|
|
1714
1755
|
const VALID_FILTERS = new Set(["all", "unresolved", "contradicts", "independent", "duplicates", "needs-user"]);
|
|
1715
1756
|
const rawFilter = parsed.searchParams.get("filter") ?? "unresolved";
|
|
1716
1757
|
if (!VALID_FILTERS.has(rawFilter)) {
|
|
@@ -1740,6 +1781,7 @@ export class EngramAccessHttpServer {
|
|
|
1740
1781
|
}
|
|
1741
1782
|
|
|
1742
1783
|
if (req.method === "GET" && pathname.startsWith("/engram/v1/review/contradictions/")) {
|
|
1784
|
+
void getOperation("contradiction_detail"); // boundary dispatch (issue #1525)
|
|
1743
1785
|
const pairId = pathname.split("/").pop() ?? "";
|
|
1744
1786
|
const { readPair } = await import("./contradiction/contradiction-review.js");
|
|
1745
1787
|
const pair = readPair(this.service.memoryDir, pairId);
|
|
@@ -1758,6 +1800,7 @@ export class EngramAccessHttpServer {
|
|
|
1758
1800
|
}
|
|
1759
1801
|
|
|
1760
1802
|
if (req.method === "POST" && pathname === "/engram/v1/review/resolve") {
|
|
1803
|
+
void getOperation("review_resolve"); // boundary dispatch (issue #1525)
|
|
1761
1804
|
const body = await this.readJsonBody(req) as Record<string, unknown>;
|
|
1762
1805
|
const pairId = typeof body.pairId === "string" ? body.pairId : "";
|
|
1763
1806
|
const verb = typeof body.verb === "string" ? body.verb : "";
|
|
@@ -1795,6 +1838,7 @@ export class EngramAccessHttpServer {
|
|
|
1795
1838
|
// params so the surface stays cacheable; invalid values yield 400 with
|
|
1796
1839
|
// a descriptive body (CLAUDE.md rule 51 — never silently default).
|
|
1797
1840
|
if (req.method === "GET" && pathname === "/engram/v1/graph/snapshot") {
|
|
1841
|
+
void getOperation("graph_snapshot"); // boundary dispatch (issue #1525)
|
|
1798
1842
|
const limitRaw = parsed.searchParams.get("limit");
|
|
1799
1843
|
let limit: number | undefined;
|
|
1800
1844
|
if (limitRaw !== null && limitRaw.length > 0) {
|
|
@@ -1887,6 +1931,7 @@ export class EngramAccessHttpServer {
|
|
|
1887
1931
|
}
|
|
1888
1932
|
|
|
1889
1933
|
if (req.method === "POST" && pathname === "/engram/v1/contradiction-scan") {
|
|
1934
|
+
void getOperation("contradiction_scan_run"); // boundary dispatch (issue #1525)
|
|
1890
1935
|
const body = await this.readJsonBody(req) as Record<string, unknown>;
|
|
1891
1936
|
const { runContradictionScan } = await import("./contradiction/contradiction-scan.js");
|
|
1892
1937
|
const principal = this.resolveRequestPrincipal(req);
|
|
@@ -1925,6 +1970,7 @@ export class EngramAccessHttpServer {
|
|
|
1925
1970
|
// The stream sends a heartbeat `data: {"type":"heartbeat"}\n\n` every
|
|
1926
1971
|
// 25 s so load balancers and proxies don't time out idle connections.
|
|
1927
1972
|
if (req.method === "GET" && pathname === "/engram/v1/graph/events") {
|
|
1973
|
+
void getOperation("graph_events"); // boundary dispatch (issue #1525)
|
|
1928
1974
|
await this.handleGraphEventsSSE(req, res);
|
|
1929
1975
|
return;
|
|
1930
1976
|
}
|
|
@@ -1934,6 +1980,7 @@ export class EngramAccessHttpServer {
|
|
|
1934
1980
|
// Read-only; namespace-aware via resolveRequestPrincipal so cross-tenant
|
|
1935
1981
|
// reads are not possible (CLAUDE.md rule 42).
|
|
1936
1982
|
if (req.method === "GET" && pathname === "/engram/v1/console/state") {
|
|
1983
|
+
void getOperation("console_state"); // boundary dispatch (issue #1525)
|
|
1937
1984
|
const namespace = parsed.searchParams.get("namespace") ?? undefined;
|
|
1938
1985
|
const snapshot = await this.service.consoleState(namespace, this.resolveRequestPrincipal(req));
|
|
1939
1986
|
this.respondJson(res, 200, snapshot);
|
|
@@ -1947,6 +1994,7 @@ export class EngramAccessHttpServer {
|
|
|
1947
1994
|
// DELETE /engram/v1/peers/:id?forget=true — destructive full purge (issue #679 completion)
|
|
1948
1995
|
// GET /engram/v1/peers/:id/profile — get peer profile
|
|
1949
1996
|
if (req.method === "GET" && pathname === "/engram/v1/peers") {
|
|
1997
|
+
void getOperation("peer_list"); // boundary dispatch (issue #1525)
|
|
1950
1998
|
const result = await this.service.peerList();
|
|
1951
1999
|
this.respondJson(res, 200, result);
|
|
1952
2000
|
return;
|
|
@@ -1954,6 +2002,7 @@ export class EngramAccessHttpServer {
|
|
|
1954
2002
|
|
|
1955
2003
|
const peerProfileMatch = /^\/engram\/v1\/peers\/([^/]+)\/profile$/.exec(pathname);
|
|
1956
2004
|
if (peerProfileMatch) {
|
|
2005
|
+
void getOperation("peer_profile_get"); // boundary dispatch (issue #1525)
|
|
1957
2006
|
if (req.method !== "GET") {
|
|
1958
2007
|
this.respondJson(res, 405, { error: "method_not_allowed", code: "method_not_allowed" });
|
|
1959
2008
|
return;
|
|
@@ -1973,6 +2022,7 @@ export class EngramAccessHttpServer {
|
|
|
1973
2022
|
const peerId = decodePeerIdSegment(peerIdMatch[1] ?? "");
|
|
1974
2023
|
|
|
1975
2024
|
if (req.method === "GET") {
|
|
2025
|
+
void getOperation("peer_get"); // boundary dispatch (issue #1525)
|
|
1976
2026
|
const result = await this.service.peerGet(peerId);
|
|
1977
2027
|
if (!result.found) {
|
|
1978
2028
|
this.respondJson(res, 404, { error: "peer_not_found", code: "peer_not_found" });
|
|
@@ -1983,6 +2033,7 @@ export class EngramAccessHttpServer {
|
|
|
1983
2033
|
}
|
|
1984
2034
|
|
|
1985
2035
|
if (req.method === "PUT") {
|
|
2036
|
+
void getOperation("peer_set"); // boundary dispatch (issue #1525)
|
|
1986
2037
|
const body = await this.readJsonBody(req) as Record<string, unknown>;
|
|
1987
2038
|
// Reject malformed types up front rather than silently dropping them
|
|
1988
2039
|
// to undefined and letting peerSet fall back to defaults
|
|
@@ -2011,6 +2062,7 @@ export class EngramAccessHttpServer {
|
|
|
2011
2062
|
}
|
|
2012
2063
|
|
|
2013
2064
|
if (req.method === "DELETE") {
|
|
2065
|
+
void getOperation("peer_delete"); // boundary dispatch (issue #1525)
|
|
2014
2066
|
// `?forget=true` triggers the destructive full-purge path (issue #679
|
|
2015
2067
|
// completion). The caller must also pass `confirm=yes` in the request
|
|
2016
2068
|
// body; absent confirmation yields 400. Plain DELETE (no ?forget) keeps
|
|
@@ -2043,6 +2095,7 @@ export class EngramAccessHttpServer {
|
|
|
2043
2095
|
// ── Dreams telemetry (issue #678 PR 3+4) ──────────────────────────────────
|
|
2044
2096
|
|
|
2045
2097
|
if (req.method === "GET" && pathname === "/engram/v1/dreams/status") {
|
|
2098
|
+
void getOperation("dreams_status"); // boundary dispatch (issue #1525)
|
|
2046
2099
|
const { normalizeDreamsStatusWindowHours } = await import("./maintenance/dreams-ledger.js");
|
|
2047
2100
|
const windowHoursRaw = parsed.searchParams.get("windowHours");
|
|
2048
2101
|
let windowHours: number;
|
|
@@ -2066,6 +2119,7 @@ export class EngramAccessHttpServer {
|
|
|
2066
2119
|
}
|
|
2067
2120
|
|
|
2068
2121
|
if (req.method === "POST" && pathname === "/engram/v1/dreams/run") {
|
|
2122
|
+
void getOperation("dreams_run"); // boundary dispatch (issue #1525)
|
|
2069
2123
|
const body = await this.readJsonBody(req) as Record<string, unknown>;
|
|
2070
2124
|
const VALID_PHASES = ["lightSleep", "rem", "deepSleep"] as const;
|
|
2071
2125
|
const phase = typeof body.phase === "string" ? body.phase : undefined;
|