@agent-wiki/mcp 0.17.11 → 0.19.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/dist/cobol/__tests__/call-boundary-lineage.test.js +101 -10
- package/dist/cobol/__tests__/call-boundary-lineage.test.js.map +1 -1
- package/dist/cobol/__tests__/db2-table-lineage.test.js +49 -10
- package/dist/cobol/__tests__/db2-table-lineage.test.js.map +1 -1
- package/dist/cobol/__tests__/extractors.test.js +36 -0
- package/dist/cobol/__tests__/extractors.test.js.map +1 -1
- package/dist/cobol/__tests__/field-lineage.test.js +127 -0
- package/dist/cobol/__tests__/field-lineage.test.js.map +1 -1
- package/dist/cobol/call-boundary-lineage.d.ts +26 -0
- package/dist/cobol/call-boundary-lineage.d.ts.map +1 -1
- package/dist/cobol/call-boundary-lineage.js +84 -9
- package/dist/cobol/call-boundary-lineage.js.map +1 -1
- package/dist/cobol/db2-table-lineage.d.ts +22 -0
- package/dist/cobol/db2-table-lineage.d.ts.map +1 -1
- package/dist/cobol/db2-table-lineage.js +67 -5
- package/dist/cobol/db2-table-lineage.js.map +1 -1
- package/dist/cobol/extractors.d.ts +8 -0
- package/dist/cobol/extractors.d.ts.map +1 -1
- package/dist/cobol/extractors.js +3 -1
- package/dist/cobol/extractors.js.map +1 -1
- package/dist/cobol/field-lineage.d.ts.map +1 -1
- package/dist/cobol/field-lineage.js +158 -32
- package/dist/cobol/field-lineage.js.map +1 -1
- package/dist/cobol/plugin.d.ts.map +1 -1
- package/dist/cobol/plugin.js +7 -0
- package/dist/cobol/plugin.js.map +1 -1
- package/dist/evidence-migration.d.ts +37 -0
- package/dist/evidence-migration.d.ts.map +1 -0
- package/dist/evidence-migration.js +117 -0
- package/dist/evidence-migration.js.map +1 -0
- package/dist/evidence-migration.test.d.ts +2 -0
- package/dist/evidence-migration.test.d.ts.map +1 -0
- package/dist/evidence-migration.test.js +74 -0
- package/dist/evidence-migration.test.js.map +1 -0
- package/dist/evidence-write-log.d.ts +64 -0
- package/dist/evidence-write-log.d.ts.map +1 -0
- package/dist/evidence-write-log.js +139 -0
- package/dist/evidence-write-log.js.map +1 -0
- package/dist/evidence-write-log.test.d.ts +2 -0
- package/dist/evidence-write-log.test.d.ts.map +1 -0
- package/dist/evidence-write-log.test.js +140 -0
- package/dist/evidence-write-log.test.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +115 -1
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +31 -0
- package/dist/server.test.js.map +1 -1
- package/dist/wiki.d.ts +5 -3
- package/dist/wiki.d.ts.map +1 -1
- package/dist/wiki.js +72 -9
- package/dist/wiki.js.map +1 -1
- package/dist/wiki.test.js +93 -0
- package/dist/wiki.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence-first phase 2a — one-shot migration that classifies every
|
|
3
|
+
* pre-existing wiki page so the new "unsupported / synthesis / grounded"
|
|
4
|
+
* vocabulary doesn't drown in false positives the day phase 2a deploys.
|
|
5
|
+
*
|
|
6
|
+
* Classification rules (in order — first match wins):
|
|
7
|
+
* 1. `type: synthesis` already in frontmatter → leave alone (legit)
|
|
8
|
+
* 2. Page lives under `wiki/<plugin-id>/...` → add `synthesis: true`
|
|
9
|
+
* (compiler-generated artifact)
|
|
10
|
+
* 3. `sources: [...]` is non-empty → leave alone (grounded)
|
|
11
|
+
* 4. Anything else (pre-existing user-authored,
|
|
12
|
+
* no sources, no synthesis flag) → add `legacyUnsupported: true`
|
|
13
|
+
*
|
|
14
|
+
* Runs at most once per workspace, gated by a marker file under
|
|
15
|
+
* .agent-wiki/. Subsequent rebuilds short-circuit immediately.
|
|
16
|
+
*
|
|
17
|
+
* See docs/evidence-envelope.md ("Synthesis-page grandfather migration").
|
|
18
|
+
*/
|
|
19
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
20
|
+
import matter from "gray-matter";
|
|
21
|
+
import { evidenceDir, migrationMarkerPath } from "./evidence-write-log.js";
|
|
22
|
+
/**
|
|
23
|
+
* Run the one-shot migration. Idempotent: if the marker file exists the
|
|
24
|
+
* function returns `alreadyMigrated: true` and touches nothing.
|
|
25
|
+
*
|
|
26
|
+
* Plugin IDs are passed in (not imported) so this module stays decoupled
|
|
27
|
+
* from the plugin registry; the caller (typically wiki_admin rebuild)
|
|
28
|
+
* supplies them.
|
|
29
|
+
*/
|
|
30
|
+
export function migrateExistingPagesForEvidence(wiki, pluginIds) {
|
|
31
|
+
const marker = migrationMarkerPath(wiki.config.workspace);
|
|
32
|
+
if (existsSync(marker)) {
|
|
33
|
+
return {
|
|
34
|
+
alreadyMigrated: true,
|
|
35
|
+
totalPages: 0,
|
|
36
|
+
syntheses: 0,
|
|
37
|
+
grounded: 0,
|
|
38
|
+
legacy: 0,
|
|
39
|
+
preExistingSynthesis: 0,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const result = {
|
|
43
|
+
alreadyMigrated: false,
|
|
44
|
+
totalPages: 0,
|
|
45
|
+
syntheses: 0,
|
|
46
|
+
grounded: 0,
|
|
47
|
+
legacy: 0,
|
|
48
|
+
preExistingSynthesis: 0,
|
|
49
|
+
};
|
|
50
|
+
const pluginPathPrefixes = pluginIds.map((id) => `${id}/`);
|
|
51
|
+
for (const pagePath of wiki.listAllPages()) {
|
|
52
|
+
if (isSystemIndex(pagePath))
|
|
53
|
+
continue;
|
|
54
|
+
const page = wiki.read(pagePath);
|
|
55
|
+
if (!page)
|
|
56
|
+
continue;
|
|
57
|
+
result.totalPages++;
|
|
58
|
+
const fm = page.frontmatter;
|
|
59
|
+
const sources = Array.isArray(fm.sources) ? fm.sources : [];
|
|
60
|
+
// Rule 1: type: synthesis is the pre-existing convention — already legit.
|
|
61
|
+
if (fm.type === "synthesis") {
|
|
62
|
+
result.preExistingSynthesis++;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
// Rule 2: compiler-generated artifact under wiki/<plugin-id>/...
|
|
66
|
+
const isPluginArtifact = pluginPathPrefixes.some((prefix) => pagePath.startsWith(prefix));
|
|
67
|
+
if (isPluginArtifact) {
|
|
68
|
+
if (fm.synthesis !== true) {
|
|
69
|
+
writeWithFrontmatterPatch(wiki, pagePath, page.content, fm, { synthesis: true });
|
|
70
|
+
}
|
|
71
|
+
result.syntheses++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// Rule 3: grounded — has sources.
|
|
75
|
+
if (sources.length > 0) {
|
|
76
|
+
result.grounded++;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
// Rule 4: legacy unsupported. Also clear any prior `unsupported: true`
|
|
80
|
+
// from a fresh phase-2a write so the flags don't pile up.
|
|
81
|
+
writeWithFrontmatterPatch(wiki, pagePath, page.content, fm, {
|
|
82
|
+
legacyUnsupported: true,
|
|
83
|
+
unsupported: undefined,
|
|
84
|
+
});
|
|
85
|
+
result.legacy++;
|
|
86
|
+
}
|
|
87
|
+
// Mark migration done.
|
|
88
|
+
mkdirSync(evidenceDir(wiki.config.workspace), { recursive: true });
|
|
89
|
+
writeFileSync(marker, new Date().toISOString());
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
function isSystemIndex(pagePath) {
|
|
93
|
+
// Auto-generated indexes: top-level index.md, log.md, timeline.md, and any
|
|
94
|
+
// nested */index.md. These are managed by the rebuild loop, not user content.
|
|
95
|
+
return (pagePath === "index.md" ||
|
|
96
|
+
pagePath === "log.md" ||
|
|
97
|
+
pagePath === "timeline.md" ||
|
|
98
|
+
pagePath.endsWith("/index.md"));
|
|
99
|
+
}
|
|
100
|
+
function writeWithFrontmatterPatch(wiki, pagePath, body, existingFrontmatter, patch) {
|
|
101
|
+
// Apply patch — keys with `undefined` are removed; everything else overrides.
|
|
102
|
+
const merged = { ...existingFrontmatter };
|
|
103
|
+
for (const [k, v] of Object.entries(patch)) {
|
|
104
|
+
if (v === undefined)
|
|
105
|
+
delete merged[k];
|
|
106
|
+
else
|
|
107
|
+
merged[k] = v;
|
|
108
|
+
}
|
|
109
|
+
// Use gray-matter's stringify so YAML escaping matches the rest of the
|
|
110
|
+
// wiki write path. Route through wiki.write() so search-index / title-cache
|
|
111
|
+
// updates fire; pass `silent: true` so a multi-hundred-page migration
|
|
112
|
+
// doesn't spam log.md with one entry per page (the rebuild's summary
|
|
113
|
+
// line covers the migration in aggregate).
|
|
114
|
+
const newContent = matter.stringify(body, merged);
|
|
115
|
+
wiki.write(pagePath, newContent, undefined, { silent: true });
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=evidence-migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-migration.js","sourceRoot":"","sources":["../src/evidence-migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAW3E;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B,CAC7C,IAAU,EACV,SAAmB;IAEnB,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC1D,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvB,OAAO;YACL,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,CAAC;YACb,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,CAAC;YACT,oBAAoB,EAAE,CAAC;SACxB,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAoB;QAC9B,eAAe,EAAE,KAAK;QACtB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,CAAC;QACT,oBAAoB,E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CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-migration.test.d.ts","sourceRoot":"","sources":["../src/evidence-migration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { mkdtempSync, rmSync, existsSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { Wiki } from "./wiki.js";
|
|
6
|
+
import { migrateExistingPagesForEvidence } from "./evidence-migration.js";
|
|
7
|
+
import { migrationMarkerPath } from "./evidence-write-log.js";
|
|
8
|
+
let tmp;
|
|
9
|
+
let wiki;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
tmp = mkdtempSync(join(tmpdir(), "evidence-mig-"));
|
|
12
|
+
wiki = Wiki.init(tmp);
|
|
13
|
+
});
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
rmSync(tmp, { recursive: true, force: true });
|
|
16
|
+
});
|
|
17
|
+
describe("migrateExistingPagesForEvidence", () => {
|
|
18
|
+
it("rule 1: pages with type: synthesis are left alone", () => {
|
|
19
|
+
wiki.write("note.md", "---\ntitle: Note\ntype: synthesis\n---\nContent.");
|
|
20
|
+
const result = migrateExistingPagesForEvidence(wiki, []);
|
|
21
|
+
expect(result.preExistingSynthesis).toBe(1);
|
|
22
|
+
const after = wiki.read("note.md");
|
|
23
|
+
expect(after?.frontmatter.synthesis).toBeUndefined();
|
|
24
|
+
expect(after?.frontmatter.legacyUnsupported).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
it("rule 2: compiler-generated pages under wiki/<plugin>/... get synthesis: true", () => {
|
|
27
|
+
wiki.write("cobol/system-map.md", "---\ntitle: System Map\n---\nGraph.");
|
|
28
|
+
const result = migrateExistingPagesForEvidence(wiki, ["cobol"]);
|
|
29
|
+
expect(result.syntheses).toBe(1);
|
|
30
|
+
const after = wiki.read("cobol/system-map.md");
|
|
31
|
+
expect(after?.frontmatter.synthesis).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
it("rule 3: pages with non-empty sources are left alone", () => {
|
|
34
|
+
wiki.write("ref.md", "---\ntitle: Ref\nsources: [raw/paper.pdf]\n---\nContent.");
|
|
35
|
+
const result = migrateExistingPagesForEvidence(wiki, []);
|
|
36
|
+
expect(result.grounded).toBe(1);
|
|
37
|
+
const after = wiki.read("ref.md");
|
|
38
|
+
expect(after?.frontmatter.legacyUnsupported).toBeUndefined();
|
|
39
|
+
expect(after?.frontmatter.synthesis).toBeUndefined();
|
|
40
|
+
});
|
|
41
|
+
it("rule 4: pre-existing user pages without sources/synthesis get legacyUnsupported", () => {
|
|
42
|
+
wiki.write("opinion.md", "---\ntitle: Opinion\n---\nMy take.");
|
|
43
|
+
// wiki.write stamps `unsupported: true` on the synthetic setup write.
|
|
44
|
+
// Migration must clear that and replace with `legacyUnsupported: true`
|
|
45
|
+
// so the two flags don't coexist (they have overlapping semantics —
|
|
46
|
+
// legacy is the grandfathered subset of unsupported).
|
|
47
|
+
const result = migrateExistingPagesForEvidence(wiki, []);
|
|
48
|
+
expect(result.legacy).toBe(1);
|
|
49
|
+
const after = wiki.read("opinion.md");
|
|
50
|
+
expect(after?.frontmatter.legacyUnsupported).toBe(true);
|
|
51
|
+
expect(after?.frontmatter.unsupported).toBeUndefined();
|
|
52
|
+
});
|
|
53
|
+
it("is idempotent: second run reports alreadyMigrated and changes nothing", () => {
|
|
54
|
+
wiki.write("a.md", "---\ntitle: A\n---\nNo sources.");
|
|
55
|
+
migrateExistingPagesForEvidence(wiki, []);
|
|
56
|
+
expect(existsSync(migrationMarkerPath(wiki.config.workspace))).toBe(true);
|
|
57
|
+
const second = migrateExistingPagesForEvidence(wiki, []);
|
|
58
|
+
expect(second.alreadyMigrated).toBe(true);
|
|
59
|
+
expect(second.totalPages).toBe(0);
|
|
60
|
+
});
|
|
61
|
+
it("classifies a mixed wiki correctly in one pass", () => {
|
|
62
|
+
wiki.write("grounded.md", "---\ntitle: G\nsources: [raw/x.md]\n---\nA.");
|
|
63
|
+
wiki.write("synth.md", "---\ntitle: S\ntype: synthesis\n---\nB.");
|
|
64
|
+
wiki.write("cobol/system-map.md", "---\ntitle: Map\n---\nGraph.");
|
|
65
|
+
wiki.write("opinion.md", "---\ntitle: O\n---\nMy take.");
|
|
66
|
+
wiki.write("nested/deep.md", "---\ntitle: D\nsources: [raw/y.md]\n---\nE.");
|
|
67
|
+
const result = migrateExistingPagesForEvidence(wiki, ["cobol"]);
|
|
68
|
+
expect(result.grounded).toBe(2); // grounded.md + nested/deep.md
|
|
69
|
+
expect(result.preExistingSynthesis).toBe(1); // synth.md
|
|
70
|
+
expect(result.syntheses).toBe(1); // cobol/system-map.md
|
|
71
|
+
expect(result.legacy).toBe(1); // opinion.md
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=evidence-migration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-migration.test.js","sourceRoot":"","sources":["../src/evidence-migration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;A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AAC,CAAE,WAAW;QACzD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAa,sBAAsB;QACpE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAgB,aAAa;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence-first phase 2a — telemetry log for `wiki_write` calls that
|
|
3
|
+
* produce "unsupported" pages (no `sources: [...]`, no `synthesis: true`).
|
|
4
|
+
*
|
|
5
|
+
* The log seeds Phase 2b: until we know how often unsupported writes
|
|
6
|
+
* happen and whether they are legitimate, hard rejection is guesswork.
|
|
7
|
+
*
|
|
8
|
+
* Design:
|
|
9
|
+
* - Append-only JSONL at <workspace>/.agent-wiki/evidence-write-log.jsonl
|
|
10
|
+
* - One UnsupportedWriteEvent per stamped write
|
|
11
|
+
* - Rotation cap: 10 MB or 30 days, whichever first
|
|
12
|
+
* - Rotation runs from `wiki_admin lint`; new entries that overflow the
|
|
13
|
+
* time window are quietly dropped on read so the file can grow up to
|
|
14
|
+
* its size cap before being touched
|
|
15
|
+
*
|
|
16
|
+
* See docs/evidence-envelope.md ("Unsupported-write telemetry").
|
|
17
|
+
*/
|
|
18
|
+
export interface UnsupportedWriteEvent {
|
|
19
|
+
/** Wiki-relative path of the page that was just stamped unsupported. */
|
|
20
|
+
page: string;
|
|
21
|
+
/** ISO 8601 timestamp at write time. */
|
|
22
|
+
timestamp: string;
|
|
23
|
+
/** Optional caller hint passed through `wiki.write(path, content, source)`. */
|
|
24
|
+
agentHint?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the writer set `synthesis: true` on the page. Always false for
|
|
27
|
+
* an unsupported event by definition (synthesis pages aren't unsupported);
|
|
28
|
+
* carried for forward compatibility if the log shape ever broadens.
|
|
29
|
+
*/
|
|
30
|
+
hadSynthesisFlag: boolean;
|
|
31
|
+
/** Length of `sources: [...]` at write time. Always 0 for unsupported. */
|
|
32
|
+
rawSourcesCount: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function evidenceDir(workspace: string): string;
|
|
35
|
+
export declare function writeLogPath(workspace: string): string;
|
|
36
|
+
export declare function migrationMarkerPath(workspace: string): string;
|
|
37
|
+
/** Append a single unsupported-write event. Best-effort — never throws. */
|
|
38
|
+
export declare function appendUnsupportedWriteEvent(workspace: string, event: UnsupportedWriteEvent): void;
|
|
39
|
+
/**
|
|
40
|
+
* Read the log and return entries within the rotation window. Entries
|
|
41
|
+
* outside the time window are silently dropped from the returned list
|
|
42
|
+
* (they're cleaned out of the file by `rotateEventLog`). Best-effort —
|
|
43
|
+
* malformed lines are skipped.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readWriteLog(workspace: string, now?: Date): UnsupportedWriteEvent[];
|
|
46
|
+
/**
|
|
47
|
+
* Truncate the log file in-place to rotation policy: drop entries older
|
|
48
|
+
* than 30 days, then if the result still exceeds 10 MB drop oldest
|
|
49
|
+
* entries until it fits. Called from `wiki_admin lint`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function rotateEventLog(workspace: string, now?: Date): {
|
|
52
|
+
entriesBefore: number;
|
|
53
|
+
entriesAfter: number;
|
|
54
|
+
bytesAfter: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Count writes in the last 7 days, broken down for a one-line summary
|
|
58
|
+
* the rebuild step appends to wiki/log.md. Phase 4 will replace this
|
|
59
|
+
* with a richer dashboard.
|
|
60
|
+
*/
|
|
61
|
+
export declare function summarizeLastWeek(workspace: string, now?: Date): {
|
|
62
|
+
unsupportedCount: number;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=evidence-write-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-write-log.d.ts","sourceRoot":"","sources":["../src/evidence-write-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0EAA0E;IAC1E,eAAe,EAAE,MAAM,CAAC;CACzB;AAUD,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAErD;AACD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtD;AACD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,2EAA2E;AAC3E,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,qBAAqB,GAC3B,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,IAAiB,GACrB,qBAAqB,EAAE,CAuBzB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,IAAiB,GACrB;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAuCrE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,IAAiB,GACrB;IAAE,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAS9B"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence-first phase 2a — telemetry log for `wiki_write` calls that
|
|
3
|
+
* produce "unsupported" pages (no `sources: [...]`, no `synthesis: true`).
|
|
4
|
+
*
|
|
5
|
+
* The log seeds Phase 2b: until we know how often unsupported writes
|
|
6
|
+
* happen and whether they are legitimate, hard rejection is guesswork.
|
|
7
|
+
*
|
|
8
|
+
* Design:
|
|
9
|
+
* - Append-only JSONL at <workspace>/.agent-wiki/evidence-write-log.jsonl
|
|
10
|
+
* - One UnsupportedWriteEvent per stamped write
|
|
11
|
+
* - Rotation cap: 10 MB or 30 days, whichever first
|
|
12
|
+
* - Rotation runs from `wiki_admin lint`; new entries that overflow the
|
|
13
|
+
* time window are quietly dropped on read so the file can grow up to
|
|
14
|
+
* its size cap before being touched
|
|
15
|
+
*
|
|
16
|
+
* See docs/evidence-envelope.md ("Unsupported-write telemetry").
|
|
17
|
+
*/
|
|
18
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
19
|
+
import { dirname, join } from "node:path";
|
|
20
|
+
const ROTATION_MAX_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
21
|
+
const ROTATION_MAX_AGE_DAYS = 30;
|
|
22
|
+
/** Path conventions, relative to a workspace root. */
|
|
23
|
+
const EVIDENCE_DIR = ".agent-wiki";
|
|
24
|
+
const WRITE_LOG_FILE = "evidence-write-log.jsonl";
|
|
25
|
+
const MIGRATION_MARKER_FILE = "evidence-migrated";
|
|
26
|
+
export function evidenceDir(workspace) {
|
|
27
|
+
return join(workspace, EVIDENCE_DIR);
|
|
28
|
+
}
|
|
29
|
+
export function writeLogPath(workspace) {
|
|
30
|
+
return join(workspace, EVIDENCE_DIR, WRITE_LOG_FILE);
|
|
31
|
+
}
|
|
32
|
+
export function migrationMarkerPath(workspace) {
|
|
33
|
+
return join(workspace, EVIDENCE_DIR, MIGRATION_MARKER_FILE);
|
|
34
|
+
}
|
|
35
|
+
/** Append a single unsupported-write event. Best-effort — never throws. */
|
|
36
|
+
export function appendUnsupportedWriteEvent(workspace, event) {
|
|
37
|
+
try {
|
|
38
|
+
const path = writeLogPath(workspace);
|
|
39
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
40
|
+
appendFileSync(path, JSON.stringify(event) + "\n");
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Telemetry must never break the write itself.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read the log and return entries within the rotation window. Entries
|
|
48
|
+
* outside the time window are silently dropped from the returned list
|
|
49
|
+
* (they're cleaned out of the file by `rotateEventLog`). Best-effort —
|
|
50
|
+
* malformed lines are skipped.
|
|
51
|
+
*/
|
|
52
|
+
export function readWriteLog(workspace, now = new Date()) {
|
|
53
|
+
const path = writeLogPath(workspace);
|
|
54
|
+
if (!existsSync(path))
|
|
55
|
+
return [];
|
|
56
|
+
try {
|
|
57
|
+
const cutoffMs = now.getTime() - ROTATION_MAX_AGE_DAYS * 24 * 60 * 60 * 1000;
|
|
58
|
+
const lines = readFileSync(path, "utf-8").split("\n");
|
|
59
|
+
const events = [];
|
|
60
|
+
for (const line of lines) {
|
|
61
|
+
const trimmed = line.trim();
|
|
62
|
+
if (!trimmed)
|
|
63
|
+
continue;
|
|
64
|
+
try {
|
|
65
|
+
const entry = JSON.parse(trimmed);
|
|
66
|
+
if (!entry.timestamp)
|
|
67
|
+
continue;
|
|
68
|
+
const t = new Date(entry.timestamp).getTime();
|
|
69
|
+
if (Number.isFinite(t) && t >= cutoffMs)
|
|
70
|
+
events.push(entry);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// skip malformed line
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return events;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Truncate the log file in-place to rotation policy: drop entries older
|
|
84
|
+
* than 30 days, then if the result still exceeds 10 MB drop oldest
|
|
85
|
+
* entries until it fits. Called from `wiki_admin lint`.
|
|
86
|
+
*/
|
|
87
|
+
export function rotateEventLog(workspace, now = new Date()) {
|
|
88
|
+
const path = writeLogPath(workspace);
|
|
89
|
+
if (!existsSync(path)) {
|
|
90
|
+
return { entriesBefore: 0, entriesAfter: 0, bytesAfter: 0 };
|
|
91
|
+
}
|
|
92
|
+
const cutoffMs = now.getTime() - ROTATION_MAX_AGE_DAYS * 24 * 60 * 60 * 1000;
|
|
93
|
+
const lines = readFileSync(path, "utf-8").split("\n").filter((l) => l.trim());
|
|
94
|
+
const entriesBefore = lines.length;
|
|
95
|
+
// First pass: drop entries older than the time window.
|
|
96
|
+
const kept = [];
|
|
97
|
+
for (const line of lines) {
|
|
98
|
+
try {
|
|
99
|
+
const entry = JSON.parse(line);
|
|
100
|
+
const t = entry.timestamp ? new Date(entry.timestamp).getTime() : NaN;
|
|
101
|
+
if (Number.isFinite(t) && t >= cutoffMs) {
|
|
102
|
+
kept.push({ line, ts: t });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// malformed — drop
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Second pass: if still over size cap, drop oldest entries.
|
|
110
|
+
kept.sort((a, b) => a.ts - b.ts);
|
|
111
|
+
let totalBytes = kept.reduce((acc, { line }) => acc + Buffer.byteLength(line) + 1, 0);
|
|
112
|
+
while (totalBytes > ROTATION_MAX_BYTES && kept.length > 0) {
|
|
113
|
+
const dropped = kept.shift();
|
|
114
|
+
totalBytes -= Buffer.byteLength(dropped.line) + 1;
|
|
115
|
+
}
|
|
116
|
+
const newContent = kept.length === 0 ? "" : kept.map((k) => k.line).join("\n") + "\n";
|
|
117
|
+
writeFileSync(path, newContent);
|
|
118
|
+
return {
|
|
119
|
+
entriesBefore,
|
|
120
|
+
entriesAfter: kept.length,
|
|
121
|
+
bytesAfter: Buffer.byteLength(newContent),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Count writes in the last 7 days, broken down for a one-line summary
|
|
126
|
+
* the rebuild step appends to wiki/log.md. Phase 4 will replace this
|
|
127
|
+
* with a richer dashboard.
|
|
128
|
+
*/
|
|
129
|
+
export function summarizeLastWeek(workspace, now = new Date()) {
|
|
130
|
+
const sevenDaysMs = 7 * 24 * 60 * 60 * 1000;
|
|
131
|
+
const cutoff = now.getTime() - sevenDaysMs;
|
|
132
|
+
const events = readWriteLog(workspace, now);
|
|
133
|
+
const recent = events.filter((e) => {
|
|
134
|
+
const t = new Date(e.timestamp).getTime();
|
|
135
|
+
return Number.isFinite(t) && t >= cutoff;
|
|
136
|
+
});
|
|
137
|
+
return { unsupportedCount: recent.length };
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=evidence-write-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-write-log.js","sourceRoot":"","sources":["../src/evidence-write-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,YAAY,EAEZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAmB1C,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AACrD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,sDAAsD;AACtD,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAClD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAElD,MAAM,UAAU,WAAW,CAAC,SAAiB;IAC3C,OAAO,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACvC,CAAC;AACD,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,OAAO,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;AACvD,CAAC;AACD,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,qBAAqB,CAAC,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U,CAAC,UAAU,CAAC;KAC1C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAiB,EACjB,MAAY,IAAI,IAAI,EAAE;IAEtB,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC;IAC3C,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACjC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;QAC1C,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;IAC3C,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-write-log.test.d.ts","sourceRoot":"","sources":["../src/evidence-write-log.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { mkdtempSync, rmSync, readFileSync, writeFileSync, existsSync, mkdirSync, statSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { appendUnsupportedWriteEvent, readWriteLog, rotateEventLog, summarizeLastWeek, writeLogPath, evidenceDir, } from "./evidence-write-log.js";
|
|
6
|
+
let workspace;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
workspace = mkdtempSync(join(tmpdir(), "evidence-log-"));
|
|
9
|
+
});
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
rmSync(workspace, { recursive: true, force: true });
|
|
12
|
+
});
|
|
13
|
+
describe("appendUnsupportedWriteEvent", () => {
|
|
14
|
+
it("creates the .agent-wiki dir and writes a JSONL line", () => {
|
|
15
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
16
|
+
page: "concept-x.md",
|
|
17
|
+
timestamp: "2026-05-06T10:00:00.000Z",
|
|
18
|
+
hadSynthesisFlag: false,
|
|
19
|
+
rawSourcesCount: 0,
|
|
20
|
+
});
|
|
21
|
+
const path = writeLogPath(workspace);
|
|
22
|
+
expect(existsSync(path)).toBe(true);
|
|
23
|
+
const content = readFileSync(path, "utf-8");
|
|
24
|
+
const parsed = JSON.parse(content.trim());
|
|
25
|
+
expect(parsed.page).toBe("concept-x.md");
|
|
26
|
+
});
|
|
27
|
+
it("appends multiple events as separate lines", () => {
|
|
28
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
29
|
+
page: "a.md", timestamp: "2026-05-06T10:00:00.000Z", hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
30
|
+
});
|
|
31
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
32
|
+
page: "b.md", timestamp: "2026-05-06T10:01:00.000Z", hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
33
|
+
});
|
|
34
|
+
const lines = readFileSync(writeLogPath(workspace), "utf-8").trim().split("\n");
|
|
35
|
+
expect(lines).toHaveLength(2);
|
|
36
|
+
});
|
|
37
|
+
it("does not throw when filesystem write fails", () => {
|
|
38
|
+
// Point at an invalid workspace (nested under a file, not a dir).
|
|
39
|
+
const nonexistent = join(workspace, "not", "a", "real", "path");
|
|
40
|
+
writeFileSync(join(workspace, "not"), "this is a file, not a dir");
|
|
41
|
+
expect(() => appendUnsupportedWriteEvent(nonexistent, {
|
|
42
|
+
page: "x.md", timestamp: "2026-05-06T10:00:00.000Z", hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
43
|
+
})).not.toThrow();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe("readWriteLog", () => {
|
|
47
|
+
it("returns events newer than the 30-day window", () => {
|
|
48
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
49
|
+
page: "recent.md", timestamp: "2026-05-06T10:00:00.000Z",
|
|
50
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
51
|
+
});
|
|
52
|
+
const events = readWriteLog(workspace, new Date("2026-05-07T00:00:00.000Z"));
|
|
53
|
+
expect(events.map((e) => e.page)).toEqual(["recent.md"]);
|
|
54
|
+
});
|
|
55
|
+
it("filters out entries older than 30 days", () => {
|
|
56
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
57
|
+
page: "old.md", timestamp: "2026-01-01T00:00:00.000Z",
|
|
58
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
59
|
+
});
|
|
60
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
61
|
+
page: "new.md", timestamp: "2026-05-05T00:00:00.000Z",
|
|
62
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
63
|
+
});
|
|
64
|
+
const events = readWriteLog(workspace, new Date("2026-05-06T00:00:00.000Z"));
|
|
65
|
+
expect(events.map((e) => e.page)).toEqual(["new.md"]);
|
|
66
|
+
});
|
|
67
|
+
it("skips malformed JSON lines without throwing", () => {
|
|
68
|
+
mkdirSync(evidenceDir(workspace), { recursive: true });
|
|
69
|
+
writeFileSync(writeLogPath(workspace), `{"page": "ok.md", "timestamp": "2026-05-06T10:00:00.000Z", "hadSynthesisFlag": false, "rawSourcesCount": 0}\nthis is not json\n{"page": "ok2.md", "timestamp": "2026-05-06T11:00:00.000Z", "hadSynthesisFlag": false, "rawSourcesCount": 0}\n`);
|
|
70
|
+
const events = readWriteLog(workspace, new Date("2026-05-07T00:00:00.000Z"));
|
|
71
|
+
expect(events.map((e) => e.page)).toEqual(["ok.md", "ok2.md"]);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe("rotateEventLog", () => {
|
|
75
|
+
it("drops entries older than 30 days", () => {
|
|
76
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
77
|
+
page: "old.md", timestamp: "2025-01-01T00:00:00.000Z",
|
|
78
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
79
|
+
});
|
|
80
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
81
|
+
page: "new.md", timestamp: "2026-05-05T00:00:00.000Z",
|
|
82
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
83
|
+
});
|
|
84
|
+
const result = rotateEventLog(workspace, new Date("2026-05-06T00:00:00.000Z"));
|
|
85
|
+
expect(result.entriesBefore).toBe(2);
|
|
86
|
+
expect(result.entriesAfter).toBe(1);
|
|
87
|
+
const remaining = readFileSync(writeLogPath(workspace), "utf-8");
|
|
88
|
+
expect(remaining).toContain("new.md");
|
|
89
|
+
expect(remaining).not.toContain("old.md");
|
|
90
|
+
});
|
|
91
|
+
it("returns zero counts when no log file exists", () => {
|
|
92
|
+
const result = rotateEventLog(workspace);
|
|
93
|
+
expect(result).toEqual({ entriesBefore: 0, entriesAfter: 0, bytesAfter: 0 });
|
|
94
|
+
});
|
|
95
|
+
it("drops oldest entries when total exceeds size cap", () => {
|
|
96
|
+
// Synthetic: write a 12 MB log — well over the 10 MB cap.
|
|
97
|
+
mkdirSync(evidenceDir(workspace), { recursive: true });
|
|
98
|
+
const eventLine = (i, dateOffsetSec) => {
|
|
99
|
+
const ts = new Date(Date.now() - dateOffsetSec * 1000).toISOString();
|
|
100
|
+
// Pad page name so each line is ~12 KB; we'll need ~1000 lines for 12 MB.
|
|
101
|
+
const padding = "x".repeat(11900);
|
|
102
|
+
return JSON.stringify({
|
|
103
|
+
page: `p${i}-${padding}.md`,
|
|
104
|
+
timestamp: ts,
|
|
105
|
+
hadSynthesisFlag: false,
|
|
106
|
+
rawSourcesCount: 0,
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const lines = [];
|
|
110
|
+
for (let i = 0; i < 1000; i++) {
|
|
111
|
+
lines.push(eventLine(i, 1000 - i)); // older entries first
|
|
112
|
+
}
|
|
113
|
+
writeFileSync(writeLogPath(workspace), lines.join("\n") + "\n");
|
|
114
|
+
expect(statSync(writeLogPath(workspace)).size).toBeGreaterThan(10 * 1024 * 1024);
|
|
115
|
+
const result = rotateEventLog(workspace);
|
|
116
|
+
expect(result.bytesAfter).toBeLessThanOrEqual(10 * 1024 * 1024);
|
|
117
|
+
expect(result.entriesAfter).toBeLessThan(1000);
|
|
118
|
+
// Newest entries must be retained — the last one had dateOffsetSec=1.
|
|
119
|
+
const remaining = readFileSync(writeLogPath(workspace), "utf-8");
|
|
120
|
+
expect(remaining).toContain("p999-");
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
describe("summarizeLastWeek", () => {
|
|
124
|
+
it("counts only events within the past 7 days", () => {
|
|
125
|
+
const now = new Date("2026-05-06T00:00:00.000Z");
|
|
126
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
127
|
+
page: "in.md", timestamp: "2026-05-04T00:00:00.000Z",
|
|
128
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
129
|
+
});
|
|
130
|
+
appendUnsupportedWriteEvent(workspace, {
|
|
131
|
+
page: "out.md", timestamp: "2026-04-20T00:00:00.000Z",
|
|
132
|
+
hadSynthesisFlag: false, rawSourcesCount: 0,
|
|
133
|
+
});
|
|
134
|
+
expect(summarizeLastWeek(workspace, now).unsupportedCount).toBe(1);
|
|
135
|
+
});
|
|
136
|
+
it("returns zero when no log file exists", () => {
|
|
137
|
+
expect(summarizeLastWeek(workspace).unsupportedCount).toBe(0);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=evidence-write-log.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-write-log.test.js","sourceRoot":"","sources":["../src/evidence-write-log.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE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CAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAAE,IAAI,EAA4E,MAAM,WAAW,CAAC;AAe3G,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAyqB1E;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAQtD,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAOrF;AA4qBD,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0FAA0F;IAC1F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAmHD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC,CA0xClC;AAID,wBAAsB,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBpF"}
|