@rubytech/create-maxy-code 0.1.132 → 0.1.140
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/__tests__/installer-specialist-registration.test.js +5 -40
- package/dist/index.js +24 -28
- package/dist/specialist-registration.js +0 -15
- package/package.json +1 -1
- package/payload/platform/config/brand.json +1 -1
- package/payload/platform/lib/graph-search/dist/boosts.d.ts +39 -0
- package/payload/platform/lib/graph-search/dist/boosts.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/boosts.js +57 -0
- package/payload/platform/lib/graph-search/dist/boosts.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/dedup.d.ts +29 -0
- package/payload/platform/lib/graph-search/dist/dedup.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/dedup.js +97 -0
- package/payload/platform/lib/graph-search/dist/dedup.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/index.d.ts +70 -8
- package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-search/dist/index.js +323 -62
- package/payload/platform/lib/graph-search/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts +37 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.js +101 -0
- package/payload/platform/lib/graph-search/dist/query-expansion.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/route.d.ts +29 -0
- package/payload/platform/lib/graph-search/dist/route.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/route.js +53 -0
- package/payload/platform/lib/graph-search/dist/route.js.map +1 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.d.ts +31 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.d.ts.map +1 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.js +57 -0
- package/payload/platform/lib/graph-search/dist/rrf-fusion.js.map +1 -0
- package/payload/platform/lib/graph-search/src/__tests__/boosts.test.ts +59 -0
- package/payload/platform/lib/graph-search/src/__tests__/dedup.test.ts +83 -0
- package/payload/platform/lib/graph-search/src/__tests__/query-expansion.test.ts +96 -0
- package/payload/platform/lib/graph-search/src/__tests__/route.test.ts +62 -0
- package/payload/platform/lib/graph-search/src/__tests__/rrf-fusion.test.ts +39 -0
- package/payload/platform/lib/graph-search/src/boosts.ts +61 -0
- package/payload/platform/lib/graph-search/src/dedup.ts +108 -0
- package/payload/platform/lib/graph-search/src/index.ts +407 -65
- package/payload/platform/lib/graph-search/src/query-expansion.ts +129 -0
- package/payload/platform/lib/graph-search/src/route.ts +70 -0
- package/payload/platform/lib/graph-search/src/rrf-fusion.ts +62 -0
- package/payload/platform/lib/obsidian-parser/dist/index.d.ts +98 -0
- package/payload/platform/lib/obsidian-parser/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/obsidian-parser/dist/index.js +480 -0
- package/payload/platform/lib/obsidian-parser/dist/index.js.map +1 -0
- package/payload/platform/lib/obsidian-parser/src/index.ts +572 -0
- package/payload/platform/lib/obsidian-parser/tsconfig.json +8 -0
- package/payload/platform/neo4j/schema.cypher +86 -1
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/.claude-plugin/marketplace.json +10 -0
- package/payload/platform/plugins/admin/hooks/session-end-retrospective.sh +4 -2
- package/payload/platform/plugins/admin/mcp/dist/index.js +6 -4
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/docs/references/internals.md +36 -10
- package/payload/platform/plugins/docs/references/neo4j.md +63 -0
- package/payload/platform/plugins/docs/references/plugins-guide.md +2 -0
- package/payload/platform/plugins/docs/references/session-retrospective.md +11 -4
- package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.js +2 -2
- package/payload/platform/plugins/graph-viewer/mcp/dist/tools/graph-render.js.map +1 -1
- package/payload/platform/plugins/memory/PLUGIN.md +3 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js +203 -7
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.js +25 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-gate-property.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.js +70 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/timeline-extractor.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.js +50 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/typed-edge-schema.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts +33 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js +99 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/compiled-truth-rewriter.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts +21 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js +24 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.d.ts +13 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.js +151 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/timeline-extractor.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts +55 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js +290 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-pass.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.d.ts +19 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.js +102 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/typed-edge-schema.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js +18 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js +5 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-update-emit.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-write-emit.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts +64 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js +258 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +14 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +29 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +22 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts +31 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js +182 -50
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +76 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.d.ts +127 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.js +477 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/obsidian-vault-import.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts +30 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js +129 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/session-retrospective-skip-rate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/scripts/backfill-typed-edges.ts +72 -0
- package/payload/platform/plugins/memory/mcp/scripts/generate-edge-docs.ts +75 -0
- package/payload/platform/plugins/memory/mcp/vitest.config.ts +5 -0
- package/payload/platform/plugins/memory/references/schema-base.md +44 -0
- package/payload/platform/plugins/notion-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/notion-import/PLUGIN.md +27 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/SKILL.md +110 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/attachments.md +55 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/databases.md +81 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/page-tree.md +61 -0
- package/payload/platform/plugins/notion-import/skills/notion-import/references/workspace-export.md +41 -0
- package/payload/platform/plugins/obsidian-import/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/obsidian-import/PLUGIN.md +39 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/SKILL.md +92 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/attachments.md +80 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/daily-notes.md +31 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/vault-structure.md +46 -0
- package/payload/platform/plugins/obsidian-import/skills/obsidian-import/references/wikilinks.md +70 -0
- package/payload/platform/scripts/seed-neo4j.sh +49 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +4 -3
- package/payload/platform/templates/specialists/agents/database-operator.md +21 -1
- package/payload/server/{adminuser-self-heal-QAWOZ3JV.js → adminuser-self-heal-YC47O34W.js} +2 -1
- package/payload/server/{chunk-JSBRDJBE.js → chunk-HYQNUVGO.js} +9 -1
- package/payload/server/{chunk-HCYM5FLU.js → chunk-T3DJD5QR.js} +3 -1
- package/payload/server/maxy-edge.js +3 -2
- package/payload/server/public/assets/{admin-FcRHAL-3.js → admin-BM9aXUUh.js} +1 -1
- package/payload/server/public/assets/{data-Ds37mflX.js → data-Ds2ECtfP.js} +1 -1
- package/payload/server/public/assets/{graph-CmWRhaiS.js → graph-BzxObKMM.js} +1 -1
- package/payload/server/public/assets/{graph-labels-Ch2r00Gt.js → graph-labels-Dwgep_nr.js} +1 -1
- package/payload/server/public/assets/{page-BcHhJXUt.js → page-BlkBsjP2.js} +1 -1
- package/payload/server/public/assets/page-h_SA5SVQ.js +51 -0
- package/payload/server/public/data.html +3 -3
- package/payload/server/public/graph.html +3 -3
- package/payload/server/public/index.html +4 -4
- package/payload/server/server.js +803 -76
- package/payload/server/public/assets/page-BOtNny_4.js +0 -51
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Compiled-truth rewriter (Task 306).
|
|
2
|
+
//
|
|
3
|
+
// Given a node's current `compiledTruth` and its most-recent N :TimelineEvent
|
|
4
|
+
// rows, produce a new compiledTruth ≤ 2000 chars. Strictly OAuth-bearer LLM
|
|
5
|
+
// (admin classifier doctrine — never API key). The skill / agent / backfill
|
|
6
|
+
// caller is responsible for: (a) selecting which node to rewrite, (b)
|
|
7
|
+
// enforcing the 7-day operator-edit cooldown, (c) writing the result back.
|
|
8
|
+
// This library is the prompt + LLM call + cap-enforcement only.
|
|
9
|
+
//
|
|
10
|
+
// Output style baseline (this sprint):
|
|
11
|
+
// - ≤ COMPILED_TRUTH_MAX_CHARS
|
|
12
|
+
// - Neutral, declarative voice. Third person.
|
|
13
|
+
// - No hedging adverbs ("likely", "perhaps", "possibly", "presumably").
|
|
14
|
+
// - No first person ("I", "we"), no second person ("you").
|
|
15
|
+
// - No marketing / superlatives.
|
|
16
|
+
//
|
|
17
|
+
// Voice grafting (no AI tells, IDENTITY alignment, BrainBench eval) is
|
|
18
|
+
// deferred — see follow-up task referenced in the task brief.
|
|
19
|
+
import { callOauthLlm, } from "../../../../../lib/oauth-llm/dist/index.js";
|
|
20
|
+
import { COMPILED_TRUTH_MAX_CHARS } from "./graph-write-gate.js";
|
|
21
|
+
const DEFAULT_MODEL = "claude-haiku-4-5";
|
|
22
|
+
const SYSTEM_PROMPT = [
|
|
23
|
+
"You are the compiled-truth rewriter for a personal knowledge graph.",
|
|
24
|
+
"",
|
|
25
|
+
"Your job: produce a neutral, declarative summary of what the operator knows about a subject right now.",
|
|
26
|
+
"",
|
|
27
|
+
"RULES (all binding, never relaxed):",
|
|
28
|
+
`- Output must be ${COMPILED_TRUTH_MAX_CHARS} characters or fewer. This is a hard cap.`,
|
|
29
|
+
"- Third person only. No 'I', 'we', 'you', 'us'.",
|
|
30
|
+
"- Declarative voice. No hedging adverbs (likely, perhaps, possibly, presumably, apparently, seemingly).",
|
|
31
|
+
"- No marketing, no superlatives, no commentary on the operator's relationship with the subject.",
|
|
32
|
+
"- Restate the most-load-bearing facts from the timeline. Drop trivia.",
|
|
33
|
+
"- If the existing compiledTruth contradicts the timeline, the timeline wins.",
|
|
34
|
+
"- Do not invent details that are not present in either the existing truth or the timeline.",
|
|
35
|
+
"- Do not add a preamble (no 'Here is the summary:'). Output the summary directly.",
|
|
36
|
+
].join("\n");
|
|
37
|
+
function buildUserMessage(p) {
|
|
38
|
+
const lines = [];
|
|
39
|
+
lines.push(`Subject: ${p.subjectName}`);
|
|
40
|
+
lines.push(`Label: :${p.subjectLabel}`);
|
|
41
|
+
lines.push("");
|
|
42
|
+
lines.push("Current compiledTruth:");
|
|
43
|
+
lines.push(p.currentTruth ? p.currentTruth : "(empty)");
|
|
44
|
+
lines.push("");
|
|
45
|
+
lines.push(`Timeline events (newest-first, ${p.events.length} shown):`);
|
|
46
|
+
for (const e of p.events) {
|
|
47
|
+
lines.push(`- [${e.occurredAt}] kind=${e.kind}: ${e.summary}`);
|
|
48
|
+
}
|
|
49
|
+
lines.push("");
|
|
50
|
+
lines.push("Rewrite the compiledTruth.");
|
|
51
|
+
return lines.join("\n");
|
|
52
|
+
}
|
|
53
|
+
function isOkText(r) {
|
|
54
|
+
return r.kind === "ok";
|
|
55
|
+
}
|
|
56
|
+
export async function rewriteCompiledTruth(p) {
|
|
57
|
+
if (p.events.length === 0) {
|
|
58
|
+
console.log(`[compiled-truth-rewriter] refused subject="${p.subjectName}" reason=no-events`);
|
|
59
|
+
return { kind: "refused", reason: "no-events" };
|
|
60
|
+
}
|
|
61
|
+
const userMessage = buildUserMessage(p);
|
|
62
|
+
const result = await callOauthLlm({
|
|
63
|
+
model: p.model ?? DEFAULT_MODEL,
|
|
64
|
+
system: SYSTEM_PROMPT,
|
|
65
|
+
userMessage,
|
|
66
|
+
maxTokens: 1024,
|
|
67
|
+
});
|
|
68
|
+
if (!isOkText(result)) {
|
|
69
|
+
console.log(`[compiled-truth-rewriter] llm-failure subject="${p.subjectName}" cause=${result.cause}`);
|
|
70
|
+
return { kind: "llm-failure", fallback: result };
|
|
71
|
+
}
|
|
72
|
+
const truth = result.text.trim();
|
|
73
|
+
const before = p.currentTruth.length;
|
|
74
|
+
const after = truth.length;
|
|
75
|
+
console.log(`[compiled-truth-rewriter] subject="${p.subjectName}" charsBefore=${before} charsAfter=${after} events=${p.events.length}`);
|
|
76
|
+
if (after > COMPILED_TRUTH_MAX_CHARS) {
|
|
77
|
+
// One retry with a stricter prompt before surfacing the over-cap failure.
|
|
78
|
+
// Per eng review: avoids losing the rewrite on a single LLM verbosity slip.
|
|
79
|
+
const stricterResult = await callOauthLlm({
|
|
80
|
+
model: p.model ?? DEFAULT_MODEL,
|
|
81
|
+
system: SYSTEM_PROMPT +
|
|
82
|
+
`\n\nPRIOR ATTEMPT WAS ${after} CHARACTERS — TOO LONG. ` +
|
|
83
|
+
`Tighten to fit ${COMPILED_TRUTH_MAX_CHARS}. Drop the lowest-value sentences first.`,
|
|
84
|
+
userMessage,
|
|
85
|
+
maxTokens: 1024,
|
|
86
|
+
});
|
|
87
|
+
if (!isOkText(stricterResult)) {
|
|
88
|
+
return { kind: "llm-failure", fallback: stricterResult };
|
|
89
|
+
}
|
|
90
|
+
const retry = stricterResult.text.trim();
|
|
91
|
+
if (retry.length > COMPILED_TRUTH_MAX_CHARS) {
|
|
92
|
+
console.log(`[compiled-truth-rewriter] still-too-long subject="${p.subjectName}" retryLen=${retry.length}`);
|
|
93
|
+
return { kind: "too-long", attemptedLen: retry.length };
|
|
94
|
+
}
|
|
95
|
+
return { kind: "ok", compiledTruth: retry };
|
|
96
|
+
}
|
|
97
|
+
return { kind: "ok", compiledTruth: truth };
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=compiled-truth-rewriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiled-truth-rewriter.js","sourceRoot":"","sources":["../../src/lib/compiled-truth-rewriter.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,sEAAsE;AACtE,2EAA2E;AAC3E,gEAAgE;AAChE,EAAE;AACF,uCAAuC;AACvC,iCAAiC;AACjC,gDAAgD;AAChD,0EAA0E;AAC1E,6DAA6D;AAC7D,mCAAmC;AACnC,EAAE;AACF,uEAAuE;AACvE,8DAA8D;AAE9D,OAAO,EACL,YAAY,GAGb,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AA2BjE,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAEzC,MAAM,aAAa,GAAG;IACpB,qEAAqE;IACrE,EAAE;IACF,wGAAwG;IACxG,EAAE;IACF,qCAAqC;IACrC,oBAAoB,wBAAwB,2CAA2C;IACvF,iDAAiD;IACjD,yGAAyG;IACzG,iGAAiG;IACjG,uEAAuE;IACvE,8EAA8E;IAC9E,4FAA4F;IAC5F,mFAAmF;CACpF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,SAAS,gBAAgB,CAAC,CAAgB;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;IACxC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI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AE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC1D,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC9C,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -34,5 +34,26 @@ export type GateResult = {
|
|
|
34
34
|
subReason: "no-admin-user-node" | "admin-user-no-accountid" | "no-business-or-personal-profile";
|
|
35
35
|
message: string;
|
|
36
36
|
};
|
|
37
|
+
/** Compiled-truth cap. ≤2000 chars ≈ 300 words — forces the rewriter to summarise, not transcribe. */
|
|
38
|
+
export declare const COMPILED_TRUTH_MAX_CHARS = 2000;
|
|
39
|
+
export type PropertyGateResult = {
|
|
40
|
+
ok: true;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
reason: "compiled-truth-too-long";
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Property-level write gate (Task 306). Today: one rule — `compiledTruth`
|
|
48
|
+
* must not exceed COMPILED_TRUTH_MAX_CHARS. Used by both `memory-write`
|
|
49
|
+
* and `memory-update`; the rewriter calls it before writing too.
|
|
50
|
+
*
|
|
51
|
+
* Pure / synchronous on purpose — no session needed. Loud-fail on
|
|
52
|
+
* violation so an over-producing rewriter surfaces immediately instead
|
|
53
|
+
* of silently truncating the operator's summary.
|
|
54
|
+
*/
|
|
55
|
+
export declare function checkPropertyWriteGate(args: {
|
|
56
|
+
properties: Record<string, unknown>;
|
|
57
|
+
}): PropertyGateResult;
|
|
37
58
|
export declare function checkGraphWriteGate(args: GateArgs): Promise<GateResult>;
|
|
38
59
|
//# sourceMappingURL=graph-write-gate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-write-gate.d.ts","sourceRoot":"","sources":["../../src/lib/graph-write-gate.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,WAAW;IAC1B,GAAG,CACD,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC;QAAE,OAAO,EAAE,KAAK,CAAC;YAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IACE,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,eAAe,GAAG,mBAAmB,CAAC;IAC9C,SAAS,EACL,oBAAoB,GACpB,yBAAyB,GACzB,iCAAiC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-write-gate.d.ts","sourceRoot":"","sources":["../../src/lib/graph-write-gate.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,WAAW;IAC1B,GAAG,CACD,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC;QAAE,OAAO,EAAE,KAAK,CAAC;YAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IACE,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,eAAe,GAAG,mBAAmB,CAAC;IAC9C,SAAS,EACL,oBAAoB,GACpB,yBAAyB,GACzB,iCAAiC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,sGAAsG;AACtG,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IACE,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,yBAAyB,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC,GAAG,kBAAkB,CAerB;AAaD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAuD7E"}
|
|
@@ -36,6 +36,30 @@
|
|
|
36
36
|
// account, add a composite index on Person(accountId, role) so the
|
|
37
37
|
// hasPersonalProfile subquery doesn't full-scan. Same scaling concern applies
|
|
38
38
|
// to LocalBusiness(accountId) and AdminUser(accountId). Not in 704 scope.
|
|
39
|
+
/** Compiled-truth cap. ≤2000 chars ≈ 300 words — forces the rewriter to summarise, not transcribe. */
|
|
40
|
+
export const COMPILED_TRUTH_MAX_CHARS = 2000;
|
|
41
|
+
/**
|
|
42
|
+
* Property-level write gate (Task 306). Today: one rule — `compiledTruth`
|
|
43
|
+
* must not exceed COMPILED_TRUTH_MAX_CHARS. Used by both `memory-write`
|
|
44
|
+
* and `memory-update`; the rewriter calls it before writing too.
|
|
45
|
+
*
|
|
46
|
+
* Pure / synchronous on purpose — no session needed. Loud-fail on
|
|
47
|
+
* violation so an over-producing rewriter surfaces immediately instead
|
|
48
|
+
* of silently truncating the operator's summary.
|
|
49
|
+
*/
|
|
50
|
+
export function checkPropertyWriteGate(args) {
|
|
51
|
+
const truth = args.properties.compiledTruth;
|
|
52
|
+
if (typeof truth === "string" && truth.length > COMPILED_TRUTH_MAX_CHARS) {
|
|
53
|
+
console.log(`[graph-write-gate] reject reason=compiled-truth-too-long len=${truth.length} cap=${COMPILED_TRUTH_MAX_CHARS}`);
|
|
54
|
+
return {
|
|
55
|
+
ok: false,
|
|
56
|
+
reason: "compiled-truth-too-long",
|
|
57
|
+
message: `compiledTruth length ${truth.length} exceeds cap of ${COMPILED_TRUTH_MAX_CHARS} chars. ` +
|
|
58
|
+
`The rewriter must produce a tighter summary.`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return { ok: true };
|
|
62
|
+
}
|
|
39
63
|
const EXEMPT_LABELS = new Set([
|
|
40
64
|
"Person",
|
|
41
65
|
"LocalBusiness",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-write-gate.js","sourceRoot":"","sources":["../../src/lib/graph-write-gate.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,yEAAyE;AACzE,iEAAiE;AACjE,2EAA2E;AAC3E,4EAA4E;AAC5E,uEAAuE;AACvE,8EAA8E;AAC9E,sEAAsE;AACtE,gDAAgD;AAChD,EAAE;AACF,2BAA2B;AAC3B,uDAAuD;AACvD,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,uEAAuE;AACvE,uEAAuE;AACvE,0DAA0D;AAC1D,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,0EAA0E;AAC1E,6EAA6E;AAC7E,+CAA+C;AAC/C,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,+DAA+D;AAC/D,EAAE;AACF,4EAA4E;AAC5E,mEAAmE;AACnE,8EAA8E;AAC9E,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;AAC9D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DatedStatement {
|
|
2
|
+
occurredAt: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
/** The literal date phrase that triggered the match. Useful for diagnostics. */
|
|
5
|
+
matched: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Extract every dated statement from `body`. One row per sentence containing
|
|
9
|
+
* the first parseable date in that sentence. Sentences without a date are
|
|
10
|
+
* dropped silently (the diagnostic count is the caller's concern).
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractDatedStatements(body: string | null | undefined): DatedStatement[];
|
|
13
|
+
//# sourceMappingURL=timeline-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-extractor.d.ts","sourceRoot":"","sources":["../../src/lib/timeline-extractor.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAkID;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,EAAE,CAcxF"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Deterministic dated-statement extractor for Task 306.
|
|
2
|
+
//
|
|
3
|
+
// Reads a free-text body and returns one row per parseable dated statement.
|
|
4
|
+
// Strictly deterministic — no LLM, no heuristics that could collapse to a
|
|
5
|
+
// catch-all. The 305 typed-edge post-write hook upgrades `kind` from the
|
|
6
|
+
// default "mentioned" to a more specific value asynchronously; until then
|
|
7
|
+
// rows land as `mentioned`, which is the most-faithful default.
|
|
8
|
+
//
|
|
9
|
+
// Date forms recognised (in priority order):
|
|
10
|
+
// 1. ISO date — 2026-03-10, 2026/03/10
|
|
11
|
+
// 2. Day-month-year — 10 March 2026, 10 Mar 2026
|
|
12
|
+
// 3. Month-year — March 2026, Mar 2026
|
|
13
|
+
// 4. "in YYYY" — "in 2018"
|
|
14
|
+
// 5. "since YYYY" — "since 2018"
|
|
15
|
+
// 6. Bare year — 2018 (only when 1900-2099 and surrounded by word boundaries)
|
|
16
|
+
//
|
|
17
|
+
// Coarse forms (bare year, "in YYYY") parse to YYYY-01-01T00:00:00Z so the
|
|
18
|
+
// `occurredAt` index is queryable. Day-precision forms parse exactly.
|
|
19
|
+
//
|
|
20
|
+
// A statement is the sentence containing the parsed date. Summaries
|
|
21
|
+
// truncate to 500 chars at sentence boundaries when possible.
|
|
22
|
+
const MONTHS = {
|
|
23
|
+
jan: 1, january: 1,
|
|
24
|
+
feb: 2, february: 2,
|
|
25
|
+
mar: 3, march: 3,
|
|
26
|
+
apr: 4, april: 4,
|
|
27
|
+
may: 5,
|
|
28
|
+
jun: 6, june: 6,
|
|
29
|
+
jul: 7, july: 7,
|
|
30
|
+
aug: 8, august: 8,
|
|
31
|
+
sep: 9, sept: 9, september: 9,
|
|
32
|
+
oct: 10, october: 10,
|
|
33
|
+
nov: 11, november: 11,
|
|
34
|
+
dec: 12, december: 12,
|
|
35
|
+
};
|
|
36
|
+
const SUMMARY_MAX = 500;
|
|
37
|
+
function pad(n) {
|
|
38
|
+
return n < 10 ? `0${n}` : String(n);
|
|
39
|
+
}
|
|
40
|
+
function isoDay(year, month, day) {
|
|
41
|
+
return `${year}-${pad(month)}-${pad(day)}T00:00:00Z`;
|
|
42
|
+
}
|
|
43
|
+
function isoMonth(year, month) {
|
|
44
|
+
return `${year}-${pad(month)}-01T00:00:00Z`;
|
|
45
|
+
}
|
|
46
|
+
function isoYear(year) {
|
|
47
|
+
return `${year}-01-01T00:00:00Z`;
|
|
48
|
+
}
|
|
49
|
+
function validYear(y) {
|
|
50
|
+
return y >= 1900 && y <= 2099;
|
|
51
|
+
}
|
|
52
|
+
function validMonth(m) {
|
|
53
|
+
return m >= 1 && m <= 12;
|
|
54
|
+
}
|
|
55
|
+
function validDay(d) {
|
|
56
|
+
return d >= 1 && d <= 31;
|
|
57
|
+
}
|
|
58
|
+
/** Split body into sentences (period / question / exclamation followed by space or end). */
|
|
59
|
+
function splitSentences(body) {
|
|
60
|
+
return body
|
|
61
|
+
.split(/(?<=[.?!])\s+/)
|
|
62
|
+
.map((s) => s.trim())
|
|
63
|
+
.filter((s) => s.length > 0);
|
|
64
|
+
}
|
|
65
|
+
function clampSummary(s) {
|
|
66
|
+
if (s.length <= SUMMARY_MAX)
|
|
67
|
+
return s;
|
|
68
|
+
// Truncate at the last sentence boundary inside the cap, else hard-truncate.
|
|
69
|
+
const sliced = s.slice(0, SUMMARY_MAX);
|
|
70
|
+
const lastBoundary = Math.max(sliced.lastIndexOf(". "), sliced.lastIndexOf("? "), sliced.lastIndexOf("! "));
|
|
71
|
+
if (lastBoundary > SUMMARY_MAX * 0.5) {
|
|
72
|
+
return sliced.slice(0, lastBoundary + 1);
|
|
73
|
+
}
|
|
74
|
+
return sliced.slice(0, SUMMARY_MAX - 1) + "…";
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns null if the sentence has no parseable date; otherwise the first
|
|
78
|
+
* matching date and its ISO normalisation.
|
|
79
|
+
*/
|
|
80
|
+
function parseFirstDate(sentence) {
|
|
81
|
+
// 1. ISO date: 2026-03-10 or 2026/03/10
|
|
82
|
+
const iso = sentence.match(/\b(\d{4})[-/](\d{1,2})[-/](\d{1,2})\b/);
|
|
83
|
+
if (iso) {
|
|
84
|
+
const y = Number(iso[1]);
|
|
85
|
+
const m = Number(iso[2]);
|
|
86
|
+
const d = Number(iso[3]);
|
|
87
|
+
if (validYear(y) && validMonth(m) && validDay(d)) {
|
|
88
|
+
return { occurredAt: isoDay(y, m, d), matched: iso[0] };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// 2. Day-month-year: "10 March 2026" / "10 Mar 2026"
|
|
92
|
+
const dmy = sentence.match(/\b(\d{1,2})\s+([A-Za-z]+)\s+(\d{4})\b/);
|
|
93
|
+
if (dmy) {
|
|
94
|
+
const d = Number(dmy[1]);
|
|
95
|
+
const m = MONTHS[dmy[2].toLowerCase()];
|
|
96
|
+
const y = Number(dmy[3]);
|
|
97
|
+
if (m && validYear(y) && validDay(d)) {
|
|
98
|
+
return { occurredAt: isoDay(y, m, d), matched: dmy[0] };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// 3. Month-year: "March 2026" / "Mar 2026"
|
|
102
|
+
const my = sentence.match(/\b([A-Za-z]+)\s+(\d{4})\b/);
|
|
103
|
+
if (my) {
|
|
104
|
+
const m = MONTHS[my[1].toLowerCase()];
|
|
105
|
+
const y = Number(my[2]);
|
|
106
|
+
if (m && validYear(y)) {
|
|
107
|
+
return { occurredAt: isoMonth(y, m), matched: my[0] };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// 4 + 5. "in YYYY" / "since YYYY"
|
|
111
|
+
const inYear = sentence.match(/\b(?:in|since)\s+(\d{4})\b/i);
|
|
112
|
+
if (inYear) {
|
|
113
|
+
const y = Number(inYear[1]);
|
|
114
|
+
if (validYear(y)) {
|
|
115
|
+
return { occurredAt: isoYear(y), matched: inYear[0] };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// 6. Bare year — restrictive: must be 4 digits surrounded by word boundaries
|
|
119
|
+
// and not preceded by "$" (price), ":" (time), or "-" (already part of a
|
|
120
|
+
// date we would have matched above). Cheap defensive guards.
|
|
121
|
+
const bareYear = sentence.match(/(?<![$:\d-])\b(\d{4})\b(?!\s*[-/]\d)/);
|
|
122
|
+
if (bareYear) {
|
|
123
|
+
const y = Number(bareYear[1]);
|
|
124
|
+
if (validYear(y)) {
|
|
125
|
+
return { occurredAt: isoYear(y), matched: bareYear[0] };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Extract every dated statement from `body`. One row per sentence containing
|
|
132
|
+
* the first parseable date in that sentence. Sentences without a date are
|
|
133
|
+
* dropped silently (the diagnostic count is the caller's concern).
|
|
134
|
+
*/
|
|
135
|
+
export function extractDatedStatements(body) {
|
|
136
|
+
if (!body || typeof body !== "string")
|
|
137
|
+
return [];
|
|
138
|
+
const out = [];
|
|
139
|
+
for (const sentence of splitSentences(body)) {
|
|
140
|
+
const hit = parseFirstDate(sentence);
|
|
141
|
+
if (hit) {
|
|
142
|
+
out.push({
|
|
143
|
+
occurredAt: hit.occurredAt,
|
|
144
|
+
summary: clampSummary(sentence),
|
|
145
|
+
matched: hit.matched,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=timeline-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-extractor.js","sourceRoot":"","sources":["../../src/lib/timeline-extractor.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,4EAA4E;AAC5E,0EAA0E;AAC1E,yEAAyE;AACzE,0EAA0E;AAC1E,gEAAgE;AAChE,EAAE;AACF,6CAA6C;AAC7C,mDAAmD;AACnD,uDAAuD;AACvD,iDAAiD;AACjD,sCAAsC;AACtC,yCAAyC;AACzC,yFAAyF;AACzF,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,EAAE;AACF,oEAAoE;AACpE,8DAA8D;AAS9D,MAAM,MAAM,GAA2B;IACrC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;IAChB,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;IAChB,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,GAAG,EAAE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B,OAAO,EAAE,YAAY,CAAC,QAAQ,CAAC;gBAC/B,OAAO,EAAE,GAAG,CAAC,OAAO;aACrB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed-edge auto-extraction pass.
|
|
3
|
+
*
|
|
4
|
+
* Runs once per session at the retrospective turn (admin-spawned via
|
|
5
|
+
* database-operator), or as a one-off backfill. Reads prose-bearing
|
|
6
|
+
* nodes (Message/Page/Meeting/Email/Idea/Note/Post/Report) the operator's
|
|
7
|
+
* account wrote since `sinceIso`, batches them, asks Haiku for typed-edge
|
|
8
|
+
* proposals against the `TYPED_EDGE_ALLOWLIST` schema, validates each
|
|
9
|
+
* proposal inline, and MERGEs accepted edges directly via Cypher with
|
|
10
|
+
* `createdBy` provenance.
|
|
11
|
+
*
|
|
12
|
+
* Continue-on-error: per-batch Haiku failure increments `failed`; per-edge
|
|
13
|
+
* MERGE failure increments `rejected`. A single bad batch never bricks the
|
|
14
|
+
* pass — partial results are returned to the caller.
|
|
15
|
+
*
|
|
16
|
+
* The pass does NOT route through `graph-write-gate`: that gate is a
|
|
17
|
+
* node-precondition surface (AdminUser + LocalBusiness must exist), not
|
|
18
|
+
* an edge-schema validator. Edge validation is owned here against
|
|
19
|
+
* `TYPED_EDGE_ALLOWLIST`.
|
|
20
|
+
*
|
|
21
|
+
* Auth: Haiku is called via Claude Code OAuth — never the Anthropic API key.
|
|
22
|
+
*/
|
|
23
|
+
import type { Session } from "neo4j-driver";
|
|
24
|
+
export interface RunTypedEdgePassArgs {
|
|
25
|
+
/** Neo4j session — caller owns the lifecycle. */
|
|
26
|
+
session: Session;
|
|
27
|
+
/** Account scope. Required: cross-account writes are impossible by query design. */
|
|
28
|
+
accountId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Lower bound on `node.updatedAt` for the enumeration. The session-end
|
|
31
|
+
* retrospective passes the session-start timestamp; backfill passes null
|
|
32
|
+
* to mean "all prose nodes ever written in this account".
|
|
33
|
+
*/
|
|
34
|
+
sinceIso: string | null;
|
|
35
|
+
/** Nodes per Haiku call. Default 8. */
|
|
36
|
+
batchSize?: number;
|
|
37
|
+
/** Conversation id to stamp on `createdBy` provenance. Optional (backfill mode has none). */
|
|
38
|
+
conversationId?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Cap on total nodes processed in one invocation. The backfill pages
|
|
41
|
+
* through Neo4j in 500-node chunks; the retrospective passes its session's
|
|
42
|
+
* worth of nodes and never trips this. Default 500.
|
|
43
|
+
*/
|
|
44
|
+
maxNodes?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface TypedEdgePassResult {
|
|
47
|
+
nodes: number;
|
|
48
|
+
proposed: number;
|
|
49
|
+
accepted: number;
|
|
50
|
+
rejected: number;
|
|
51
|
+
failed: number;
|
|
52
|
+
ms: number;
|
|
53
|
+
}
|
|
54
|
+
export declare function runTypedEdgePass(args: RunTypedEdgePassArgs): Promise<TypedEdgePassResult>;
|
|
55
|
+
//# sourceMappingURL=typed-edge-pass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-edge-pass.d.ts","sourceRoot":"","sources":["../../src/lib/typed-edge-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAc5C,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;CACZ;AA4SD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAiF/F"}
|