daftari 1.32.0 → 3.0.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 (200) hide show
  1. package/CHANGELOG.md +123 -1
  2. package/README.md +472 -342
  3. package/dist/access/rbac.d.ts +1 -0
  4. package/dist/access/rbac.d.ts.map +1 -1
  5. package/dist/access/rbac.js +16 -0
  6. package/dist/access/rbac.js.map +1 -1
  7. package/dist/asof/index.d.ts.map +1 -1
  8. package/dist/asof/index.js +23 -2
  9. package/dist/asof/index.js.map +1 -1
  10. package/dist/asof/report.d.ts.map +1 -1
  11. package/dist/asof/report.js +24 -0
  12. package/dist/asof/report.js.map +1 -1
  13. package/dist/asof/snapshot.d.ts +7 -1
  14. package/dist/asof/snapshot.d.ts.map +1 -1
  15. package/dist/asof/snapshot.js +28 -1
  16. package/dist/asof/snapshot.js.map +1 -1
  17. package/dist/backfill/derive.d.ts.map +1 -1
  18. package/dist/backfill/derive.js +8 -0
  19. package/dist/backfill/derive.js.map +1 -1
  20. package/dist/canary/fixtures.d.ts +12 -0
  21. package/dist/canary/fixtures.d.ts.map +1 -0
  22. package/dist/canary/fixtures.js +132 -0
  23. package/dist/canary/fixtures.js.map +1 -0
  24. package/dist/canary/index.d.ts +16 -0
  25. package/dist/canary/index.d.ts.map +1 -0
  26. package/dist/canary/index.js +105 -0
  27. package/dist/canary/index.js.map +1 -0
  28. package/dist/canary/run.d.ts +39 -0
  29. package/dist/canary/run.d.ts.map +1 -0
  30. package/dist/canary/run.js +266 -0
  31. package/dist/canary/run.js.map +1 -0
  32. package/dist/canary/stats.d.ts +36 -0
  33. package/dist/canary/stats.d.ts.map +1 -0
  34. package/dist/canary/stats.js +143 -0
  35. package/dist/canary/stats.js.map +1 -0
  36. package/dist/canon/index.d.ts +15 -0
  37. package/dist/canon/index.d.ts.map +1 -0
  38. package/dist/canon/index.js +167 -0
  39. package/dist/canon/index.js.map +1 -0
  40. package/dist/canon/resolve.d.ts +12 -0
  41. package/dist/canon/resolve.d.ts.map +1 -0
  42. package/dist/canon/resolve.js +67 -0
  43. package/dist/canon/resolve.js.map +1 -0
  44. package/dist/canon/topic.d.ts +20 -0
  45. package/dist/canon/topic.d.ts.map +1 -0
  46. package/dist/canon/topic.js +81 -0
  47. package/dist/canon/topic.js.map +1 -0
  48. package/dist/canon/types.d.ts +37 -0
  49. package/dist/canon/types.d.ts.map +1 -0
  50. package/dist/canon/types.js +9 -0
  51. package/dist/canon/types.js.map +1 -0
  52. package/dist/cli.d.ts.map +1 -1
  53. package/dist/cli.js +6 -0
  54. package/dist/cli.js.map +1 -1
  55. package/dist/court/index.d.ts.map +1 -1
  56. package/dist/court/index.js +48 -0
  57. package/dist/court/index.js.map +1 -1
  58. package/dist/court/triage.d.ts +5 -0
  59. package/dist/court/triage.d.ts.map +1 -0
  60. package/dist/court/triage.js +71 -0
  61. package/dist/court/triage.js.map +1 -0
  62. package/dist/curation/lint-voice.d.ts +3 -0
  63. package/dist/curation/lint-voice.d.ts.map +1 -0
  64. package/dist/curation/lint-voice.js +87 -0
  65. package/dist/curation/lint-voice.js.map +1 -0
  66. package/dist/curation/lint.d.ts +5 -1
  67. package/dist/curation/lint.d.ts.map +1 -1
  68. package/dist/curation/lint.js +41 -5
  69. package/dist/curation/lint.js.map +1 -1
  70. package/dist/curation/read-heat.d.ts +16 -0
  71. package/dist/curation/read-heat.d.ts.map +1 -0
  72. package/dist/curation/read-heat.js +52 -0
  73. package/dist/curation/read-heat.js.map +1 -0
  74. package/dist/curation/structural.d.ts +1 -1
  75. package/dist/curation/structural.d.ts.map +1 -1
  76. package/dist/curation/structural.js +8 -7
  77. package/dist/curation/structural.js.map +1 -1
  78. package/dist/curation/tension-triage.d.ts +57 -0
  79. package/dist/curation/tension-triage.d.ts.map +1 -0
  80. package/dist/curation/tension-triage.js +155 -0
  81. package/dist/curation/tension-triage.js.map +1 -0
  82. package/dist/curation/validity.d.ts +20 -0
  83. package/dist/curation/validity.d.ts.map +1 -0
  84. package/dist/curation/validity.js +191 -0
  85. package/dist/curation/validity.js.map +1 -0
  86. package/dist/fence/detect.d.ts +10 -0
  87. package/dist/fence/detect.d.ts.map +1 -0
  88. package/dist/fence/detect.js +161 -0
  89. package/dist/fence/detect.js.map +1 -0
  90. package/dist/fence/index.d.ts +22 -0
  91. package/dist/fence/index.d.ts.map +1 -0
  92. package/dist/fence/index.js +117 -0
  93. package/dist/fence/index.js.map +1 -0
  94. package/dist/frontmatter/schema.d.ts.map +1 -1
  95. package/dist/frontmatter/schema.js +28 -1
  96. package/dist/frontmatter/schema.js.map +1 -1
  97. package/dist/frontmatter/types.d.ts +6 -1
  98. package/dist/frontmatter/types.d.ts.map +1 -1
  99. package/dist/frontmatter/types.js +8 -0
  100. package/dist/frontmatter/types.js.map +1 -1
  101. package/dist/holders/registry.d.ts +8 -0
  102. package/dist/holders/registry.d.ts.map +1 -0
  103. package/dist/holders/registry.js +18 -0
  104. package/dist/holders/registry.js.map +1 -0
  105. package/dist/holders/types.d.ts +10 -0
  106. package/dist/holders/types.d.ts.map +1 -0
  107. package/dist/holders/types.js +2 -0
  108. package/dist/holders/types.js.map +1 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +10 -6
  111. package/dist/index.js.map +1 -1
  112. package/dist/interview/questions.d.ts.map +1 -1
  113. package/dist/interview/questions.js +41 -9
  114. package/dist/interview/questions.js.map +1 -1
  115. package/dist/resources.d.ts +27 -0
  116. package/dist/resources.d.ts.map +1 -0
  117. package/dist/resources.js +169 -0
  118. package/dist/resources.js.map +1 -0
  119. package/dist/search/current-source.d.ts +1 -0
  120. package/dist/search/current-source.d.ts.map +1 -1
  121. package/dist/search/current-source.js +3 -1
  122. package/dist/search/current-source.js.map +1 -1
  123. package/dist/search/hybrid.d.ts +6 -1
  124. package/dist/search/hybrid.d.ts.map +1 -1
  125. package/dist/search/hybrid.js +23 -4
  126. package/dist/search/hybrid.js.map +1 -1
  127. package/dist/search/reindex.d.ts.map +1 -1
  128. package/dist/search/reindex.js +48 -13
  129. package/dist/search/reindex.js.map +1 -1
  130. package/dist/search/valid-at-source.d.ts +25 -0
  131. package/dist/search/valid-at-source.d.ts.map +1 -0
  132. package/dist/search/valid-at-source.js +131 -0
  133. package/dist/search/valid-at-source.js.map +1 -0
  134. package/dist/serve/index.d.ts.map +1 -1
  135. package/dist/serve/index.js +58 -89
  136. package/dist/serve/index.js.map +1 -1
  137. package/dist/server.d.ts +3 -1
  138. package/dist/server.d.ts.map +1 -1
  139. package/dist/server.js +159 -11
  140. package/dist/server.js.map +1 -1
  141. package/dist/sleep/cycle.d.ts.map +1 -1
  142. package/dist/sleep/cycle.js +38 -6
  143. package/dist/sleep/cycle.js.map +1 -1
  144. package/dist/storage/index-db.d.ts +7 -1
  145. package/dist/storage/index-db.d.ts.map +1 -1
  146. package/dist/storage/index-db.js +133 -8
  147. package/dist/storage/index-db.js.map +1 -1
  148. package/dist/tools/canon.d.ts +3 -0
  149. package/dist/tools/canon.d.ts.map +1 -0
  150. package/dist/tools/canon.js +177 -0
  151. package/dist/tools/canon.js.map +1 -0
  152. package/dist/tools/consumes.d.ts.map +1 -1
  153. package/dist/tools/consumes.js +47 -1
  154. package/dist/tools/consumes.js.map +1 -1
  155. package/dist/tools/curation.d.ts +4 -0
  156. package/dist/tools/curation.d.ts.map +1 -1
  157. package/dist/tools/curation.js +647 -3
  158. package/dist/tools/curation.js.map +1 -1
  159. package/dist/tools/edge-staleness.d.ts.map +1 -1
  160. package/dist/tools/edge-staleness.js +115 -0
  161. package/dist/tools/edge-staleness.js.map +1 -1
  162. package/dist/tools/edges.d.ts.map +1 -1
  163. package/dist/tools/edges.js +94 -0
  164. package/dist/tools/edges.js.map +1 -1
  165. package/dist/tools/read.d.ts +14 -0
  166. package/dist/tools/read.d.ts.map +1 -1
  167. package/dist/tools/read.js +385 -6
  168. package/dist/tools/read.js.map +1 -1
  169. package/dist/tools/receipt.d.ts +1 -1
  170. package/dist/tools/receipt.d.ts.map +1 -1
  171. package/dist/tools/receipt.js +147 -2
  172. package/dist/tools/receipt.js.map +1 -1
  173. package/dist/tools/search.d.ts.map +1 -1
  174. package/dist/tools/search.js +456 -5
  175. package/dist/tools/search.js.map +1 -1
  176. package/dist/tools/staged-actions.d.ts +7 -0
  177. package/dist/tools/staged-actions.d.ts.map +1 -1
  178. package/dist/tools/staged-actions.js +106 -2
  179. package/dist/tools/staged-actions.js.map +1 -1
  180. package/dist/tools/themes.d.ts.map +1 -1
  181. package/dist/tools/themes.js +120 -0
  182. package/dist/tools/themes.js.map +1 -1
  183. package/dist/tools/tier1.d.ts.map +1 -1
  184. package/dist/tools/tier1.js +56 -0
  185. package/dist/tools/tier1.js.map +1 -1
  186. package/dist/tools/tier2.d.ts.map +1 -1
  187. package/dist/tools/tier2.js +111 -1
  188. package/dist/tools/tier2.js.map +1 -1
  189. package/dist/tools/witness.d.ts.map +1 -1
  190. package/dist/tools/witness.js +93 -0
  191. package/dist/tools/witness.js.map +1 -1
  192. package/dist/tools/write.d.ts +8 -0
  193. package/dist/tools/write.d.ts.map +1 -1
  194. package/dist/tools/write.js +391 -3
  195. package/dist/tools/write.js.map +1 -1
  196. package/dist/utils/config.d.ts +2 -0
  197. package/dist/utils/config.d.ts.map +1 -1
  198. package/dist/utils/config.js +74 -0
  199. package/dist/utils/config.js.map +1 -1
  200. package/package.json +5 -2
package/CHANGELOG.md CHANGED
@@ -5,7 +5,129 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [3.0.0] - 2026-08-05
9
+
10
+ ### Changed
11
+
12
+ - **Retracted-source detection now covers `superseded`, not just `deprecated`, and is renamed.** The read-time structural advisory field `deprecated_still_linked` is now `retired_still_linked`, and the `vault_lint` check `deprecatedStillLinked` is now `retiredStillLinked`. Both now flag canonical documents that still link to a **deprecated _or_ superseded** source (previously only `deprecated`). **Breaking:** consumers keying on the old field/check names must update.
13
+
14
+ ### Added
15
+
16
+ - **Tension-triage card** (`daftari court --triage` / `vault_tension_triage`) — an unranked, cluster-grouped companion to the ranked docket that makes each contested tension's cost legible. Deliberately no severity score: it surfaces the signals and lets the human rank.
17
+ - Each contested side of the triage card surfaces per-side **`criticality`** (`low`/`medium`/`high`), read straight from document frontmatter.
18
+ - Each contested side of the triage card also surfaces **`provenance`** (`direct`/`synthesized`/`inferred`) and **`updated_by`**, so a resolver can judge how each side was obtained and who last touched it without opening the documents.
19
+ - `vault_deprecate` and `vault_supersede` now return a best-effort `dependents` advisory — the RBAC-filtered downstream blast of the retracted document — so the caller immediately sees which documents' grounding just weakened. Advisory only; omitted when the index/docs are unavailable.
20
+ - The nightly `sleep` cycle now wakes a canonical, accumulation-domain document whose frontmatter `sources` cite a deprecated/superseded document, even when the citing document is itself fresh — so a retracted source proactively surfaces its dependents for re-pointing. Self-terminating once the citation is dropped or re-pointed.
21
+
22
+ ## [2.0.0] - 2026-07-30
23
+
24
+ ### Changed
25
+
26
+ - **MCP 2026-07-28.** The server speaks the final "stateless MCP" revision on
27
+ the v2 SDK line (`@modelcontextprotocol/server` 2.0). `daftari serve` is
28
+ stateless per the spec's Decision 1: the initialize handshake, the
29
+ `Mcp-Session-Id` header, and the session table are gone — identity is
30
+ resolved from the bearer on every request against the same config-declared
31
+ map, and 2025-era traffic is refused (no dual-stacking). stdio serves both
32
+ eras from one factory, so lagging clients use stdio; the RBAC,
33
+ existence-disclosure, and process-lock invariants carry over unchanged.
34
+ Design record:
35
+ `docs/superpowers/specs/2026-07-26-mcp-2026-07-28-readiness-design.md`.
36
+ - `vault_ratify` called without a `decision` now answers with a stateless
37
+ form-mode elicitation (`input_required`): approve/reject with reject
38
+ preselected, plus HMAC-signed opaque state carrying the action id, the
39
+ vault HEAD at proposal time, and the deciding user. A declined form applies
40
+ nothing and leaves the action pending; a direct call with the decision
41
+ inline keeps working. The server proposes, the human disposes — now on the
42
+ wire itself (Decision 5).
43
+ - The maintenance passes (`sleep`, `consolidate`, `audit`, `eval`) remain
44
+ CLI-only: the spec's Decision 4 kill condition fired — the final revision
45
+ moved Tasks to a standalone extension (removing `tasks/list`) and the
46
+ TypeScript SDK ships no tasks runtime yet.
47
+
48
+ ### Added
49
+
50
+ - **Ledger-keeper voice for `vault_lint`.** An optional `lint_voice` config key
51
+ (`plain` default, or `ledger_keeper`) re-renders the `content`-channel lint
52
+ summary in the dry margin-note register of a three-centuries-old ledger-keeper.
53
+ Presentation only: it is a deterministic, templated re-wording (no LLM) of the
54
+ same findings the plain summary reports, selecting and capping them identically,
55
+ and the structured output channel is byte-for-byte unchanged. Default-on
56
+ discoverability is gated on a real-user read (the spec's kill condition). Spec:
57
+ `docs/superpowers/specs/2026-07-30-ledger-keeper-voice-design.md`.
58
+
59
+ - **`vault_canon` — settled vs. contested belief over an emergent topic.**
60
+ Read-only. Given a seed document path and optional holder list, `vault_canon` walks
61
+ the depth-2 belief graph and classifies each claim as settled (no
62
+ contradiction recorded) or contested, attaching a `vault_receipt` as the
63
+ epistemic anchor. Honest-relational: `graph_completeness` is always
64
+ `"curated"`, `partial_visibility`, `unindexed`, and `ghost_holder_warning`
65
+ flags are surfaced when the graph is incomplete. Never auto-resolves.
66
+
67
+ - **Bi-temporal validity.** Two optional built-in frontmatter fields,
68
+ `valid_from` and `valid_until`, recording when a document's claim was true
69
+ *in the world* — as distinct from when the vault recorded it, which git
70
+ history and `created`/`updated` already cover. The window is **half-open**,
71
+ `[valid_from, valid_until)`, day-granular: `valid_until` is the first day the
72
+ claim no longer held, so a successor's `valid_from` is exactly its
73
+ predecessor's `valid_until` and a handoff shares no day. Both null means
74
+ valid-time-unknown, which is never read as "always true"; a contradictory
75
+ window (`valid_until <= valid_from`) reads as unknown everywhere and is
76
+ reported by lint, never evaluated.
77
+ Design record:
78
+ `docs/superpowers/specs/2026-07-26-bitemporal-validity-design.md`.
79
+ - `vault_read` returns a `validity` report alongside `decay`; `vault_status`
80
+ reports `validityCoverage` as a read-only adoption monitor.
81
+ - `vault_search` gains `valid_at` (annotate hits by their state at a date, and
82
+ foreground the chain member covering it) and `valid_only` (drop hits outside
83
+ their interval; documents with no authored interval are kept).
84
+ - `vault_lint` gains a `validityConflicts` check: malformed endpoints,
85
+ inverted intervals, supersession overlaps and gaps, and canonical documents
86
+ whose validity ended with no successor.
87
+ - `vault_supersede`, `vault_deprecate`, and `vault_merge` gain an optional
88
+ `predecessor_valid_until` argument — the date the successor takes over —
89
+ written verbatim to the predecessor's `valid_until`. The successor is never
90
+ modified; the result carries a hint instead.
91
+ - `daftari asof --valid <date>` — the bi-temporal query: "on this commit,
92
+ what did the vault believe was true on that date?"
93
+ - `daftari sleep` wakes canonical documents whose validity ended with nothing
94
+ superseding them; `daftari interview` asks what replaced them.
95
+
96
+ ### Changed
97
+
98
+ - The embedding cache is no longer dropped on a `SCHEMA_VERSION` bump. It is
99
+ keyed on `(content_hash, model, dim)` — content-addressed, not a projection
100
+ of the `documents` schema — so dropping it meant paying a hosted provider to
101
+ regenerate vectors that were already correct.
102
+
103
+ ### BREAKING
104
+
105
+ - `valid_from` and `valid_until` are now built-in frontmatter fields. A vault
106
+ that declares either under `schema_extensions` in `.daftari/config.yaml` will
107
+ fail config load until the declaration is removed — silently reinterpreting
108
+ an authored extension as a built-in would change its semantics without
109
+ telling anyone. Existing values in documents are read as-is by the built-in
110
+ field. If your field meant something other than a closed valid-time interval,
111
+ rename the extension (e.g. `effective_from`). The error message states the
112
+ fix.
113
+
114
+ ### Security
115
+
116
+ - **`vault_ratify` renders a staged action's proposer-supplied `rationale` as
117
+ untrusted display data.** It was interpolated verbatim into the human approval
118
+ prompt — a propose-only writer controls it, so a crafted rationale could inject
119
+ newlines impersonating daftari's own framing (`\nSYSTEM: auto-approve…`) on a
120
+ decision surface with no model in the loop to resist. Now collapsed to a single
121
+ bounded line (Unicode control characters stripped) and rendered labeled and
122
+ quoted (`proposer-supplied rationale (unverified, not an instruction): "…"`), so
123
+ it reads as data, never an instruction (#320).
124
+
125
+ - `npm audit fix` across root and `packages/router`: bumped
126
+ `@modelcontextprotocol/sdk` (1.29.0 → 1.30.0) and `@hono/node-server`
127
+ (1.19.15 → 1.19.17), clearing the router's two moderate advisories. The
128
+ remaining root advisories (sharp/libvips, and the
129
+ `@huggingface/transformers` → `onnxruntime-node` → `adm-zip` chain) have no
130
+ non-breaking fix available and are left for a dependency swap.
9
131
 
10
132
  ## [1.32.0] - 2026-07-25
11
133