@gamaze/hicortex 0.27.4 → 0.28.0
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/assets/dashboard.html +361 -100
- package/dist/backfill-privacy.d.ts +68 -45
- package/dist/backfill-privacy.js +236 -145
- package/dist/calibration.d.ts +67 -68
- package/dist/calibration.js +75 -78
- package/dist/capture-health.d.ts +2 -2
- package/dist/capture-health.js +2 -2
- package/dist/classification.d.ts +141 -12
- package/dist/classification.js +214 -27
- package/dist/classify-domains.d.ts +1 -1
- package/dist/classify-domains.js +2 -2
- package/dist/cli-args.d.ts +5 -3
- package/dist/cli-args.js +7 -3
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +64 -16
- package/dist/cluster.d.ts +12 -9
- package/dist/cluster.js +9 -6
- package/dist/consolidate.d.ts +93 -43
- package/dist/consolidate.js +255 -119
- package/dist/dashboard.d.ts +48 -5
- package/dist/dashboard.js +55 -3
- package/dist/db.js +27 -6
- package/dist/dedup.d.ts +2 -3
- package/dist/dedup.js +2 -3
- package/dist/distill-queue.d.ts +36 -4
- package/dist/distill-queue.js +80 -18
- package/dist/distiller.d.ts +1 -1
- package/dist/distiller.js +13 -12
- package/dist/domain-classify.d.ts +8 -9
- package/dist/domain-classify.js +6 -7
- package/dist/graph.d.ts +15 -5
- package/dist/graph.js +46 -13
- package/dist/hermes-transcript-reader.d.ts +1 -1
- package/dist/hermes-transcript-reader.js +1 -1
- package/dist/init.d.ts +2 -2
- package/dist/init.js +3 -3
- package/dist/llm.d.ts +1 -1
- package/dist/llm.js +5 -5
- package/dist/mcp-server.js +323 -59
- package/dist/memory-instructions.d.ts +2 -2
- package/dist/memory-instructions.js +2 -2
- package/dist/nightly.d.ts +1 -1
- package/dist/nightly.js +64 -5
- package/dist/nofit.d.ts +2 -2
- package/dist/nofit.js +2 -2
- package/dist/observed-agents.d.ts +54 -0
- package/dist/observed-agents.js +78 -0
- package/dist/project-canonicalize.d.ts +6 -5
- package/dist/project-canonicalize.js +6 -5
- package/dist/prompts.d.ts +29 -8
- package/dist/prompts.js +39 -16
- package/dist/quality-scoreboard.d.ts +1 -1
- package/dist/recall-hook-cli.d.ts +1 -1
- package/dist/recall-hook-cli.js +2 -2
- package/dist/recall-index.d.ts +28 -14
- package/dist/recall-index.js +22 -10
- package/dist/recall-precision.d.ts +3 -3
- package/dist/recall-precision.js +5 -4
- package/dist/reconcile-projects.d.ts +2 -2
- package/dist/reconcile-projects.js +2 -2
- package/dist/reconsolidation.d.ts +9 -2
- package/dist/reconsolidation.js +48 -31
- package/dist/relink.d.ts +2 -2
- package/dist/relink.js +4 -4
- package/dist/rescore-importance.d.ts +2 -2
- package/dist/rescore-importance.js +22 -3
- package/dist/retrieval.d.ts +14 -0
- package/dist/retrieval.js +11 -11
- package/dist/schema-prototypes.d.ts +1 -1
- package/dist/schema-prototypes.js +1 -1
- package/dist/seed-lesson.js +4 -2
- package/dist/spaces-api.d.ts +104 -0
- package/dist/spaces-api.js +193 -0
- package/dist/spaces-cli.d.ts +90 -0
- package/dist/spaces-cli.js +245 -0
- package/dist/spaces.d.ts +187 -0
- package/dist/spaces.js +360 -0
- package/dist/storage.d.ts +47 -10
- package/dist/storage.js +74 -17
- package/dist/sweep-volatile.d.ts +2 -2
- package/dist/sweep-volatile.js +2 -2
- package/dist/telemetry-cli.d.ts +1 -1
- package/dist/telemetry-cli.js +1 -1
- package/dist/type-classify.d.ts +1 -1
- package/dist/type-classify.js +1 -1
- package/dist/type-labels.d.ts +1 -1
- package/dist/type-labels.js +1 -1
- package/dist/types.d.ts +43 -20
- package/dist/wrapper-prompt.d.ts +2 -2
- package/dist/wrapper-prompt.js +2 -2
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ---------------
|
|
6
6
|
* The nightly's legacy `stageDomainCuration` groups PROJECTS into domains and
|
|
7
7
|
* assigns every memory its project's domain. For an owner whose "projects" are
|
|
8
|
-
* often AGENT names (alice,
|
|
8
|
+
* often AGENT names (alice, carol, ...), one agent produces memories spanning
|
|
9
9
|
* many life areas, so life-memories get smeared under the agent. This module
|
|
10
10
|
* classifies a single memory into life-spheres by its CONTENT, drawn from a
|
|
11
11
|
* user-curated vocabulary in ~/.hicortex/config.json (`domains`).
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* deterministically (argmax association weight, LLM tag order breaking ties) in
|
|
22
22
|
* schema-prototypes.ts / storage.setMemoryTags.
|
|
23
23
|
*
|
|
24
|
-
* NO-FIT = EMPTY TAG SET (
|
|
24
|
+
* NO-FIT = EMPTY TAG SET (spec 2026-07-07 amendment): "Unsorted" is a non-tag —
|
|
25
25
|
* there is NO fallback category in the vocabulary and no configured domain is
|
|
26
26
|
* ever auto-assigned on a no-fit. A genuine no-fit is the distinct result
|
|
27
27
|
* `{tags: []}`; the CALLER then derives a weak primary from prototype cosines
|
|
@@ -47,9 +47,8 @@
|
|
|
47
47
|
*
|
|
48
48
|
* SCOPE: sphere-level tags only. Sub-labels within a sphere are a future phase.
|
|
49
49
|
*
|
|
50
|
-
* Example
|
|
51
|
-
* Work,
|
|
52
|
-
* Family, People, Travel
|
|
50
|
+
* Example vocabulary (documented, NOT hardcoded — lives in config.json):
|
|
51
|
+
* Work, Personal, People, Health, Finance
|
|
53
52
|
*/
|
|
54
53
|
import type { LlmClient, LlmUsage } from "./llm.js";
|
|
55
54
|
import type { DomainDef } from "./types.js";
|
|
@@ -86,8 +85,8 @@ export declare function matchDomain(reply: string, domains: DomainDef[]): string
|
|
|
86
85
|
* - `tags`: 0..N vocabulary names that genuinely apply, MOST-RELEVANT FIRST
|
|
87
86
|
* (LLM order — used downstream only as an exact-weight tiebreak), deduped,
|
|
88
87
|
* all members of the configured vocabulary.
|
|
89
|
-
* - An EMPTY array is a distinct, VALID result: genuine no-fit (
|
|
90
|
-
*
|
|
88
|
+
* - An EMPTY array is a distinct, VALID result: genuine no-fit (spec
|
|
89
|
+
* 2026-07-07 amendment — no fallback category). Callers route it through the
|
|
91
90
|
* weak-primary / no-association-decay path (nofit.ts). It is NOT the same
|
|
92
91
|
* as null (null = infra error → skip and retry later).
|
|
93
92
|
*
|
|
@@ -124,7 +123,7 @@ export declare function buildClassifyPrompt(content: string, project: string | n
|
|
|
124
123
|
* Return values (three distinct outcomes):
|
|
125
124
|
* - {tags: [...]} — >= 1 valid vocabulary tag (canonical-cased, ordered).
|
|
126
125
|
* - {tags: []} — the model EXPLICITLY replied with an empty tags array:
|
|
127
|
-
* genuine no-fit (
|
|
126
|
+
* genuine no-fit (spec 2026-07-07 amendment). NOT retried by the caller.
|
|
128
127
|
* - null — unparseable reply, missing/non-array `tags`, or a
|
|
129
128
|
* NON-EMPTY tags array in which no name matched the vocabulary (invalid
|
|
130
129
|
* names are dropped — an all-invalid reply is a bad reply, not a no-fit).
|
|
@@ -151,7 +150,7 @@ export declare function parseTagReply(reply: string, domains: DomainDef[]): TagR
|
|
|
151
150
|
* - Valid JSON reply with ≥1 vocabulary tag → {tags} (ordered,
|
|
152
151
|
* most-relevant first).
|
|
153
152
|
* - Valid reply with an EXPLICIT empty tags array → {tags: []} (genuine
|
|
154
|
-
* no-fit —
|
|
153
|
+
* no-fit — spec 2026-07-07 amendment: no fallback category is ever assigned;
|
|
155
154
|
* the caller routes empty tag sets through nofit.ts).
|
|
156
155
|
* - Unparseable / no-valid-tag reply → retry ONCE, then treat as a genuine
|
|
157
156
|
* no-fit: {tags: []} (the model responded twice but produced nothing
|
package/dist/domain-classify.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ---------------
|
|
7
7
|
* The nightly's legacy `stageDomainCuration` groups PROJECTS into domains and
|
|
8
8
|
* assigns every memory its project's domain. For an owner whose "projects" are
|
|
9
|
-
* often AGENT names (alice,
|
|
9
|
+
* often AGENT names (alice, carol, ...), one agent produces memories spanning
|
|
10
10
|
* many life areas, so life-memories get smeared under the agent. This module
|
|
11
11
|
* classifies a single memory into life-spheres by its CONTENT, drawn from a
|
|
12
12
|
* user-curated vocabulary in ~/.hicortex/config.json (`domains`).
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* deterministically (argmax association weight, LLM tag order breaking ties) in
|
|
23
23
|
* schema-prototypes.ts / storage.setMemoryTags.
|
|
24
24
|
*
|
|
25
|
-
* NO-FIT = EMPTY TAG SET (
|
|
25
|
+
* NO-FIT = EMPTY TAG SET (spec 2026-07-07 amendment): "Unsorted" is a non-tag —
|
|
26
26
|
* there is NO fallback category in the vocabulary and no configured domain is
|
|
27
27
|
* ever auto-assigned on a no-fit. A genuine no-fit is the distinct result
|
|
28
28
|
* `{tags: []}`; the CALLER then derives a weak primary from prototype cosines
|
|
@@ -48,9 +48,8 @@
|
|
|
48
48
|
*
|
|
49
49
|
* SCOPE: sphere-level tags only. Sub-labels within a sphere are a future phase.
|
|
50
50
|
*
|
|
51
|
-
* Example
|
|
52
|
-
* Work,
|
|
53
|
-
* Family, People, Travel
|
|
51
|
+
* Example vocabulary (documented, NOT hardcoded — lives in config.json):
|
|
52
|
+
* Work, Personal, People, Health, Finance
|
|
54
53
|
*/
|
|
55
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
55
|
exports.CLASSIFY_CONTENT_MAX_CHARS = void 0;
|
|
@@ -177,7 +176,7 @@ function buildClassifyPrompt(content, project, domains) {
|
|
|
177
176
|
* Return values (three distinct outcomes):
|
|
178
177
|
* - {tags: [...]} — >= 1 valid vocabulary tag (canonical-cased, ordered).
|
|
179
178
|
* - {tags: []} — the model EXPLICITLY replied with an empty tags array:
|
|
180
|
-
* genuine no-fit (
|
|
179
|
+
* genuine no-fit (spec 2026-07-07 amendment). NOT retried by the caller.
|
|
181
180
|
* - null — unparseable reply, missing/non-array `tags`, or a
|
|
182
181
|
* NON-EMPTY tags array in which no name matched the vocabulary (invalid
|
|
183
182
|
* names are dropped — an all-invalid reply is a bad reply, not a no-fit).
|
|
@@ -248,7 +247,7 @@ function parseTagReply(reply, domains) {
|
|
|
248
247
|
* - Valid JSON reply with ≥1 vocabulary tag → {tags} (ordered,
|
|
249
248
|
* most-relevant first).
|
|
250
249
|
* - Valid reply with an EXPLICIT empty tags array → {tags: []} (genuine
|
|
251
|
-
* no-fit —
|
|
250
|
+
* no-fit — spec 2026-07-07 amendment: no fallback category is ever assigned;
|
|
252
251
|
* the caller routes empty tag sets through nofit.ts).
|
|
253
252
|
* - Unparseable / no-valid-tag reply → retry ONCE, then treat as a genuine
|
|
254
253
|
* no-fit: {tags: []} (the model responded twice but produced nothing
|
package/dist/graph.d.ts
CHANGED
|
@@ -38,12 +38,16 @@ export declare function louvainCommunities(db: Database.Database): {
|
|
|
38
38
|
edgeCount: number;
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
|
-
* #
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* #642 AC-5/AC-7: the visible-space HIDE set — ids of every row whose
|
|
42
|
+
* spaceOf(privacy) is neither 'standard' nor in `visible`. The generalized
|
|
43
|
+
* form of #332's confidential-only hide set (with an empty visible set it
|
|
44
|
+
* hides exactly the confidential rows on standard/confidential data, by
|
|
45
|
+
* construction). Unknown/retired space ids are in NO visible set any
|
|
46
|
+
* configuration can produce, so they are always hidden — fail-closed.
|
|
47
|
+
* Computed once per call (the graph ops are single-query + small loops; a
|
|
48
|
+
* corpus-wide id set is cheap).
|
|
45
49
|
*/
|
|
46
|
-
export declare function
|
|
50
|
+
export declare function hiddenSpaceNodeIds(db: Database.Database, visible: ReadonlySet<string>): Set<string>;
|
|
47
51
|
/**
|
|
48
52
|
* Find hub nodes — memories with link count significantly above median.
|
|
49
53
|
* Returns nodes with links > threshold (default: 2x median, minimum 3 links).
|
|
@@ -52,9 +56,11 @@ export declare function confidentialNodeIds(db: Database.Database): Set<string>;
|
|
|
52
56
|
* (REST /graph?op=hubs without a member agent, the MCP graph tool) hard-omit
|
|
53
57
|
* confidential hubs (their content snippets ARE content-bearing). The /viz
|
|
54
58
|
* export (deliberately ungated, #332) passes true.
|
|
59
|
+
* #642: `visibleSpaces` is the generalized form (resolveHiddenNodes).
|
|
55
60
|
*/
|
|
56
61
|
export declare function detectHubs(db: Database.Database, thresholdMultiplier?: number, minLinks?: number, opts?: {
|
|
57
62
|
includeConfidential?: boolean;
|
|
63
|
+
visibleSpaces?: Set<string>;
|
|
58
64
|
}): HubNode[];
|
|
59
65
|
export interface GraphNeighbor {
|
|
60
66
|
id: string;
|
|
@@ -66,6 +72,7 @@ export interface GraphNeighbor {
|
|
|
66
72
|
}
|
|
67
73
|
export declare function getNeighbors(db: Database.Database, memoryId: string, limit?: number, relationship?: string, opts?: {
|
|
68
74
|
includeConfidential?: boolean;
|
|
75
|
+
visibleSpaces?: Set<string>;
|
|
69
76
|
}): GraphNeighbor[];
|
|
70
77
|
export declare const EXPORT_DEFAULT_LIMIT = 5000;
|
|
71
78
|
export declare const EXPORT_MAX_LIMIT = 10000;
|
|
@@ -127,7 +134,10 @@ export declare function exportGraph(db: Database.Database, options?: ExportGraph
|
|
|
127
134
|
* confidential nodes are excluded from TRAVERSAL entirely (a confidential id
|
|
128
135
|
* must not appear even as an intermediate hop; the endpoints' own classes are
|
|
129
136
|
* the caller's gate, same contract as getNeighbors' center).
|
|
137
|
+
* #642: `visibleSpaces` is the generalized form (resolveHiddenNodes) — nodes
|
|
138
|
+
* outside the visible set never appear even as an intermediate hop.
|
|
130
139
|
*/
|
|
131
140
|
export declare function shortestPath(db: Database.Database, fromId: string, toId: string, maxDepth?: number, opts?: {
|
|
132
141
|
includeConfidential?: boolean;
|
|
142
|
+
visibleSpaces?: Set<string>;
|
|
133
143
|
}): string[] | null;
|
package/dist/graph.js
CHANGED
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.EXPORT_MAX_LIMIT = exports.EXPORT_DEFAULT_LIMIT = void 0;
|
|
14
14
|
exports.louvainCommunities = louvainCommunities;
|
|
15
|
-
exports.
|
|
15
|
+
exports.hiddenSpaceNodeIds = hiddenSpaceNodeIds;
|
|
16
16
|
exports.detectHubs = detectHubs;
|
|
17
17
|
exports.getNeighbors = getNeighbors;
|
|
18
18
|
exports.exportGraph = exportGraph;
|
|
19
19
|
exports.shortestPath = shortestPath;
|
|
20
20
|
const retrieval_js_1 = require("./retrieval.js");
|
|
21
|
+
const spaces_js_1 = require("./spaces.js");
|
|
21
22
|
function loadGraph(db) {
|
|
22
23
|
const rows = db
|
|
23
24
|
.prepare("SELECT source_id, target_id, strength FROM memory_links")
|
|
@@ -141,16 +142,44 @@ function louvainCommunities(db) {
|
|
|
141
142
|
// Hub node detection
|
|
142
143
|
// ---------------------------------------------------------------------------
|
|
143
144
|
/**
|
|
144
|
-
* #
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
145
|
+
* #642 AC-5/AC-7: the visible-space HIDE set — ids of every row whose
|
|
146
|
+
* spaceOf(privacy) is neither 'standard' nor in `visible`. The generalized
|
|
147
|
+
* form of #332's confidential-only hide set (with an empty visible set it
|
|
148
|
+
* hides exactly the confidential rows on standard/confidential data, by
|
|
149
|
+
* construction). Unknown/retired space ids are in NO visible set any
|
|
150
|
+
* configuration can produce, so they are always hidden — fail-closed.
|
|
151
|
+
* Computed once per call (the graph ops are single-query + small loops; a
|
|
152
|
+
* corpus-wide id set is cheap).
|
|
148
153
|
*/
|
|
149
|
-
function
|
|
154
|
+
function hiddenSpaceNodeIds(db, visible) {
|
|
150
155
|
const rows = db
|
|
151
|
-
.prepare("SELECT id FROM memories WHERE privacy
|
|
156
|
+
.prepare("SELECT id, privacy FROM memories WHERE privacy IS NOT NULL")
|
|
152
157
|
.all();
|
|
153
|
-
|
|
158
|
+
const hidden = new Set();
|
|
159
|
+
for (const r of rows) {
|
|
160
|
+
if (!(0, spaces_js_1.isVisiblePrivacy)(r.privacy, visible))
|
|
161
|
+
hidden.add(r.id);
|
|
162
|
+
}
|
|
163
|
+
return hidden;
|
|
164
|
+
}
|
|
165
|
+
/** The module-wide empty visible set — the shared-only default arm of
|
|
166
|
+
* resolveHiddenNodes (never mutated). */
|
|
167
|
+
const EMPTY_VISIBLE = new Set();
|
|
168
|
+
/**
|
|
169
|
+
* Resolve the hide set for one graph op from the two gate forms (#642 AC-5):
|
|
170
|
+
* `visibleSpaces` given (even empty) → hide everything outside it; else the
|
|
171
|
+
* legacy boolean — TRUE hides NOTHING (the /viz owner surface keeps its
|
|
172
|
+
* ungated-by-design behavior), FALSE/absent → shared-only (the empty visible
|
|
173
|
+
* set, which equals #332's confidentialNodeIds on standard/confidential
|
|
174
|
+
* data). The MCP tools call the graph ops with NO opts: shared-only by
|
|
175
|
+
* construction (AC-6).
|
|
176
|
+
*/
|
|
177
|
+
function resolveHiddenNodes(db, opts) {
|
|
178
|
+
if (opts?.visibleSpaces !== undefined)
|
|
179
|
+
return hiddenSpaceNodeIds(db, opts.visibleSpaces);
|
|
180
|
+
if (opts?.includeConfidential === true)
|
|
181
|
+
return null;
|
|
182
|
+
return hiddenSpaceNodeIds(db, EMPTY_VISIBLE);
|
|
154
183
|
}
|
|
155
184
|
/**
|
|
156
185
|
* Find hub nodes — memories with link count significantly above median.
|
|
@@ -160,9 +189,10 @@ function confidentialNodeIds(db) {
|
|
|
160
189
|
* (REST /graph?op=hubs without a member agent, the MCP graph tool) hard-omit
|
|
161
190
|
* confidential hubs (their content snippets ARE content-bearing). The /viz
|
|
162
191
|
* export (deliberately ungated, #332) passes true.
|
|
192
|
+
* #642: `visibleSpaces` is the generalized form (resolveHiddenNodes).
|
|
163
193
|
*/
|
|
164
194
|
function detectHubs(db, thresholdMultiplier = 2, minLinks = 3, opts) {
|
|
165
|
-
const hidden =
|
|
195
|
+
const hidden = resolveHiddenNodes(db, opts);
|
|
166
196
|
const rows = db
|
|
167
197
|
.prepare(`SELECT id, cnt FROM (
|
|
168
198
|
SELECT id, COUNT(*) as cnt FROM (
|
|
@@ -205,7 +235,8 @@ function getNeighbors(db, memoryId, limit = 10, relationship, opts) {
|
|
|
205
235
|
// agent-facing adapter must refuse a confidential center id before calling
|
|
206
236
|
// (REST /graph and the MCP tool 404 it for non-members, same contract as
|
|
207
237
|
// GET /memory). Default false = omit; member-gated callers pass true.
|
|
208
|
-
|
|
238
|
+
// #642: `visibleSpaces` is the generalized form (resolveHiddenNodes).
|
|
239
|
+
const hidden = resolveHiddenNodes(db, opts);
|
|
209
240
|
let sql = `SELECT source_id, target_id, relationship, strength
|
|
210
241
|
FROM memory_links
|
|
211
242
|
WHERE (source_id = ? OR target_id = ?)`;
|
|
@@ -244,8 +275,8 @@ function getNeighbors(db, memoryId, limit = 10, relationship, opts) {
|
|
|
244
275
|
// ---------------------------------------------------------------------------
|
|
245
276
|
// Full graph export (for GET /graph?op=export — the /viz page, #124)
|
|
246
277
|
// ---------------------------------------------------------------------------
|
|
247
|
-
// Default shows the whole graph for corpora up to 5k memories (
|
|
248
|
-
//
|
|
278
|
+
// Default shows the whole graph for corpora up to 5k memories (the
|
|
279
|
+
// strongest-500 default hid most edges). Payload note: nodes carry
|
|
249
280
|
// content up to 4000 chars, so 5k nodes can be a several-MB JSON response —
|
|
250
281
|
// acceptable on localhost/LAN, which is the /viz deployment model.
|
|
251
282
|
exports.EXPORT_DEFAULT_LIMIT = 5000;
|
|
@@ -392,13 +423,15 @@ function exportGraph(db, options = {}) {
|
|
|
392
423
|
* confidential nodes are excluded from TRAVERSAL entirely (a confidential id
|
|
393
424
|
* must not appear even as an intermediate hop; the endpoints' own classes are
|
|
394
425
|
* the caller's gate, same contract as getNeighbors' center).
|
|
426
|
+
* #642: `visibleSpaces` is the generalized form (resolveHiddenNodes) — nodes
|
|
427
|
+
* outside the visible set never appear even as an intermediate hop.
|
|
395
428
|
*/
|
|
396
429
|
function shortestPath(db, fromId, toId, maxDepth = 5, opts) {
|
|
397
430
|
// BFS on the memory_links graph
|
|
398
431
|
const links = db
|
|
399
432
|
.prepare("SELECT source_id, target_id FROM memory_links")
|
|
400
433
|
.all();
|
|
401
|
-
const hidden =
|
|
434
|
+
const hidden = resolveHiddenNodes(db, opts);
|
|
402
435
|
const adj = new Map();
|
|
403
436
|
for (const { source_id, target_id } of links) {
|
|
404
437
|
if (hidden?.has(source_id) || hidden?.has(target_id))
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Hermes transcript reader — the nightly capture path for Nous Research Hermes.
|
|
3
3
|
*
|
|
4
4
|
* Hermes stores conversation in a SQLite state DB, one per profile:
|
|
5
|
-
* ~/.hermes/profiles/<profile>/state.db (per-profile agents: alice,
|
|
5
|
+
* ~/.hermes/profiles/<profile>/state.db (per-profile agents: alice, carol, dave)
|
|
6
6
|
* ~/.hermes/state.db (global, non-profile setups)
|
|
7
7
|
*
|
|
8
8
|
* Schema (relevant columns):
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Hermes transcript reader — the nightly capture path for Nous Research Hermes.
|
|
4
4
|
*
|
|
5
5
|
* Hermes stores conversation in a SQLite state DB, one per profile:
|
|
6
|
-
* ~/.hermes/profiles/<profile>/state.db (per-profile agents: alice,
|
|
6
|
+
* ~/.hermes/profiles/<profile>/state.db (per-profile agents: alice, carol, dave)
|
|
7
7
|
* ~/.hermes/state.db (global, non-profile setups)
|
|
8
8
|
*
|
|
9
9
|
* Schema (relevant columns):
|
package/dist/init.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export declare function persistLlmConfig(configPath?: string): Promise<void>;
|
|
|
68
68
|
* parse (a hand-edit syntax slip, truncation, corruption), silently seeded `{}`
|
|
69
69
|
* and the writer then OVERWROTE the file — `persistAuthToken` minted a fresh
|
|
70
70
|
* token (fleet-wide 401), `scaffoldDefaultDomains` re-seeded the generic
|
|
71
|
-
* vocabulary over the
|
|
71
|
+
* vocabulary over the existing list, etc. `authToken` / `licenseKey` /
|
|
72
72
|
* `llmApiKey` / `domains` / `identityClients` (was
|
|
73
73
|
* `contextClients`) all gone.
|
|
74
74
|
* The early-return guards (existing-key checks) did NOT save them: those only
|
|
@@ -208,7 +208,7 @@ export declare function ensureAndPersistAgentId(configPath: string): {
|
|
|
208
208
|
};
|
|
209
209
|
/**
|
|
210
210
|
* Decide the per-agent identity id to persist at init (#179; CC default = global,
|
|
211
|
-
*
|
|
211
|
+
* #179 decision). `agentName` is an explicit opt-in only — there is
|
|
212
212
|
* NO hostname default, so an install with no `--agent-name` sends no `?agent=`
|
|
213
213
|
* and shares the global identity (one user = one identity across machines).
|
|
214
214
|
*
|
package/dist/init.js
CHANGED
|
@@ -998,7 +998,7 @@ function saveConfig(configPath, config) {
|
|
|
998
998
|
* parse (a hand-edit syntax slip, truncation, corruption), silently seeded `{}`
|
|
999
999
|
* and the writer then OVERWROTE the file — `persistAuthToken` minted a fresh
|
|
1000
1000
|
* token (fleet-wide 401), `scaffoldDefaultDomains` re-seeded the generic
|
|
1001
|
-
* vocabulary over the
|
|
1001
|
+
* vocabulary over the existing list, etc. `authToken` / `licenseKey` /
|
|
1002
1002
|
* `llmApiKey` / `domains` / `identityClients` (was
|
|
1003
1003
|
* `contextClients`) all gone.
|
|
1004
1004
|
* The early-return guards (existing-key checks) did NOT save them: those only
|
|
@@ -1222,7 +1222,7 @@ function ensureAndPersistAgentId(configPath) {
|
|
|
1222
1222
|
}
|
|
1223
1223
|
/**
|
|
1224
1224
|
* Decide the per-agent identity id to persist at init (#179; CC default = global,
|
|
1225
|
-
*
|
|
1225
|
+
* #179 decision). `agentName` is an explicit opt-in only — there is
|
|
1226
1226
|
* NO hostname default, so an install with no `--agent-name` sends no `?agent=`
|
|
1227
1227
|
* and shares the global identity (one user = one identity across machines).
|
|
1228
1228
|
*
|
|
@@ -1349,7 +1349,7 @@ exports.GENERIC_DEFAULT_DOMAINS = [
|
|
|
1349
1349
|
*/
|
|
1350
1350
|
function scaffoldDefaultDomains(configPath) {
|
|
1351
1351
|
// Strict load: a malformed existing config throws here — NEVER re-seed the
|
|
1352
|
-
// generic defaults over the
|
|
1352
|
+
// generic defaults over the existing vocabulary (the 0.16.x BLOCKER). ENOENT
|
|
1353
1353
|
// seeds {} (fresh install → scaffold is the point).
|
|
1354
1354
|
const { config } = loadConfigStrict(configPath);
|
|
1355
1355
|
if ("domains" in config) {
|
package/dist/llm.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ export declare class LlmClient {
|
|
|
293
293
|
* enableThinking is read from config here (one value, all phases — #231).
|
|
294
294
|
* #562: the azure dialect (provider "azure", selected ONLY via config
|
|
295
295
|
* llmProvider) swaps the token-cap parameter to max_completion_tokens and
|
|
296
|
-
* never sends chat_template_kwargs — Azure 400s on both (
|
|
296
|
+
* never sends chat_template_kwargs — Azure 400s on both (verified live).
|
|
297
297
|
*
|
|
298
298
|
* Token usage (#246): the OpenAI spec's `usage` object is always present on
|
|
299
299
|
* a successful completion — `prompt_tokens` / `completion_tokens` /
|
package/dist/llm.js
CHANGED
|
@@ -40,7 +40,7 @@ const paths_js_1 = require("./paths.js");
|
|
|
40
40
|
// under the hood, but with a hidden 5-minute response-HEADER timer that fires
|
|
41
41
|
// FIRST on non-streaming completions — a completion only sends its headers after
|
|
42
42
|
// generation finishes, so a legitimate >5-min generation is abandoned client-side
|
|
43
|
-
// while the server keeps generating for the dead client (
|
|
43
|
+
// while the server keeps generating for the dead client (a production
|
|
44
44
|
// incident's amplification mechanism). The ollama path already streams to dodge
|
|
45
45
|
// this; these paths get the dispatcher instead.
|
|
46
46
|
const undici_1 = require("undici");
|
|
@@ -325,8 +325,8 @@ const rateLimitedUntilByEndpoint = new Map();
|
|
|
325
325
|
// throw LlmCircuitOpenError with NO network I/O until the cooldown elapses,
|
|
326
326
|
// after which exactly one call is a trial (a failure re-opens, a success
|
|
327
327
|
// resets). This is what bounds a wedged endpoint to K ladder-exhausted calls
|
|
328
|
-
// instead of the ~200-call nightly retrying into it for hours (
|
|
329
|
-
//
|
|
328
|
+
// instead of the ~200-call nightly retrying into it for hours (a production
|
|
329
|
+
// incident). `openedAt` stays set (breakerOpen stays true) until a
|
|
330
330
|
// SUCCESS resets it — tripped-but-past-cooldown is still "not proven healthy".
|
|
331
331
|
//
|
|
332
332
|
// #405: threshold + cooldown are CONSTANTS — the config knobs
|
|
@@ -781,7 +781,7 @@ class LlmClient {
|
|
|
781
781
|
* enableThinking is read from config here (one value, all phases — #231).
|
|
782
782
|
* #562: the azure dialect (provider "azure", selected ONLY via config
|
|
783
783
|
* llmProvider) swaps the token-cap parameter to max_completion_tokens and
|
|
784
|
-
* never sends chat_template_kwargs — Azure 400s on both (
|
|
784
|
+
* never sends chat_template_kwargs — Azure 400s on both (verified live).
|
|
785
785
|
*
|
|
786
786
|
* Token usage (#246): the OpenAI spec's `usage` object is always present on
|
|
787
787
|
* a successful completion — `prompt_tokens` / `completion_tokens` /
|
|
@@ -803,7 +803,7 @@ class LlmClient {
|
|
|
803
803
|
headers["Authorization"] = `Bearer ${this.config.apiKey}`;
|
|
804
804
|
}
|
|
805
805
|
// Qwen3 thinking mode: when on, the model can burn the whole token budget on
|
|
806
|
-
// an unclosed <think> block and emit nothing (
|
|
806
|
+
// an unclosed <think> block and emit nothing (observed live). One value
|
|
807
807
|
// for all phases (#231): when set (true or false) the chat_template_kwargs
|
|
808
808
|
// kwarg rides every call — so it is LOCAL-endpoint only (ollama, mlx-lm
|
|
809
809
|
// gateway); a cloud OpenAI/OpenRouter/Groq endpoint would 400 on the unknown
|