@remnic/core 9.3.655 → 9.3.656
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 +22 -22
- package/dist/access-http.d.ts +4 -4
- package/dist/access-http.js +10 -10
- package/dist/access-mcp.d.ts +4 -4
- package/dist/access-mcp.js +9 -9
- package/dist/access-schema.d.ts +10 -10
- package/dist/{access-service-BEJvriUt.d.ts → access-service-D_nbpexW.d.ts} +33 -2
- package/dist/access-service.d.ts +4 -4
- package/dist/access-service.js +8 -8
- 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-PVE7KSQP.js → chunk-2BD7DG37.js} +2 -2
- package/dist/{chunk-54LOUIBE.js → chunk-2MXEVL75.js} +2 -2
- package/dist/{chunk-55ZMNKMQ.js → chunk-4UL7VPTD.js} +276 -57
- package/dist/chunk-4UL7VPTD.js.map +1 -0
- package/dist/{chunk-COVZLGMR.js → chunk-54XF2FY7.js} +17 -17
- package/dist/{chunk-UYNFWZWG.js → chunk-AGJKWOKV.js} +2 -2
- package/dist/{chunk-TDZSSJV4.js → chunk-AZBV4RRY.js} +1 -1
- package/dist/chunk-AZBV4RRY.js.map +1 -0
- package/dist/{chunk-KOI765XP.js → chunk-CTAV55JM.js} +241 -1
- package/dist/chunk-CTAV55JM.js.map +1 -0
- package/dist/{chunk-A3Y37UWI.js → chunk-DIBWFCLA.js} +3 -3
- package/dist/{chunk-QDVQ4AN2.js → chunk-DR67OK4E.js} +5 -5
- package/dist/{chunk-XBIACVCO.js → chunk-EC2AYKRX.js} +2 -2
- package/dist/{chunk-IQ53ZSXV.js → chunk-GCYFUTUC.js} +2 -2
- package/dist/{chunk-YYN3LIYA.js → chunk-GSHW5VVD.js} +5 -5
- package/dist/chunk-GYSYLGNE.js +650 -0
- package/dist/chunk-GYSYLGNE.js.map +1 -0
- package/dist/{chunk-NRBGRZW4.js → chunk-IOZ5WBWD.js} +2 -2
- package/dist/{chunk-NCSJKK23.js → chunk-JSVFEHLL.js} +7 -5
- package/dist/chunk-JSVFEHLL.js.map +1 -0
- package/dist/{chunk-7LWRCOP7.js → chunk-LZTFCAKE.js} +2 -2
- package/dist/{chunk-TEO46GMM.js → chunk-NXCK7DO7.js} +2 -2
- package/dist/{chunk-XOFXKASO.js → chunk-PEPHBH2W.js} +2 -2
- package/dist/{chunk-WDTUYOLS.js → chunk-QZRKNA5F.js} +2 -2
- package/dist/{chunk-PS3SYNHP.js → chunk-R5DB26G6.js} +2 -2
- package/dist/{chunk-5QD3QD76.js → chunk-RDW5G6DO.js} +659 -123
- package/dist/chunk-RDW5G6DO.js.map +1 -0
- package/dist/{chunk-BGKXTVNG.js → chunk-SWDHVH2P.js} +2 -2
- package/dist/{chunk-67G4T7KI.js → chunk-SXYCVRLK.js} +3 -3
- package/dist/{chunk-UCEABZZN.js → chunk-TFFZUFEP.js} +7 -5
- package/dist/chunk-TFFZUFEP.js.map +1 -0
- package/dist/{chunk-UCEDY5M7.js → chunk-TIJYQXDI.js} +2 -2
- package/dist/{chunk-2RCGZ67B.js → chunk-VAEAGTEQ.js} +3 -3
- package/dist/{chunk-XRKQOQLY.js → chunk-WIKMCJUR.js} +2 -2
- package/dist/{chunk-KZZ4YAEC.js → chunk-WWMHAMAY.js} +2 -2
- package/dist/{chunk-OKW6F5S5.js → chunk-YEZHZCUO.js} +4 -4
- package/dist/{chunk-5FOCXX5E.js → chunk-YVVQUAOO.js} +3 -3
- package/dist/{chunk-5FOCXX5E.js.map → chunk-YVVQUAOO.js.map} +1 -1
- package/dist/{chunk-3XGWCZ63.js → chunk-YXLT4EMM.js} +2 -2
- package/dist/{chunk-PTMJ2FH2.js → chunk-Z6UDTNY6.js} +2 -2
- package/dist/{cli-BGahB_d3.d.ts → cli-aYxSuPvP.d.ts} +3 -3
- package/dist/cli.d.ts +5 -5
- package/dist/cli.js +22 -22
- 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 +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-cue-recall.js +2 -2
- 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/focused-list-recall.js +2 -2
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +121 -121
- package/dist/index.js +32 -32
- 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/lcm-fallback-read.js +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 +4 -4
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/namespaces/storage.js +3 -3
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +7 -7
- package/dist/{orchestrator-BgzZlWxH.d.ts → orchestrator-D1wcmPNj.d.ts} +8 -2
- package/dist/orchestrator.d.ts +3 -3
- package/dist/orchestrator.js +18 -18
- 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 +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-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 -2
- 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/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-consolidation-Z8d_uMq8.d.ts → semantic-consolidation-MWOdNtSE.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 +3 -2
- package/dist/semantic-rule-verifier.js +5 -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/targeted-fact-recall.js +2 -2
- 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/{types-2OPlQWJG.d.ts → types-CgcCpUrf.d.ts} +39 -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.d.ts +2 -1
- package/dist/verified-recall.js +5 -3
- package/package.json +1 -1
- package/src/access-service-observe-lcm-parity.test.ts +86 -1
- package/src/access-service-observe-scope.test.ts +283 -1
- package/src/access-service-raw-excerpt-read-gate.test.ts +53 -0
- package/src/access-service.ts +391 -93
- package/src/coding/coding-namespace.ts +0 -3
- package/src/config.ts +282 -0
- package/src/lcm-fallback-read.ts +2 -6
- package/src/namespaces/scope-profiles.test.ts +1074 -0
- package/src/namespaces/scope-profiles.ts +456 -0
- package/src/orchestrator-flush.test.ts +142 -0
- package/src/orchestrator-source-attribution.test.ts +73 -0
- package/src/orchestrator.ts +835 -163
- package/src/semantic-rule-verifier.ts +13 -6
- package/src/types.ts +52 -0
- package/src/verified-recall.ts +10 -6
- package/dist/chunk-55ZMNKMQ.js.map +0 -1
- package/dist/chunk-5QD3QD76.js.map +0 -1
- package/dist/chunk-KOI765XP.js.map +0 -1
- package/dist/chunk-MMJANTJX.js +0 -339
- package/dist/chunk-MMJANTJX.js.map +0 -1
- package/dist/chunk-NCSJKK23.js.map +0 -1
- package/dist/chunk-TDZSSJV4.js.map +0 -1
- package/dist/chunk-UCEABZZN.js.map +0 -1
- /package/dist/{chunk-PVE7KSQP.js.map → chunk-2BD7DG37.js.map} +0 -0
- /package/dist/{chunk-54LOUIBE.js.map → chunk-2MXEVL75.js.map} +0 -0
- /package/dist/{chunk-COVZLGMR.js.map → chunk-54XF2FY7.js.map} +0 -0
- /package/dist/{chunk-UYNFWZWG.js.map → chunk-AGJKWOKV.js.map} +0 -0
- /package/dist/{chunk-A3Y37UWI.js.map → chunk-DIBWFCLA.js.map} +0 -0
- /package/dist/{chunk-QDVQ4AN2.js.map → chunk-DR67OK4E.js.map} +0 -0
- /package/dist/{chunk-XBIACVCO.js.map → chunk-EC2AYKRX.js.map} +0 -0
- /package/dist/{chunk-IQ53ZSXV.js.map → chunk-GCYFUTUC.js.map} +0 -0
- /package/dist/{chunk-YYN3LIYA.js.map → chunk-GSHW5VVD.js.map} +0 -0
- /package/dist/{chunk-NRBGRZW4.js.map → chunk-IOZ5WBWD.js.map} +0 -0
- /package/dist/{chunk-7LWRCOP7.js.map → chunk-LZTFCAKE.js.map} +0 -0
- /package/dist/{chunk-TEO46GMM.js.map → chunk-NXCK7DO7.js.map} +0 -0
- /package/dist/{chunk-XOFXKASO.js.map → chunk-PEPHBH2W.js.map} +0 -0
- /package/dist/{chunk-WDTUYOLS.js.map → chunk-QZRKNA5F.js.map} +0 -0
- /package/dist/{chunk-PS3SYNHP.js.map → chunk-R5DB26G6.js.map} +0 -0
- /package/dist/{chunk-BGKXTVNG.js.map → chunk-SWDHVH2P.js.map} +0 -0
- /package/dist/{chunk-67G4T7KI.js.map → chunk-SXYCVRLK.js.map} +0 -0
- /package/dist/{chunk-UCEDY5M7.js.map → chunk-TIJYQXDI.js.map} +0 -0
- /package/dist/{chunk-2RCGZ67B.js.map → chunk-VAEAGTEQ.js.map} +0 -0
- /package/dist/{chunk-XRKQOQLY.js.map → chunk-WIKMCJUR.js.map} +0 -0
- /package/dist/{chunk-KZZ4YAEC.js.map → chunk-WWMHAMAY.js.map} +0 -0
- /package/dist/{chunk-OKW6F5S5.js.map → chunk-YEZHZCUO.js.map} +0 -0
- /package/dist/{chunk-3XGWCZ63.js.map → chunk-YXLT4EMM.js.map} +0 -0
- /package/dist/{chunk-PTMJ2FH2.js.map → chunk-Z6UDTNY6.js.map} +0 -0
package/dist/tier-routing.d.ts
CHANGED
package/dist/topics.d.ts
CHANGED
package/dist/transcript.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PluginConfig, _ as TranscriptEntry, $ as Checkpoint } from './types-
|
|
1
|
+
import { P as PluginConfig, _ as TranscriptEntry, $ as Checkpoint } from './types-CgcCpUrf.js';
|
|
2
2
|
import { SessionIntegrityReport } from './session-integrity.js';
|
|
3
3
|
import './types-ByK7T3L6.js';
|
|
4
4
|
import './index-DJ9QWMw-.js';
|
|
@@ -757,6 +757,41 @@ interface CodingContext {
|
|
|
757
757
|
rootPath: string;
|
|
758
758
|
defaultBranch: string | null;
|
|
759
759
|
}
|
|
760
|
+
type ScopeProfileLayerId = "userProject" | "teamProject" | "userGlobal" | "serverShared";
|
|
761
|
+
type ScopeProfilePromotionTarget = ScopeProfileLayerId | "serverShared" | "teamProject" | "userGlobal";
|
|
762
|
+
interface ScopeProfileTeamProjectConfig {
|
|
763
|
+
/**
|
|
764
|
+
* Namespace template for team-project layers. Supported placeholders:
|
|
765
|
+
* `{teamId}`, `{principal}`, `{projectId}`, `{projectHash}`, and
|
|
766
|
+
* `{projectNamespace}`. The resolved namespace is validated at use time.
|
|
767
|
+
*/
|
|
768
|
+
namespaceTemplate?: string;
|
|
769
|
+
/**
|
|
770
|
+
* Optional trusted team id for this profile. When omitted, the resolver uses
|
|
771
|
+
* the first configured team whose principal lists include the caller.
|
|
772
|
+
*/
|
|
773
|
+
teamId?: string;
|
|
774
|
+
}
|
|
775
|
+
interface ScopeProfileAutoPromoteConfig {
|
|
776
|
+
enabled: boolean;
|
|
777
|
+
targets: ScopeProfilePromotionTarget[];
|
|
778
|
+
categories: Array<"fact" | "correction" | "decision" | "preference" | "rule" | "procedure">;
|
|
779
|
+
minConfidenceTier: ConfidenceTier;
|
|
780
|
+
}
|
|
781
|
+
interface ScopeProfileConfig {
|
|
782
|
+
readOrder: ScopeProfileLayerId[];
|
|
783
|
+
writeDefault: ScopeProfileLayerId;
|
|
784
|
+
promotionTargets: ScopeProfilePromotionTarget[];
|
|
785
|
+
teamProject?: ScopeProfileTeamProjectConfig;
|
|
786
|
+
autoPromote: ScopeProfileAutoPromoteConfig;
|
|
787
|
+
}
|
|
788
|
+
interface ScopeTeamConfig {
|
|
789
|
+
principals: string[];
|
|
790
|
+
projectNamespaceTemplate?: string;
|
|
791
|
+
read: string[];
|
|
792
|
+
write: string[];
|
|
793
|
+
promote: string[];
|
|
794
|
+
}
|
|
760
795
|
/** Configuration for the nightly contradiction-scan cron (issue #520). */
|
|
761
796
|
interface ContradictionScanConfig {
|
|
762
797
|
/** Master switch for the contradiction scan cron. Default true. */
|
|
@@ -1586,6 +1621,9 @@ interface PluginConfig {
|
|
|
1586
1621
|
principalFromSessionKeyRules: PrincipalRule[];
|
|
1587
1622
|
namespacePolicies: NamespacePolicy[];
|
|
1588
1623
|
defaultRecallNamespaces: Array<"self" | "shared">;
|
|
1624
|
+
scopeProfiles: Record<string, ScopeProfileConfig>;
|
|
1625
|
+
defaultScopeProfile: string | undefined;
|
|
1626
|
+
teams: Record<string, ScopeTeamConfig>;
|
|
1589
1627
|
cronRecallMode: CronRecallMode;
|
|
1590
1628
|
cronRecallAllowlist: string[];
|
|
1591
1629
|
cronRecallPolicyEnabled: boolean;
|
|
@@ -3207,4 +3245,4 @@ interface HourlySummary {
|
|
|
3207
3245
|
generatedAt: string;
|
|
3208
3246
|
}
|
|
3209
3247
|
|
|
3210
|
-
export { type Checkpoint as $, type ActiveRecallChatType as A, type BehaviorSignalEvent as B, type CompressionGuidelineOptimizerState as C, type MemorySummary as D, type EntityStructuredSection as E, type FileHygieneConfig as F, type GatewayConfig as G, type RecallPlanMode as H, type ImportanceScore as I, type IdentityInjectionMode as J, type RecallDisclosure as K, type LiveConnectorsConfig as L, type MemoryCategory as M, type BriefingSections as N, type BriefingFollowup as O, type PluginConfig as P, type BriefingFocus as Q, type RecallTierExplain as R, type CalendarSource as S, type TopicScore as T, type CalendarEvent as U, type BriefingActiveThread as V, type BriefingResult as W, type BriefingRecentEntity as X, type BufferTurn as Y, type QmdSearchResult as Z, type TranscriptEntry as _, type ActiveRecallQueryMode as a, type
|
|
3248
|
+
export { type Checkpoint as $, type ActiveRecallChatType as A, type BehaviorSignalEvent as B, type CompressionGuidelineOptimizerState as C, type MemorySummary as D, type EntityStructuredSection as E, type FileHygieneConfig as F, type GatewayConfig as G, type RecallPlanMode as H, type ImportanceScore as I, type IdentityInjectionMode as J, type RecallDisclosure as K, type LiveConnectorsConfig as L, type MemoryCategory as M, type BriefingSections as N, type BriefingFollowup as O, type PluginConfig as P, type BriefingFocus as Q, type RecallTierExplain as R, type CalendarSource as S, type TopicScore as T, type CalendarEvent as U, type BriefingActiveThread as V, type BriefingResult as W, type BriefingRecentEntity as X, type BufferTurn as Y, type QmdSearchResult as Z, type TranscriptEntry as _, type ActiveRecallQueryMode as a, type WearableFetchOptions as a$, type HourlySummary as a0, type SessionObserverBandConfig as a1, type LifecycleState as a2, type VerificationState as a3, type PolicyClass as a4, type ImportanceLevel as a5, type SecretRef as a6, type AgentAccessAuthToken as a7, type CompressionGuidelineOptimizerEventCounts as a8, type CompressionGuidelineOptimizerActionSummary as a9, type WearableNativeMemory as aA, type WearableMemoryMode as aB, type WearableSourceConnector as aC, type WearablesConfig as aD, type WearableSyncSummary as aE, type WearableSourceStatus as aF, type WearableDayTranscript as aG, type WearableCorrectionRule as aH, type CodingContext as aI, type BootstrapOptions as aJ, type BootstrapResult as aK, type ConsolidationObservation as aL, type EntityTimelineEntry as aM, type CodingModeConfig as aN, type WearableCleanupSettings as aO, type WearableDayTranscriptMeta as aP, type BriefingConfig as aQ, type BriefingOpenCommitment as aR, type BriefingWindow as aS, type CodexCompatConfig as aT, DEFAULT_RECALL_DISCLOSURE as aU, type ExtractedFact as aV, type MemoryActionEligibilitySource as aW, type MemoryObservation as aX, type MemoryScope as aY, RECALL_DISCLOSURE_LEVELS as aZ, type WearableAuthCheck as a_, type CompressionGuidelineOptimizerRuleUpdate as aa, type MemoryActionType as ab, type EntityMention as ac, type EntitySchemaDefinition as ad, type EntitySchemaSectionDefinition as ae, type ExtractionResult as af, type ConsolidationResult as ag, type DaySummaryResult as ah, type MemoryIntent as ai, type QmdSearchExplain as aj, type MemoryActionEligibilityContext as ak, type MemoryActionPolicyResult as al, type MemoryLifecycleEventType as am, type MemoryLifecycleStateSummary as an, type ModelProviderConfig as ao, type NativeKnowledgeConfig as ap, type RetrievalTier as aq, type SignalScanResult as ar, type ConversationThread as as, type ScopeProfileLayerId as at, type ScopeProfilePromotionTarget as au, type DreamsStatusResult as av, type DreamsPhase as aw, type DreamsRunResult as ax, type WearableConversation as ay, type WearableSourceSettings as az, type ActiveRecallPromptStyle as b, type ProceduralConfig as b$, type WearableFetchPage as b0, type WearableNativeMemoryPage as b1, type WearableTranscriptSegment as b2, isRecallDisclosure as b3, type AgentAccessHttpConfig as b4, type AgentDefaultsConfig as b5, type AgentPersona as b6, type BehaviorLoopAdjustment as b7, type BehaviorSignalDirection as b8, type BehaviorSignalType as b9, type ExtractedQuestion as bA, type ExtractedReasoningTrace as bB, type ExtractedReasoningTraceStep as bC, type ExtractedRelationship as bD, type ExtractionPassSource as bE, type GitHubLiveConnectorConfig as bF, type GmailLiveConnectorConfig as bG, type GoogleDriveLiveConnectorConfig as bH, type HeartbeatConfig as bI, type HeartbeatDetectionMode as bJ, type LlmTraceCallback as bK, type LlmTraceEvent as bL, type MemoryActionOutcome as bM, type MemoryActionPolicyDecision as bN, type MemoryActionStatus as bO, type MemoryLinkType as bP, type MemoryOsPresetName as bQ, type ModelApi as bR, type ModelDefinitionConfig as bS, type ModelProviderAuthMode as bT, type NamespacePolicy as bU, type NativeKnowledgeFolderRuleConfig as bV, type NativeKnowledgeObsidianVaultConfig as bW, type NativeKnowledgeOpenClawWorkspaceConfig as bX, type NotionLiveConnectorConfig as bY, type PrincipalFromSessionKeyMode as bZ, type PrincipalRule as b_, type BriefingCalendarSourceError as ba, type BufferEntryState as bb, type CaptureMode as bc, type CodexCliReasoningEffort as bd, type CodexCompactionFlushMode as be, type CodexConnectorConfig as bf, type CompressionGuidelineActivationState as bg, type CompressionGuidelineOptimizerSourceWindow as bh, type ConfidenceTier as bi, type ConsolidationAction as bj, type ConsolidationItem as bk, type ContinuityIncidentState as bl, type ContinuityLoopCadence as bm, type ContinuityLoopStatus as bn, type ContradictionScanConfig as bo, type CronConversationRecallMode as bp, type CronRecallMode as bq, type DreamingConfig as br, type DreamingNarrativePromptStyle as bs, type DreamsDeepSleepConfig as bt, type DreamsLightSleepConfig as bu, type DreamsPhaseStatus as bv, type DreamsPhasesConfig as bw, type DreamsRemConfig as bx, type EngramTraceEvent as by, type ExtractedProcedureStep as bz, type ActiveRecallThinking as c, type QuestionEntry as c0, type ReasoningEffort as c1, type RecallPipelineConfig as c2, type RecallSectionConfig as c3, type RecallTraceEvent as c4, type RelevanceFeedback as c5, SPECULATIVE_TTL_DAYS as c6, type ScopeProfileAutoPromoteConfig as c7, type ScopeProfileConfig as c8, type ScopeProfileTeamProjectConfig as c9, type ScopeTeamConfig as ca, type ScoredEntity as cb, type SemanticChunkingConfigShape as cc, type SignalLevel as cd, type SlotBehaviorConfig as ce, type SlotMismatchMode as cf, type TriggerMode as cg, confidenceTier as ch, type ActiveRecallModelFallbackPolicy as d, type BehaviorLoopPolicyState as e, type AgentPersonaModelConfig as f, type MemoryFile as g, type MemoryStatus as h, type MemoryLink as i, type MemoryFrontmatter as j, type BufferState as k, type MetaState as l, type MemoryActionEvent as m, type MemoryLifecycleEvent as n, type BufferSurpriseEvent as o, type ContinuityIncidentOpenInput as p, type ContinuityIncidentRecord as q, type ContinuityIncidentCloseInput as r, type ContinuityImprovementLoop as s, type ContinuityLoopUpsertInput as t, type ContinuityLoopReviewInput as u, type EntityRelationship as v, type EntityActivityEntry as w, type EntityFile as x, type AccessTrackingEntry as y, type MemoryProjectionCurrentState 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 { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a7 as AgentAccessAuthToken,
|
|
3
|
+
export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a7 as AgentAccessAuthToken, b4 as AgentAccessHttpConfig, b5 as AgentDefaultsConfig, b6 as AgentPersona, f as AgentPersonaModelConfig, b7 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, b8 as BehaviorSignalDirection, B as BehaviorSignalEvent, b9 as BehaviorSignalType, aJ as BootstrapOptions, aK as BootstrapResult, V as BriefingActiveThread, ba as BriefingCalendarSourceError, aQ as BriefingConfig, Q as BriefingFocus, O as BriefingFollowup, aR as BriefingOpenCommitment, X as BriefingRecentEntity, W as BriefingResult, N as BriefingSections, aS as BriefingWindow, bb as BufferEntryState, k as BufferState, o as BufferSurpriseEvent, Y as BufferTurn, U as CalendarEvent, S as CalendarSource, bc as CaptureMode, $ as Checkpoint, bd as CodexCliReasoningEffort, be as CodexCompactionFlushMode, aT as CodexCompatConfig, bf as CodexConnectorConfig, aI as CodingContext, aN as CodingModeConfig, bg as CompressionGuidelineActivationState, a9 as CompressionGuidelineOptimizerActionSummary, a8 as CompressionGuidelineOptimizerEventCounts, aa as CompressionGuidelineOptimizerRuleUpdate, bh as CompressionGuidelineOptimizerSourceWindow, C as CompressionGuidelineOptimizerState, bi as ConfidenceTier, bj as ConsolidationAction, bk as ConsolidationItem, aL as ConsolidationObservation, ag as ConsolidationResult, s as ContinuityImprovementLoop, r as ContinuityIncidentCloseInput, p as ContinuityIncidentOpenInput, q as ContinuityIncidentRecord, bl as ContinuityIncidentState, bm as ContinuityLoopCadence, u as ContinuityLoopReviewInput, bn as ContinuityLoopStatus, t as ContinuityLoopUpsertInput, bo as ContradictionScanConfig, as as ConversationThread, bp as CronConversationRecallMode, bq as CronRecallMode, aU as DEFAULT_RECALL_DISCLOSURE, ah as DaySummaryResult, br as DreamingConfig, bs as DreamingNarrativePromptStyle, bt as DreamsDeepSleepConfig, bu as DreamsLightSleepConfig, aw as DreamsPhase, bv as DreamsPhaseStatus, bw as DreamsPhasesConfig, bx as DreamsRemConfig, ax as DreamsRunResult, av as DreamsStatusResult, by as EngramTraceEvent, w as EntityActivityEntry, x as EntityFile, ac as EntityMention, v as EntityRelationship, ad as EntitySchemaDefinition, ae as EntitySchemaSectionDefinition, E as EntityStructuredSection, aM as EntityTimelineEntry, aV as ExtractedFact, bz as ExtractedProcedureStep, bA as ExtractedQuestion, bB as ExtractedReasoningTrace, bC as ExtractedReasoningTraceStep, bD as ExtractedRelationship, bE as ExtractionPassSource, af as ExtractionResult, F as FileHygieneConfig, G as GatewayConfig, bF as GitHubLiveConnectorConfig, bG as GmailLiveConnectorConfig, bH as GoogleDriveLiveConnectorConfig, bI as HeartbeatConfig, bJ as HeartbeatDetectionMode, a0 as HourlySummary, J as IdentityInjectionMode, a5 as ImportanceLevel, I as ImportanceScore, a2 as LifecycleState, L as LiveConnectorsConfig, bK as LlmTraceCallback, bL as LlmTraceEvent, ak as MemoryActionEligibilityContext, aW as MemoryActionEligibilitySource, m as MemoryActionEvent, bM as MemoryActionOutcome, bN as MemoryActionPolicyDecision, al as MemoryActionPolicyResult, bO as MemoryActionStatus, ab as MemoryActionType, M as MemoryCategory, g as MemoryFile, j as MemoryFrontmatter, ai as MemoryIntent, n as MemoryLifecycleEvent, am as MemoryLifecycleEventType, an as MemoryLifecycleStateSummary, i as MemoryLink, bP as MemoryLinkType, aX as MemoryObservation, bQ as MemoryOsPresetName, z as MemoryProjectionCurrentState, aY as MemoryScope, h as MemoryStatus, D as MemorySummary, l as MetaState, bR as ModelApi, bS as ModelDefinitionConfig, bT as ModelProviderAuthMode, ao as ModelProviderConfig, bU as NamespacePolicy, ap as NativeKnowledgeConfig, bV as NativeKnowledgeFolderRuleConfig, bW as NativeKnowledgeObsidianVaultConfig, bX as NativeKnowledgeOpenClawWorkspaceConfig, bY as NotionLiveConnectorConfig, P as PluginConfig, a4 as PolicyClass, bZ as PrincipalFromSessionKeyMode, b_ as PrincipalRule, b$ as ProceduralConfig, aj as QmdSearchExplain, Z as QmdSearchResult, c0 as QuestionEntry, aZ as RECALL_DISCLOSURE_LEVELS, c1 as ReasoningEffort, K as RecallDisclosure, c2 as RecallPipelineConfig, H as RecallPlanMode, c3 as RecallSectionConfig, R as RecallTierExplain, c4 as RecallTraceEvent, c5 as RelevanceFeedback, aq as RetrievalTier, c6 as SPECULATIVE_TTL_DAYS, c7 as ScopeProfileAutoPromoteConfig, c8 as ScopeProfileConfig, at as ScopeProfileLayerId, au as ScopeProfilePromotionTarget, c9 as ScopeProfileTeamProjectConfig, ca as ScopeTeamConfig, cb as ScoredEntity, a6 as SecretRef, cc as SemanticChunkingConfigShape, a1 as SessionObserverBandConfig, cd as SignalLevel, ar as SignalScanResult, ce as SlotBehaviorConfig, cf as SlotMismatchMode, T as TopicScore, _ as TranscriptEntry, cg as TriggerMode, a3 as VerificationState, ch as confidenceTier, b3 as isRecallDisclosure } from './types-CgcCpUrf.js';
|
package/dist/types.js
CHANGED
|
@@ -7,6 +7,7 @@ interface VerifiedEpisodeResult {
|
|
|
7
7
|
verifiedMemoryIds: string[];
|
|
8
8
|
matchedFields: string[];
|
|
9
9
|
}
|
|
10
|
+
declare function compareVerifiedEpisodeResults(left: VerifiedEpisodeResult, right: VerifiedEpisodeResult): number;
|
|
10
11
|
declare function searchVerifiedEpisodes(options: {
|
|
11
12
|
memoryDir: string;
|
|
12
13
|
query: string;
|
|
@@ -14,4 +15,4 @@ declare function searchVerifiedEpisodes(options: {
|
|
|
14
15
|
boxRecallDays?: number;
|
|
15
16
|
}): Promise<VerifiedEpisodeResult[]>;
|
|
16
17
|
|
|
17
|
-
export { type VerifiedEpisodeResult, searchVerifiedEpisodes };
|
|
18
|
+
export { type VerifiedEpisodeResult, compareVerifiedEpisodeResults, searchVerifiedEpisodes };
|
package/dist/verified-recall.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
compareVerifiedEpisodeResults,
|
|
2
3
|
searchVerifiedEpisodes
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JSVFEHLL.js";
|
|
4
5
|
import "./chunk-HQ6NIBL6.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-NXCK7DO7.js";
|
|
6
7
|
import "./chunk-M7XQSUBB.js";
|
|
7
8
|
import "./chunk-5UZXUTVO.js";
|
|
8
9
|
import "./chunk-J6A3CX5N.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-AZBV4RRY.js";
|
|
10
11
|
import "./chunk-CPPS65WS.js";
|
|
11
12
|
import "./chunk-RULE4VG5.js";
|
|
12
13
|
import "./chunk-SCU65EZI.js";
|
|
@@ -25,6 +26,7 @@ import "./chunk-A6XUJE5D.js";
|
|
|
25
26
|
import "./chunk-P7FMDTKL.js";
|
|
26
27
|
import "./chunk-PZ5AY32C.js";
|
|
27
28
|
export {
|
|
29
|
+
compareVerifiedEpisodeResults,
|
|
28
30
|
searchVerifiedEpisodes
|
|
29
31
|
};
|
|
30
32
|
//# sourceMappingURL=verified-recall.js.map
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
projectNamespaceName,
|
|
39
39
|
projectTagProjectId,
|
|
40
40
|
} from "./coding/coding-namespace.js";
|
|
41
|
-
import { resolveGitContext } from "./coding/git-context.js";
|
|
41
|
+
import { resolveGitContext, stableHash } from "./coding/git-context.js";
|
|
42
42
|
import { defaultNamespaceForPrincipal } from "./namespaces/principal.js";
|
|
43
43
|
import type { CodingContext, PluginConfig } from "./types.js";
|
|
44
44
|
|
|
@@ -652,6 +652,91 @@ test("#1505 thread 2 compaction regression: flush/record overlay-derived key mat
|
|
|
652
652
|
);
|
|
653
653
|
});
|
|
654
654
|
|
|
655
|
+
test("#1501 scope profile lcmSearch fans out prefix-only reads across profile namespaces", async () => {
|
|
656
|
+
const probe = makeParityProbe({
|
|
657
|
+
...withSelfPolicyPrefix("pi-observer"),
|
|
658
|
+
namespacePolicies: [
|
|
659
|
+
{ name: "pi-observer", readPrincipals: ["pi-observer"], writePrincipals: ["pi-observer"] },
|
|
660
|
+
{ name: "shared", readPrincipals: ["pi-observer"], writePrincipals: [] },
|
|
661
|
+
],
|
|
662
|
+
defaultScopeProfile: "profilePrefix",
|
|
663
|
+
scopeProfiles: {
|
|
664
|
+
profilePrefix: {
|
|
665
|
+
readOrder: ["userGlobal", "serverShared"],
|
|
666
|
+
writeDefault: "userGlobal",
|
|
667
|
+
promotionTargets: [],
|
|
668
|
+
autoPromote: {
|
|
669
|
+
enabled: false,
|
|
670
|
+
targets: [],
|
|
671
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
672
|
+
minConfidenceTier: "explicit",
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
} as Partial<PluginConfig>);
|
|
677
|
+
const service = new EngramAccessService(probe.orch);
|
|
678
|
+
|
|
679
|
+
await service.lcmSearch({
|
|
680
|
+
query: "database",
|
|
681
|
+
sessionPrefix: "pi-observer:",
|
|
682
|
+
authenticatedPrincipal: "pi-observer",
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
assert.deepEqual(probe.searchSessionIds, [undefined, undefined]);
|
|
686
|
+
assert.deepEqual(probe.searchSessionPrefixes, [
|
|
687
|
+
encodeNs("pi-observer", "pi-observer:"),
|
|
688
|
+
encodeNs("shared", "pi-observer:"),
|
|
689
|
+
]);
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
test("#1501 scope profile lcmSearch reads the team-project profile key", async () => {
|
|
693
|
+
const probe = makeParityProbe({
|
|
694
|
+
...withSelfPolicyPrefix("pi-observer"),
|
|
695
|
+
defaultScopeProfile: "teamCoding",
|
|
696
|
+
scopeProfiles: {
|
|
697
|
+
teamCoding: {
|
|
698
|
+
readOrder: ["teamProject"],
|
|
699
|
+
writeDefault: "teamProject",
|
|
700
|
+
promotionTargets: ["teamProject"],
|
|
701
|
+
autoPromote: {
|
|
702
|
+
enabled: false,
|
|
703
|
+
targets: [],
|
|
704
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
705
|
+
minConfidenceTier: "explicit",
|
|
706
|
+
},
|
|
707
|
+
teamProject: { namespaceTemplate: "team-{teamId}-project-{projectHash}" },
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
teams: {
|
|
711
|
+
pi: {
|
|
712
|
+
principals: ["pi-observer"],
|
|
713
|
+
read: ["pi-observer"],
|
|
714
|
+
write: ["pi-observer"],
|
|
715
|
+
promote: ["pi-observer"],
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
} as Partial<PluginConfig>);
|
|
719
|
+
const service = new EngramAccessService(probe.orch);
|
|
720
|
+
|
|
721
|
+
await service.observe(
|
|
722
|
+
observeRequest({ sessionKey: "pi-observer:abc123", projectTag: "Remnic" }),
|
|
723
|
+
);
|
|
724
|
+
const expectedTeamProject = `team-pi-project-${stableHash(projectTagProjectId("Remnic"))}`;
|
|
725
|
+
const expectedKey = encodeNs(expectedTeamProject, "pi-observer:abc123");
|
|
726
|
+
assert.equal(probe.lcmWriteKeys[0], expectedKey);
|
|
727
|
+
|
|
728
|
+
await service.lcmSearch({
|
|
729
|
+
query: "what database are we using?",
|
|
730
|
+
sessionKey: "pi-observer:abc123",
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
assert.equal(
|
|
734
|
+
probe.searchSessionIds[0],
|
|
735
|
+
expectedKey,
|
|
736
|
+
"lcmSearch must read the same team-project key the scope-profile observe wrote",
|
|
737
|
+
);
|
|
738
|
+
});
|
|
739
|
+
|
|
655
740
|
test("#1505 round 3: access lcmSearch routes the session_id through the SCOPED (overlay) key", async () => {
|
|
656
741
|
// cursor "LCM search misses overlay keys" / codex "Route access LCM search
|
|
657
742
|
// through the scoped key". A project-scoped observe (no explicit namespace)
|
|
@@ -41,7 +41,8 @@ import {
|
|
|
41
41
|
projectNamespaceName,
|
|
42
42
|
projectTagProjectId,
|
|
43
43
|
} from "./coding/coding-namespace.js";
|
|
44
|
-
import { resolveGitContext } from "./coding/git-context.js";
|
|
44
|
+
import { resolveGitContext, stableHash } from "./coding/git-context.js";
|
|
45
|
+
import { namespaceCollectionName } from "./namespaces/search.js";
|
|
45
46
|
import type { CodingContext, PluginConfig } from "./types.js";
|
|
46
47
|
|
|
47
48
|
/**
|
|
@@ -212,6 +213,72 @@ test("#1495 projectTag: LCM, extraction, objective-state, and response all agree
|
|
|
212
213
|
);
|
|
213
214
|
});
|
|
214
215
|
|
|
216
|
+
test("#1501 scope profile exposes layered read/write/promotion diagnostics without changing user-project write default", async () => {
|
|
217
|
+
const probe = makeObserveProbe({
|
|
218
|
+
namespacePolicies: [
|
|
219
|
+
{ name: "pi-geek", readPrincipals: ["pi-geek"], writePrincipals: ["pi-geek"] },
|
|
220
|
+
{ name: "shared", readPrincipals: ["pi-geek"], writePrincipals: ["pi-geek"] },
|
|
221
|
+
],
|
|
222
|
+
principalFromSessionKeyMode: "prefix",
|
|
223
|
+
principalFromSessionKeyRules: [{ match: "pi-geek:", principal: "pi-geek" }],
|
|
224
|
+
scopeProfiles: {
|
|
225
|
+
teamCoding: {
|
|
226
|
+
readOrder: ["userProject", "teamProject", "userGlobal", "serverShared"],
|
|
227
|
+
writeDefault: "userProject",
|
|
228
|
+
promotionTargets: ["teamProject", "serverShared"],
|
|
229
|
+
teamProject: { namespaceTemplate: "team-{teamId}-project-{projectHash}" },
|
|
230
|
+
autoPromote: {
|
|
231
|
+
enabled: false,
|
|
232
|
+
targets: [],
|
|
233
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
234
|
+
minConfidenceTier: "explicit",
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
defaultScopeProfile: "teamCoding",
|
|
239
|
+
teams: {
|
|
240
|
+
pi: {
|
|
241
|
+
principals: ["pi-geek", "pi-friend"],
|
|
242
|
+
read: ["pi-geek", "pi-friend"],
|
|
243
|
+
write: ["pi-geek", "pi-friend"],
|
|
244
|
+
promote: ["pi-geek", "pi-friend"],
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
} as Partial<PluginConfig>);
|
|
248
|
+
const service = new EngramAccessService(probe.orch);
|
|
249
|
+
|
|
250
|
+
const res = await service.observe(
|
|
251
|
+
observeRequest({ sessionKey: "pi-geek:abc123", projectTag: "Remnic" }),
|
|
252
|
+
);
|
|
253
|
+
const expectedUserProject = combineNamespaces(
|
|
254
|
+
"pi-geek",
|
|
255
|
+
projectNamespaceName(projectTagProjectId("Remnic")),
|
|
256
|
+
);
|
|
257
|
+
const expectedTeamProject = `team-pi-project-${stableHash(projectTagProjectId("Remnic"))}`;
|
|
258
|
+
|
|
259
|
+
assert.equal(res.effectiveNamespace, expectedUserProject);
|
|
260
|
+
assert.equal(res.scopeDebug?.scopeProfile, "teamCoding");
|
|
261
|
+
assert.equal(res.scopeDebug?.writeLayer, "userProject");
|
|
262
|
+
assert.deepEqual(res.scopeDebug?.readNamespaces, [
|
|
263
|
+
expectedUserProject,
|
|
264
|
+
expectedTeamProject,
|
|
265
|
+
"pi-geek",
|
|
266
|
+
"shared",
|
|
267
|
+
]);
|
|
268
|
+
assert.deepEqual(
|
|
269
|
+
res.scopeDebug?.promotionTargets?.map((target) => [
|
|
270
|
+
target.target,
|
|
271
|
+
target.namespace,
|
|
272
|
+
target.authorized,
|
|
273
|
+
]),
|
|
274
|
+
[
|
|
275
|
+
["teamProject", expectedTeamProject, true],
|
|
276
|
+
["serverShared", "shared", true],
|
|
277
|
+
],
|
|
278
|
+
);
|
|
279
|
+
assert.equal(probe.extractionCalls[0]?.writeNamespaceOverride, expectedUserProject);
|
|
280
|
+
});
|
|
281
|
+
|
|
215
282
|
test("#1495 cwd (git repo): every observe side effect agrees on the effective namespace", async () => {
|
|
216
283
|
const repoDir = mkdtempSync(join(tmpdir(), "remnic-observe-git-"));
|
|
217
284
|
// A real (synthetic) git repo so resolveGitContext can read rev-parse output.
|
|
@@ -577,6 +644,120 @@ test("#1495 the scope plan's writeNamespace matches resolveCodingScopedWriteName
|
|
|
577
644
|
}
|
|
578
645
|
});
|
|
579
646
|
|
|
647
|
+
test("#1501 profile write auth rejects memory_store when no profile layer is writable", async () => {
|
|
648
|
+
const probe = makeObserveProbe({
|
|
649
|
+
namespacePolicies: [
|
|
650
|
+
{ name: "pi-observer", readPrincipals: ["pi-observer"], writePrincipals: [] },
|
|
651
|
+
{ name: "shared", readPrincipals: ["pi-observer"], writePrincipals: [] },
|
|
652
|
+
],
|
|
653
|
+
principalFromSessionKeyMode: "prefix",
|
|
654
|
+
principalFromSessionKeyRules: [{ match: "pi-observer:", principal: "pi-observer" }],
|
|
655
|
+
scopeProfiles: {
|
|
656
|
+
teamCoding: {
|
|
657
|
+
readOrder: ["userProject", "teamProject", "serverShared"],
|
|
658
|
+
writeDefault: "userProject",
|
|
659
|
+
promotionTargets: ["teamProject", "serverShared"],
|
|
660
|
+
teamProject: { namespaceTemplate: "team-{teamId}-project-{projectHash}" },
|
|
661
|
+
autoPromote: {
|
|
662
|
+
enabled: false,
|
|
663
|
+
targets: [],
|
|
664
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
665
|
+
minConfidenceTier: "explicit",
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
},
|
|
669
|
+
defaultScopeProfile: "teamCoding",
|
|
670
|
+
teams: {
|
|
671
|
+
pi: {
|
|
672
|
+
principals: ["pi-observer"],
|
|
673
|
+
read: ["pi-observer"],
|
|
674
|
+
write: [],
|
|
675
|
+
promote: [],
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
} as Partial<PluginConfig>);
|
|
679
|
+
probe.contexts.set("pi-observer:abc123", {
|
|
680
|
+
projectId: projectTagProjectId("Remnic"),
|
|
681
|
+
branch: null,
|
|
682
|
+
rootPath: projectTagProjectId("Remnic"),
|
|
683
|
+
defaultBranch: null,
|
|
684
|
+
});
|
|
685
|
+
const service = new EngramAccessService(probe.orch);
|
|
686
|
+
const internals = service as unknown as {
|
|
687
|
+
resolveMemoryScopePlan: (r: unknown) => Promise<{ writeNamespace: string }>;
|
|
688
|
+
resolveCodingScopedWriteNamespace: (r: unknown) => Promise<string>;
|
|
689
|
+
};
|
|
690
|
+
const req = {
|
|
691
|
+
sessionKey: "pi-observer:abc123",
|
|
692
|
+
authenticatedPrincipal: "pi-observer",
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
await assert.rejects(
|
|
696
|
+
() => internals.resolveMemoryScopePlan.call(service, req),
|
|
697
|
+
/scope profile teamCoding has no writable layer/,
|
|
698
|
+
);
|
|
699
|
+
await assert.rejects(
|
|
700
|
+
() => internals.resolveCodingScopedWriteNamespace.call(service, req),
|
|
701
|
+
/scope profile teamCoding has no writable layer/,
|
|
702
|
+
);
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
test("#1501 team-project profile observe reports the profile write namespace as legacy namespace", async () => {
|
|
706
|
+
const projectId = projectTagProjectId("Remnic");
|
|
707
|
+
const expectedTeamProject = `team-pi-project-${stableHash(projectId)}`;
|
|
708
|
+
const probe = makeObserveProbe({
|
|
709
|
+
namespacePolicies: [
|
|
710
|
+
{
|
|
711
|
+
name: expectedTeamProject,
|
|
712
|
+
readPrincipals: ["pi-observer"],
|
|
713
|
+
writePrincipals: ["pi-observer"],
|
|
714
|
+
},
|
|
715
|
+
],
|
|
716
|
+
principalFromSessionKeyMode: "prefix",
|
|
717
|
+
principalFromSessionKeyRules: [{ match: "pi-observer:", principal: "pi-observer" }],
|
|
718
|
+
scopeProfiles: {
|
|
719
|
+
teamCoding: {
|
|
720
|
+
readOrder: ["teamProject", "serverShared"],
|
|
721
|
+
writeDefault: "teamProject",
|
|
722
|
+
promotionTargets: ["teamProject"],
|
|
723
|
+
teamProject: { namespaceTemplate: "team-{teamId}-project-{projectHash}" },
|
|
724
|
+
autoPromote: {
|
|
725
|
+
enabled: false,
|
|
726
|
+
targets: [],
|
|
727
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
728
|
+
minConfidenceTier: "explicit",
|
|
729
|
+
},
|
|
730
|
+
},
|
|
731
|
+
},
|
|
732
|
+
defaultScopeProfile: "teamCoding",
|
|
733
|
+
teams: {
|
|
734
|
+
pi: {
|
|
735
|
+
principals: ["pi-observer"],
|
|
736
|
+
read: ["pi-observer"],
|
|
737
|
+
write: ["pi-observer"],
|
|
738
|
+
promote: ["pi-observer"],
|
|
739
|
+
},
|
|
740
|
+
},
|
|
741
|
+
} as Partial<PluginConfig>);
|
|
742
|
+
const service = new EngramAccessService(probe.orch);
|
|
743
|
+
|
|
744
|
+
const res = await service.observe(
|
|
745
|
+
observeRequest({
|
|
746
|
+
sessionKey: "pi-observer:abc123",
|
|
747
|
+
authenticatedPrincipal: "pi-observer",
|
|
748
|
+
projectTag: "Remnic",
|
|
749
|
+
}),
|
|
750
|
+
);
|
|
751
|
+
|
|
752
|
+
assert.equal(res.scopeDebug?.baseNamespace, "pi-observer");
|
|
753
|
+
assert.equal(res.scopeDebug?.writeLayer, "teamProject");
|
|
754
|
+
assert.equal(res.scopeDebug?.codingOverlayApplied, true);
|
|
755
|
+
assert.equal(res.namespace, expectedTeamProject);
|
|
756
|
+
assert.equal(res.effectiveNamespace, expectedTeamProject);
|
|
757
|
+
assert.equal(probe.lcmCalls[0]?.sessionKey, encodeNs(expectedTeamProject, "pi-observer:abc123"));
|
|
758
|
+
assert.equal(probe.extractionCalls[0]?.writeNamespaceOverride, expectedTeamProject);
|
|
759
|
+
});
|
|
760
|
+
|
|
580
761
|
test("#1495 skipExtraction does not enqueue extraction but still archives LCM under the effective namespace", async () => {
|
|
581
762
|
const probe = makeObserveProbe(withSelfPolicyPrefix("pi-geek"));
|
|
582
763
|
const service = new EngramAccessService(probe.orch);
|
|
@@ -597,3 +778,104 @@ test("#1495 skipExtraction does not enqueue extraction but still archives LCM un
|
|
|
597
778
|
assert.equal(probe.extractionCalls.length, 0);
|
|
598
779
|
assert.equal(probe.lcmCalls[0].sessionKey, encodeNs(expected, "pi-geek:abc123"));
|
|
599
780
|
});
|
|
781
|
+
|
|
782
|
+
test("#1501 implicit memorySearch honors active scope profile readOrder", async () => {
|
|
783
|
+
let searchedNamespaces: string[] | null = null;
|
|
784
|
+
const config = {
|
|
785
|
+
namespacesEnabled: true,
|
|
786
|
+
defaultNamespace: "default",
|
|
787
|
+
sharedNamespace: "shared",
|
|
788
|
+
memoryDir: "/synthetic/remnic-memory-search",
|
|
789
|
+
namespacePolicies: [
|
|
790
|
+
{ name: "pi-geek", readPrincipals: ["pi-geek"], writePrincipals: ["pi-geek"] },
|
|
791
|
+
{ name: "shared", readPrincipals: ["pi-geek"], writePrincipals: ["pi-geek"] },
|
|
792
|
+
],
|
|
793
|
+
defaultRecallNamespaces: ["self", "shared"],
|
|
794
|
+
defaultScopeProfile: "projectOnly",
|
|
795
|
+
scopeProfiles: {
|
|
796
|
+
projectOnly: {
|
|
797
|
+
readOrder: ["userProject"],
|
|
798
|
+
writeDefault: "userProject",
|
|
799
|
+
promotionTargets: [],
|
|
800
|
+
autoPromote: {
|
|
801
|
+
enabled: false,
|
|
802
|
+
targets: [],
|
|
803
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
804
|
+
minConfidenceTier: "explicit",
|
|
805
|
+
},
|
|
806
|
+
},
|
|
807
|
+
},
|
|
808
|
+
codingMode: { projectScope: true },
|
|
809
|
+
} as unknown as PluginConfig;
|
|
810
|
+
const orch = {
|
|
811
|
+
config,
|
|
812
|
+
qmd: { isAvailable: () => true },
|
|
813
|
+
searchAcrossNamespaces: async (options: { namespaces: string[] }) => {
|
|
814
|
+
searchedNamespaces = options.namespaces;
|
|
815
|
+
return [];
|
|
816
|
+
},
|
|
817
|
+
} as unknown as Orchestrator;
|
|
818
|
+
const service = new EngramAccessService(orch);
|
|
819
|
+
|
|
820
|
+
const result = await service.memorySearch({
|
|
821
|
+
query: "deployment",
|
|
822
|
+
principal: "pi-geek",
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
assert.equal(result.count, 0);
|
|
826
|
+
assert.equal(
|
|
827
|
+
searchedNamespaces,
|
|
828
|
+
null,
|
|
829
|
+
"userProject-only profiles without project context must not fall back to shared/global search",
|
|
830
|
+
);
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
test("#1501 memorySearch collection names stay constrained to active scope profile namespaces", async () => {
|
|
834
|
+
let searchedNamespaces: string[] | null = null;
|
|
835
|
+
const config = {
|
|
836
|
+
namespacesEnabled: true,
|
|
837
|
+
defaultNamespace: "default",
|
|
838
|
+
sharedNamespace: "shared",
|
|
839
|
+
memoryDir: "/synthetic/remnic-memory-search-collection",
|
|
840
|
+
qmdCollection: "memories",
|
|
841
|
+
namespacePolicies: [
|
|
842
|
+
{ name: "pi-geek", readPrincipals: ["pi-geek"], writePrincipals: ["pi-geek"] },
|
|
843
|
+
{ name: "shared", readPrincipals: ["pi-geek"], writePrincipals: ["pi-geek"] },
|
|
844
|
+
],
|
|
845
|
+
defaultRecallNamespaces: ["self", "shared"],
|
|
846
|
+
defaultScopeProfile: "privateOnly",
|
|
847
|
+
scopeProfiles: {
|
|
848
|
+
privateOnly: {
|
|
849
|
+
readOrder: ["userGlobal"],
|
|
850
|
+
writeDefault: "userGlobal",
|
|
851
|
+
promotionTargets: [],
|
|
852
|
+
autoPromote: {
|
|
853
|
+
enabled: false,
|
|
854
|
+
targets: [],
|
|
855
|
+
categories: ["fact", "correction", "decision", "preference"],
|
|
856
|
+
minConfidenceTier: "explicit",
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
codingMode: { projectScope: true },
|
|
861
|
+
} as unknown as PluginConfig;
|
|
862
|
+
const orch = {
|
|
863
|
+
config,
|
|
864
|
+
qmd: { isAvailable: () => true },
|
|
865
|
+
searchAcrossNamespaces: async (options: { namespaces: string[] }) => {
|
|
866
|
+
searchedNamespaces = options.namespaces;
|
|
867
|
+
return [];
|
|
868
|
+
},
|
|
869
|
+
} as unknown as Orchestrator;
|
|
870
|
+
const service = new EngramAccessService(orch);
|
|
871
|
+
const sharedCollection = namespaceCollectionName(config.qmdCollection, "shared", {
|
|
872
|
+
defaultNamespace: config.defaultNamespace,
|
|
873
|
+
useLegacyDefaultCollection: false,
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
await assert.rejects(
|
|
877
|
+
() => service.memorySearch({ query: "deployment", principal: "pi-geek", collection: sharedCollection }),
|
|
878
|
+
/collection is not namespace-scoped/,
|
|
879
|
+
);
|
|
880
|
+
assert.equal(searchedNamespaces, null);
|
|
881
|
+
});
|