@isaacriehm/cairn-core 0.4.3 → 0.6.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/dist/.tsbuildinfo +1 -1
- package/dist/align-undo/index.d.ts +6 -0
- package/dist/align-undo/index.js +6 -0
- package/dist/align-undo/index.js.map +1 -0
- package/dist/align-undo/log.d.ts +53 -0
- package/dist/align-undo/log.js +162 -0
- package/dist/align-undo/log.js.map +1 -0
- package/dist/align-undo/undo.d.ts +65 -0
- package/dist/align-undo/undo.js +397 -0
- package/dist/align-undo/undo.js.map +1 -0
- package/dist/attention/bulk-accept.js +9 -22
- package/dist/attention/bulk-accept.js.map +1 -1
- package/dist/attention/dedup.js +1 -47
- package/dist/attention/dedup.js.map +1 -1
- package/dist/attention/serve/api.js +3 -17
- package/dist/attention/serve/api.js.map +1 -1
- package/dist/attention/serve/index.js +3 -3
- package/dist/attention/serve/index.js.map +1 -1
- package/dist/drain/drain.d.ts +77 -0
- package/dist/drain/drain.js +464 -0
- package/dist/drain/drain.js.map +1 -0
- package/dist/drain/index.d.ts +5 -0
- package/dist/drain/index.js +5 -0
- package/dist/drain/index.js.map +1 -0
- package/dist/fix-align/index.d.ts +7 -0
- package/dist/fix-align/index.js +6 -0
- package/dist/fix-align/index.js.map +1 -0
- package/dist/fix-align/run.d.ts +99 -0
- package/dist/fix-align/run.js +258 -0
- package/dist/fix-align/run.js.map +1 -0
- package/dist/fix-align/sentinel.d.ts +59 -0
- package/dist/fix-align/sentinel.js +149 -0
- package/dist/fix-align/sentinel.js.map +1 -0
- package/dist/fs.d.ts +5 -0
- package/dist/fs.js +11 -0
- package/dist/fs.js.map +1 -0
- package/dist/gc/apply.js +4 -4
- package/dist/gc/apply.js.map +1 -1
- package/dist/ground/alignment-pending.d.ts +28 -0
- package/dist/ground/alignment-pending.js +83 -0
- package/dist/ground/alignment-pending.js.map +1 -0
- package/dist/ground/anchor-map.d.ts +14 -0
- package/dist/ground/anchor-map.js +56 -0
- package/dist/ground/anchor-map.js.map +1 -0
- package/dist/ground/frontmatter.d.ts +12 -0
- package/dist/ground/frontmatter.js +28 -0
- package/dist/ground/frontmatter.js.map +1 -1
- package/dist/ground/index.d.ts +10 -3
- package/dist/ground/index.js +9 -3
- package/dist/ground/index.js.map +1 -1
- package/dist/ground/paths.d.ts +21 -0
- package/dist/ground/paths.js +43 -0
- package/dist/ground/paths.js.map +1 -1
- package/dist/ground/schemas.d.ts +201 -0
- package/dist/ground/schemas.js +135 -10
- package/dist/ground/schemas.js.map +1 -1
- package/dist/ground/scope-index.js +4 -4
- package/dist/ground/scope-index.js.map +1 -1
- package/dist/ground/slug.d.ts +60 -0
- package/dist/ground/slug.js +103 -0
- package/dist/ground/slug.js.map +1 -0
- package/dist/ground/sot-bindings.d.ts +14 -0
- package/dist/ground/sot-bindings.js +79 -0
- package/dist/ground/sot-bindings.js.map +1 -0
- package/dist/ground/sot-cache.d.ts +18 -0
- package/dist/ground/sot-cache.js +62 -0
- package/dist/ground/sot-cache.js.map +1 -0
- package/dist/ground/topic-index.d.ts +27 -0
- package/dist/ground/topic-index.js +82 -0
- package/dist/ground/topic-index.js.map +1 -0
- package/dist/hooks/post-tool-use/index.d.ts +2 -0
- package/dist/hooks/post-tool-use/index.js +1 -0
- package/dist/hooks/post-tool-use/index.js.map +1 -1
- package/dist/hooks/post-tool-use/sot-align.d.ts +166 -0
- package/dist/hooks/post-tool-use/sot-align.js +1306 -0
- package/dist/hooks/post-tool-use/sot-align.js.map +1 -0
- package/dist/hooks/pre-commit/index.d.ts +8 -0
- package/dist/hooks/pre-commit/index.js +8 -0
- package/dist/hooks/pre-commit/index.js.map +1 -0
- package/dist/hooks/pre-commit/sot-align-precommit.d.ts +60 -0
- package/dist/hooks/pre-commit/sot-align-precommit.js +221 -0
- package/dist/hooks/pre-commit/sot-align-precommit.js.map +1 -0
- package/dist/hooks/runners/session-start.js +41 -0
- package/dist/hooks/runners/session-start.js.map +1 -1
- package/dist/hooks/sot-align-common.d.ts +39 -0
- package/dist/hooks/sot-align-common.js +152 -0
- package/dist/hooks/sot-align-common.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/init/index.d.ts +4 -2
- package/dist/init/index.js +2 -1
- package/dist/init/index.js.map +1 -1
- package/dist/init/ingest-docs.d.ts +30 -47
- package/dist/init/ingest-docs.js +113 -410
- package/dist/init/ingest-docs.js.map +1 -1
- package/dist/init/init.d.ts +8 -0
- package/dist/init/init.js +58 -29
- package/dist/init/init.js.map +1 -1
- package/dist/init/mapper.js +6 -6
- package/dist/init/mapper.js.map +1 -1
- package/dist/init/phases/5-brand.js +1 -1
- package/dist/init/phases/5-brand.js.map +1 -1
- package/dist/init/phases/5b-topic-index.d.ts +30 -0
- package/dist/init/phases/5b-topic-index.js +62 -0
- package/dist/init/phases/5b-topic-index.js.map +1 -0
- package/dist/init/phases/6-docs-ingest.d.ts +4 -5
- package/dist/init/phases/6-docs-ingest.js +5 -6
- package/dist/init/phases/6-docs-ingest.js.map +1 -1
- package/dist/init/phases/index.d.ts +2 -0
- package/dist/init/phases/index.js +1 -0
- package/dist/init/phases/index.js.map +1 -1
- package/dist/init/phases/parallel-678.d.ts +14 -17
- package/dist/init/phases/parallel-678.js +77 -98
- package/dist/init/phases/parallel-678.js.map +1 -1
- package/dist/init/phases/source-comments-output-io.d.ts +16 -10
- package/dist/init/phases/source-comments-output-io.js +7 -10
- package/dist/init/phases/source-comments-output-io.js.map +1 -1
- package/dist/init/phases/types.d.ts +1 -1
- package/dist/init/phases/types.js +1 -0
- package/dist/init/phases/types.js.map +1 -1
- package/dist/init/rules-merge/discover.d.ts +8 -3
- package/dist/init/rules-merge/discover.js +7 -3
- package/dist/init/rules-merge/discover.js.map +1 -1
- package/dist/init/rules-merge/ingest.d.ts +81 -28
- package/dist/init/rules-merge/ingest.js +456 -162
- package/dist/init/rules-merge/ingest.js.map +1 -1
- package/dist/init/sot-emit.d.ts +84 -0
- package/dist/init/sot-emit.js +214 -0
- package/dist/init/sot-emit.js.map +1 -0
- package/dist/init/source-comments/classify.d.ts +12 -10
- package/dist/init/source-comments/classify.js +13 -25
- package/dist/init/source-comments/classify.js.map +1 -1
- package/dist/init/source-comments/index.d.ts +1 -1
- package/dist/init/source-comments/index.js +1 -1
- package/dist/init/source-comments/index.js.map +1 -1
- package/dist/init/source-comments/ingest.d.ts +91 -67
- package/dist/init/source-comments/ingest.js +392 -361
- package/dist/init/source-comments/ingest.js.map +1 -1
- package/dist/init/topic-index/index.d.ts +36 -0
- package/dist/init/topic-index/index.js +46 -0
- package/dist/init/topic-index/index.js.map +1 -0
- package/dist/init/topic-index/judge.d.ts +20 -0
- package/dist/init/topic-index/judge.js +65 -0
- package/dist/init/topic-index/judge.js.map +1 -0
- package/dist/init/topic-index/resolve.d.ts +50 -0
- package/dist/init/topic-index/resolve.js +196 -0
- package/dist/init/topic-index/resolve.js.map +1 -0
- package/dist/init/topic-index/walk.d.ts +43 -0
- package/dist/init/topic-index/walk.js +293 -0
- package/dist/init/topic-index/walk.js.map +1 -0
- package/dist/mcp/schemas.d.ts +45 -8
- package/dist/mcp/schemas.js +43 -7
- package/dist/mcp/schemas.js.map +1 -1
- package/dist/mcp/tools/align-drain.d.ts +7 -0
- package/dist/mcp/tools/align-drain.js +26 -0
- package/dist/mcp/tools/align-drain.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +1 -1
- package/dist/mcp/tools/index.js +3 -0
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/init-phases.js +4 -1
- package/dist/mcp/tools/init-phases.js.map +1 -1
- package/dist/mcp/tools/record-decision.js +5 -2
- package/dist/mcp/tools/record-decision.js.map +1 -1
- package/dist/mcp/tools/resolve-attention.d.ts +2 -2
- package/dist/mcp/tools/resolve-attention.js +781 -5
- package/dist/mcp/tools/resolve-attention.js.map +1 -1
- package/dist/status-line/event-queue.d.ts +40 -0
- package/dist/status-line/event-queue.js +195 -0
- package/dist/status-line/event-queue.js.map +1 -0
- package/dist/status-line/format.d.ts +1 -1
- package/dist/status-line/format.js +49 -6
- package/dist/status-line/format.js.map +1 -1
- package/dist/status-line/index.d.ts +41 -0
- package/dist/status-line/index.js +14 -0
- package/dist/status-line/index.js.map +1 -1
- package/dist/status-line/reader.js +23 -18
- package/dist/status-line/reader.js.map +1 -1
- package/dist/status-line/writer.d.ts +1 -1
- package/dist/status-line/writer.js +5 -0
- package/dist/status-line/writer.js.map +1 -1
- package/dist/text/jaccard.d.ts +19 -0
- package/dist/text/jaccard.js +68 -0
- package/dist/text/jaccard.js.map +1 -0
- package/package.json +1 -1
- package/templates/.cairn/git-hooks/pre-commit +16 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alignment-pending.js","sourceRoot":"","sources":["../../src/ground/alignment-pending.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAqBtC,MAAM,UAAU,qBAAqB,CAAC,IAA+B;IACnE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,yBAAyB,CAAC;IAC5D,MAAM,GAAG,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC1C,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,MA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,IAAI,CAAC,2DAA2D,CAAC,CAAC;QACxE,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QAC9E,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QACxC,KAAK,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IACjF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,aAAa,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7C,OAAO,mCAAmC,QAAQ,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnchorMap, type AnchorMapEntry } from "./schemas.js";
|
|
2
|
+
/**
|
|
3
|
+
* Anchor-map is the external slug → location index for sot_kind=path
|
|
4
|
+
* DECs. Operator's docs stay pristine: no `<!-- cairn-anchor: … -->`
|
|
5
|
+
* comments are injected. When the operator renames a heading or moves a
|
|
6
|
+
* paragraph, the anchor-map updates and §DEC-<hash> tokens stay valid
|
|
7
|
+
* because they resolve through this map, not the literal heading slug.
|
|
8
|
+
*/
|
|
9
|
+
export declare function emptyAnchorMap(): AnchorMap;
|
|
10
|
+
export declare function readAnchorMap(repoRoot: string): AnchorMap;
|
|
11
|
+
export declare function writeAnchorMap(repoRoot: string, map: AnchorMap): string;
|
|
12
|
+
export declare function setAnchor(map: AnchorMap, slug: string, entry: AnchorMapEntry): AnchorMap;
|
|
13
|
+
export declare function getAnchor(map: AnchorMap, slug: string): AnchorMapEntry | null;
|
|
14
|
+
export declare function deleteAnchor(map: AnchorMap, slug: string): AnchorMap;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { writeFileSafe } from "../fs.js";
|
|
3
|
+
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
4
|
+
import { logger } from "../logger.js";
|
|
5
|
+
import { anchorMapPath } from "./paths.js";
|
|
6
|
+
import { AnchorMap } from "./schemas.js";
|
|
7
|
+
const log = logger("ground.anchor-map");
|
|
8
|
+
/**
|
|
9
|
+
* Anchor-map is the external slug → location index for sot_kind=path
|
|
10
|
+
* DECs. Operator's docs stay pristine: no `<!-- cairn-anchor: … -->`
|
|
11
|
+
* comments are injected. When the operator renames a heading or moves a
|
|
12
|
+
* paragraph, the anchor-map updates and §DEC-<hash> tokens stay valid
|
|
13
|
+
* because they resolve through this map, not the literal heading slug.
|
|
14
|
+
*/
|
|
15
|
+
export function emptyAnchorMap() {
|
|
16
|
+
return { version: 1, generated: new Date().toISOString(), anchors: {} };
|
|
17
|
+
}
|
|
18
|
+
export function readAnchorMap(repoRoot) {
|
|
19
|
+
const path = anchorMapPath(repoRoot);
|
|
20
|
+
if (!existsSync(path))
|
|
21
|
+
return emptyAnchorMap();
|
|
22
|
+
try {
|
|
23
|
+
const raw = readFileSync(path, "utf8");
|
|
24
|
+
const parsed = AnchorMap.safeParse(parseYaml(raw));
|
|
25
|
+
if (!parsed.success) {
|
|
26
|
+
log.warn({ path, error: parsed.error.message }, "anchor-map invalid; treating as empty");
|
|
27
|
+
return emptyAnchorMap();
|
|
28
|
+
}
|
|
29
|
+
return parsed.data;
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
log.warn({ path, err }, "anchor-map read failed; treating as empty");
|
|
33
|
+
return emptyAnchorMap();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function writeAnchorMap(repoRoot, map) {
|
|
37
|
+
const path = anchorMapPath(repoRoot);
|
|
38
|
+
const next = { ...map, generated: new Date().toISOString() };
|
|
39
|
+
writeFileSafe(path, stringifyYaml(next));
|
|
40
|
+
log.debug({ path, anchors: Object.keys(next.anchors).length }, "wrote anchor-map");
|
|
41
|
+
return path;
|
|
42
|
+
}
|
|
43
|
+
export function setAnchor(map, slug, entry) {
|
|
44
|
+
return { ...map, anchors: { ...map.anchors, [slug]: entry } };
|
|
45
|
+
}
|
|
46
|
+
export function getAnchor(map, slug) {
|
|
47
|
+
return map.anchors[slug] ?? null;
|
|
48
|
+
}
|
|
49
|
+
export function deleteAnchor(map, slug) {
|
|
50
|
+
if (map.anchors[slug] === undefined)
|
|
51
|
+
return map;
|
|
52
|
+
const anchors = { ...map.anchors };
|
|
53
|
+
delete anchors[slug];
|
|
54
|
+
return { ...map, anchors };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=anchor-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-map.js","sourceRoot":"","sources":["../../src/ground/anchor-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;AAE9D,MAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAExC;;;;;;GAMG;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,cAAc,EAAE,CAAC;IAC/C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC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IACpD,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAc,EAAE,IAAY;IACvD,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IAChD,MAAM,OAAO,GAAG,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IACnC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -7,6 +7,18 @@ export interface ParsedDocument {
|
|
|
7
7
|
/** Number of lines the frontmatter (incl. fences) occupies. */
|
|
8
8
|
fenceLineCount: number;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Extract frontmatter from `source` and return it as an unvalidated
|
|
12
|
+
* `Record<string, unknown>` alongside the remaining body. Returns
|
|
13
|
+
* `{ fm: {}, body: source }` on any parse failure or absent frontmatter.
|
|
14
|
+
*
|
|
15
|
+
* Use this instead of an inline `.match(/^---…/)` when callers need
|
|
16
|
+
* arbitrary field access without a Zod schema.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseFrontmatterRecord(source: string): {
|
|
19
|
+
fm: Record<string, unknown>;
|
|
20
|
+
body: string;
|
|
21
|
+
};
|
|
10
22
|
export declare function parseFrontmatter(source: string): ParsedDocument;
|
|
11
23
|
export declare function readFrontmatter(absPath: string): ParsedDocument;
|
|
12
24
|
export interface FreshnessVerdict {
|
|
@@ -2,6 +2,34 @@ import { readFileSync } from "node:fs";
|
|
|
2
2
|
import { parse as parseYaml } from "yaml";
|
|
3
3
|
import { ProvenanceFrontmatter } from "./schemas.js";
|
|
4
4
|
const FENCE_RE = /^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?/;
|
|
5
|
+
/**
|
|
6
|
+
* Extract frontmatter from `source` and return it as an unvalidated
|
|
7
|
+
* `Record<string, unknown>` alongside the remaining body. Returns
|
|
8
|
+
* `{ fm: {}, body: source }` on any parse failure or absent frontmatter.
|
|
9
|
+
*
|
|
10
|
+
* Use this instead of an inline `.match(/^---…/)` when callers need
|
|
11
|
+
* arbitrary field access without a Zod schema.
|
|
12
|
+
*/
|
|
13
|
+
export function parseFrontmatterRecord(source) {
|
|
14
|
+
const match = source.match(FENCE_RE);
|
|
15
|
+
if (match === null || match.index !== 0) {
|
|
16
|
+
return { fm: {}, body: source };
|
|
17
|
+
}
|
|
18
|
+
const raw = match[1] ?? "";
|
|
19
|
+
const body = source.slice(match[0].length);
|
|
20
|
+
if (raw.trim().length === 0)
|
|
21
|
+
return { fm: {}, body };
|
|
22
|
+
try {
|
|
23
|
+
const parsed = parseYaml(raw);
|
|
24
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
25
|
+
return { fm: parsed, body };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
/* ignore — malformed YAML */
|
|
30
|
+
}
|
|
31
|
+
return { fm: {}, body };
|
|
32
|
+
}
|
|
5
33
|
export function parseFrontmatter(source) {
|
|
6
34
|
const match = source.match(FENCE_RE);
|
|
7
35
|
if (!match || match.index !== 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/ground/frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAgD,MAAM,cAAc,CAAC;AAWnG,MAAM,QAAQ,GAAG,yCAAyC,CAAC;AAE3D,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC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C,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAChE,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC7E,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACvF,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC5D,CAAC"}
|
package/dist/ground/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { CANONICAL_GLOBS, CANONICAL_EXCLUDES, decisionsDir, decisionsLedgerPath, groundDir, invariantsDir, invariantsLedgerPath, manifestPath, qualityGradesPath, runsTerminalDir, stalenessCurrentPath, stalenessDir, stalenessLogPath, } from "./paths.js";
|
|
1
|
+
export { CANONICAL_GLOBS, CANONICAL_EXCLUDES, alignmentPendingDir, anchorMapPath, archivedConflictsDir, conflictsDir, decisionsDir, decisionsLedgerPath, groundDir, haikuCacheDir, invariantsDir, invariantsLedgerPath, manifestPath, qualityGradesPath, runsTerminalDir, sotBindingsPath, sotCachePath, sotRenderedCacheDir, layerADeferredLogPath, preCommitDeferredLogPath, stalenessCurrentPath, stalenessDir, stalenessLogPath, topicIndexPath, } from "./paths.js";
|
|
2
2
|
export { matchGlob, matchAnyGlob, compileGlob } from "./glob.js";
|
|
3
3
|
export { walkCanonical } from "./walk.js";
|
|
4
|
-
export { parseFrontmatter, readFrontmatter, evaluateFreshness } from "./frontmatter.js";
|
|
4
|
+
export { parseFrontmatter, parseFrontmatterRecord, readFrontmatter, evaluateFreshness } from "./frontmatter.js";
|
|
5
5
|
export type { ParsedDocument, FreshnessVerdict } from "./frontmatter.js";
|
|
6
6
|
export { buildManifest, writeManifest } from "./manifest.js";
|
|
7
7
|
export type { BuildManifestOptions } from "./manifest.js";
|
|
@@ -9,8 +9,15 @@ export { buildDecisionsLedger, buildInvariantsLedger, writeDecisionsLedger, writ
|
|
|
9
9
|
export type { LedgerOptions } from "./ledgers.js";
|
|
10
10
|
export { recordDriftEvent, writeDriftSnapshot } from "./drift.js";
|
|
11
11
|
export type { DriftSnapshot } from "./drift.js";
|
|
12
|
+
export { writeAlignmentPending } from "./alignment-pending.js";
|
|
13
|
+
export type { AlignmentPendingKind, WriteAlignmentPendingArgs, } from "./alignment-pending.js";
|
|
12
14
|
export { buildQualityGrades, writeQualityGrades } from "./quality-grades.js";
|
|
13
15
|
export type { QualityGradesOptions } from "./quality-grades.js";
|
|
14
16
|
export { coerceDecisionIds, coerceInvariantIds, lookupScope, readScopeIndex, rebuildScopeIndex, rescanScopeIndex, scopeIndexPath, writeScopeIndex, } from "./scope-index.js";
|
|
15
17
|
export type { RebuildScopeIndexOptions, RebuildScopeIndexResult, RescanScopeIndexResult, ScopeIndex, ScopeIndexEntry, } from "./scope-index.js";
|
|
16
|
-
export { Audience, ProvenanceFrontmatter, ManifestEntry, Manifest, DecisionAssertion, DecisionFrontmatter, InvariantFrontmatter, DecisionLedgerEntry, InvariantLedgerEntry, QualityGrade, QualityGrades, DriftEvent, } from "./schemas.js";
|
|
18
|
+
export { AnchorMap, AnchorMapEntry, Audience, ProvenanceFrontmatter, ManifestEntry, Manifest, DecisionAssertion, DecisionFrontmatter, InvariantFrontmatter, DecisionLedgerEntry, InvariantLedgerEntry, QualityGrade, QualityGrades, DriftEvent, PreCommitDriftCandidate, PreCommitDriftLogEntry, SotBindings, SotCache, SotCacheEntry, SotKind, TopicIndex, TopicIndexEntry, } from "./schemas.js";
|
|
19
|
+
export { bindDec, decsForPath, emptySotBindings, pathForDec, readSotBindings, unbindDec, writeSotBindings, } from "./sot-bindings.js";
|
|
20
|
+
export { clearDecFromTopicIndex, emptyTopicIndex, getTopic, readTopicIndex, setTopic, writeTopicIndex, } from "./topic-index.js";
|
|
21
|
+
export { deleteEntry as deleteSotCacheEntry, emptySotCache, entries as sotCacheEntries, getEntry as getSotCacheEntry, readSotCache, setEntry as setSotCacheEntry, writeSotCache, } from "./sot-cache.js";
|
|
22
|
+
export { deleteAnchor, emptyAnchorMap, getAnchor, readAnchorMap, setAnchor, writeAnchorMap, } from "./anchor-map.js";
|
|
23
|
+
export { bodyContentHash, deriveDecId, deriveInvId, deriveLedgerDecId, deriveLedgerInvId, normalizeBlock, topicSlug, } from "./slug.js";
|
package/dist/ground/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
export { CANONICAL_GLOBS, CANONICAL_EXCLUDES, decisionsDir, decisionsLedgerPath, groundDir, invariantsDir, invariantsLedgerPath, manifestPath, qualityGradesPath, runsTerminalDir, stalenessCurrentPath, stalenessDir, stalenessLogPath, } from "./paths.js";
|
|
1
|
+
export { CANONICAL_GLOBS, CANONICAL_EXCLUDES, alignmentPendingDir, anchorMapPath, archivedConflictsDir, conflictsDir, decisionsDir, decisionsLedgerPath, groundDir, haikuCacheDir, invariantsDir, invariantsLedgerPath, manifestPath, qualityGradesPath, runsTerminalDir, sotBindingsPath, sotCachePath, sotRenderedCacheDir, layerADeferredLogPath, preCommitDeferredLogPath, stalenessCurrentPath, stalenessDir, stalenessLogPath, topicIndexPath, } from "./paths.js";
|
|
2
2
|
export { matchGlob, matchAnyGlob, compileGlob } from "./glob.js";
|
|
3
3
|
export { walkCanonical } from "./walk.js";
|
|
4
|
-
export { parseFrontmatter, readFrontmatter, evaluateFreshness } from "./frontmatter.js";
|
|
4
|
+
export { parseFrontmatter, parseFrontmatterRecord, readFrontmatter, evaluateFreshness } from "./frontmatter.js";
|
|
5
5
|
export { buildManifest, writeManifest } from "./manifest.js";
|
|
6
6
|
export { buildDecisionsLedger, buildInvariantsLedger, writeDecisionsLedger, writeInvariantsLedger, } from "./ledgers.js";
|
|
7
7
|
export { recordDriftEvent, writeDriftSnapshot } from "./drift.js";
|
|
8
|
+
export { writeAlignmentPending } from "./alignment-pending.js";
|
|
8
9
|
export { buildQualityGrades, writeQualityGrades } from "./quality-grades.js";
|
|
9
10
|
export { coerceDecisionIds, coerceInvariantIds, lookupScope, readScopeIndex, rebuildScopeIndex, rescanScopeIndex, scopeIndexPath, writeScopeIndex, } from "./scope-index.js";
|
|
10
|
-
export { Audience, ProvenanceFrontmatter, ManifestEntry, Manifest, DecisionAssertion, DecisionFrontmatter, InvariantFrontmatter, DecisionLedgerEntry, InvariantLedgerEntry, QualityGrade, QualityGrades, DriftEvent, } from "./schemas.js";
|
|
11
|
+
export { AnchorMap, AnchorMapEntry, Audience, ProvenanceFrontmatter, ManifestEntry, Manifest, DecisionAssertion, DecisionFrontmatter, InvariantFrontmatter, DecisionLedgerEntry, InvariantLedgerEntry, QualityGrade, QualityGrades, DriftEvent, PreCommitDriftCandidate, PreCommitDriftLogEntry, SotBindings, SotCache, SotCacheEntry, SotKind, TopicIndex, TopicIndexEntry, } from "./schemas.js";
|
|
12
|
+
export { bindDec, decsForPath, emptySotBindings, pathForDec, readSotBindings, unbindDec, writeSotBindings, } from "./sot-bindings.js";
|
|
13
|
+
export { clearDecFromTopicIndex, emptyTopicIndex, getTopic, readTopicIndex, setTopic, writeTopicIndex, } from "./topic-index.js";
|
|
14
|
+
export { deleteEntry as deleteSotCacheEntry, emptySotCache, entries as sotCacheEntries, getEntry as getSotCacheEntry, readSotCache, setEntry as setSotCacheEntry, writeSotCache, } from "./sot-cache.js";
|
|
15
|
+
export { deleteAnchor, emptyAnchorMap, getAnchor, readAnchorMap, setAnchor, writeAnchorMap, } from "./anchor-map.js";
|
|
16
|
+
export { bodyContentHash, deriveDecId, deriveInvId, deriveLedgerDecId, deriveLedgerInvId, normalizeBlock, topicSlug, } from "./slug.js";
|
|
11
17
|
//# sourceMappingURL=index.js.map
|
package/dist/ground/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ground/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ground/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,eAAe,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M,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,SAAS,EACT,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,SAAS,GACV,MAAM,WAAW,CAAC"}
|
package/dist/ground/paths.d.ts
CHANGED
|
@@ -14,7 +14,28 @@ export declare function invariantsDir(repoRoot: string): string;
|
|
|
14
14
|
export declare function decisionsLedgerPath(repoRoot: string): string;
|
|
15
15
|
export declare function invariantsLedgerPath(repoRoot: string): string;
|
|
16
16
|
export declare function qualityGradesPath(repoRoot: string): string;
|
|
17
|
+
export declare function topicIndexPath(repoRoot: string): string;
|
|
18
|
+
export declare function sotBindingsPath(repoRoot: string): string;
|
|
19
|
+
export declare function sotCachePath(repoRoot: string): string;
|
|
20
|
+
export declare function anchorMapPath(repoRoot: string): string;
|
|
21
|
+
export declare function conflictsDir(repoRoot: string): string;
|
|
22
|
+
export declare function archivedConflictsDir(repoRoot: string): string;
|
|
23
|
+
export declare function alignmentPendingDir(repoRoot: string): string;
|
|
24
|
+
export declare function sotRenderedCacheDir(repoRoot: string): string;
|
|
25
|
+
export declare function haikuCacheDir(repoRoot: string): string;
|
|
17
26
|
export declare function stalenessDir(repoRoot: string): string;
|
|
18
27
|
export declare function stalenessLogPath(repoRoot: string): string;
|
|
19
28
|
export declare function stalenessCurrentPath(repoRoot: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Layer A live-hook deferred-block log. PostToolUse Write/Edit appends
|
|
31
|
+
* one rich record per block when the per-Write Haiku cap is exceeded
|
|
32
|
+
* or Pass-2-still-ambiguous fires. Drained by Layer C at SessionStart.
|
|
33
|
+
*/
|
|
34
|
+
export declare function layerADeferredLogPath(repoRoot: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Layer B pre-commit-drift rich log. Git pre-commit hook appends one
|
|
37
|
+
* record per prose block discovered in staged content. Drained by
|
|
38
|
+
* Layer C at SessionStart.
|
|
39
|
+
*/
|
|
40
|
+
export declare function preCommitDeferredLogPath(repoRoot: string): string;
|
|
20
41
|
export declare function runsTerminalDir(repoRoot: string): string;
|
package/dist/ground/paths.js
CHANGED
|
@@ -45,6 +45,33 @@ export function invariantsLedgerPath(repoRoot) {
|
|
|
45
45
|
export function qualityGradesPath(repoRoot) {
|
|
46
46
|
return join(groundDir(repoRoot), "quality-grades.yaml");
|
|
47
47
|
}
|
|
48
|
+
export function topicIndexPath(repoRoot) {
|
|
49
|
+
return join(groundDir(repoRoot), "topic-index.yaml");
|
|
50
|
+
}
|
|
51
|
+
export function sotBindingsPath(repoRoot) {
|
|
52
|
+
return join(groundDir(repoRoot), "sot-bindings.yaml");
|
|
53
|
+
}
|
|
54
|
+
export function sotCachePath(repoRoot) {
|
|
55
|
+
return join(groundDir(repoRoot), "sot-cache.yaml");
|
|
56
|
+
}
|
|
57
|
+
export function anchorMapPath(repoRoot) {
|
|
58
|
+
return join(groundDir(repoRoot), "anchor-map.yaml");
|
|
59
|
+
}
|
|
60
|
+
export function conflictsDir(repoRoot) {
|
|
61
|
+
return join(groundDir(repoRoot), "conflicts");
|
|
62
|
+
}
|
|
63
|
+
export function archivedConflictsDir(repoRoot) {
|
|
64
|
+
return join(conflictsDir(repoRoot), "_archived");
|
|
65
|
+
}
|
|
66
|
+
export function alignmentPendingDir(repoRoot) {
|
|
67
|
+
return join(groundDir(repoRoot), "alignment-pending");
|
|
68
|
+
}
|
|
69
|
+
export function sotRenderedCacheDir(repoRoot) {
|
|
70
|
+
return join(repoRoot, ".cairn", "cache", "sot-rendered");
|
|
71
|
+
}
|
|
72
|
+
export function haikuCacheDir(repoRoot) {
|
|
73
|
+
return join(repoRoot, ".cairn", "cache", "haiku");
|
|
74
|
+
}
|
|
48
75
|
export function stalenessDir(repoRoot) {
|
|
49
76
|
return join(repoRoot, ".cairn", "staleness");
|
|
50
77
|
}
|
|
@@ -54,6 +81,22 @@ export function stalenessLogPath(repoRoot) {
|
|
|
54
81
|
export function stalenessCurrentPath(repoRoot) {
|
|
55
82
|
return join(stalenessDir(repoRoot), "current.json");
|
|
56
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Layer A live-hook deferred-block log. PostToolUse Write/Edit appends
|
|
86
|
+
* one rich record per block when the per-Write Haiku cap is exceeded
|
|
87
|
+
* or Pass-2-still-ambiguous fires. Drained by Layer C at SessionStart.
|
|
88
|
+
*/
|
|
89
|
+
export function layerADeferredLogPath(repoRoot) {
|
|
90
|
+
return join(stalenessDir(repoRoot), "layer-a-deferred.jsonl");
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Layer B pre-commit-drift rich log. Git pre-commit hook appends one
|
|
94
|
+
* record per prose block discovered in staged content. Drained by
|
|
95
|
+
* Layer C at SessionStart.
|
|
96
|
+
*/
|
|
97
|
+
export function preCommitDeferredLogPath(repoRoot) {
|
|
98
|
+
return join(stalenessDir(repoRoot), "pre-commit-deferred.jsonl");
|
|
99
|
+
}
|
|
57
100
|
export function runsTerminalDir(repoRoot) {
|
|
58
101
|
return join(repoRoot, ".cairn", "runs", "terminal");
|
|
59
102
|
}
|
package/dist/ground/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/ground/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW;IACX,WAAW;IACX,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,cAAc;IACd,oBAAoB;IACpB,oBAAoB;IACpB,0BAA0B;CAC3B,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,mCAAmC;IACnC,6BAA6B;IAC7B,+CAA+C;IAC/C,iDAAiD;IACjD,mCAA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AC;AAC3D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,wBAAwB,CAAC,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,2BAA2B,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
package/dist/ground/schemas.d.ts
CHANGED
|
@@ -122,6 +122,18 @@ export declare const DecisionAssertion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
122
122
|
description: z.ZodString;
|
|
123
123
|
}, z.core.$strip>], "kind">;
|
|
124
124
|
export type DecisionAssertion = z.infer<typeof DecisionAssertion>;
|
|
125
|
+
/**
|
|
126
|
+
* sot_kind = where the canonical prose lives for this DEC.
|
|
127
|
+
* "ledger" — body in this DEC file is canonical (source-comment essay,
|
|
128
|
+
* operator-recorded). Lens renders body verbatim.
|
|
129
|
+
* "path" — sot_path points at the canonical location (doc paragraph,
|
|
130
|
+
* CLAUDE.md section). Lens renders live content from there.
|
|
131
|
+
*/
|
|
132
|
+
export declare const SotKind: z.ZodEnum<{
|
|
133
|
+
path: "path";
|
|
134
|
+
ledger: "ledger";
|
|
135
|
+
}>;
|
|
136
|
+
export type SotKind = z.infer<typeof SotKind>;
|
|
125
137
|
export declare const DecisionFrontmatter: z.ZodObject<{
|
|
126
138
|
id: z.ZodString;
|
|
127
139
|
title: z.ZodString;
|
|
@@ -217,6 +229,14 @@ export declare const DecisionFrontmatter: z.ZodObject<{
|
|
|
217
229
|
}, z.core.$strip>], "kind">>>;
|
|
218
230
|
human_review_hint: z.ZodOptional<z.ZodString>;
|
|
219
231
|
related_invariants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
232
|
+
sot_kind: z.ZodEnum<{
|
|
233
|
+
path: "path";
|
|
234
|
+
ledger: "ledger";
|
|
235
|
+
}>;
|
|
236
|
+
sot_path: z.ZodString;
|
|
237
|
+
sot_content_hash: z.ZodString;
|
|
238
|
+
related: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
derived_from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
240
|
}, z.core.$loose>;
|
|
221
241
|
export type DecisionFrontmatter = z.infer<typeof DecisionFrontmatter>;
|
|
222
242
|
export declare const InvariantFrontmatter: z.ZodObject<{
|
|
@@ -225,6 +245,7 @@ export declare const InvariantFrontmatter: z.ZodObject<{
|
|
|
225
245
|
type: z.ZodOptional<z.ZodLiteral<"invariant">>;
|
|
226
246
|
status: z.ZodOptional<z.ZodEnum<{
|
|
227
247
|
superseded: "superseded";
|
|
248
|
+
archived: "archived";
|
|
228
249
|
active: "active";
|
|
229
250
|
}>>;
|
|
230
251
|
audience: z.ZodOptional<z.ZodEnum<{
|
|
@@ -241,6 +262,14 @@ export declare const InvariantFrontmatter: z.ZodObject<{
|
|
|
241
262
|
e2e: z.ZodOptional<z.ZodString>;
|
|
242
263
|
naming_convention: z.ZodOptional<z.ZodString>;
|
|
243
264
|
superseded_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
265
|
+
sot_kind: z.ZodEnum<{
|
|
266
|
+
path: "path";
|
|
267
|
+
ledger: "ledger";
|
|
268
|
+
}>;
|
|
269
|
+
sot_path: z.ZodString;
|
|
270
|
+
sot_content_hash: z.ZodString;
|
|
271
|
+
related: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
272
|
+
derived_from: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
244
273
|
}, z.core.$loose>;
|
|
245
274
|
export type InvariantFrontmatter = z.infer<typeof InvariantFrontmatter>;
|
|
246
275
|
export declare const DecisionLedgerEntry: z.ZodObject<{
|
|
@@ -282,6 +311,132 @@ export declare const QualityGrades: z.ZodObject<{
|
|
|
282
311
|
}, z.core.$strip>>;
|
|
283
312
|
}, z.core.$strip>;
|
|
284
313
|
export type QualityGrades = z.infer<typeof QualityGrades>;
|
|
314
|
+
/**
|
|
315
|
+
* Topic-index entry — one row per content-fingerprint slug across all
|
|
316
|
+
* scanned sources. `sot_source` is the canonical source path picked by
|
|
317
|
+
* priority order (docs/* > CLAUDE.md > AGENTS.md > source comments).
|
|
318
|
+
* `candidates` lists every place the same prose appears (one becomes the
|
|
319
|
+
* SoT, the rest become §DEC-<id> cites).
|
|
320
|
+
*/
|
|
321
|
+
export declare const TopicIndexEntry: z.ZodObject<{
|
|
322
|
+
slug: z.ZodString;
|
|
323
|
+
dec_id: z.ZodOptional<z.ZodString>;
|
|
324
|
+
sot_source: z.ZodString;
|
|
325
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
326
|
+
file: z.ZodString;
|
|
327
|
+
kind: z.ZodEnum<{
|
|
328
|
+
doc: "doc";
|
|
329
|
+
claudemd: "claudemd";
|
|
330
|
+
agentsmd: "agentsmd";
|
|
331
|
+
rule: "rule";
|
|
332
|
+
"source-comment": "source-comment";
|
|
333
|
+
}>;
|
|
334
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
335
|
+
line_range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
336
|
+
}, z.core.$strip>>;
|
|
337
|
+
created_at: z.ZodString;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
export type TopicIndexEntry = z.infer<typeof TopicIndexEntry>;
|
|
340
|
+
export declare const TopicIndex: z.ZodObject<{
|
|
341
|
+
version: z.ZodLiteral<1>;
|
|
342
|
+
generated: z.ZodString;
|
|
343
|
+
topics: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
344
|
+
slug: z.ZodString;
|
|
345
|
+
dec_id: z.ZodOptional<z.ZodString>;
|
|
346
|
+
sot_source: z.ZodString;
|
|
347
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
348
|
+
file: z.ZodString;
|
|
349
|
+
kind: z.ZodEnum<{
|
|
350
|
+
doc: "doc";
|
|
351
|
+
claudemd: "claudemd";
|
|
352
|
+
agentsmd: "agentsmd";
|
|
353
|
+
rule: "rule";
|
|
354
|
+
"source-comment": "source-comment";
|
|
355
|
+
}>;
|
|
356
|
+
anchor: z.ZodOptional<z.ZodString>;
|
|
357
|
+
line_range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
created_at: z.ZodString;
|
|
360
|
+
}, z.core.$strip>>;
|
|
361
|
+
}, z.core.$strip>;
|
|
362
|
+
export type TopicIndex = z.infer<typeof TopicIndex>;
|
|
363
|
+
/**
|
|
364
|
+
* SoT bindings — bidirectional map between DEC ids and their canonical
|
|
365
|
+
* source paths. Forward index is one-to-one. Reverse index is one-to-many
|
|
366
|
+
* because supersedes chains keep the same sot_path across multiple DEC
|
|
367
|
+
* ids.
|
|
368
|
+
*/
|
|
369
|
+
export declare const SotBindings: z.ZodObject<{
|
|
370
|
+
version: z.ZodLiteral<1>;
|
|
371
|
+
generated: z.ZodString;
|
|
372
|
+
forward: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
373
|
+
reverse: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
export type SotBindings = z.infer<typeof SotBindings>;
|
|
376
|
+
/**
|
|
377
|
+
* Sot-cache — tokenized DEC body shingles for Jaccard pre-filter in the
|
|
378
|
+
* Layer A alignment hook. Mtime-keyed so the cache rebuilds incrementally
|
|
379
|
+
* on PostToolUse Write events.
|
|
380
|
+
*/
|
|
381
|
+
export declare const SotCacheEntry: z.ZodObject<{
|
|
382
|
+
dec_id: z.ZodString;
|
|
383
|
+
sot_path: z.ZodString;
|
|
384
|
+
body_hash: z.ZodString;
|
|
385
|
+
tokens: z.ZodArray<z.ZodString>;
|
|
386
|
+
shingles: z.ZodArray<z.ZodString>;
|
|
387
|
+
mtime_ms: z.ZodNumber;
|
|
388
|
+
}, z.core.$strip>;
|
|
389
|
+
export type SotCacheEntry = z.infer<typeof SotCacheEntry>;
|
|
390
|
+
export declare const SotCache: z.ZodObject<{
|
|
391
|
+
version: z.ZodLiteral<1>;
|
|
392
|
+
generated: z.ZodString;
|
|
393
|
+
entries: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
394
|
+
dec_id: z.ZodString;
|
|
395
|
+
sot_path: z.ZodString;
|
|
396
|
+
body_hash: z.ZodString;
|
|
397
|
+
tokens: z.ZodArray<z.ZodString>;
|
|
398
|
+
shingles: z.ZodArray<z.ZodString>;
|
|
399
|
+
mtime_ms: z.ZodNumber;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
export type SotCache = z.infer<typeof SotCache>;
|
|
403
|
+
/**
|
|
404
|
+
* Anchor-map — external map from topic slug to its current location in
|
|
405
|
+
* source. Allows operator's docs to stay pristine (no `<!-- cairn-anchor -->`
|
|
406
|
+
* injected) while drift detection reconciles via content_hash.
|
|
407
|
+
*/
|
|
408
|
+
export declare const AnchorMapEntry: z.ZodObject<{
|
|
409
|
+
file: z.ZodString;
|
|
410
|
+
current_anchor: z.ZodOptional<z.ZodString>;
|
|
411
|
+
content_hash: z.ZodString;
|
|
412
|
+
line_range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
413
|
+
kind: z.ZodEnum<{
|
|
414
|
+
doc: "doc";
|
|
415
|
+
claudemd: "claudemd";
|
|
416
|
+
agentsmd: "agentsmd";
|
|
417
|
+
rule: "rule";
|
|
418
|
+
"source-comment": "source-comment";
|
|
419
|
+
}>;
|
|
420
|
+
}, z.core.$strip>;
|
|
421
|
+
export type AnchorMapEntry = z.infer<typeof AnchorMapEntry>;
|
|
422
|
+
export declare const AnchorMap: z.ZodObject<{
|
|
423
|
+
version: z.ZodLiteral<1>;
|
|
424
|
+
generated: z.ZodString;
|
|
425
|
+
anchors: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
426
|
+
file: z.ZodString;
|
|
427
|
+
current_anchor: z.ZodOptional<z.ZodString>;
|
|
428
|
+
content_hash: z.ZodString;
|
|
429
|
+
line_range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
430
|
+
kind: z.ZodEnum<{
|
|
431
|
+
doc: "doc";
|
|
432
|
+
claudemd: "claudemd";
|
|
433
|
+
agentsmd: "agentsmd";
|
|
434
|
+
rule: "rule";
|
|
435
|
+
"source-comment": "source-comment";
|
|
436
|
+
}>;
|
|
437
|
+
}, z.core.$strip>>;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
export type AnchorMap = z.infer<typeof AnchorMap>;
|
|
285
440
|
export declare const DriftEvent: z.ZodObject<{
|
|
286
441
|
ts: z.ZodString;
|
|
287
442
|
kind: z.ZodEnum<{
|
|
@@ -290,6 +445,9 @@ export declare const DriftEvent: z.ZodObject<{
|
|
|
290
445
|
broken_link: "broken_link";
|
|
291
446
|
orphan_path: "orphan_path";
|
|
292
447
|
manifest_hash_changed: "manifest_hash_changed";
|
|
448
|
+
"doc-drift": "doc-drift";
|
|
449
|
+
"paragraph-deleted": "paragraph-deleted";
|
|
450
|
+
"pre-commit-drift": "pre-commit-drift";
|
|
293
451
|
}>;
|
|
294
452
|
path: z.ZodString;
|
|
295
453
|
detail: z.ZodOptional<z.ZodString>;
|
|
@@ -297,5 +455,48 @@ export declare const DriftEvent: z.ZodObject<{
|
|
|
297
455
|
soft: "soft";
|
|
298
456
|
hard: "hard";
|
|
299
457
|
}>>;
|
|
458
|
+
dec_id: z.ZodOptional<z.ZodString>;
|
|
300
459
|
}, z.core.$strip>;
|
|
301
460
|
export type DriftEvent = z.infer<typeof DriftEvent>;
|
|
461
|
+
/**
|
|
462
|
+
* Layer B pre-commit-drift log entry written by the git pre-commit
|
|
463
|
+
* hook (`cairn hook pre-commit-align`). Layer C SessionStart drain
|
|
464
|
+
* consumes this file, re-checks each entry against the (possibly
|
|
465
|
+
* changed) source location, and runs the Haiku judge for ambiguous
|
|
466
|
+
* candidates.
|
|
467
|
+
*
|
|
468
|
+
* Path: `.cairn/staleness/pre-commit-deferred.jsonl`.
|
|
469
|
+
*
|
|
470
|
+
* `tier: tier1` — deterministic match passed (Jaccard ≥ 0.85, shingle
|
|
471
|
+
* ≥ 0.6, length ratio 0.5–2.0). Layer C can auto-cite without Haiku
|
|
472
|
+
* if the block survives.
|
|
473
|
+
*
|
|
474
|
+
* `tier: tier2-3` — Jaccard pre-filter survivors only; Tier 1 didn't
|
|
475
|
+
* fire. Layer C invokes Haiku dedup judge.
|
|
476
|
+
*/
|
|
477
|
+
export declare const PreCommitDriftCandidate: z.ZodObject<{
|
|
478
|
+
id: z.ZodString;
|
|
479
|
+
similarity: z.ZodNumber;
|
|
480
|
+
body_hash: z.ZodString;
|
|
481
|
+
sot_path: z.ZodString;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
export type PreCommitDriftCandidate = z.infer<typeof PreCommitDriftCandidate>;
|
|
484
|
+
export declare const PreCommitDriftLogEntry: z.ZodObject<{
|
|
485
|
+
ts: z.ZodString;
|
|
486
|
+
file: z.ZodString;
|
|
487
|
+
block_start_line: z.ZodNumber;
|
|
488
|
+
block_end_line: z.ZodNumber;
|
|
489
|
+
block_content_hash: z.ZodString;
|
|
490
|
+
block_prose: z.ZodString;
|
|
491
|
+
tier: z.ZodEnum<{
|
|
492
|
+
tier1: "tier1";
|
|
493
|
+
"tier2-3": "tier2-3";
|
|
494
|
+
}>;
|
|
495
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
496
|
+
id: z.ZodString;
|
|
497
|
+
similarity: z.ZodNumber;
|
|
498
|
+
body_hash: z.ZodString;
|
|
499
|
+
sot_path: z.ZodString;
|
|
500
|
+
}, z.core.$strip>>;
|
|
501
|
+
}, z.core.$strip>;
|
|
502
|
+
export type PreCommitDriftLogEntry = z.infer<typeof PreCommitDriftLogEntry>;
|