daftari 3.0.0 → 3.2.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +11 -5
  3. package/dist/access/locks.d.ts +1 -0
  4. package/dist/access/locks.d.ts.map +1 -1
  5. package/dist/access/locks.js +13 -0
  6. package/dist/access/locks.js.map +1 -1
  7. package/dist/access/rbac.js +3 -3
  8. package/dist/access/rbac.js.map +1 -1
  9. package/dist/asof/git-read.d.ts.map +1 -1
  10. package/dist/asof/git-read.js +4 -0
  11. package/dist/asof/git-read.js.map +1 -1
  12. package/dist/audit/describes.d.ts +7 -0
  13. package/dist/audit/describes.d.ts.map +1 -1
  14. package/dist/audit/describes.js +48 -16
  15. package/dist/audit/describes.js.map +1 -1
  16. package/dist/backfill/derive.d.ts.map +1 -1
  17. package/dist/backfill/derive.js +3 -0
  18. package/dist/backfill/derive.js.map +1 -1
  19. package/dist/curation/lint-voice.d.ts.map +1 -1
  20. package/dist/curation/lint-voice.js +2 -0
  21. package/dist/curation/lint-voice.js.map +1 -1
  22. package/dist/curation/lint.d.ts +1 -1
  23. package/dist/curation/lint.d.ts.map +1 -1
  24. package/dist/curation/lint.js +95 -0
  25. package/dist/curation/lint.js.map +1 -1
  26. package/dist/curation/positions.d.ts +29 -0
  27. package/dist/curation/positions.d.ts.map +1 -0
  28. package/dist/curation/positions.js +164 -0
  29. package/dist/curation/positions.js.map +1 -0
  30. package/dist/curation/staged-actions.d.ts +1 -1
  31. package/dist/curation/staged-actions.d.ts.map +1 -1
  32. package/dist/curation/staged-actions.js +1 -0
  33. package/dist/curation/staged-actions.js.map +1 -1
  34. package/dist/curation/staleness.d.ts +0 -7
  35. package/dist/curation/staleness.d.ts.map +1 -1
  36. package/dist/curation/staleness.js +0 -30
  37. package/dist/curation/staleness.js.map +1 -1
  38. package/dist/curation/tension.d.ts +5 -2
  39. package/dist/curation/tension.d.ts.map +1 -1
  40. package/dist/curation/tension.js +169 -103
  41. package/dist/curation/tension.js.map +1 -1
  42. package/dist/curation/vault-docs.d.ts +10 -0
  43. package/dist/curation/vault-docs.d.ts.map +1 -1
  44. package/dist/curation/vault-docs.js +101 -10
  45. package/dist/curation/vault-docs.js.map +1 -1
  46. package/dist/eval/llm-openrouter.d.ts.map +1 -1
  47. package/dist/eval/llm-openrouter.js +8 -0
  48. package/dist/eval/llm-openrouter.js.map +1 -1
  49. package/dist/frontmatter/schema.d.ts.map +1 -1
  50. package/dist/frontmatter/schema.js +118 -1
  51. package/dist/frontmatter/schema.js.map +1 -1
  52. package/dist/frontmatter/types.d.ts +26 -2
  53. package/dist/frontmatter/types.d.ts.map +1 -1
  54. package/dist/frontmatter/types.js +7 -0
  55. package/dist/frontmatter/types.js.map +1 -1
  56. package/dist/lifecycle/lock.d.ts +2 -0
  57. package/dist/lifecycle/lock.d.ts.map +1 -1
  58. package/dist/lifecycle/lock.js +98 -18
  59. package/dist/lifecycle/lock.js.map +1 -1
  60. package/dist/search/providers/openai-3-small.d.ts.map +1 -1
  61. package/dist/search/providers/openai-3-small.js +8 -0
  62. package/dist/search/providers/openai-3-small.js.map +1 -1
  63. package/dist/search/reindex.d.ts.map +1 -1
  64. package/dist/search/reindex.js +39 -13
  65. package/dist/search/reindex.js.map +1 -1
  66. package/dist/serve/index.d.ts +4 -1
  67. package/dist/serve/index.d.ts.map +1 -1
  68. package/dist/serve/index.js +28 -12
  69. package/dist/serve/index.js.map +1 -1
  70. package/dist/server.d.ts.map +1 -1
  71. package/dist/server.js +2 -0
  72. package/dist/server.js.map +1 -1
  73. package/dist/sleep/cycle.d.ts +12 -0
  74. package/dist/sleep/cycle.d.ts.map +1 -1
  75. package/dist/sleep/cycle.js +98 -2
  76. package/dist/sleep/cycle.js.map +1 -1
  77. package/dist/sleep/report.d.ts.map +1 -1
  78. package/dist/sleep/report.js +31 -0
  79. package/dist/sleep/report.js.map +1 -1
  80. package/dist/storage/index-db.d.ts +1 -0
  81. package/dist/storage/index-db.d.ts.map +1 -1
  82. package/dist/storage/index-db.js +17 -2
  83. package/dist/storage/index-db.js.map +1 -1
  84. package/dist/tools/anchors.d.ts +12 -0
  85. package/dist/tools/anchors.d.ts.map +1 -0
  86. package/dist/tools/anchors.js +64 -0
  87. package/dist/tools/anchors.js.map +1 -0
  88. package/dist/tools/pin-mint.d.ts +49 -0
  89. package/dist/tools/pin-mint.d.ts.map +1 -0
  90. package/dist/tools/pin-mint.js +157 -0
  91. package/dist/tools/pin-mint.js.map +1 -0
  92. package/dist/tools/positions.d.ts +42 -0
  93. package/dist/tools/positions.d.ts.map +1 -0
  94. package/dist/tools/positions.js +711 -0
  95. package/dist/tools/positions.js.map +1 -0
  96. package/dist/tools/read.d.ts +46 -1
  97. package/dist/tools/read.d.ts.map +1 -1
  98. package/dist/tools/read.js +302 -3
  99. package/dist/tools/read.js.map +1 -1
  100. package/dist/tools/repin.d.ts +29 -0
  101. package/dist/tools/repin.d.ts.map +1 -0
  102. package/dist/tools/repin.js +140 -0
  103. package/dist/tools/repin.js.map +1 -0
  104. package/dist/tools/staged-actions.d.ts.map +1 -1
  105. package/dist/tools/staged-actions.js +102 -6
  106. package/dist/tools/staged-actions.js.map +1 -1
  107. package/dist/tools/write.d.ts +30 -2
  108. package/dist/tools/write.d.ts.map +1 -1
  109. package/dist/tools/write.js +149 -12
  110. package/dist/tools/write.js.map +1 -1
  111. package/dist/utils/concurrency.d.ts +2 -0
  112. package/dist/utils/concurrency.d.ts.map +1 -0
  113. package/dist/utils/concurrency.js +39 -0
  114. package/dist/utils/concurrency.js.map +1 -0
  115. package/dist/utils/config.d.ts +3 -0
  116. package/dist/utils/config.d.ts.map +1 -1
  117. package/dist/utils/config.js +45 -0
  118. package/dist/utils/config.js.map +1 -1
  119. package/dist/utils/git.d.ts +3 -0
  120. package/dist/utils/git.d.ts.map +1 -1
  121. package/dist/utils/git.js +34 -1
  122. package/dist/utils/git.js.map +1 -1
  123. package/package.json +2 -2
@@ -0,0 +1,157 @@
1
+ // src/tools/pin-mint.ts
2
+ // JIT anchor-pin minting (U1, citation-anchors spec, R1/R2/R7).
3
+ //
4
+ // `mintDescribesPins` enriches shaless `describes` entries of the form
5
+ // [<repo>:]<path>[::symbol]#L<start>[-<end>]
6
+ // to
7
+ // [<repo>:]<path>[::symbol]#L<start>-<end>@<sha12>
8
+ // using the configured code repo's current working-tree blob id. This is
9
+ // purely a read operation — no file in the vault or any code repo is ever
10
+ // written to (R7). Any failure for a single entry leaves it byte-identical
11
+ // and pushes a reason to `unresolved`; the function never throws (R2).
12
+ import { parseDescribesEntry } from "../audit/describes.js";
13
+ import { loadConfig } from "../utils/config.js";
14
+ import { blobExists, hashObjectFile } from "../utils/git.js";
15
+ // ---------------------------------------------------------------------------
16
+ // Shared helper — also exported for U3
17
+ // ---------------------------------------------------------------------------
18
+ /**
19
+ * Build the minted entry string: `<head>#L<start>-<end>@<sha12>`.
20
+ * `head` is the portion of the entry before any `#L` tail (may include a
21
+ * `::symbol` suffix). `sha` should be exactly 12 hex characters.
22
+ */
23
+ export function formatPin(head, start, end, sha) {
24
+ return `${head}#L${start}-${end}@${sha}`;
25
+ }
26
+ // ---------------------------------------------------------------------------
27
+ // Tail regex: end-anchored shaless line-range suffix
28
+ // ---------------------------------------------------------------------------
29
+ // Matches `#L<start>[-<end>]` at the end of a string — no `@sha` component.
30
+ // Applied ONLY when parseDescribesEntry confirmed no existing pin/malformedPin.
31
+ const SHALESS_TAIL = /^(.*?)#L(\d+)(?:-(\d+))?$/;
32
+ // ---------------------------------------------------------------------------
33
+ // mintDescribesPins
34
+ // ---------------------------------------------------------------------------
35
+ /**
36
+ * Enrich shaless `describes` entries with a working-tree blob sha prefix.
37
+ *
38
+ * For each entry:
39
+ * - If it already has a pin (`@sha` tail) or no `#L` tail → pass through
40
+ * (not counted in minted or unresolved).
41
+ * - If it has a `#L<start>[-<end>]` tail with no `@sha`:
42
+ * - Look up `repo` in `cfg.codeRepos`; absent → unresolved ("no configured repo").
43
+ * - Validate line numbers; end < start → unresolved ("inverted range").
44
+ * - Call `hashObjectFile`; failure (path absent, repo absent, etc.) → unresolved.
45
+ * - Rewrite to `<head>#L<start>-<end>@<sha12>`; check blob presence (committed flag).
46
+ *
47
+ * When `jitAnchors === false` the function returns the input array unchanged
48
+ * with empty minted/unresolved lists (kill-switch, R2 advisory posture).
49
+ *
50
+ * This function is pure with respect to the vault and any code repos —
51
+ * no file is written anywhere (R7).
52
+ */
53
+ export async function mintDescribesPins(vaultRoot, entries) {
54
+ const out = [...entries];
55
+ const minted = [];
56
+ const unresolved = [];
57
+ // Load config; on failure, treat as kill-switch (advisory: never throw).
58
+ let cfg;
59
+ try {
60
+ const cfgResult = loadConfig(vaultRoot);
61
+ if (!cfgResult.ok) {
62
+ // Config malformed — no-op, return untouched.
63
+ return { entries: out, minted, unresolved };
64
+ }
65
+ cfg = { codeRepos: cfgResult.value.codeRepos, jitAnchors: cfgResult.value.jitAnchors };
66
+ }
67
+ catch {
68
+ return { entries: out, minted, unresolved };
69
+ }
70
+ // Kill-switch: jit_anchors: false → return all entries unchanged.
71
+ if (!cfg.jitAnchors) {
72
+ return { entries: out, minted, unresolved };
73
+ }
74
+ for (let i = 0; i < entries.length; i++) {
75
+ const raw = entries[i];
76
+ // Step 1: use parseDescribesEntry (with "" sentinel) to detect existing pins.
77
+ // The "" sentinel means a bare entry would resolve to repo:"" — but we only
78
+ // care about whether pin/malformedPin are set, so the repo resolution is
79
+ // irrelevant here.
80
+ const parsed = parseDescribesEntry(raw, "");
81
+ // Already pinned (pin present) or malformed pin → pass through.
82
+ if (parsed.pin !== undefined || parsed.malformedPin) {
83
+ continue;
84
+ }
85
+ // Check for a shaless #L tail on the raw entry.
86
+ const tailMatch = raw.match(SHALESS_TAIL);
87
+ if (!tailMatch) {
88
+ // No #L tail → bare binding, pass through.
89
+ continue;
90
+ }
91
+ // Extract head (everything before #L) and line numbers.
92
+ const head = tailMatch[1];
93
+ const startRaw = Number.parseInt(tailMatch[2], 10);
94
+ const endRaw = tailMatch[3] !== undefined ? Number.parseInt(tailMatch[3], 10) : startRaw;
95
+ // Validate line numbers (invalid line numbers before inverted-range check).
96
+ if (startRaw <= 0 || endRaw <= 0) {
97
+ unresolved.push({
98
+ entry: raw,
99
+ reason: `invalid line numbers: start=${startRaw}, end=${endRaw} (must be >= 1)`,
100
+ });
101
+ continue;
102
+ }
103
+ if (endRaw < startRaw) {
104
+ unresolved.push({
105
+ entry: raw,
106
+ reason: `inverted range: end (${endRaw}) < start (${startRaw})`,
107
+ });
108
+ continue;
109
+ }
110
+ // Resolve repo. Re-parse via parseDescribesEntry to get the repo name and
111
+ // clean path from `head` (the portion before the `#L` tail). `parsed` from
112
+ // step 1 was called on the full `raw` string which has no @sha suffix but
113
+ // still has the `#L<n>` tail, so `parsed.path` includes that tail — it
114
+ // cannot be reused directly for hashing. We pass "" as sourceRepo so bare
115
+ // (unprefixed) entries resolve to "", which is never in codeRepos —
116
+ // matching the candidate filter in read.ts ~line 493-497.
117
+ const parsedHead = parseDescribesEntry(head, "");
118
+ const repoName = parsedHead.repo; // "" for bare entries, or the declared repo prefix
119
+ const repoRoot = cfg.codeRepos[repoName];
120
+ if (repoRoot === undefined) {
121
+ unresolved.push({
122
+ entry: raw,
123
+ reason: `no configured repo for prefix "${repoName}"`,
124
+ });
125
+ continue;
126
+ }
127
+ // Hash the working-tree file (read-only, never -w).
128
+ let sha40;
129
+ try {
130
+ const hashResult = await hashObjectFile(repoRoot, parsedHead.path);
131
+ if (!hashResult.ok) {
132
+ unresolved.push({ entry: raw, reason: hashResult.error.message });
133
+ continue;
134
+ }
135
+ sha40 = hashResult.value;
136
+ }
137
+ catch (e) {
138
+ const reason = e instanceof Error ? e.message : String(e);
139
+ unresolved.push({ entry: raw, reason });
140
+ continue;
141
+ }
142
+ const sha12 = sha40.slice(0, 12);
143
+ const pinned = formatPin(head, startRaw, endRaw, sha12);
144
+ // Check whether the blob is committed.
145
+ let committed;
146
+ try {
147
+ committed = await blobExists(repoRoot, sha40);
148
+ }
149
+ catch {
150
+ committed = false;
151
+ }
152
+ out[i] = pinned;
153
+ minted.push({ entry: raw, pinned, committed });
154
+ }
155
+ return { entries: out, minted, unresolved };
156
+ }
157
+ //# sourceMappingURL=pin-mint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin-mint.js","sourceRoot":"","sources":["../../src/tools/pin-mint.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,gEAAgE;AAChE,EAAE;AACF,uEAAuE;AACvE,+CAA+C;AAC/C,KAAK;AACL,qDAAqD;AACrD,yEAAyE;AACzE,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAgC7D,8EAA8E;AAC9E,uCAAuC;AACvC,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW,EAAE,GAAW;IAC7E,OAAO,GAAG,IAAI,KAAK,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AAC3C,CAAC;AAED,8EAA8E;AAC9E,qDAAqD;AACrD,8EAA8E;AAE9E,4EAA4E;AAC5E,gFAAgF;AAChF,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAEjD,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAiB,EACjB,OAAiB;IAEjB,MAAM,GAAG,GAAa,CAAC,GAAG,OAAO,CAAC,CAAC;IACnC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,UAAU,GAAsB,EAAE,CAAC;IAEzC,yEAAyE;IACzE,IAAI,GAA+D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 import { type AccessContext } from "../access/rbac.js";
2
+ import { type Confidence, type OrgPosition, type Position, type Result } from "../frontmatter/types.js";
3
+ import { type ToolDefinition } from "./read.js";
4
+ export interface AssertResult {
5
+ path: string;
6
+ action: "assert" | "staged";
7
+ position: Position | null;
8
+ superseded_position_id: string | null;
9
+ contested: boolean;
10
+ tension_ids: string[];
11
+ tension_error?: string;
12
+ commit: string | null;
13
+ committed: boolean;
14
+ staged_id?: string;
15
+ expires_at?: string;
16
+ conflicts_with?: string[];
17
+ }
18
+ export declare function vaultAssert(vaultRoot: string, args: Record<string, unknown>, access?: AccessContext): Promise<Result<AssertResult, Error>>;
19
+ export interface ConsolidateResult {
20
+ path: string;
21
+ action: "consolidate";
22
+ org_position: OrgPosition;
23
+ confidence: Confidence;
24
+ dissent: string[];
25
+ contested: boolean | null;
26
+ resolved_tension_id: string | null;
27
+ resolve_error?: string;
28
+ commit: string | null;
29
+ committed: boolean;
30
+ }
31
+ export declare function vaultConsolidate(vaultRoot: string, args: Record<string, unknown>, access?: AccessContext): Promise<Result<ConsolidateResult, Error>>;
32
+ export interface PositionsResult {
33
+ count: number;
34
+ positions: Array<{
35
+ path: string;
36
+ position: Position;
37
+ contested: boolean;
38
+ }>;
39
+ }
40
+ export declare function vaultPositions(vaultRoot: string, args: Record<string, unknown>, access?: AccessContext): Promise<Result<PositionsResult, Error>>;
41
+ export declare const positionsTools: ToolDefinition[];
42
+ //# sourceMappingURL=positions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../src/tools/positions.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,mBAAmB,CAAC;AAoB3B,OAAO,EAEL,KAAK,UAAU,EAGf,KAAK,WAAW,EAEhB,KAAK,QAAQ,EAGb,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAiC9D,M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