@gamaze/hicortex 0.20.7 → 0.20.10
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/README.md +18 -41
- package/assets/dashboard.html +3989 -836
- package/dist/calibration.d.ts +293 -0
- package/dist/calibration.js +379 -0
- package/dist/capture-health.d.ts +87 -0
- package/dist/capture-health.js +106 -0
- package/dist/capture-pause.d.ts +86 -0
- package/dist/capture-pause.js +127 -0
- package/dist/capture.d.ts +24 -3
- package/dist/capture.js +11 -1
- package/dist/classify-domains.d.ts +6 -0
- package/dist/classify-domains.js +7 -1
- package/dist/cli.js +38 -3
- package/dist/config-read.d.ts +1 -1
- package/dist/config-read.js +96 -9
- package/dist/consolidate.d.ts +114 -68
- package/dist/consolidate.js +302 -182
- package/dist/dashboard.d.ts +326 -6
- package/dist/dashboard.js +592 -7
- package/dist/db.js +105 -0
- package/dist/dedup.d.ts +34 -26
- package/dist/dedup.js +91 -57
- package/dist/distiller.js +1 -1
- package/dist/domain-classify.d.ts +7 -6
- package/dist/domain-classify.js +12 -10
- package/dist/eval/decay-eval.d.ts +3 -3
- package/dist/eval/decay-eval.js +4 -4
- package/dist/eval/importance-eval.d.ts +85 -0
- package/dist/eval/importance-eval.js +286 -0
- package/dist/eval/planted-eval.d.ts +26 -0
- package/dist/eval/planted-eval.js +97 -0
- package/dist/eval/planted-fixtures.d.ts +107 -0
- package/dist/eval/planted-fixtures.js +283 -0
- package/dist/eval/planted-harness.d.ts +176 -0
- package/dist/eval/planted-harness.js +649 -0
- package/dist/eval/ranking-battery.d.ts +78 -0
- package/dist/eval/ranking-battery.js +181 -0
- package/dist/eval/ranking-eval.d.ts +41 -0
- package/dist/eval/ranking-eval.js +391 -0
- package/dist/eval/ranking-fixtures.d.ts +77 -0
- package/dist/eval/ranking-fixtures.js +226 -0
- package/dist/identity-store.d.ts +21 -0
- package/dist/identity-store.js +49 -0
- package/dist/index.js +4 -3
- package/dist/init.d.ts +23 -3
- package/dist/init.js +84 -9
- package/dist/llm.d.ts +43 -58
- package/dist/llm.js +87 -101
- package/dist/mcp-server.d.ts +12 -0
- package/dist/mcp-server.js +213 -32
- package/dist/nightly.d.ts +9 -1
- package/dist/nightly.js +164 -110
- package/dist/nofit.d.ts +4 -11
- package/dist/nofit.js +6 -23
- package/dist/prompts.d.ts +10 -0
- package/dist/prompts.js +28 -5
- package/dist/recall-index.d.ts +30 -28
- package/dist/recall-index.js +21 -18
- package/dist/recall-registry.d.ts +2 -1
- package/dist/recall-registry.js +35 -1
- package/dist/reconsolidation.d.ts +168 -87
- package/dist/reconsolidation.js +818 -377
- package/dist/relink.js +3 -4
- package/dist/rescore-importance.d.ts +80 -0
- package/dist/rescore-importance.js +236 -0
- package/dist/retrieval.d.ts +80 -35
- package/dist/retrieval.js +322 -105
- package/dist/run-deadline.d.ts +62 -0
- package/dist/run-deadline.js +73 -0
- package/dist/schema-prototypes.d.ts +3 -3
- package/dist/schema-prototypes.js +3 -3
- package/dist/stages.d.ts +37 -0
- package/dist/stages.js +51 -0
- package/dist/state.d.ts +34 -9
- package/dist/storage.d.ts +50 -18
- package/dist/storage.js +125 -30
- package/dist/telemetry.d.ts +8 -7
- package/dist/token-budget.js +3 -4
- package/dist/type-classify.js +4 -4
- package/dist/types.d.ts +143 -155
- package/domains.example.json +4 -5
- package/hermes-plugin/hicortex/README.md +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -1
- package/pi-extension/hicortex/README.md +1 -1
- package/server.json +3 -3
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release-managed calibration constants (#408) — the single home of every
|
|
3
|
+
* tuning value the product ships. One value, one definition, one provenance
|
|
4
|
+
* comment. Nothing in here is read from ~/.hicortex/config.json anymore: the
|
|
5
|
+
* ~35 tuning keys that 0.15–0.20 exposed as config are now CONSTANTS that
|
|
6
|
+
* move only in releases. The user config surface shrinks to the keys that
|
|
7
|
+
* describe an install (mode, model, schedules, identity, budgets), not the
|
|
8
|
+
* ones that tune the brain.
|
|
9
|
+
*
|
|
10
|
+
* EVOLUTION CONTRACT: these values change ONLY in releases, with the
|
|
11
|
+
* eval/band-stats evidence linked in the changelog line that moves them
|
|
12
|
+
* (eval harness = `npm run eval` + the resolution band stats in the nightly
|
|
13
|
+
* report). Never in a patch to quiet one corpus, never behind a new config
|
|
14
|
+
* key. The seams for EXPERIMENTS are the configure*() functions in
|
|
15
|
+
* retrieval.ts / storage.ts (and the stage Options fields) — the eval and
|
|
16
|
+
* the tests sweep values through them; production never passes anything, so
|
|
17
|
+
* every process scores with exactly these constants.
|
|
18
|
+
*
|
|
19
|
+
* Every value below equals the default the code shipped the day this module
|
|
20
|
+
* was introduced (verified by tests/calibration.test.ts) — an install that
|
|
21
|
+
* never set the old config keys sees byte-identical behavior. The old keys
|
|
22
|
+
* are warned as RELEASE-MANAGED at the config boundary (config-read.ts) so
|
|
23
|
+
* the removal is never silent.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Memory-decay half-life (days) at the reference importance 0.5. #192 recall/
|
|
27
|
+
* decay alignment: was ~115 days — aggressive enough to bury the long tail in
|
|
28
|
+
* ranking. Long-term remembering is the product; time preference stays mild.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DECAY_HALF_LIFE_DAYS = 365;
|
|
31
|
+
/** Default k for retrieve() (/search without an explicit limit). #192. */
|
|
32
|
+
export declare const SEARCH_LIMIT = 8;
|
|
33
|
+
/** Default k for searchRecent() (/recent without an explicit limit). #192. */
|
|
34
|
+
export declare const RECENT_LIMIT = 12;
|
|
35
|
+
/** searchRecent() candidate window, days. #192. */
|
|
36
|
+
export declare const RECENT_WINDOW_DAYS = 180;
|
|
37
|
+
/** Top-k slots reservable for never-accessed memories (cold exposure). #192:
|
|
38
|
+
* recall was too passive (88% of memories never accessed) — the long tail
|
|
39
|
+
* gets guaranteed slots instead of waiting for the strength clock. */
|
|
40
|
+
export declare const COLD_EXPOSURE_SLOTS = 2;
|
|
41
|
+
/** Blend weight of the session-intent centroid in the recall search vector
|
|
42
|
+
* (#192, 0.15.3): query = (1-w)·prompt + w·centroid. The kill-switch is the
|
|
43
|
+
* configureSessionIntent(0) seam (eval-only); production always ships 0.33. */
|
|
44
|
+
export declare const SESSION_INTENT_WEIGHT = 0.33;
|
|
45
|
+
/** Relevance-gate floor for vector-only /recall-index candidates. 0.62
|
|
46
|
+
* (raised from 0.55 on 2026-08-03 per a 0.01-step floor sweep on the
|
|
47
|
+
* rewritten corpus): steady ~3:1 noise:signal removal with no knee; sits
|
|
48
|
+
* below the 0.63 local pessimum. FTS-matched candidates pass regardless. */
|
|
49
|
+
export declare const RECALL_MIN_SIMILARITY = 0.62;
|
|
50
|
+
/** Max lines in the pushed recall index. 5 (lowered from 6 on 2026-08-03):
|
|
51
|
+
* per-slot decomposition at floor 0.62 showed slot 6 gives NO prompt its
|
|
52
|
+
* first relevant memory. The K-sweep is monotone toward 4, but the 4-vs-5
|
|
53
|
+
* distinction rests on 5 of 98 prompts — 5 hedges with coverage. */
|
|
54
|
+
export declare const RECALL_MAX_ITEMS = 5;
|
|
55
|
+
/** Prompts shorter than this skip the recall index (continuations, "yes"). */
|
|
56
|
+
export declare const RECALL_MIN_PROMPT_CHARS = 20;
|
|
57
|
+
/** Chars of a memory's first line shown in an index entry. 100 (reverted
|
|
58
|
+
* from 150 on 2026-08-03): the full-corpus relevance eval found 100 vs 150
|
|
59
|
+
* statistically identical (full CI overlap at N=40); 100 saves ~13% tokens. */
|
|
60
|
+
export declare const RECALL_TITLE_CHARS = 100;
|
|
61
|
+
/** Slots of RECALL_MAX_ITEMS guaranteed to the pure-prompt (unblended)
|
|
62
|
+
* search's top passing hit(s) — the #324 novelty floor. 2 mirrors
|
|
63
|
+
* COLD_EXPOSURE_SLOTS sizing: a floor, never a takeover. */
|
|
64
|
+
export declare const NOVELTY_FLOOR_SLOTS = 2;
|
|
65
|
+
/** Turns an already-shown memory stays suppressed in the same session before
|
|
66
|
+
* it may reappear in the pushed index (#192 turn-based dedup). */
|
|
67
|
+
export declare const RECALL_RESHOW_TURNS = 30;
|
|
68
|
+
/** uses_per_showing below this reads Low on the console band.
|
|
69
|
+
* PROVISIONAL (owner anchor 2026-09-13, #426). */
|
|
70
|
+
export declare const RECALL_USES_LOW_MAX = 0.05;
|
|
71
|
+
/** uses_per_showing below this (and ≥ RECALL_USES_LOW_MAX) reads Normal.
|
|
72
|
+
* PROVISIONAL (owner anchor 2026-09-13, #426). */
|
|
73
|
+
export declare const RECALL_USES_NORMAL_MAX = 0.25;
|
|
74
|
+
/** Display-axis maximum for the console band (the marker clamps here).
|
|
75
|
+
* PROVISIONAL (owner anchor 2026-09-13, #426) — chosen so Overfetching
|
|
76
|
+
* keeps a visible span, not a measured bound. */
|
|
77
|
+
export declare const RECALL_USES_AXIS_MAX = 0.3;
|
|
78
|
+
/** Semantic-similarity share of the composite score. 0.50 (raised from 0.40
|
|
79
|
+
* in the 0.15.2 rebalance, #191 Phase B): on the production corpus effective
|
|
80
|
+
* strength (0.30) outweighed what similarity could recover — hardened old
|
|
81
|
+
* memories beat exact matches for their own topic. Similarity now leads;
|
|
82
|
+
* strength breaks ties and rewards real use. */
|
|
83
|
+
export declare const SCORE_SIMILARITY_WEIGHT = 0.5;
|
|
84
|
+
/** Effective-strength share of the composite score (was 0.30; see above). */
|
|
85
|
+
export declare const SCORE_STRENGTH_WEIGHT = 0.2;
|
|
86
|
+
/** Graph-centrality share of the composite score (was 0.20; see above). */
|
|
87
|
+
export declare const SCORE_CONNECTIONS_WEIGHT = 0.15;
|
|
88
|
+
/** Slow recency curve share of the composite score (was 0.10; see above). */
|
|
89
|
+
export declare const SCORE_RECENCY_WEIGHT = 0.15;
|
|
90
|
+
/** Fresh-memory window: the additive bonus fades linearly to 0 over this
|
|
91
|
+
* many days. 7 — nightly capture means 1 day is the floor of "fresh"
|
|
92
|
+
* (#191 Phase B). */
|
|
93
|
+
export declare const FRESHNESS_BOOST_DAYS = 7;
|
|
94
|
+
/** Fresh-memory bonus size at age 0 (#191 Phase B; 0 = disabled via seam). */
|
|
95
|
+
export declare const FRESHNESS_BOOST_WEIGHT = 0.15;
|
|
96
|
+
/** Score multiplier for a memory a later decision superseded (0.15.2; the
|
|
97
|
+
* belief walk (#393 D) is the primary mechanism — this is the safety net
|
|
98
|
+
* for rows the walk does not reach). */
|
|
99
|
+
export declare const SUPERSEDED_DEMOTION = 0.5;
|
|
100
|
+
/** #203 soft boost on exact project match. ADDITIVE, zero-boost neutral,
|
|
101
|
+
* never a penalty — a foreign memory ranks equal, not lower. */
|
|
102
|
+
export declare const PROJECT_AFFINITY_WEIGHT = 0.15;
|
|
103
|
+
/** #203 soft boost multiplier on max overlapping domain-tag weight. */
|
|
104
|
+
export declare const DOMAIN_AFFINITY_WEIGHT = 0.15;
|
|
105
|
+
/** #205 RRF k parameter (1/(k+rank+1)) — matches the pre-#205 hardcoded 60
|
|
106
|
+
* so the no-config path was byte-identical to 0.15.3. */
|
|
107
|
+
export declare const RRF_K = 60;
|
|
108
|
+
/** #205 composite-score share of the final blend (RRF gets the remainder);
|
|
109
|
+
* pre-#205 hardcoded value carried forward. */
|
|
110
|
+
export declare const RRF_COMPOSITE_WEIGHT = 0.8;
|
|
111
|
+
/** #205 per-list RRF weight for the FTS list. 0.5 is the bisection point
|
|
112
|
+
* where BM25F + composite-affinity flip the token-exact marine body match
|
|
113
|
+
* below the same-scope hardware field (Q4 contamination 0.20 → 0.00) while
|
|
114
|
+
* pure-keyword queries keep recall@5 = 1.0. 0.7 was measured too timid. */
|
|
115
|
+
export declare const RRF_FTS_WEIGHT = 0.5;
|
|
116
|
+
/** #205 per-list RRF weight for the vector list (vec stays at 1.0 — the
|
|
117
|
+
* conservative nudge is on the FTS side only). */
|
|
118
|
+
export declare const RRF_VECTOR_WEIGHT = 1;
|
|
119
|
+
/**
|
|
120
|
+
* Additive boost for candidates the TWO retrieval channels AGREE on
|
|
121
|
+
* (vector KNN AND BM25 FTS both matched — computeScore option
|
|
122
|
+
* `bothChannel`). #425 (owner decision D3, 2026-09-13): the two-channel
|
|
123
|
+
* signal is the genuine-match signature and is immune to FTS-only token
|
|
124
|
+
* collisions, which is why the boost lives in the composite score, not in
|
|
125
|
+
* the RRF FTS weight (raising that re-opens the #205 cross-scope collision
|
|
126
|
+
* it fixed). D3's dominance property: a both-channel match outranks a
|
|
127
|
+
* single-channel rival unless the rival is >0.10 more similar — at the
|
|
128
|
+
* shipped simWeight 0.50, 0.10 gives that property 2x headroom (a rival
|
|
129
|
+
* needs >0.20 more similarity).
|
|
130
|
+
*
|
|
131
|
+
* SIZING (the #425 sweep, 2026-09-13, production snapshot copy: case-1
|
|
132
|
+
* planted fixture + a 30-query real battery vs the boost-0 baseline): every
|
|
133
|
+
* value in {0.05, 0.10, 0.15} passed the hard gates (exact-match rank-1,
|
|
134
|
+
* no-match byte-stability, zero both-channel exact-match losses, the
|
|
135
|
+
* Sirnäs flip) with IDENTICAL battery stability (96.7% top-1 ex-promotions
|
|
136
|
+
* — every raw change was a both-channel exact match displacing a
|
|
137
|
+
* single-channel row, the property firing); they differed only in case-1
|
|
138
|
+
* margin (0.021 / 0.061 / 0.101) and per-id top-3 churn. 0.10 chosen:
|
|
139
|
+
* 0.05's margin is within one embedder revision of flipping, 0.15 churns
|
|
140
|
+
* more for no gate benefit. Weight rebalances measured WORSE (sim .55/str
|
|
141
|
+
* .15 → 93.3%; sim .60/str .10 → 86.7%, fails the 90% gate) — the
|
|
142
|
+
* SCORE_*_WEIGHT values stay as shipped. ZERO-boost neutral (never a
|
|
143
|
+
* penalty): graph-only and single-channel candidates add nothing.
|
|
144
|
+
*/
|
|
145
|
+
export declare const BOTH_CHANNEL_BOOST = 0.1;
|
|
146
|
+
export declare const BM25_WEIGHT_BODY = 1;
|
|
147
|
+
export declare const BM25_WEIGHT_PROJECT = 2;
|
|
148
|
+
export declare const BM25_WEIGHT_DOMAIN = 2;
|
|
149
|
+
/**
|
|
150
|
+
* Write cap on base_strength / importance (#425, owner decision D2
|
|
151
|
+
* 2026-09-13: cap 0.95). The decay model's rate is `1 − BASE_DECAY·(1 −
|
|
152
|
+
* importance)` — at importance exactly 1.0 the rate is exactly 1.0 and the
|
|
153
|
+
* row NEVER decays (measured on the production snapshot: ~14% of live rows
|
|
154
|
+
* pegged at ≥0.999, 1838/17399 at exactly 1.0). The cap kills the
|
|
155
|
+
* immortality cliff at every write site (stageImportance, enrich, hub
|
|
156
|
+
* boost) while keeping a multi-year half-life for the top band (0.95 →
|
|
157
|
+
* ~13 years). effectiveStrength ALSO clamps the read side, so legacy
|
|
158
|
+
* base-1.0 rows decay again.
|
|
159
|
+
*/
|
|
160
|
+
export declare const IMPORTANCE_CEILING = 0.95;
|
|
161
|
+
/** Deterministic merge ceiling of the unified resolution pass (#392): pairs
|
|
162
|
+
* at/above this cosine merge LLM-free; [CORRECTION_MIN_SIMILARITY, this)
|
|
163
|
+
* get the one verdict call. 0.92 — measured on the #191 mechanical audit
|
|
164
|
+
* corpus (89 clusters / 110 excess rows; data/audit-20260729). */
|
|
165
|
+
export declare const DEDUP_AUTO_MERGE_THRESHOLD = 0.92;
|
|
166
|
+
/** Minimum cosine for a nightly supersession candidate pair (#100 stage,
|
|
167
|
+
* 0.15.0): one classify-tier call per pair above the bar. */
|
|
168
|
+
export declare const SUPERSESSION_MIN_SIMILARITY = 0.8;
|
|
169
|
+
/** Minimum cosine for a reconsolidation correction pair (#384). Deliberately
|
|
170
|
+
* wider than supersession's 0.80: a retraction often rides inside an
|
|
171
|
+
* otherwise unrelated memory; the verdict + confidence gate carry the
|
|
172
|
+
* precision. */
|
|
173
|
+
export declare const CORRECTION_MIN_SIMILARITY = 0.75;
|
|
174
|
+
/** Minimum verdict confidence for the REWRITE (and #392 merge-apply) fork
|
|
175
|
+
* (#384): below it a `corrects` degrades to mark-only — a weak mark is
|
|
176
|
+
* recoverable, a weak rewrite is corruption. */
|
|
177
|
+
export declare const CORRECTION_REWRITE_MIN_CONFIDENCE = 0.8;
|
|
178
|
+
/** Minimum cosine(memory embedding, best domain prototype) for a no-fit
|
|
179
|
+
* memory to earn a WEAK primary instead of decaying (owner amendment
|
|
180
|
+
* 07.07). Starting point for bge-small-en-v1.5. */
|
|
181
|
+
export declare const WEAK_PRIMARY_FLOOR = 0.45;
|
|
182
|
+
/**
|
|
183
|
+
* Console stage bands (#409/#421) — TWO #408-contract calibrations:
|
|
184
|
+
*
|
|
185
|
+
* (1) 2026-09-13 (PR #424 fix round) against the INFLATED distribution:
|
|
186
|
+
* effectiveStrength p25 = 0.599, p50 = 0.788, p86 = 0.900, ~14%
|
|
187
|
+
* saturated at exactly 1.000 → edges 0.40/0.60/0.90 targeting a rendered
|
|
188
|
+
* split ≈ 10/15/61/14 (fading/forming/belief/truth).
|
|
189
|
+
*
|
|
190
|
+
* (2) This release (#425) against the POST-FIX distribution: the importance
|
|
191
|
+
* recalibration (re-anchored prompt + 0.95 cap) plus the
|
|
192
|
+
* rescore-importance backfill re-spread the same 17,399-row store to
|
|
193
|
+
* base_strength median 0.40 / p90 0.60 / max 0.90 (zero rows ≥ 0.999);
|
|
194
|
+
* measured effectiveStrength on the backfilled copy: p25 ≈ 0.296,
|
|
195
|
+
* p50 ≈ 0.397, p75 ≈ 0.497, p86 ≈ 0.585, max ≈ 0.900. The stale 2026-09-13
|
|
196
|
+
* edges rendered that store as 58.5/37.2/4.2/0 — no Truth left. These
|
|
197
|
+
* edges (0.20/0.30/0.58) re-derive the same ≈ 10/15/61/14 split intent
|
|
198
|
+
* against the honest distribution and render 11.8/25.6/47.7/14.9 (the
|
|
199
|
+
* scorer emits one-decimal scores, so the mass clusters at exact atoms —
|
|
200
|
+
* 0.20/0.30/0.60 — and the 0.60 atom alone holds ~12% of the store; the
|
|
201
|
+
* truth edge therefore sits at 0.58, just under the atom, rather than on
|
|
202
|
+
* the round number that would strand it). Evidence: the #425
|
|
203
|
+
* post-backfill band-stats photo (backfilled copy, deriveStage math via
|
|
204
|
+
* the production effectiveStrength).
|
|
205
|
+
*/
|
|
206
|
+
/**
|
|
207
|
+
* Days without access after which a memory's derived stage is Fading
|
|
208
|
+
* (regardless of strength — the recency gate runs FIRST in deriveStage).
|
|
209
|
+
* 120 ≈ a season: long enough that a working memory is never mislabeled,
|
|
210
|
+
* short enough that the rim of the field turns over within a year.
|
|
211
|
+
*/
|
|
212
|
+
export declare const STAGE_FADING_DAYS = 120;
|
|
213
|
+
/**
|
|
214
|
+
* Effective-strength ceiling of the living bands: below this the memory is
|
|
215
|
+
* Fading (the measured weak cluster + the recency-gated rim, together ~12% of
|
|
216
|
+
* the post-#425 store) even when recently touched.
|
|
217
|
+
*/
|
|
218
|
+
export declare const STAGE_FADING_STRENGTH = 0.2;
|
|
219
|
+
/** The Forming/Belief edge: [FADING, this) → forming, ≥ this → belief. */
|
|
220
|
+
export declare const STAGE_BELIEF_STRENGTH = 0.3;
|
|
221
|
+
/** The Belief/Truth edge: ≥ this → truth — the hardened core (~15% post-#425;
|
|
222
|
+
* just under the 0.60 score atom, see the block JSDoc above). */
|
|
223
|
+
export declare const STAGE_TRUTH_STRENGTH = 0.58;
|
|
224
|
+
/**
|
|
225
|
+
* One owner corroboration's bump to base_strength (#423 phase 3, POST
|
|
226
|
+
* /enrich — evidence about importance). Post-#425 the forming band
|
|
227
|
+
* [0.20,0.30) is 0.10 wide; +0.10 = a full band — one enrich visibly crosses
|
|
228
|
+
* an edge for a mid-band Forming memory. Repeated enriches cap at the
|
|
229
|
+
* IMPORTANCE_CEILING (0.95, the SQL MIN); for a young memory effStr ≈ base so
|
|
230
|
+
* the bump lands ~1:1 (the phase-3 verify "enrich a Forming memory → stage
|
|
231
|
+
* change" holds for a mid-band memory ≥0.25).
|
|
232
|
+
*/
|
|
233
|
+
export declare const ENRICH_STRENGTH_DELTA = 0.1;
|
|
234
|
+
/**
|
|
235
|
+
* Days of session history a FIRST nightly run discovers (the first-run
|
|
236
|
+
* watermark is now − this many days, not the epoch).
|
|
237
|
+
*
|
|
238
|
+
* Owner ruling (2026-09-14, #436): full-history first-run ingestion is not
|
|
239
|
+
* feasible — "if everybody signing up ingests their full history, we will
|
|
240
|
+
* pay millions in tokens during the trial period before customers pay us
|
|
241
|
+
* anything." Cloud needs a very short window; the local/installable version
|
|
242
|
+
* uses the SAME default.
|
|
243
|
+
*
|
|
244
|
+
* Unlike every other constant in this module, this one KEEPS a config
|
|
245
|
+
* override (`firstRunLookbackDays`, read at the capture call sites): it
|
|
246
|
+
* describes an install's cost posture — the same family as
|
|
247
|
+
* `llmTokensPerMonth` / `captureCooldownHours`, which stayed config through
|
|
248
|
+
* #408 — not brain tuning. More history is a deliberate act:
|
|
249
|
+
* `hicortex nightly --recapture-window <days>`.
|
|
250
|
+
*/
|
|
251
|
+
export declare const DEFAULT_FIRST_RUN_LOOKBACK_DAYS = 7;
|
|
252
|
+
/**
|
|
253
|
+
* Context window for ollama (one value, all phases; #220/#228). 8192 is
|
|
254
|
+
* where context stops being the binding constraint for a sub-8B model on
|
|
255
|
+
* ollama. Also drives `detectChunkSize` (chunkChars ≤ numCtx × 0.6 × 4
|
|
256
|
+
* chars) so the chunker and the request agree by construction.
|
|
257
|
+
*/
|
|
258
|
+
export declare const NUM_CTX = 8192;
|
|
259
|
+
/** Flush ollama's accumulated memory every N LLM calls (0 = off; #220).
|
|
260
|
+
* Opt-in operational workaround for ollama runner RSS growth — never a
|
|
261
|
+
* default-on behavior. */
|
|
262
|
+
export declare const OLLAMA_FLUSH_EVERY = 0;
|
|
263
|
+
/** Ms to wait after an ollama flush (`keep_alive:0`) for the runner to exit
|
|
264
|
+
* + release memory. The runner takes >90 s to exit; 3 min allows margin. */
|
|
265
|
+
export declare const OLLAMA_FLUSH_WAIT_MS = 180000;
|
|
266
|
+
/** The env-tier table (release surface: names + defaults are frozen —
|
|
267
|
+
* adding a knob here is a release decision, not a runtime one). */
|
|
268
|
+
export declare const DIAGNOSTIC_ENV_TIER: Readonly<{
|
|
269
|
+
numCtx: Readonly<{
|
|
270
|
+
env: string;
|
|
271
|
+
default: number;
|
|
272
|
+
}>;
|
|
273
|
+
ollamaFlushEvery: Readonly<{
|
|
274
|
+
env: string;
|
|
275
|
+
default: number;
|
|
276
|
+
}>;
|
|
277
|
+
ollamaFlushWaitMs: Readonly<{
|
|
278
|
+
env: string;
|
|
279
|
+
default: number;
|
|
280
|
+
}>;
|
|
281
|
+
}>;
|
|
282
|
+
/** Resolve the effective ollama context window: a positive finite
|
|
283
|
+
* HICORTEX_NUM_CTX wins; anything else (absent/blank/invalid) keeps NUM_CTX
|
|
284
|
+
* with a warn on the invalid case. */
|
|
285
|
+
export declare function resolveNumCtx(): number;
|
|
286
|
+
/** Resolve the flush cadence: a non-negative finite
|
|
287
|
+
* HICORTEX_OLLAMA_FLUSH_EVERY wins (0 = the valid off value); invalid warns
|
|
288
|
+
* and keeps OLLAMA_FLUSH_EVERY. */
|
|
289
|
+
export declare function resolveOllamaFlushEvery(): number;
|
|
290
|
+
/** Resolve the post-flush wait: a positive finite
|
|
291
|
+
* HICORTEX_OLLAMA_FLUSH_WAIT_MS wins; invalid warns and keeps
|
|
292
|
+
* OLLAMA_FLUSH_WAIT_MS. */
|
|
293
|
+
export declare function resolveOllamaFlushWaitMs(): number;
|