@saasontools/strauss-kb 0.1.17 → 0.1.18
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/ARCHITECTURE.md +26 -0
- package/README.md +31 -3
- package/dist/{chunk-ZKIQOBHT.js → chunk-GSOTMWZZ.js} +905 -147
- package/dist/chunk-GSOTMWZZ.js.map +1 -0
- package/dist/{chunk-RMJUGTAQ.js → chunk-IOIUS26S.js} +2 -2
- package/dist/{chunk-SA3A2SPY.js → chunk-ROGVYSMV.js} +2 -2
- package/dist/cli-main.cjs +937 -184
- package/dist/cli-main.cjs.map +1 -1
- package/dist/cli-main.js +2 -2
- package/dist/index.cjs +914 -153
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +291 -5
- package/dist/index.d.ts +291 -5
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp-main.cjs +930 -177
- package/dist/mcp-main.cjs.map +1 -1
- package/dist/mcp-main.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-ZKIQOBHT.js.map +0 -1
- /package/dist/{chunk-RMJUGTAQ.js.map → chunk-IOIUS26S.js.map} +0 -0
- /package/dist/{chunk-SA3A2SPY.js.map → chunk-ROGVYSMV.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -68,6 +68,10 @@ declare const kbAnchorSchema: z.ZodObject<{
|
|
|
68
68
|
repo: z.ZodOptional<z.ZodString>;
|
|
69
69
|
ref: z.ZodOptional<z.ZodString>;
|
|
70
70
|
hash: z.ZodOptional<z.ZodString>;
|
|
71
|
+
hash_kind: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
raw: "raw";
|
|
73
|
+
ast: "ast";
|
|
74
|
+
}>>;
|
|
71
75
|
resolved_at: z.ZodOptional<z.ZodString>;
|
|
72
76
|
lines: z.ZodOptional<z.ZodNumber>;
|
|
73
77
|
resolver: z.ZodOptional<z.ZodEnum<{
|
|
@@ -142,6 +146,10 @@ declare const kbRecordFrontmatterSchema: z.ZodObject<{
|
|
|
142
146
|
repo: z.ZodOptional<z.ZodString>;
|
|
143
147
|
ref: z.ZodOptional<z.ZodString>;
|
|
144
148
|
hash: z.ZodOptional<z.ZodString>;
|
|
149
|
+
hash_kind: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
raw: "raw";
|
|
151
|
+
ast: "ast";
|
|
152
|
+
}>>;
|
|
145
153
|
resolved_at: z.ZodOptional<z.ZodString>;
|
|
146
154
|
lines: z.ZodOptional<z.ZodNumber>;
|
|
147
155
|
resolver: z.ZodOptional<z.ZodEnum<{
|
|
@@ -234,12 +242,23 @@ interface AnchorResolver {
|
|
|
234
242
|
/** The richer verdict the chain uses; defaults to `resolve`. */
|
|
235
243
|
attempt?(source: string, symbol: string, file?: string): ResolverAttempt;
|
|
236
244
|
resolve(source: string, symbol: string, file?: string): ResolvedSymbol | null;
|
|
245
|
+
/**
|
|
246
|
+
* The span's normalised token stream — comments dropped, runs of whitespace
|
|
247
|
+
* collapsed — or `null` when this resolver cannot parse the text.
|
|
248
|
+
*
|
|
249
|
+
* Only a resolver that understands the language can offer one, which is why
|
|
250
|
+
* it is optional: a text heuristic normalising by guess would call two
|
|
251
|
+
* different programs equal.
|
|
252
|
+
*/
|
|
253
|
+
normalize?(text: string, file?: string): string | null;
|
|
237
254
|
}
|
|
238
255
|
/** A resolved span, and which resolver produced it. */
|
|
239
256
|
type AnchorResolution = {
|
|
240
257
|
ok: true;
|
|
241
258
|
span: ResolvedSymbol;
|
|
242
259
|
resolver?: AnchorResolverName;
|
|
260
|
+
/** The span's token stream, when the resolver that spanned it can parse. */
|
|
261
|
+
normalized?: string;
|
|
243
262
|
} | {
|
|
244
263
|
ok: false;
|
|
245
264
|
reason: AnchorUnresolvedReason;
|
|
@@ -272,6 +291,25 @@ type AnchorDriftReason = "resolver-changed";
|
|
|
272
291
|
* commit it was taken from, and the code has moved since.
|
|
273
292
|
*/
|
|
274
293
|
type RemoteAnchorState = "matches-ref" | "drifted-from-ref" | "drifted-on-default";
|
|
294
|
+
/** What `hash` was taken over. Absent on an anchor means `raw`. */
|
|
295
|
+
type AnchorHashKind = "raw" | "ast";
|
|
296
|
+
/**
|
|
297
|
+
* How an anchor's code changed, once the bytes are known to differ.
|
|
298
|
+
*
|
|
299
|
+
* The classes a machine can settle, so a reader only sees the ones it cannot:
|
|
300
|
+
* `moved` and `cosmetic` are answered and closed, `gone` and `changed` are
|
|
301
|
+
* handed on. Deliberately shallow — whether the record's *claim* still holds
|
|
302
|
+
* is a reading, and no hash can stand in for one.
|
|
303
|
+
*/
|
|
304
|
+
declare const KB_DRIFT_CLASSES: readonly ["moved", "cosmetic", "gone", "changed"];
|
|
305
|
+
type KbDriftClass = (typeof KB_DRIFT_CLASSES)[number];
|
|
306
|
+
/** Where a `moved` anchor's stored hash turned up. */
|
|
307
|
+
type KbDriftMovedTo = {
|
|
308
|
+
file: string;
|
|
309
|
+
symbol?: string;
|
|
310
|
+
startLine: number;
|
|
311
|
+
endLine: number;
|
|
312
|
+
};
|
|
275
313
|
type KbAnchorDriftEntry = {
|
|
276
314
|
file: string;
|
|
277
315
|
symbol?: string;
|
|
@@ -286,6 +324,17 @@ type KbAnchorDriftEntry = {
|
|
|
286
324
|
/** Set only when the anchor was resolved against another repository. */
|
|
287
325
|
repo?: string;
|
|
288
326
|
remoteState?: RemoteAnchorState;
|
|
327
|
+
/** What the compared hashes were taken over. */
|
|
328
|
+
hashKind?: AnchorHashKind;
|
|
329
|
+
/**
|
|
330
|
+
* Provisional: `gone` or `changed`, the two a hash comparison alone can
|
|
331
|
+
* settle. `moved` and `cosmetic` cost a repository search and a git read, so
|
|
332
|
+
* `classifyDrift` refines this on the reassessment path rather than on every
|
|
333
|
+
* `load`.
|
|
334
|
+
*/
|
|
335
|
+
class?: KbDriftClass;
|
|
336
|
+
/** Set by `classifyDrift` when the class is `moved`. */
|
|
337
|
+
movedTo?: KbDriftMovedTo;
|
|
289
338
|
};
|
|
290
339
|
type AnchorRead = {
|
|
291
340
|
ok: true;
|
|
@@ -550,6 +599,12 @@ type KbWarningAnchor = {
|
|
|
550
599
|
/** Set only for an anchor resolved against another repository. */
|
|
551
600
|
repo?: string;
|
|
552
601
|
remoteState?: string;
|
|
602
|
+
/**
|
|
603
|
+
* `gone` or `changed` — what a hash comparison alone can settle. `moved` and
|
|
604
|
+
* `cosmetic` cost a repository search and a git read, so they are
|
|
605
|
+
* `kb_reassess`'s answer, not a read path's.
|
|
606
|
+
*/
|
|
607
|
+
class?: KbDriftClass;
|
|
553
608
|
};
|
|
554
609
|
type KbStanding = "current" | "superseded" | "rejected" | "unsettled" | "open";
|
|
555
610
|
type KbAdjudicated = {
|
|
@@ -965,6 +1020,15 @@ type KbStampResult = {
|
|
|
965
1020
|
/** Newest `generated.at` across the base, or null when none carries one. */
|
|
966
1021
|
newestAt: string | null;
|
|
967
1022
|
records: KbRecordStamp[];
|
|
1023
|
+
/**
|
|
1024
|
+
* Records with at least one anchor whose code no longer matches its hash.
|
|
1025
|
+
*
|
|
1026
|
+
* Outside the digest, and deliberately: drift is a fact about the working
|
|
1027
|
+
* tree, not about the base's content, and folding it in would make a stamp
|
|
1028
|
+
* change every time someone checked out a branch. `null` when the drift pass
|
|
1029
|
+
* could not run — an unknown count, which is not zero.
|
|
1030
|
+
*/
|
|
1031
|
+
drifted: number | null;
|
|
968
1032
|
};
|
|
969
1033
|
type KbWriteInput = {
|
|
970
1034
|
type: string;
|
|
@@ -1136,11 +1200,16 @@ declare class KbStore {
|
|
|
1136
1200
|
}): Promise<KbLoadResult>;
|
|
1137
1201
|
/**
|
|
1138
1202
|
* `load`'s digest without `load`'s bodies — the same records, adjudicated
|
|
1139
|
-
* the same way, handed back as a stamp.
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1203
|
+
* the same way, handed back as a stamp.
|
|
1204
|
+
*
|
|
1205
|
+
* Drift is counted but kept out of the digest, which is what lets the reload
|
|
1206
|
+
* hook ask one question and get two answers: whether the base moved, and
|
|
1207
|
+
* whether the code under it did. A `load` and a `stamp` of the same base
|
|
1208
|
+
* still agree on the digest, because no warning has ever reached it.
|
|
1142
1209
|
*/
|
|
1143
|
-
stamp(bundlePath: string
|
|
1210
|
+
stamp(bundlePath: string, options?: {
|
|
1211
|
+
repoRoot?: string;
|
|
1212
|
+
}): Promise<KbStampResult>;
|
|
1144
1213
|
/** How a position was arrived at, as a timeline. See `trace.ts`. */
|
|
1145
1214
|
trace(bundlePath: string, seedId: string, options?: KbTraceOptions): Promise<KbTraceStep[]>;
|
|
1146
1215
|
/** Every record named in one line each. See `catalog.ts`. */
|
|
@@ -1421,6 +1490,32 @@ declare class TreeSitterResolver implements AnchorResolver {
|
|
|
1421
1490
|
resolve(source: string, symbol: string, file?: string): ResolvedSymbol | null;
|
|
1422
1491
|
/** Parsed trees are keyed by content hash, so an unchanged file parses once. */
|
|
1423
1492
|
private parse;
|
|
1493
|
+
/**
|
|
1494
|
+
* Every definition this file declares, as dotted symbol and span.
|
|
1495
|
+
*
|
|
1496
|
+
* The inverse of `attempt`: that asks "where is this name", this asks "what
|
|
1497
|
+
* names are here". `moved` needs the second — the stored hash has to be
|
|
1498
|
+
* looked for at every definition in the repository, and there is no name to
|
|
1499
|
+
* ask about, since the whole question is which name now carries that code.
|
|
1500
|
+
*/
|
|
1501
|
+
spans(source: string, file: string): {
|
|
1502
|
+
symbol: string;
|
|
1503
|
+
span: ResolvedSymbol;
|
|
1504
|
+
}[];
|
|
1505
|
+
/**
|
|
1506
|
+
* The token stream of a span: every leaf the parser sees, comments dropped,
|
|
1507
|
+
* joined by single spaces.
|
|
1508
|
+
*
|
|
1509
|
+
* This is what makes a reformat not be drift. Hashing it rather than the raw
|
|
1510
|
+
* text means indentation, line breaks, trailing commas the formatter moved,
|
|
1511
|
+
* and every comment above or inside the definition are outside the hash —
|
|
1512
|
+
* and a renamed identifier or a changed literal is still inside it, because
|
|
1513
|
+
* those are leaves.
|
|
1514
|
+
*
|
|
1515
|
+
* `null` when the file has no grammar, the grammar would not load, or the
|
|
1516
|
+
* text will not parse: no normalisation is better than a guessed one.
|
|
1517
|
+
*/
|
|
1518
|
+
normalize(text: string, file?: string): string | null;
|
|
1424
1519
|
/** Drops cached trees. Grammars stay loaded — they are immutable. */
|
|
1425
1520
|
reset(): void;
|
|
1426
1521
|
}
|
|
@@ -1520,6 +1615,10 @@ declare const composeInputSchema: z.ZodObject<{
|
|
|
1520
1615
|
repo: z.ZodOptional<z.ZodString>;
|
|
1521
1616
|
ref: z.ZodOptional<z.ZodString>;
|
|
1522
1617
|
hash: z.ZodOptional<z.ZodString>;
|
|
1618
|
+
hash_kind: z.ZodOptional<z.ZodEnum<{
|
|
1619
|
+
raw: "raw";
|
|
1620
|
+
ast: "ast";
|
|
1621
|
+
}>>;
|
|
1523
1622
|
resolved_at: z.ZodOptional<z.ZodString>;
|
|
1524
1623
|
lines: z.ZodOptional<z.ZodNumber>;
|
|
1525
1624
|
resolver: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2128,6 +2227,10 @@ declare const decisionInputSchema: z.ZodObject<{
|
|
|
2128
2227
|
repo: z.ZodOptional<z.ZodString>;
|
|
2129
2228
|
ref: z.ZodOptional<z.ZodString>;
|
|
2130
2229
|
hash: z.ZodOptional<z.ZodString>;
|
|
2230
|
+
hash_kind: z.ZodOptional<z.ZodEnum<{
|
|
2231
|
+
raw: "raw";
|
|
2232
|
+
ast: "ast";
|
|
2233
|
+
}>>;
|
|
2131
2234
|
resolved_at: z.ZodOptional<z.ZodString>;
|
|
2132
2235
|
lines: z.ZodOptional<z.ZodNumber>;
|
|
2133
2236
|
resolver: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2253,6 +2356,189 @@ type KbCommand<Shape extends z.ZodRawShape = z.ZodRawShape> = {
|
|
|
2253
2356
|
declare const KB_COMMANDS: KbCommand[];
|
|
2254
2357
|
declare const KB_COMMANDS_BY_NAME: Map<string, KbCommand>;
|
|
2255
2358
|
|
|
2359
|
+
/** Where a recovered file came from, so a packet can say how far back it looked. */
|
|
2360
|
+
type OldSourceOrigin =
|
|
2361
|
+
/** `git show <anchor.ref>:<file>` — the rev the record itself named. */
|
|
2362
|
+
{
|
|
2363
|
+
kind: "ref";
|
|
2364
|
+
ref: string;
|
|
2365
|
+
}
|
|
2366
|
+
/** The last commit touching the path before `resolved_at`. */
|
|
2367
|
+
| {
|
|
2368
|
+
kind: "history";
|
|
2369
|
+
ref: string;
|
|
2370
|
+
};
|
|
2371
|
+
|
|
2372
|
+
type MovedSearch = {
|
|
2373
|
+
/**
|
|
2374
|
+
* Where this anchor's stored hash turned up, or `undefined`.
|
|
2375
|
+
*
|
|
2376
|
+
* Shared across every anchor of a run: one `git ls-files`, one parse cache,
|
|
2377
|
+
* one set of loaded grammars. A `doctor --drifted` sweep over a base whose
|
|
2378
|
+
* records anchor into the same few languages parses each candidate once, not
|
|
2379
|
+
* once per drifted anchor.
|
|
2380
|
+
*/
|
|
2381
|
+
find(anchor: KbAnchor): Promise<KbDriftMovedTo | undefined>;
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2384
|
+
/**
|
|
2385
|
+
* Turning "the bytes changed" into one of four answers, two of which end the
|
|
2386
|
+
* matter.
|
|
2387
|
+
*
|
|
2388
|
+
* The order is not arbitrary: `moved` is asked first because it is the only
|
|
2389
|
+
* class that needs no history at all, and `cosmetic` second because it is the
|
|
2390
|
+
* only one that needs the old text. What survives both is what a reader has to
|
|
2391
|
+
* read — and the whole point of asking the cheap questions first is that most
|
|
2392
|
+
* drift never reaches them.
|
|
2393
|
+
*
|
|
2394
|
+
* Everything here is read-only. Rebaselining a `moved` anchor is a write, and
|
|
2395
|
+
* writes belong to the verb the caller named.
|
|
2396
|
+
*/
|
|
2397
|
+
type ClassifiedAnchor = {
|
|
2398
|
+
anchor: KbAnchor;
|
|
2399
|
+
entry: KbAnchorDriftEntry;
|
|
2400
|
+
/** Resolved class. Never `undefined` — every reported anchor gets one. */
|
|
2401
|
+
class: KbDriftClass;
|
|
2402
|
+
/** The anchored text as it stands now. Absent when the class is `gone`. */
|
|
2403
|
+
newText?: string;
|
|
2404
|
+
/** The anchored text as it was, when history could produce it. */
|
|
2405
|
+
oldText?: string;
|
|
2406
|
+
oldOrigin?: OldSourceOrigin;
|
|
2407
|
+
};
|
|
2408
|
+
type ClassifyOptions = {
|
|
2409
|
+
/** Test seam: replaces the disk reader. */
|
|
2410
|
+
reader?: AnchorFileReader;
|
|
2411
|
+
/** Skip the history read. `cosmetic` cannot be reached without it. */
|
|
2412
|
+
withHistory?: boolean;
|
|
2413
|
+
/**
|
|
2414
|
+
* The run's shared `moved` search. A sweep classifying many records passes
|
|
2415
|
+
* one, so the repository is listed once and each candidate file is parsed
|
|
2416
|
+
* once for the whole sweep rather than once per record.
|
|
2417
|
+
*/
|
|
2418
|
+
search?: MovedSearch;
|
|
2419
|
+
};
|
|
2420
|
+
/**
|
|
2421
|
+
* Refines one record's drift entries. Anchors that matched, or that name
|
|
2422
|
+
* another repository, are not drift and never appear.
|
|
2423
|
+
*/
|
|
2424
|
+
declare function classifyDrift(repoRoot: string, record: KbRecord, entries: readonly KbAnchorDriftEntry[], options?: ClassifyOptions): Promise<ClassifiedAnchor[]>;
|
|
2425
|
+
|
|
2426
|
+
type UnifiedDiff = {
|
|
2427
|
+
/** `-`/`+`/` ` prefixed lines, with a `@@` header. */
|
|
2428
|
+
text: string;
|
|
2429
|
+
added: number;
|
|
2430
|
+
removed: number;
|
|
2431
|
+
/** Whether the cap cut it short. */
|
|
2432
|
+
truncated: boolean;
|
|
2433
|
+
};
|
|
2434
|
+
/**
|
|
2435
|
+
* One hunk, no context trimming: the two sides are already a symbol's span,
|
|
2436
|
+
* so the whole of both is the context a reader wants.
|
|
2437
|
+
*
|
|
2438
|
+
* The common subsequence is computed over line *hashes* through a simple
|
|
2439
|
+
* O(n·m) table. Spans are bounded by the anchor file cap, and a smarter
|
|
2440
|
+
* algorithm would be a second thing to be wrong about for a saving nobody can
|
|
2441
|
+
* measure at this size.
|
|
2442
|
+
*/
|
|
2443
|
+
declare function unifiedDiff(before: string, after: string, options?: {
|
|
2444
|
+
maxLines?: number;
|
|
2445
|
+
oldLabel?: string;
|
|
2446
|
+
newLabel?: string;
|
|
2447
|
+
}): UnifiedDiff;
|
|
2448
|
+
|
|
2449
|
+
/**
|
|
2450
|
+
* What a reader needs in order to decide whether a record still holds, without
|
|
2451
|
+
* opening the repository.
|
|
2452
|
+
*
|
|
2453
|
+
* A drift finding today says two hashes disagree, which is not a thing anyone
|
|
2454
|
+
* can judge. The packet is the same finding with the three pieces judgment
|
|
2455
|
+
* actually takes: what the record claims, what the code did, and what depends
|
|
2456
|
+
* on the answer. It stops there — the reading itself is the reader's, and
|
|
2457
|
+
* every default below is a starting point the protocol expects to be argued
|
|
2458
|
+
* with.
|
|
2459
|
+
*/
|
|
2460
|
+
type KbReassessDiff = {
|
|
2461
|
+
status: "ok";
|
|
2462
|
+
/** `ref` when the anchor pinned one, `history` when it was inferred. */
|
|
2463
|
+
source: "ref" | "history";
|
|
2464
|
+
/** The rev the old side was read at. */
|
|
2465
|
+
ref: string;
|
|
2466
|
+
unified: string;
|
|
2467
|
+
added: number;
|
|
2468
|
+
removed: number;
|
|
2469
|
+
truncated: boolean;
|
|
2470
|
+
}
|
|
2471
|
+
/** No committed text to diff against; see `readOldSource`. */
|
|
2472
|
+
| {
|
|
2473
|
+
status: "unrecoverable";
|
|
2474
|
+
};
|
|
2475
|
+
type KbReassessAnchor = {
|
|
2476
|
+
file: string;
|
|
2477
|
+
symbol?: string;
|
|
2478
|
+
class: KbDriftClass;
|
|
2479
|
+
reason?: string;
|
|
2480
|
+
storedHash: string;
|
|
2481
|
+
currentHash?: string;
|
|
2482
|
+
diffSize: number | null;
|
|
2483
|
+
movedTo?: KbDriftMovedTo;
|
|
2484
|
+
diff?: KbReassessDiff;
|
|
2485
|
+
};
|
|
2486
|
+
/**
|
|
2487
|
+
* What the type says about a record whose code changed under it.
|
|
2488
|
+
*
|
|
2489
|
+
* A `fact` is a claim about the world that the code was the evidence for, so
|
|
2490
|
+
* changed evidence presumptively unmakes it. A `decision` is a claim about a
|
|
2491
|
+
* choice, and the reasoning for a choice routinely outlives the code that
|
|
2492
|
+
* implemented it. Neither is a verdict — they are which way to lean while
|
|
2493
|
+
* reading, and naming the lean is what keeps it arguable.
|
|
2494
|
+
*/
|
|
2495
|
+
type KbReassessDefault = "presumed-invalidated" | "rationale-may-survive" | "review";
|
|
2496
|
+
type KbReassessPacket = {
|
|
2497
|
+
conceptId: string;
|
|
2498
|
+
title: string | null;
|
|
2499
|
+
type: string;
|
|
2500
|
+
standing: KbStanding;
|
|
2501
|
+
/** What breaks if this record is wrong — the record's `why`, stored as `description`. */
|
|
2502
|
+
why: string | null;
|
|
2503
|
+
/** The type's claim section — the sentence being reassessed. */
|
|
2504
|
+
claim: {
|
|
2505
|
+
section: string;
|
|
2506
|
+
text: string;
|
|
2507
|
+
} | null;
|
|
2508
|
+
anchors: KbReassessAnchor[];
|
|
2509
|
+
/**
|
|
2510
|
+
* The record's dependants. A fact that stopped holding did not stop holding
|
|
2511
|
+
* alone, and a reader deciding about it is deciding about these too.
|
|
2512
|
+
*/
|
|
2513
|
+
impact: {
|
|
2514
|
+
conceptId: string;
|
|
2515
|
+
title: string | null;
|
|
2516
|
+
standing: KbStanding;
|
|
2517
|
+
depth: number;
|
|
2518
|
+
}[];
|
|
2519
|
+
impactTruncated: boolean;
|
|
2520
|
+
default: KbReassessDefault;
|
|
2521
|
+
defaultNote: string;
|
|
2522
|
+
};
|
|
2523
|
+
type PacketOptions = ClassifyOptions & {
|
|
2524
|
+
/** Recover and render the old-vs-new span diff. Off by default: it reads git. */
|
|
2525
|
+
withDiff?: boolean;
|
|
2526
|
+
impact?: KbImpactResult;
|
|
2527
|
+
standing?: KbStanding;
|
|
2528
|
+
};
|
|
2529
|
+
/**
|
|
2530
|
+
* One record's packet, or `null` when nothing survived classification.
|
|
2531
|
+
*
|
|
2532
|
+
* A record whose every drifted anchor turned out to be `moved` or `cosmetic`
|
|
2533
|
+
* is a record with no reassessment work, and emitting an empty packet for it
|
|
2534
|
+
* would put it back in front of the reader the classification just cleared it
|
|
2535
|
+
* from.
|
|
2536
|
+
*/
|
|
2537
|
+
declare function reassessPacket(repoRoot: string, record: KbRecord, entries: readonly KbAnchorDriftEntry[], options?: PacketOptions): Promise<{
|
|
2538
|
+
packet: KbReassessPacket | null;
|
|
2539
|
+
classified: ClassifiedAnchor[];
|
|
2540
|
+
}>;
|
|
2541
|
+
|
|
2256
2542
|
/**
|
|
2257
2543
|
* A knowledge base's own MCP server, over stdio.
|
|
2258
2544
|
*
|
|
@@ -2385,4 +2671,4 @@ declare function parseMarkdownWithFrontmatter<S extends z.ZodType>(text: string,
|
|
|
2385
2671
|
frontmatter: ReturnType<S["safeParse"]>;
|
|
2386
2672
|
};
|
|
2387
2673
|
|
|
2388
|
-
export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, BaseError, CONTEXT_BEGIN, CONTEXT_END, CONTEXT_PROFILES, type ComposeInput, type ComposeLink, type ComposedRecord, DECISION_TYPE, DEFAULT_AGING_DAYS, DEFAULT_EXPIRING_DAYS, DEFAULT_LOAD_BUDGET, DEFAULT_PACK_HOPS, DEFAULT_PACK_MAX_NODES, DEFAULT_TYPED_LINK_RELS, DEFAULT_UNVERIFIED_DAYS, type DecisionInput, type DiffFile, type DiffHunk, type DiffMatch, type ErrorDetails, type ErrorProps, ErrorTypes, Fault, type Grammar, type GrammarManifest, type GrammarOptions, INDEX_FILE, KB_CAUSAL_LINK_RELS, KB_COMMANDS, KB_COMMANDS_BY_NAME, KB_CONCEPT_ID_PATTERN, KB_CONFIDENCES, KB_DIR, KB_DOCTOR_CHECKS, KB_EDGE_KINDS, KB_LINK_RELS, KB_MATERIALITIES, KB_RECORD_STATUSES, KB_RECORD_TYPES, KB_SLUG_PATTERN, type KbActorStamp, type KbAdjudicated, type KbAnchor, type KbAnchorDriftEntry, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbEdgeKind, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLoadResult, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMergedPin, type KbMergedPins, KbMissingFlagValueError, type KbNeighbour, KbPackBudgetExceededError, type KbPackOptions, type KbPackResult, type KbPackedRecord, type KbPin, type KbPinLayer, type KbPinOptions, type KbPinResult, type KbPinStatus, KbPinsMalformedError, type KbPinsManifest, type KbRecord, KbRecordAlreadyExistsError, type KbRecordFrontmatter, KbRecordNotFoundError, type KbRecordStatus, type KbRecordType, type KbRecordTypeSpec, type KbSearchLogger, KbSelfVerificationError, type KbSource, type KbStanding, KbStore, type KbSupersededStub, type KbSyncResult, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, assertBaseNotFrozen, backlinks, buildContext, catalog, composeDecisionRecord, composeInputSchema, composeLinkSchema, composeNoDecisionRecord, composeRecord, contextProfileBudgets, createKbMcpServer, decisionInputSchema, defaultAnchorResolvers, detectAnchorDrift, doctor, edgeNeighbours, ensureGrammar, grammarHints, grammarManifest, grammarsCacheRoot, hashAnchorText, impact, inboundIndex, indexIsStale, isCanonicalRepoUrl, isKbLinkRel, isKbRecordType, isNoDecisionRecord, kbActorStampSchema, kbAnchorSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogEntrySchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, loadQmd, matchToDiff, mergedContextBudgets, neighbours, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, readMergedPins, readPinsLayer, readRemoteAnchors, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, stringifyMarkdownWithFrontmatter, syncInstructions, toHookJson, trace, treeSitterLanguages, unpinBase, validateBundle };
|
|
2674
|
+
export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, BaseError, CONTEXT_BEGIN, CONTEXT_END, CONTEXT_PROFILES, type ClassifiedAnchor, type ComposeInput, type ComposeLink, type ComposedRecord, DECISION_TYPE, DEFAULT_AGING_DAYS, DEFAULT_EXPIRING_DAYS, DEFAULT_LOAD_BUDGET, DEFAULT_PACK_HOPS, DEFAULT_PACK_MAX_NODES, DEFAULT_TYPED_LINK_RELS, DEFAULT_UNVERIFIED_DAYS, type DecisionInput, type DiffFile, type DiffHunk, type DiffMatch, type ErrorDetails, type ErrorProps, ErrorTypes, Fault, type Grammar, type GrammarManifest, type GrammarOptions, INDEX_FILE, KB_CAUSAL_LINK_RELS, KB_COMMANDS, KB_COMMANDS_BY_NAME, KB_CONCEPT_ID_PATTERN, KB_CONFIDENCES, KB_DIR, KB_DOCTOR_CHECKS, KB_EDGE_KINDS, KB_LINK_RELS, KB_MATERIALITIES, KB_RECORD_STATUSES, KB_RECORD_TYPES, KB_SLUG_PATTERN, type KbActorStamp, type KbAdjudicated, type KbAnchor, type KbAnchorDriftEntry, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbEdgeKind, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLoadResult, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMergedPin, type KbMergedPins, KbMissingFlagValueError, type KbNeighbour, KbPackBudgetExceededError, type KbPackOptions, type KbPackResult, type KbPackedRecord, type KbPin, type KbPinLayer, type KbPinOptions, type KbPinResult, type KbPinStatus, KbPinsMalformedError, type KbPinsManifest, type KbReassessAnchor, type KbReassessDefault, type KbReassessDiff, type KbReassessPacket, type KbRecord, KbRecordAlreadyExistsError, type KbRecordFrontmatter, KbRecordNotFoundError, type KbRecordStatus, type KbRecordType, type KbRecordTypeSpec, type KbSearchLogger, KbSelfVerificationError, type KbSource, type KbStanding, KbStore, type KbSupersededStub, type KbSyncResult, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, assertBaseNotFrozen, backlinks, buildContext, catalog, classifyDrift, composeDecisionRecord, composeInputSchema, composeLinkSchema, composeNoDecisionRecord, composeRecord, contextProfileBudgets, createKbMcpServer, decisionInputSchema, defaultAnchorResolvers, detectAnchorDrift, doctor, edgeNeighbours, ensureGrammar, grammarHints, grammarManifest, grammarsCacheRoot, hashAnchorText, impact, inboundIndex, indexIsStale, isCanonicalRepoUrl, isKbLinkRel, isKbRecordType, isNoDecisionRecord, kbActorStampSchema, kbAnchorSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogEntrySchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, loadQmd, matchToDiff, mergedContextBudgets, neighbours, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, stringifyMarkdownWithFrontmatter, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
|