@remnic/core 9.3.689 → 9.3.690

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.
Files changed (158) hide show
  1. package/dist/access-boundary.d.ts +5 -4
  2. package/dist/access-boundary.js +10 -9
  3. package/dist/access-cli.js +86 -22
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +4 -3
  6. package/dist/access-http.js +13 -12
  7. package/dist/access-mcp.d.ts +11 -3
  8. package/dist/access-mcp.js +12 -11
  9. package/dist/access-operations.d.ts +11 -5
  10. package/dist/access-operations.js +13 -10
  11. package/dist/{access-service-DmCHJ4cH.d.ts → access-service-Dujr3MTm.d.ts} +62 -2
  12. package/dist/access-service.d.ts +4 -3
  13. package/dist/access-service.js +9 -8
  14. package/dist/access-surface-catalog.d.ts +4 -3
  15. package/dist/access-surface-catalog.js +2 -0
  16. package/dist/access-surface-catalog.js.map +1 -1
  17. package/dist/bootstrap.d.ts +3 -2
  18. package/dist/briefing.d.ts +1 -0
  19. package/dist/briefing.js +3 -2
  20. package/dist/buffer.d.ts +1 -0
  21. package/dist/{catalog-COqWZlZ6.d.ts → catalog-CKPtJ114.d.ts} +1 -1
  22. package/dist/causal-consolidation.js +4 -3
  23. package/dist/causal-consolidation.js.map +1 -1
  24. package/dist/{chunk-B4XVLHJA.js → chunk-2N6UNJSX.js} +2 -2
  25. package/dist/{chunk-OWFY6NGQ.js → chunk-46URPRE6.js} +2 -2
  26. package/dist/chunk-46URPRE6.js.map +1 -0
  27. package/dist/{chunk-4N3TFFPH.js → chunk-54PVJDO5.js} +2 -2
  28. package/dist/{chunk-PH3HOKYW.js → chunk-67MMWC74.js} +2 -2
  29. package/dist/{chunk-STOEE37X.js → chunk-BKAMHZYR.js} +2 -2
  30. package/dist/{chunk-JZBFL7RI.js → chunk-CE6CBRCV.js} +429 -2237
  31. package/dist/chunk-CE6CBRCV.js.map +1 -0
  32. package/dist/{chunk-UHUZXWDX.js → chunk-CP2NZQLT.js} +15 -4
  33. package/dist/chunk-CP2NZQLT.js.map +1 -0
  34. package/dist/{chunk-BLIWOONZ.js → chunk-CUNTLEJP.js} +4 -12
  35. package/dist/chunk-CUNTLEJP.js.map +1 -0
  36. package/dist/{chunk-W63OY3J7.js → chunk-CWE74HRG.js} +3 -3
  37. package/dist/{chunk-VX6OBUDW.js → chunk-GR77Z2BM.js} +2 -2
  38. package/dist/{chunk-SAEZIIID.js → chunk-LXIEXSHU.js} +2 -2
  39. package/dist/{chunk-Z2M6YTAJ.js → chunk-NSVXK7M5.js} +33 -4
  40. package/dist/chunk-NSVXK7M5.js.map +1 -0
  41. package/dist/{chunk-UXLZOVCN.js → chunk-OMKUJTVJ.js} +37 -5
  42. package/dist/chunk-OMKUJTVJ.js.map +1 -0
  43. package/dist/{chunk-GS55WYRL.js → chunk-PHZKALOE.js} +2 -2
  44. package/dist/{chunk-6O6A6YUO.js → chunk-RGNEARXW.js} +3 -3
  45. package/dist/{chunk-4FE2K57M.js → chunk-RTFAZOIR.js} +2 -2
  46. package/dist/{chunk-UTYBJR7M.js → chunk-SB6CQTKP.js} +2 -2
  47. package/dist/chunk-SVOZFLIQ.js +16 -0
  48. package/dist/chunk-SVOZFLIQ.js.map +1 -0
  49. package/dist/{chunk-JPETDXED.js → chunk-TYF3D4MS.js} +2 -2
  50. package/dist/{chunk-WIHPNY65.js → chunk-UD5OKH4J.js} +2 -2
  51. package/dist/{chunk-QANVLERJ.js → chunk-UPIBE2DK.js} +2 -2
  52. package/dist/{chunk-RHXFYIHA.js → chunk-WROKD3XC.js} +33 -18
  53. package/dist/chunk-WROKD3XC.js.map +1 -0
  54. package/dist/{chunk-2SNKUSQC.js → chunk-X5J3JZR3.js} +4 -4
  55. package/dist/{chunk-OV4D5T7V.js → chunk-X7RLU5CR.js} +2 -2
  56. package/dist/{chunk-QSQW54U5.js → chunk-XKUKJIOY.js} +30 -7
  57. package/dist/chunk-XKUKJIOY.js.map +1 -0
  58. package/dist/{chunk-XU7363OX.js → chunk-Z7KILAOU.js} +603 -9
  59. package/dist/chunk-Z7KILAOU.js.map +1 -0
  60. package/dist/chunk-ZU7N3S6V.js +2190 -0
  61. package/dist/chunk-ZU7N3S6V.js.map +1 -0
  62. package/dist/{chunk-T422SYM6.js → chunk-ZUDM75KG.js} +5 -5
  63. package/dist/{cli-D8nZ2MPH.d.ts → cli-BkDp6WNi.d.ts} +2 -2
  64. package/dist/cli.d.ts +5 -4
  65. package/dist/cli.js +25 -23
  66. package/dist/compounding/engine.d.ts +1 -0
  67. package/dist/compounding/engine.js +3 -2
  68. package/dist/connectors/codex-materialize-runner.js +3 -2
  69. package/dist/connectors/index.js +3 -2
  70. package/dist/consolidation-provenance-check.d.ts +1 -0
  71. package/dist/consolidation-undo.d.ts +1 -0
  72. package/dist/contradiction/index.d.ts +1 -0
  73. package/dist/conversation-index/backend.js +2 -2
  74. package/dist/entity-retrieval.d.ts +1 -0
  75. package/dist/entity-retrieval.js +3 -2
  76. package/dist/explicit-capture.d.ts +3 -2
  77. package/dist/index.d.ts +6 -5
  78. package/dist/index.js +34 -31
  79. package/dist/index.js.map +1 -1
  80. package/dist/lcm/engine.js +2 -2
  81. package/dist/lcm/index.js +2 -2
  82. package/dist/maintenance/memory-governance.js +3 -2
  83. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -2
  84. package/dist/maintenance/rebuild-memory-projection.js +4 -3
  85. package/dist/mcp-memory-inspector-app.d.ts +4 -3
  86. package/dist/memory-worth-outcomes.d.ts +1 -0
  87. package/dist/namespaces/migrate.d.ts +2 -1
  88. package/dist/namespaces/migrate.js +8 -7
  89. package/dist/namespaces/search.js +4 -4
  90. package/dist/namespaces/storage.d.ts +2 -1
  91. package/dist/namespaces/storage.js +3 -2
  92. package/dist/operator-toolkit.d.ts +1 -0
  93. package/dist/operator-toolkit.js +11 -9
  94. package/dist/{orchestrator-CA6ouzBn.d.ts → orchestrator-B7ixmUkP.d.ts} +145 -1
  95. package/dist/orchestrator.d.ts +3 -2
  96. package/dist/orchestrator.js +18 -16
  97. package/dist/schemas.d.ts +10 -10
  98. package/dist/search/factory.js +3 -3
  99. package/dist/search/index.js +3 -3
  100. package/dist/semantic-consolidation.js +4 -3
  101. package/dist/semantic-rule-promotion.js +3 -2
  102. package/dist/semantic-rule-verifier.js +3 -2
  103. package/dist/storage.d.ts +3 -27
  104. package/dist/storage.js +5 -3
  105. package/dist/structured-attributes.d.ts +29 -0
  106. package/dist/structured-attributes.js +8 -0
  107. package/dist/structured-attributes.js.map +1 -0
  108. package/dist/temporal-supersession.d.ts +1 -0
  109. package/dist/tier-migration.d.ts +1 -0
  110. package/dist/verified-recall.js +3 -2
  111. package/package.json +2 -2
  112. package/src/access-boundary.ts +2 -1
  113. package/src/access-cli.test.ts +40 -0
  114. package/src/access-cli.ts +90 -2
  115. package/src/access-http.ts +35 -6
  116. package/src/access-mcp.ts +34 -0
  117. package/src/access-operations.ts +45 -0
  118. package/src/access-service.ts +60 -0
  119. package/src/access-surface-catalog.test.ts +1 -1
  120. package/src/access-surface-catalog.ts +2 -0
  121. package/src/cli.ts +18 -0
  122. package/src/coding/architecture-card.test.ts +544 -0
  123. package/src/coding/architecture-card.ts +687 -0
  124. package/src/coding/architecture-surfaces.test.ts +579 -0
  125. package/src/coding/architecture-surfaces.ts +457 -0
  126. package/src/maintenance/namespace-maintenance-fanout.test.ts +595 -0
  127. package/src/maintenance/namespace-maintenance-fanout.ts +318 -0
  128. package/src/maintenance/namespace-planner.ts +74 -16
  129. package/src/operator-toolkit.ts +25 -0
  130. package/src/orchestrator.ts +144 -0
  131. package/src/storage.ts +6 -20
  132. package/src/structured-attributes.ts +39 -0
  133. package/dist/chunk-BLIWOONZ.js.map +0 -1
  134. package/dist/chunk-JZBFL7RI.js.map +0 -1
  135. package/dist/chunk-OWFY6NGQ.js.map +0 -1
  136. package/dist/chunk-QSQW54U5.js.map +0 -1
  137. package/dist/chunk-RHXFYIHA.js.map +0 -1
  138. package/dist/chunk-UHUZXWDX.js.map +0 -1
  139. package/dist/chunk-UXLZOVCN.js.map +0 -1
  140. package/dist/chunk-XU7363OX.js.map +0 -1
  141. package/dist/chunk-Z2M6YTAJ.js.map +0 -1
  142. /package/dist/{chunk-B4XVLHJA.js.map → chunk-2N6UNJSX.js.map} +0 -0
  143. /package/dist/{chunk-4N3TFFPH.js.map → chunk-54PVJDO5.js.map} +0 -0
  144. /package/dist/{chunk-PH3HOKYW.js.map → chunk-67MMWC74.js.map} +0 -0
  145. /package/dist/{chunk-STOEE37X.js.map → chunk-BKAMHZYR.js.map} +0 -0
  146. /package/dist/{chunk-W63OY3J7.js.map → chunk-CWE74HRG.js.map} +0 -0
  147. /package/dist/{chunk-VX6OBUDW.js.map → chunk-GR77Z2BM.js.map} +0 -0
  148. /package/dist/{chunk-SAEZIIID.js.map → chunk-LXIEXSHU.js.map} +0 -0
  149. /package/dist/{chunk-GS55WYRL.js.map → chunk-PHZKALOE.js.map} +0 -0
  150. /package/dist/{chunk-6O6A6YUO.js.map → chunk-RGNEARXW.js.map} +0 -0
  151. /package/dist/{chunk-4FE2K57M.js.map → chunk-RTFAZOIR.js.map} +0 -0
  152. /package/dist/{chunk-UTYBJR7M.js.map → chunk-SB6CQTKP.js.map} +0 -0
  153. /package/dist/{chunk-JPETDXED.js.map → chunk-TYF3D4MS.js.map} +0 -0
  154. /package/dist/{chunk-WIHPNY65.js.map → chunk-UD5OKH4J.js.map} +0 -0
  155. /package/dist/{chunk-QANVLERJ.js.map → chunk-UPIBE2DK.js.map} +0 -0
  156. /package/dist/{chunk-2SNKUSQC.js.map → chunk-X5J3JZR3.js.map} +0 -0
  157. /package/dist/{chunk-OV4D5T7V.js.map → chunk-X7RLU5CR.js.map} +0 -0
  158. /package/dist/{chunk-T422SYM6.js.map → chunk-ZUDM75KG.js.map} +0 -0
package/dist/schemas.d.ts CHANGED
@@ -351,13 +351,13 @@ declare const ExtractedRelationshipSchema: z.ZodObject<{
351
351
  promptedByQuestion: z.ZodNullable<z.ZodOptional<z.ZodString>>;
352
352
  }, "strip", z.ZodTypeAny, {
353
353
  source: string;
354
- label: string;
355
354
  target: string;
355
+ label: string;
356
356
  promptedByQuestion?: string | null | undefined;
357
357
  }, {
358
358
  source: string;
359
- label: string;
360
359
  target: string;
360
+ label: string;
361
361
  promptedByQuestion?: string | null | undefined;
362
362
  }>;
363
363
  declare const ProactiveExtractionResultSchema: z.ZodObject<{
@@ -620,13 +620,13 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
620
620
  promptedByQuestion: z.ZodNullable<z.ZodOptional<z.ZodString>>;
621
621
  }, "strip", z.ZodTypeAny, {
622
622
  source: string;
623
- label: string;
624
623
  target: string;
624
+ label: string;
625
625
  promptedByQuestion?: string | null | undefined;
626
626
  }, {
627
627
  source: string;
628
- label: string;
629
628
  target: string;
629
+ label: string;
630
630
  promptedByQuestion?: string | null | undefined;
631
631
  }>, "many">>>;
632
632
  }, "strip", z.ZodTypeAny, {
@@ -674,8 +674,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
674
674
  profileUpdates: string[];
675
675
  relationships?: {
676
676
  source: string;
677
- label: string;
678
677
  target: string;
678
+ label: string;
679
679
  promptedByQuestion?: string | null | undefined;
680
680
  }[] | null | undefined;
681
681
  }, {
@@ -723,8 +723,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
723
723
  profileUpdates: string[];
724
724
  relationships?: {
725
725
  source: string;
726
- label: string;
727
726
  target: string;
727
+ label: string;
728
728
  promptedByQuestion?: string | null | undefined;
729
729
  }[] | null | undefined;
730
730
  }>;
@@ -1002,13 +1002,13 @@ declare const ExtractionResultSchema: z.ZodObject<{
1002
1002
  promptedByQuestion: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1003
1003
  }, "strip", z.ZodTypeAny, {
1004
1004
  source: string;
1005
- label: string;
1006
1005
  target: string;
1006
+ label: string;
1007
1007
  promptedByQuestion?: string | null | undefined;
1008
1008
  }, {
1009
1009
  source: string;
1010
- label: string;
1011
1010
  target: string;
1011
+ label: string;
1012
1012
  promptedByQuestion?: string | null | undefined;
1013
1013
  }>, "many">>>;
1014
1014
  }, "strip", z.ZodTypeAny, {
@@ -1061,8 +1061,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
1061
1061
  profileUpdates: string[];
1062
1062
  relationships?: {
1063
1063
  source: string;
1064
- label: string;
1065
1064
  target: string;
1065
+ label: string;
1066
1066
  promptedByQuestion?: string | null | undefined;
1067
1067
  }[] | null | undefined;
1068
1068
  identityReflection?: string | null | undefined;
@@ -1116,8 +1116,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
1116
1116
  profileUpdates: string[];
1117
1117
  relationships?: {
1118
1118
  source: string;
1119
- label: string;
1120
1119
  target: string;
1120
+ label: string;
1121
1121
  promptedByQuestion?: string | null | undefined;
1122
1122
  }[] | null | undefined;
1123
1123
  identityReflection?: string | null | undefined;
@@ -2,7 +2,7 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-JPETDXED.js";
5
+ } from "../chunk-TYF3D4MS.js";
6
6
  import "../chunk-5CEJH5ZN.js";
7
7
  import "../chunk-WRFKZEO6.js";
8
8
  import "../chunk-CYEPCZN5.js";
@@ -11,10 +11,10 @@ import "../chunk-SANZHXY2.js";
11
11
  import "../chunk-AER6MT24.js";
12
12
  import "../chunk-EHISUJFN.js";
13
13
  import "../chunk-CINZGPSJ.js";
14
- import "../chunk-T422SYM6.js";
14
+ import "../chunk-ZUDM75KG.js";
15
+ import "../chunk-KCQA46NR.js";
15
16
  import "../chunk-SJHM6I4J.js";
16
17
  import "../chunk-XBZQRZ6G.js";
17
- import "../chunk-KCQA46NR.js";
18
18
  import "../chunk-K43PI6DQ.js";
19
19
  import "../chunk-YNQ6DFSV.js";
20
20
  import "../chunk-O75CRYGF.js";
@@ -2,7 +2,7 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-JPETDXED.js";
5
+ } from "../chunk-TYF3D4MS.js";
6
6
  import {
7
7
  LanceDbBackend
8
8
  } from "../chunk-5CEJH5ZN.js";
@@ -25,10 +25,10 @@ import {
25
25
  EmbedHelper
26
26
  } from "../chunk-EHISUJFN.js";
27
27
  import "../chunk-CINZGPSJ.js";
28
- import "../chunk-T422SYM6.js";
28
+ import "../chunk-ZUDM75KG.js";
29
+ import "../chunk-KCQA46NR.js";
29
30
  import "../chunk-SJHM6I4J.js";
30
31
  import "../chunk-XBZQRZ6G.js";
31
- import "../chunk-KCQA46NR.js";
32
32
  import "../chunk-K43PI6DQ.js";
33
33
  import "../chunk-YNQ6DFSV.js";
34
34
  import "../chunk-O75CRYGF.js";
@@ -7,17 +7,18 @@ import {
7
7
  materializeAfterSemanticConsolidation,
8
8
  parseConsolidationResponse,
9
9
  parseOperatorAwareConsolidationResponse
10
- } from "./chunk-GS55WYRL.js";
11
- import "./chunk-QANVLERJ.js";
10
+ } from "./chunk-PHZKALOE.js";
11
+ import "./chunk-UPIBE2DK.js";
12
12
  import "./chunk-UUH4YQOF.js";
13
13
  import {
14
14
  resolveExtensionsRoot
15
15
  } from "./chunk-JLNBQWZ2.js";
16
16
  import "./chunk-3UXOZBHV.js";
17
- import "./chunk-BLIWOONZ.js";
17
+ import "./chunk-CUNTLEJP.js";
18
18
  import "./chunk-M7XQSUBB.js";
19
19
  import "./chunk-5UZXUTVO.js";
20
20
  import "./chunk-5GPPACXK.js";
21
+ import "./chunk-SVOZFLIQ.js";
21
22
  import "./chunk-J6A3CX5N.js";
22
23
  import "./chunk-NGFEWFNK.js";
23
24
  import "./chunk-MB5RSUW6.js";
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  promoteSemanticRuleFromMemory,
3
3
  setSemanticRulePromotionTestHooks
4
- } from "./chunk-UTYBJR7M.js";
5
- import "./chunk-BLIWOONZ.js";
4
+ } from "./chunk-SB6CQTKP.js";
5
+ import "./chunk-CUNTLEJP.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
8
  import "./chunk-5GPPACXK.js";
9
+ import "./chunk-SVOZFLIQ.js";
9
10
  import "./chunk-J6A3CX5N.js";
10
11
  import "./chunk-NGFEWFNK.js";
11
12
  import "./chunk-MB5RSUW6.js";
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  compareVerifiedSemanticRuleResults,
3
3
  searchVerifiedSemanticRules
4
- } from "./chunk-PH3HOKYW.js";
5
- import "./chunk-BLIWOONZ.js";
4
+ } from "./chunk-67MMWC74.js";
5
+ import "./chunk-CUNTLEJP.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
8
  import "./chunk-5GPPACXK.js";
9
+ import "./chunk-SVOZFLIQ.js";
9
10
  import "./chunk-J6A3CX5N.js";
10
11
  import "./chunk-NGFEWFNK.js";
11
12
  import "./chunk-MB5RSUW6.js";
package/dist/storage.d.ts CHANGED
@@ -2,6 +2,7 @@ import { VersioningConfig } from './page-versioning.js';
2
2
  import { ConsolidationOperator } from './consolidation-operator.js';
3
3
  import { P as PluginConfig, h as MemoryStatus, M as MemoryCategory, I as ImportanceScore, i as MemoryLink, j as MemoryFrontmatter, g as MemoryFile, E as EntityStructuredSection, k as BufferState, l as MetaState, m as MemoryActionEvent, n as MemoryLifecycleEvent, o as BufferSurpriseEvent, B as BehaviorSignalEvent, C as CompressionGuidelineOptimizerState, p as ContinuityIncidentOpenInput, q as ContinuityIncidentRecord, r as ContinuityIncidentCloseInput, s as ContinuityImprovementLoop, t as ContinuityLoopUpsertInput, u as ContinuityLoopReviewInput, F as FileHygieneConfig, v as EntityRelationship, w as EntityActivityEntry, x as EntityFile, y as AccessTrackingEntry, z as MemoryProjectionCurrentState, D as MemorySummary, T as TopicScore } from './types-Dm5xxVrr.js';
4
4
  import { ProjectedMemoryBrowseOptions, ProjectedMemoryBrowsePage, readProjectedGovernanceRecord } from './memory-projection-store.js';
5
+ export { stripAttributesSuffix } from './structured-attributes.js';
5
6
  import './types-ByK7T3L6.js';
6
7
  import './index-DJ9QWMw-.js';
7
8
  import './maintenance/memory-governance.js';
@@ -84,32 +85,7 @@ declare class ContentHashIndex {
84
85
  /** Normalize content and compute SHA-256 hash. */
85
86
  static computeHash(content: string): string;
86
87
  }
87
- /**
88
- * Render a structured-attributes map into a stable, canonical string fragment
89
- * suitable for appending to enriched memory content before hashing.
90
- *
91
- * Normalization rules:
92
- * - Keys are trimmed and lowercased (values are trimmed but preserve case)
93
- * - Key-value pairs are sorted alphabetically by normalized key
94
- * - Pairs are joined with "; " and rendered as "key: value"
95
- *
96
- * Using this helper at BOTH the write path (enrichedContent) and the
97
- * dedup-lookup path (dedupContent) guarantees identical output regardless of
98
- * the insertion order or casing used by the caller.
99
- *
100
- * @example
101
- * normalizeAttributePairs({ foo: "bar", BAZ: "qux" })
102
- * // → "baz: qux; foo: bar"
103
- */
104
- /**
105
- * Remove the "[Attributes: ...]" suffix `writeMemory` appends to the
106
- * stored body when structuredAttributes are present, yielding the raw
107
- * fact text for content comparison. Inverse companion of
108
- * `normalizeAttributePairs` enrichment. String operations, not regex —
109
- * CodeQL js/polynomial-redos on a suffix-anchored pattern over
110
- * library-supplied content.
111
- */
112
- declare function stripAttributesSuffix(content: string): string;
88
+
113
89
  declare function normalizeAttributePairs(pairs: Record<string, string>): string;
114
90
  declare function compareEntityTimestamps(left?: string, right?: string): number;
115
91
  declare function fingerprintEntityStructuredFacts(entity: Pick<EntityFile, "structuredSections">): string | undefined;
@@ -893,4 +869,4 @@ declare class StorageManager {
893
869
  private appendGeneratedMemoryLifecycleEventFailOpen;
894
870
  }
895
871
 
896
- export { ContentHashIndex, type MemoryLifecycleEventWriteOptions, type ReextractJobRequest, StorageManager, compareEntityTimestamps, fingerprintEntityStructuredFacts, isEntitySynthesisStale, normalizeAttributePairs, normalizeEntityName, parseEntityFile, serializeEntityFile, stripAttributesSuffix };
872
+ export { ContentHashIndex, type MemoryLifecycleEventWriteOptions, type ReextractJobRequest, StorageManager, compareEntityTimestamps, fingerprintEntityStructuredFacts, isEntitySynthesisStale, normalizeAttributePairs, normalizeEntityName, parseEntityFile, serializeEntityFile };
package/dist/storage.js CHANGED
@@ -7,12 +7,14 @@ import {
7
7
  normalizeAttributePairs,
8
8
  normalizeEntityName,
9
9
  parseEntityFile,
10
- serializeEntityFile,
11
- stripAttributesSuffix
12
- } from "./chunk-BLIWOONZ.js";
10
+ serializeEntityFile
11
+ } from "./chunk-CUNTLEJP.js";
13
12
  import "./chunk-M7XQSUBB.js";
14
13
  import "./chunk-5UZXUTVO.js";
15
14
  import "./chunk-5GPPACXK.js";
15
+ import {
16
+ stripAttributesSuffix
17
+ } from "./chunk-SVOZFLIQ.js";
16
18
  import "./chunk-J6A3CX5N.js";
17
19
  import "./chunk-NGFEWFNK.js";
18
20
  import "./chunk-MB5RSUW6.js";
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Shared helpers for the `\n[Attributes: …]` enrichment suffix that
3
+ * `writeMemory` appends to a stored body when `structuredAttributes` are
4
+ * present.
5
+ *
6
+ * Extracted here (out of `storage.ts`) so every reader — the storage
7
+ * manager, the wearable service, and the coding surfaces — strips the suffix
8
+ * with ONE definition. Previously `coding/architecture-surfaces.ts` carried a
9
+ * weaker local copy that only checked the trailing `]`, which could truncate
10
+ * card markdown that legitimately ends in a `[Attributes: …]` line (cursor
11
+ * review: duplicate attribute suffix stripper).
12
+ *
13
+ * String operations, not regex — CodeQL `js/polynomial-redos` flags
14
+ * suffix-anchored patterns over library-supplied content.
15
+ */
16
+ /**
17
+ * Remove the `[Attributes: …]` suffix `writeMemory` appends to the stored
18
+ * body when structuredAttributes are present, yielding the raw fact/card text
19
+ * for content comparison or client display. Inverse companion of
20
+ * `normalizeAttributePairs` enrichment in `storage.ts`.
21
+ *
22
+ * Returns the stripped (trimmed) body when the marker opens the final
23
+ * non-empty line and its inner payload contains no premature `]` or newline
24
+ * (mirrors the exact shape `normalizeAttributePairs` emits). Otherwise
25
+ * returns the trimmed input unchanged — never truncates legitimate content.
26
+ */
27
+ declare function stripAttributesSuffix(content: string): string;
28
+
29
+ export { stripAttributesSuffix };
@@ -0,0 +1,8 @@
1
+ import {
2
+ stripAttributesSuffix
3
+ } from "./chunk-SVOZFLIQ.js";
4
+ import "./chunk-PZ5AY32C.js";
5
+ export {
6
+ stripAttributesSuffix
7
+ };
8
+ //# sourceMappingURL=structured-attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -8,6 +8,7 @@ import './memory-projection-store.js';
8
8
  import './maintenance/memory-governance.js';
9
9
  import './runtime/better-sqlite.js';
10
10
  import 'better-sqlite3';
11
+ import './structured-attributes.js';
11
12
 
12
13
  /**
13
14
  * Temporal Supersession (issue #375)
@@ -10,6 +10,7 @@ import './memory-projection-store.js';
10
10
  import './maintenance/memory-governance.js';
11
11
  import './runtime/better-sqlite.js';
12
12
  import 'better-sqlite3';
13
+ import './structured-attributes.js';
13
14
  import './lifecycle.js';
14
15
 
15
16
  interface TierMigrationRequest {
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  compareVerifiedEpisodeResults,
3
3
  searchVerifiedEpisodes
4
- } from "./chunk-4FE2K57M.js";
4
+ } from "./chunk-RTFAZOIR.js";
5
5
  import "./chunk-7FL4CNPV.js";
6
- import "./chunk-BLIWOONZ.js";
6
+ import "./chunk-CUNTLEJP.js";
7
7
  import "./chunk-M7XQSUBB.js";
8
8
  import "./chunk-5UZXUTVO.js";
9
9
  import "./chunk-5GPPACXK.js";
10
+ import "./chunk-SVOZFLIQ.js";
10
11
  import "./chunk-J6A3CX5N.js";
11
12
  import "./chunk-NGFEWFNK.js";
12
13
  import "./chunk-MB5RSUW6.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "9.3.689",
3
+ "version": "9.3.690",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -2931,7 +2931,7 @@
2931
2931
  "core"
2932
2932
  ],
2933
2933
  "peerDependencies": {
2934
- "@remnic/coding-graph": "^9.3.689"
2934
+ "@remnic/coding-graph": "^9.3.690"
2935
2935
  },
2936
2936
  "peerDependenciesMeta": {
2937
2937
  "@remnic/coding-graph": {
@@ -34,7 +34,8 @@ export type OperationName =
34
34
  | "memory_get"
35
35
  | "memory_search"
36
36
  | "memory_store"
37
- | "coding_decision";
37
+ | "coding_decision"
38
+ | "coding_architecture";
38
39
 
39
40
  // ---------------------------------------------------------------------------
40
41
  // Operation context — what every handler receives
@@ -522,3 +522,43 @@ test("access-cli rejects adjacent option-looking values", async () => {
522
522
 
523
523
  assert.match(output, /missing required option: --content/);
524
524
  });
525
+
526
+ // ──────────────────────────────────────────────────────────────────────────
527
+ // architecture command — wired through the boundary operation (#1548 PR3)
528
+ // ──────────────────────────────────────────────────────────────────────────
529
+
530
+ test("access-cli architecture is a known command (unknown options rejected, not unsupported-command)", async () => {
531
+ const output = await captureRunCliFailure(["architecture", "--typo", "x"]);
532
+ assert.match(output, /unknown option: --typo/);
533
+ });
534
+
535
+ test("access-cli architecture accepts its documented value options", async () => {
536
+ // Valid option spellings parse cleanly; the invocation only fails once it
537
+ // reaches the runtime (no OpenClaw config here), proving the options were
538
+ // accepted by parseArgs rather than rejected as unknown.
539
+ const output = await captureRunCliFailure([
540
+ "architecture",
541
+ "--subcommand",
542
+ "get",
543
+ "--session-key",
544
+ "s1",
545
+ "--namespace",
546
+ "ns",
547
+ "--project-tag",
548
+ "myproj",
549
+ ]);
550
+ assert.doesNotMatch(output, /unknown option/);
551
+ assert.doesNotMatch(output, /unsupported command/);
552
+ });
553
+
554
+ test("access-cli usage lists the architecture command and its options", async () => {
555
+ const output = await captureRunCliFailure(["architecture", "--typo"]);
556
+ assert.match(output, /engram-access architecture \[options\]/);
557
+ assert.match(output, /Architecture options:/);
558
+ assert.match(output, /--subcommand <get\|refresh>/);
559
+ });
560
+
561
+ test("access-cli still rejects truly unknown commands as unsupported", async () => {
562
+ const output = await captureRunCliFailure(["bogus-command"]);
563
+ assert.match(output, /unsupported command/);
564
+ });
package/src/access-cli.ts CHANGED
@@ -15,7 +15,7 @@ import { projectTagProjectId } from "./coding/coding-namespace.js";
15
15
 
16
16
  const OPENCLAW_REMNIC_PLUGIN_IDS = ["openclaw-remnic", "openclaw-engram"] as const;
17
17
 
18
- type CommandName = "browse" | "store" | "decision";
18
+ type CommandName = "browse" | "store" | "decision" | "architecture";
19
19
 
20
20
  type ParsedArgs = {
21
21
  command: CommandName;
@@ -137,6 +137,7 @@ function usage(): string {
137
137
  " engram-access browse [options]",
138
138
  " engram-access store [options]",
139
139
  " engram-access decision [options]",
140
+ " engram-access architecture [options]",
140
141
  "",
141
142
  "Browse options:",
142
143
  " --namespace <name>",
@@ -176,6 +177,14 @@ function usage(): string {
176
177
  " --entity-ref <ref> (repeatable)",
177
178
  " --project-tag <tag> (attach coding context for this invocation)",
178
179
  " --supersedes-id <id> (alias for --id on supersede)",
180
+ "",
181
+ "Architecture options:",
182
+ " --subcommand <get|refresh>",
183
+ " --namespace <name>",
184
+ " --session-key <key>",
185
+ " --principal <principal>",
186
+ " --project-tag <tag> (attach coding context for this invocation)",
187
+ " --repo-root <path> (repo to scan for refresh; defaults to the current directory)",
179
188
  ].join("\n");
180
189
  }
181
190
 
@@ -228,6 +237,17 @@ const COMMAND_SPECS: Record<CommandName, CommandSpec> = {
228
237
  ]),
229
238
  flagOptions: new Set(),
230
239
  },
240
+ architecture: {
241
+ valueOptions: new Set([
242
+ "subcommand",
243
+ "namespace",
244
+ "session-key",
245
+ "principal",
246
+ "project-tag",
247
+ "repo-root",
248
+ ]),
249
+ flagOptions: new Set(),
250
+ },
231
251
  };
232
252
  const BROWSE_SORT_VALUES = Object.freeze([
233
253
  "updated_desc",
@@ -238,9 +258,19 @@ const BROWSE_SORT_VALUES = Object.freeze([
238
258
 
239
259
  type BrowseSort = (typeof BROWSE_SORT_VALUES)[number];
240
260
 
261
+ /**
262
+ * Type guard for {@link CommandName}. Enumerating the union (rather than a
263
+ * bare `value in COMMAND_SPECS`) is what lets TypeScript NARROW the string
264
+ * to `CommandName` — the `in` operator alone yields TS2322 on the
265
+ * `command: commandRaw` assignment below (codex review P2).
266
+ */
267
+ function isCommandName(value: string): value is CommandName {
268
+ return value === "browse" || value === "store" || value === "decision" || value === "architecture";
269
+ }
270
+
241
271
  function parseArgs(argv: string[]): ParsedArgs {
242
272
  const [commandRaw, ...rest] = argv;
243
- if (commandRaw !== "browse" && commandRaw !== "store" && commandRaw !== "decision") {
273
+ if (!isCommandName(commandRaw)) {
244
274
  throw new UsageError("unsupported-command");
245
275
  }
246
276
  const spec = COMMAND_SPECS[commandRaw];
@@ -552,6 +582,60 @@ async function runDecision(args: ParsedArgs, preferredId?: string): Promise<void
552
582
  console.log(JSON.stringify(output.result, null, 2));
553
583
  }
554
584
 
585
+ /**
586
+ * Architecture-card surface (issue #1548 Track A PR 3). Dispatches through
587
+ * the same `coding_architecture` operation as the MCP tool and HTTP route —
588
+ * one validation boundary, three transports.
589
+ */
590
+ async function runArchitecture(args: ParsedArgs, preferredId?: string): Promise<void> {
591
+ const subcommand = requireOption(args, "subcommand");
592
+ const { config, service } = buildRuntime(preferredId);
593
+ // Same coding-context attachment as runDecision (review P2): the CLI's
594
+ // fresh Orchestrator has an empty session coding-context map, so attach
595
+ // a context BEFORE dispatching when --project-tag + --session-key are
596
+ // given, so the gate passes and writes resolve to the right namespace.
597
+ const projectTag = getLastOption(args, "project-tag");
598
+ const sessionKey = getLastOption(args, "session-key");
599
+ if (sessionKey && sessionKey.trim().length > 0) {
600
+ // refresh scans codingContext.rootPath, so it must be a REAL checkout
601
+ // path. Default to the CWD (or an explicit --repo-root) so a one-shot
602
+ // CLI refresh scans the caller's repo, not a non-existent tag path.
603
+ const repoRoot = expandOptionalPath(getLastOption(args, "repo-root")) ?? process.cwd();
604
+ // --project-tag supplies the context id (namespace); when absent, derive
605
+ // a default from the repo-root basename so refresh works with just
606
+ // --session-key + --repo-root (codex review).
607
+ const projectId =
608
+ projectTag && projectTag.trim().length > 0
609
+ ? projectTagProjectId(projectTag.trim())
610
+ : projectTagProjectId(path.basename(repoRoot));
611
+ service.setCodingContext({
612
+ sessionKey,
613
+ codingContext: {
614
+ projectId,
615
+ branch: null,
616
+ rootPath: repoRoot,
617
+ defaultBranch: null,
618
+ },
619
+ });
620
+ }
621
+ const op = getOperation("coding_architecture");
622
+ if (!op) {
623
+ throw new Error("access-boundary: operation not registered: coding_architecture");
624
+ }
625
+ const output = (await op.run(
626
+ {
627
+ subcommand,
628
+ namespace: getLastOption(args, "namespace"),
629
+ sessionKey,
630
+ },
631
+ {
632
+ service,
633
+ authenticatedPrincipal: getLastOption(args, "principal") ?? config.agentAccessHttp.principal,
634
+ },
635
+ )) as { result: unknown };
636
+ console.log(JSON.stringify(output.result, null, 2));
637
+ }
638
+
555
639
  export async function main(
556
640
  argv: string[] = process.argv.slice(2),
557
641
  options: AccessCliOptions = {},
@@ -565,6 +649,10 @@ export async function main(
565
649
  await runDecision(args, options.preferredId);
566
650
  return;
567
651
  }
652
+ if (args.command === "architecture") {
653
+ await runArchitecture(args, options.preferredId);
654
+ return;
655
+ }
568
656
  await runStore(args, options.preferredId);
569
657
  }
570
658
 
@@ -316,6 +316,7 @@ export class EngramAccessHttpServer {
316
316
  citationsAutoDetect: options.citationsAutoDetect,
317
317
  emitLegacyTools: options.emitLegacyTools,
318
318
  codingDecisionVisible: this.service.decisionRecordSurfaceVisible,
319
+ architectureCardVisible: this.service.architectureCardSurfaceVisible,
319
320
  });
320
321
  }
321
322
 
@@ -1361,6 +1362,30 @@ export class EngramAccessHttpServer {
1361
1362
  return;
1362
1363
  }
1363
1364
 
1365
+ if (req.method === "POST" && pathname === "/engram/v1/coding/architecture") {
1366
+ // Migrated through the access boundary (issue #1525/#1548 PR3):
1367
+ // refresh persists the card, so it is gated by the 30/min write quota;
1368
+ // get is a pure read and stays uncounted.
1369
+ const body = await this.readJsonBody(req);
1370
+ const isWriteSubcommand = body.subcommand === "refresh";
1371
+ if (isWriteSubcommand) {
1372
+ this.ensureWriteRateLimitAvailable();
1373
+ }
1374
+ const op = getOperation("coding_architecture");
1375
+ if (!op) {
1376
+ throw new EngramAccessInputError("access-boundary: operation not registered: coding_architecture");
1377
+ }
1378
+ const output = (await op.run(body, {
1379
+ service: this.service,
1380
+ authenticatedPrincipal: this.resolveRequestPrincipal(req),
1381
+ })) as { result: unknown };
1382
+ if (isWriteSubcommand) {
1383
+ this.recordWriteRateLimitHit();
1384
+ }
1385
+ this.respondJson(res, 200, output.result);
1386
+ return;
1387
+ }
1388
+
1364
1389
  if (req.method === "POST" && pathname === "/engram/v1/suggestions") {
1365
1390
  const body = await this.readValidatedBody(req, "suggestionSubmit");
1366
1391
  const request = {
@@ -2213,13 +2238,16 @@ export class EngramAccessHttpServer {
2213
2238
  typeof toolArgs === "object" &&
2214
2239
  !Array.isArray(toolArgs) &&
2215
2240
  (toolArgs as { dryRun?: unknown }).dryRun === true;
2241
+ const toolArgsSubcommand =
2242
+ toolArgs !== null && typeof toolArgs === "object" && !Array.isArray(toolArgs) && "subcommand" in toolArgs
2243
+ ? toolArgs.subcommand
2244
+ : undefined;
2216
2245
  const codingDecisionWrite =
2217
2246
  (toolName === "engram.coding_decision" || toolName === "remnic.coding_decision") &&
2218
- toolArgs !== null &&
2219
- typeof toolArgs === "object" &&
2220
- !Array.isArray(toolArgs) &&
2221
- ((toolArgs as { subcommand?: unknown }).subcommand === "record" ||
2222
- (toolArgs as { subcommand?: unknown }).subcommand === "supersede");
2247
+ (toolArgsSubcommand === "record" || toolArgsSubcommand === "supersede");
2248
+ const codingArchitectureWrite =
2249
+ (toolName === "engram.coding_architecture" || toolName === "remnic.coding_architecture") &&
2250
+ toolArgsSubcommand === "refresh";
2223
2251
  const isMcpWrite =
2224
2252
  request.method === "tools/call" &&
2225
2253
  (
@@ -2248,7 +2276,8 @@ export class EngramAccessHttpServer {
2248
2276
  toolName === "remnic.memory_action_apply"
2249
2277
  )
2250
2278
  ) ||
2251
- codingDecisionWrite
2279
+ codingDecisionWrite ||
2280
+ codingArchitectureWrite
2252
2281
  );
2253
2282
  if (isMcpWrite) {
2254
2283
  this.ensureWriteRateLimitAvailable();