@remnic/core 9.3.701 → 9.3.702
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 +7 -7
- package/dist/access-boundary.js +15 -12
- package/dist/access-cli.js +36 -33
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +7 -7
- package/dist/access-http.js +18 -15
- package/dist/access-mcp.d.ts +7 -7
- package/dist/access-mcp.js +17 -14
- package/dist/access-operations.d.ts +7 -7
- package/dist/access-operations.js +16 -13
- package/dist/{access-service-CGVWK6lZ.d.ts → access-service-COCzhgEL.d.ts} +397 -19
- package/dist/access-service.d.ts +6 -6
- package/dist/access-service.js +14 -11
- package/dist/access-surface-catalog.d.ts +7 -7
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +7 -6
- package/dist/active-recall.js.map +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +5 -5
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +6 -5
- 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/capabilities.d.ts +1 -1
- package/dist/{catalog-DBIghceA.d.ts → catalog-DxCzhjE6.d.ts} +2 -2
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +7 -6
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-YXLT4EMM.js → chunk-4463LUIE.js} +12 -2
- package/dist/chunk-4463LUIE.js.map +1 -0
- package/dist/{chunk-R5DB26G6.js → chunk-4SBW47WK.js} +9 -23
- package/dist/chunk-4SBW47WK.js.map +1 -0
- package/dist/{chunk-KF4TXW7Z.js → chunk-5VXVXJH6.js} +149 -6
- package/dist/{chunk-KF4TXW7Z.js.map → chunk-5VXVXJH6.js.map} +1 -1
- package/dist/{chunk-ODTWHSY2.js → chunk-64XXOQRW.js} +2 -2
- package/dist/{chunk-ZT7B64BE.js → chunk-6TAETM63.js} +2 -2
- package/dist/{chunk-HF4N43Q7.js → chunk-6VVP6NK7.js} +2 -2
- package/dist/{chunk-FN2SM5SN.js → chunk-ABCGDW3A.js} +75 -12
- package/dist/chunk-ABCGDW3A.js.map +1 -0
- package/dist/{chunk-7TAQEPLE.js → chunk-AMNLZ6SF.js} +2 -2
- package/dist/{chunk-KS7WQ4BZ.js → chunk-CZJ6QSKG.js} +3 -3
- package/dist/{chunk-27LQPUMZ.js → chunk-EOOVJK2U.js} +3 -3
- package/dist/{chunk-QP37KL5H.js → chunk-EYJD6KIO.js} +2 -2
- package/dist/{chunk-WFEZUGU5.js → chunk-EZR35XHX.js} +2 -2
- package/dist/{chunk-UU6MVCJ6.js → chunk-FIOYURII.js} +32 -25
- package/dist/chunk-FIOYURII.js.map +1 -0
- package/dist/{chunk-JO3E5VGS.js → chunk-FVI5B7DE.js} +2 -2
- package/dist/{chunk-SFMRLXIV.js → chunk-GFIARMA7.js} +15 -7
- package/dist/chunk-GFIARMA7.js.map +1 -0
- package/dist/{chunk-PONNZ54D.js → chunk-GY3SKOS4.js} +4 -4
- package/dist/{chunk-U33LWTQQ.js → chunk-HV57RHMD.js} +4 -4
- package/dist/{chunk-IKNQAGBV.js → chunk-IX3UQT4H.js} +1 -1
- package/dist/{chunk-IKNQAGBV.js.map → chunk-IX3UQT4H.js.map} +1 -1
- package/dist/{chunk-IYOPIG3E.js → chunk-IX72AAMZ.js} +2 -2
- package/dist/{chunk-JKOKX3PS.js → chunk-JMA4RYRN.js} +2 -2
- package/dist/{chunk-DEDQXIDL.js → chunk-JTKFZMZ7.js} +2 -2
- package/dist/{chunk-OLOYQZFB.js → chunk-KC6TCAWV.js} +5 -5
- package/dist/{chunk-ROZJACKP.js → chunk-KKK7YTYN.js} +4 -1
- package/dist/chunk-KKK7YTYN.js.map +1 -0
- package/dist/{chunk-EC2AYKRX.js → chunk-L6W77GWW.js} +10 -24
- package/dist/chunk-L6W77GWW.js.map +1 -0
- package/dist/{chunk-ED35D32I.js → chunk-LQ4J7ELC.js} +2 -2
- package/dist/chunk-LUPVCGYK.js +63 -0
- package/dist/chunk-LUPVCGYK.js.map +1 -0
- package/dist/{chunk-TFVVONWD.js → chunk-MBUM2Y3L.js} +2 -2
- package/dist/{chunk-T5QAZIBO.js → chunk-MOXFPLD6.js} +3 -3
- package/dist/{chunk-XTIRCSIH.js → chunk-MXEWQKM7.js} +2 -2
- package/dist/{chunk-ZYNMX6IU.js → chunk-NUIJEGVD.js} +6 -6
- package/dist/{chunk-FUCJAZ25.js → chunk-OXEAMU42.js} +529 -9
- package/dist/chunk-OXEAMU42.js.map +1 -0
- package/dist/{chunk-YO4MBK3I.js → chunk-QGJAGC2J.js} +2 -2
- package/dist/{chunk-ISLJ5WIM.js → chunk-QIMFOCSH.js} +2 -2
- package/dist/{chunk-IJEZMWKA.js → chunk-SFOAQQDJ.js} +3 -3
- package/dist/{chunk-HRUULBBV.js → chunk-SHRRWOVY.js} +81 -4
- package/dist/chunk-SHRRWOVY.js.map +1 -0
- package/dist/{chunk-NINRTFSV.js → chunk-SINGJCUR.js} +5 -5
- package/dist/{chunk-ZPQVJEVQ.js → chunk-SK2CR6MW.js} +146 -2
- package/dist/chunk-SK2CR6MW.js.map +1 -0
- package/dist/{chunk-6W2D6FGG.js → chunk-TGAHHCB6.js} +2 -2
- package/dist/{chunk-D75JXBV4.js → chunk-WN4GHSDH.js} +2 -2
- package/dist/{chunk-K4DWSPMW.js → chunk-WRGPE6AW.js} +2 -2
- package/dist/{chunk-4HIAWLA2.js → chunk-XGMCUY5P.js} +60 -114
- package/dist/chunk-XGMCUY5P.js.map +1 -0
- package/dist/{chunk-SDPDU2PM.js → chunk-YTMDF6S7.js} +2 -2
- package/dist/{chunk-MNU5G4TK.js → chunk-Z7XEIAV4.js} +2 -2
- package/dist/{chunk-HXHKLVAS.js → chunk-ZCEI242W.js} +23 -23
- package/dist/{cli-D3XeenwN.d.ts → cli-BM4xQPp4.d.ts} +3 -3
- package/dist/cli.d.ts +7 -7
- package/dist/cli.js +33 -32
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +6 -5
- 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 +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +6 -5
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +7 -6
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +2 -2
- 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 +6 -5
- package/dist/entity-schema.d.ts +1 -1
- package/dist/event-order-recall.js +2 -1
- package/dist/explicit-capture.d.ts +5 -5
- package/dist/explicit-capture.js +2 -2
- package/dist/explicit-cue-recall.js +2 -1
- package/dist/extraction-faithfulness.d.ts +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 +14 -1
- package/dist/extraction.js +5 -3
- 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 +123 -123
- package/dist/index.js +53 -52
- 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 +6 -5
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +6 -5
- package/dist/maintenance/rebuild-memory-projection.js +7 -6
- package/dist/mcp-memory-inspector-app.d.ts +7 -7
- 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 +2 -2
- package/dist/namespaces/migrate.js +7 -6
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +6 -5
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +12 -11
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +8 -7
- package/dist/{orchestrator-BzMCZlKn.d.ts → orchestrator-C9CDWAm6.d.ts} +4 -4
- package/dist/orchestrator.d.ts +5 -5
- package/dist/orchestrator.js +29 -27
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +36 -2
- package/dist/provenance.js +5 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +1 -1
- 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-pipeline-stages.d.ts +15 -0
- package/dist/recall-pipeline-stages.js +3 -56
- package/dist/recall-pipeline-stages.js.map +1 -1
- 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/resolve-auth-token.d.ts +1 -1
- package/dist/response-guidance-recall.js +2 -1
- package/dist/resume-bundles.js +7 -5
- 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 +19 -0
- package/dist/schemas.js +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-DJR8_DMQ.d.ts → semantic-SLAa_prH.d.ts} +1 -1
- package/dist/{semantic-consolidation-BtUfv-AL.d.ts → semantic-consolidation-DgFXyALl.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +7 -6
- package/dist/semantic-rule-promotion.js +6 -5
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +6 -5
- 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 +13 -1
- package/dist/storage.js +5 -4
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/targeted-fact-recall.js +2 -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/transcript.js +2 -2
- package/dist/{types-PuiPZ9iE.d.ts → types-MWKPZnM0.d.ts} +25 -1
- 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 +6 -5
- package/package.json +2 -2
- package/src/access-http.ts +162 -0
- package/src/access-service.ts +215 -0
- package/src/admin/admin-surfaces.test.ts +458 -0
- package/src/admin/admin-surfaces.ts +819 -0
- package/src/event-order-recall.test.ts +53 -0
- package/src/event-order-recall.ts +61 -37
- package/src/explicit-cue-recall.ts +21 -1
- package/src/extraction.ts +91 -6
- package/src/orchestrator.ts +46 -5
- package/src/provenance-extraction.test.ts +838 -0
- package/src/provenance.ts +413 -0
- package/src/recall-pipeline-parity.test.ts +288 -0
- package/src/recall-pipeline-stages.test.ts +43 -0
- package/src/recall-pipeline-stages.ts +22 -0
- package/src/response-guidance-recall.ts +32 -36
- package/src/schemas.ts +7 -0
- package/src/storage.ts +23 -0
- package/src/targeted-fact-recall.ts +25 -32
- package/src/types.ts +24 -0
- package/dist/chunk-4HIAWLA2.js.map +0 -1
- package/dist/chunk-EC2AYKRX.js.map +0 -1
- package/dist/chunk-FN2SM5SN.js.map +0 -1
- package/dist/chunk-FUCJAZ25.js.map +0 -1
- package/dist/chunk-HRUULBBV.js.map +0 -1
- package/dist/chunk-R5DB26G6.js.map +0 -1
- package/dist/chunk-ROZJACKP.js.map +0 -1
- package/dist/chunk-SFMRLXIV.js.map +0 -1
- package/dist/chunk-UU6MVCJ6.js.map +0 -1
- package/dist/chunk-YXLT4EMM.js.map +0 -1
- package/dist/chunk-ZPQVJEVQ.js.map +0 -1
- /package/dist/{chunk-ODTWHSY2.js.map → chunk-64XXOQRW.js.map} +0 -0
- /package/dist/{chunk-ZT7B64BE.js.map → chunk-6TAETM63.js.map} +0 -0
- /package/dist/{chunk-HF4N43Q7.js.map → chunk-6VVP6NK7.js.map} +0 -0
- /package/dist/{chunk-7TAQEPLE.js.map → chunk-AMNLZ6SF.js.map} +0 -0
- /package/dist/{chunk-KS7WQ4BZ.js.map → chunk-CZJ6QSKG.js.map} +0 -0
- /package/dist/{chunk-27LQPUMZ.js.map → chunk-EOOVJK2U.js.map} +0 -0
- /package/dist/{chunk-QP37KL5H.js.map → chunk-EYJD6KIO.js.map} +0 -0
- /package/dist/{chunk-WFEZUGU5.js.map → chunk-EZR35XHX.js.map} +0 -0
- /package/dist/{chunk-JO3E5VGS.js.map → chunk-FVI5B7DE.js.map} +0 -0
- /package/dist/{chunk-PONNZ54D.js.map → chunk-GY3SKOS4.js.map} +0 -0
- /package/dist/{chunk-U33LWTQQ.js.map → chunk-HV57RHMD.js.map} +0 -0
- /package/dist/{chunk-IYOPIG3E.js.map → chunk-IX72AAMZ.js.map} +0 -0
- /package/dist/{chunk-JKOKX3PS.js.map → chunk-JMA4RYRN.js.map} +0 -0
- /package/dist/{chunk-DEDQXIDL.js.map → chunk-JTKFZMZ7.js.map} +0 -0
- /package/dist/{chunk-OLOYQZFB.js.map → chunk-KC6TCAWV.js.map} +0 -0
- /package/dist/{chunk-ED35D32I.js.map → chunk-LQ4J7ELC.js.map} +0 -0
- /package/dist/{chunk-TFVVONWD.js.map → chunk-MBUM2Y3L.js.map} +0 -0
- /package/dist/{chunk-T5QAZIBO.js.map → chunk-MOXFPLD6.js.map} +0 -0
- /package/dist/{chunk-XTIRCSIH.js.map → chunk-MXEWQKM7.js.map} +0 -0
- /package/dist/{chunk-ZYNMX6IU.js.map → chunk-NUIJEGVD.js.map} +0 -0
- /package/dist/{chunk-YO4MBK3I.js.map → chunk-QGJAGC2J.js.map} +0 -0
- /package/dist/{chunk-ISLJ5WIM.js.map → chunk-QIMFOCSH.js.map} +0 -0
- /package/dist/{chunk-IJEZMWKA.js.map → chunk-SFOAQQDJ.js.map} +0 -0
- /package/dist/{chunk-NINRTFSV.js.map → chunk-SINGJCUR.js.map} +0 -0
- /package/dist/{chunk-6W2D6FGG.js.map → chunk-TGAHHCB6.js.map} +0 -0
- /package/dist/{chunk-D75JXBV4.js.map → chunk-WN4GHSDH.js.map} +0 -0
- /package/dist/{chunk-K4DWSPMW.js.map → chunk-WRGPE6AW.js.map} +0 -0
- /package/dist/{chunk-SDPDU2PM.js.map → chunk-YTMDF6S7.js.map} +0 -0
- /package/dist/{chunk-MNU5G4TK.js.map → chunk-Z7XEIAV4.js.map} +0 -0
- /package/dist/{chunk-HXHKLVAS.js.map → chunk-ZCEI242W.js.map} +0 -0
|
@@ -2946,6 +2946,30 @@ interface ExtractedFact {
|
|
|
2946
2946
|
* "no verified span" and skip gracefully.
|
|
2947
2947
|
*/
|
|
2948
2948
|
sources?: ProvenanceSource[];
|
|
2949
|
+
/**
|
|
2950
|
+
* Coarse provenance strength tag (issue #1575 PR 2). Set by the extraction
|
|
2951
|
+
* validator: "verified" when the quote was located in source turns,
|
|
2952
|
+
* "unverified" when the quote survived but no offsets were recoverable.
|
|
2953
|
+
* Absent when `provenance.enabled` is false or no quote was provided —
|
|
2954
|
+
* readers treat absent as "none" (rule 34 spirit).
|
|
2955
|
+
*/
|
|
2956
|
+
provenance?: "verified" | "unverified" | "none";
|
|
2957
|
+
/**
|
|
2958
|
+
* Transient LLM-provided supporting quote (issue #1575 PR 2). Consumed by
|
|
2959
|
+
* the post-parse validator to build `sources`, then stripped before the
|
|
2960
|
+
* fact reaches persistence. NEVER included in content-hash dedup (rule 23 /
|
|
2961
|
+
* checklist §13). Absent on facts that have already passed the validator.
|
|
2962
|
+
*/
|
|
2963
|
+
quote?: string;
|
|
2964
|
+
/**
|
|
2965
|
+
* Transient requireSpans signal (issue #1575 PR 2). Set by the provenance
|
|
2966
|
+
* validator (`ProvenanceBuildResult.requireSpansPending`) when
|
|
2967
|
+
* `provenance.requireSpans` is enabled and the quote could not be located
|
|
2968
|
+
* in any source turn. Read by the persist path to route the fact to
|
|
2969
|
+
* `pending_review` instead of `active`. Stripped before persistence —
|
|
2970
|
+
* it never reaches frontmatter (chatgpt-codex-connector thread 4xB).
|
|
2971
|
+
*/
|
|
2972
|
+
requireSpansPending?: boolean;
|
|
2949
2973
|
promptedByQuestion?: string;
|
|
2950
2974
|
/**
|
|
2951
2975
|
* Whether this fact is project-scoped or globally applicable.
|
|
@@ -3455,4 +3479,4 @@ interface HourlySummary {
|
|
|
3455
3479
|
generatedAt: string;
|
|
3456
3480
|
}
|
|
3457
3481
|
|
|
3458
|
-
export { type EntityStructuredSection as $, type ActiveRecallChatType as A, type BehaviorSignalEvent as B, type CalendarSource as C, type SecretRef as D, type EntityFile as E, type FaithfulnessFrontmatter as F, type GatewayConfig as G, type HourlySummary as H, type IdentityInjectionMode as I, type AgentAccessAuthToken as J, type CompressionGuidelineOptimizerEventCounts as K, type LiveConnectorsConfig as L, type MemoryCategory as M, type CompressionGuidelineOptimizerActionSummary as N, type CompressionGuidelineOptimizerRuleUpdate as O, type PluginConfig as P, type QmdSearchResult as Q, type RecallTierExplain as R, type SessionObserverBandConfig as S, type TranscriptEntry as T, type MemoryActionType as U, type VerificationState as V, type MemoryActionEvent as W, type CompressionGuidelineOptimizerState as X, type EntityMention as Y, type EntitySchemaDefinition as Z, type EntitySchemaSectionDefinition as _, type ActiveRecallQueryMode as a, type
|
|
3482
|
+
export { type EntityStructuredSection as $, type ActiveRecallChatType as A, type BehaviorSignalEvent as B, type CalendarSource as C, type SecretRef as D, type EntityFile as E, type FaithfulnessFrontmatter as F, type GatewayConfig as G, type HourlySummary as H, type IdentityInjectionMode as I, type AgentAccessAuthToken as J, type CompressionGuidelineOptimizerEventCounts as K, type LiveConnectorsConfig as L, type MemoryCategory as M, type CompressionGuidelineOptimizerActionSummary as N, type CompressionGuidelineOptimizerRuleUpdate as O, type PluginConfig as P, type QmdSearchResult as Q, type RecallTierExplain as R, type SessionObserverBandConfig as S, type TranscriptEntry as T, type MemoryActionType as U, type VerificationState as V, type MemoryActionEvent as W, type CompressionGuidelineOptimizerState as X, type EntityMention as Y, type EntitySchemaDefinition as Z, type EntitySchemaSectionDefinition as _, type ActiveRecallQueryMode as a, type MemoryObservation as a$, type ExtractionResult as a0, type ConsolidationResult as a1, type DaySummaryResult as a2, type ContinuityIncidentRecord as a3, type ContinuityIncidentCloseInput as a4, type ContinuityIncidentOpenInput as a5, type ContinuityImprovementLoop as a6, type ContinuityLoopReviewInput as a7, type ContinuityLoopUpsertInput as a8, type ImportanceScore as a9, type WearableSourceConnector as aA, type WearablesConfig as aB, type WearableSyncSummary as aC, type WearableSourceStatus as aD, type WearableDayTranscript as aE, type WearableCorrectionRule as aF, type CodingContext as aG, type BootstrapOptions as aH, type BootstrapResult as aI, type ConsolidationObservation as aJ, type EntityTimelineEntry as aK, type ScopeProfileLayerId as aL, type ScopeProfilePromotionTarget as aM, type ScopeProfileConfig as aN, type DreamsStatusResult as aO, type DreamsPhase as aP, type DreamsRunResult as aQ, type CodingModeConfig as aR, type WearableCleanupSettings as aS, type WearableDayTranscriptMeta as aT, type BriefingConfig as aU, type BriefingOpenCommitment as aV, type BriefingWindow as aW, type CodexCompatConfig as aX, DEFAULT_RECALL_DISCLOSURE as aY, type ExtractedFact as aZ, type MemoryActionEligibilitySource as a_, type MemoryIntent as aa, type QmdSearchExplain as ab, type MemoryActionEligibilityContext as ac, type MemoryActionPolicyResult as ad, type MemoryLifecycleEventType as ae, type MemoryLifecycleStateSummary as af, type ModelProviderConfig as ag, type NativeKnowledgeConfig as ah, type ProvenanceSource as ai, type ProvenanceConfig as aj, type RetrievalTier as ak, type SignalScanResult as al, type ConversationThread as am, type TopicScore as an, type MemoryLink as ao, type BufferState as ap, type MetaState as aq, type FileHygieneConfig as ar, type EntityRelationship as as, type EntityActivityEntry as at, type AccessTrackingEntry as au, type MemorySummary as av, type WearableConversation as aw, type WearableSourceSettings as ax, type WearableNativeMemory as ay, type WearableMemoryMode as az, type ActiveRecallPromptStyle as b, type NativeKnowledgeObsidianVaultConfig as b$, type MemoryScope as b0, RECALL_DISCLOSURE_LEVELS as b1, type WearableAuthCheck as b2, type WearableFetchOptions as b3, type WearableFetchPage as b4, type WearableNativeMemoryPage as b5, type WearableTranscriptSegment as b6, isRecallDisclosure as b7, type AgentAccessHttpConfig as b8, type AgentDefaultsConfig as b9, type DreamsPhaseStatus as bA, type DreamsPhasesConfig as bB, type DreamsRemConfig as bC, type EngramTraceEvent as bD, type ExtractedProcedureStep as bE, type ExtractedQuestion as bF, type ExtractedReasoningTrace as bG, type ExtractedReasoningTraceStep as bH, type ExtractedRelationship as bI, type ExtractionPassSource as bJ, type GitHubLiveConnectorConfig as bK, type GmailLiveConnectorConfig as bL, type GoogleDriveLiveConnectorConfig as bM, type HeartbeatConfig as bN, type HeartbeatDetectionMode as bO, type LlmTraceCallback as bP, type LlmTraceEvent as bQ, type MemoryActionOutcome as bR, type MemoryActionPolicyDecision as bS, type MemoryActionStatus as bT, type MemoryLinkType as bU, type MemoryOsPresetName as bV, type ModelApi as bW, type ModelDefinitionConfig as bX, type ModelProviderAuthMode as bY, type NamespacePolicy as bZ, type NativeKnowledgeFolderRuleConfig as b_, type AgentPersona as ba, type BehaviorLoopAdjustment as bb, type BehaviorSignalDirection as bc, type BehaviorSignalType as bd, type BriefingCalendarSourceError as be, type BufferEntryState as bf, type CaptureMode as bg, type CodexCliReasoningEffort as bh, type CodexCompactionFlushMode as bi, type CodexConnectorConfig as bj, type CodingKnowledgeConfig as bk, type CompressionGuidelineActivationState as bl, type CompressionGuidelineOptimizerSourceWindow as bm, type ConfidenceTier as bn, type ConsolidationAction as bo, type ConsolidationItem as bp, type ContinuityIncidentState as bq, type ContinuityLoopCadence as br, type ContinuityLoopStatus as bs, type ContradictionScanConfig as bt, type CronConversationRecallMode as bu, type CronRecallMode as bv, type DreamingConfig as bw, type DreamingNarrativePromptStyle as bx, type DreamsDeepSleepConfig as by, type DreamsLightSleepConfig as bz, type ActiveRecallThinking as c, type NativeKnowledgeOpenClawWorkspaceConfig as c0, type NotionLiveConnectorConfig as c1, type PrincipalFromSessionKeyMode as c2, type PrincipalRule as c3, type ProceduralConfig as c4, type QuestionEntry as c5, type ReasoningEffort as c6, type RecallPipelineConfig as c7, type RecallSectionConfig as c8, type RecallTraceEvent as c9, type RelevanceFeedback as ca, SPECULATIVE_TTL_DAYS as cb, type ScopeProfileAutoPromoteConfig as cc, type ScopeProfileTeamProjectConfig as cd, type ScopeTeamConfig as ce, type ScoredEntity as cf, type SemanticChunkingConfigShape as cg, type SignalLevel as ch, type SlotBehaviorConfig as ci, type SlotMismatchMode as cj, type TriggerMode as ck, confidenceTier as cl, type ActiveRecallModelFallbackPolicy as d, type BehaviorLoopPolicyState as e, type AgentPersonaModelConfig as f, type MemoryFile as g, type MemoryStatus as h, type RecallPlanMode as i, type RecallDisclosure as j, type MemoryFrontmatter as k, type MemoryProjectionCurrentState as l, type MemoryLifecycleEvent as m, type BriefingSections as n, type BriefingFollowup as o, type BriefingFocus as p, type CalendarEvent as q, type BriefingActiveThread as r, type BriefingResult as s, type BriefingRecentEntity as t, type BufferTurn as u, type Checkpoint as v, type LifecycleState as w, type PolicyClass as x, type ImportanceLevel as y, type BufferSurpriseEvent as z };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './types-ByK7T3L6.js';
|
|
2
2
|
import './index-DJ9QWMw-.js';
|
|
3
|
-
export { au as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, J as AgentAccessAuthToken,
|
|
3
|
+
export { au as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, J as AgentAccessAuthToken, b8 as AgentAccessHttpConfig, b9 as AgentDefaultsConfig, ba as AgentPersona, f as AgentPersonaModelConfig, bb as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, bc as BehaviorSignalDirection, B as BehaviorSignalEvent, bd as BehaviorSignalType, aH as BootstrapOptions, aI as BootstrapResult, r as BriefingActiveThread, be as BriefingCalendarSourceError, aU as BriefingConfig, p as BriefingFocus, o as BriefingFollowup, aV as BriefingOpenCommitment, t as BriefingRecentEntity, s as BriefingResult, n as BriefingSections, aW as BriefingWindow, bf as BufferEntryState, ap as BufferState, z as BufferSurpriseEvent, u as BufferTurn, q as CalendarEvent, C as CalendarSource, bg as CaptureMode, v as Checkpoint, bh as CodexCliReasoningEffort, bi as CodexCompactionFlushMode, aX as CodexCompatConfig, bj as CodexConnectorConfig, aG as CodingContext, bk as CodingKnowledgeConfig, aR as CodingModeConfig, bl as CompressionGuidelineActivationState, N as CompressionGuidelineOptimizerActionSummary, K as CompressionGuidelineOptimizerEventCounts, O as CompressionGuidelineOptimizerRuleUpdate, bm as CompressionGuidelineOptimizerSourceWindow, X as CompressionGuidelineOptimizerState, bn as ConfidenceTier, bo as ConsolidationAction, bp as ConsolidationItem, aJ as ConsolidationObservation, a1 as ConsolidationResult, a6 as ContinuityImprovementLoop, a4 as ContinuityIncidentCloseInput, a5 as ContinuityIncidentOpenInput, a3 as ContinuityIncidentRecord, bq as ContinuityIncidentState, br as ContinuityLoopCadence, a7 as ContinuityLoopReviewInput, bs as ContinuityLoopStatus, a8 as ContinuityLoopUpsertInput, bt as ContradictionScanConfig, am as ConversationThread, bu as CronConversationRecallMode, bv as CronRecallMode, aY as DEFAULT_RECALL_DISCLOSURE, a2 as DaySummaryResult, bw as DreamingConfig, bx as DreamingNarrativePromptStyle, by as DreamsDeepSleepConfig, bz as DreamsLightSleepConfig, aP as DreamsPhase, bA as DreamsPhaseStatus, bB as DreamsPhasesConfig, bC as DreamsRemConfig, aQ as DreamsRunResult, aO as DreamsStatusResult, bD as EngramTraceEvent, at as EntityActivityEntry, E as EntityFile, Y as EntityMention, as as EntityRelationship, Z as EntitySchemaDefinition, _ as EntitySchemaSectionDefinition, $ as EntityStructuredSection, aK as EntityTimelineEntry, aZ as ExtractedFact, bE as ExtractedProcedureStep, bF as ExtractedQuestion, bG as ExtractedReasoningTrace, bH as ExtractedReasoningTraceStep, bI as ExtractedRelationship, bJ as ExtractionPassSource, a0 as ExtractionResult, F as FaithfulnessFrontmatter, ar as FileHygieneConfig, G as GatewayConfig, bK as GitHubLiveConnectorConfig, bL as GmailLiveConnectorConfig, bM as GoogleDriveLiveConnectorConfig, bN as HeartbeatConfig, bO as HeartbeatDetectionMode, H as HourlySummary, I as IdentityInjectionMode, y as ImportanceLevel, a9 as ImportanceScore, w as LifecycleState, L as LiveConnectorsConfig, bP as LlmTraceCallback, bQ as LlmTraceEvent, ac as MemoryActionEligibilityContext, a_ as MemoryActionEligibilitySource, W as MemoryActionEvent, bR as MemoryActionOutcome, bS as MemoryActionPolicyDecision, ad as MemoryActionPolicyResult, bT as MemoryActionStatus, U as MemoryActionType, M as MemoryCategory, g as MemoryFile, k as MemoryFrontmatter, aa as MemoryIntent, m as MemoryLifecycleEvent, ae as MemoryLifecycleEventType, af as MemoryLifecycleStateSummary, ao as MemoryLink, bU as MemoryLinkType, a$ as MemoryObservation, bV as MemoryOsPresetName, l as MemoryProjectionCurrentState, b0 as MemoryScope, h as MemoryStatus, av as MemorySummary, aq as MetaState, bW as ModelApi, bX as ModelDefinitionConfig, bY as ModelProviderAuthMode, ag as ModelProviderConfig, bZ as NamespacePolicy, ah as NativeKnowledgeConfig, b_ as NativeKnowledgeFolderRuleConfig, b$ as NativeKnowledgeObsidianVaultConfig, c0 as NativeKnowledgeOpenClawWorkspaceConfig, c1 as NotionLiveConnectorConfig, P as PluginConfig, x as PolicyClass, c2 as PrincipalFromSessionKeyMode, c3 as PrincipalRule, c4 as ProceduralConfig, aj as ProvenanceConfig, ai as ProvenanceSource, ab as QmdSearchExplain, Q as QmdSearchResult, c5 as QuestionEntry, b1 as RECALL_DISCLOSURE_LEVELS, c6 as ReasoningEffort, j as RecallDisclosure, c7 as RecallPipelineConfig, i as RecallPlanMode, c8 as RecallSectionConfig, R as RecallTierExplain, c9 as RecallTraceEvent, ca as RelevanceFeedback, ak as RetrievalTier, cb as SPECULATIVE_TTL_DAYS, cc as ScopeProfileAutoPromoteConfig, aN as ScopeProfileConfig, aL as ScopeProfileLayerId, aM as ScopeProfilePromotionTarget, cd as ScopeProfileTeamProjectConfig, ce as ScopeTeamConfig, cf as ScoredEntity, D as SecretRef, cg as SemanticChunkingConfigShape, S as SessionObserverBandConfig, ch as SignalLevel, al as SignalScanResult, ci as SlotBehaviorConfig, cj as SlotMismatchMode, an as TopicScore, T as TranscriptEntry, ck as TriggerMode, V as VerificationState, cl as confidenceTier, b7 as isRecallDisclosure } from './types-MWKPZnM0.js';
|
package/dist/types.js
CHANGED
package/dist/verified-recall.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareVerifiedEpisodeResults,
|
|
3
3
|
searchVerifiedEpisodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MXEWQKM7.js";
|
|
5
5
|
import "./chunk-7FL4CNPV.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-GFIARMA7.js";
|
|
7
7
|
import "./chunk-3JJWNZTT.js";
|
|
8
8
|
import "./chunk-M7XQSUBB.js";
|
|
9
9
|
import "./chunk-5UZXUTVO.js";
|
|
@@ -13,7 +13,7 @@ import "./chunk-IREVVFTM.js";
|
|
|
13
13
|
import "./chunk-SVOZFLIQ.js";
|
|
14
14
|
import "./chunk-LTJAMRGI.js";
|
|
15
15
|
import "./chunk-J6A3CX5N.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-IX3UQT4H.js";
|
|
17
17
|
import "./chunk-SCU65EZI.js";
|
|
18
18
|
import "./chunk-MB5RSUW6.js";
|
|
19
19
|
import "./chunk-6KYMPV2O.js";
|
|
@@ -22,7 +22,6 @@ import "./chunk-42JKGUFJ.js";
|
|
|
22
22
|
import "./chunk-RULE4VG5.js";
|
|
23
23
|
import "./chunk-LDXUBPMO.js";
|
|
24
24
|
import "./chunk-DM2T26WE.js";
|
|
25
|
-
import "./chunk-FVQJYWH7.js";
|
|
26
25
|
import "./chunk-FEB7W5JG.js";
|
|
27
26
|
import "./chunk-G7D6GZ5J.js";
|
|
28
27
|
import "./chunk-VF4XKTX3.js";
|
|
@@ -36,11 +35,13 @@ import "./chunk-J2HSAU72.js";
|
|
|
36
35
|
import "./chunk-A6XUJE5D.js";
|
|
37
36
|
import "./chunk-P7FMDTKL.js";
|
|
38
37
|
import "./chunk-VS2IYZRU.js";
|
|
39
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-SK2CR6MW.js";
|
|
39
|
+
import "./chunk-FVQJYWH7.js";
|
|
40
40
|
import "./chunk-4DJQYKMN.js";
|
|
41
41
|
import "./chunk-EYIEWJNI.js";
|
|
42
42
|
import "./chunk-JUC24CTX.js";
|
|
43
43
|
import "./chunk-NU3CSQ4H.js";
|
|
44
|
+
import "./chunk-6MKAMLQL.js";
|
|
44
45
|
import "./chunk-ZBJMUXZH.js";
|
|
45
46
|
import "./chunk-PZ5AY32C.js";
|
|
46
47
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.702",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -2941,7 +2941,7 @@
|
|
|
2941
2941
|
"core"
|
|
2942
2942
|
],
|
|
2943
2943
|
"peerDependencies": {
|
|
2944
|
-
"@remnic/coding-graph": "^9.3.
|
|
2944
|
+
"@remnic/coding-graph": "^9.3.702"
|
|
2945
2945
|
},
|
|
2946
2946
|
"peerDependenciesMeta": {
|
|
2947
2947
|
"@remnic/coding-graph": {
|
package/src/access-http.ts
CHANGED
|
@@ -2114,6 +2114,168 @@ export class EngramAccessHttpServer {
|
|
|
2114
2114
|
return;
|
|
2115
2115
|
}
|
|
2116
2116
|
|
|
2117
|
+
// ── Admin console surfaces (issue #1502) ──────────────────────────────
|
|
2118
|
+
//
|
|
2119
|
+
// All five routes live under /engram/v1/admin/* which the access-surface
|
|
2120
|
+
// catalog treats as infrastructure (no boundary migration required; the
|
|
2121
|
+
// static-completeness fitness test excludes this prefix). They still
|
|
2122
|
+
// require bearer auth (enforced above) and delegate to core APIs via the
|
|
2123
|
+
// pure admin-surfaces module — the dashboard never re-resolves scope or
|
|
2124
|
+
// re-lists namespaces.
|
|
2125
|
+
if (pathname.startsWith("/engram/v1/admin/scope/inspect")) {
|
|
2126
|
+
if (req.method !== "GET" && req.method !== "POST") {
|
|
2127
|
+
this.respondJson(res, 405, { error: "method_not_allowed", code: "method_not_allowed" });
|
|
2128
|
+
return;
|
|
2129
|
+
}
|
|
2130
|
+
const principal = this.resolveRequestPrincipal(req);
|
|
2131
|
+
let sessionKey: string | undefined;
|
|
2132
|
+
let namespaceOverride: string | undefined;
|
|
2133
|
+
let operation: string | undefined;
|
|
2134
|
+
if (req.method === "GET") {
|
|
2135
|
+
sessionKey = parsed.searchParams.get("session") ?? undefined;
|
|
2136
|
+
namespaceOverride = parsed.searchParams.get("namespace") ?? undefined;
|
|
2137
|
+
operation = parsed.searchParams.get("operation") ?? undefined;
|
|
2138
|
+
} else {
|
|
2139
|
+
const body = await this.readJsonBody(req) as Record<string, unknown>;
|
|
2140
|
+
sessionKey = typeof body.sessionKey === "string" ? body.sessionKey : undefined;
|
|
2141
|
+
namespaceOverride = typeof body.namespace === "string" ? body.namespace : undefined;
|
|
2142
|
+
operation = typeof body.operation === "string" ? body.operation : undefined;
|
|
2143
|
+
}
|
|
2144
|
+
const inspection = await this.service.adminInspectScope({
|
|
2145
|
+
sessionKey: sessionKey && sessionKey.length > 0 ? sessionKey : undefined,
|
|
2146
|
+
namespace: namespaceOverride && namespaceOverride.length > 0 ? namespaceOverride : undefined,
|
|
2147
|
+
principalOverride: principal,
|
|
2148
|
+
operation: operation as "recall" | "observe" | "memory_store" | "maintenance" | "dashboard" | undefined,
|
|
2149
|
+
});
|
|
2150
|
+
this.respondJson(res, 200, inspection);
|
|
2151
|
+
return;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
if (pathname === "/engram/v1/admin/namespaces") {
|
|
2155
|
+
if (req.method !== "GET") {
|
|
2156
|
+
this.respondJson(res, 405, { error: "method_not_allowed", code: "method_not_allowed" });
|
|
2157
|
+
return;
|
|
2158
|
+
}
|
|
2159
|
+
const kind = parsed.searchParams.get("kind");
|
|
2160
|
+
const principal = parsed.searchParams.get("principal");
|
|
2161
|
+
const projectId = parsed.searchParams.get("projectId");
|
|
2162
|
+
const discoveredBy = parsed.searchParams.get("discoveredBy");
|
|
2163
|
+
const result = await this.service.adminListNamespaces({
|
|
2164
|
+
...(kind ? { kind: kind as "default" | "self" | "shared" | "project" | "branch" | "team-project" | "explicit" | "legacy" } : {}),
|
|
2165
|
+
...(principal && principal.length > 0 ? { principal } : {}),
|
|
2166
|
+
...(projectId && projectId.length > 0 ? { projectId } : {}),
|
|
2167
|
+
...(discoveredBy
|
|
2168
|
+
? { discoveredBy: discoveredBy as "config" | "write" | "read" | "scan" | "migration" }
|
|
2169
|
+
: {}),
|
|
2170
|
+
});
|
|
2171
|
+
this.respondJson(res, 200, result);
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
if (pathname === "/engram/v1/admin/maintenance-health") {
|
|
2176
|
+
if (req.method !== "GET") {
|
|
2177
|
+
this.respondJson(res, 405, { error: "method_not_allowed", code: "method_not_allowed" });
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
const report = await this.service.adminMaintenanceHealth();
|
|
2181
|
+
this.respondJson(res, 200, report);
|
|
2182
|
+
return;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
if (pathname === "/engram/v1/admin/transcript-audit") {
|
|
2186
|
+
if (req.method !== "GET") {
|
|
2187
|
+
this.respondJson(res, 405, { error: "method_not_allowed", code: "method_not_allowed" });
|
|
2188
|
+
return;
|
|
2189
|
+
}
|
|
2190
|
+
const report = await this.service.adminTranscriptAudit();
|
|
2191
|
+
this.respondJson(res, 200, report);
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
if (pathname === "/engram/v1/admin/promote") {
|
|
2196
|
+
if (req.method !== "POST") {
|
|
2197
|
+
this.respondJson(res, 405, { error: "method_not_allowed", code: "method_not_allowed" });
|
|
2198
|
+
return;
|
|
2199
|
+
}
|
|
2200
|
+
const body = await this.readJsonBody(req) as Record<string, unknown>;
|
|
2201
|
+
if (typeof body.sourceMemoryId !== "string" || body.sourceMemoryId.trim().length === 0) {
|
|
2202
|
+
this.respondJson(res, 400, {
|
|
2203
|
+
error: "invalid_request",
|
|
2204
|
+
code: "invalid_request",
|
|
2205
|
+
message: "sourceMemoryId is required",
|
|
2206
|
+
});
|
|
2207
|
+
return;
|
|
2208
|
+
}
|
|
2209
|
+
if (typeof body.reason !== "string" || body.reason.trim().length === 0) {
|
|
2210
|
+
this.respondJson(res, 400, {
|
|
2211
|
+
error: "invalid_request",
|
|
2212
|
+
code: "invalid_request",
|
|
2213
|
+
message: "reason is required for promotion",
|
|
2214
|
+
});
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
if (!Array.isArray(body.targets) || body.targets.length === 0) {
|
|
2218
|
+
this.respondJson(res, 400, {
|
|
2219
|
+
error: "invalid_request",
|
|
2220
|
+
code: "invalid_request",
|
|
2221
|
+
message: "targets must be a non-empty array",
|
|
2222
|
+
});
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
const VALID_TARGETS = ["teamProject", "serverShared", "userProject", "userGlobal", "explicit"];
|
|
2226
|
+
const targets = [];
|
|
2227
|
+
for (const entry of body.targets) {
|
|
2228
|
+
if (typeof entry !== "object" || entry === null || typeof entry.kind !== "string") {
|
|
2229
|
+
this.respondJson(res, 400, {
|
|
2230
|
+
error: "invalid_request",
|
|
2231
|
+
code: "invalid_request",
|
|
2232
|
+
message: "each target must be an object with a 'kind' string",
|
|
2233
|
+
});
|
|
2234
|
+
return;
|
|
2235
|
+
}
|
|
2236
|
+
if (!VALID_TARGETS.includes(entry.kind)) {
|
|
2237
|
+
this.respondJson(res, 400, {
|
|
2238
|
+
error: "invalid_request",
|
|
2239
|
+
code: "invalid_request",
|
|
2240
|
+
message: `target.kind must be one of: ${VALID_TARGETS.join(", ")}`,
|
|
2241
|
+
});
|
|
2242
|
+
return;
|
|
2243
|
+
}
|
|
2244
|
+
targets.push({
|
|
2245
|
+
kind: entry.kind as "teamProject" | "serverShared" | "userProject" | "userGlobal" | "explicit",
|
|
2246
|
+
namespace: typeof entry.namespace === "string" ? entry.namespace : undefined,
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
try {
|
|
2250
|
+
// Rate-limit the promotion write, matching every other write route
|
|
2251
|
+
// (observe, trust-zone promotion, etc.). The check throws on limit
|
|
2252
|
+
// exceeded; the hit is recorded after the write succeeds.
|
|
2253
|
+
this.ensureWriteRateLimitAvailable();
|
|
2254
|
+
const result = await this.service.adminPromoteMemory({
|
|
2255
|
+
sourceMemoryId: body.sourceMemoryId,
|
|
2256
|
+
namespace: typeof body.namespace === "string" ? body.namespace : undefined,
|
|
2257
|
+
principal: this.resolveRequestPrincipal(req),
|
|
2258
|
+
sessionKey: typeof body.sessionKey === "string" ? body.sessionKey : undefined,
|
|
2259
|
+
targets,
|
|
2260
|
+
reason: body.reason,
|
|
2261
|
+
});
|
|
2262
|
+
// actor is derived from the authenticated principal inside adminPromoteMemory;
|
|
2263
|
+
this.recordWriteRateLimitHit();
|
|
2264
|
+
this.respondJson(res, 200, result);
|
|
2265
|
+
} catch (err) {
|
|
2266
|
+
if (err instanceof EngramAccessInputError) {
|
|
2267
|
+
this.respondJson(res, 400, {
|
|
2268
|
+
error: "invalid_request",
|
|
2269
|
+
code: "invalid_request",
|
|
2270
|
+
message: err.message,
|
|
2271
|
+
});
|
|
2272
|
+
return;
|
|
2273
|
+
}
|
|
2274
|
+
throw err;
|
|
2275
|
+
}
|
|
2276
|
+
return;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2117
2279
|
this.respondJson(res, 404, { error: "not_found", code: "not_found" });
|
|
2118
2280
|
}
|
|
2119
2281
|
|
package/src/access-service.ts
CHANGED
|
@@ -100,10 +100,26 @@ import {
|
|
|
100
100
|
type ScopeProfileLayerResolution,
|
|
101
101
|
type ScopeProfilePromotionResolution,
|
|
102
102
|
} from "./namespaces/scope-profiles.js";
|
|
103
|
+
import { type ScopePlan, resolveScopePlan } from "./scopes/scope-plan.js";
|
|
103
104
|
import { namespaceIdentityFromToken } from "./namespaces/identity.js";
|
|
104
105
|
import { namespaceCollectionName } from "./namespaces/search.js";
|
|
105
106
|
import { SecureStoreLockedError } from "./secure-store/index.js";
|
|
106
107
|
import { isPathInsideStorageRoot } from "./storage-paths.js";
|
|
108
|
+
import {
|
|
109
|
+
AdminPromotionError,
|
|
110
|
+
auditTranscripts,
|
|
111
|
+
gatherMaintenanceHealth,
|
|
112
|
+
inspectScope,
|
|
113
|
+
listAdminNamespaces,
|
|
114
|
+
promoteMemory,
|
|
115
|
+
redactSensitive,
|
|
116
|
+
type AdminNamespaceFilter,
|
|
117
|
+
type AdminNamespaceQmdHealth,
|
|
118
|
+
type InspectScopeOptions,
|
|
119
|
+
type MemoryPromotionTargetKind,
|
|
120
|
+
type PromotionStorageProvider,
|
|
121
|
+
type ScopeInspection,
|
|
122
|
+
} from "./admin/admin-surfaces.js";
|
|
107
123
|
import type { LastRecallSnapshot } from "./recall-state.js";
|
|
108
124
|
import type {
|
|
109
125
|
GraphRecallSnapshot,
|
|
@@ -8561,5 +8577,204 @@ export class EngramAccessService {
|
|
|
8561
8577
|
limit: request.limit,
|
|
8562
8578
|
});
|
|
8563
8579
|
}
|
|
8580
|
+
|
|
8581
|
+
// ── Admin console surfaces (issue #1502) ────────────────────────────────
|
|
8582
|
+
//
|
|
8583
|
+
// Thin delegators. Every method threads `this.orchestrator` references
|
|
8584
|
+
// into the pure `admin/admin-surfaces.ts` functions so the dashboard
|
|
8585
|
+
// never re-resolves scope, re-derives promotion targets, or re-lists
|
|
8586
|
+
// namespaces.
|
|
8587
|
+
|
|
8588
|
+
/**
|
|
8589
|
+
* Resolve an effective scope inspection for the console. Inputs are
|
|
8590
|
+
* redacted before return so an operator-supplied principal preview /
|
|
8591
|
+
* namespace override never echoes a pasted credential back.
|
|
8592
|
+
*/
|
|
8593
|
+
async adminInspectScope(options: {
|
|
8594
|
+
sessionKey?: string;
|
|
8595
|
+
namespace?: string;
|
|
8596
|
+
principalOverride?: string;
|
|
8597
|
+
operation?: InspectScopeOptions["operation"];
|
|
8598
|
+
}): Promise<ScopeInspection> {
|
|
8599
|
+
const config = this.orchestrator.config;
|
|
8600
|
+
// Fetch the coding context when a session is supplied; the pure
|
|
8601
|
+
// inspectScope helper (admin-surfaces.ts) owns the single namespace-flag
|
|
8602
|
+
// read for this surface and threads it through resolveScopePlan.
|
|
8603
|
+
const codingContext = options.sessionKey
|
|
8604
|
+
? this.orchestrator.getCodingContextForSession(options.sessionKey) ?? null
|
|
8605
|
+
: null;
|
|
8606
|
+
const inspection = inspectScope({
|
|
8607
|
+
config,
|
|
8608
|
+
sessionKey: options.sessionKey,
|
|
8609
|
+
namespace: options.namespace,
|
|
8610
|
+
principalOverride: options.principalOverride,
|
|
8611
|
+
codingContext,
|
|
8612
|
+
operation: options.operation,
|
|
8613
|
+
});
|
|
8614
|
+
// Redact operator free-text inputs that may carry credentials. The plan
|
|
8615
|
+
// itself is derived from config + storage layout, not user input, so its
|
|
8616
|
+
// fields stay intact for diagnostics.
|
|
8617
|
+
return redactSensitive(inspection);
|
|
8618
|
+
}
|
|
8619
|
+
|
|
8620
|
+
/**
|
|
8621
|
+
* List configured + discovered namespaces from the catalog with the
|
|
8622
|
+
* admin filters the console exposes.
|
|
8623
|
+
*/
|
|
8624
|
+
async adminListNamespaces(filter?: AdminNamespaceFilter) {
|
|
8625
|
+
const result = await listAdminNamespaces({
|
|
8626
|
+
catalog: this.orchestrator.namespaceCatalog,
|
|
8627
|
+
filter,
|
|
8628
|
+
});
|
|
8629
|
+
return redactSensitive(result);
|
|
8630
|
+
}
|
|
8631
|
+
|
|
8632
|
+
/**
|
|
8633
|
+
* Per-namespace maintenance + QMD health. QMD diagnostics are probed via
|
|
8634
|
+
* the orchestrator's search health accessor (one probe per namespace).
|
|
8635
|
+
*/
|
|
8636
|
+
async adminMaintenanceHealth() {
|
|
8637
|
+
const report = await gatherMaintenanceHealth({
|
|
8638
|
+
catalog: this.orchestrator.namespaceCatalog,
|
|
8639
|
+
qmdHealthProvider: async (namespace): Promise<AdminNamespaceQmdHealth | null> => {
|
|
8640
|
+
try {
|
|
8641
|
+
const health = await this.orchestrator.searchHealthForNamespace(namespace);
|
|
8642
|
+
return {
|
|
8643
|
+
namespace,
|
|
8644
|
+
collection: health.collection,
|
|
8645
|
+
available: health.available,
|
|
8646
|
+
collectionState: health.collectionState,
|
|
8647
|
+
debugStatus: health.debugStatus,
|
|
8648
|
+
installedVersion: health.installedVersion,
|
|
8649
|
+
supportedVersion: health.supportedVersion,
|
|
8650
|
+
supported: health.supported,
|
|
8651
|
+
upgradeAvailable: health.upgradeAvailable,
|
|
8652
|
+
daemonMode: health.daemonMode,
|
|
8653
|
+
};
|
|
8654
|
+
} catch (err) {
|
|
8655
|
+
// The report marks the namespace degraded and records the reason;
|
|
8656
|
+
// a probe failure must not abort the whole report.
|
|
8657
|
+
throw err;
|
|
8658
|
+
}
|
|
8659
|
+
},
|
|
8660
|
+
});
|
|
8661
|
+
return redactSensitive(report);
|
|
8662
|
+
}
|
|
8663
|
+
|
|
8664
|
+
/**
|
|
8665
|
+
* Dry-run transcript/session audit. Detects mixed `other/default` data
|
|
8666
|
+
* and legacy stranded directories. Never applies a migration.
|
|
8667
|
+
*/
|
|
8668
|
+
async adminTranscriptAudit() {
|
|
8669
|
+
const result = await auditTranscripts(this.orchestrator.config.memoryDir);
|
|
8670
|
+
return redactSensitive(result);
|
|
8671
|
+
}
|
|
8672
|
+
|
|
8673
|
+
/**
|
|
8674
|
+
* Manually promote a memory into one or more authorized targets. Requires
|
|
8675
|
+
* a non-empty reason (audit-logged). Reuses the scope-profile promotion
|
|
8676
|
+
* resolution and `canWriteNamespace` gate — there is no dashboard-only
|
|
8677
|
+
* write path.
|
|
8678
|
+
*/
|
|
8679
|
+
async adminPromoteMemory(request: {
|
|
8680
|
+
sourceMemoryId: string;
|
|
8681
|
+
namespace?: string;
|
|
8682
|
+
principal?: string;
|
|
8683
|
+
sessionKey?: string;
|
|
8684
|
+
targets: ReadonlyArray<{ kind: MemoryPromotionTargetKind; namespace?: string }>;
|
|
8685
|
+
reason: string;
|
|
8686
|
+
actor?: never; // ignored — actor is derived from the authenticated principal
|
|
8687
|
+
}) {
|
|
8688
|
+
const config = this.orchestrator.config;
|
|
8689
|
+
const namespacesEnabled = config.namespacesEnabled === true;
|
|
8690
|
+
// Fix OdCl3: when no namespace is supplied, resolve the source via the
|
|
8691
|
+
// scope plan (principal self / scope-profile write layer / coding overlay)
|
|
8692
|
+
// instead of falling through to config.defaultNamespace. This matches the
|
|
8693
|
+
// runtime observe/write path.
|
|
8694
|
+
let sourceNamespace: string;
|
|
8695
|
+
if (request.namespace) {
|
|
8696
|
+
sourceNamespace = this.resolveReadableNamespace(
|
|
8697
|
+
request.namespace,
|
|
8698
|
+
request.principal,
|
|
8699
|
+
);
|
|
8700
|
+
} else {
|
|
8701
|
+
const codingContext = request.sessionKey
|
|
8702
|
+
? this.orchestrator.getCodingContextForSession(request.sessionKey) ?? null
|
|
8703
|
+
: null;
|
|
8704
|
+
const plan = resolveScopePlan({
|
|
8705
|
+
config,
|
|
8706
|
+
sessionKey: request.sessionKey,
|
|
8707
|
+
principalOverride: request.principal,
|
|
8708
|
+
codingContext,
|
|
8709
|
+
namespacesEnabled,
|
|
8710
|
+
});
|
|
8711
|
+
sourceNamespace = this.resolveReadableNamespace(
|
|
8712
|
+
plan.baseNamespace,
|
|
8713
|
+
request.principal,
|
|
8714
|
+
);
|
|
8715
|
+
}
|
|
8716
|
+
// Fix OdB0c: thread coding context into the scope-profile plan so
|
|
8717
|
+
// userProject/teamProject promotion targets resolve for project-scoped
|
|
8718
|
+
// sessions (previously hard-coded to null).
|
|
8719
|
+
const codingContext = request.sessionKey
|
|
8720
|
+
? this.orchestrator.getCodingContextForSession(request.sessionKey) ?? null
|
|
8721
|
+
: null;
|
|
8722
|
+
const codingOverlay = codingContext
|
|
8723
|
+
? resolveCodingNamespaceOverlay(
|
|
8724
|
+
codingContext,
|
|
8725
|
+
config.codingMode,
|
|
8726
|
+
config.defaultNamespace,
|
|
8727
|
+
)
|
|
8728
|
+
: null;
|
|
8729
|
+
const scopeProfilePlan = resolveScopeProfilePlan({
|
|
8730
|
+
config,
|
|
8731
|
+
principal: request.principal,
|
|
8732
|
+
codingContext,
|
|
8733
|
+
codingOverlay,
|
|
8734
|
+
});
|
|
8735
|
+
const storage: PromotionStorageProvider = {
|
|
8736
|
+
readMemory: async (namespace, memoryId) => {
|
|
8737
|
+
const resolved = await this.orchestrator.getStorage(namespace);
|
|
8738
|
+
const memory = await resolved.getMemoryById(memoryId);
|
|
8739
|
+
if (!memory) return null;
|
|
8740
|
+
return {
|
|
8741
|
+
category: memory.frontmatter.category,
|
|
8742
|
+
content: memory.content,
|
|
8743
|
+
frontmatter: memory.frontmatter,
|
|
8744
|
+
};
|
|
8745
|
+
},
|
|
8746
|
+
writePromotedMemory: async (namespace, memory) => {
|
|
8747
|
+
const resolved = await this.orchestrator.getStorage(namespace);
|
|
8748
|
+
return resolved.writeMemory(memory.category, memory.content, {
|
|
8749
|
+
confidence: memory.confidence,
|
|
8750
|
+
tags: memory.tags,
|
|
8751
|
+
entityRef: memory.entityRef,
|
|
8752
|
+
source: `admin-promotion:${memory.sourceNamespace}:${memory.reason.slice(0, 120)}`,
|
|
8753
|
+
lineage: memory.lineage,
|
|
8754
|
+
sourceMemoryId: memory.sourceMemoryId,
|
|
8755
|
+
actor: memory.actor,
|
|
8756
|
+
validAt: memory.validAt,
|
|
8757
|
+
});
|
|
8758
|
+
},
|
|
8759
|
+
};
|
|
8760
|
+
try {
|
|
8761
|
+
return await promoteMemory({
|
|
8762
|
+
config,
|
|
8763
|
+
sourceMemoryId: request.sourceMemoryId,
|
|
8764
|
+
sourceNamespace,
|
|
8765
|
+
principal: request.principal,
|
|
8766
|
+
targets: request.targets,
|
|
8767
|
+
reason: request.reason,
|
|
8768
|
+
actor: request.principal ?? "admin-console",
|
|
8769
|
+
storage,
|
|
8770
|
+
scopeProfilePlan,
|
|
8771
|
+
});
|
|
8772
|
+
} catch (err) {
|
|
8773
|
+
if (err instanceof AdminPromotionError) {
|
|
8774
|
+
throw new EngramAccessInputError(err.message);
|
|
8775
|
+
}
|
|
8776
|
+
throw err;
|
|
8777
|
+
}
|
|
8778
|
+
}
|
|
8564
8779
|
}
|
|
8565
8780
|
|