@remnic/core 9.69.0 → 9.69.2
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 +18 -18
- package/dist/access-authorization-probe.js +19 -19
- package/dist/access-boundary.js +18 -18
- package/dist/access-cli.js +76 -76
- package/dist/access-extraction-force-flush.js +18 -18
- package/dist/access-http-query.js +20 -20
- package/dist/access-http.js +34 -34
- package/dist/access-identity-continuity-surface.js +18 -18
- package/dist/access-lcm-surface.js +18 -18
- package/dist/access-mcp.js +25 -25
- package/dist/access-namespace-preflight.js +18 -18
- package/dist/access-observe-write-surface.js +18 -18
- package/dist/access-operations-batch.js +19 -19
- package/dist/access-operations.js +24 -24
- package/dist/access-recall-concurrency.js +18 -18
- package/dist/access-recall-response.js +18 -18
- package/dist/access-recall-surface.js +18 -18
- package/dist/access-service.js +18 -18
- package/dist/access-surface-catalog.js +20 -20
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/briefing.js +10 -10
- package/dist/causal-consolidation.js +11 -11
- package/dist/{chunk-4PEZMGZD.js → chunk-42JAVCED.js} +2 -2
- package/dist/{chunk-QOE3EM5Z.js → chunk-42LQMCEE.js} +8 -8
- package/dist/{chunk-PIBQIYF2.js → chunk-4EQBBIFH.js} +2 -2
- package/dist/{chunk-DJ7TZLGU.js → chunk-4FRP3R44.js} +2 -2
- package/dist/{chunk-25P3LW6U.js → chunk-5H5TKPBA.js} +2 -2
- package/dist/{chunk-L7MJJAG2.js → chunk-6FLNUDEO.js} +2 -2
- package/dist/{chunk-2MHMHF76.js → chunk-6LDZNG3T.js} +2 -2
- package/dist/{chunk-KAY2C6VX.js → chunk-7ATQD2GP.js} +2 -2
- package/dist/{chunk-P342D5BP.js → chunk-AEZCLP3C.js} +2 -2
- package/dist/{chunk-4PMPOZK3.js → chunk-AF67CHFU.js} +2 -2
- package/dist/{chunk-YYAWJRGL.js → chunk-AI6TT4Y3.js} +2 -2
- package/dist/{chunk-VLSUKXCJ.js → chunk-B6D3O5X2.js} +3 -3
- package/dist/{chunk-5UI7WQA6.js → chunk-C7KYMSL5.js} +2 -2
- package/dist/{chunk-BS5BD3DF.js → chunk-CCKIHXU5.js} +2 -2
- package/dist/{chunk-KJUH3QIQ.js → chunk-DKTIW44X.js} +2 -2
- package/dist/{chunk-3IRH5MYM.js → chunk-DMR6GVTW.js} +5 -5
- package/dist/{chunk-USQAH6PN.js → chunk-F6B3RUR4.js} +2 -2
- package/dist/{chunk-XZBXINXZ.js → chunk-GIC6BASP.js} +4 -4
- package/dist/{chunk-BGD3T743.js → chunk-GPTZFSMQ.js} +2 -2
- package/dist/{chunk-327JMA2N.js → chunk-IJCC5TSX.js} +2 -2
- package/dist/{chunk-NYQHD7H4.js → chunk-J7RZ4NJO.js} +11 -11
- package/dist/{chunk-6FUMA6AA.js → chunk-JAQXUGLN.js} +2 -2
- package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
- package/dist/{chunk-FOT5GP2U.js → chunk-JC5GCR3K.js} +2 -2
- package/dist/{chunk-363VZTVH.js → chunk-JU5SBSV7.js} +2 -2
- package/dist/{chunk-WQCET3N3.js → chunk-KXJ3IDD5.js} +2 -2
- package/dist/{chunk-YFK64FYK.js → chunk-LSGQRUTX.js} +2 -2
- package/dist/{chunk-X2NFFBTO.js → chunk-LVFI5LG7.js} +10 -10
- package/dist/{chunk-ABPCF4MW.js → chunk-LW5DFCGW.js} +1 -1
- package/dist/{chunk-KRNFJKMH.js → chunk-M73TXJJW.js} +2 -2
- package/dist/{chunk-RACZB5HT.js → chunk-N37X5RU7.js} +4 -4
- package/dist/{chunk-AG46P24C.js → chunk-NNBZS3DY.js} +4 -4
- package/dist/{chunk-HDQQRRCZ.js → chunk-PSFQ4HDM.js} +3 -3
- package/dist/{chunk-D35XLYQ7.js → chunk-RGCF4XNH.js} +9 -9
- package/dist/{chunk-F25CL3IQ.js → chunk-RJ7NOBKA.js} +2 -2
- package/dist/{chunk-A7NMS5II.js → chunk-RSPIDEY3.js} +3 -3
- package/dist/{chunk-ND6NL2YR.js → chunk-S7WPER23.js} +2 -2
- package/dist/{chunk-52GQNSLC.js → chunk-SB7PMYWV.js} +7 -7
- package/dist/{chunk-WSYACIKD.js → chunk-THWUR7JO.js} +2 -2
- package/dist/{chunk-BZ26443Y.js → chunk-TL2THUFH.js} +101 -53
- package/dist/chunk-TL2THUFH.js.map +1 -0
- package/dist/{chunk-XW3G4BJI.js → chunk-TV52QFXK.js} +7 -7
- package/dist/{chunk-ERKFG4RV.js → chunk-UXEAJ765.js} +34 -34
- package/dist/{chunk-ZVW724ZK.js → chunk-WFHBC4BQ.js} +2 -2
- package/dist/{chunk-7KG5V4VV.js → chunk-WJPSCTZY.js} +2 -2
- package/dist/{chunk-BHH736UQ.js → chunk-WKZSKFZC.js} +3 -3
- package/dist/{chunk-NFITGYMQ.js → chunk-XCVGQKTR.js} +3 -3
- package/dist/{chunk-BTRY6UH3.js → chunk-YJLGCUKZ.js} +2 -2
- package/dist/{chunk-Z2FXSE5P.js → chunk-YQPVXUJG.js} +2 -2
- package/dist/{chunk-ZDJMCXC7.js → chunk-ZBGODUSY.js} +12 -12
- package/dist/{chunk-XPDWNWH6.js → chunk-ZMVMYZMX.js} +3 -3
- package/dist/{chunk-I6T4SYFW.js → chunk-ZOMXROJ6.js} +3 -3
- package/dist/cli.js +50 -50
- package/dist/coding/export-okf-codegraph.js +10 -10
- package/dist/compounding/engine.js +10 -10
- package/dist/connectors/codex-materialize-runner.js +10 -10
- package/dist/connectors/index.js +10 -10
- package/dist/convergence-refresh.js +12 -12
- package/dist/corpus-watermark.js +12 -12
- package/dist/entity-retrieval.js +10 -10
- package/dist/external-wiki-access.js +19 -19
- package/dist/extraction.js +10 -10
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +94 -88
- package/dist/lcm/engine.js +4 -4
- package/dist/lcm/index.js +13 -13
- package/dist/location/index.js +12 -12
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.js +10 -10
- package/dist/operator-doctor-corpus.js +13 -13
- package/dist/operator-toolkit.js +18 -18
- package/dist/orchestration/maintenance.js +18 -18
- package/dist/orchestrator.js +76 -76
- package/dist/recall-deep-expand-select.d.ts +23 -0
- package/dist/recall-deep-expand-select.js +50 -0
- package/dist/recall-deep-expand-select.js.map +1 -0
- package/dist/recall-navigate-disclosure.d.ts +44 -0
- package/dist/recall-navigate-disclosure.js +30 -0
- package/dist/recall-navigate-disclosure.js.map +1 -0
- package/dist/recall-state-view-packet.d.ts +30 -0
- package/dist/recall-state-view-packet.js +69 -0
- package/dist/recall-state-view-packet.js.map +1 -0
- package/dist/search/factory.js +6 -6
- package/dist/search/index.js +10 -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/semantic-consolidation.js +11 -11
- package/dist/semantic-rule-promotion.js +10 -10
- package/dist/semantic-rule-verifier.js +10 -10
- package/dist/source-agent-qualifier.js +10 -10
- package/dist/standup/build.js +10 -10
- package/dist/storage.js +9 -9
- package/dist/support-passport/index.js +21 -21
- package/dist/transfer/export-okf.js +11 -11
- package/dist/verified-recall.js +10 -10
- package/dist/who-knows-cli.js +11 -11
- package/dist/who-knows.js +10 -10
- package/package.json +2 -2
- package/src/activity/timeline/index.ts +1 -0
- package/src/activity/timeline/week-recurring.test.ts +177 -0
- package/src/activity/timeline/week-recurring.ts +88 -0
- package/src/dedup/index.ts +7 -0
- package/src/dedup/merge-provenance.test.ts +185 -0
- package/src/dedup/merge-provenance.ts +151 -0
- package/src/recall-deep-expand-select.test.ts +163 -0
- package/src/recall-deep-expand-select.ts +65 -0
- package/src/recall-navigate-disclosure.test.ts +128 -0
- package/src/recall-navigate-disclosure.ts +45 -0
- package/src/recall-state-view-packet.test.ts +158 -0
- package/src/recall-state-view-packet.ts +128 -0
- package/dist/chunk-BZ26443Y.js.map +0 -1
- /package/dist/{chunk-4PEZMGZD.js.map → chunk-42JAVCED.js.map} +0 -0
- /package/dist/{chunk-QOE3EM5Z.js.map → chunk-42LQMCEE.js.map} +0 -0
- /package/dist/{chunk-PIBQIYF2.js.map → chunk-4EQBBIFH.js.map} +0 -0
- /package/dist/{chunk-DJ7TZLGU.js.map → chunk-4FRP3R44.js.map} +0 -0
- /package/dist/{chunk-25P3LW6U.js.map → chunk-5H5TKPBA.js.map} +0 -0
- /package/dist/{chunk-L7MJJAG2.js.map → chunk-6FLNUDEO.js.map} +0 -0
- /package/dist/{chunk-2MHMHF76.js.map → chunk-6LDZNG3T.js.map} +0 -0
- /package/dist/{chunk-KAY2C6VX.js.map → chunk-7ATQD2GP.js.map} +0 -0
- /package/dist/{chunk-P342D5BP.js.map → chunk-AEZCLP3C.js.map} +0 -0
- /package/dist/{chunk-4PMPOZK3.js.map → chunk-AF67CHFU.js.map} +0 -0
- /package/dist/{chunk-YYAWJRGL.js.map → chunk-AI6TT4Y3.js.map} +0 -0
- /package/dist/{chunk-VLSUKXCJ.js.map → chunk-B6D3O5X2.js.map} +0 -0
- /package/dist/{chunk-5UI7WQA6.js.map → chunk-C7KYMSL5.js.map} +0 -0
- /package/dist/{chunk-BS5BD3DF.js.map → chunk-CCKIHXU5.js.map} +0 -0
- /package/dist/{chunk-KJUH3QIQ.js.map → chunk-DKTIW44X.js.map} +0 -0
- /package/dist/{chunk-3IRH5MYM.js.map → chunk-DMR6GVTW.js.map} +0 -0
- /package/dist/{chunk-USQAH6PN.js.map → chunk-F6B3RUR4.js.map} +0 -0
- /package/dist/{chunk-XZBXINXZ.js.map → chunk-GIC6BASP.js.map} +0 -0
- /package/dist/{chunk-BGD3T743.js.map → chunk-GPTZFSMQ.js.map} +0 -0
- /package/dist/{chunk-327JMA2N.js.map → chunk-IJCC5TSX.js.map} +0 -0
- /package/dist/{chunk-NYQHD7H4.js.map → chunk-J7RZ4NJO.js.map} +0 -0
- /package/dist/{chunk-6FUMA6AA.js.map → chunk-JAQXUGLN.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-FOT5GP2U.js.map → chunk-JC5GCR3K.js.map} +0 -0
- /package/dist/{chunk-363VZTVH.js.map → chunk-JU5SBSV7.js.map} +0 -0
- /package/dist/{chunk-WQCET3N3.js.map → chunk-KXJ3IDD5.js.map} +0 -0
- /package/dist/{chunk-YFK64FYK.js.map → chunk-LSGQRUTX.js.map} +0 -0
- /package/dist/{chunk-X2NFFBTO.js.map → chunk-LVFI5LG7.js.map} +0 -0
- /package/dist/{chunk-ABPCF4MW.js.map → chunk-LW5DFCGW.js.map} +0 -0
- /package/dist/{chunk-KRNFJKMH.js.map → chunk-M73TXJJW.js.map} +0 -0
- /package/dist/{chunk-RACZB5HT.js.map → chunk-N37X5RU7.js.map} +0 -0
- /package/dist/{chunk-AG46P24C.js.map → chunk-NNBZS3DY.js.map} +0 -0
- /package/dist/{chunk-HDQQRRCZ.js.map → chunk-PSFQ4HDM.js.map} +0 -0
- /package/dist/{chunk-D35XLYQ7.js.map → chunk-RGCF4XNH.js.map} +0 -0
- /package/dist/{chunk-F25CL3IQ.js.map → chunk-RJ7NOBKA.js.map} +0 -0
- /package/dist/{chunk-A7NMS5II.js.map → chunk-RSPIDEY3.js.map} +0 -0
- /package/dist/{chunk-ND6NL2YR.js.map → chunk-S7WPER23.js.map} +0 -0
- /package/dist/{chunk-52GQNSLC.js.map → chunk-SB7PMYWV.js.map} +0 -0
- /package/dist/{chunk-WSYACIKD.js.map → chunk-THWUR7JO.js.map} +0 -0
- /package/dist/{chunk-XW3G4BJI.js.map → chunk-TV52QFXK.js.map} +0 -0
- /package/dist/{chunk-ERKFG4RV.js.map → chunk-UXEAJ765.js.map} +0 -0
- /package/dist/{chunk-ZVW724ZK.js.map → chunk-WFHBC4BQ.js.map} +0 -0
- /package/dist/{chunk-7KG5V4VV.js.map → chunk-WJPSCTZY.js.map} +0 -0
- /package/dist/{chunk-BHH736UQ.js.map → chunk-WKZSKFZC.js.map} +0 -0
- /package/dist/{chunk-NFITGYMQ.js.map → chunk-XCVGQKTR.js.map} +0 -0
- /package/dist/{chunk-BTRY6UH3.js.map → chunk-YJLGCUKZ.js.map} +0 -0
- /package/dist/{chunk-Z2FXSE5P.js.map → chunk-YQPVXUJG.js.map} +0 -0
- /package/dist/{chunk-ZDJMCXC7.js.map → chunk-ZBGODUSY.js.map} +0 -0
- /package/dist/{chunk-XPDWNWH6.js.map → chunk-ZMVMYZMX.js.map} +0 -0
- /package/dist/{chunk-I6T4SYFW.js.map → chunk-ZOMXROJ6.js.map} +0 -0
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
OKF_LOG_TRUNCATION_MARKER,
|
|
4
4
|
exportOkfBundle,
|
|
5
5
|
parseIncludeStatus
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-XCVGQKTR.js";
|
|
7
7
|
import {
|
|
8
8
|
OKF_EXPORT_VERSION
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YQPVXUJG.js";
|
|
10
10
|
import "../chunk-D24OXEPB.js";
|
|
11
11
|
import "../chunk-3UXOZBHV.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-UHVXE24Y.js";
|
|
12
|
+
import "../chunk-42LQMCEE.js";
|
|
14
13
|
import "../chunk-4ZWCQJNM.js";
|
|
14
|
+
import "../chunk-UHVXE24Y.js";
|
|
15
15
|
import "../chunk-WVGXCBOC.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-JAQXUGLN.js";
|
|
17
|
+
import "../chunk-RGCF4XNH.js";
|
|
18
|
+
import "../chunk-CYEPCZN5.js";
|
|
19
|
+
import "../chunk-GIC6BASP.js";
|
|
18
20
|
import "../chunk-YQNNHLCG.js";
|
|
19
21
|
import "../chunk-6KTXE6A3.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-CYEPCZN5.js";
|
|
23
|
-
import "../chunk-XZBXINXZ.js";
|
|
24
|
-
import "../chunk-GUMZC2BO.js";
|
|
22
|
+
import "../chunk-N37X5RU7.js";
|
|
23
|
+
import "../chunk-NNBZS3DY.js";
|
|
25
24
|
import "../chunk-W7IGLX4G.js";
|
|
25
|
+
import "../chunk-GUMZC2BO.js";
|
|
26
26
|
import "../chunk-227UFSEQ.js";
|
|
27
27
|
import "../chunk-ET356KSB.js";
|
|
28
28
|
import "../chunk-72A4L5JJ.js";
|
package/dist/verified-recall.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareVerifiedEpisodeResults,
|
|
3
3
|
searchVerifiedEpisodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JC5GCR3K.js";
|
|
5
5
|
import "./chunk-B7RWBZXW.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-UHVXE24Y.js";
|
|
6
|
+
import "./chunk-42LQMCEE.js";
|
|
8
7
|
import "./chunk-4ZWCQJNM.js";
|
|
8
|
+
import "./chunk-UHVXE24Y.js";
|
|
9
9
|
import "./chunk-WVGXCBOC.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-JAQXUGLN.js";
|
|
11
|
+
import "./chunk-RGCF4XNH.js";
|
|
12
|
+
import "./chunk-CYEPCZN5.js";
|
|
13
|
+
import "./chunk-GIC6BASP.js";
|
|
12
14
|
import "./chunk-YQNNHLCG.js";
|
|
13
15
|
import "./chunk-6KTXE6A3.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-CYEPCZN5.js";
|
|
17
|
-
import "./chunk-XZBXINXZ.js";
|
|
18
|
-
import "./chunk-GUMZC2BO.js";
|
|
16
|
+
import "./chunk-N37X5RU7.js";
|
|
17
|
+
import "./chunk-NNBZS3DY.js";
|
|
19
18
|
import "./chunk-W7IGLX4G.js";
|
|
19
|
+
import "./chunk-GUMZC2BO.js";
|
|
20
20
|
import "./chunk-227UFSEQ.js";
|
|
21
21
|
import "./chunk-ET356KSB.js";
|
|
22
22
|
import "./chunk-72A4L5JJ.js";
|
package/dist/who-knows-cli.js
CHANGED
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
renderWhoKnows,
|
|
5
5
|
renderWhoKnowsJson,
|
|
6
6
|
renderWhoKnowsText
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-UHVXE24Y.js";
|
|
7
|
+
} from "./chunk-S7WPER23.js";
|
|
8
|
+
import "./chunk-WJPSCTZY.js";
|
|
9
|
+
import "./chunk-42LQMCEE.js";
|
|
11
10
|
import "./chunk-4ZWCQJNM.js";
|
|
11
|
+
import "./chunk-UHVXE24Y.js";
|
|
12
12
|
import "./chunk-WVGXCBOC.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-JAQXUGLN.js";
|
|
14
|
+
import "./chunk-RGCF4XNH.js";
|
|
15
|
+
import "./chunk-CYEPCZN5.js";
|
|
16
|
+
import "./chunk-GIC6BASP.js";
|
|
15
17
|
import "./chunk-YQNNHLCG.js";
|
|
16
18
|
import "./chunk-6KTXE6A3.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-CYEPCZN5.js";
|
|
20
|
-
import "./chunk-XZBXINXZ.js";
|
|
21
|
-
import "./chunk-GUMZC2BO.js";
|
|
19
|
+
import "./chunk-N37X5RU7.js";
|
|
20
|
+
import "./chunk-NNBZS3DY.js";
|
|
22
21
|
import "./chunk-W7IGLX4G.js";
|
|
22
|
+
import "./chunk-GUMZC2BO.js";
|
|
23
23
|
import "./chunk-227UFSEQ.js";
|
|
24
24
|
import "./chunk-ET356KSB.js";
|
|
25
25
|
import "./chunk-72A4L5JJ.js";
|
package/dist/who-knows.js
CHANGED
|
@@ -9,21 +9,21 @@ import {
|
|
|
9
9
|
loadWhoKnowsEntities,
|
|
10
10
|
tokenizeTopic,
|
|
11
11
|
validateWhoKnowsInput
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-UHVXE24Y.js";
|
|
12
|
+
} from "./chunk-WJPSCTZY.js";
|
|
13
|
+
import "./chunk-42LQMCEE.js";
|
|
15
14
|
import "./chunk-4ZWCQJNM.js";
|
|
15
|
+
import "./chunk-UHVXE24Y.js";
|
|
16
16
|
import "./chunk-WVGXCBOC.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-JAQXUGLN.js";
|
|
18
|
+
import "./chunk-RGCF4XNH.js";
|
|
19
|
+
import "./chunk-CYEPCZN5.js";
|
|
20
|
+
import "./chunk-GIC6BASP.js";
|
|
19
21
|
import "./chunk-YQNNHLCG.js";
|
|
20
22
|
import "./chunk-6KTXE6A3.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-CYEPCZN5.js";
|
|
24
|
-
import "./chunk-XZBXINXZ.js";
|
|
25
|
-
import "./chunk-GUMZC2BO.js";
|
|
23
|
+
import "./chunk-N37X5RU7.js";
|
|
24
|
+
import "./chunk-NNBZS3DY.js";
|
|
26
25
|
import "./chunk-W7IGLX4G.js";
|
|
26
|
+
import "./chunk-GUMZC2BO.js";
|
|
27
27
|
import "./chunk-227UFSEQ.js";
|
|
28
28
|
import "./chunk-ET356KSB.js";
|
|
29
29
|
import "./chunk-72A4L5JJ.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.69.
|
|
3
|
+
"version": "9.69.2",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -3217,7 +3217,7 @@
|
|
|
3217
3217
|
"core"
|
|
3218
3218
|
],
|
|
3219
3219
|
"peerDependencies": {
|
|
3220
|
-
"@remnic/coding-graph": "^9.69.
|
|
3220
|
+
"@remnic/coding-graph": "^9.69.2"
|
|
3221
3221
|
},
|
|
3222
3222
|
"peerDependenciesMeta": {
|
|
3223
3223
|
"@remnic/coding-graph": {
|
|
@@ -15,6 +15,7 @@ export * from "./recap-markdown.js";
|
|
|
15
15
|
export * from "./week-export.js";
|
|
16
16
|
export * from "./week-snapshot.js";
|
|
17
17
|
export * from "./week-previous.js";
|
|
18
|
+
export * from "./week-recurring.js";
|
|
18
19
|
export * from "./analysis-batch.js";
|
|
19
20
|
export * from "./analysis-evidence.js";
|
|
20
21
|
export * from "./analysis-prompt.js";
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
DEFAULT_RECURRENCE_MIN_DAYS,
|
|
6
|
+
MIN_RECURRENCE_MIN_DAYS,
|
|
7
|
+
findRecurringPatterns,
|
|
8
|
+
type WeekDayOccurrence,
|
|
9
|
+
} from "./week-recurring.js";
|
|
10
|
+
|
|
11
|
+
function rangeErrorMatching(pattern: RegExp): (err: unknown) => boolean {
|
|
12
|
+
return (err: unknown) => err instanceof RangeError && pattern.test((err as Error).message);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
test("default minDays is 3; a key on exactly minDays distinct dates qualifies", () => {
|
|
16
|
+
assert.equal(DEFAULT_RECURRENCE_MIN_DAYS, 3);
|
|
17
|
+
const result = findRecurringPatterns({
|
|
18
|
+
occurrences: [
|
|
19
|
+
{ date: "2026-08-10", key: "code", durationMs: 100 },
|
|
20
|
+
{ date: "2026-08-11", key: "code", durationMs: 100 },
|
|
21
|
+
{ date: "2026-08-12", key: "code", durationMs: 100 },
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
assert.deepEqual(result, [{ key: "code", dayCount: 3, totalDurationMs: 300 }]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("a key on minDays - 1 distinct dates does not qualify", () => {
|
|
28
|
+
const result = findRecurringPatterns({
|
|
29
|
+
occurrences: [
|
|
30
|
+
{ date: "2026-08-10", key: "code", durationMs: 999_999 },
|
|
31
|
+
{ date: "2026-08-11", key: "code", durationMs: 999_999 },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
assert.deepEqual(result, []);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("same-date occurrences count as one day but all durations sum", () => {
|
|
38
|
+
const result = findRecurringPatterns({
|
|
39
|
+
occurrences: [
|
|
40
|
+
{ date: "2026-08-10", key: "code", durationMs: 100 },
|
|
41
|
+
{ date: "2026-08-10", key: "code", durationMs: 40 },
|
|
42
|
+
{ date: "2026-08-11", key: "code", durationMs: 100 },
|
|
43
|
+
{ date: "2026-08-12", key: "code", durationMs: 100 },
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
assert.deepEqual(result, [{ key: "code", dayCount: 3, totalDurationMs: 340 }]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("blank keys are ignored", () => {
|
|
50
|
+
const result = findRecurringPatterns({
|
|
51
|
+
occurrences: [
|
|
52
|
+
{ date: "2026-08-10", key: "", durationMs: 100 },
|
|
53
|
+
{ date: "2026-08-11", key: " ", durationMs: 100 },
|
|
54
|
+
{ date: "2026-08-12", key: "\t", durationMs: 100 },
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
assert.deepEqual(result, []);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("keys are compared trimmed and case-sensitively", () => {
|
|
61
|
+
const result = findRecurringPatterns({
|
|
62
|
+
occurrences: [
|
|
63
|
+
{ date: "2026-08-10", key: "code", durationMs: 100 },
|
|
64
|
+
{ date: "2026-08-11", key: " code ", durationMs: 100 },
|
|
65
|
+
{ date: "2026-08-12", key: "code", durationMs: 100 },
|
|
66
|
+
{ date: "2026-08-10", key: "Code", durationMs: 100 },
|
|
67
|
+
{ date: "2026-08-11", key: "Code", durationMs: 100 },
|
|
68
|
+
],
|
|
69
|
+
});
|
|
70
|
+
// " code " folds into "code" (3 distinct days); "Code" stays separate at 2 days.
|
|
71
|
+
assert.deepEqual(result, [{ key: "code", dayCount: 3, totalDurationMs: 300 }]);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("minDays must be an integer >= MIN_RECURRENCE_MIN_DAYS", () => {
|
|
75
|
+
for (const bad of [0, 1, -3, 1.5]) {
|
|
76
|
+
assert.throws(
|
|
77
|
+
() => findRecurringPatterns({ occurrences: [], minDays: bad }),
|
|
78
|
+
rangeErrorMatching(/minDays/),
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
assert.doesNotThrow(() =>
|
|
82
|
+
findRecurringPatterns({
|
|
83
|
+
occurrences: [{ date: "2026-08-10", key: "code", durationMs: 1 }],
|
|
84
|
+
minDays: MIN_RECURRENCE_MIN_DAYS,
|
|
85
|
+
}),
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// minDays 1 would make a single-day key "recurring", which is the invariant
|
|
90
|
+
// this helper exists to enforce — configuration must not be able to disable it.
|
|
91
|
+
test("minDays 1 is refused rather than reporting one-off keys", () => {
|
|
92
|
+
assert.throws(
|
|
93
|
+
() =>
|
|
94
|
+
findRecurringPatterns({
|
|
95
|
+
occurrences: [{ date: "2026-08-10", key: "code", durationMs: 5 }],
|
|
96
|
+
minDays: 1,
|
|
97
|
+
}),
|
|
98
|
+
rangeErrorMatching(/minDays/),
|
|
99
|
+
);
|
|
100
|
+
assert.equal(MIN_RECURRENCE_MIN_DAYS, 2);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test("durationMs must be a finite number >= 0", () => {
|
|
104
|
+
for (const bad of [Number.NaN, Number.POSITIVE_INFINITY, -1]) {
|
|
105
|
+
assert.throws(
|
|
106
|
+
() =>
|
|
107
|
+
findRecurringPatterns({
|
|
108
|
+
occurrences: [{ date: "2026-08-10", key: "code", durationMs: bad }],
|
|
109
|
+
}),
|
|
110
|
+
rangeErrorMatching(/durationMs/),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test("date must be a valid YYYY-MM-DD calendar date", () => {
|
|
116
|
+
for (const bad of ["", "not-a-date", "2026-8-10", "2026-02-30"]) {
|
|
117
|
+
assert.throws(
|
|
118
|
+
() =>
|
|
119
|
+
findRecurringPatterns({
|
|
120
|
+
occurrences: [{ date: bad, key: "code", durationMs: 0 }],
|
|
121
|
+
}),
|
|
122
|
+
rangeErrorMatching(/date/),
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("ordering: dayCount desc, then totalDurationMs desc, then key asc", () => {
|
|
128
|
+
const result = findRecurringPatterns({
|
|
129
|
+
minDays: 2,
|
|
130
|
+
occurrences: [
|
|
131
|
+
// alpha: 2 days, biggest total — dayCount still ranks it last.
|
|
132
|
+
{ date: "2026-08-10", key: "alpha", durationMs: 999_999 },
|
|
133
|
+
{ date: "2026-08-11", key: "alpha", durationMs: 999_999 },
|
|
134
|
+
// beta: 3 days, 10 total — wins the dayCount tie on duration.
|
|
135
|
+
{ date: "2026-08-10", key: "beta", durationMs: 4 },
|
|
136
|
+
{ date: "2026-08-11", key: "beta", durationMs: 4 },
|
|
137
|
+
{ date: "2026-08-12", key: "beta", durationMs: 2 },
|
|
138
|
+
// gamma: 3 days, 8 total — ties delta on both, loses on key ascending.
|
|
139
|
+
{ date: "2026-08-10", key: "gamma", durationMs: 8 },
|
|
140
|
+
{ date: "2026-08-11", key: "gamma", durationMs: 0 },
|
|
141
|
+
{ date: "2026-08-12", key: "gamma", durationMs: 0 },
|
|
142
|
+
// delta: 3 days, 8 total.
|
|
143
|
+
{ date: "2026-08-10", key: "delta", durationMs: 8 },
|
|
144
|
+
{ date: "2026-08-11", key: "delta", durationMs: 0 },
|
|
145
|
+
{ date: "2026-08-12", key: "delta", durationMs: 0 },
|
|
146
|
+
],
|
|
147
|
+
});
|
|
148
|
+
assert.deepEqual(result.map((p) => p.key), ["beta", "delta", "gamma", "alpha"]);
|
|
149
|
+
assert.deepEqual(result[0], { key: "beta", dayCount: 3, totalDurationMs: 10 });
|
|
150
|
+
assert.deepEqual(result[3], { key: "alpha", dayCount: 2, totalDurationMs: 1_999_998 });
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test("empty input and no-qualifier input return []", () => {
|
|
154
|
+
assert.deepEqual(findRecurringPatterns({ occurrences: [] }), []);
|
|
155
|
+
assert.deepEqual(
|
|
156
|
+
findRecurringPatterns({
|
|
157
|
+
occurrences: [{ date: "2026-08-10", key: "code", durationMs: 5000 }],
|
|
158
|
+
}),
|
|
159
|
+
[],
|
|
160
|
+
);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test("pure: two calls deep-equal and the input is not mutated", () => {
|
|
164
|
+
const occurrences: WeekDayOccurrence[] = [
|
|
165
|
+
{ date: "2026-08-10", key: "code", durationMs: 100 },
|
|
166
|
+
{ date: "2026-08-10", key: "code", durationMs: 50 },
|
|
167
|
+
{ date: "2026-08-11", key: "mail", durationMs: 10 },
|
|
168
|
+
{ date: "2026-08-11", key: "code", durationMs: 100 },
|
|
169
|
+
{ date: "2026-08-12", key: "code", durationMs: 100 },
|
|
170
|
+
];
|
|
171
|
+
const snapshot = structuredClone(occurrences);
|
|
172
|
+
const first = findRecurringPatterns({ occurrences });
|
|
173
|
+
const second = findRecurringPatterns({ occurrences });
|
|
174
|
+
assert.deepEqual(first, second);
|
|
175
|
+
assert.deepEqual(first, [{ key: "code", dayCount: 3, totalDurationMs: 350 }]);
|
|
176
|
+
assert.deepEqual(occurrences, snapshot);
|
|
177
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recurring weekly pattern gate (issue #2052).
|
|
3
|
+
*
|
|
4
|
+
* A category/application key counts as recurring only when it appeared on at
|
|
5
|
+
* least `minDays` DISTINCT days of the analyzed week, so a one-off blip is
|
|
6
|
+
* never reported as a pattern. Pure: no I/O, no clock, no input mutation.
|
|
7
|
+
* Validation happens on the exact occurrence values before any key trimming
|
|
8
|
+
* (AGENTS.md: validate before normalizing; reject non-finite numbers
|
|
9
|
+
* explicitly instead of letting NaN fall through a comparison).
|
|
10
|
+
*/
|
|
11
|
+
import { isValidActivityDate } from "../digest.js";
|
|
12
|
+
|
|
13
|
+
export const DEFAULT_RECURRENCE_MIN_DAYS = 3;
|
|
14
|
+
|
|
15
|
+
/** Lowest threshold that still means "recurring": two distinct days. */
|
|
16
|
+
export const MIN_RECURRENCE_MIN_DAYS = 2;
|
|
17
|
+
|
|
18
|
+
export interface WeekDayOccurrence {
|
|
19
|
+
/** YYYY-MM-DD inside the analyzed week. */
|
|
20
|
+
date: string;
|
|
21
|
+
/** Category id or application/domain label. */
|
|
22
|
+
key: string;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface RecurringPattern {
|
|
27
|
+
key: string;
|
|
28
|
+
/** Count of DISTINCT days the key appeared on. */
|
|
29
|
+
dayCount: number;
|
|
30
|
+
totalDurationMs: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function findRecurringPatterns(input: {
|
|
34
|
+
occurrences: readonly WeekDayOccurrence[];
|
|
35
|
+
minDays?: number;
|
|
36
|
+
}): RecurringPattern[] {
|
|
37
|
+
const minDays = input.minDays ?? DEFAULT_RECURRENCE_MIN_DAYS;
|
|
38
|
+
// A floor of 2 is the module's defining invariant, not a preference: at
|
|
39
|
+
// minDays 1 every key that appeared once is "recurring", which is exactly
|
|
40
|
+
// the one-off blip this helper exists to exclude. Configuration must not be
|
|
41
|
+
// able to switch the invariant off.
|
|
42
|
+
if (!Number.isInteger(minDays) || minDays < MIN_RECURRENCE_MIN_DAYS) {
|
|
43
|
+
throw new RangeError(
|
|
44
|
+
`Invalid minDays ${minDays}; expected an integer >= ${MIN_RECURRENCE_MIN_DAYS}.`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const daysByKey = new Map<string, Set<string>>();
|
|
49
|
+
const totalsByKey = new Map<string, number>();
|
|
50
|
+
|
|
51
|
+
for (const occurrence of input.occurrences) {
|
|
52
|
+
if (!isValidActivityDate(occurrence.date)) {
|
|
53
|
+
throw new RangeError(`Invalid date "${occurrence.date}"; expected YYYY-MM-DD.`);
|
|
54
|
+
}
|
|
55
|
+
if (
|
|
56
|
+
typeof occurrence.durationMs !== "number" ||
|
|
57
|
+
!Number.isFinite(occurrence.durationMs) ||
|
|
58
|
+
occurrence.durationMs < 0
|
|
59
|
+
) {
|
|
60
|
+
throw new RangeError(`Invalid durationMs ${occurrence.durationMs}; expected a finite number >= 0.`);
|
|
61
|
+
}
|
|
62
|
+
const key = occurrence.key.trim();
|
|
63
|
+
if (key === "") continue;
|
|
64
|
+
let days = daysByKey.get(key);
|
|
65
|
+
if (!days) {
|
|
66
|
+
days = new Set<string>();
|
|
67
|
+
daysByKey.set(key, days);
|
|
68
|
+
totalsByKey.set(key, 0);
|
|
69
|
+
}
|
|
70
|
+
days.add(occurrence.date);
|
|
71
|
+
totalsByKey.set(key, totalsByKey.get(key)! + occurrence.durationMs);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const patterns: RecurringPattern[] = [];
|
|
75
|
+
for (const [key, days] of daysByKey) {
|
|
76
|
+
if (days.size < minDays) continue;
|
|
77
|
+
patterns.push({ key, dayCount: days.size, totalDurationMs: totalsByKey.get(key)! });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
patterns.sort((a, b) => {
|
|
81
|
+
if (a.dayCount !== b.dayCount) return b.dayCount - a.dayCount;
|
|
82
|
+
if (a.totalDurationMs !== b.totalDurationMs) return b.totalDurationMs - a.totalDurationMs;
|
|
83
|
+
if (a.key < b.key) return -1;
|
|
84
|
+
if (a.key > b.key) return 1;
|
|
85
|
+
return 0;
|
|
86
|
+
});
|
|
87
|
+
return patterns;
|
|
88
|
+
}
|
package/src/dedup/index.ts
CHANGED
|
@@ -474,3 +474,10 @@ export {
|
|
|
474
474
|
type MergeJudgeVerdictName,
|
|
475
475
|
type ParseMergeVerdictResult,
|
|
476
476
|
} from "./merge-verdict.js";
|
|
477
|
+
|
|
478
|
+
export {
|
|
479
|
+
MERGE_DERIVED_VIA,
|
|
480
|
+
buildMergeFrontmatterUpdate,
|
|
481
|
+
type MergeFrontmatterUpdate,
|
|
482
|
+
type MergeProvenanceSource,
|
|
483
|
+
} from "./merge-provenance.js";
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
buildMergeFrontmatterUpdate,
|
|
6
|
+
MERGE_DERIVED_VIA,
|
|
7
|
+
type MergeProvenanceSource,
|
|
8
|
+
} from "./merge-provenance.js";
|
|
9
|
+
|
|
10
|
+
const NOW = "2026-08-19T12:00:00.000Z";
|
|
11
|
+
|
|
12
|
+
function source(overrides: Partial<MergeProvenanceSource> = {}): MergeProvenanceSource {
|
|
13
|
+
return {
|
|
14
|
+
sessionKey: "project/demo/1",
|
|
15
|
+
observedAt: "2026-08-18T09:00:00.000Z",
|
|
16
|
+
quote: "the API limit is 100/min",
|
|
17
|
+
...overrides,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
test("appends incoming sources after target sources in order", () => {
|
|
22
|
+
const a = source({ quote: "first" });
|
|
23
|
+
const b = source({ quote: "second" });
|
|
24
|
+
const update = buildMergeFrontmatterUpdate({
|
|
25
|
+
targetSources: [a],
|
|
26
|
+
incomingSources: [b],
|
|
27
|
+
nowIso: NOW,
|
|
28
|
+
});
|
|
29
|
+
assert.deepEqual(
|
|
30
|
+
update.sources.map((s) => s.quote),
|
|
31
|
+
["first", "second"],
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("uses the serializer's allow-listed operator, not an invented one", () => {
|
|
36
|
+
const update = buildMergeFrontmatterUpdate({ incomingSources: [source()], nowIso: NOW });
|
|
37
|
+
assert.equal(update.derived_via, "merge");
|
|
38
|
+
assert.equal(MERGE_DERIVED_VIA, "merge");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("preserves every canonical optional field on an accepted source", () => {
|
|
42
|
+
const full = source({ turnId: "turn-7", charStart: 4, charEnd: 12 });
|
|
43
|
+
const update = buildMergeFrontmatterUpdate({ incomingSources: [full], nowIso: NOW });
|
|
44
|
+
assert.deepEqual(update.sources, [
|
|
45
|
+
{
|
|
46
|
+
sessionKey: full.sessionKey,
|
|
47
|
+
observedAt: full.observedAt,
|
|
48
|
+
quote: full.quote,
|
|
49
|
+
turnId: "turn-7",
|
|
50
|
+
charStart: 4,
|
|
51
|
+
charEnd: 12,
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("accepts a source with no turnId, which the canonical shape allows", () => {
|
|
57
|
+
const update = buildMergeFrontmatterUpdate({ incomingSources: [source()], nowIso: NOW });
|
|
58
|
+
assert.equal(update.sources.length, 1);
|
|
59
|
+
assert.equal("turnId" in update.sources[0]!, false);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("deduplicates on the full field tuple and keeps the first", () => {
|
|
63
|
+
const first = source({ turnId: "turn-1" });
|
|
64
|
+
const update = buildMergeFrontmatterUpdate({
|
|
65
|
+
targetSources: [first],
|
|
66
|
+
incomingSources: [{ ...first }, source({ turnId: "turn-2" })],
|
|
67
|
+
nowIso: NOW,
|
|
68
|
+
});
|
|
69
|
+
assert.deepEqual(
|
|
70
|
+
update.sources.map((s) => s.turnId),
|
|
71
|
+
["turn-1", "turn-2"],
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test("sources differing only in offsets are both kept", () => {
|
|
76
|
+
const update = buildMergeFrontmatterUpdate({
|
|
77
|
+
incomingSources: [source({ charStart: 0, charEnd: 5 }), source({ charStart: 6, charEnd: 9 })],
|
|
78
|
+
nowIso: NOW,
|
|
79
|
+
});
|
|
80
|
+
assert.equal(update.sources.length, 2);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test("a blank sessionKey or quote is rejected", () => {
|
|
84
|
+
for (const bad of [source({ sessionKey: " " }), source({ quote: "" })]) {
|
|
85
|
+
assert.throws(() => buildMergeFrontmatterUpdate({ incomingSources: [bad], nowIso: NOW }), /non-blank/);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test("a missing or malformed observedAt is rejected", () => {
|
|
90
|
+
for (const bad of ["", "2026-08-18", "not-a-date", undefined as unknown as string]) {
|
|
91
|
+
assert.throws(
|
|
92
|
+
() => buildMergeFrontmatterUpdate({ incomingSources: [source({ observedAt: bad })], nowIso: NOW }),
|
|
93
|
+
/observedAt/,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test("a blank turnId is rejected while an absent one is fine", () => {
|
|
99
|
+
assert.throws(
|
|
100
|
+
() => buildMergeFrontmatterUpdate({ incomingSources: [source({ turnId: " " })], nowIso: NOW }),
|
|
101
|
+
/turnId/,
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test("negative, non-integer, and inverted offsets are rejected", () => {
|
|
106
|
+
assert.throws(
|
|
107
|
+
() => buildMergeFrontmatterUpdate({ incomingSources: [source({ charStart: -1 })], nowIso: NOW }),
|
|
108
|
+
/charStart/,
|
|
109
|
+
);
|
|
110
|
+
assert.throws(
|
|
111
|
+
() => buildMergeFrontmatterUpdate({ incomingSources: [source({ charEnd: 1.5 })], nowIso: NOW }),
|
|
112
|
+
/charEnd/,
|
|
113
|
+
);
|
|
114
|
+
assert.throws(
|
|
115
|
+
() =>
|
|
116
|
+
buildMergeFrontmatterUpdate({
|
|
117
|
+
incomingSources: [source({ charStart: 9, charEnd: 2 })],
|
|
118
|
+
nowIso: NOW,
|
|
119
|
+
}),
|
|
120
|
+
/charEnd must be >= charStart/,
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test("reinforcement_count starts at 1 and increments from the target", () => {
|
|
125
|
+
assert.equal(
|
|
126
|
+
buildMergeFrontmatterUpdate({ incomingSources: [source()], nowIso: NOW }).reinforcement_count,
|
|
127
|
+
1,
|
|
128
|
+
);
|
|
129
|
+
assert.equal(
|
|
130
|
+
buildMergeFrontmatterUpdate({
|
|
131
|
+
incomingSources: [source()],
|
|
132
|
+
targetReinforcementCount: 2,
|
|
133
|
+
nowIso: NOW,
|
|
134
|
+
}).reinforcement_count,
|
|
135
|
+
3,
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test("an invalid target reinforcement_count is rejected", () => {
|
|
140
|
+
for (const bad of [-1, 1.5, Number.NaN, "2" as unknown as number]) {
|
|
141
|
+
assert.throws(
|
|
142
|
+
() =>
|
|
143
|
+
buildMergeFrontmatterUpdate({
|
|
144
|
+
incomingSources: [source()],
|
|
145
|
+
targetReinforcementCount: bad,
|
|
146
|
+
nowIso: NOW,
|
|
147
|
+
}),
|
|
148
|
+
/reinforcement_count/,
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Date.parse alone accepts "123" and rolls 2026-02-30 into March; the value is
|
|
154
|
+
// echoed verbatim into frontmatter, so the full ISO shape is required.
|
|
155
|
+
test("nowIso must be a full ISO instant with a real calendar date", () => {
|
|
156
|
+
for (const bad of ["", " ", "123", "2026-01-01", "2026-02-30T00:00:00Z", "nope"]) {
|
|
157
|
+
assert.throws(
|
|
158
|
+
() => buildMergeFrontmatterUpdate({ incomingSources: [source()], nowIso: bad }),
|
|
159
|
+
/nowIso/,
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
assert.equal(
|
|
163
|
+
buildMergeFrontmatterUpdate({ incomingSources: [source()], nowIso: "2026-08-19T12:00:00+02:00" }).updated,
|
|
164
|
+
"2026-08-19T12:00:00+02:00",
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test("empty incomingSources still bumps the counter and preserves target sources", () => {
|
|
169
|
+
const update = buildMergeFrontmatterUpdate({
|
|
170
|
+
targetSources: [source()],
|
|
171
|
+
incomingSources: [],
|
|
172
|
+
targetReinforcementCount: 1,
|
|
173
|
+
nowIso: NOW,
|
|
174
|
+
});
|
|
175
|
+
assert.equal(update.sources.length, 1);
|
|
176
|
+
assert.equal(update.reinforcement_count, 2);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
test("inputs are not mutated", () => {
|
|
180
|
+
const target = [source({ turnId: "t" })];
|
|
181
|
+
const incoming = [source({ quote: "other" })];
|
|
182
|
+
const snapshot = JSON.stringify({ target, incoming });
|
|
183
|
+
buildMergeFrontmatterUpdate({ targetSources: target, incomingSources: incoming, nowIso: NOW });
|
|
184
|
+
assert.equal(JSON.stringify({ target, incoming }), snapshot);
|
|
185
|
+
});
|