daftari 1.15.0 → 1.17.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 (103) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +8 -2
  3. package/dist/backfill/apply.d.ts +14 -0
  4. package/dist/backfill/apply.d.ts.map +1 -0
  5. package/dist/backfill/apply.js +111 -0
  6. package/dist/backfill/apply.js.map +1 -0
  7. package/dist/backfill/derive.d.ts +25 -0
  8. package/dist/backfill/derive.d.ts.map +1 -0
  9. package/dist/backfill/derive.js +142 -0
  10. package/dist/backfill/derive.js.map +1 -0
  11. package/dist/backfill/index.d.ts +2 -0
  12. package/dist/backfill/index.d.ts.map +1 -0
  13. package/dist/backfill/index.js +232 -0
  14. package/dist/backfill/index.js.map +1 -0
  15. package/dist/backfill/plan.d.ts +19 -0
  16. package/dist/backfill/plan.d.ts.map +1 -0
  17. package/dist/backfill/plan.js +157 -0
  18. package/dist/backfill/plan.js.map +1 -0
  19. package/dist/backfill/types.d.ts +19 -0
  20. package/dist/backfill/types.d.ts.map +1 -0
  21. package/dist/backfill/types.js +10 -0
  22. package/dist/backfill/types.js.map +1 -0
  23. package/dist/cli.d.ts.map +1 -1
  24. package/dist/cli.js +15 -0
  25. package/dist/cli.js.map +1 -1
  26. package/dist/curation/lint.d.ts +3 -0
  27. package/dist/curation/lint.d.ts.map +1 -1
  28. package/dist/curation/lint.js +5 -0
  29. package/dist/curation/lint.js.map +1 -1
  30. package/dist/curation/staged-actions.d.ts +68 -0
  31. package/dist/curation/staged-actions.d.ts.map +1 -0
  32. package/dist/curation/staged-actions.js +394 -0
  33. package/dist/curation/staged-actions.js.map +1 -0
  34. package/dist/eval/generate.d.ts +12 -0
  35. package/dist/eval/generate.d.ts.map +1 -0
  36. package/dist/eval/generate.js +221 -0
  37. package/dist/eval/generate.js.map +1 -0
  38. package/dist/eval/index.d.ts +2 -0
  39. package/dist/eval/index.d.ts.map +1 -0
  40. package/dist/eval/index.js +311 -0
  41. package/dist/eval/index.js.map +1 -0
  42. package/dist/eval/llm.d.ts +47 -0
  43. package/dist/eval/llm.d.ts.map +1 -0
  44. package/dist/eval/llm.js +165 -0
  45. package/dist/eval/llm.js.map +1 -0
  46. package/dist/eval/prompts.d.ts +5 -0
  47. package/dist/eval/prompts.d.ts.map +1 -0
  48. package/dist/eval/prompts.js +44 -0
  49. package/dist/eval/prompts.js.map +1 -0
  50. package/dist/eval/run.d.ts +13 -0
  51. package/dist/eval/run.d.ts.map +1 -0
  52. package/dist/eval/run.js +78 -0
  53. package/dist/eval/run.js.map +1 -0
  54. package/dist/eval/score.d.ts +12 -0
  55. package/dist/eval/score.d.ts.map +1 -0
  56. package/dist/eval/score.js +154 -0
  57. package/dist/eval/score.js.map +1 -0
  58. package/dist/eval/storage.d.ts +10 -0
  59. package/dist/eval/storage.d.ts.map +1 -0
  60. package/dist/eval/storage.js +69 -0
  61. package/dist/eval/storage.js.map +1 -0
  62. package/dist/eval/subgraph.d.ts +17 -0
  63. package/dist/eval/subgraph.d.ts.map +1 -0
  64. package/dist/eval/subgraph.js +214 -0
  65. package/dist/eval/subgraph.js.map +1 -0
  66. package/dist/eval/tool-surface.d.ts +7 -0
  67. package/dist/eval/tool-surface.d.ts.map +1 -0
  68. package/dist/eval/tool-surface.js +160 -0
  69. package/dist/eval/tool-surface.js.map +1 -0
  70. package/dist/eval/types.d.ts +173 -0
  71. package/dist/eval/types.d.ts.map +1 -0
  72. package/dist/eval/types.js +44 -0
  73. package/dist/eval/types.js.map +1 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +11 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/search/reindex.d.ts.map +1 -1
  78. package/dist/search/reindex.js +6 -0
  79. package/dist/search/reindex.js.map +1 -1
  80. package/dist/server.d.ts.map +1 -1
  81. package/dist/server.js +2 -0
  82. package/dist/server.js.map +1 -1
  83. package/dist/storage/index-db.d.ts +19 -0
  84. package/dist/storage/index-db.d.ts.map +1 -1
  85. package/dist/storage/index-db.js +56 -0
  86. package/dist/storage/index-db.js.map +1 -1
  87. package/dist/tools/curation.d.ts +2 -1
  88. package/dist/tools/curation.d.ts.map +1 -1
  89. package/dist/tools/curation.js +18 -4
  90. package/dist/tools/curation.js.map +1 -1
  91. package/dist/tools/staged-actions.d.ts +18 -0
  92. package/dist/tools/staged-actions.d.ts.map +1 -0
  93. package/dist/tools/staged-actions.js +275 -0
  94. package/dist/tools/staged-actions.js.map +1 -0
  95. package/dist/utils/config.d.ts +1 -0
  96. package/dist/utils/config.d.ts.map +1 -1
  97. package/dist/utils/config.js +32 -0
  98. package/dist/utils/config.js.map +1 -1
  99. package/dist/utils/git.d.ts +6 -0
  100. package/dist/utils/git.d.ts.map +1 -1
  101. package/dist/utils/git.js +34 -0
  102. package/dist/utils/git.js.map +1 -1
  103. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,78 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.17.0] - 2026-06-07
11
+
12
+ ### Added
13
+
14
+ - **`daftari backfill` git-driven frontmatter migration** (cortex consolidation
15
+ loop §11.1). A CLI command that adopts an existing wiki into Daftari without a
16
+ manual migration sprint: it walks the vault, derives frontmatter defaults
17
+ deterministically (no LLM calls) from git history and body conventions, and
18
+ writes them per-folder on human ratification. Two-step plan/apply:
19
+ `daftari backfill --plan [--scope <folder>]` derives proposals and stages them
20
+ to `.daftari/backfill-plan.jsonl` (modifying no markdown), and
21
+ `daftari backfill --apply --scope <folder> [--yes]` writes the proposals for
22
+ one folder and commits them in a single commit (honoring the vault's
23
+ `auto_commit` setting — with `auto_commit: false` the files are written but
24
+ the caller owns git, matching the other write tools). `--scope` is required on
25
+ apply so a whole-vault write can never happen by accident. Derivation: `title`
26
+ from the first H1 (else the filename), `created`/`updated`/`updated_by` from
27
+ git (`--diff-filter=A` first-add, last-commit, author through an optional
28
+ `backfill.identity_map` in `.daftari/config.yaml`), `collection` from the
29
+ parent folder, and `status: canonical` / `confidence: medium` /
30
+ `provenance: direct` / `domain: accumulation` defaults — explicitly suggested,
31
+ ratified by a human, never asserted. Existing frontmatter is preserved
32
+ field-by-field; a doc whose frontmatter already validates is reported
33
+ conformant and skipped. The plan is transient: backfill never stages or
34
+ commits it (apply stages only the doc paths), the apply commit is the durable
35
+ audit trail, and `.daftari/backfill-plan.jsonl` is added to the `daftari
36
+ --init` .gitignore template (a `--plan` run also prints a reminder to gitignore
37
+ it on wikis not scaffolded by Daftari). CLI-only for v1 — no MCP tool. See
38
+ [docs/superpowers/specs/2026-06-06-cortex-consolidation-loop-design-direction.md](docs/superpowers/specs/2026-06-06-cortex-consolidation-loop-design-direction.md)
39
+ §11.1.
40
+ - **Staged-action queue + `vault_ratify`** (cortex loop §11.2). A persistent
41
+ queue of proposed vault changes awaiting human ratification — the foundation
42
+ for the consolidation loop's "always-stage" tier. Two new MCP tools:
43
+ `vault_stage_action` (producer; normally the curation loop, exposed for
44
+ testing and future callers) records a proposed `promote` / `deprecate` /
45
+ `supersede` / `merge` / `confidence-up` action with a rationale, a proposed
46
+ diff, and a TTL (default 14 days); `vault_ratify` (consumer) lets a human
47
+ `approve` or `reject` one pending action. On approve, it dispatches to the
48
+ existing write path — `promote` → `vault_promote`, `deprecate` →
49
+ `vault_deprecate` (both auto-commit). `supersede` / `merge` / `confidence-up`
50
+ are staged only in v1 (their write tools are deferred to §11.4); approving
51
+ one returns `applied: false` with `deferred_to: "§11.4"` and a
52
+ `ratified-pending-tool` status. Storage mirrors the rest of Daftari: an
53
+ append-only canonical log at `.daftari/staged-actions.jsonl` (the source of
54
+ truth) plus a derived `staged_actions` table in the ephemeral
55
+ `.daftari/index.db`, rebuilt from the jsonl on reindex and startup.
56
+ `vault_lint` gains a "Staged actions" section listing pending actions
57
+ soonest-to-expire first, and expires actions past their TTL as a housekeeping
58
+ sweep on each invocation. See
59
+ [docs/superpowers/specs/2026-06-06-cortex-consolidation-loop-design-direction.md](docs/superpowers/specs/2026-06-06-cortex-consolidation-loop-design-direction.md)
60
+ §11.2.
61
+
62
+ ## [1.16.0] - 2026-06-02
63
+
64
+ ### Added
65
+
66
+ - **`daftari eval` cortex quality metric** (Sleep Component B). New CLI
67
+ subcommand that scores how well an LLM can use the Daftari MCP curation
68
+ surface to answer multi-hop questions about the vault. Three tiers
69
+ (retrieval, cross-reference, contradiction) with a tier-weighted aggregate
70
+ (1×/2×/3×) plus per-tier variance and trace-efficiency. The pipeline is
71
+ seeded subgraph sampling → LLM question generation (with tier-mix top-up
72
+ and tension-graph augmentation) → in-process answerer over the existing
73
+ read-only tool surface → LLM grading. Runs persist incrementally, so a
74
+ failed run is resumable with `--resume`. Generator/answerer/grader are all
75
+ LLM-mediated via `@anthropic-ai/sdk` (new dependency, isolated to
76
+ `src/eval/llm.ts`); the rest of the codebase stays LLM-free. Output
77
+ artifacts live under `.daftari/eval/` (gitignored). Components A (multi-pass
78
+ curation) and C (dependency-triggered re-curation) are deferred to
79
+ follow-on specs. See
80
+ [docs/superpowers/specs/2026-05-31-cortex-quality-metric-design.md](docs/superpowers/specs/2026-05-31-cortex-quality-metric-design.md).
81
+
10
82
  ## [1.15.0] - 2026-05-31
11
83
 
12
84
  ### Added
package/README.md CHANGED
@@ -23,8 +23,9 @@ session ends.
23
23
 
24
24
  Daftari takes the other path: **compilation over retrieval.** The agent
25
25
  synthesizes an answer once, writes it back as a durable document, and every
26
- later read starts from that compiled result. The vault gets better the more it
27
- is used.
26
+ later read starts from that compiled result. The compiler is the agent;
27
+ Daftari is the substrate that catches and persists what the agent
28
+ consolidates. The vault gets better the more it is used.
28
29
 
29
30
  A human cortex doesn’t re-derive everything from sensory input each time it
30
31
  thinks. It consolidates: experiences become memories, memories become
@@ -72,6 +73,11 @@ The curation engine is advisory: `vault_lint` reports problems and
72
73
  `vault_tension_log` records contradictions. Neither auto-fixes anything. Every
73
74
  change is a deliberate, attributable act.
74
75
 
76
+ **Evaluate (opt-in, requires an Anthropic API key):** `daftari eval` — scores how
77
+ well an LLM can use the curation surface to answer multi-hop questions about the
78
+ vault. See the [design spec](docs/superpowers/specs/2026-05-31-cortex-quality-metric-design.md)
79
+ for the rationale and the cortex framing.
80
+
75
81
  ## Two kinds of knowledge
76
82
 
77
83
  Every document declares a `domain`. The distinction drives how the curation
@@ -0,0 +1,14 @@
1
+ import { type Result } from "../frontmatter/types.js";
2
+ export interface SkippedDoc {
3
+ path: string;
4
+ reason: string;
5
+ }
6
+ export interface ApplyResult {
7
+ scope: string;
8
+ applied: string[];
9
+ unchanged: string[];
10
+ skipped: SkippedDoc[];
11
+ commit: string | null;
12
+ }
13
+ export declare function applyPlan(vaultRoot: string, scope: string, agent: string): Promise<Result<ApplyResult, Error>>;
14
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/backfill/apply.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAU1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,OAAO,EAAE,UAAU,EAAE,CAAC;IAEtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAkCD,wBAAsB,SAAS,CAC7B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAwErC"}
@@ -0,0 +1,111 @@
1
+ // Plan application for `daftari backfill` (§11.1).
2
+ //
3
+ // `applyPlan` reads the plan, takes only the entries under the given scope
4
+ // (per-folder ratification), and writes each doc's proposed frontmatter through
5
+ // the same primitives the write tools use: validate, serialize, then one git
6
+ // commit for the whole scope. The body is taken from the file on disk at apply
7
+ // time, so a body edited between plan and apply is preserved; only frontmatter
8
+ // is filled.
9
+ //
10
+ // --scope is required (the CLI enforces it) so a whole-vault write can never
11
+ // happen by accident. The run is idempotent: a doc whose on-disk content
12
+ // already equals the proposed serialization is left untouched, so re-applying
13
+ // an already-applied folder is a no-op (and never produces an empty commit).
14
+ import { writeFile } from "node:fs/promises";
15
+ import { recordProvenance } from "../curation/provenance.js";
16
+ import { parseDocument } from "../frontmatter/parser.js";
17
+ import { validateFrontmatter } from "../frontmatter/schema.js";
18
+ import { ok } from "../frontmatter/types.js";
19
+ import { readFile, resolveVaultPath } from "../storage/local.js";
20
+ import { serializeDocument } from "../tools/write.js";
21
+ import { loadConfig } from "../utils/config.js";
22
+ import { commit } from "../utils/git.js";
23
+ import { planPath, readPlan } from "./plan.js";
24
+ // Serializes one plan entry against the file's current body. Returns the new
25
+ // file text, or a reason it cannot be written.
26
+ function renderEntry(entry, currentText, extensions) {
27
+ const parsed = parseDocument(currentText);
28
+ if (!parsed.ok)
29
+ return parsed;
30
+ // Guard: never write frontmatter the validator would reject. A non-conformant
31
+ // doc whose *present* field is itself malformed (so preservation carries the
32
+ // bad value through) is reported, not written.
33
+ const { report } = validateFrontmatter(entry.proposed);
34
+ if (!report.valid) {
35
+ const summary = report.issues.map((i) => `${i.field}: ${i.message}`).join("; ");
36
+ return { ok: false, error: new Error(`proposed frontmatter is invalid: ${summary}`) };
37
+ }
38
+ // Preserve any config-extension fields present on disk by passing the current
39
+ // raw frontmatter through to the serializer.
40
+ const text = serializeDocument(entry.proposed, parsed.value.content, extensions, parsed.value.raw);
41
+ return ok(text);
42
+ }
43
+ // Applies all plan entries under `scope`. Writes only changed docs and commits
44
+ // them in a single commit authored by `agent`.
45
+ export async function applyPlan(vaultRoot, scope, agent) {
46
+ const plan = await readPlan(planPath(vaultRoot));
47
+ if (!plan.ok)
48
+ return plan;
49
+ const config = loadConfig(vaultRoot);
50
+ if (!config.ok)
51
+ return config;
52
+ const extensions = config.value.schemaExtensions;
53
+ const inScope = plan.value.filter((e) => e.scope === scope);
54
+ const applied = [];
55
+ const unchanged = [];
56
+ const skipped = [];
57
+ for (const entry of inScope) {
58
+ const resolved = resolveVaultPath(vaultRoot, entry.path);
59
+ if (!resolved.ok) {
60
+ skipped.push({ path: entry.path, reason: resolved.error.message });
61
+ continue;
62
+ }
63
+ const existing = await readFile(resolved.value);
64
+ if (!existing.ok) {
65
+ skipped.push({ path: entry.path, reason: existing.error.message });
66
+ continue;
67
+ }
68
+ const rendered = renderEntry(entry, existing.value, extensions);
69
+ if (!rendered.ok) {
70
+ skipped.push({ path: entry.path, reason: rendered.error.message });
71
+ continue;
72
+ }
73
+ // Idempotence: identical bytes → no write, no stage, no commit churn.
74
+ if (rendered.value === existing.value) {
75
+ unchanged.push(entry.path);
76
+ continue;
77
+ }
78
+ try {
79
+ await writeFile(resolved.value, rendered.value, "utf-8");
80
+ }
81
+ catch (e) {
82
+ const reason = e instanceof Error ? e.message : String(e);
83
+ skipped.push({ path: entry.path, reason: `write failed: ${reason}` });
84
+ continue;
85
+ }
86
+ applied.push(entry.path);
87
+ }
88
+ // One commit for the whole scope. Skipped entirely when nothing changed (no
89
+ // empty commits) or when the vault is configured with auto_commit: false.
90
+ let commitHash = null;
91
+ if (applied.length > 0 && config.value.autoCommit) {
92
+ const message = `vault_backfill: ${scope} — ${applied.length} ` +
93
+ `${applied.length === 1 ? "doc" : "docs"} frontmatter backfilled by ${agent}`;
94
+ const committed = await commit(vaultRoot, applied, message, agent);
95
+ if (!committed.ok)
96
+ return committed;
97
+ commitHash = committed.value.hash;
98
+ }
99
+ // Advisory provenance, per applied doc. Best-effort: a log failure does not
100
+ // fail the backfill (the commit is the durable record).
101
+ for (const path of applied) {
102
+ await recordProvenance(vaultRoot, {
103
+ tool: "vault_backfill",
104
+ file: path,
105
+ agent,
106
+ action: "backfill",
107
+ });
108
+ }
109
+ return ok({ scope, applied, unchanged, skipped, commit: commitHash });
110
+ }
111
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/backfill/apply.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,aAAa;AACb,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAe,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAwB,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAsB/C,6EAA6E;AAC7E,+CAA+C;AAC/C,SAAS,WAAW,CAClB,KAAgB,EAChB,WAAmB,EACnB,UAA6B;IAE7B,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC;IAE9B,8EAA8E;IAC9E,6EAA6E;IAC7E,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,KAAK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K,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { Frontmatter } from "../frontmatter/types.js";
2
+ import type { FileGitMeta } from "../utils/git.js";
3
+ import type { DerivationMap, DocClassification } from "./types.js";
4
+ export declare function slugify(value: string): string;
5
+ export declare function firstH1(body: string): string | null;
6
+ export declare function titleFromFilename(relPath: string): string;
7
+ export declare function parseQuestionSection(body: string, heading: string): string[];
8
+ export declare function mapIdentity(author: string, identityMap: Record<string, string>): string;
9
+ export declare function classifyDoc(raw: Record<string, unknown>): DocClassification;
10
+ export interface DeriveInputs {
11
+ relPath: string;
12
+ body: string;
13
+ raw: Record<string, unknown>;
14
+ coerced: Frontmatter;
15
+ git: FileGitMeta;
16
+ mtimeDate: string;
17
+ identityMap: Record<string, string>;
18
+ invoker: string;
19
+ }
20
+ export interface DerivedFrontmatter {
21
+ proposed: Frontmatter;
22
+ derivation: DerivationMap;
23
+ }
24
+ export declare function deriveProposed(input: DeriveInputs): DerivedFrontmatter;
25
+ //# sourceMappingURL=derive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/backfill/derive.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAInE,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM7C;AAID,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnD;AAID,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKzD;AAKD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAqB5E;AAID,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIvF;AAeD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAG3E;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAG7B,OAAO,EAAE,WAAW,CAAC;IACrB,GAAG,EAAE,WAAW,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,aAAa,CAAC;CAC3B;AAKD,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,kBAAkB,CA6EtE"}
@@ -0,0 +1,142 @@
1
+ // Deterministic frontmatter derivation for `daftari backfill` (§11.1).
2
+ //
3
+ // No LLM calls: every value comes from git metadata, body conventions, the
4
+ // path, or a fixed default. The contract is "suggest, don't assert" — adopted
5
+ // docs are proposed as canonical/medium/direct, but a human ratifies per folder
6
+ // before anything is written. Existing frontmatter is never overwritten: a
7
+ // present field is preserved verbatim, only missing fields are filled.
8
+ import { validateFrontmatter } from "../frontmatter/schema.js";
9
+ // kebab-case a free-form string: lowercase, non-alphanumerics → single hyphen,
10
+ // trimmed. Used for collection names and the identity fallback slug.
11
+ export function slugify(value) {
12
+ return value
13
+ .toLowerCase()
14
+ .replace(/[^a-z0-9]+/g, "-")
15
+ .replace(/-+/g, "-")
16
+ .replace(/^-+|-+$/g, "");
17
+ }
18
+ // The first ATX H1 (`# Title`) in the body, or null. Only a single leading `#`
19
+ // counts — `##` and deeper are sub-headings, not the document title.
20
+ export function firstH1(body) {
21
+ for (const line of body.split(/\r?\n/)) {
22
+ const m = line.match(/^#\s+(.+?)\s*#*\s*$/);
23
+ if (m)
24
+ return m[1].trim();
25
+ }
26
+ return null;
27
+ }
28
+ // Title-cased title derived from a filename when the body has no H1. Strips the
29
+ // `.md`, splits the basename on `-`/`_`, and capitalizes each word.
30
+ export function titleFromFilename(relPath) {
31
+ const base = (relPath.split("/").pop() ?? relPath).replace(/\.md$/i, "");
32
+ const words = base.split(/[-_]+/).filter((w) => w.length > 0);
33
+ if (words.length === 0)
34
+ return base;
35
+ return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
36
+ }
37
+ // Bullet items under a `## <heading>` section, in order. Collection stops at the
38
+ // next heading of any level. Placeholder bullets (empty, or fully parenthical
39
+ // like "(none yet)") are dropped — they are scaffolding, not real questions.
40
+ export function parseQuestionSection(body, heading) {
41
+ const lines = body.split(/\r?\n/);
42
+ const target = heading.toLowerCase();
43
+ const out = [];
44
+ let inSection = false;
45
+ for (const line of lines) {
46
+ const headingMatch = line.match(/^#{1,6}\s+(.+?)\s*#*\s*$/);
47
+ if (headingMatch) {
48
+ const text = headingMatch[1].trim().toLowerCase();
49
+ inSection = text === target;
50
+ continue;
51
+ }
52
+ if (!inSection)
53
+ continue;
54
+ const bullet = line.match(/^\s*[-*]\s+(.*\S)\s*$/);
55
+ if (!bullet)
56
+ continue;
57
+ const item = bullet[1].trim();
58
+ if (item.length === 0)
59
+ continue;
60
+ if (item.startsWith("(") && item.endsWith(")"))
61
+ continue;
62
+ out.push(item);
63
+ }
64
+ return out;
65
+ }
66
+ // Maps a git author name to a Daftari identity: an explicit identity_map entry
67
+ // wins; otherwise the default `human:<slug>` fallback.
68
+ export function mapIdentity(author, identityMap) {
69
+ const mapped = identityMap[author];
70
+ if (mapped)
71
+ return mapped;
72
+ return `human:${slugify(author) || "unknown"}`;
73
+ }
74
+ // A frontmatter field is "present" — and therefore preserved — when the raw
75
+ // YAML carries a non-null, non-empty-string value for it. Empty arrays count as
76
+ // present (the author wrote `[]` deliberately).
77
+ function isPresent(raw, field) {
78
+ const v = raw[field];
79
+ if (v === undefined || v === null)
80
+ return false;
81
+ if (typeof v === "string" && v.length === 0)
82
+ return false;
83
+ return true;
84
+ }
85
+ // Whether a document needs backfilling. A doc whose existing frontmatter
86
+ // already validates against the built-in schema is conformant and skipped;
87
+ // otherwise it is `missing` (no frontmatter at all) or `partial`.
88
+ export function classifyDoc(raw) {
89
+ if (validateFrontmatter(raw).report.valid)
90
+ return "conformant";
91
+ return Object.keys(raw).length === 0 ? "missing" : "partial";
92
+ }
93
+ // Builds the full proposed frontmatter for a non-conformant doc plus a per-field
94
+ // derivation map. Present fields are preserved (coerced value, label
95
+ // "preserved"); missing fields are derived from git / body / path / defaults.
96
+ export function deriveProposed(input) {
97
+ const { relPath, body, raw, coerced, git, mtimeDate, identityMap, invoker } = input;
98
+ const derivation = {};
99
+ // Resolves one field: if present in raw, preserve the coerced value; else use
100
+ // the derived value. Records the chosen source label either way.
101
+ function resolve(field, derivedValue, derivedLabel) {
102
+ if (isPresent(raw, field)) {
103
+ derivation[field] = "preserved";
104
+ return coerced[field];
105
+ }
106
+ derivation[field] = derivedLabel;
107
+ return derivedValue;
108
+ }
109
+ // title ← H1, else filename.
110
+ const h1 = firstH1(body);
111
+ const title = resolve("title", h1 ?? titleFromFilename(relPath), h1 ? "body-h1" : "filename");
112
+ // collection ← first path component, kebab-cased.
113
+ const folder = relPath.split("/")[0] ?? "";
114
+ const collection = resolve("collection", slugify(folder), "parent-folder");
115
+ // created/updated ← git, else file mtime.
116
+ const created = resolve("created", git.created ?? mtimeDate, git.created ? "git-first-commit" : "file-mtime");
117
+ const updated = resolve("updated", git.updated ?? mtimeDate, git.updated ? "git-last-commit" : "file-mtime");
118
+ // updated_by ← git author mapped through identity config, else invoker.
119
+ const updatedBy = resolve("updated_by", git.author ? mapIdentity(git.author, identityMap) : invoker, git.author ? "git-author + identity-map" : "invoker-fallback");
120
+ // questions ← body sections, else empty.
121
+ const qAnswered = parseQuestionSection(body, "Questions Answered");
122
+ const qRaised = parseQuestionSection(body, "Questions Raised");
123
+ const proposed = {
124
+ title,
125
+ domain: resolve("domain", "accumulation", "default"),
126
+ collection,
127
+ status: resolve("status", "canonical", "default"),
128
+ confidence: resolve("confidence", "medium", "default"),
129
+ created,
130
+ updated,
131
+ updated_by: updatedBy,
132
+ provenance: resolve("provenance", "direct", "default"),
133
+ sources: resolve("sources", [], "empty"),
134
+ superseded_by: resolve("superseded_by", null, "null"),
135
+ ttl_days: resolve("ttl_days", null, "null"),
136
+ tags: resolve("tags", [], "empty"),
137
+ questions_answered: resolve("questions_answered", qAnswered, qAnswered.length > 0 ? "body-section" : "empty"),
138
+ questions_raised: resolve("questions_raised", qRaised, qRaised.length > 0 ? "body-section" : "empty"),
139
+ };
140
+ return { proposed, derivation };
141
+ }
142
+ //# sourceMappingURL=derive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derive.js","sourceRoot":"","sources":["../../src/backfill/derive.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,gFAAgF;AAChF,2EAA2E;AAC3E,uEAAuE;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D,+EAA+E;AAC/E,qEAAqE;AACrE,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,+EAA+E;AAC/E,qEAAqE;AACrE,MAAM,UAAU,OAAO,CAAC,IAAY;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AAE,SAAS,CAAC;QACtD,OAAO;QACP,OAAO;QACP,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC;QACtD,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,OAAO,CAAC;QACxC,aAAa,EAAE,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,MAAM,CAAC;QACrD,QAAQ,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC;QAC3C,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,CAAC;QAClC,kBAAkB,EAAE,OAAO,CACzB,oBAAoB,EACpB,SAAS,EACT,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAChD;QACD,gBAAgB,EAAE,OAAO,CACvB,kBAAkB,EAClB,OAAO,EACP,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAC9C;KACF,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function runBackfill(argv: string[]): Promise<number>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/backfill/index.ts"],"names":[],"mappings":"AA+IA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA8GjE"}