@remnic/core 10.0.174 → 10.0.176
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-admin-ops-surface.js +72 -71
- package/dist/access-audit.js +2 -2
- package/dist/access-cli.js +72 -71
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush-preempt.js +72 -71
- package/dist/access-extraction-force-flush.js +72 -71
- package/dist/access-http-briefing.js +72 -71
- package/dist/access-http-query.js +72 -71
- package/dist/access-http.js +72 -71
- package/dist/access-identity-continuity-surface.js +72 -71
- package/dist/access-lcm-surface.js +72 -71
- package/dist/access-mcp.js +72 -71
- package/dist/access-observe-write-surface.js +72 -71
- package/dist/access-operations-batch.js +72 -71
- package/dist/access-operations.js +72 -71
- package/dist/access-recall-concurrency.js +72 -71
- package/dist/access-recall-response.js +72 -71
- package/dist/access-recall-surface.js +72 -71
- package/dist/access-service.js +72 -71
- package/dist/active-recall.js +16 -14
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/briefing.js +14 -13
- package/dist/buffer-add-turns-bounded.js +2 -2
- package/dist/buffer-session-cap.d.ts +1 -1
- package/dist/buffer-session-cap.d.ts.map +1 -1
- package/dist/buffer-session-cap.js +1 -1
- package/dist/buffer.js +11 -10
- package/dist/causal-consolidation.js +15 -14
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-IO4AAVYZ.js → chunk-2EKXMZ6E.js} +2 -2
- package/dist/{chunk-TOQK5A4Y.js → chunk-2LXROA34.js} +6 -6
- package/dist/{chunk-IUM3VSHI.js → chunk-2WREX7KD.js} +10 -1
- package/dist/chunk-2WREX7KD.js.map +1 -0
- package/dist/{chunk-IHB3JO4B.js → chunk-3FS6IVSU.js} +2 -2
- package/dist/{chunk-UBQ2ZOWA.js → chunk-3SP7EZWA.js} +2 -2
- package/dist/{chunk-4PBHMJRC.js → chunk-4GI2IGUK.js} +2 -2
- package/dist/{chunk-OWD365QW.js → chunk-4TIGRBKH.js} +5 -5
- package/dist/{chunk-HHVK2JRE.js → chunk-4TPU36X4.js} +2 -2
- package/dist/{chunk-DMPZABKG.js → chunk-4TZOOUMK.js} +2 -2
- package/dist/{chunk-Y2LZW3EQ.js → chunk-5CLKLKID.js} +3 -3
- package/dist/{chunk-5MTKGNZ5.js → chunk-5RBHL5TF.js} +121 -41
- package/dist/chunk-5RBHL5TF.js.map +1 -0
- package/dist/{chunk-HR3DKJCU.js → chunk-6SROXED4.js} +2 -2
- package/dist/{chunk-L3DDKXQJ.js → chunk-76LDFLAG.js} +2 -2
- package/dist/{chunk-5RONA5FF.js → chunk-7DFJ4JX2.js} +4 -4
- package/dist/{chunk-OK3X3TBR.js → chunk-7L73PLRG.js} +2 -2
- package/dist/{chunk-PUQQPLVV.js → chunk-AJQI2XCB.js} +2 -2
- package/dist/chunk-AJQI2XCB.js.map +1 -0
- package/dist/{chunk-RSUNBJ4I.js → chunk-AOHQ4OJR.js} +8 -8
- package/dist/{chunk-WKNMKV52.js → chunk-AQ6V47Q7.js} +2 -2
- package/dist/{chunk-H4KIMZJD.js → chunk-B4ZA2PZC.js} +3 -3
- package/dist/{chunk-DLR3SBOM.js → chunk-B7GZL7PR.js} +2 -2
- package/dist/{chunk-XYNUEXLC.js → chunk-BAMF6J4W.js} +4 -4
- package/dist/{chunk-WI2WTIMY.js → chunk-CFFYGKDJ.js} +5 -5
- package/dist/{chunk-NTR72OL5.js → chunk-CXIBBZ6N.js} +2 -2
- package/dist/{chunk-3DJ6R4CC.js → chunk-DLPS5YP3.js} +2 -2
- package/dist/{chunk-EXGY5TPU.js → chunk-EQSOXIIH.js} +7 -7
- package/dist/{chunk-6OMSYPOL.js → chunk-F2XXZR6A.js} +3 -3
- package/dist/{chunk-CY2C5LM4.js → chunk-FDLPNFKE.js} +2 -2
- package/dist/{chunk-KAGLV5KH.js → chunk-FTQF3G3B.js} +2 -2
- package/dist/{chunk-2GQVYLQK.js → chunk-FTV2C3CA.js} +2 -2
- package/dist/{chunk-B7HYXVME.js → chunk-FZF7JX76.js} +1 -1
- package/dist/chunk-FZF7JX76.js.map +1 -0
- package/dist/{chunk-ZKXNSPGQ.js → chunk-G77MHQFZ.js} +2 -2
- package/dist/{chunk-66DUCUOC.js → chunk-GGQ3CJVH.js} +2 -2
- package/dist/{chunk-BN5SK2RZ.js → chunk-HHKUWNHQ.js} +2 -2
- package/dist/{chunk-KMOH6W5B.js → chunk-HOTAHSO3.js} +3 -3
- package/dist/{chunk-OY3IULYL.js → chunk-IFXQGDMG.js} +2 -2
- package/dist/{chunk-OWBI5477.js → chunk-JUROR7PB.js} +2 -2
- package/dist/{chunk-4ACKO4U2.js → chunk-JXYFXVPB.js} +2 -2
- package/dist/{chunk-ASWECJXS.js → chunk-KYPFQO43.js} +3 -3
- package/dist/{chunk-4WOEEMGK.js → chunk-KZBE4KBZ.js} +2 -2
- package/dist/{chunk-V6MN37WG.js → chunk-MFJM35R7.js} +2 -2
- package/dist/{chunk-LKXW6W42.js → chunk-OTE5E44O.js} +2 -2
- package/dist/{chunk-KPLKABGR.js → chunk-P3SMXKFR.js} +2 -2
- package/dist/{chunk-27BH67PT.js → chunk-PCLTJUOY.js} +2 -2
- package/dist/{chunk-JDH2BA2P.js → chunk-RXAWE76Y.js} +2 -2
- package/dist/{chunk-IXI6S2VJ.js → chunk-S45VECVD.js} +29 -2
- package/dist/chunk-S45VECVD.js.map +1 -0
- package/dist/{chunk-WTFHZQXM.js → chunk-T3NEDSLZ.js} +3 -3
- package/dist/{chunk-HB2PRTXX.js → chunk-V425GW5W.js} +2 -2
- package/dist/{chunk-XKFL2WQO.js → chunk-V5FCMJW4.js} +2 -2
- package/dist/{chunk-SNI526DD.js → chunk-VR6NF6VX.js} +2 -2
- package/dist/{chunk-V6UFCV6T.js → chunk-VRDG7XFJ.js} +80 -80
- package/dist/{chunk-5ACIRCBO.js → chunk-WTXUUZYI.js} +6 -4
- package/dist/chunk-WTXUUZYI.js.map +1 -0
- package/dist/chunk-XBJOO7G5.js +87 -0
- package/dist/chunk-XBJOO7G5.js.map +1 -0
- package/dist/{chunk-RASE4TEF.js → chunk-Y26CFLHD.js} +5 -2
- package/dist/chunk-Y26CFLHD.js.map +1 -0
- package/dist/{chunk-AM6H7BIY.js → chunk-YMNPQMHA.js} +2 -2
- package/dist/{chunk-QVXRE66C.js → chunk-ZBDTOWGX.js} +7 -7
- package/dist/{chunk-YCK26VSL.js → chunk-ZMEEOLQG.js} +2 -2
- package/dist/{chunk-R2AJAAHJ.js → chunk-ZNHLUYIT.js} +90 -16
- package/dist/chunk-ZNHLUYIT.js.map +1 -0
- package/dist/{chunk-DAOMWGO2.js → chunk-ZX5N5D6M.js} +4 -4
- package/dist/cli.js +72 -71
- package/dist/coding/export-okf-codegraph.js +13 -12
- package/dist/coding/export-okf-codegraph.js.map +1 -1
- package/dist/compounding/engine.js +15 -14
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -14
- package/dist/connectors/codex-materialize-runner.js +14 -13
- package/dist/connectors/index.js +14 -13
- package/dist/convergence-refresh.js +16 -15
- package/dist/corpus-watermark.js +16 -15
- package/dist/entity-retrieval.js +14 -13
- package/dist/explicit-capture.js +72 -71
- package/dist/extraction.js +18 -17
- package/dist/{first-start-migration-CCZ5SM3V.js → first-start-migration-TCPK2I7J.js} +4 -4
- package/dist/harmonic-retrieval.js +14 -13
- package/dist/index.js +104 -103
- package/dist/lcm/index.js +3 -3
- package/dist/location/index.js +15 -14
- package/dist/maintenance/memory-governance.js +14 -13
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +14 -13
- package/dist/maintenance/rebuild-memory-projection-runner.js +16 -15
- package/dist/maintenance/rebuild-memory-projection.js +15 -14
- package/dist/memory-browse.js +9 -8
- package/dist/namespaces/migrate.js +15 -14
- package/dist/namespaces/search.d.ts +5 -1
- package/dist/namespaces/search.d.ts.map +1 -1
- package/dist/namespaces/search.js +12 -11
- package/dist/namespaces/storage.js +14 -13
- package/dist/operator-doctor-corpus.js +17 -16
- package/dist/operator-toolkit.js +23 -21
- package/dist/orchestration/backlog-scheduler.js +75 -74
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +73 -72
- package/dist/orchestration/maintenance.js +22 -21
- package/dist/orchestrator.js +72 -71
- package/dist/peers/index.js +1 -1
- package/dist/peers/interaction-log-append.d.ts.map +1 -1
- package/dist/qmd-daemon-session.d.ts +8 -0
- package/dist/qmd-daemon-session.d.ts.map +1 -1
- package/dist/qmd-daemon-session.js +1 -1
- package/dist/qmd-health-metadata.d.ts +39 -0
- package/dist/qmd-health-metadata.d.ts.map +1 -0
- package/dist/qmd-health-metadata.js +12 -0
- package/dist/qmd-health-metadata.js.map +1 -0
- package/dist/qmd-status.d.ts.map +1 -1
- package/dist/qmd-status.js +1 -1
- package/dist/qmd.d.ts +5 -1
- package/dist/qmd.d.ts.map +1 -1
- package/dist/qmd.js +8 -7
- package/dist/recall-composition-decision.js +2 -2
- package/dist/recall-navigation.js +72 -71
- package/dist/recall-state-view-admission.js +9 -8
- package/dist/recall-why-service.js +9 -8
- package/dist/resume-bundles.js +19 -17
- package/dist/search/factory.js +11 -10
- package/dist/search/index.js +11 -10
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +21 -0
- package/dist/search/port.d.ts.map +1 -1
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/semantic-consolidation.js +15 -14
- package/dist/semantic-rule-promotion.js +14 -13
- package/dist/semantic-rule-verifier.js +14 -13
- package/dist/source-agent-qualifier.js +17 -16
- package/dist/standup/build.js +14 -13
- package/dist/storage.js +13 -12
- package/dist/transcript.js +2 -2
- package/dist/transfer/export-okf.js +14 -13
- package/dist/verified-recall.js +14 -13
- package/dist/who-knows-cli.js +15 -14
- package/dist/who-knows.js +14 -13
- package/package.json +2 -2
- package/src/buffer-session-cap-default.test.ts +86 -0
- package/src/buffer-session-cap.ts +7 -1
- package/src/config.ts +2 -1
- package/src/namespaces/search.test.ts +320 -4
- package/src/namespaces/search.ts +147 -51
- package/src/peers/interaction-log-append.ts +11 -3
- package/src/peers/peers.test.ts +27 -0
- package/src/qmd-client.test.ts +34 -3
- package/src/qmd-daemon-session.ts +34 -1
- package/src/qmd-health-metadata.test.ts +493 -0
- package/src/qmd-health-metadata.ts +95 -0
- package/src/qmd-status.ts +10 -1
- package/src/qmd.ts +83 -3
- package/src/search/port.ts +23 -0
- package/dist/chunk-5ACIRCBO.js.map +0 -1
- package/dist/chunk-5MTKGNZ5.js.map +0 -1
- package/dist/chunk-B7HYXVME.js.map +0 -1
- package/dist/chunk-IUM3VSHI.js.map +0 -1
- package/dist/chunk-IXI6S2VJ.js.map +0 -1
- package/dist/chunk-PUQQPLVV.js.map +0 -1
- package/dist/chunk-R2AJAAHJ.js.map +0 -1
- package/dist/chunk-RASE4TEF.js.map +0 -1
- /package/dist/{chunk-IO4AAVYZ.js.map → chunk-2EKXMZ6E.js.map} +0 -0
- /package/dist/{chunk-TOQK5A4Y.js.map → chunk-2LXROA34.js.map} +0 -0
- /package/dist/{chunk-IHB3JO4B.js.map → chunk-3FS6IVSU.js.map} +0 -0
- /package/dist/{chunk-UBQ2ZOWA.js.map → chunk-3SP7EZWA.js.map} +0 -0
- /package/dist/{chunk-4PBHMJRC.js.map → chunk-4GI2IGUK.js.map} +0 -0
- /package/dist/{chunk-OWD365QW.js.map → chunk-4TIGRBKH.js.map} +0 -0
- /package/dist/{chunk-HHVK2JRE.js.map → chunk-4TPU36X4.js.map} +0 -0
- /package/dist/{chunk-DMPZABKG.js.map → chunk-4TZOOUMK.js.map} +0 -0
- /package/dist/{chunk-Y2LZW3EQ.js.map → chunk-5CLKLKID.js.map} +0 -0
- /package/dist/{chunk-HR3DKJCU.js.map → chunk-6SROXED4.js.map} +0 -0
- /package/dist/{chunk-L3DDKXQJ.js.map → chunk-76LDFLAG.js.map} +0 -0
- /package/dist/{chunk-5RONA5FF.js.map → chunk-7DFJ4JX2.js.map} +0 -0
- /package/dist/{chunk-OK3X3TBR.js.map → chunk-7L73PLRG.js.map} +0 -0
- /package/dist/{chunk-RSUNBJ4I.js.map → chunk-AOHQ4OJR.js.map} +0 -0
- /package/dist/{chunk-WKNMKV52.js.map → chunk-AQ6V47Q7.js.map} +0 -0
- /package/dist/{chunk-H4KIMZJD.js.map → chunk-B4ZA2PZC.js.map} +0 -0
- /package/dist/{chunk-DLR3SBOM.js.map → chunk-B7GZL7PR.js.map} +0 -0
- /package/dist/{chunk-XYNUEXLC.js.map → chunk-BAMF6J4W.js.map} +0 -0
- /package/dist/{chunk-WI2WTIMY.js.map → chunk-CFFYGKDJ.js.map} +0 -0
- /package/dist/{chunk-NTR72OL5.js.map → chunk-CXIBBZ6N.js.map} +0 -0
- /package/dist/{chunk-3DJ6R4CC.js.map → chunk-DLPS5YP3.js.map} +0 -0
- /package/dist/{chunk-EXGY5TPU.js.map → chunk-EQSOXIIH.js.map} +0 -0
- /package/dist/{chunk-6OMSYPOL.js.map → chunk-F2XXZR6A.js.map} +0 -0
- /package/dist/{chunk-CY2C5LM4.js.map → chunk-FDLPNFKE.js.map} +0 -0
- /package/dist/{chunk-KAGLV5KH.js.map → chunk-FTQF3G3B.js.map} +0 -0
- /package/dist/{chunk-2GQVYLQK.js.map → chunk-FTV2C3CA.js.map} +0 -0
- /package/dist/{chunk-ZKXNSPGQ.js.map → chunk-G77MHQFZ.js.map} +0 -0
- /package/dist/{chunk-66DUCUOC.js.map → chunk-GGQ3CJVH.js.map} +0 -0
- /package/dist/{chunk-BN5SK2RZ.js.map → chunk-HHKUWNHQ.js.map} +0 -0
- /package/dist/{chunk-KMOH6W5B.js.map → chunk-HOTAHSO3.js.map} +0 -0
- /package/dist/{chunk-OY3IULYL.js.map → chunk-IFXQGDMG.js.map} +0 -0
- /package/dist/{chunk-OWBI5477.js.map → chunk-JUROR7PB.js.map} +0 -0
- /package/dist/{chunk-4ACKO4U2.js.map → chunk-JXYFXVPB.js.map} +0 -0
- /package/dist/{chunk-ASWECJXS.js.map → chunk-KYPFQO43.js.map} +0 -0
- /package/dist/{chunk-4WOEEMGK.js.map → chunk-KZBE4KBZ.js.map} +0 -0
- /package/dist/{chunk-V6MN37WG.js.map → chunk-MFJM35R7.js.map} +0 -0
- /package/dist/{chunk-LKXW6W42.js.map → chunk-OTE5E44O.js.map} +0 -0
- /package/dist/{chunk-KPLKABGR.js.map → chunk-P3SMXKFR.js.map} +0 -0
- /package/dist/{chunk-27BH67PT.js.map → chunk-PCLTJUOY.js.map} +0 -0
- /package/dist/{chunk-JDH2BA2P.js.map → chunk-RXAWE76Y.js.map} +0 -0
- /package/dist/{chunk-WTFHZQXM.js.map → chunk-T3NEDSLZ.js.map} +0 -0
- /package/dist/{chunk-HB2PRTXX.js.map → chunk-V425GW5W.js.map} +0 -0
- /package/dist/{chunk-XKFL2WQO.js.map → chunk-V5FCMJW4.js.map} +0 -0
- /package/dist/{chunk-SNI526DD.js.map → chunk-VR6NF6VX.js.map} +0 -0
- /package/dist/{chunk-V6UFCV6T.js.map → chunk-VRDG7XFJ.js.map} +0 -0
- /package/dist/{chunk-AM6H7BIY.js.map → chunk-YMNPQMHA.js.map} +0 -0
- /package/dist/{chunk-QVXRE66C.js.map → chunk-ZBDTOWGX.js.map} +0 -0
- /package/dist/{chunk-YCK26VSL.js.map → chunk-ZMEEOLQG.js.map} +0 -0
- /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
- /package/dist/{first-start-migration-CCZ5SM3V.js.map → first-start-migration-TCPK2I7J.js.map} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeDreamsStatusWindowHours,
|
|
3
|
+
recordDreamsPhaseRun
|
|
4
|
+
} from "./chunk-PQM3B54K.js";
|
|
1
5
|
import {
|
|
2
6
|
WEARABLE_SOURCE_PREFIX,
|
|
3
7
|
WearablesInputError,
|
|
@@ -13,9 +17,8 @@ import {
|
|
|
13
17
|
runGraphEdgeDecayMaintenanceAcrossNamespaces
|
|
14
18
|
} from "./chunk-GOZXQNIM.js";
|
|
15
19
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} from "./chunk-PQM3B54K.js";
|
|
20
|
+
openclawReplayNormalizer
|
|
21
|
+
} from "./chunk-H4CKS5B2.js";
|
|
19
22
|
import {
|
|
20
23
|
exportWorkBoardMarkdown,
|
|
21
24
|
exportWorkBoardSnapshot,
|
|
@@ -31,8 +34,9 @@ import {
|
|
|
31
34
|
claudeReplayNormalizer
|
|
32
35
|
} from "./chunk-54BGIBCR.js";
|
|
33
36
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
exportOkfBundle,
|
|
38
|
+
parseIncludeStatus
|
|
39
|
+
} from "./chunk-G77MHQFZ.js";
|
|
36
40
|
import {
|
|
37
41
|
exportSqlite
|
|
38
42
|
} from "./chunk-BV2TIZ4F.js";
|
|
@@ -60,10 +64,6 @@ import {
|
|
|
60
64
|
import {
|
|
61
65
|
exportMarkdownBundle
|
|
62
66
|
} from "./chunk-765K3SAT.js";
|
|
63
|
-
import {
|
|
64
|
-
exportOkfBundle,
|
|
65
|
-
parseIncludeStatus
|
|
66
|
-
} from "./chunk-ZKXNSPGQ.js";
|
|
67
67
|
import {
|
|
68
68
|
isSharedContextWriteInputError,
|
|
69
69
|
parseSharedWriteOutputControls
|
|
@@ -71,15 +71,22 @@ import {
|
|
|
71
71
|
import {
|
|
72
72
|
buildStandup,
|
|
73
73
|
parseStandupDate
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-FTV2C3CA.js";
|
|
75
75
|
import {
|
|
76
76
|
SupportPassportAccessSurface,
|
|
77
77
|
createSupportPassportModelAdapter,
|
|
78
78
|
supportsSupportPassportPrivateFiles
|
|
79
79
|
} from "./chunk-2WITFW6F.js";
|
|
80
|
+
import {
|
|
81
|
+
RoutingRulesStore
|
|
82
|
+
} from "./chunk-TBUEE7XF.js";
|
|
83
|
+
import {
|
|
84
|
+
ActivityStore,
|
|
85
|
+
MaintenanceScheduler
|
|
86
|
+
} from "./chunk-ZBDTOWGX.js";
|
|
80
87
|
import {
|
|
81
88
|
runPeerProfileReasoner
|
|
82
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-WTXUUZYI.js";
|
|
83
90
|
import {
|
|
84
91
|
buildReplayNormalizerRegistry,
|
|
85
92
|
clampBatchSize,
|
|
@@ -89,9 +96,6 @@ import {
|
|
|
89
96
|
isReplaySource,
|
|
90
97
|
normalizeReplaySessionKey
|
|
91
98
|
} from "./chunk-AJVLDJU6.js";
|
|
92
|
-
import {
|
|
93
|
-
RoutingRulesStore
|
|
94
|
-
} from "./chunk-TBUEE7XF.js";
|
|
95
99
|
import {
|
|
96
100
|
TailscaleHelper
|
|
97
101
|
} from "./chunk-SZDLX763.js";
|
|
@@ -101,13 +105,9 @@ import {
|
|
|
101
105
|
import {
|
|
102
106
|
CompressionGuidelineCoordinator
|
|
103
107
|
} from "./chunk-5OBYISRA.js";
|
|
104
|
-
import {
|
|
105
|
-
ActivityStore,
|
|
106
|
-
MaintenanceScheduler
|
|
107
|
-
} from "./chunk-QVXRE66C.js";
|
|
108
108
|
import {
|
|
109
109
|
rebuildMemoryLifecycleLedger
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-4GI2IGUK.js";
|
|
111
111
|
import {
|
|
112
112
|
rebuildObservations
|
|
113
113
|
} from "./chunk-2X4WP4GD.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
runLocationDay,
|
|
122
122
|
runLocationStatus,
|
|
123
123
|
runLocationSync
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-F2XXZR6A.js";
|
|
125
125
|
import {
|
|
126
126
|
archiveObservations
|
|
127
127
|
} from "./chunk-SBQOBY3S.js";
|
|
@@ -131,13 +131,16 @@ import {
|
|
|
131
131
|
import {
|
|
132
132
|
LcmEngine
|
|
133
133
|
} from "./chunk-OJXK5C6Z.js";
|
|
134
|
+
import {
|
|
135
|
+
chunkTranscriptEntries
|
|
136
|
+
} from "./chunk-TECVW3JP.js";
|
|
134
137
|
import {
|
|
135
138
|
cleanupConversationChunks
|
|
136
139
|
} from "./chunk-C5JF6EZ7.js";
|
|
137
140
|
import {
|
|
138
141
|
CompoundingEngine,
|
|
139
142
|
defaultTierMigrationCycleBudget
|
|
140
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-HOTAHSO3.js";
|
|
141
144
|
import {
|
|
142
145
|
SharedContextManager,
|
|
143
146
|
UNATTRIBUTED_ACCESS_WRITE_ORIGIN
|
|
@@ -152,9 +155,6 @@ import {
|
|
|
152
155
|
isValidResolutionVerb,
|
|
153
156
|
runPreferenceDriftScan
|
|
154
157
|
} from "./chunk-KNYUEYB6.js";
|
|
155
|
-
import {
|
|
156
|
-
chunkTranscriptEntries
|
|
157
|
-
} from "./chunk-TECVW3JP.js";
|
|
158
158
|
import {
|
|
159
159
|
ACTIVE_DECISION_STATUSES,
|
|
160
160
|
CodegraphRuntimeError,
|
|
@@ -184,7 +184,7 @@ import {
|
|
|
184
184
|
} from "./chunk-2524MOWK.js";
|
|
185
185
|
import {
|
|
186
186
|
AdapterRegistry
|
|
187
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-BAMF6J4W.js";
|
|
188
188
|
import {
|
|
189
189
|
getBulkImportSource,
|
|
190
190
|
listBulkImportSources,
|
|
@@ -192,12 +192,23 @@ import {
|
|
|
192
192
|
registerBulkImportSource,
|
|
193
193
|
runBulkImportPipeline
|
|
194
194
|
} from "./chunk-4P4GF76E.js";
|
|
195
|
+
import {
|
|
196
|
+
WHO_KNOWS_DEFAULT_LIMIT,
|
|
197
|
+
WHO_KNOWS_MCP_TOOLS,
|
|
198
|
+
computeWhoKnows,
|
|
199
|
+
handleWhoKnowsHttpQuery,
|
|
200
|
+
loadWhoKnowsEntities,
|
|
201
|
+
validateWhoKnowsInput
|
|
202
|
+
} from "./chunk-V5FCMJW4.js";
|
|
195
203
|
import {
|
|
196
204
|
WriteQuarantineStore
|
|
197
205
|
} from "./chunk-BANSBRNX.js";
|
|
198
206
|
import {
|
|
199
207
|
WriteRateLimiter
|
|
200
208
|
} from "./chunk-TB6CBZ5V.js";
|
|
209
|
+
import {
|
|
210
|
+
cleanArchivedUserMessage
|
|
211
|
+
} from "./chunk-47DU4SGJ.js";
|
|
201
212
|
import {
|
|
202
213
|
applyUtilityPromotionRuntimePolicy,
|
|
203
214
|
applyUtilityRankingRuntimeDelta,
|
|
@@ -214,15 +225,7 @@ import {
|
|
|
214
225
|
import {
|
|
215
226
|
compareVerifiedEpisodeResults,
|
|
216
227
|
searchVerifiedEpisodes
|
|
217
|
-
} from "./chunk-
|
|
218
|
-
import {
|
|
219
|
-
WHO_KNOWS_DEFAULT_LIMIT,
|
|
220
|
-
WHO_KNOWS_MCP_TOOLS,
|
|
221
|
-
computeWhoKnows,
|
|
222
|
-
handleWhoKnowsHttpQuery,
|
|
223
|
-
loadWhoKnowsEntities,
|
|
224
|
-
validateWhoKnowsInput
|
|
225
|
-
} from "./chunk-XKFL2WQO.js";
|
|
228
|
+
} from "./chunk-PCLTJUOY.js";
|
|
226
229
|
import {
|
|
227
230
|
applyTrustScoreStage,
|
|
228
231
|
buildTrustSignalsForRerank,
|
|
@@ -244,8 +247,8 @@ import {
|
|
|
244
247
|
summarizeTrustZonePromotionReadiness
|
|
245
248
|
} from "./chunk-JWX2Q6HS.js";
|
|
246
249
|
import {
|
|
247
|
-
|
|
248
|
-
} from "./chunk-
|
|
250
|
+
decideTierTransition
|
|
251
|
+
} from "./chunk-KBHUGMUW.js";
|
|
249
252
|
import {
|
|
250
253
|
TmtBuilder
|
|
251
254
|
} from "./chunk-ECZU5BJH.js";
|
|
@@ -264,9 +267,6 @@ import {
|
|
|
264
267
|
import {
|
|
265
268
|
TierMigrationExecutor
|
|
266
269
|
} from "./chunk-YRFAYOFQ.js";
|
|
267
|
-
import {
|
|
268
|
-
decideTierTransition
|
|
269
|
-
} from "./chunk-KBHUGMUW.js";
|
|
270
270
|
import {
|
|
271
271
|
HourlySummarizer,
|
|
272
272
|
summarizeHourlyStatus
|
|
@@ -289,11 +289,11 @@ import {
|
|
|
289
289
|
} from "./chunk-WWDO7ZWM.js";
|
|
290
290
|
import {
|
|
291
291
|
promoteSemanticRuleFromMemory
|
|
292
|
-
} from "./chunk-
|
|
292
|
+
} from "./chunk-YMNPQMHA.js";
|
|
293
293
|
import {
|
|
294
294
|
compareVerifiedSemanticRuleResults,
|
|
295
295
|
searchVerifiedSemanticRules
|
|
296
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-7L73PLRG.js";
|
|
297
297
|
import {
|
|
298
298
|
buildResponseGuidanceRecallSection,
|
|
299
299
|
shouldRecallResponseGuidance
|
|
@@ -302,7 +302,7 @@ import {
|
|
|
302
302
|
buildResumeBundleFromState,
|
|
303
303
|
getResumeBundleStatus,
|
|
304
304
|
recordResumeBundle
|
|
305
|
-
} from "./chunk-
|
|
305
|
+
} from "./chunk-5CLKLKID.js";
|
|
306
306
|
import {
|
|
307
307
|
getWorkProductLedgerStatus,
|
|
308
308
|
recordWorkProductLedgerEntry,
|
|
@@ -311,7 +311,7 @@ import {
|
|
|
311
311
|
import {
|
|
312
312
|
TranscriptManager,
|
|
313
313
|
utcDayRange
|
|
314
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-7DFJ4JX2.js";
|
|
315
315
|
import {
|
|
316
316
|
mergeWithAgentResults,
|
|
317
317
|
runDirectAgent,
|
|
@@ -339,6 +339,9 @@ import {
|
|
|
339
339
|
import {
|
|
340
340
|
composeSalvagedEnvelope
|
|
341
341
|
} from "./chunk-5CO5G4MN.js";
|
|
342
|
+
import {
|
|
343
|
+
findUnresolvedEntityRefs
|
|
344
|
+
} from "./chunk-X7XN6YU4.js";
|
|
342
345
|
import {
|
|
343
346
|
RelevanceStore
|
|
344
347
|
} from "./chunk-FEYPXEKE.js";
|
|
@@ -349,13 +352,10 @@ import {
|
|
|
349
352
|
} from "./chunk-WBOJMAAV.js";
|
|
350
353
|
import {
|
|
351
354
|
runRecallWhy
|
|
352
|
-
} from "./chunk-
|
|
355
|
+
} from "./chunk-KYPFQO43.js";
|
|
353
356
|
import {
|
|
354
357
|
parseXrayCliOptions
|
|
355
358
|
} from "./chunk-FSORYJRP.js";
|
|
356
|
-
import {
|
|
357
|
-
findUnresolvedEntityRefs
|
|
358
|
-
} from "./chunk-X7XN6YU4.js";
|
|
359
359
|
import {
|
|
360
360
|
LastRecallStore,
|
|
361
361
|
RecallHandleHistoryStore,
|
|
@@ -365,7 +365,7 @@ import {
|
|
|
365
365
|
import {
|
|
366
366
|
indexStateViewAnnotatedResults,
|
|
367
367
|
resolveRecallStateViewActive
|
|
368
|
-
} from "./chunk-
|
|
368
|
+
} from "./chunk-4TPU36X4.js";
|
|
369
369
|
import {
|
|
370
370
|
applyRecallStateViews
|
|
371
371
|
} from "./chunk-DBB5JPSL.js";
|
|
@@ -383,6 +383,9 @@ import {
|
|
|
383
383
|
import {
|
|
384
384
|
renderNavigationResult
|
|
385
385
|
} from "./chunk-KIW3OOZE.js";
|
|
386
|
+
import {
|
|
387
|
+
planDisclosureStep
|
|
388
|
+
} from "./chunk-RDHEBINJ.js";
|
|
386
389
|
import {
|
|
387
390
|
DEFAULT_TRAVERSE_LIMIT,
|
|
388
391
|
selectTraverseNeighbors
|
|
@@ -399,9 +402,6 @@ import {
|
|
|
399
402
|
import {
|
|
400
403
|
takeNavigateBudget
|
|
401
404
|
} from "./chunk-VYDGHJIN.js";
|
|
402
|
-
import {
|
|
403
|
-
planDisclosureStep
|
|
404
|
-
} from "./chunk-RDHEBINJ.js";
|
|
405
405
|
import {
|
|
406
406
|
decideDisclosureEscalation
|
|
407
407
|
} from "./chunk-H7XKCNR6.js";
|
|
@@ -425,7 +425,7 @@ import {
|
|
|
425
425
|
decideRecallContextComposition,
|
|
426
426
|
notifyContextComposition,
|
|
427
427
|
recallFailureComposition
|
|
428
|
-
} from "./chunk-
|
|
428
|
+
} from "./chunk-FTQF3G3B.js";
|
|
429
429
|
import {
|
|
430
430
|
applyReasoningTraceBoost
|
|
431
431
|
} from "./chunk-EVWDNKQA.js";
|
|
@@ -473,12 +473,12 @@ import {
|
|
|
473
473
|
runOperatorRepair,
|
|
474
474
|
runOperatorSetup,
|
|
475
475
|
summarizeNamespaceMaintenanceHealth
|
|
476
|
-
} from "./chunk-
|
|
476
|
+
} from "./chunk-AOHQ4OJR.js";
|
|
477
477
|
import {
|
|
478
478
|
NamespaceCatalog,
|
|
479
479
|
isNamespaceKind,
|
|
480
480
|
planNamespaceMaintenance
|
|
481
|
-
} from "./chunk-
|
|
481
|
+
} from "./chunk-CXIBBZ6N.js";
|
|
482
482
|
import {
|
|
483
483
|
analyzeSessionIntegrity,
|
|
484
484
|
applySessionRepair,
|
|
@@ -499,7 +499,7 @@ import {
|
|
|
499
499
|
} from "./chunk-3GPTTA4J.js";
|
|
500
500
|
import {
|
|
501
501
|
runMemoryBrowse
|
|
502
|
-
} from "./chunk-
|
|
502
|
+
} from "./chunk-RXAWE76Y.js";
|
|
503
503
|
import {
|
|
504
504
|
filterRecallCandidates,
|
|
505
505
|
isGenericRecallExcludedPath,
|
|
@@ -507,7 +507,7 @@ import {
|
|
|
507
507
|
isTopLevelArchivePath,
|
|
508
508
|
journalPath,
|
|
509
509
|
writeJournalFile
|
|
510
|
-
} from "./chunk-
|
|
510
|
+
} from "./chunk-6SROXED4.js";
|
|
511
511
|
import {
|
|
512
512
|
REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
|
|
513
513
|
REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
|
|
@@ -574,7 +574,7 @@ import {
|
|
|
574
574
|
import {
|
|
575
575
|
readProjectedHarmonicGraph,
|
|
576
576
|
searchHarmonicRetrieval
|
|
577
|
-
} from "./chunk-
|
|
577
|
+
} from "./chunk-IFXQGDMG.js";
|
|
578
578
|
import {
|
|
579
579
|
classifyMemoryKind
|
|
580
580
|
} from "./chunk-YAZNBMNF.js";
|
|
@@ -598,13 +598,13 @@ import {
|
|
|
598
598
|
} from "./chunk-LEO4MQ3S.js";
|
|
599
599
|
import {
|
|
600
600
|
ExtractionEngine
|
|
601
|
-
} from "./chunk-
|
|
601
|
+
} from "./chunk-MFJM35R7.js";
|
|
602
602
|
import {
|
|
603
603
|
wrapWorkLayerContext
|
|
604
604
|
} from "./chunk-EI6V5UXY.js";
|
|
605
605
|
import {
|
|
606
606
|
CONNECTOR_LABEL_MAX_LENGTH
|
|
607
|
-
} from "./chunk-
|
|
607
|
+
} from "./chunk-AQ6V47Q7.js";
|
|
608
608
|
import {
|
|
609
609
|
isValidConnectorId
|
|
610
610
|
} from "./chunk-GFOLOYAR.js";
|
|
@@ -673,7 +673,7 @@ import {
|
|
|
673
673
|
buildEntityRecallSection,
|
|
674
674
|
entityRecentTranscriptLookbackHours,
|
|
675
675
|
readRecentEntityTranscriptEntries
|
|
676
|
-
} from "./chunk-
|
|
676
|
+
} from "./chunk-76LDFLAG.js";
|
|
677
677
|
import {
|
|
678
678
|
boundRecallContextComposition,
|
|
679
679
|
composeMissingMemoryContext,
|
|
@@ -716,15 +716,15 @@ import {
|
|
|
716
716
|
import {
|
|
717
717
|
CorpusWatermarkCache,
|
|
718
718
|
computeServiceCorpusCensus
|
|
719
|
-
} from "./chunk-
|
|
719
|
+
} from "./chunk-3FS6IVSU.js";
|
|
720
720
|
import {
|
|
721
721
|
listNamespaces,
|
|
722
722
|
runNamespaceMigration,
|
|
723
723
|
verifyNamespaces
|
|
724
|
-
} from "./chunk-
|
|
724
|
+
} from "./chunk-T3NEDSLZ.js";
|
|
725
725
|
import {
|
|
726
726
|
NamespaceStorageRouter
|
|
727
|
-
} from "./chunk-
|
|
727
|
+
} from "./chunk-KZBE4KBZ.js";
|
|
728
728
|
import {
|
|
729
729
|
CrossNamespaceBudget,
|
|
730
730
|
toBudgetWarning
|
|
@@ -738,12 +738,12 @@ import {
|
|
|
738
738
|
} from "./chunk-YNDLCWXS.js";
|
|
739
739
|
import {
|
|
740
740
|
refreshConvergedNamespaces
|
|
741
|
-
} from "./chunk-
|
|
741
|
+
} from "./chunk-VR6NF6VX.js";
|
|
742
742
|
import {
|
|
743
743
|
rebuildMemoryProjection,
|
|
744
744
|
repairMemoryProjection,
|
|
745
745
|
verifyMemoryProjection
|
|
746
|
-
} from "./chunk-
|
|
746
|
+
} from "./chunk-B4ZA2PZC.js";
|
|
747
747
|
import {
|
|
748
748
|
buildProposedActions,
|
|
749
749
|
buildQualityScore,
|
|
@@ -752,7 +752,7 @@ import {
|
|
|
752
752
|
readMemoryGovernanceRunArtifact,
|
|
753
753
|
restoreMemoryGovernanceRun,
|
|
754
754
|
runMemoryGovernance
|
|
755
|
-
} from "./chunk-
|
|
755
|
+
} from "./chunk-P3SMXKFR.js";
|
|
756
756
|
import {
|
|
757
757
|
collectNativeKnowledgeChunks,
|
|
758
758
|
formatNativeKnowledgeSection,
|
|
@@ -785,7 +785,7 @@ import {
|
|
|
785
785
|
materializeAfterSemanticConsolidation,
|
|
786
786
|
parseConsolidationResponse,
|
|
787
787
|
parseOperatorAwareConsolidationResponse
|
|
788
|
-
} from "./chunk-
|
|
788
|
+
} from "./chunk-OTE5E44O.js";
|
|
789
789
|
import {
|
|
790
790
|
resolveNamespaceChildRoot
|
|
791
791
|
} from "./chunk-3UXOZBHV.js";
|
|
@@ -801,13 +801,13 @@ import {
|
|
|
801
801
|
} from "./chunk-GKCXTSFF.js";
|
|
802
802
|
import {
|
|
803
803
|
SmartBuffer
|
|
804
|
-
} from "./chunk-
|
|
804
|
+
} from "./chunk-EQSOXIIH.js";
|
|
805
805
|
import {
|
|
806
806
|
ExtractionDeadlineError,
|
|
807
807
|
ExtractionRunCoordinator,
|
|
808
808
|
ProviderCircuitBreaker,
|
|
809
809
|
classifyExtractionOrigin
|
|
810
|
-
} from "./chunk-
|
|
810
|
+
} from "./chunk-3SP7EZWA.js";
|
|
811
811
|
import {
|
|
812
812
|
ARTIFACT_STATUS_CACHE_TTL_MS,
|
|
813
813
|
BulkImportBatchPartialFailureError,
|
|
@@ -847,7 +847,7 @@ import {
|
|
|
847
847
|
throwIfRecallAborted,
|
|
848
848
|
tokenizeRecallQuery,
|
|
849
849
|
utcDateKeysForLocalDay
|
|
850
|
-
} from "./chunk-
|
|
850
|
+
} from "./chunk-FDLPNFKE.js";
|
|
851
851
|
import {
|
|
852
852
|
inferIntentFromText,
|
|
853
853
|
intentCompatibilityScore,
|
|
@@ -885,7 +885,7 @@ import {
|
|
|
885
885
|
parseBriefingFocus,
|
|
886
886
|
parseBriefingWindow,
|
|
887
887
|
validateBriefingFormat
|
|
888
|
-
} from "./chunk-
|
|
888
|
+
} from "./chunk-4TZOOUMK.js";
|
|
889
889
|
import {
|
|
890
890
|
BriefingTimeoutError,
|
|
891
891
|
withBriefingDeadline
|
|
@@ -957,7 +957,7 @@ import {
|
|
|
957
957
|
validateCorrectionAction,
|
|
958
958
|
validateCorrectionRequest,
|
|
959
959
|
validateRedactionPattern
|
|
960
|
-
} from "./chunk-
|
|
960
|
+
} from "./chunk-Y26CFLHD.js";
|
|
961
961
|
import {
|
|
962
962
|
compileCorrectionRule,
|
|
963
963
|
correctionsFilePath,
|
|
@@ -1070,7 +1070,7 @@ import {
|
|
|
1070
1070
|
reconstructFusionInputs,
|
|
1071
1071
|
selfDeps,
|
|
1072
1072
|
serializeFusionDay
|
|
1073
|
-
} from "./chunk-
|
|
1073
|
+
} from "./chunk-JUROR7PB.js";
|
|
1074
1074
|
import {
|
|
1075
1075
|
buildRetiredFactTombstoneInputs
|
|
1076
1076
|
} from "./chunk-QGVCFVX6.js";
|
|
@@ -1089,12 +1089,12 @@ import {
|
|
|
1089
1089
|
embeddingBacklogExceeds,
|
|
1090
1090
|
isSearchHealthDegraded,
|
|
1091
1091
|
namespaceCollectionName
|
|
1092
|
-
} from "./chunk-
|
|
1092
|
+
} from "./chunk-5RBHL5TF.js";
|
|
1093
1093
|
import {
|
|
1094
1094
|
createConversationIndexRuntime,
|
|
1095
1095
|
createSearchBackend,
|
|
1096
1096
|
isSearchBackendEnabled
|
|
1097
|
-
} from "./chunk-
|
|
1097
|
+
} from "./chunk-2LXROA34.js";
|
|
1098
1098
|
import {
|
|
1099
1099
|
NoopSearchBackend
|
|
1100
1100
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -1174,10 +1174,10 @@ import {
|
|
|
1174
1174
|
} from "./chunk-Y33KJ556.js";
|
|
1175
1175
|
import {
|
|
1176
1176
|
mergeSearchQueryOptions
|
|
1177
|
-
} from "./chunk-
|
|
1177
|
+
} from "./chunk-FZF7JX76.js";
|
|
1178
1178
|
import {
|
|
1179
1179
|
renderQmdBacklogStatus
|
|
1180
|
-
} from "./chunk-
|
|
1180
|
+
} from "./chunk-2WREX7KD.js";
|
|
1181
1181
|
import {
|
|
1182
1182
|
isUntrustedOrigin,
|
|
1183
1183
|
parseOriginClass
|
|
@@ -1610,7 +1610,7 @@ import {
|
|
|
1610
1610
|
} from "./chunk-QUIRIG2P.js";
|
|
1611
1611
|
import {
|
|
1612
1612
|
AccessAuditAdapter
|
|
1613
|
-
} from "./chunk-
|
|
1613
|
+
} from "./chunk-ZX5N5D6M.js";
|
|
1614
1614
|
import {
|
|
1615
1615
|
authorizationProbeNamespaces,
|
|
1616
1616
|
authorizationProbeRequiresPrincipalNamespace,
|
|
@@ -23789,7 +23789,7 @@ var OrchestratorInitCoordinator = class {
|
|
|
23789
23789
|
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
23790
23790
|
if (lifecycleCaps.lifecyclePolicy && resolveQmdCapabilities(this.deps.config).qmdTierMigration) {
|
|
23791
23791
|
try {
|
|
23792
|
-
const { runFirstStartMigration } = await import("./first-start-migration-
|
|
23792
|
+
const { runFirstStartMigration } = await import("./first-start-migration-TCPK2I7J.js");
|
|
23793
23793
|
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
23794
23794
|
const result = await runFirstStartMigration({
|
|
23795
23795
|
storage: this.deps.storage,
|
|
@@ -68044,4 +68044,4 @@ export {
|
|
|
68044
68044
|
EngramAccessService,
|
|
68045
68045
|
AccessAdminOpsSurface
|
|
68046
68046
|
};
|
|
68047
|
-
//# sourceMappingURL=chunk-
|
|
68047
|
+
//# sourceMappingURL=chunk-VRDG7XFJ.js.map
|
|
@@ -51,12 +51,14 @@ async function appendInteractionLog(memoryDir, peerId, entry) {
|
|
|
51
51
|
}
|
|
52
52
|
const e = parsedEntry.data;
|
|
53
53
|
assertCanonicalIsoTimestamp(e.timestamp, "interaction entry timestamp");
|
|
54
|
-
await mkdirPeerDirAtomic(memoryDir, peerId);
|
|
55
|
-
await assertPeerDirNotEscaped(memoryDir, peerId);
|
|
56
54
|
const file = interactionsPath(memoryDir, peerId);
|
|
57
55
|
const line = formatLogEntry(e) + "\n";
|
|
58
56
|
const prev = appendQueues.get(file) ?? Promise.resolve();
|
|
59
|
-
const write = prev.then(() =>
|
|
57
|
+
const write = prev.then(async () => {
|
|
58
|
+
await mkdirPeerDirAtomic(memoryDir, peerId);
|
|
59
|
+
await assertPeerDirNotEscaped(memoryDir, peerId);
|
|
60
|
+
await appendFileNoFollow(file, line);
|
|
61
|
+
});
|
|
60
62
|
const tail = write.catch(() => {
|
|
61
63
|
});
|
|
62
64
|
appendQueues.set(file, tail);
|
|
@@ -409,4 +411,4 @@ export {
|
|
|
409
411
|
parsePeerProfileReasonerResponse,
|
|
410
412
|
runPeerProfileReasoner
|
|
411
413
|
};
|
|
412
|
-
//# sourceMappingURL=chunk-
|
|
414
|
+
//# sourceMappingURL=chunk-WTXUUZYI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/peers/interaction-log-append.ts","../src/peers/profile-reasoner.ts"],"sourcesContent":["/**\n * peers/interaction-log-append.ts — append path for the peer\n * interaction log, extracted from storage.ts (#1995 ratchet: the file\n * exceeded its grandfathered ceiling). Read/parse stays in storage.ts.\n */\n\nimport { z } from \"zod\";\n\nimport type { PeerInteractionLogEntry } from \"./types.js\";\nimport {\n appendFileNoFollow,\n assertPeerDirNotEscaped,\n assertValidPeerId,\n interactionsPath,\n mkdirPeerDirAtomic,\n} from \"./storage.js\";\n\n// Boundary decode for the untrusted entry argument. The checks below\n// carry the Codex P2 review history: trim() before the empty check\n// matches what sanitizeLogField does at format time (round 10/12); a\n// whitespace-only timestamp or kind would previously pass validation\n// and then be normalized to \"\" later, producing an entry like\n// `- [] ()` that breaks downstream parsers; optional sessionId must be\n// a non-empty string OR strictly `undefined` — null and \"\" are both\n// rejected explicitly (rounds 6/8/9) because silently dropping them\n// reinterprets invalid input instead of failing fast.\nconst NON_WHITESPACE_TIMESTAMP = \"interaction entry must have a non-whitespace timestamp\";\nconst NON_WHITESPACE_KIND = \"interaction entry must have a non-whitespace kind\";\nconst STRING_SUMMARY = \"interaction entry must have a string summary\";\nconst NON_WHITESPACE_SESSION = \"interaction entry sessionId must be a non-whitespace string when provided\";\nconst interactionEntrySchema = z.object({\n timestamp: z.string({ error: NON_WHITESPACE_TIMESTAMP }).trim().min(1, NON_WHITESPACE_TIMESTAMP),\n kind: z.string({ error: NON_WHITESPACE_KIND }).trim().min(1, NON_WHITESPACE_KIND),\n summary: z.string({ error: STRING_SUMMARY }),\n sessionId: z.string({ error: NON_WHITESPACE_SESSION }).trim().min(1, NON_WHITESPACE_SESSION).optional(),\n});\n\nfunction sanitizeLogField(value: string): string {\n // Cursor Medium: every interaction-log field — not just summary —\n // must collapse newlines so a malicious or buggy `timestamp` /\n // `kind` / `sessionId` value can't break the one-line-per-entry\n // invariant the append-only log relies on. Replace CR/LF/Tab with\n // a single space; trim leading/trailing whitespace.\n return value.replace(/[\\r\\n\\t]+/g, \" \").trim();\n}\n\nfunction isCanonicalIsoTimestamp(value: string): boolean {\n const ms = Date.parse(value);\n return Number.isFinite(ms) && new Date(ms).toISOString() === value;\n}\nfunction assertCanonicalIsoTimestamp(value: string, field: string): void {\n if (!isCanonicalIsoTimestamp(value)) {\n throw new Error(`${field} must be a canonical ISO-8601 timestamp`);\n }\n}\n\nfunction formatLogEntry(entry: PeerInteractionLogEntry): string {\n // One line per entry. We use a leading bullet so the file remains\n // readable as ordinary markdown. Order: timestamp, kind, optional\n // session id, summary. ALL fields are passed through `sanitizeLogField`\n // so a stray newline anywhere can't shatter the append-only invariant\n // (cursor Medium on PR #723).\n //\n // Cursor Low on PR #736: the previous bare `session=<id>` token was\n // ambiguous with summaries that literally start with `session=`\n // (e.g. summary `\"session=foo bar\"` round-tripped to\n // `{sessionId: \"foo\", summary: \"bar\"}`). New entries wrap the\n // session marker in square brackets — `[session=<id>]` — which a\n // sanitized summary can never start with (sanitizeLogField never\n // emits `[` as the first character of a summary that originally\n // started with `session=`, and bracketed metadata is unambiguously\n // distinct from `session=` text). Old entries written by previous\n // code remain parseable through the legacy fallback in\n // `parseLogLine`.\n const ts = sanitizeLogField(entry.timestamp);\n const kind = sanitizeLogField(entry.kind);\n const summary = sanitizeLogField(entry.summary);\n const session = entry.sessionId\n ? ` [session=${sanitizeLogField(entry.sessionId)}]`\n : \"\";\n return `- [${ts}] (${kind})${session} ${summary}`;\n}\n\n/**\n * Append one entry to a peer's interaction log.\n *\n * Creates `peers/{id}/` and `interactions.log.md` if needed. The file is\n * append-only by contract — this helper never rewrites prior entries.\n * Returns the absolute path of the log file (useful for tests).\n *\n * Concurrency contract: appends to the same file are serialized\n * in-process via a per-file promise chain — entries land in enqueue\n * order and a single entry can never be split by another writer's chunk\n * (#3564). Ordering across separate PROCESSES is still the caller's\n * responsibility (POSIX gives atomicity per write, not ordering).\n */\n// Per-file tail of the append chain. Bounded to files with an in-flight\n// write: the writer deletes its entry when it is still the tail.\nconst appendQueues = new Map<string, Promise<void>>();\nexport async function appendInteractionLog(\n memoryDir: string,\n peerId: string,\n entry: PeerInteractionLogEntry,\n): Promise<string> {\n assertValidPeerId(peerId);\n const parsedEntry = interactionEntrySchema.safeParse(entry);\n if (!parsedEntry.success) {\n throw new Error(parsedEntry.error.issues[0]?.message ?? \"invalid interaction entry\");\n }\n const e = parsedEntry.data;\n assertCanonicalIsoTimestamp(e.timestamp, \"interaction entry timestamp\");\n const file = interactionsPath(memoryDir, peerId);\n const line = formatLogEntry(e) + \"\\n\";\n // `appendFile` creates the file if it does not exist. Serialize writes\n // per file so concurrent callers' entries land in enqueue order —\n // `fh.writeFile` chunks a large entry across multiple writes, and an\n // unqueued writer could otherwise interleave between them (#3564).\n // The chain tail is kept on a .catch(() => {}) so one failed append\n // does not poison the queue for followers.\n //\n // The queue slot is taken SYNCHRONOUSLY, before the directory awaits:\n // a caller that awaits mkdir first can otherwise reach this block after\n // a later caller (the dir already exists, so its mkdir returns faster),\n // and the later entry would be written first. Taking the slot here makes\n // enqueue order equal call order.\n const prev = appendQueues.get(file) ?? Promise.resolve();\n const write = prev.then(async () => {\n await mkdirPeerDirAtomic(memoryDir, peerId);\n await assertPeerDirNotEscaped(memoryDir, peerId);\n await appendFileNoFollow(file, line);\n });\n const tail = write.catch(() => {});\n appendQueues.set(file, tail);\n try {\n await write;\n } finally {\n if (appendQueues.get(file) === tail) appendQueues.delete(file);\n }\n return file;\n}\n","/**\n * Peer profile reasoner — issue #679 PR 2/5.\n *\n * Pure async function that, for each peer:\n *\n * 1. Reads recent interaction-log entries via `readPeerInteractionLog`.\n * 2. Calls an injected LLM client (same chat shape as\n * `FallbackLlmClient.chatCompletion`) to derive 0..N profile-field\n * proposals with provenance `{observedAt, signal, sourceSessionId,\n * note}`.\n * 3. Merges the proposals into the peer's existing `PeerProfile`,\n * appending provenance entries (never replacing existing\n * provenance — the reasoner is additive by design so the operator\n * retains the full audit trail).\n * 4. Writes via `writePeerProfile`.\n *\n * Gating is handled in two layers:\n *\n * - The orchestrator wires the call behind the\n * `peerProfileReasonerEnabled` config flag (default `false` —\n * opt-in per Gotcha #30/#48). The reasoner ALSO short-circuits\n * when `options.enabled !== true`, so direct callers can't\n * accidentally bypass the flag.\n * - Per-peer, the `peerProfileReasonerMinInteractions` threshold\n * skips peers whose log has fewer entries since the last reasoner\n * run than required.\n *\n * The reasoner is intentionally storage-agnostic — it accepts an LLM\n * client by interface (`PeerProfileReasonerLlm`) so tests can mock the\n * call and the orchestrator can inject either the gateway client or\n * a fast local model. No direct OpenAI imports here.\n */\n\nimport {\n listPeers,\n readPeerInteractionLog,\n readPeerProfile,\n writePeerProfile,\n} from \"./storage.js\";\nimport { appendInteractionLog } from \"./interaction-log-append.js\";\nimport type {\n Peer,\n PeerInteractionLogEntry,\n PeerProfile,\n PeerProfileFieldProvenance,\n} from \"./types.js\";\nimport { PEER_ID_PATTERN } from \"./types.js\";\n\n// ──────────────────────────────────────────────────────────────────────\n// Types\n// ──────────────────────────────────────────────────────────────────────\n\n/**\n * Minimal chat-completion contract the reasoner depends on. Matches\n * `FallbackLlmClient.chatCompletion` so the orchestrator can pass it\n * through directly. Tests inject a mock that returns canned strings.\n *\n * Returning `null` means the LLM is unavailable / failed — the\n * reasoner treats that as \"no proposals for this peer\" rather than an\n * error so a flaky LLM never aborts the whole pass.\n */\nexport interface PeerProfileReasonerLlm {\n chatCompletion(\n messages: Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }>,\n options?: { temperature?: number; maxTokens?: number; timeoutMs?: number },\n ): Promise<{ content: string } | null>;\n}\n\n/**\n * One LLM-proposed profile-field update.\n *\n * `value` is the new markdown string to set under `field`. The\n * provenance entry the LLM emits travels alongside it; the reasoner\n * does NOT trust the LLM's `observedAt` — it always overwrites with\n * the run's `now` timestamp so provenance can never claim future or\n * past observation timestamps the operator didn't witness.\n */\nexport interface PeerProfileReasonerProposal {\n /** Stable section key, e.g. \"communication_style\". */\n readonly field: string;\n /** Markdown value to set under that key. */\n readonly value: string;\n /**\n * Short label for the signal that justified the inference,\n * e.g. \"explicit_preference\", \"tool_pattern\", \"topic_recurrence\".\n */\n readonly signal: string;\n /** Optional free-form note explaining the inference. */\n readonly note?: string;\n /**\n * Originating session id, when the LLM can attribute the inference\n * to a specific log line. Reasoner clamps this to a value that\n * actually appeared in the log window so the LLM can't hallucinate.\n */\n readonly sourceSessionId?: string;\n}\n\nexport interface PeerProfileReasonerOptions {\n /** Memory directory containing the peers/ subtree. */\n readonly memoryDir: string;\n /**\n * Master gate. When `false` (the default the orchestrator passes\n * when the config flag is off), the reasoner is a no-op and\n * returns an empty result. Direct callers must explicitly pass\n * `true` so the gate can never be defaulted ON by accident\n * (Gotcha #48 — least-privileged default).\n */\n readonly enabled: boolean;\n /** Injected LLM client. Required when `enabled === true`. */\n readonly llm?: PeerProfileReasonerLlm;\n /** Model name to log for telemetry; not used to dispatch. */\n readonly model?: string;\n /**\n * Minimum new interaction-log entries since last reasoner run\n * before this peer is processed. Peers below the threshold are\n * skipped with `reason: \"below_min_interactions\"`.\n */\n readonly minInteractions: number;\n /**\n * Hard cap on profile fields the reasoner will accept across all\n * peers in a single run. Tracked in insertion order: once the cap\n * is reached, subsequent proposals are dropped with\n * `dropped_due_to_cap` in the per-peer result. Use to bound LLM\n * cost and reviewer load per pass.\n */\n readonly maxFieldsPerRun: number;\n /**\n * Optional restriction to specific peer ids. When omitted, the\n * reasoner enumerates the entire peer registry via `listPeers`.\n */\n readonly peerIds?: ReadonlyArray<string>;\n /**\n * Maximum number of recent log entries to feed the LLM per peer.\n * Defaults to 50. Bounded so a runaway log can't blow the prompt.\n */\n readonly maxLogEntriesPerPeer?: number;\n /**\n * Reasoner run timestamp. Defaults to `new Date()` at call time.\n * Tests inject a deterministic clock; the orchestrator passes\n * `new Date()` so provenance entries reflect actual wall time.\n */\n readonly now?: Date;\n /**\n * Optional logger; defaults to a no-op so the reasoner stays\n * silent in unit tests. The orchestrator wires its `log` here so\n * runs surface in the gateway log under the\n * `[peer-profile-reasoner]` prefix.\n */\n readonly log?: {\n debug?: (msg: string) => void;\n info?: (msg: string) => void;\n warn?: (msg: string) => void;\n };\n /**\n * Whether to append a `peer_profile_reasoner_run` entry to the\n * peer's interaction log when the reasoner emits at least one\n * field for that peer. Defaults to `true`. Disable in tests that\n * want to assert the log was untouched.\n */\n readonly appendRunMarkerToLog?: boolean;\n /**\n * Optional abort signal. The reasoner checks between peers and\n * returns the partial result if cancelled mid-run.\n */\n readonly signal?: AbortSignal;\n}\n\nexport interface PeerProfileReasonerPeerResult {\n readonly peerId: string;\n readonly status:\n | \"processed\"\n | \"skipped_below_min_interactions\"\n | \"skipped_no_log\"\n | \"skipped_disabled\"\n | \"skipped_no_llm\"\n | \"skipped_llm_unavailable\"\n | \"skipped_invalid_proposal\"\n | \"skipped_cap_reached\"\n | \"skipped_aborted\"\n | \"error\";\n /** Number of fields actually applied to the peer's profile. */\n readonly fieldsApplied: number;\n /** Number of proposals dropped because the per-run cap was hit. */\n readonly droppedDueToCap: number;\n /** Set of field keys applied; useful for tests and telemetry. */\n readonly fields: ReadonlyArray<string>;\n /** Error message, when `status === \"error\"`. */\n readonly error?: string;\n}\n\nexport interface PeerProfileReasonerResult {\n readonly peersConsidered: number;\n readonly peersProcessed: number;\n readonly fieldsApplied: number;\n readonly perPeer: ReadonlyArray<PeerProfileReasonerPeerResult>;\n}\n\n// ──────────────────────────────────────────────────────────────────────\n// Prompt + parser (pure, exported for tests)\n// ──────────────────────────────────────────────────────────────────────\n\n/**\n * Build the user-facing reasoner prompt. The system message carries\n * the strict-JSON instruction; this function emits the user message\n * with the peer context and the recent log slice.\n *\n * The prompt is intentionally schema-prescriptive — sibling modules\n * (`semantic-consolidation.ts`, `extraction-judge.ts`) demonstrated\n * that letting the LLM improvise field names produces unstable\n * profiles across runs.\n */\nexport function buildPeerProfileReasonerPrompt(input: {\n peer: Peer;\n existingProfile: PeerProfile | null;\n log: ReadonlyArray<PeerInteractionLogEntry>;\n maxFields: number;\n}): string {\n const existingFields = input.existingProfile\n ? Object.keys(input.existingProfile.fields)\n : [];\n const logBlock = input.log\n .map((e) => {\n const session = e.sessionId ? ` session=${e.sessionId}` : \"\";\n return `- [${e.timestamp}] (${e.kind})${session} ${e.summary}`;\n })\n .join(\"\\n\");\n return [\n `You are an async peer-profile reasoner. Your job is to read recent interaction-log entries for one peer and propose 0..${input.maxFields} profile-field updates.`,\n \"\",\n `Peer:`,\n ` id: ${input.peer.id}`,\n ` kind: ${input.peer.kind}`,\n ` displayName: ${input.peer.displayName}`,\n \"\",\n `Existing profile field keys (preserve names when proposing updates that refine an existing field): ${existingFields.length > 0 ? existingFields.join(\", \") : \"(none yet)\"}`,\n \"\",\n `Recent interaction log (oldest first):`,\n logBlock.length > 0 ? logBlock : \"(no entries)\",\n \"\",\n `Output a single JSON object: {\"proposals\": [{\"field\": \"<stable_key>\", \"value\": \"<markdown>\", \"signal\": \"<short_label>\", \"note\": \"<optional>\", \"sourceSessionId\": \"<optional>\"}]}.`,\n \"\",\n `Rules:`,\n `1. Only propose fields supported by evidence in the log. Do not invent.`,\n `2. Keys are short snake_case (e.g. \"communication_style\", \"tool_patterns\").`,\n `3. value is markdown. signal is a short label like \"explicit_preference\" or \"topic_recurrence\".`,\n `4. Omit fields you can't justify. Empty proposals array is valid.`,\n `5. Output JSON ONLY — no prose before or after.`,\n ].join(\"\\n\");\n}\n\n/**\n * Parse the LLM response. Tolerates a fenced code block wrapper.\n * Returns an empty array on any malformed payload — the contract is\n * that flaky LLM output silently produces zero proposals rather than\n * surfacing an error to the caller.\n *\n * Exported so unit tests can verify parser behavior without spinning\n * up the full reasoner.\n */\nexport function parsePeerProfileReasonerResponse(\n raw: string,\n): PeerProfileReasonerProposal[] {\n if (typeof raw !== \"string\" || raw.trim() === \"\") return [];\n const trimmed = raw.trim();\n // Dropped the \\s* groups around the lazy body (they overlapped it and\n // backtracked polynomially — CodeQL js/polynomial-redos). Input is already\n // trimmed and fenced[1] is trimmed below, so matches are identical.\n const fenced = /^```(?:json)?([\\s\\S]*?)```$/u.exec(trimmed);\n const payload = fenced ? fenced[1].trim() : trimmed;\n let parsed: unknown;\n try {\n parsed = JSON.parse(payload);\n } catch {\n return [];\n }\n // Gotcha #18: JSON.parse('null') succeeds. Reject non-objects.\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return [];\n }\n const obj = parsed as { proposals?: unknown };\n if (!Array.isArray(obj.proposals)) return [];\n const out: PeerProfileReasonerProposal[] = [];\n // Gotcha — drop prototype-pollution keys at the field-name layer.\n const RESERVED_KEYS = new Set([\"__proto__\", \"constructor\", \"prototype\"]);\n for (const item of obj.proposals) {\n if (typeof item !== \"object\" || item === null || Array.isArray(item)) continue;\n const r = item as Record<string, unknown>;\n if (typeof r.field !== \"string\" || r.field.trim() === \"\") continue;\n if (RESERVED_KEYS.has(r.field)) continue;\n if (typeof r.value !== \"string\" || r.value.trim() === \"\") continue;\n if (typeof r.signal !== \"string\" || r.signal.trim() === \"\") continue;\n const proposal: PeerProfileReasonerProposal = {\n field: r.field,\n value: r.value,\n signal: r.signal,\n ...(typeof r.note === \"string\" && r.note.length > 0 ? { note: r.note } : {}),\n ...(typeof r.sourceSessionId === \"string\" && r.sourceSessionId.length > 0\n ? { sourceSessionId: r.sourceSessionId }\n : {}),\n };\n out.push(proposal);\n }\n return out;\n}\n\n// ──────────────────────────────────────────────────────────────────────\n// Reasoner core\n// ──────────────────────────────────────────────────────────────────────\n\nconst SYSTEM_MESSAGE =\n 'You are a peer-profile reasoner. Output ONLY a JSON object of the form {\"proposals\":[{\"field\":\"...\",\"value\":\"...\",\"signal\":\"...\",\"note\":\"...\",\"sourceSessionId\":\"...\"}]}. No prose, no fenced code block, no commentary.';\n\nconst RUN_MARKER_KIND = \"peer_profile_reasoner_run\";\n\n/**\n * Find the most recent reasoner-run marker timestamp in the log.\n * Used to count \"interactions since last run\" so the threshold\n * gate doesn't keep firing on the same dormant log forever.\n */\nfunction lastRunTimestamp(\n log: ReadonlyArray<PeerInteractionLogEntry>,\n): string | undefined {\n let latest: string | undefined;\n for (const entry of log) {\n if (entry.kind !== RUN_MARKER_KIND) continue;\n if (latest === undefined || entry.timestamp > latest) {\n latest = entry.timestamp;\n }\n }\n return latest;\n}\n\nfunction noopLogger(): NonNullable<PeerProfileReasonerOptions[\"log\"]> {\n return { debug: () => {}, info: () => {}, warn: () => {} };\n}\n\n/**\n * Run the reasoner across all (or the requested subset of) peers.\n *\n * Always returns a `PeerProfileReasonerResult` — never throws to the\n * caller — so the orchestrator can wire it as a best-effort\n * post-consolidation hook (Gotcha #13).\n */\nexport async function runPeerProfileReasoner(\n options: PeerProfileReasonerOptions,\n): Promise<PeerProfileReasonerResult> {\n const log = {\n debug: options.log?.debug ?? noopLogger().debug!,\n info: options.log?.info ?? noopLogger().info!,\n warn: options.log?.warn ?? noopLogger().warn!,\n };\n const result: {\n peersConsidered: number;\n peersProcessed: number;\n fieldsApplied: number;\n perPeer: PeerProfileReasonerPeerResult[];\n } = {\n peersConsidered: 0,\n peersProcessed: 0,\n fieldsApplied: 0,\n perPeer: [],\n };\n // Disabled flag is the master gate. Defaults to false in callers'\n // config; we additionally require strict `=== true` here so a\n // stray \"true\" string doesn't silently flip the flag (Gotcha #36).\n if (options.enabled !== true) {\n log.debug(\"[peer-profile-reasoner] disabled — no-op\");\n return result;\n }\n if (!options.llm) {\n log.warn(\"[peer-profile-reasoner] no LLM client supplied — skipping run\");\n return result;\n }\n const minInteractions = Number.isFinite(options.minInteractions)\n ? Math.max(0, Math.floor(options.minInteractions))\n : 0;\n const maxFields = Number.isFinite(options.maxFieldsPerRun)\n ? Math.max(0, Math.floor(options.maxFieldsPerRun))\n : 0;\n if (maxFields === 0) {\n log.debug(\"[peer-profile-reasoner] maxFieldsPerRun=0 — no-op\");\n return result;\n }\n const maxLogPerPeer = Number.isFinite(options.maxLogEntriesPerPeer ?? NaN)\n ? Math.max(1, Math.floor(options.maxLogEntriesPerPeer as number))\n : 50;\n const now = options.now ?? new Date();\n const nowIso = now.toISOString();\n\n let peers: Peer[];\n try {\n if (options.peerIds && options.peerIds.length > 0) {\n // Filter the explicit list against on-disk peers so we never\n // act on an id the operator typed but didn't register.\n const all = await listPeers(options.memoryDir);\n const wanted = new Set(\n options.peerIds.filter(\n (id) => typeof id === \"string\" && PEER_ID_PATTERN.test(id),\n ),\n );\n peers = all.filter((p) => wanted.has(p.id));\n } else {\n peers = await listPeers(options.memoryDir);\n }\n } catch (err) {\n log.warn(\n `[peer-profile-reasoner] listPeers failed: ${err instanceof Error ? err.message : String(err)}`,\n );\n return result;\n }\n result.peersConsidered = peers.length;\n let fieldsAppliedTotal = 0;\n\n for (const peer of peers) {\n if (options.signal?.aborted) {\n result.perPeer.push({\n peerId: peer.id,\n status: \"skipped_aborted\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n try {\n // Codex P2 review on PR #736: the min-interactions threshold\n // must reflect the FULL log of new activity, not the\n // `maxLogPerPeer`-truncated slice. Otherwise a peer with a\n // genuinely active conversation history can be permanently\n // marked `skipped_below_min_interactions` whenever\n // `peerProfileReasonerMinInteractions > maxLogEntriesPerPeer`,\n // because the slice will never include enough new entries.\n // Read the full log first to compute the gate, then truncate\n // for prompt construction below.\n const fullLog = await readPeerInteractionLog(\n options.memoryDir,\n peer.id,\n );\n if (fullLog.length === 0) {\n result.perPeer.push({\n peerId: peer.id,\n status: \"skipped_no_log\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n // Count interactions since the last reasoner-run marker, so\n // dormant peers don't trigger another LLM call until enough\n // new signal accumulates. Run markers themselves don't count.\n const lastRun = lastRunTimestamp(fullLog);\n const sinceLastRunFull = lastRun\n ? fullLog.filter(\n (e) => e.timestamp > lastRun && e.kind !== RUN_MARKER_KIND,\n )\n : fullLog.filter((e) => e.kind !== RUN_MARKER_KIND);\n if (sinceLastRunFull.length < minInteractions) {\n result.perPeer.push({\n peerId: peer.id,\n status: \"skipped_below_min_interactions\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n // Truncate ONLY for prompt construction so the LLM context\n // stays bounded. Use the most recent `maxLogPerPeer` entries\n // from the full since-last-run set so the prompt prefers fresh\n // signal over older entries.\n const sinceLastRun =\n sinceLastRunFull.length > maxLogPerPeer\n ? sinceLastRunFull.slice(sinceLastRunFull.length - maxLogPerPeer)\n : sinceLastRunFull;\n\n const existingProfile = await readPeerProfile(options.memoryDir, peer.id);\n\n const remainingBudget = maxFields - fieldsAppliedTotal;\n if (remainingBudget <= 0) {\n result.perPeer.push({\n peerId: peer.id,\n status: \"skipped_cap_reached\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n\n const prompt = buildPeerProfileReasonerPrompt({\n peer,\n existingProfile,\n log: sinceLastRun,\n maxFields: remainingBudget,\n });\n const messages = [\n { role: \"system\" as const, content: SYSTEM_MESSAGE },\n { role: \"user\" as const, content: prompt },\n ];\n let response: { content: string } | null;\n try {\n response = await options.llm.chatCompletion(messages, {\n temperature: 0.2,\n maxTokens: 1500,\n });\n } catch (err) {\n log.warn(\n `[peer-profile-reasoner] LLM call failed for \"${peer.id}\": ${err instanceof Error ? err.message : String(err)}`,\n );\n result.perPeer.push({\n peerId: peer.id,\n status: \"skipped_llm_unavailable\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n if (!response || typeof response.content !== \"string\") {\n result.perPeer.push({\n peerId: peer.id,\n status: \"skipped_llm_unavailable\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n\n const proposals = parsePeerProfileReasonerResponse(response.content);\n if (proposals.length === 0) {\n result.perPeer.push({\n peerId: peer.id,\n status: \"processed\",\n fieldsApplied: 0,\n droppedDueToCap: 0,\n fields: [],\n });\n continue;\n }\n\n // Build the merged profile. We never replace existing\n // provenance entries — provenance is append-only so the\n // operator retains a full audit trail.\n const sessionIdsInWindow = new Set(\n sinceLastRun\n .map((e) => e.sessionId)\n .filter((s): s is string => typeof s === \"string\" && s.length > 0),\n );\n const baseFields: Record<string, string> = existingProfile\n ? { ...existingProfile.fields }\n : {};\n const baseProvenance: Record<string, PeerProfileFieldProvenance[]> = {};\n if (existingProfile) {\n for (const [k, list] of Object.entries(existingProfile.provenance)) {\n baseProvenance[k] = [...list];\n }\n }\n\n // Codex P1 review on PR #736: the global `fieldsAppliedTotal`\n // counter must NOT be incremented until the profile write\n // actually succeeds. Otherwise a transient I/O error here\n // poisons the per-run cap for every subsequent peer — they get\n // marked `skipped_cap_reached` for fields that were never\n // persisted. Track the candidate count locally and only\n // commit it to the run-wide budget after `writePeerProfile`\n // returns successfully (Gotcha #25 — don't destroy old state\n // before confirming new state succeeds).\n const appliedFieldsForPeer: string[] = [];\n let droppedDueToCap = 0;\n let invalidProposalSeen = false;\n for (const proposal of proposals) {\n // Use a candidate-budget projection so we never propose more\n // than the run-wide cap allows even before we know the write\n // will succeed.\n const candidateBudget =\n maxFields - fieldsAppliedTotal - appliedFieldsForPeer.length;\n if (candidateBudget <= 0) {\n droppedDueToCap += 1;\n continue;\n }\n // Final defensive guard against prototype keys (parser\n // already drops them, but be redundant for safety).\n if (\n proposal.field === \"__proto__\" ||\n proposal.field === \"constructor\" ||\n proposal.field === \"prototype\"\n ) {\n invalidProposalSeen = true;\n continue;\n }\n // Sanity-check field key matches a conservative pattern so a\n // hostile LLM can't sneak path-traversal-shaped keys through\n // for downstream consumers.\n if (!/^[a-zA-Z][a-zA-Z0-9_]{0,63}$/.test(proposal.field)) {\n invalidProposalSeen = true;\n continue;\n }\n baseFields[proposal.field] = proposal.value;\n const sourceSessionId =\n proposal.sourceSessionId &&\n sessionIdsInWindow.has(proposal.sourceSessionId)\n ? proposal.sourceSessionId\n : undefined;\n const provEntry: PeerProfileFieldProvenance = {\n observedAt: nowIso,\n signal: proposal.signal,\n ...(sourceSessionId ? { sourceSessionId } : {}),\n ...(proposal.note && proposal.note.length > 0\n ? { note: proposal.note }\n : {}),\n };\n const list = baseProvenance[proposal.field] ?? [];\n list.push(provEntry);\n baseProvenance[proposal.field] = list;\n appliedFieldsForPeer.push(proposal.field);\n // NOTE: fieldsAppliedTotal is NOT incremented here — see the\n // P1 comment above. We commit the budget after the write\n // succeeds.\n }\n\n if (appliedFieldsForPeer.length === 0) {\n result.perPeer.push({\n peerId: peer.id,\n status: invalidProposalSeen\n ? \"skipped_invalid_proposal\"\n : droppedDueToCap > 0\n ? \"skipped_cap_reached\"\n : \"processed\",\n fieldsApplied: 0,\n droppedDueToCap,\n fields: [],\n });\n continue;\n }\n\n const merged: PeerProfile = {\n peerId: peer.id,\n updatedAt: nowIso,\n fields: baseFields,\n provenance: baseProvenance,\n };\n await writePeerProfile(options.memoryDir, merged);\n // Write succeeded — NOW commit the budget. A throw above\n // bubbles to the outer catch, where the peer is recorded as\n // `error` and the global cap remains intact for subsequent\n // peers (Codex P1 fix on PR #736).\n fieldsAppliedTotal += appliedFieldsForPeer.length;\n\n // Append a run marker so the next reasoner pass can compute\n // \"interactions since last run\" without a dedicated state\n // file. The marker is best-effort — a write failure here\n // logs but does not roll back the profile (the operator\n // would prefer a slightly noisy threshold over a lost\n // profile update).\n const wantsMarker = options.appendRunMarkerToLog ?? true;\n if (wantsMarker) {\n try {\n await appendInteractionLog(options.memoryDir, peer.id, {\n timestamp: nowIso,\n kind: RUN_MARKER_KIND,\n summary: `applied ${appliedFieldsForPeer.length} field(s) via ${options.model ?? \"unknown-model\"}`,\n });\n } catch (err) {\n log.warn(\n `[peer-profile-reasoner] run-marker append failed for \"${peer.id}\": ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n\n result.perPeer.push({\n peerId: peer.id,\n status: \"processed\",\n fieldsApplied: appliedFieldsForPeer.length,\n droppedDueToCap,\n fields: appliedFieldsForPeer,\n });\n result.peersProcessed += 1;\n result.fieldsApplied = fieldsAppliedTotal;\n } catch (err) {\n log.warn(\n `[peer-profile-reasoner] error processing peer \"${peer.id}\": ${err instanceof Error ? err.message : String(err)}`,\n );\n result.perPeer.push({\n peerId: peer.id,\n status: \"error\",\n fieldsApplied: 0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