@tenphi/akno-core 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/default.jsonc +3 -0
- package/dist/bench/language.d.ts +2 -2
- package/dist/config/load.js +1 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +9 -1
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +4 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/maintenance/dream.d.ts +2 -0
- package/dist/maintenance/dream.d.ts.map +1 -1
- package/dist/maintenance/dream.js +25 -1
- package/dist/maintenance/dream.js.map +1 -1
- package/dist/maintenance/path-policy.d.ts +1 -1
- package/dist/maintenance/path-policy.d.ts.map +1 -1
- package/dist/maintenance/path-policy.js +6 -0
- package/dist/maintenance/path-policy.js.map +1 -1
- package/dist/maintenance/plans.d.ts +4 -2
- package/dist/maintenance/plans.d.ts.map +1 -1
- package/dist/maintenance/plans.js +43 -4
- package/dist/maintenance/plans.js.map +1 -1
- package/dist/maintenance/profile.d.ts.map +1 -1
- package/dist/maintenance/profile.js +3 -0
- package/dist/maintenance/profile.js.map +1 -1
- package/dist/maintenance/runs.d.ts +1 -0
- package/dist/maintenance/runs.d.ts.map +1 -1
- package/dist/maintenance/runs.js +1 -0
- package/dist/maintenance/runs.js.map +1 -1
- package/dist/maintenance/timeline-history.d.ts +61 -0
- package/dist/maintenance/timeline-history.d.ts.map +1 -0
- package/dist/maintenance/timeline-history.js +464 -0
- package/dist/maintenance/timeline-history.js.map +1 -0
- package/dist/models/semantic-verdict.d.ts +3 -3
- package/dist/ops/answer-source-audit.d.ts +9 -9
- package/dist/reserved.d.ts +1 -1
- package/dist/reserved.js +1 -1
- package/dist/write/ledger.d.ts.map +1 -1
- package/dist/write/ledger.js +4 -2
- package/dist/write/ledger.js.map +1 -1
- package/dist/write/retention-negative-evidence.d.ts +8 -8
- package/package.json +2 -2
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import fsp from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { hasInlineMergeConflict, quarantineReasonsForPath } from "../index/page-quarantine.js";
|
|
4
|
+
import { parsePage, resolvePagePolicy } from "../kb/page.js";
|
|
5
|
+
import { effectiveRule } from "../rules/compile.js";
|
|
6
|
+
import { isReserved } from "../reserved.js";
|
|
7
|
+
import { sha256 } from "../store/ids.js";
|
|
8
|
+
import { owningTimeline, timelineCatalog } from "../timeline/boundaries.js";
|
|
9
|
+
import { routeLegacyEvent } from "../timeline/route-event.js";
|
|
10
|
+
import { formatEventLine, insertEvent, newLedger } from "../write/ledger.js";
|
|
11
|
+
import { runRetain } from "../write/retain.js";
|
|
12
|
+
export function emptyTimelineHistoryReport() {
|
|
13
|
+
return { inspected: 0, cached: 0, additions: 0, relocations: 0, held: {} };
|
|
14
|
+
}
|
|
15
|
+
/** A declaration admits bounded history work, never a whole-page rewrite or an index-time write. */
|
|
16
|
+
export async function planTimelineHistory(ctx, options = {}) {
|
|
17
|
+
const report = emptyTimelineHistoryReport();
|
|
18
|
+
const degraded = new Set();
|
|
19
|
+
const result = () => ({ drafts: [], report, degraded: [...degraded] });
|
|
20
|
+
const hold = (reason) => {
|
|
21
|
+
report.held[reason] = (report.held[reason] ?? 0) + 1;
|
|
22
|
+
};
|
|
23
|
+
const limit = ctx.config.maintenance.curate.maxTimelineEvents;
|
|
24
|
+
if (limit === 0)
|
|
25
|
+
return result();
|
|
26
|
+
const catalog = timelineCatalog(ctx.config, ctx.store);
|
|
27
|
+
const ledgers = catalog.filter((entry) => entry.status === 'ready' && entry.writable);
|
|
28
|
+
if (!ledgers.length)
|
|
29
|
+
return result();
|
|
30
|
+
const sources = new Map();
|
|
31
|
+
// Every declaration participates in routing. Changing an untouched description must also stale a plan.
|
|
32
|
+
for (const entry of catalog) {
|
|
33
|
+
if (entry.status !== 'ready')
|
|
34
|
+
continue;
|
|
35
|
+
const content = await readHistorySource(ctx, entry.path);
|
|
36
|
+
if (content === null) {
|
|
37
|
+
hold('source_unavailable');
|
|
38
|
+
return result();
|
|
39
|
+
}
|
|
40
|
+
sources.set(entry.path, { relPath: entry.path, content, hash: sha256(content) });
|
|
41
|
+
}
|
|
42
|
+
if ([...sources.keys()].some((file) => options.protectedPaths?.has(file))) {
|
|
43
|
+
hold('limit');
|
|
44
|
+
return result();
|
|
45
|
+
}
|
|
46
|
+
const before = new Map(ledgers.map((entry) => [entry.path, sources.get(entry.path).content]));
|
|
47
|
+
const after = new Map(before);
|
|
48
|
+
const actions = [];
|
|
49
|
+
const scans = [];
|
|
50
|
+
const boundaries = boundaryFingerprint(catalog);
|
|
51
|
+
const routingInput = sha256(JSON.stringify([
|
|
52
|
+
boundaries,
|
|
53
|
+
[...sources.values()].map(({ relPath, hash }) => [relPath, hash]),
|
|
54
|
+
ctx.config.rules,
|
|
55
|
+
ctx.models.derive.endpointFingerprint,
|
|
56
|
+
'timeline-history-v1',
|
|
57
|
+
]));
|
|
58
|
+
let calls = 0;
|
|
59
|
+
const cache = (key, fingerprint) => {
|
|
60
|
+
if (options.recordState && ctx.writable)
|
|
61
|
+
ctx.store.setMeta(key, fingerprint);
|
|
62
|
+
};
|
|
63
|
+
const proofFor = (planned, extra) => ({
|
|
64
|
+
boundaries,
|
|
65
|
+
catalog,
|
|
66
|
+
actions: planned,
|
|
67
|
+
scans,
|
|
68
|
+
sources: [...sources.values(), ...(extra && !sources.has(extra.relPath) ? [extra] : [])].map((source) => catalog.some((entry) => entry.path === source.relPath)
|
|
69
|
+
? { relPath: source.relPath, hash: source.hash }
|
|
70
|
+
: source),
|
|
71
|
+
});
|
|
72
|
+
const operationsFor = (planned) => [...planned].flatMap(([relPath, content]) => content === before.get(relPath)
|
|
73
|
+
? []
|
|
74
|
+
: [
|
|
75
|
+
{
|
|
76
|
+
type: 'replace',
|
|
77
|
+
relPath,
|
|
78
|
+
before: before.get(relPath),
|
|
79
|
+
beforeHash: sha256(before.get(relPath)),
|
|
80
|
+
after: content,
|
|
81
|
+
afterHash: sha256(content),
|
|
82
|
+
},
|
|
83
|
+
]);
|
|
84
|
+
const append = (action, source) => {
|
|
85
|
+
if (options.protectedPaths?.has(action.destination) ||
|
|
86
|
+
(action.kind === 'relocate' && options.protectedPaths?.has(action.source))) {
|
|
87
|
+
hold('limit');
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
const proposed = applyHistoryActions(before, [...actions, action]);
|
|
91
|
+
if (!proposed ||
|
|
92
|
+
[...proposed.values()].some((content) => Buffer.byteLength(content) > ctx.config.maxPageBytes)) {
|
|
93
|
+
hold('limit');
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
// The curator must receive complete evidence. Its transport has a 100k-character envelope;
|
|
97
|
+
// leave room for plan metadata instead of silently slicing a larger historical batch.
|
|
98
|
+
if (JSON.stringify({
|
|
99
|
+
operations: operationsFor(proposed),
|
|
100
|
+
evidence: timelineHistoryEvidence(proofFor([...actions, action], source)),
|
|
101
|
+
}).length > 80_000) {
|
|
102
|
+
hold('limit');
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (source)
|
|
106
|
+
sources.set(source.relPath, source);
|
|
107
|
+
for (const [file, content] of proposed)
|
|
108
|
+
after.set(file, content);
|
|
109
|
+
actions.push(action);
|
|
110
|
+
if (action.kind === 'extract')
|
|
111
|
+
report.additions++;
|
|
112
|
+
else
|
|
113
|
+
report.relocations++;
|
|
114
|
+
return true;
|
|
115
|
+
};
|
|
116
|
+
// Move only down an existing boundary tree. This cannot oscillate between sibling ledgers.
|
|
117
|
+
for (const ledger of ledgers) {
|
|
118
|
+
if (!catalog.some((entry) => isDescendant(ledger, entry)))
|
|
119
|
+
continue;
|
|
120
|
+
const content = before.get(ledger.path);
|
|
121
|
+
for (const event of parsePage(ledger.path, content).events) {
|
|
122
|
+
if (actions.length >= limit || calls >= limit) {
|
|
123
|
+
hold('limit');
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
const line = content.split('\n')[event.line - 1];
|
|
127
|
+
if (!standaloneEventLine(content, line)) {
|
|
128
|
+
hold('source_ineligible');
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const key = `timeline-history:move:${sha256(ledger.path + '\0' + line)}`;
|
|
132
|
+
const fingerprint = sha256(routingInput + line);
|
|
133
|
+
if (ctx.store.meta(key) === fingerprint) {
|
|
134
|
+
report.cached++;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (!ctx.models.derive.available) {
|
|
138
|
+
hold('model_unavailable');
|
|
139
|
+
degraded.add('no_derive_model');
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
report.inspected++;
|
|
143
|
+
calls++;
|
|
144
|
+
const routed = await routeLegacyEvent({ date: event.date, summary: line }, catalog, ctx.models.derive);
|
|
145
|
+
if (routed.degraded)
|
|
146
|
+
degraded.add(routed.degraded);
|
|
147
|
+
if (!routed.timeline) {
|
|
148
|
+
hold(routed.degraded ? 'model_failed' : 'ownership_uncertain');
|
|
149
|
+
if (!routed.degraded)
|
|
150
|
+
cache(key, fingerprint);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const target = routed.timeline;
|
|
154
|
+
if (target.slug === ledger.slug) {
|
|
155
|
+
cache(key, fingerprint);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (!isDescendant(ledger, target) || !after.has(target.path)) {
|
|
159
|
+
hold('destination_unavailable');
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
// A similar sentence is not an exact duplicate: never delete its provenance by fuzzy matching.
|
|
163
|
+
if (append({ kind: 'relocate', source: ledger.path, destination: target.path, line }))
|
|
164
|
+
scans.push({ key, fingerprint });
|
|
165
|
+
else if (!actions.length)
|
|
166
|
+
cache(key, fingerprint);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const rows = ctx.store.db.prepare('SELECT slug, rel_path FROM pages ORDER BY rel_path').all();
|
|
170
|
+
let inspectedPages = 0;
|
|
171
|
+
for (const row of rows) {
|
|
172
|
+
if (sources.has(row.rel_path) || isReserved(row.slug, ctx.config))
|
|
173
|
+
continue;
|
|
174
|
+
if (actions.length >= limit || inspectedPages >= ctx.config.maintenance.curate.maxPages) {
|
|
175
|
+
hold('limit');
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
const owner = owningTimeline(catalog, row.slug);
|
|
179
|
+
if (!after.has(owner.path) || options.protectedPaths?.has(row.rel_path))
|
|
180
|
+
continue;
|
|
181
|
+
const content = await readHistorySource(ctx, row.rel_path);
|
|
182
|
+
if (content === null) {
|
|
183
|
+
hold('source_unavailable');
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const page = parsePage(row.rel_path, content);
|
|
187
|
+
// No file timestamp is an event date. Undated notes need foreground retention with a source clock.
|
|
188
|
+
if (!/\b\d{4}\b/u.test(page.body))
|
|
189
|
+
continue;
|
|
190
|
+
if (!eligibleHistoryPage(ctx, row.rel_path, content)) {
|
|
191
|
+
hold('source_ineligible');
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const key = `timeline-history:extract:${sha256(row.rel_path)}`;
|
|
195
|
+
const fingerprint = sha256(routingInput + sha256(content));
|
|
196
|
+
if (ctx.store.meta(key) === fingerprint) {
|
|
197
|
+
report.cached++;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (!ctx.models.derive.available) {
|
|
201
|
+
hold('model_unavailable');
|
|
202
|
+
degraded.add('no_derive_model');
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (JSON.stringify({ content, catalog }).length > 60_000) {
|
|
206
|
+
hold('limit');
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
inspectedPages++;
|
|
210
|
+
report.inspected++;
|
|
211
|
+
const retained = await runRetain(page.body, ctx.models.derive, {
|
|
212
|
+
mission: 'Extract only actual dated events explicitly recorded in this authored knowledge note for its folder timeline. Do not invent an event date from a file timestamp or today. Preserve attribution and uncertainty. Existing Akno-managed memory is already projected; never extract it again.',
|
|
213
|
+
});
|
|
214
|
+
if (retained.degradedReason)
|
|
215
|
+
degraded.add(retained.degradedReason);
|
|
216
|
+
if (retained.sourceHold) {
|
|
217
|
+
hold(retained.sourceHold.reason_code === 'context_too_large' ? 'limit' : 'unqualified_event');
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (retained.error) {
|
|
221
|
+
hold('model_failed');
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (retained.held.length || retained.events.length)
|
|
225
|
+
hold('unqualified_event');
|
|
226
|
+
const start = actions.length;
|
|
227
|
+
let deferred = false;
|
|
228
|
+
for (const candidate of retained.candidates) {
|
|
229
|
+
if (!qualifiedHistoricalEvent(candidate, page.body)) {
|
|
230
|
+
hold('unqualified_event');
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (actions.length >= limit) {
|
|
234
|
+
hold('limit');
|
|
235
|
+
deferred = true;
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
const eventKey = `timeline-history:event:${sha256(row.rel_path + '\0' + candidate.time.start + '\0' + candidate.text)}`;
|
|
239
|
+
if (ctx.store.meta(eventKey) === fingerprint) {
|
|
240
|
+
report.cached++;
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
const event = { date: candidate.time.start, summary: candidate.text, slug: page.slug };
|
|
244
|
+
const current = after.get(owner.path);
|
|
245
|
+
// Use the ordinary writer's same-day duplicate check, including entries predating this feature.
|
|
246
|
+
if (current.trim() && insertEvent(current, event).content === current)
|
|
247
|
+
continue;
|
|
248
|
+
const line = formatEventLine(event);
|
|
249
|
+
if (!append({ kind: 'extract', source: row.rel_path, destination: owner.path, line, candidate }, { relPath: row.rel_path, content, hash: sha256(content) })) {
|
|
250
|
+
deferred = true;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
scans.push({ key: eventKey, fingerprint });
|
|
254
|
+
}
|
|
255
|
+
if (deferred && actions.length === 0)
|
|
256
|
+
cache(key, fingerprint);
|
|
257
|
+
if (!deferred) {
|
|
258
|
+
if (actions.length === start)
|
|
259
|
+
cache(key, fingerprint);
|
|
260
|
+
else
|
|
261
|
+
scans.push({ key, fingerprint });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (!actions.length)
|
|
265
|
+
return result();
|
|
266
|
+
const operations = operationsFor(after);
|
|
267
|
+
const proof = proofFor(actions);
|
|
268
|
+
const inputHash = sha256(JSON.stringify([proof.boundaries, proof.sources.map(({ relPath, hash }) => [relPath, hash]), actions]));
|
|
269
|
+
return {
|
|
270
|
+
drafts: [
|
|
271
|
+
{
|
|
272
|
+
slug: parsePage(operations[0].relPath, operations[0].after).slug,
|
|
273
|
+
inputHash,
|
|
274
|
+
operations,
|
|
275
|
+
proof,
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
report,
|
|
279
|
+
degraded: [...degraded],
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/** Only terminal decisions suppress rediscovery; pending work must survive mode changes. */
|
|
283
|
+
export function recordTimelineHistoryScans(ctx, proof) {
|
|
284
|
+
for (const scan of proof?.scans ?? [])
|
|
285
|
+
ctx.store.setMeta(scan.key, scan.fingerprint);
|
|
286
|
+
}
|
|
287
|
+
export function timelineHistoryEvidence(proof) {
|
|
288
|
+
return proof.sources.map((source, index) => ({
|
|
289
|
+
type: 'page',
|
|
290
|
+
source: source.relPath,
|
|
291
|
+
fingerprint: source.hash,
|
|
292
|
+
relationship: 'ownership',
|
|
293
|
+
sourceRelPath: source.relPath,
|
|
294
|
+
sourceHash: source.hash,
|
|
295
|
+
details: ['Exact source sealed for historical timeline population.'],
|
|
296
|
+
...(index === 0 ? { timelineHistory: proof } : {}),
|
|
297
|
+
}));
|
|
298
|
+
}
|
|
299
|
+
export async function timelineHistoryIssue(ctx, proof, operations, stage) {
|
|
300
|
+
if (!proof?.actions.length || !operations.length || operations.some((op) => op.type !== 'replace'))
|
|
301
|
+
return 'timeline history requires sealed existing-ledger replacements';
|
|
302
|
+
const catalog = timelineCatalog(ctx.config, ctx.store);
|
|
303
|
+
if (boundaryFingerprint(catalog) !== proof.boundaries)
|
|
304
|
+
return 'timeline boundaries or their write policies changed';
|
|
305
|
+
const replacements = operations;
|
|
306
|
+
const before = new Map();
|
|
307
|
+
for (const source of proof.sources) {
|
|
308
|
+
const op = replacements.find((entry) => entry.relPath === source.relPath);
|
|
309
|
+
const current = await readHistorySource(ctx, source.relPath);
|
|
310
|
+
if ((source.content !== undefined && sha256(source.content) !== source.hash) ||
|
|
311
|
+
current === null ||
|
|
312
|
+
sha256(current) !== (stage === 'after' && op ? op.afterHash : source.hash))
|
|
313
|
+
return 'timeline history evidence changed or became unavailable';
|
|
314
|
+
const ledger = catalog.find((entry) => entry.path === source.relPath);
|
|
315
|
+
if (ledger)
|
|
316
|
+
before.set(source.relPath, op?.before ?? current);
|
|
317
|
+
}
|
|
318
|
+
for (const action of proof.actions) {
|
|
319
|
+
const target = catalog.find((entry) => entry.path === action.destination);
|
|
320
|
+
if (!target || target.status !== 'ready' || !target.writable)
|
|
321
|
+
return 'timeline history destination is unavailable or read-only';
|
|
322
|
+
if (action.kind === 'relocate') {
|
|
323
|
+
const source = catalog.find((entry) => entry.path === action.source);
|
|
324
|
+
if (!source?.writable || !isDescendant(source, target))
|
|
325
|
+
return 'timeline relocation is not a writable ancestor-to-descendant transfer';
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
const source = proof.sources.find((entry) => entry.relPath === action.source);
|
|
329
|
+
if (!source?.content || !eligibleHistoryPage(ctx, source.relPath, source.content))
|
|
330
|
+
return 'timeline extraction source is not eligible authored knowledge';
|
|
331
|
+
const page = parsePage(source.relPath, source.content);
|
|
332
|
+
if (!qualifiedHistoricalEvent(action.candidate, page.body) ||
|
|
333
|
+
owningTimeline(catalog, page.slug).slug !== target.slug ||
|
|
334
|
+
action.line !==
|
|
335
|
+
formatEventLine({
|
|
336
|
+
date: action.candidate.time.start,
|
|
337
|
+
summary: action.candidate.text,
|
|
338
|
+
slug: page.slug,
|
|
339
|
+
}))
|
|
340
|
+
return 'timeline extraction lost its exact source, date, or folder ownership';
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const expected = applyHistoryActions(before, proof.actions);
|
|
344
|
+
if (!expected)
|
|
345
|
+
return 'timeline actions do not preserve exact event lines';
|
|
346
|
+
const changed = [...expected].filter(([file, content]) => content !== before.get(file));
|
|
347
|
+
if (changed.length !== replacements.length ||
|
|
348
|
+
changed.some(([file, content]) => !replacements.some((op) => op.relPath === file && op.before === before.get(file) && op.after === content)))
|
|
349
|
+
return 'timeline operation exceeds its sealed additions and relocations';
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
function boundaryFingerprint(catalog) {
|
|
353
|
+
return sha256(JSON.stringify(catalog.map(({ slug, path: file, folder, default: root, status, writable }) => [
|
|
354
|
+
slug,
|
|
355
|
+
file,
|
|
356
|
+
folder,
|
|
357
|
+
root,
|
|
358
|
+
status,
|
|
359
|
+
writable,
|
|
360
|
+
])));
|
|
361
|
+
}
|
|
362
|
+
function isDescendant(parent, child) {
|
|
363
|
+
return (!child.default &&
|
|
364
|
+
parent.slug !== child.slug &&
|
|
365
|
+
(parent.default || child.folder.startsWith(parent.folder + '/')));
|
|
366
|
+
}
|
|
367
|
+
async function readHistorySource(ctx, relPath) {
|
|
368
|
+
if (path.isAbsolute(relPath) ||
|
|
369
|
+
relPath.split(/[\\/]/u).some((part) => !part || part === '.' || part === '..') ||
|
|
370
|
+
quarantineReasonsForPath(ctx.store, relPath).length)
|
|
371
|
+
return null;
|
|
372
|
+
try {
|
|
373
|
+
let current = ctx.config.aknoPath;
|
|
374
|
+
const segments = relPath.split('/');
|
|
375
|
+
for (const [index, segment] of segments.entries()) {
|
|
376
|
+
current = path.join(current, segment);
|
|
377
|
+
const stat = await fsp.lstat(current);
|
|
378
|
+
if (stat.isSymbolicLink() ||
|
|
379
|
+
(index < segments.length - 1
|
|
380
|
+
? !stat.isDirectory()
|
|
381
|
+
: !stat.isFile() || stat.size > ctx.config.maxPageBytes))
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
const content = await fsp.readFile(current, 'utf8');
|
|
385
|
+
return hasInlineMergeConflict(content) ? null : content;
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function eligibleHistoryPage(ctx, relPath, content) {
|
|
392
|
+
const page = parsePage(relPath, content);
|
|
393
|
+
const policy = resolvePagePolicy(page, effectiveRule(page.slug, ctx.config.rules), ctx.config.paths.observations);
|
|
394
|
+
// Managed records and document renditions already retain stronger temporal and epistemic identity.
|
|
395
|
+
// Copying their prose into an unqualified authored event would destroy that identity.
|
|
396
|
+
return (policy.role === 'knowledge' &&
|
|
397
|
+
policy.remember !== 'deny' &&
|
|
398
|
+
!isReserved(page.slug, ctx.config) &&
|
|
399
|
+
!/[\r\n[\]|#]/u.test(page.slug) &&
|
|
400
|
+
!/<!--\s*akno:|<!--\s*source\b/iu.test(content));
|
|
401
|
+
}
|
|
402
|
+
function qualifiedHistoricalEvent(candidate, body) {
|
|
403
|
+
const time = candidate.time;
|
|
404
|
+
return (candidate.kind === 'event' &&
|
|
405
|
+
!/\[|<[a-z!]/iu.test(candidate.text) &&
|
|
406
|
+
candidate.discourse.commitment === 'asserted' &&
|
|
407
|
+
candidate.discourse.disposition === 'active' &&
|
|
408
|
+
candidate.epistemic.basis === 'self_attested' &&
|
|
409
|
+
candidate.attribution.source_role === 'user' &&
|
|
410
|
+
!candidate.attribution.chain?.length &&
|
|
411
|
+
candidate.polarity !== 'negated' &&
|
|
412
|
+
!candidate.relations?.length &&
|
|
413
|
+
time?.relation === 'occurred' &&
|
|
414
|
+
time.status === 'actual' &&
|
|
415
|
+
time.precision === 'day' &&
|
|
416
|
+
/^\d{4}-\d{2}-\d{2}$/u.test(time.start ?? '') &&
|
|
417
|
+
!time.until &&
|
|
418
|
+
!time.recurrence &&
|
|
419
|
+
candidate.support.every((span) => body.includes(span.quote)) &&
|
|
420
|
+
candidate.discourse_frame.every((span) => body.includes(span.quote)));
|
|
421
|
+
}
|
|
422
|
+
function standaloneEventLine(content, line) {
|
|
423
|
+
const lines = content.split('\n');
|
|
424
|
+
const index = lines.indexOf(line);
|
|
425
|
+
// Continuations, managed records, code blocks, and repeated identical lines require inspection.
|
|
426
|
+
return (index >= 0 &&
|
|
427
|
+
lines.lastIndexOf(line) === index &&
|
|
428
|
+
/^- \*\*\d{4}-\d{2}-\d{2}\*\*\s*\|/u.test(line) &&
|
|
429
|
+
// Byte-identical relative addresses can point elsewhere after a folder transfer.
|
|
430
|
+
!/\[\[(?:\.{1,2}\/|#)/u.test(line) &&
|
|
431
|
+
!/\[|<[a-z!]/iu.test(line.replace(/\[\[[^\]]+\]\]/gu, '')) &&
|
|
432
|
+
!/<!--\s*akno:|```|~~~/iu.test(content) &&
|
|
433
|
+
!/^\s+\S/u.test(lines[index + 1] ?? ''));
|
|
434
|
+
}
|
|
435
|
+
function applyHistoryActions(before, actions) {
|
|
436
|
+
const after = new Map(before);
|
|
437
|
+
for (const action of actions) {
|
|
438
|
+
let destination = after.get(action.destination);
|
|
439
|
+
if (destination === undefined)
|
|
440
|
+
return null;
|
|
441
|
+
if (action.kind === 'relocate') {
|
|
442
|
+
const source = after.get(action.source);
|
|
443
|
+
if (source === undefined || !standaloneEventLine(source, action.line))
|
|
444
|
+
return null;
|
|
445
|
+
const lines = source.split('\n');
|
|
446
|
+
lines.splice(lines.indexOf(action.line), 1);
|
|
447
|
+
after.set(action.source, lines.join('\n'));
|
|
448
|
+
}
|
|
449
|
+
if (!destination.split('\n').includes(action.line)) {
|
|
450
|
+
const date = /^- \*\*(\d{4}-\d{2}-\d{2})\*\*/u.exec(action.line)?.[1];
|
|
451
|
+
if (!date)
|
|
452
|
+
return null;
|
|
453
|
+
if (!destination.trim())
|
|
454
|
+
destination = newLedger(date.slice(0, 4));
|
|
455
|
+
// The ordinary insertion algorithm chooses the year/date position. The exact original line,
|
|
456
|
+
// including every citation and qualifier, replaces only our unique temporary placeholder.
|
|
457
|
+
const event = { date, summary: `akno-history-${sha256(action.line)}` };
|
|
458
|
+
destination = insertEvent(destination, event).content.replace(formatEventLine(event), () => action.line);
|
|
459
|
+
after.set(action.destination, destination);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return after;
|
|
463
|
+
}
|
|
464
|
+
//# sourceMappingURL=timeline-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-history.js","sourceRoot":"","sources":["../../src/maintenance/timeline-history.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAiDrE,MAAM,UAAU,0BAA0B;IACxC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAA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AC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -20,16 +20,16 @@ export declare const semanticVerdictFields: {
|
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
mismatches: z.ZodArray<z.ZodObject<{
|
|
22
22
|
dimension: z.ZodEnum<{
|
|
23
|
+
qualification_scope_preserved: "qualification_scope_preserved";
|
|
23
24
|
proposition_supported: "proposition_supported";
|
|
24
25
|
action_arguments_preserved: "action_arguments_preserved";
|
|
25
|
-
qualification_scope_preserved: "qualification_scope_preserved";
|
|
26
26
|
}>;
|
|
27
27
|
kind: z.ZodEnum<{
|
|
28
|
+
omitted_scope: "omitted_scope";
|
|
29
|
+
changed_qualification: "changed_qualification";
|
|
28
30
|
unsupported_content: "unsupported_content";
|
|
29
31
|
changed_value: "changed_value";
|
|
30
32
|
changed_action_or_role: "changed_action_or_role";
|
|
31
|
-
changed_qualification: "changed_qualification";
|
|
32
|
-
omitted_scope: "omitted_scope";
|
|
33
33
|
changed_repair_proposition: "changed_repair_proposition";
|
|
34
34
|
}>;
|
|
35
35
|
detail: z.ZodString;
|
|
@@ -57,8 +57,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
57
57
|
detail: z.ZodString;
|
|
58
58
|
relation: z.ZodEnum<{
|
|
59
59
|
preserved: "preserved";
|
|
60
|
-
generalized: "generalized";
|
|
61
60
|
changed: "changed";
|
|
61
|
+
generalized: "generalized";
|
|
62
62
|
}>;
|
|
63
63
|
}, z.core.$strict>, z.ZodObject<{
|
|
64
64
|
source_anchor: z.ZodEnum<{
|
|
@@ -93,8 +93,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
93
93
|
detail: z.ZodString;
|
|
94
94
|
relation: z.ZodEnum<{
|
|
95
95
|
preserved: "preserved";
|
|
96
|
-
generalized: "generalized";
|
|
97
96
|
changed: "changed";
|
|
97
|
+
generalized: "generalized";
|
|
98
98
|
}>;
|
|
99
99
|
}, z.core.$strict>, z.ZodObject<{
|
|
100
100
|
source_anchor: z.ZodEnum<{
|
|
@@ -127,8 +127,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
127
127
|
answer_specifics: z.ZodString;
|
|
128
128
|
relation: z.ZodEnum<{
|
|
129
129
|
preserved: "preserved";
|
|
130
|
-
generalized: "generalized";
|
|
131
130
|
changed: "changed";
|
|
131
|
+
generalized: "generalized";
|
|
132
132
|
}>;
|
|
133
133
|
}, z.core.$strict>, z.ZodObject<{
|
|
134
134
|
source_anchor: z.ZodEnum<{
|
|
@@ -152,8 +152,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
152
152
|
answer_property: z.ZodString;
|
|
153
153
|
relation: z.ZodEnum<{
|
|
154
154
|
preserved: "preserved";
|
|
155
|
-
generalized: "generalized";
|
|
156
155
|
changed: "changed";
|
|
156
|
+
generalized: "generalized";
|
|
157
157
|
}>;
|
|
158
158
|
}, z.core.$strict>, z.ZodObject<{
|
|
159
159
|
source_anchor: z.ZodEnum<{
|
|
@@ -186,8 +186,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
186
186
|
detail: z.ZodString;
|
|
187
187
|
relation: z.ZodEnum<{
|
|
188
188
|
preserved: "preserved";
|
|
189
|
-
generalized: "generalized";
|
|
190
189
|
changed: "changed";
|
|
190
|
+
generalized: "generalized";
|
|
191
191
|
}>;
|
|
192
192
|
}, z.core.$strict>, z.ZodObject<{
|
|
193
193
|
source_anchor: z.ZodEnum<{
|
|
@@ -222,8 +222,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
222
222
|
detail: z.ZodString;
|
|
223
223
|
relation: z.ZodEnum<{
|
|
224
224
|
preserved: "preserved";
|
|
225
|
-
generalized: "generalized";
|
|
226
225
|
changed: "changed";
|
|
226
|
+
generalized: "generalized";
|
|
227
227
|
}>;
|
|
228
228
|
}, z.core.$strict>, z.ZodObject<{
|
|
229
229
|
source_anchor: z.ZodEnum<{
|
|
@@ -256,8 +256,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
256
256
|
answer_specifics: z.ZodString;
|
|
257
257
|
relation: z.ZodEnum<{
|
|
258
258
|
preserved: "preserved";
|
|
259
|
-
generalized: "generalized";
|
|
260
259
|
changed: "changed";
|
|
260
|
+
generalized: "generalized";
|
|
261
261
|
}>;
|
|
262
262
|
}, z.core.$strict>, z.ZodObject<{
|
|
263
263
|
source_anchor: z.ZodEnum<{
|
|
@@ -289,8 +289,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
289
289
|
detail: z.ZodString;
|
|
290
290
|
relation: z.ZodEnum<{
|
|
291
291
|
preserved: "preserved";
|
|
292
|
-
generalized: "generalized";
|
|
293
292
|
changed: "changed";
|
|
293
|
+
generalized: "generalized";
|
|
294
294
|
}>;
|
|
295
295
|
}, z.core.$strict>, z.ZodObject<{
|
|
296
296
|
source_anchor: z.ZodEnum<{
|
|
@@ -325,8 +325,8 @@ export declare function answerAlignmentSchema(coordinates: AnswerAuditCoordinate
|
|
|
325
325
|
detail: z.ZodString;
|
|
326
326
|
relation: z.ZodEnum<{
|
|
327
327
|
preserved: "preserved";
|
|
328
|
-
generalized: "generalized";
|
|
329
328
|
changed: "changed";
|
|
329
|
+
generalized: "generalized";
|
|
330
330
|
}>;
|
|
331
331
|
}, z.core.$strict>, z.ZodObject<{
|
|
332
332
|
source_anchor: z.ZodEnum<{
|
package/dist/reserved.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function ledgerSlug(config: AknoConfig): string;
|
|
|
22
22
|
* **Every slug prefix a caller must not aim a page write at.**
|
|
23
23
|
*
|
|
24
24
|
* These are Akno's own structures, not the user's notes: the ledger is maintained by
|
|
25
|
-
*
|
|
25
|
+
* event insertion and sealed historical transfers, the inbox is a queue that empties itself, observations are
|
|
26
26
|
* written by the cycle with their own evidence, and the journal is a record of what happened.
|
|
27
27
|
* A claim landing on any of them is a claim in a file whose shape means something specific —
|
|
28
28
|
* and on the ledger, where prose is invisible to the event parser, it is a claim in a file
|
package/dist/reserved.js
CHANGED
|
@@ -24,7 +24,7 @@ export function ledgerSlug(config) {
|
|
|
24
24
|
* **Every slug prefix a caller must not aim a page write at.**
|
|
25
25
|
*
|
|
26
26
|
* These are Akno's own structures, not the user's notes: the ledger is maintained by
|
|
27
|
-
*
|
|
27
|
+
* event insertion and sealed historical transfers, the inbox is a queue that empties itself, observations are
|
|
28
28
|
* written by the cycle with their own evidence, and the journal is a record of what happened.
|
|
29
29
|
* A claim landing on any of them is a claim in a file whose shape means something specific —
|
|
30
30
|
* and on the ledger, where prose is invisible to the event parser, it is a claim in a file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/write/ledger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/write/ledger.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;CACd;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAM1D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,YAAY,CAiF7E;AASD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAW9C"}
|
package/dist/write/ledger.js
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* So Akno maintains it **by appending only** — inserting under the right year
|
|
10
10
|
* heading and never rewriting or reordering what is already there. No edit a human
|
|
11
11
|
* made can be lost, and a hand-written line is indexed exactly like a generated
|
|
12
|
-
* one.
|
|
12
|
+
* one. Historical maintenance may separately transfer an exact line to its owning
|
|
13
|
+
* descendant ledger in one reviewed, journalled change; it never regenerates either file.
|
|
13
14
|
*
|
|
14
15
|
* Nothing about this line syntax ever reaches a prompt: there is no
|
|
15
16
|
* `add_event` op). A caller hands over `{date, summary}`.
|
|
@@ -133,7 +134,8 @@ export function newLedger(year) {
|
|
|
133
134
|
return (`---\ntype: timeline\ntitle: Timeline\n---\n\n# Timeline\n\n` +
|
|
134
135
|
`What actually happened, newest first. One line per event; the detail lives on the linked\n` +
|
|
135
136
|
`page, so this stays an index and never a second copy of a fact.\n\n` +
|
|
136
|
-
`Append
|
|
137
|
+
`Append new events and corrections. Maintenance may transfer an exact line to its owning\n` +
|
|
138
|
+
`folder timeline in one journalled change, preserving its citations. Each line reads\n` +
|
|
137
139
|
`\`- **YYYY-MM-DD** | what happened. [[page/with/detail]]\` — that exact shape is what\n` +
|
|
138
140
|
`makes a line an event, and prose Akno cannot match is invisible to search.\n\n` +
|
|
139
141
|
`## ${year}\n`);
|