@saasontools/strauss-kb 0.1.23 → 0.3.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/ARCHITECTURE.md +12 -0
- package/README.md +4 -3
- package/dist/{chunk-5IPQVXCM.js → chunk-4AJGI6WN.js} +2 -2
- package/dist/{chunk-3EZ3PAPA.js → chunk-EOSRZHWY.js} +2 -2
- package/dist/{chunk-XENLCPL5.js → chunk-MC5LUSZ3.js} +7648 -483
- package/dist/chunk-MC5LUSZ3.js.map +1 -0
- package/dist/cli-main.cjs +7706 -546
- package/dist/cli-main.cjs.map +1 -1
- package/dist/cli-main.js +2 -2
- package/dist/index.cjs +7564 -400
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -50
- package/dist/index.d.ts +100 -50
- package/dist/index.js +13 -3
- package/dist/mcp-main.cjs +7700 -540
- package/dist/mcp-main.cjs.map +1 -1
- package/dist/mcp-main.js +2 -2
- package/package.json +2 -1
- package/dist/chunk-XENLCPL5.js.map +0 -1
- /package/dist/{chunk-5IPQVXCM.js.map → chunk-4AJGI6WN.js.map} +0 -0
- /package/dist/{chunk-3EZ3PAPA.js.map → chunk-EOSRZHWY.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -165,7 +165,7 @@ declare const kbLinkSchema: z.ZodObject<{
|
|
|
165
165
|
target: z.ZodString;
|
|
166
166
|
rel: z.ZodString;
|
|
167
167
|
}, z.core.$loose>;
|
|
168
|
-
declare const KB_RECORD_TYPES: readonly ["fact", "requirement", "constraint", "decision", "assumption", "open-question", "risk", "contract", "flow", "affected-system", "
|
|
168
|
+
declare const KB_RECORD_TYPES: readonly ["fact", "requirement", "constraint", "decision", "assumption", "open-question", "risk", "contract", "flow", "affected-system", "source-note"];
|
|
169
169
|
type KbRecordType = (typeof KB_RECORD_TYPES)[number];
|
|
170
170
|
/** Both halves of `<type>.<slug>` are kebab-case, and neither may be empty. */
|
|
171
171
|
declare const KB_SLUG_PATTERN: RegExp;
|
|
@@ -767,22 +767,10 @@ type KbRecordStamp = {
|
|
|
767
767
|
};
|
|
768
768
|
|
|
769
769
|
/**
|
|
770
|
-
* Edges a trace may follow
|
|
771
|
-
* `
|
|
772
|
-
* suits a bounded pack but floods a timeline.
|
|
773
|
-
*
|
|
774
|
-
* in its own body rather than in another record.
|
|
775
|
-
*
|
|
776
|
-
* `typed-link` is in, where `body-link` is out, because the two differ in how
|
|
777
|
-
* cheaply they are made. A body link is any markdown a writer happened to
|
|
778
|
-
* type; a `strauss_links` entry is a deliberate claim from a closed vocabulary
|
|
779
|
-
* about what this record depends on. That is exactly the kind of edge a
|
|
780
|
-
* timeline should follow — "we chose this because of that" is the history.
|
|
781
|
-
*
|
|
782
|
-
* Only the causal rels, though. `related_to` asserts no dependence and reaches
|
|
783
|
-
* whatever a writer thought worth mentioning, which is the same flooding
|
|
784
|
-
* `body-link` is excluded for; a bibliography is a neighbourhood's business
|
|
785
|
-
* (`pack`), not a history's.
|
|
770
|
+
* Edges a trace may follow: every kb-edges.ts kind, narrowed to the causal
|
|
771
|
+
* rels. `related_to` reaches whatever a writer thought worth mentioning, which
|
|
772
|
+
* suits a bounded pack but floods a timeline. `strauss_answered` carries no
|
|
773
|
+
* target id, so a question's resolution is not an edge.
|
|
786
774
|
*/
|
|
787
775
|
declare const TRACE_EDGES: readonly ["typed-link", "supersession", "anchor", "source"];
|
|
788
776
|
type KbTraceEdge = (typeof TRACE_EDGES)[number];
|
|
@@ -795,7 +783,7 @@ type KbTraceStep = {
|
|
|
795
783
|
};
|
|
796
784
|
type KbTraceOptions = {
|
|
797
785
|
edges?: readonly KbTraceEdge[];
|
|
798
|
-
/**
|
|
786
|
+
/** A trace is always bounded: supersession and shared anchors alone can reach the whole bundle. */
|
|
799
787
|
depth?: number;
|
|
800
788
|
};
|
|
801
789
|
/**
|
|
@@ -1918,7 +1906,7 @@ declare class TreeSitterResolver implements AnchorResolver {
|
|
|
1918
1906
|
/**
|
|
1919
1907
|
* What each record type is for, and the shape of its body.
|
|
1920
1908
|
*
|
|
1921
|
-
* A table rather than
|
|
1909
|
+
* A table rather than a composer module per type. The types differ only in which
|
|
1922
1910
|
* questions their body answers and where they start in the lifecycle; encoding
|
|
1923
1911
|
* that as data keeps the one composer honest and makes adding a type an edit
|
|
1924
1912
|
* rather than a file.
|
|
@@ -2609,32 +2597,20 @@ type KbClassifyResult = {
|
|
|
2609
2597
|
declare function classifyDiff(files: readonly KbClassifyFile[], options?: KbClassifyOptions): KbClassifiedFile[];
|
|
2610
2598
|
|
|
2611
2599
|
/**
|
|
2612
|
-
*
|
|
2613
|
-
*
|
|
2614
|
-
* Both walks — `trace` and `pack` — consume this module, so they cannot drift
|
|
2615
|
-
* into disagreeing about what makes two records neighbours, and a diagnostic
|
|
2616
|
-
* pass over the graph can reuse the same definition.
|
|
2617
|
-
*
|
|
2618
|
-
* There is no separate `related` kind: compose.ts renders `relatedConceptIds`
|
|
2619
|
-
* as body links (`Relates to [id](id.md).`), so in stored form a related edge
|
|
2620
|
-
* IS a body link, and a distinct kind would count the same markdown twice.
|
|
2621
|
-
*
|
|
2622
|
-
* `typed-link` is not that case, despite compose.ts also rendering a sentence
|
|
2623
|
-
* per link. The edge is `strauss_links` in the frontmatter — the authoritative,
|
|
2624
|
-
* typed form — and the sentence is its rendering for a reader that only knows
|
|
2625
|
-
* OKF. A record can carry the frontmatter without the prose (hand-written, or
|
|
2626
|
-
* from a producer we did not write), so reading only the body would miss it.
|
|
2627
|
-
* A pair connected both ways comes back with both kinds in `via`, which is the
|
|
2628
|
-
* honest answer: it was declared, and it was written about.
|
|
2600
|
+
* Every concept id this record's prose cites, itself excluded.
|
|
2629
2601
|
*
|
|
2630
|
-
*
|
|
2631
|
-
*
|
|
2632
|
-
* are symmetric: they hold between two records because both name the same
|
|
2633
|
-
* thing, so either end sees the other. Callers wanting the inbound half of a
|
|
2634
|
-
* typed edge use `kb-links/` (`kb_backlinks`, `kb_impact`) rather than this
|
|
2635
|
-
* module, which answers "what does this record point at".
|
|
2602
|
+
* Parsed to an mdast tree rather than matched by pattern: a link in a fence, an
|
|
2603
|
+
* indented block or a code span is an example, and only a parser knows which.
|
|
2636
2604
|
*/
|
|
2637
|
-
declare
|
|
2605
|
+
declare function bodyCitations(record: KbRecord): Set<string>;
|
|
2606
|
+
|
|
2607
|
+
/**
|
|
2608
|
+
* The edges between records in one bundle, defined once for `trace` and
|
|
2609
|
+
* `pack`. `typed-link` (`strauss_links`) is directed and the only edge a
|
|
2610
|
+
* record declares; the other three are symmetric. Prose is never walked; the
|
|
2611
|
+
* inbound half of a typed edge is `kb-links/`.
|
|
2612
|
+
*/
|
|
2613
|
+
declare const KB_EDGE_KINDS: readonly ["typed-link", "supersession", "anchor", "source"];
|
|
2638
2614
|
type KbEdgeKind = (typeof KB_EDGE_KINDS)[number];
|
|
2639
2615
|
type KbNeighbour = {
|
|
2640
2616
|
record: KbRecord;
|
|
@@ -2665,6 +2641,61 @@ declare function neighbours(from: KbRecord, bundle: KbRecord[], kinds?: readonly
|
|
|
2665
2641
|
*/
|
|
2666
2642
|
declare function edgeNeighbours(from: KbRecord, bundle: KbRecord[], kind: KbEdgeKind, linkRels?: readonly string[]): KbRecord[];
|
|
2667
2643
|
|
|
2644
|
+
/**
|
|
2645
|
+
* What a record explicitly points at — the question a consumer about to warn
|
|
2646
|
+
* or about to delete has to ask, where `kb-edges.ts` answers it for a walk and
|
|
2647
|
+
* `kb-links/` answers the causal inverse.
|
|
2648
|
+
*/
|
|
2649
|
+
/** One target a record points at, with every claim it makes about it. */
|
|
2650
|
+
type KbOutboundReference = {
|
|
2651
|
+
target: string;
|
|
2652
|
+
/** Rels declared for this target, in declaration order. Never empty. */
|
|
2653
|
+
rels: string[];
|
|
2654
|
+
};
|
|
2655
|
+
/** A record that still holds, pointing at one that does not. */
|
|
2656
|
+
type KbStaleReference = {
|
|
2657
|
+
from: string;
|
|
2658
|
+
target: string;
|
|
2659
|
+
/** Always `superseded` or `rejected` — the standings that stopped holding. */
|
|
2660
|
+
targetStanding: Extract<KbStanding, "superseded" | "rejected">;
|
|
2661
|
+
rels: string[];
|
|
2662
|
+
/** The replacement chain, nearest first, limited to ids the bundle holds. */
|
|
2663
|
+
replacedBy: string[];
|
|
2664
|
+
};
|
|
2665
|
+
/** A record that still holds, pointing at the record being reassessed. */
|
|
2666
|
+
type KbLiveReference = {
|
|
2667
|
+
from: string;
|
|
2668
|
+
title: string | null;
|
|
2669
|
+
standing: KbStanding;
|
|
2670
|
+
rels: string[];
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2673
|
+
/**
|
|
2674
|
+
* Every record this one points at through `strauss_links`, each target once,
|
|
2675
|
+
* with every distinct rel. An unknown rel is skipped, as every walk skips it;
|
|
2676
|
+
* shared anchors and sources are co-location, not reference.
|
|
2677
|
+
*/
|
|
2678
|
+
declare function outboundReferences(record: KbRecord): KbOutboundReference[];
|
|
2679
|
+
|
|
2680
|
+
/**
|
|
2681
|
+
* Every stale reference in the bundle, in bundle order, then in each record's
|
|
2682
|
+
* own reference order.
|
|
2683
|
+
*/
|
|
2684
|
+
declare function staleReferences(bundle: KbRecord[], standings: Map<string, KbStanding>): KbStaleReference[];
|
|
2685
|
+
/**
|
|
2686
|
+
* One record's stale references.
|
|
2687
|
+
*
|
|
2688
|
+
* A record already out of force is asked nothing: what a superseded record
|
|
2689
|
+
* points at is history, and repairing it would put a finding on every record
|
|
2690
|
+
* the base has already replaced.
|
|
2691
|
+
*/
|
|
2692
|
+
declare function staleReferencesFrom(record: KbRecord, byId: Map<string, KbRecord>, standings: Map<string, KbStanding>): KbStaleReference[];
|
|
2693
|
+
/**
|
|
2694
|
+
* Who still points at this record, among the records that still hold: one hop
|
|
2695
|
+
* and every rel, where `kb_impact` walks causal dependence transitively.
|
|
2696
|
+
*/
|
|
2697
|
+
declare function liveReferencesTo(targetId: string, bundle: KbRecord[], standings: Map<string, KbStanding>): KbLiveReference[];
|
|
2698
|
+
|
|
2668
2699
|
/** `error` fails the check; `warning` does not. */
|
|
2669
2700
|
type KbValidationSeverity = "error" | "warning";
|
|
2670
2701
|
type KbValidationProblem = {
|
|
@@ -2710,6 +2741,11 @@ type KbDoctorFinding = {
|
|
|
2710
2741
|
status: KbRecordStatus;
|
|
2711
2742
|
/** Why this record is in this group, in one phrase a reader can act on. */
|
|
2712
2743
|
note: string;
|
|
2744
|
+
/**
|
|
2745
|
+
* The edge behind a `superseded-but-cited` finding, for a consumer that acts
|
|
2746
|
+
* on it rather than prints it. Absent on every other check.
|
|
2747
|
+
*/
|
|
2748
|
+
reference?: KbStaleReference;
|
|
2713
2749
|
};
|
|
2714
2750
|
type KbDoctorGroup = {
|
|
2715
2751
|
check: KbDoctorCheck;
|
|
@@ -3215,6 +3251,20 @@ type KbReassessAnchor = {
|
|
|
3215
3251
|
* reading, and naming the lean is what keeps it arguable.
|
|
3216
3252
|
*/
|
|
3217
3253
|
type KbReassessDefault = "presumed-invalidated" | "rationale-may-survive" | "review";
|
|
3254
|
+
/**
|
|
3255
|
+
* The reference half of a reassessment, kept apart from the anchor half: two
|
|
3256
|
+
* readings, two repairs, and either present without the other.
|
|
3257
|
+
*/
|
|
3258
|
+
type KbPacketReferences = {
|
|
3259
|
+
/** What this record points at that no longer holds. */
|
|
3260
|
+
outgoing: KbStaleReference[];
|
|
3261
|
+
/**
|
|
3262
|
+
* Who still points at this record, asked only of a record that has itself
|
|
3263
|
+
* stopped holding. Contextual and one hop — `impact` is the causal walk and
|
|
3264
|
+
* is not changed by this.
|
|
3265
|
+
*/
|
|
3266
|
+
incoming: KbLiveReference[];
|
|
3267
|
+
};
|
|
3218
3268
|
type KbReassessPacket = {
|
|
3219
3269
|
conceptId: string;
|
|
3220
3270
|
title: string | null;
|
|
@@ -3239,6 +3289,7 @@ type KbReassessPacket = {
|
|
|
3239
3289
|
depth: number;
|
|
3240
3290
|
}[];
|
|
3241
3291
|
impactTruncated: boolean;
|
|
3292
|
+
references: KbPacketReferences;
|
|
3242
3293
|
default: KbReassessDefault;
|
|
3243
3294
|
defaultNote: string;
|
|
3244
3295
|
};
|
|
@@ -3247,14 +3298,13 @@ type PacketOptions = ClassifyOptions & {
|
|
|
3247
3298
|
withDiff?: boolean;
|
|
3248
3299
|
impact?: KbImpactResult;
|
|
3249
3300
|
standing?: KbStanding;
|
|
3301
|
+
/** Computed by the caller, which holds the bundle; the packet stays a shaper. */
|
|
3302
|
+
references?: KbPacketReferences;
|
|
3250
3303
|
};
|
|
3251
3304
|
/**
|
|
3252
|
-
* One record's packet, or `null` when nothing
|
|
3253
|
-
*
|
|
3254
|
-
*
|
|
3255
|
-
* is a record with no reassessment work, and emitting an empty packet for it
|
|
3256
|
-
* would put it back in front of the reader the classification just cleared it
|
|
3257
|
-
* from.
|
|
3305
|
+
* One record's packet, or `null` when there is nothing for a reader to do:
|
|
3306
|
+
* every drifted anchor classified `moved` or `cosmetic`, and no unresolved
|
|
3307
|
+
* reference. Either half alone is reassessment work.
|
|
3258
3308
|
*/
|
|
3259
3309
|
declare function reassessPacket(repoRoot: string, record: KbRecord, entries: readonly KbAnchorDriftEntry[], options?: PacketOptions): Promise<{
|
|
3260
3310
|
packet: KbReassessPacket | null;
|
|
@@ -3393,4 +3443,4 @@ declare function parseMarkdownWithFrontmatter<S extends z.ZodType>(text: string,
|
|
|
3393
3443
|
frontmatter: ReturnType<S["safeParse"]>;
|
|
3394
3444
|
};
|
|
3395
3445
|
|
|
3396
|
-
export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, type AnchorSetInput, 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_THRESHOLDS, 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_CLASSES, 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 KbAnchorChange, type KbAnchorDriftEntry, type KbAnchorLocator, KbAnchorSetDuplicateError, type KbAnchorSetOutcome, type KbAnchorSetResult, type KbAnchorSpan, type KbAnchorWrite, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbClass, type KbClassifiedFile, type KbClassifiedHunk, type KbClassifyFile, KbClassifyInputError, type KbClassifyOptions, type KbClassifyResult, type KbClassifyThresholds, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbDroppedLink, type KbEdgeKind, type KbExportForeignFile, type KbExportResult, type KbExportedDecision, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLoadResult, type KbLogAnchorChange, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMatch, type KbMatchRecord, 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 KbPromoteCandidate, KbPromoteCollisionError, type KbPromoteResult, KbPromoteSelfError, KbPromoteStandingError, KbPromoteStoppedError, type KbPromotedRecord, 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 KbTagFilter, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerdict, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, PROMOTION_SOURCE_ID, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, type ResolverAttemptOptions, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, type SymbolRangeIndex, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, anchorOnHunk, anchorSetInputSchema, applyAnchorSet, assertBaseNotFrozen, backlinks, buildContext, carry, catalog, classifyDiff, 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, isReviewTag, kbActorStampSchema, kbAnchorLocatorSchema, kbAnchorSchema, kbAnchorSpanSchema, kbAnchorWriteSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogAnchorChangeSchema, kbLogEntrySchema, kbLogEntryWriteSchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, loadQmd, locatorOf, matchToDiff, matchesTags, mergedContextBudgets, neighbours, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, promoteCandidates, promoteInputSchema, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, stringifyMarkdownWithFrontmatter, symbolRangeIndex, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
|
|
3446
|
+
export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, type AnchorSetInput, 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_THRESHOLDS, 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_CLASSES, 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 KbAnchorChange, type KbAnchorDriftEntry, type KbAnchorLocator, KbAnchorSetDuplicateError, type KbAnchorSetOutcome, type KbAnchorSetResult, type KbAnchorSpan, type KbAnchorWrite, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbClass, type KbClassifiedFile, type KbClassifiedHunk, type KbClassifyFile, KbClassifyInputError, type KbClassifyOptions, type KbClassifyResult, type KbClassifyThresholds, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbDroppedLink, type KbEdgeKind, type KbExportForeignFile, type KbExportResult, type KbExportedDecision, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLiveReference, type KbLoadResult, type KbLogAnchorChange, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMatch, type KbMatchRecord, type KbMergedPin, type KbMergedPins, KbMissingFlagValueError, type KbNeighbour, type KbOutboundReference, KbPackBudgetExceededError, type KbPackOptions, type KbPackResult, type KbPackedRecord, type KbPin, type KbPinLayer, type KbPinOptions, type KbPinResult, type KbPinStatus, KbPinsMalformedError, type KbPinsManifest, type KbPromoteCandidate, KbPromoteCollisionError, type KbPromoteResult, KbPromoteSelfError, KbPromoteStandingError, KbPromoteStoppedError, type KbPromotedRecord, 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 KbStaleReference, type KbStanding, KbStore, type KbSupersededStub, type KbSyncResult, type KbTagFilter, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerdict, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, PROMOTION_SOURCE_ID, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, type ResolverAttemptOptions, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, type SymbolRangeIndex, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, anchorOnHunk, anchorSetInputSchema, applyAnchorSet, assertBaseNotFrozen, backlinks, bodyCitations, buildContext, carry, catalog, classifyDiff, 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, isReviewTag, kbActorStampSchema, kbAnchorLocatorSchema, kbAnchorSchema, kbAnchorSpanSchema, kbAnchorWriteSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogAnchorChangeSchema, kbLogEntrySchema, kbLogEntryWriteSchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, liveReferencesTo, loadQmd, locatorOf, matchToDiff, matchesTags, mergedContextBudgets, neighbours, outboundReferences, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, promoteCandidates, promoteInputSchema, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, staleReferences, staleReferencesFrom, stringifyMarkdownWithFrontmatter, symbolRangeIndex, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
|
package/dist/index.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ declare const kbLinkSchema: z.ZodObject<{
|
|
|
165
165
|
target: z.ZodString;
|
|
166
166
|
rel: z.ZodString;
|
|
167
167
|
}, z.core.$loose>;
|
|
168
|
-
declare const KB_RECORD_TYPES: readonly ["fact", "requirement", "constraint", "decision", "assumption", "open-question", "risk", "contract", "flow", "affected-system", "
|
|
168
|
+
declare const KB_RECORD_TYPES: readonly ["fact", "requirement", "constraint", "decision", "assumption", "open-question", "risk", "contract", "flow", "affected-system", "source-note"];
|
|
169
169
|
type KbRecordType = (typeof KB_RECORD_TYPES)[number];
|
|
170
170
|
/** Both halves of `<type>.<slug>` are kebab-case, and neither may be empty. */
|
|
171
171
|
declare const KB_SLUG_PATTERN: RegExp;
|
|
@@ -767,22 +767,10 @@ type KbRecordStamp = {
|
|
|
767
767
|
};
|
|
768
768
|
|
|
769
769
|
/**
|
|
770
|
-
* Edges a trace may follow
|
|
771
|
-
* `
|
|
772
|
-
* suits a bounded pack but floods a timeline.
|
|
773
|
-
*
|
|
774
|
-
* in its own body rather than in another record.
|
|
775
|
-
*
|
|
776
|
-
* `typed-link` is in, where `body-link` is out, because the two differ in how
|
|
777
|
-
* cheaply they are made. A body link is any markdown a writer happened to
|
|
778
|
-
* type; a `strauss_links` entry is a deliberate claim from a closed vocabulary
|
|
779
|
-
* about what this record depends on. That is exactly the kind of edge a
|
|
780
|
-
* timeline should follow — "we chose this because of that" is the history.
|
|
781
|
-
*
|
|
782
|
-
* Only the causal rels, though. `related_to` asserts no dependence and reaches
|
|
783
|
-
* whatever a writer thought worth mentioning, which is the same flooding
|
|
784
|
-
* `body-link` is excluded for; a bibliography is a neighbourhood's business
|
|
785
|
-
* (`pack`), not a history's.
|
|
770
|
+
* Edges a trace may follow: every kb-edges.ts kind, narrowed to the causal
|
|
771
|
+
* rels. `related_to` reaches whatever a writer thought worth mentioning, which
|
|
772
|
+
* suits a bounded pack but floods a timeline. `strauss_answered` carries no
|
|
773
|
+
* target id, so a question's resolution is not an edge.
|
|
786
774
|
*/
|
|
787
775
|
declare const TRACE_EDGES: readonly ["typed-link", "supersession", "anchor", "source"];
|
|
788
776
|
type KbTraceEdge = (typeof TRACE_EDGES)[number];
|
|
@@ -795,7 +783,7 @@ type KbTraceStep = {
|
|
|
795
783
|
};
|
|
796
784
|
type KbTraceOptions = {
|
|
797
785
|
edges?: readonly KbTraceEdge[];
|
|
798
|
-
/**
|
|
786
|
+
/** A trace is always bounded: supersession and shared anchors alone can reach the whole bundle. */
|
|
799
787
|
depth?: number;
|
|
800
788
|
};
|
|
801
789
|
/**
|
|
@@ -1918,7 +1906,7 @@ declare class TreeSitterResolver implements AnchorResolver {
|
|
|
1918
1906
|
/**
|
|
1919
1907
|
* What each record type is for, and the shape of its body.
|
|
1920
1908
|
*
|
|
1921
|
-
* A table rather than
|
|
1909
|
+
* A table rather than a composer module per type. The types differ only in which
|
|
1922
1910
|
* questions their body answers and where they start in the lifecycle; encoding
|
|
1923
1911
|
* that as data keeps the one composer honest and makes adding a type an edit
|
|
1924
1912
|
* rather than a file.
|
|
@@ -2609,32 +2597,20 @@ type KbClassifyResult = {
|
|
|
2609
2597
|
declare function classifyDiff(files: readonly KbClassifyFile[], options?: KbClassifyOptions): KbClassifiedFile[];
|
|
2610
2598
|
|
|
2611
2599
|
/**
|
|
2612
|
-
*
|
|
2613
|
-
*
|
|
2614
|
-
* Both walks — `trace` and `pack` — consume this module, so they cannot drift
|
|
2615
|
-
* into disagreeing about what makes two records neighbours, and a diagnostic
|
|
2616
|
-
* pass over the graph can reuse the same definition.
|
|
2617
|
-
*
|
|
2618
|
-
* There is no separate `related` kind: compose.ts renders `relatedConceptIds`
|
|
2619
|
-
* as body links (`Relates to [id](id.md).`), so in stored form a related edge
|
|
2620
|
-
* IS a body link, and a distinct kind would count the same markdown twice.
|
|
2621
|
-
*
|
|
2622
|
-
* `typed-link` is not that case, despite compose.ts also rendering a sentence
|
|
2623
|
-
* per link. The edge is `strauss_links` in the frontmatter — the authoritative,
|
|
2624
|
-
* typed form — and the sentence is its rendering for a reader that only knows
|
|
2625
|
-
* OKF. A record can carry the frontmatter without the prose (hand-written, or
|
|
2626
|
-
* from a producer we did not write), so reading only the body would miss it.
|
|
2627
|
-
* A pair connected both ways comes back with both kinds in `via`, which is the
|
|
2628
|
-
* honest answer: it was declared, and it was written about.
|
|
2600
|
+
* Every concept id this record's prose cites, itself excluded.
|
|
2629
2601
|
*
|
|
2630
|
-
*
|
|
2631
|
-
*
|
|
2632
|
-
* are symmetric: they hold between two records because both name the same
|
|
2633
|
-
* thing, so either end sees the other. Callers wanting the inbound half of a
|
|
2634
|
-
* typed edge use `kb-links/` (`kb_backlinks`, `kb_impact`) rather than this
|
|
2635
|
-
* module, which answers "what does this record point at".
|
|
2602
|
+
* Parsed to an mdast tree rather than matched by pattern: a link in a fence, an
|
|
2603
|
+
* indented block or a code span is an example, and only a parser knows which.
|
|
2636
2604
|
*/
|
|
2637
|
-
declare
|
|
2605
|
+
declare function bodyCitations(record: KbRecord): Set<string>;
|
|
2606
|
+
|
|
2607
|
+
/**
|
|
2608
|
+
* The edges between records in one bundle, defined once for `trace` and
|
|
2609
|
+
* `pack`. `typed-link` (`strauss_links`) is directed and the only edge a
|
|
2610
|
+
* record declares; the other three are symmetric. Prose is never walked; the
|
|
2611
|
+
* inbound half of a typed edge is `kb-links/`.
|
|
2612
|
+
*/
|
|
2613
|
+
declare const KB_EDGE_KINDS: readonly ["typed-link", "supersession", "anchor", "source"];
|
|
2638
2614
|
type KbEdgeKind = (typeof KB_EDGE_KINDS)[number];
|
|
2639
2615
|
type KbNeighbour = {
|
|
2640
2616
|
record: KbRecord;
|
|
@@ -2665,6 +2641,61 @@ declare function neighbours(from: KbRecord, bundle: KbRecord[], kinds?: readonly
|
|
|
2665
2641
|
*/
|
|
2666
2642
|
declare function edgeNeighbours(from: KbRecord, bundle: KbRecord[], kind: KbEdgeKind, linkRels?: readonly string[]): KbRecord[];
|
|
2667
2643
|
|
|
2644
|
+
/**
|
|
2645
|
+
* What a record explicitly points at — the question a consumer about to warn
|
|
2646
|
+
* or about to delete has to ask, where `kb-edges.ts` answers it for a walk and
|
|
2647
|
+
* `kb-links/` answers the causal inverse.
|
|
2648
|
+
*/
|
|
2649
|
+
/** One target a record points at, with every claim it makes about it. */
|
|
2650
|
+
type KbOutboundReference = {
|
|
2651
|
+
target: string;
|
|
2652
|
+
/** Rels declared for this target, in declaration order. Never empty. */
|
|
2653
|
+
rels: string[];
|
|
2654
|
+
};
|
|
2655
|
+
/** A record that still holds, pointing at one that does not. */
|
|
2656
|
+
type KbStaleReference = {
|
|
2657
|
+
from: string;
|
|
2658
|
+
target: string;
|
|
2659
|
+
/** Always `superseded` or `rejected` — the standings that stopped holding. */
|
|
2660
|
+
targetStanding: Extract<KbStanding, "superseded" | "rejected">;
|
|
2661
|
+
rels: string[];
|
|
2662
|
+
/** The replacement chain, nearest first, limited to ids the bundle holds. */
|
|
2663
|
+
replacedBy: string[];
|
|
2664
|
+
};
|
|
2665
|
+
/** A record that still holds, pointing at the record being reassessed. */
|
|
2666
|
+
type KbLiveReference = {
|
|
2667
|
+
from: string;
|
|
2668
|
+
title: string | null;
|
|
2669
|
+
standing: KbStanding;
|
|
2670
|
+
rels: string[];
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2673
|
+
/**
|
|
2674
|
+
* Every record this one points at through `strauss_links`, each target once,
|
|
2675
|
+
* with every distinct rel. An unknown rel is skipped, as every walk skips it;
|
|
2676
|
+
* shared anchors and sources are co-location, not reference.
|
|
2677
|
+
*/
|
|
2678
|
+
declare function outboundReferences(record: KbRecord): KbOutboundReference[];
|
|
2679
|
+
|
|
2680
|
+
/**
|
|
2681
|
+
* Every stale reference in the bundle, in bundle order, then in each record's
|
|
2682
|
+
* own reference order.
|
|
2683
|
+
*/
|
|
2684
|
+
declare function staleReferences(bundle: KbRecord[], standings: Map<string, KbStanding>): KbStaleReference[];
|
|
2685
|
+
/**
|
|
2686
|
+
* One record's stale references.
|
|
2687
|
+
*
|
|
2688
|
+
* A record already out of force is asked nothing: what a superseded record
|
|
2689
|
+
* points at is history, and repairing it would put a finding on every record
|
|
2690
|
+
* the base has already replaced.
|
|
2691
|
+
*/
|
|
2692
|
+
declare function staleReferencesFrom(record: KbRecord, byId: Map<string, KbRecord>, standings: Map<string, KbStanding>): KbStaleReference[];
|
|
2693
|
+
/**
|
|
2694
|
+
* Who still points at this record, among the records that still hold: one hop
|
|
2695
|
+
* and every rel, where `kb_impact` walks causal dependence transitively.
|
|
2696
|
+
*/
|
|
2697
|
+
declare function liveReferencesTo(targetId: string, bundle: KbRecord[], standings: Map<string, KbStanding>): KbLiveReference[];
|
|
2698
|
+
|
|
2668
2699
|
/** `error` fails the check; `warning` does not. */
|
|
2669
2700
|
type KbValidationSeverity = "error" | "warning";
|
|
2670
2701
|
type KbValidationProblem = {
|
|
@@ -2710,6 +2741,11 @@ type KbDoctorFinding = {
|
|
|
2710
2741
|
status: KbRecordStatus;
|
|
2711
2742
|
/** Why this record is in this group, in one phrase a reader can act on. */
|
|
2712
2743
|
note: string;
|
|
2744
|
+
/**
|
|
2745
|
+
* The edge behind a `superseded-but-cited` finding, for a consumer that acts
|
|
2746
|
+
* on it rather than prints it. Absent on every other check.
|
|
2747
|
+
*/
|
|
2748
|
+
reference?: KbStaleReference;
|
|
2713
2749
|
};
|
|
2714
2750
|
type KbDoctorGroup = {
|
|
2715
2751
|
check: KbDoctorCheck;
|
|
@@ -3215,6 +3251,20 @@ type KbReassessAnchor = {
|
|
|
3215
3251
|
* reading, and naming the lean is what keeps it arguable.
|
|
3216
3252
|
*/
|
|
3217
3253
|
type KbReassessDefault = "presumed-invalidated" | "rationale-may-survive" | "review";
|
|
3254
|
+
/**
|
|
3255
|
+
* The reference half of a reassessment, kept apart from the anchor half: two
|
|
3256
|
+
* readings, two repairs, and either present without the other.
|
|
3257
|
+
*/
|
|
3258
|
+
type KbPacketReferences = {
|
|
3259
|
+
/** What this record points at that no longer holds. */
|
|
3260
|
+
outgoing: KbStaleReference[];
|
|
3261
|
+
/**
|
|
3262
|
+
* Who still points at this record, asked only of a record that has itself
|
|
3263
|
+
* stopped holding. Contextual and one hop — `impact` is the causal walk and
|
|
3264
|
+
* is not changed by this.
|
|
3265
|
+
*/
|
|
3266
|
+
incoming: KbLiveReference[];
|
|
3267
|
+
};
|
|
3218
3268
|
type KbReassessPacket = {
|
|
3219
3269
|
conceptId: string;
|
|
3220
3270
|
title: string | null;
|
|
@@ -3239,6 +3289,7 @@ type KbReassessPacket = {
|
|
|
3239
3289
|
depth: number;
|
|
3240
3290
|
}[];
|
|
3241
3291
|
impactTruncated: boolean;
|
|
3292
|
+
references: KbPacketReferences;
|
|
3242
3293
|
default: KbReassessDefault;
|
|
3243
3294
|
defaultNote: string;
|
|
3244
3295
|
};
|
|
@@ -3247,14 +3298,13 @@ type PacketOptions = ClassifyOptions & {
|
|
|
3247
3298
|
withDiff?: boolean;
|
|
3248
3299
|
impact?: KbImpactResult;
|
|
3249
3300
|
standing?: KbStanding;
|
|
3301
|
+
/** Computed by the caller, which holds the bundle; the packet stays a shaper. */
|
|
3302
|
+
references?: KbPacketReferences;
|
|
3250
3303
|
};
|
|
3251
3304
|
/**
|
|
3252
|
-
* One record's packet, or `null` when nothing
|
|
3253
|
-
*
|
|
3254
|
-
*
|
|
3255
|
-
* is a record with no reassessment work, and emitting an empty packet for it
|
|
3256
|
-
* would put it back in front of the reader the classification just cleared it
|
|
3257
|
-
* from.
|
|
3305
|
+
* One record's packet, or `null` when there is nothing for a reader to do:
|
|
3306
|
+
* every drifted anchor classified `moved` or `cosmetic`, and no unresolved
|
|
3307
|
+
* reference. Either half alone is reassessment work.
|
|
3258
3308
|
*/
|
|
3259
3309
|
declare function reassessPacket(repoRoot: string, record: KbRecord, entries: readonly KbAnchorDriftEntry[], options?: PacketOptions): Promise<{
|
|
3260
3310
|
packet: KbReassessPacket | null;
|
|
@@ -3393,4 +3443,4 @@ declare function parseMarkdownWithFrontmatter<S extends z.ZodType>(text: string,
|
|
|
3393
3443
|
frontmatter: ReturnType<S["safeParse"]>;
|
|
3394
3444
|
};
|
|
3395
3445
|
|
|
3396
|
-
export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, type AnchorSetInput, 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_THRESHOLDS, 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_CLASSES, 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 KbAnchorChange, type KbAnchorDriftEntry, type KbAnchorLocator, KbAnchorSetDuplicateError, type KbAnchorSetOutcome, type KbAnchorSetResult, type KbAnchorSpan, type KbAnchorWrite, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbClass, type KbClassifiedFile, type KbClassifiedHunk, type KbClassifyFile, KbClassifyInputError, type KbClassifyOptions, type KbClassifyResult, type KbClassifyThresholds, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbDroppedLink, type KbEdgeKind, type KbExportForeignFile, type KbExportResult, type KbExportedDecision, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLoadResult, type KbLogAnchorChange, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMatch, type KbMatchRecord, 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 KbPromoteCandidate, KbPromoteCollisionError, type KbPromoteResult, KbPromoteSelfError, KbPromoteStandingError, KbPromoteStoppedError, type KbPromotedRecord, 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 KbTagFilter, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerdict, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, PROMOTION_SOURCE_ID, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, type ResolverAttemptOptions, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, type SymbolRangeIndex, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, anchorOnHunk, anchorSetInputSchema, applyAnchorSet, assertBaseNotFrozen, backlinks, buildContext, carry, catalog, classifyDiff, 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, isReviewTag, kbActorStampSchema, kbAnchorLocatorSchema, kbAnchorSchema, kbAnchorSpanSchema, kbAnchorWriteSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogAnchorChangeSchema, kbLogEntrySchema, kbLogEntryWriteSchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, loadQmd, locatorOf, matchToDiff, matchesTags, mergedContextBudgets, neighbours, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, promoteCandidates, promoteInputSchema, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, stringifyMarkdownWithFrontmatter, symbolRangeIndex, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
|
|
3446
|
+
export { type AnchorResolution, type AnchorResolver, type AnchorResolverName, type AnchorSetInput, 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_THRESHOLDS, 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_CLASSES, 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 KbAnchorChange, type KbAnchorDriftEntry, type KbAnchorLocator, KbAnchorSetDuplicateError, type KbAnchorSetOutcome, type KbAnchorSetResult, type KbAnchorSpan, type KbAnchorWrite, type KbBacklink, type KbBacklinksResult, KbBaseFrozenError, type KbCatalogEntry, type KbCatalogResult, type KbClass, type KbClassifiedFile, type KbClassifiedHunk, type KbClassifyFile, KbClassifyInputError, type KbClassifyOptions, type KbClassifyResult, type KbClassifyThresholds, type KbCommand, type KbCommandContext, type KbContextBudgets, type KbContextOptions, type KbContextResult, type KbDoctorCheck, type KbDoctorFinding, type KbDoctorGroup, type KbDoctorOptions, type KbDoctorReport, type KbDoctorThresholds, type KbDroppedLink, type KbEdgeKind, type KbExportForeignFile, type KbExportResult, type KbExportedDecision, type KbImpactOptions, type KbImpactResult, type KbImpactedRecord, type KbInboundEdge, KbInvalidConceptIdError, type KbLink, type KbLinkEdge, type KbLinkRel, type KbLinkRelSpec, type KbLiveReference, type KbLoadResult, type KbLogAnchorChange, type KbLogEntry, type KbLogReadResult, type KbLogger, type KbMatch, type KbMatchRecord, type KbMergedPin, type KbMergedPins, KbMissingFlagValueError, type KbNeighbour, type KbOutboundReference, KbPackBudgetExceededError, type KbPackOptions, type KbPackResult, type KbPackedRecord, type KbPin, type KbPinLayer, type KbPinOptions, type KbPinResult, type KbPinStatus, KbPinsMalformedError, type KbPinsManifest, type KbPromoteCandidate, KbPromoteCollisionError, type KbPromoteResult, KbPromoteSelfError, KbPromoteStandingError, KbPromoteStoppedError, type KbPromotedRecord, 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 KbStaleReference, type KbStanding, KbStore, type KbSupersededStub, type KbSyncResult, type KbTagFilter, type KbTraceEdge, type KbTraceOptions, type KbTraceStep, KbUnknownLinkRelError, type KbValidationProblem, type KbValidationSeverity, type KbVerdict, type KbVerifiedEvent, type KbWarning, KbWriteConflictError, type KbWriteInput, LINK_RELS, LOG_FILE, type MatchOptions, NO_DECISION_SLUG, PINS_FILE, PINS_LOCAL_FILE, PIN_LAYERS, PROMOTION_SOURCE_ID, type QmdModule, RECORD_TYPES, type RemoteAnchorState, type RemoteOptions, type RemoteRead, type ResolvedSymbol, type ResolverAttempt, type ResolverAttemptOptions, SEARCH_INDEX_FILE, type SearchHit, type SearchOptions, type SymbolRange, type SymbolRangeIndex, TRACE_EDGES, TreeSitterResolver, adjudicate, anchorFilePath, anchorOnHunk, anchorSetInputSchema, applyAnchorSet, assertBaseNotFrozen, backlinks, bodyCitations, buildContext, carry, catalog, classifyDiff, 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, isReviewTag, kbActorStampSchema, kbAnchorLocatorSchema, kbAnchorSchema, kbAnchorSpanSchema, kbAnchorWriteSchema, kbConceptIdSchema, kbJsonSchemas, kbLinkSchema, kbLogAnchorChangeSchema, kbLogEntrySchema, kbLogEntryWriteSchema, kbRecordFrontmatterSchema, kbSourceSchema, kbVerifiedEventSchema, languageForFile, listPins, liveReferencesTo, loadQmd, locatorOf, matchToDiff, matchesTags, mergedContextBudgets, neighbours, outboundReferences, pack, parseLog, parseMarkdownWithFrontmatter, pinBase, prepareResolvers, promoteCandidates, promoteInputSchema, readMergedPins, readPinsLayer, readRemoteAnchors, reassessPacket, regexResolver, renderCatalogLine, renderIndex, renderIndexLine, renderLogEntry, repoCacheDir, resolveAnchor, resolveAnchorSpan, resolveHeads, resolveHits, resolvePinPath, runKbCli, runKbMcpServer, searchBase, selectDecisions, splitMarkdownFrontmatter, staleReferences, staleReferencesFrom, stringifyMarkdownWithFrontmatter, symbolRangeIndex, syncInstructions, toHookJson, trace, treeSitterLanguages, unifiedDiff, unpinBase, validateBundle };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKbCli
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4AJGI6WN.js";
|
|
4
4
|
import {
|
|
5
5
|
createKbMcpServer,
|
|
6
6
|
runKbMcpServer
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EOSRZHWY.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseError,
|
|
10
10
|
CONTEXT_BEGIN,
|
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
applyAnchorSet,
|
|
72
72
|
assertBaseNotFrozen,
|
|
73
73
|
backlinks,
|
|
74
|
+
bodyCitations,
|
|
74
75
|
buildContext,
|
|
75
76
|
carry,
|
|
76
77
|
catalog,
|
|
@@ -116,12 +117,14 @@ import {
|
|
|
116
117
|
kbVerifiedEventSchema,
|
|
117
118
|
languageForFile,
|
|
118
119
|
listPins,
|
|
120
|
+
liveReferencesTo,
|
|
119
121
|
loadQmd,
|
|
120
122
|
locatorOf,
|
|
121
123
|
matchToDiff,
|
|
122
124
|
matchesTags,
|
|
123
125
|
mergedContextBudgets,
|
|
124
126
|
neighbours,
|
|
127
|
+
outboundReferences,
|
|
125
128
|
pack,
|
|
126
129
|
parseLog,
|
|
127
130
|
parseMarkdownWithFrontmatter,
|
|
@@ -147,6 +150,8 @@ import {
|
|
|
147
150
|
searchBase,
|
|
148
151
|
selectDecisions,
|
|
149
152
|
splitMarkdownFrontmatter,
|
|
153
|
+
staleReferences,
|
|
154
|
+
staleReferencesFrom,
|
|
150
155
|
stringifyMarkdownWithFrontmatter,
|
|
151
156
|
symbolRangeIndex,
|
|
152
157
|
syncInstructions,
|
|
@@ -156,7 +161,7 @@ import {
|
|
|
156
161
|
unifiedDiff,
|
|
157
162
|
unpinBase,
|
|
158
163
|
validateBundle
|
|
159
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-MC5LUSZ3.js";
|
|
160
165
|
export {
|
|
161
166
|
BaseError,
|
|
162
167
|
CONTEXT_BEGIN,
|
|
@@ -223,6 +228,7 @@ export {
|
|
|
223
228
|
applyAnchorSet,
|
|
224
229
|
assertBaseNotFrozen,
|
|
225
230
|
backlinks,
|
|
231
|
+
bodyCitations,
|
|
226
232
|
buildContext,
|
|
227
233
|
carry,
|
|
228
234
|
catalog,
|
|
@@ -269,12 +275,14 @@ export {
|
|
|
269
275
|
kbVerifiedEventSchema,
|
|
270
276
|
languageForFile,
|
|
271
277
|
listPins,
|
|
278
|
+
liveReferencesTo,
|
|
272
279
|
loadQmd,
|
|
273
280
|
locatorOf,
|
|
274
281
|
matchToDiff,
|
|
275
282
|
matchesTags,
|
|
276
283
|
mergedContextBudgets,
|
|
277
284
|
neighbours,
|
|
285
|
+
outboundReferences,
|
|
278
286
|
pack,
|
|
279
287
|
parseLog,
|
|
280
288
|
parseMarkdownWithFrontmatter,
|
|
@@ -302,6 +310,8 @@ export {
|
|
|
302
310
|
searchBase,
|
|
303
311
|
selectDecisions,
|
|
304
312
|
splitMarkdownFrontmatter,
|
|
313
|
+
staleReferences,
|
|
314
|
+
staleReferencesFrom,
|
|
305
315
|
stringifyMarkdownWithFrontmatter,
|
|
306
316
|
symbolRangeIndex,
|
|
307
317
|
syncInstructions,
|