@the-40-thieves/obsidian-tc-shared 1.31.3 → 1.31.4
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/config/indexing-embeddings.schema.d.ts +18 -0
- package/dist/config/indexing-embeddings.schema.d.ts.map +1 -1
- package/dist/config/indexing-embeddings.schema.js +70 -5
- package/dist/config/indexing-embeddings.schema.js.map +1 -1
- package/dist/config/observability.schema.d.ts +6 -0
- package/dist/config/observability.schema.d.ts.map +1 -1
- package/dist/config/observability.schema.js +90 -12
- package/dist/config/observability.schema.js.map +1 -1
- package/dist/config/personas.schema.js +1 -1
- package/dist/config/personas.schema.js.map +1 -1
- package/dist/config/reranker.schema.js +2 -2
- package/dist/config/reranker.schema.js.map +1 -1
- package/dist/config/retrieval.schema.d.ts +10 -0
- package/dist/config/retrieval.schema.d.ts.map +1 -1
- package/dist/config/retrieval.schema.js +38 -12
- package/dist/config/retrieval.schema.js.map +1 -1
- package/dist/config/runtime.schema.js +2 -2
- package/dist/config/runtime.schema.js.map +1 -1
- package/dist/config/server.schema.d.ts +38 -0
- package/dist/config/server.schema.d.ts.map +1 -1
- package/dist/config/server.schema.js +10 -5
- package/dist/config/server.schema.js.map +1 -1
- package/dist/config/tools.schema.d.ts +11 -0
- package/dist/config/tools.schema.d.ts.map +1 -1
- package/dist/config/tools.schema.js +33 -5
- package/dist/config/tools.schema.js.map +1 -1
- package/dist/config.schema.d.ts +5 -5
- package/dist/config.schema.d.ts.map +1 -1
- package/dist/config.schema.js +3 -3
- package/dist/config.schema.js.map +1 -1
- package/dist/errors.d.ts +7 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +11 -2
- package/dist/errors.js.map +1 -1
- package/dist/net-host.d.ts +12 -0
- package/dist/net-host.d.ts.map +1 -1
- package/dist/net-host.js +69 -0
- package/dist/net-host.js.map +1 -1
- package/package.json +4 -3
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/** THE-1122 review (item 7): each "local" catalog entry's native vector width, duplicated from
|
|
3
|
+
* packages/embedder-local/src/model-info.ts for the SAME reason LOCAL_DEFAULT_MODEL above is
|
|
4
|
+
* duplicated rather than imported (this schema leaf cannot depend on that optional, Node-fs-
|
|
5
|
+
* shaped package — see this file's own header). Kept in sync by the same mechanism:
|
|
6
|
+
* embedder-local's own test/model-info.test.ts pins each catalog entry's real `dimensions`, so a
|
|
7
|
+
* future catalog change that drifts from this map is caught there, not only by this comment.
|
|
8
|
+
*
|
|
9
|
+
* Exported for packages/server/src/config/load.ts's finalizeConfig, which uses this to (a)
|
|
10
|
+
* DERIVE `embeddings.dimensions` when a "local" config omits it (this schema's own `dimensions`
|
|
11
|
+
* default is a PROVIDER-AGNOSTIC 768 — see LOCAL_DEFAULT_MODEL's comment above for why it cannot
|
|
12
|
+
* be provider-conditional at the schema level — so a config selecting a 384-dim catalog entry
|
|
13
|
+
* with no explicit `dimensions` would otherwise silently inherit the wrong width and crash later
|
|
14
|
+
* at vec0 column-width mismatch), and (b) REJECT an explicit `dimensions` that contradicts the
|
|
15
|
+
* selected model's real width, naming both numbers, rather than letting that surface as an opaque
|
|
16
|
+
* failure far from the config that caused it. */
|
|
17
|
+
export declare const LOCAL_CATALOG_DIMENSIONS: Readonly<Record<string, number>>;
|
|
2
18
|
export declare const EmbeddingsConfigSchema: z.ZodObject<{
|
|
3
19
|
provider: z.ZodDefault<z.ZodString>;
|
|
4
20
|
model: z.ZodDefault<z.ZodString>;
|
|
@@ -32,6 +48,8 @@ export declare const EmbeddingsConfigSchema: z.ZodObject<{
|
|
|
32
48
|
dimensions: z.ZodDefault<z.ZodNumber>;
|
|
33
49
|
}, z.core.$strip>>;
|
|
34
50
|
}, z.core.$strip>>;
|
|
51
|
+
quantized: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
35
53
|
}, z.core.$strip>;
|
|
36
54
|
export declare const IndexingConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
37
55
|
writeConcurrency: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexing-embeddings.schema.d.ts","sourceRoot":"","sources":["../../src/config/indexing-embeddings.schema.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"indexing-embeddings.schema.d.ts","sourceRoot":"","sources":["../../src/config/indexing-embeddings.schema.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB;;;;;;;;;;;;;;kDAckD;AAClD,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIrE,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuNjC,CAAC;AAOH,eAAO,MAAM,oBAAoB;;;;;;kBA8DlB,CAAC;AAChB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -6,22 +6,76 @@
|
|
|
6
6
|
// `.prefault({})` (a default-application combinator, not a `.refine`/`.superRefine`) — there is
|
|
7
7
|
// no cross-domain field read to keep back in config.schema.ts, so the whole schema moves here.
|
|
8
8
|
import { z } from "zod";
|
|
9
|
+
// THE-1122: `LOCAL_DEFAULT_MODEL` MUST stay in sync with packages/embedder-local/src/model-info.ts's
|
|
10
|
+
// DEFAULT_MODEL_NAME — this file cannot import that optional, non-workspace package (it is
|
|
11
|
+
// Node-fs- and network-shaped; this schema leaf is isomorphic and imports Zod only, see the file
|
|
12
|
+
// header). embedder-local's own test/model-info.test.ts pins its DEFAULT_MODEL_NAME to the same
|
|
13
|
+
// literal string, so a future change to one side is caught by that test, not just by this comment.
|
|
14
|
+
//
|
|
15
|
+
// NOT the smallest/fastest catalog entry — measured, not assumed, each model with its own
|
|
16
|
+
// correct pooling strategy (docs/EVALUATION.md's "Local embedder model selection"). Both 384-dim
|
|
17
|
+
// candidates FAILED the −0.015 non-inferiority floor against this exact model — MiniLM's deficit
|
|
18
|
+
// is real and clearly detected; bge-small's nDCG@10 does not reach conventional significance at
|
|
19
|
+
// this n, so read that one number as non-inferiority not established at this corpus's resolution
|
|
20
|
+
// rather than a pass (its recall@10 IS significant, and it still fails the floor either way).
|
|
21
|
+
// nomic-embed-text-v1.5 is the default as the conservative choice under this underpowered
|
|
22
|
+
// comparison, not a claimed decisive win — see model-info.ts's own comment on DEFAULT_MODEL_NAME
|
|
23
|
+
// for the exact numbers.
|
|
24
|
+
//
|
|
25
|
+
// WHY THIS IS A PLAIN UNCONDITIONAL DEFAULT, NOT PROVIDER-CONDITIONAL: an earlier version of this
|
|
26
|
+
// change made `model`/`dimensions` default based on `provider` via a schema-level `.transform()`.
|
|
27
|
+
// That broke scripts/docgen/extract-config.ts's hand-rolled Zod introspection walker (it requires
|
|
28
|
+
// every nested config section to literally be `def.type === "object"` with a `.shape` to recurse
|
|
29
|
+
// into it; a `.transform()` turns the schema into a ZodPipe, and the WHOLE `embeddings` subtree
|
|
30
|
+
// silently vanished from generated docs — caught by test/docgen-config.test.ts, not by inspection).
|
|
31
|
+
// The plain default below is the one-line fix: `provider`/`model`/`dimensions` keep the exact
|
|
32
|
+
// unconditional-default shape every OTHER field in this schema already has. The one behavioural
|
|
33
|
+
// cost: `{ "provider": "ollama" }` with no `model` now resolves `model` to "nomic-embed-text-v1.5"
|
|
34
|
+
// (the new schema default) rather than the old "nomic-embed-text" (no version suffix — Ollama's
|
|
35
|
+
// own tag name) — Ollama then 404s LOUDLY on a model it was never asked to pull, rather than
|
|
36
|
+
// silently misconfiguring anything (the two happen to share `dimensions: 768`, so that half is
|
|
37
|
+
// unaffected). This shorthand (provider set, model omitted) was never actually documented
|
|
38
|
+
// anywhere in this repo's own config examples, which always pair `"provider": "ollama"` with an
|
|
39
|
+
// explicit `"model"` — see docs/src/content/docs/configuration/config-yaml.md and
|
|
40
|
+
// docs/wiki/Configuration.md.
|
|
41
|
+
const LOCAL_DEFAULT_MODEL = "nomic-embed-text-v1.5";
|
|
42
|
+
/** THE-1122 review (item 7): each "local" catalog entry's native vector width, duplicated from
|
|
43
|
+
* packages/embedder-local/src/model-info.ts for the SAME reason LOCAL_DEFAULT_MODEL above is
|
|
44
|
+
* duplicated rather than imported (this schema leaf cannot depend on that optional, Node-fs-
|
|
45
|
+
* shaped package — see this file's own header). Kept in sync by the same mechanism:
|
|
46
|
+
* embedder-local's own test/model-info.test.ts pins each catalog entry's real `dimensions`, so a
|
|
47
|
+
* future catalog change that drifts from this map is caught there, not only by this comment.
|
|
48
|
+
*
|
|
49
|
+
* Exported for packages/server/src/config/load.ts's finalizeConfig, which uses this to (a)
|
|
50
|
+
* DERIVE `embeddings.dimensions` when a "local" config omits it (this schema's own `dimensions`
|
|
51
|
+
* default is a PROVIDER-AGNOSTIC 768 — see LOCAL_DEFAULT_MODEL's comment above for why it cannot
|
|
52
|
+
* be provider-conditional at the schema level — so a config selecting a 384-dim catalog entry
|
|
53
|
+
* with no explicit `dimensions` would otherwise silently inherit the wrong width and crash later
|
|
54
|
+
* at vec0 column-width mismatch), and (b) REJECT an explicit `dimensions` that contradicts the
|
|
55
|
+
* selected model's real width, naming both numbers, rather than letting that surface as an opaque
|
|
56
|
+
* failure far from the config that caused it. */
|
|
57
|
+
export const LOCAL_CATALOG_DIMENSIONS = {
|
|
58
|
+
"all-MiniLM-L6-v2": 384,
|
|
59
|
+
"bge-small-en-v1.5": 384,
|
|
60
|
+
"nomic-embed-text-v1.5": 768,
|
|
61
|
+
};
|
|
9
62
|
export const EmbeddingsConfigSchema = z.object({
|
|
10
63
|
provider: z
|
|
11
64
|
.string()
|
|
12
65
|
.min(1)
|
|
13
|
-
.default("
|
|
14
|
-
.describe("Embeddings backend name, resolved against the provider registry at startup. Built-ins: ollama, openai, voyage, cohere, bge-m3, model-tier (splits dense and multi-vector across two services), the generic openai-compatible, and the profile-gated module. An unregistered name is a startup error listing every valid option."),
|
|
66
|
+
.default("local")
|
|
67
|
+
.describe("Embeddings backend name, resolved against the provider registry at startup. Built-ins: local (a bundled, fully offline dense embedder via the optional @the-40-thieves/obsidian-tc-embedder-local package; no network, no Ollama, no API key), ollama, openai, voyage, cohere, bge-m3, model-tier (splits dense and multi-vector across two services), the generic openai-compatible, and the profile-gated module. `local` is the DEFAULT when this whole block is absent — semantic search works with zero configuration. An unregistered name is a startup error listing every valid option."),
|
|
15
68
|
model: z
|
|
16
69
|
.string()
|
|
17
|
-
.
|
|
18
|
-
.
|
|
70
|
+
.min(1)
|
|
71
|
+
.default(LOCAL_DEFAULT_MODEL)
|
|
72
|
+
.describe('Embedding model name as the provider names it. Defaults to nomic-embed-text-v1.5, the "local" provider\'s default catalog entry — set this explicitly for every other provider. Under provider "local" this MUST be one of embedder-local\'s pinned catalog names (all-MiniLM-L6-v2, bge-small-en-v1.5, nomic-embed-text-v1.5) — an unrecognized name is refused, since the local provider only ever loads checksum-verified weights it has a pinned manifest for.'),
|
|
19
73
|
dimensions: z
|
|
20
74
|
.number()
|
|
21
75
|
.int()
|
|
22
76
|
.positive()
|
|
23
77
|
.default(768)
|
|
24
|
-
.describe("Stored vector width, and the width of the vec0 column. Changing it requires a fresh index — existing vectors are not re-projected."),
|
|
78
|
+
.describe("Stored vector width, and the width of the vec0 column. Changing it requires a fresh index — existing vectors are not re-projected. Defaults to 768, nomic-embed-text-v1.5's native width (the \"local\" provider's default model) — set this explicitly to match whatever model you configure (e.g. 384 for the smaller local catalog entries)."),
|
|
25
79
|
baseUrl: z
|
|
26
80
|
.string()
|
|
27
81
|
.url()
|
|
@@ -167,6 +221,17 @@ export const EmbeddingsConfigSchema = z.object({
|
|
|
167
221
|
})
|
|
168
222
|
.optional()
|
|
169
223
|
.describe("Polyglot model tier: dense retrieval from one service and sparse/ColBERT from another, fused by RRF on ranks. Required when provider is model-tier."),
|
|
224
|
+
// THE-1122: only read by provider "local".
|
|
225
|
+
quantized: z
|
|
226
|
+
.boolean()
|
|
227
|
+
.default(true)
|
|
228
|
+
.describe('provider "local" only. true (default) loads the pinned q8 (int8) quantized ONNX export; false loads the pinned fp32 export instead — larger, slower, marginally more precise. Both are separately checksum-verified; toggling this re-downloads the other variant on first use if it is not already cached.'),
|
|
229
|
+
threads: z
|
|
230
|
+
.number()
|
|
231
|
+
.int()
|
|
232
|
+
.positive()
|
|
233
|
+
.optional()
|
|
234
|
+
.describe('provider "local" only. onnxruntime-node intra-/inter-op thread count. Absent lets the runtime pick its own default (usually the CPU core count).'),
|
|
170
235
|
});
|
|
171
236
|
// THE-458 (audit #5): index-on-write coordinator concurrency + backpressure. Fully defaulted so a
|
|
172
237
|
// config predating it validates unchanged. `writeConcurrency` bounds concurrent index/embed calls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexing-embeddings.schema.js","sourceRoot":"","sources":["../../src/config/indexing-embeddings.schema.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,2FAA2F;AAC3F,EAAE;AACF,oFAAoF;AACpF,iFAAiF;AACjF,gGAAgG;AAChG,+FAA+F;AAC/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"indexing-embeddings.schema.js","sourceRoot":"","sources":["../../src/config/indexing-embeddings.schema.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,2FAA2F;AAC3F,EAAE;AACF,oFAAoF;AACpF,iFAAiF;AACjF,gGAAgG;AAChG,+FAA+F;AAC/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qGAAqG;AACrG,2FAA2F;AAC3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CAAC;IAC1E,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CACP,8HAA8H,CAC/H;IACH;;;;;;wFAMoF;IACpF,aAAa,EAAE,CAAC;SACb,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,2MAA2M,CAC5M;IACH;;;;;;;;;;;;;;;;+FAgB2F;IAC3F,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,EAAE,CAAC;SACP,GAAG,CAAC,IAAI,CAAC;SACT,OAAO,CAAC,GAAG,CAAC;SACZ,QAAQ,CACP,8UAA8U,CAC/U;CACJ,CAAC;KACD,QAAQ,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -84,4 +84,10 @@ export declare const ReadwiseConfigSchema: z.ZodObject<{
|
|
|
84
84
|
export declare const PensieveConfigSchema: z.ZodObject<{
|
|
85
85
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
86
86
|
}, z.core.$strip>;
|
|
87
|
+
export declare const TelemetryConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
88
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
89
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
90
|
+
intervalMinutes: z.ZodDefault<z.ZodNumber>;
|
|
91
|
+
authTokenEnv: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
87
93
|
//# sourceMappingURL=observability.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.schema.d.ts","sourceRoot":"","sources":["../../src/config/observability.schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"observability.schema.d.ts","sourceRoot":"","sources":["../../src/config/observability.schema.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBA8EpC,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;kBAgBnB,CAAC;AAGhB,eAAO,MAAM,uBAAuB;;;;;;;;kBAoErB,CAAC;AAOhB,eAAO,MAAM,iBAAiB;;;kBAiBf,CAAC;AAWhB,eAAO,MAAM,qBAAqB;;kBAWnB,CAAC;AAgBhB,eAAO,MAAM,iBAAiB;;;;;;kBAuCf,CAAC;AAUhB;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOvE;AAED,eAAO,MAAM,kBAAkB;;kBAchB,CAAC;AAUhB,eAAO,MAAM,gBAAgB;;;;;;iBAgC3B,CAAC;AAOH,eAAO,MAAM,oBAAoB;;iBAO/B,CAAC;AASH,eAAO,MAAM,oBAAoB;;iBAO/B,CAAC;AAIH,eAAO,MAAM,qBAAqB;;;;;kBAqFnB,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// WP1.6: extracted from ../config.schema.ts (which stays a compatibility facade re-exporting
|
|
2
|
-
// these same symbol names). Leaf schema — imports Zod
|
|
2
|
+
// these same symbol names). Leaf schema — imports Zod plus net-host.ts (a shared scalar helper,
|
|
3
|
+
// not a schema module; retrieval.schema.ts's judge.baseUrl sets this precedent).
|
|
3
4
|
//
|
|
4
5
|
// Import direction is non-negotiable: this file must never import config.schema.ts,
|
|
5
|
-
// server.schema.ts, or any other schema module.
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// here whole.
|
|
6
|
+
// server.schema.ts, or any other schema module. Every schema below chains only `.prefault({})`
|
|
7
|
+
// or a SELF-CONTAINED `.superRefine`/`.refine` reading only its own fields (EgressConfigSchema's
|
|
8
|
+
// pattern refusal, TelemetryConfigSchema's enabled-requires-endpoint check below) — no cross-domain read.
|
|
9
9
|
//
|
|
10
|
-
// The http/auth interlock (ServerConfigSchema.superRefine) is NOT here —
|
|
11
|
-
// cfg.transports.http
|
|
12
|
-
// auth-acl.schema.ts respectively, so it is cross-domain and stays in config.schema.ts.
|
|
10
|
+
// The http/auth interlock (ServerConfigSchema.superRefine) is NOT here — cross-domain
|
|
11
|
+
// (cfg.transports.http + cfg.auth), so it stays in config.schema.ts.
|
|
13
12
|
import { z } from "zod";
|
|
13
|
+
import { classifyJudgeBaseUrl, isDisallowedLiteralHost, isLoopbackHost } from "../net-host";
|
|
14
14
|
export const ObservabilityConfigSchema = z.object({
|
|
15
15
|
// traceDetail / tracesSampleRate were declared here and read by NOTHING: no sampling was ever applied
|
|
16
16
|
// and no detail switch existed. Removed rather than left as a lie in a schema operators trust. Re-add
|
|
@@ -77,7 +77,7 @@ export const ObservabilityConfigSchema = z.object({
|
|
|
77
77
|
.int()
|
|
78
78
|
.positive()
|
|
79
79
|
.default(30)
|
|
80
|
-
.describe("Days of workspace session trace files (<vault>/<traceFolder>/*.jsonl) kept by the maintenance sweep. Traces are per-vault and live INSIDE the vault, so they are also picked up by whatever syncs or backs it up. Orphans from a failed start_session are pruned by the same age rule (
|
|
80
|
+
.describe("Days of workspace session trace files (<vault>/<traceFolder>/*.jsonl) kept by the maintenance sweep. Traces are per-vault and live INSIDE the vault, so they are also picked up by whatever syncs or backs it up. Orphans from a failed start_session are pruned by the same age rule (the trace is written before the session row, so a failed attempt leaves a file with no row referencing it)."),
|
|
81
81
|
})
|
|
82
82
|
.prefault({})
|
|
83
83
|
.describe("Retention policy for locally stored observability data."),
|
|
@@ -215,7 +215,7 @@ export const PlaneConfigSchema = z
|
|
|
215
215
|
enabled: z
|
|
216
216
|
.boolean()
|
|
217
217
|
.default(false)
|
|
218
|
-
.describe("Run ambient sleep-time consolidation (synthesis and audit jobs). Only meaningful when the inference gateway roles are configured. Opt-in
|
|
218
|
+
.describe("Run ambient sleep-time consolidation (synthesis and audit jobs). Only meaningful when the inference gateway roles are configured. Opt-in: a deployment with a gateway configured and this key unset gets a boot-time notice explaining how to turn it on."),
|
|
219
219
|
intervalMinutes: z
|
|
220
220
|
.number()
|
|
221
221
|
.int()
|
|
@@ -227,7 +227,7 @@ export const PlaneConfigSchema = z
|
|
|
227
227
|
.int()
|
|
228
228
|
.positive()
|
|
229
229
|
.default(6)
|
|
230
|
-
.describe("Attempts a consolidation job's gateway call may make before failing, each with its own fresh timeout. Higher than the interactive default (3) because the models behind the gateway roles may be serverless and scale to zero: a cold start measured at over 180s exceeded 3 attempts x 60s, so every scheduled pass failed with a timeout while the same request against a warm endpoint took 4.8s. Separate from the interactive path on purpose: a multi-minute budget suits a background weekly pass and not a user-facing call. NOTE
|
|
230
|
+
.describe("Attempts a consolidation job's gateway call may make before failing, each with its own fresh timeout. Higher than the interactive default (3) because the models behind the gateway roles may be serverless and scale to zero: a cold start measured at over 180s exceeded 3 attempts x 60s, so every scheduled pass failed with a timeout while the same request against a warm endpoint took 4.8s. Separate from the interactive path on purpose: a multi-minute budget suits a background weekly pass and not a user-facing call. NOTE: attempts alone were not sufficient — retries only help a TRANSIENT failure, and a request that deterministically exceeds the per-attempt timeout fails identically on every attempt. See planeGatewayTimeoutMs, which is the knob for that case."),
|
|
231
231
|
gatewayTimeoutMs: z
|
|
232
232
|
.number()
|
|
233
233
|
.int()
|
|
@@ -239,7 +239,7 @@ export const PlaneConfigSchema = z
|
|
|
239
239
|
.int()
|
|
240
240
|
.positive()
|
|
241
241
|
.default(45535)
|
|
242
|
-
.describe("Aggregate character cap on a consolidation job's WHOLE gateway request (system prompt + user message). Not a per-item cap: the synthesis job already truncated each chunk to 1000 chars and still built a 169,258-char prompt from 200 of them, which the serving window rejected as ContextWindowExceeded. Sized in characters, not tokens, because no tokenizer is available on this side. The default is conservative on purpose — the model behind a gateway role is swappable at the gateway, and the server does not advertise its max_model_len through the LiteLLM /v1/models passthrough, so this side cannot discover the real ceiling.
|
|
242
|
+
.describe("Aggregate character cap on a consolidation job's WHOLE gateway request (system prompt + user message). Not a per-item cap: the synthesis job already truncated each chunk to 1000 chars and still built a 169,258-char prompt from 200 of them, which the serving window rejected as ContextWindowExceeded. Sized in characters, not tokens, because no tokenizer is available on this side. The default is conservative on purpose — the model behind a gateway role is swappable at the gateway, and the server does not advertise its max_model_len through the LiteLLM /v1/models passthrough, so this side cannot discover the real ceiling. Sized so every vault shape keeps the SAME ~14,554-token output reserve inside a 32768-token window, not just prose-like ones — derived from the worst-case density this job documents (code/CJK, ~2.5 chars/token): (32768 - 14554) x 2.5 = 45535 chars. A prose-dense vault (measured on a real vault at 3.294 chars/token) gets MORE reserve than this, never less. Raise it when the role points at a larger serving window."),
|
|
243
243
|
})
|
|
244
244
|
.prefault({});
|
|
245
245
|
// THE-934 — the egress boundary. `readPaths` (auth-acl.schema.ts) is a whitelist that ALSO governs
|
|
@@ -355,4 +355,82 @@ export const PensieveConfigSchema = z.object({
|
|
|
355
355
|
.optional()
|
|
356
356
|
.describe("Base URL of a Pensieve instance (e.g. http://100.x.x.x:8839, its default port), queried at `/api/search`. Pensieve's API has no auth — access control is expected at the network layer (tailscale). Absent means `import-ambient` no-ops with NO network call."),
|
|
357
357
|
});
|
|
358
|
+
// Opt-in, anonymous usage telemetry (THE-1125). Full disclosure: docs/configuration/telemetry.md,
|
|
359
|
+
// SECURITY.md; the closed key set enforcing "never sent" lives in server/src/telemetry/document.ts.
|
|
360
|
+
export const TelemetryConfigSchema = z
|
|
361
|
+
.object({
|
|
362
|
+
enabled: z
|
|
363
|
+
.boolean()
|
|
364
|
+
.default(false)
|
|
365
|
+
.describe("Opt in to anonymous usage telemetry. Off by default. Turning this on with no `endpoint` set is a CONFIG ERROR at boot (refused below), never a silent no-op — there is no default telemetry endpoint. When on, an aggregate document (never paths, note content, queries, vault ids, principals, tokens, hostnames or env) is POSTed to `endpoint` once every `intervalMinutes`, never at boot before the first interval elapses. `obsidian-tc telemetry preview` prints the exact document that would be sent right now."),
|
|
366
|
+
endpoint: z
|
|
367
|
+
.string()
|
|
368
|
+
.url()
|
|
369
|
+
.optional()
|
|
370
|
+
.describe("Collector URL the telemetry document is POSTed to. Required when `enabled` is true — refused below when absent. Must be `https://` unless the host is loopback (`localhost`/`127.0.0.1`/`[::1]`), which is allowed ONLY for tests and a locally-run reference collector; unlike experiential.citationInfer.judge.baseUrl there is no `allowPlainHttp` widening here for a remote host — a bearer token (`authTokenEnv`) and the document both travel over it, so a remote endpoint must be encrypted in transit. Must not name a literal private, link-local, carrier-grade-NAT, unspecified, or cloud-metadata IP address (loopback is the one such range that IS allowed) — a hostname that happens to resolve to one is not checked here, by design."),
|
|
371
|
+
intervalMinutes: z
|
|
372
|
+
.number()
|
|
373
|
+
.int()
|
|
374
|
+
.min(60)
|
|
375
|
+
.default(1440)
|
|
376
|
+
.describe("Minutes between telemetry sends. Minimum 60 — this is aggregate, low-frequency telemetry, not a heartbeat. The first send happens no sooner than this many minutes after boot; there is never a send at boot itself."),
|
|
377
|
+
authTokenEnv: z
|
|
378
|
+
.string()
|
|
379
|
+
.min(1)
|
|
380
|
+
.optional()
|
|
381
|
+
.describe('Name of an environment variable holding a bearer token, sent as "Authorization: Bearer <value>" on the telemetry POST. Optional — most reference collectors need no auth at all. Never put a secret in `endpoint` itself (refused below); this is the only supported way to authenticate to a collector.'),
|
|
382
|
+
})
|
|
383
|
+
.superRefine((cfg, ctx) => {
|
|
384
|
+
if (cfg.enabled && cfg.endpoint === undefined) {
|
|
385
|
+
ctx.addIssue({
|
|
386
|
+
code: z.ZodIssueCode.custom,
|
|
387
|
+
path: ["endpoint"],
|
|
388
|
+
message: "telemetry.enabled is true but telemetry.endpoint is not set. There is no default telemetry endpoint — obsidian-tc never phones home unless you opt in AND name a collector. Set telemetry.endpoint to the URL you want the aggregate usage document sent to, or leave telemetry.enabled false.",
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
if (cfg.endpoint !== undefined) {
|
|
392
|
+
const cls = classifyJudgeBaseUrl(cfg.endpoint);
|
|
393
|
+
if (cls === "invalid") {
|
|
394
|
+
ctx.addIssue({
|
|
395
|
+
code: z.ZodIssueCode.custom,
|
|
396
|
+
path: ["endpoint"],
|
|
397
|
+
message: 'telemetry.endpoint must be a canonical "scheme://host" URL with scheme https or http — either it could not be parsed that way, or its scheme is neither (e.g. ftp:/file:).',
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
else if (cls === "http-remote") {
|
|
401
|
+
ctx.addIssue({
|
|
402
|
+
code: z.ZodIssueCode.custom,
|
|
403
|
+
path: ["endpoint"],
|
|
404
|
+
message: "telemetry.endpoint must use https:// unless the host is loopback (localhost/127.0.0.1/[::1]) for tests or a locally-run reference collector. There is no allowPlainHttp-style widening for telemetry: a remote endpoint is always required to be https.",
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
let hasUserinfo = false;
|
|
408
|
+
try {
|
|
409
|
+
const u = new URL(cfg.endpoint);
|
|
410
|
+
hasUserinfo = u.username.length > 0 || u.password.length > 0;
|
|
411
|
+
}
|
|
412
|
+
catch { }
|
|
413
|
+
if (hasUserinfo) {
|
|
414
|
+
ctx.addIssue({
|
|
415
|
+
code: z.ZodIssueCode.custom,
|
|
416
|
+
path: ["endpoint"],
|
|
417
|
+
message: "telemetry.endpoint must not contain userinfo (a username/password embedded in the URL) — the endpoint is shown by `telemetry preview`/`status`, `doctor` and `server_health`, and logged on a failed send, so a credential placed there will leak. Put a collector secret in telemetry.authTokenEnv (an environment variable name) instead; it is sent as an Authorization header and never printed or logged.",
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
// https alone does not stop a literal private/link-local/metadata host (loopback excepted).
|
|
421
|
+
let host;
|
|
422
|
+
try {
|
|
423
|
+
host = new URL(cfg.endpoint).hostname;
|
|
424
|
+
}
|
|
425
|
+
catch { }
|
|
426
|
+
if (host !== undefined && !isLoopbackHost(host) && isDisallowedLiteralHost(host)) {
|
|
427
|
+
ctx.addIssue({
|
|
428
|
+
code: z.ZodIssueCode.custom,
|
|
429
|
+
path: ["endpoint"],
|
|
430
|
+
message: "telemetry.endpoint must not name a literal private, link-local, carrier-grade-NAT, unspecified, or cloud-metadata IP address — this collector would then be reachable only from inside your own network, or (for a metadata address) could reach a cloud instance's credential-issuing endpoint. Loopback (localhost/127.0.0.1/[::1]) is the one such range that stays allowed, for tests and a locally-run collector.",
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
})
|
|
435
|
+
.prefault({});
|
|
358
436
|
//# sourceMappingURL=observability.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.schema.js","sourceRoot":"","sources":["../../src/config/observability.schema.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,
|
|
1
|
+
{"version":3,"file":"observability.schema.js","sourceRoot":"","sources":["../../src/config/observability.schema.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,gGAAgG;AAChG,iFAAiF;AACjF,EAAE;AACF,oFAAoF;AACpF,+FAA+F;AAC/F,iGAAiG;AACjG,0GAA0G;AAC1G,EAAE;AACF,sFAAsF;AACtF,qEAAqE;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5F,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,sGAAsG;IACtG,sGAAsG;IACtG,gDAAgD;IAChD,IAAI,EAAE,CAAC;SACJ,MAAM,CAAC;QACN,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,6EAA6E,CAAC;QAC1F,OAAO,EAAE,CAAC;aACP,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;aAC9B,QAAQ,CAAC,EAAE,CAAC;aACZ,QA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CAAC;QACV,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;YACjF,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,OAAO,EACL,wZAAwZ;aAC3Z,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC;KACD,QAAQ,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -18,7 +18,7 @@ export const PersonaConfigSchema = z.object({
|
|
|
18
18
|
.array(z.string())
|
|
19
19
|
.min(1)
|
|
20
20
|
.describe("The scopes a token carrying this persona is granted — REPLACES whatever scopes the token itself carries, never unioned with them, so a persona claim can only narrow or redirect a grant, never widen it beyond what the operator configured here."),
|
|
21
|
-
toolVisibility: ToolVisibilityConfigSchema.optional().describe("Optional per-persona tool-visibility mask, composed with the server's static `toolVisibility` at the same disabled > hidden > scope_denied > listed chokepoint (
|
|
21
|
+
toolVisibility: ToolVisibilityConfigSchema.optional().describe("Optional per-persona tool-visibility mask, composed with the server's static `toolVisibility` at the same disabled > hidden > scope_denied > listed chokepoint (the existence-oracle constraint still holds). Can only narrow what the static config already allows, never restore a tool the static config hid or disabled."),
|
|
22
22
|
});
|
|
23
23
|
// A name -> bundle map. Wired into ServerConfigObject as `.optional()` — absent (the default)
|
|
24
24
|
// means no persona claim can ever resolve; see auth/persona.ts, which fails closed on an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personas.schema.js","sourceRoot":"","sources":["../../src/config/personas.schema.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,kFAAkF;AAClF,iGAAiG;AACjG,EAAE;AACF,+FAA+F;AAC/F,qFAAqF;AACrF,yFAAyF;AACzF,0FAA0F;AAC1F,6FAA6F;AAC7F,OAAO,EAAE,CAAC,EAAE,MAAM,K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,gFAAgF;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const RerankerConfigSchema = z.object({
|
|
|
6
6
|
provider: z
|
|
7
7
|
.string()
|
|
8
8
|
.min(1)
|
|
9
|
-
.describe("Reranker backend name, resolved against the provider registry at startup. Built-ins: cohere-compatible (any Cohere-format /rerank endpoint), model-tier (the BGE cross-encoder, configured via embeddings.modelTier.full), gateway (the inference gateway passthrough), local (
|
|
9
|
+
.describe("Reranker backend name, resolved against the provider registry at startup. Built-ins: cohere-compatible (any Cohere-format /rerank endpoint), model-tier (the BGE cross-encoder, configured via embeddings.modelTier.full), gateway (the inference gateway passthrough), local (a bundled, fully offline cross-encoder — no gateway or Python service required; requires the optional @the-40-thieves/obsidian-tc-reranker-local package, and is also tried AUTOMATICALLY — no need to set provider: 'local' explicitly — when this whole block is left unset, model-tier is not configured, and no gateway URL is configured either), and the profile-gated module."),
|
|
10
10
|
// Optional at the schema level because "required" is not uniform across entries: cohere-compatible
|
|
11
11
|
// genuinely needs one and throws its own actionable boot error when it is absent; model-tier
|
|
12
12
|
// ignores it entirely (its model comes from embeddings.modelTier.full.model) and throws its own
|
|
@@ -48,7 +48,7 @@ export const RerankerConfigSchema = z.object({
|
|
|
48
48
|
.string()
|
|
49
49
|
.min(1)
|
|
50
50
|
.optional()
|
|
51
|
-
.describe("Absolute path to the ROOT directory under which <model-id>/<revision>/ lives (config.json, tokenizer.json, onnx/model_int8.onnx — see @the-40-thieves/obsidian-tc-reranker-local's README) for provider 'local'.
|
|
51
|
+
.describe("Absolute path to the ROOT directory under which <model-id>/<revision>/ lives (config.json, tokenizer.json, onnx/model_int8.onnx — see @the-40-thieves/obsidian-tc-reranker-local's README) for provider 'local'. No longer required to be pre-populated — fetched and sha256-verified automatically on the first rerank call if not already present. Defaults to that package's own models/ directory. `bun run fetch-model` still works, for offline/CI pre-population. Ignored — and refused at boot if set — by every other provider."),
|
|
52
52
|
// THE-705 round 2: route (i) of provider "local"'s resolution ladder (registry.ts's
|
|
53
53
|
// resolveLocalRerankerModule) — the escape hatch for every deployment shape the bare package
|
|
54
54
|
// specifier and the source-checkout default don't cover (an npm-installed server pointed at a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reranker.schema.js","sourceRoot":"","sources":["../../src/config/reranker.schema.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,mGAAmG;AACnG,uEAAuE;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,
|
|
1
|
+
{"version":3,"file":"reranker.schema.js","sourceRoot":"","sources":["../../src/config/reranker.schema.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,mGAAmG;AACnG,uEAAuE;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,qoBAAqoB,CACtoB;IACH,mGAAmG;IACnG,6FAA6F;IAC7F,gGAAgG;IAChG,iGAAiG;IACjG,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,iTAAiT,CAClT;IACH,qEAAqE;IACrE,OAAO,EAAE,CAAC;SACP,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CACP,kTAAkT,CACnT;IACH,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,6JAA6J,CAC9J;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,kIAAkI,CACnI;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,2IAA2I,CAC5I;IACH,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,2UAA2U,CAC5U;IACH,+FAA+F;IAC/F,8FAA8F;IAC9F,+BAA+B;IAC/B,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,0gBAA0gB,CAC3gB;IACH,oFAAoF;IACpF,6FAA6F;IAC7F,8FAA8F;IAC9F,8FAA8F;IAC9F,6CAA6C;IAC7C,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,4XAA4X,CAC7X;CACJ,CAAC,CAAC"}
|
|
@@ -77,6 +77,7 @@ export declare const RankingConfigSchema: z.ZodObject<{
|
|
|
77
77
|
/** THE-230: experiential-tier (membrane store, experiential.db) knobs. */
|
|
78
78
|
export declare const ExperientialConfigSchema: z.ZodObject<{
|
|
79
79
|
logRetrievals: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
allowFeedbackInReadOnly: z.ZodDefault<z.ZodBoolean>;
|
|
80
81
|
captureEpisodes: z.ZodDefault<z.ZodBoolean>;
|
|
81
82
|
captureContent: z.ZodDefault<z.ZodBoolean>;
|
|
82
83
|
captureRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
@@ -115,4 +116,13 @@ export declare const ExperientialConfigSchema: z.ZodObject<{
|
|
|
115
116
|
dismissalPenalty: z.ZodDefault<z.ZodNumber>;
|
|
116
117
|
}, z.core.$strip>>;
|
|
117
118
|
}, z.core.$strip>;
|
|
119
|
+
export type ExperientialConfig = z.infer<typeof ExperientialConfigSchema>;
|
|
120
|
+
/** THE-1099 (GH #964 part 2): the ONE place `allowFeedbackInReadOnly && logRetrievals` is
|
|
121
|
+
* computed — every consumer (server-runtime.ts's `toolVisibility.allowReadOnlyDerivedTelemetry`
|
|
122
|
+
* wiring, boot-notices.ts's boot-line) calls this rather than restating the AND, so the two can
|
|
123
|
+
* never read different answers to "is the exemption live right now". `logRetrievals` is required
|
|
124
|
+
* because with it false there are no `chunk_retrievals` rows for `record_retrieval_feedback` to
|
|
125
|
+
* update — the exemption would be live but inert, which is a confusing thing for a boot line or
|
|
126
|
+
* a dispatch decision to imply. */
|
|
127
|
+
export declare function isFeedbackExemptFromReadOnly(experiential: Pick<ExperientialConfig, "allowFeedbackInReadOnly" | "logRetrievals">): boolean;
|
|
118
128
|
//# sourceMappingURL=retrieval.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieval.schema.d.ts","sourceRoot":"","sources":["../../src/config/retrieval.schema.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,oFAAoF;AACpF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0WhC,CAAC;AAEH;;;;0DAI0D;AAC1D,eAAO,MAAM,uBAAuB;;;;iBAQlC,CAAC;AAEH;yEACyE;AACzE,eAAO,MAAM,mBAAmB;;;;;;;;;;iBA+B9B,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"retrieval.schema.d.ts","sourceRoot":"","sources":["../../src/config/retrieval.schema.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,oFAAoF;AACpF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0WhC,CAAC;AAEH;;;;0DAI0D;AAC1D,eAAO,MAAM,uBAAuB;;;;iBAQlC,CAAC;AAEH;yEACyE;AACzE,eAAO,MAAM,mBAAmB;;;;;;;;;;iBA+B9B,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqdnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;;;;oCAMoC;AACpC,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,IAAI,CAAC,kBAAkB,EAAE,yBAAyB,GAAG,eAAe,CAAC,GAClF,OAAO,CAET"}
|
|
@@ -79,7 +79,7 @@ export const RetrievalConfigSchema = z.object({
|
|
|
79
79
|
mode: z
|
|
80
80
|
.enum(["cosine", "zMargin"])
|
|
81
81
|
.default("cosine")
|
|
82
|
-
.describe("Which hardness rule gates the rerank: absolute top-1 cosine, or the model-agnostic z-margin. Default `cosine` preserves the shipped behaviour; `zMargin` is
|
|
82
|
+
.describe("Which hardness rule gates the rerank: absolute top-1 cosine, or the model-agnostic z-margin. Default `cosine` preserves the shipped behaviour; `zMargin` is a model-agnostic alternative that has never been the production default."),
|
|
83
83
|
hardTop1: z
|
|
84
84
|
.number()
|
|
85
85
|
.min(0)
|
|
@@ -232,7 +232,7 @@ export const RetrievalConfigSchema = z.object({
|
|
|
232
232
|
.describe("Strength of the tilt, clamped to [0,1] so stream weights stay within [0,2] — an over-unity gain would drive a weight negative and invert its ranking rather than just reweight it."),
|
|
233
233
|
})
|
|
234
234
|
.prefault({})
|
|
235
|
-
.describe("Adaptive per-stream RRF weighting
|
|
235
|
+
.describe("Adaptive per-stream RRF weighting: tilts dense vs lexical/sparse stream weight by per-query lexical specificity. Off by default."),
|
|
236
236
|
/** THE-497: the in-process query-product cache. Keyed by the vault generation (THE-496) + the
|
|
237
237
|
* caller's ACL fingerprint + the query text + the full retrieval option set, so a hit is only
|
|
238
238
|
* ever the SAME caller re-asking the SAME question of an UNCHANGED vault under the SAME
|
|
@@ -261,7 +261,7 @@ export const RetrievalConfigSchema = z.object({
|
|
|
261
261
|
.describe("Entry lifetime. Bounds staleness from inputs the key cannot see: wall-clock recency decay, and derived state (densified edges, activation scores) written by jobs that do not bump the vault generation."),
|
|
262
262
|
})
|
|
263
263
|
.prefault({})
|
|
264
|
-
.describe("
|
|
264
|
+
.describe("In-process query-product cache. Off by default; a hit requires the same caller, query, vault generation and retrieval configuration."),
|
|
265
265
|
/** THE-628 (first PR): note-level (leaf) summary tier for global/thematic queries a chunk-only
|
|
266
266
|
* index has no answer for ("what are the main themes in my vault"). A summary is generated per
|
|
267
267
|
* note at index time (gateway `extract` role), embedded, and stored in `note_summaries` keyed on
|
|
@@ -280,7 +280,7 @@ export const RetrievalConfigSchema = z.object({
|
|
|
280
280
|
enabled: z
|
|
281
281
|
.boolean()
|
|
282
282
|
.default(false)
|
|
283
|
-
.describe("Generate + retrieve note-level summaries
|
|
283
|
+
.describe("Generate + retrieve note-level summaries. Off ships the mechanism dark: zero gateway calls at index time, no summary candidates at retrieval time. Gated on a pre-registered global-query eval, not built here."),
|
|
284
284
|
model: z
|
|
285
285
|
.string()
|
|
286
286
|
.optional()
|
|
@@ -306,7 +306,7 @@ export const RetrievalConfigSchema = z.object({
|
|
|
306
306
|
enabled: z
|
|
307
307
|
.boolean()
|
|
308
308
|
.default(false)
|
|
309
|
-
.describe("Generate + retrieve cluster-level (tier-2/RAPTOR) summaries
|
|
309
|
+
.describe("Generate + retrieve cluster-level (tier-2/RAPTOR) summaries. Off ships the mechanism dark: zero gateway/embed calls at the offline cluster pass, no cluster_summary candidates at retrieval time. Gated on the SAME pre-registered global-query eval as the note-level tier."),
|
|
310
310
|
maxConcurrency: z
|
|
311
311
|
.number()
|
|
312
312
|
.int()
|
|
@@ -315,10 +315,10 @@ export const RetrievalConfigSchema = z.object({
|
|
|
315
315
|
.describe("In-flight extract() calls across clusters during a cluster-summary pass. Same 8-16 recommended range as the note-level tier."),
|
|
316
316
|
})
|
|
317
317
|
.prefault({})
|
|
318
|
-
.describe("
|
|
318
|
+
.describe("Cluster-level (tier-2) summary tier (mechanism only, dark by default). Independent enable flag from the note-level tier above — see this block's comment."),
|
|
319
319
|
})
|
|
320
320
|
.prefault({})
|
|
321
|
-
.describe("
|
|
321
|
+
.describe("Note-level summary tier (mechanism only, dark by default). See the block comment for the eval gate this is built ahead of."),
|
|
322
322
|
});
|
|
323
323
|
/** Metadata-prior (authority-boost) rule: add `boost` to the fused score of a result whose note
|
|
324
324
|
* frontmatter[field] === value. Ported from the retired KMS/vault-sync hardcoded prior
|
|
@@ -375,6 +375,22 @@ export const ExperientialConfigSchema = z.object({
|
|
|
375
375
|
.boolean()
|
|
376
376
|
.default(true)
|
|
377
377
|
.describe("Append serve-path retrieval events (chunk id, rank, score, query text, surface) to experiential.db. Local-only telemetry feeding activation recompute and usage stats; eval runs never log."),
|
|
378
|
+
/** THE-1099 (GH #964 part 2): let `record_retrieval_feedback` — and only it, enumerated by name
|
|
379
|
+
* in mcp/visibility.ts's READ_ONLY_DERIVED_TELEMETRY_EXEMPT_TOOLS — bypass the `acl.readOnly`
|
|
380
|
+
* kill switch and `toolVisibility.requireReadOnly` hiding. Its writes land in
|
|
381
|
+
* `chunk_retrievals` in experiential.db, the derived-cognition plane (SECURITY.md; THE-563/564),
|
|
382
|
+
* never in authored vault content, so a caller that must keep the vault itself read-only can
|
|
383
|
+
* still close the retrieval-feedback loop the server's own instructions ask for.
|
|
384
|
+
*
|
|
385
|
+
* Default false: nothing changes for an existing config. Requires `logRetrievals: true` as
|
|
386
|
+
* well — with it false there are no `chunk_retrievals` rows for feedback to update, so the
|
|
387
|
+
* exemption is inert and the tool stays hidden/blocked exactly as before. `write:workspace`
|
|
388
|
+
* stays required for scoped-JWT callers either way; this setting relaxes the read-only
|
|
389
|
+
* POLICIES, not authorization. */
|
|
390
|
+
allowFeedbackInReadOnly: z
|
|
391
|
+
.boolean()
|
|
392
|
+
.default(false)
|
|
393
|
+
.describe("Exempt record_retrieval_feedback (only) from acl.readOnly and toolVisibility.requireReadOnly, because its writes are derived telemetry in experiential.db, never authored vault content. Default false. Needs logRetrievals: true as well — otherwise there is nothing for it to update and the exemption is inert. The write:workspace scope requirement is unchanged."),
|
|
378
394
|
/** THE-228: capture every dispatch outcome as an agent_episodes row (action axis: tool,
|
|
379
395
|
* status, duration, sizes, hashes, attribution — no payloads). Local-only work-memory in
|
|
380
396
|
* experiential.db; the sleep-time evaluator stamps retrieval-eligibility. */
|
|
@@ -483,7 +499,7 @@ export const ExperientialConfigSchema = z.object({
|
|
|
483
499
|
activationRerank: z
|
|
484
500
|
.boolean()
|
|
485
501
|
.default(false)
|
|
486
|
-
.describe("Apply the ACT-R cached-activation-score signal to graph search ranking: builds the lookup, threads it to every M7 graphSearch call, and enables the bounded bubble pass that composes it into the fused order (each item moves at most one position). Ships off; the A/B that would justify turning it on
|
|
502
|
+
.describe("Apply the ACT-R cached-activation-score signal to graph search ranking: builds the lookup, threads it to every M7 graphSearch call, and enables the bounded bubble pass that composes it into the fused order (each item moves at most one position). Ships off; the A/B that would justify turning it on has not shipped."),
|
|
487
503
|
/** THE-644: fold the RETRIEVAL-level citation verdict (`chunk_retrievals.citation_state` /
|
|
488
504
|
* `cited_in_response`) into the deterministic `preferred.search_mode` counter alongside the
|
|
489
505
|
* existing episode-level `task_result` evidence — so a search-family tool whose results are
|
|
@@ -670,10 +686,10 @@ export const ExperientialConfigSchema = z.object({
|
|
|
670
686
|
}
|
|
671
687
|
})
|
|
672
688
|
.optional()
|
|
673
|
-
.describe("
|
|
689
|
+
.describe("Opt-in judge provider for the citation-inference stage-2 verdict. Absent -> today's behaviour unchanged (the gateway `judge` role when configured, or stage-1-only mode)."),
|
|
674
690
|
})
|
|
675
691
|
.prefault({})
|
|
676
|
-
.describe("
|
|
692
|
+
.describe("Scheduled citation-inference pass over a transcript index. Needs an out-of-tree producer for transcriptIndex — no MCP surface gives a server the assistant's answer."),
|
|
677
693
|
/** THE-719: the scheduled coverage-gap sweep. `detectGaps` had exactly one caller — the offline
|
|
678
694
|
* `obsidian-tc gaps` CLI — so `gap_reports` held 0 rows and the THE-611 read tool had nothing to
|
|
679
695
|
* read: correct code, complete tests, no scheduled caller.
|
|
@@ -703,7 +719,7 @@ export const ExperientialConfigSchema = z.object({
|
|
|
703
719
|
.describe("Upper bound on queries per sweep. The sweep draws the most recent DISTINCT logged queries from chunk_retrievals, so this caps both gateway cost and how far back a single pass reaches."),
|
|
704
720
|
})
|
|
705
721
|
.prefault({})
|
|
706
|
-
.describe("
|
|
722
|
+
.describe("Scheduled coverage-gap sweep over recently logged queries. Advisory only — nothing auto-tunes retrieval config from its own gap measurements."),
|
|
707
723
|
/** THE-634: the scheduled proactive-advisory sweep — the caller `scoreAgainstGoals` +
|
|
708
724
|
* `selectAdvisories` (PR #779, `experiential/advisory.ts` + `experiential/advisory-policy.ts`)
|
|
709
725
|
* never had. Same shape as citationInfer/gapSweep above and the same lesson: correct code,
|
|
@@ -751,6 +767,16 @@ export const ExperientialConfigSchema = z.object({
|
|
|
751
767
|
.describe("Budget removed per dismissal (a -1 stamped through record_retrieval_feedback on an advisory row). At 1, five dismissals exhaust a maxPerSession of five."),
|
|
752
768
|
})
|
|
753
769
|
.prefault({})
|
|
754
|
-
.describe("
|
|
770
|
+
.describe("Scheduled proactive-advisory sweep over goal-anchored candidates (vault-watcher note changes, open contradictions, recent syntheses). Publishes into subscriptions/listen for modern-era (2026-07-28) sessions only; legacy-era sessions — the LiteLLM-fronted production majority — receive no delivery attempt, by design. See docs/MCP-COMPATIBILITY.md."),
|
|
755
771
|
});
|
|
772
|
+
/** THE-1099 (GH #964 part 2): the ONE place `allowFeedbackInReadOnly && logRetrievals` is
|
|
773
|
+
* computed — every consumer (server-runtime.ts's `toolVisibility.allowReadOnlyDerivedTelemetry`
|
|
774
|
+
* wiring, boot-notices.ts's boot-line) calls this rather than restating the AND, so the two can
|
|
775
|
+
* never read different answers to "is the exemption live right now". `logRetrievals` is required
|
|
776
|
+
* because with it false there are no `chunk_retrievals` rows for `record_retrieval_feedback` to
|
|
777
|
+
* update — the exemption would be live but inert, which is a confusing thing for a boot line or
|
|
778
|
+
* a dispatch decision to imply. */
|
|
779
|
+
export function isFeedbackExemptFromReadOnly(experiential) {
|
|
780
|
+
return experiential.allowFeedbackInReadOnly && experiential.logRetrievals;
|
|
781
|
+
}
|
|
756
782
|
//# sourceMappingURL=retrieval.schema.js.map
|