@toolbaux/guardian 0.1.21 → 0.1.23
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/README.md +1 -1
- package/dist/adapters/runner.js +72 -3
- package/dist/adapters/typescript-adapter.js +24 -10
- package/dist/benchmarking/metrics/context-coverage.js +82 -0
- package/dist/benchmarking/metrics/drift-score.js +104 -0
- package/dist/benchmarking/metrics/search-recall.js +207 -0
- package/dist/benchmarking/metrics/token-efficiency.js +79 -0
- package/dist/benchmarking/report.js +131 -0
- package/dist/benchmarking/runner.js +175 -0
- package/dist/benchmarking/types.js +13 -0
- package/dist/cli.js +53 -10
- package/dist/commands/benchmark.js +62 -0
- package/dist/commands/discrepancy.js +1 -1
- package/dist/commands/doc-generate.js +1 -1
- package/dist/commands/doc-html.js +1 -1
- package/dist/commands/extract.js +1 -1
- package/dist/commands/feature-context.js +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/intel.js +47 -1
- package/dist/commands/mcp-serve.js +48 -288
- package/dist/commands/search.js +602 -14
- package/dist/db/file-specs-store.js +174 -0
- package/dist/db/fts-builder.js +305 -0
- package/dist/db/index.js +55 -0
- package/dist/db/specs-store.js +13 -0
- package/dist/db/sqlite-specs-store.js +441 -0
- package/dist/extract/codebase-intel.js +31 -2
- package/dist/extract/compress.js +70 -3
- package/dist/extract/context-block.js +11 -2
- package/dist/extract/function-intel.js +5 -2
- package/dist/extract/index.js +1 -23
- package/dist/extract/writer.js +6 -0
- package/package.json +3 -1
package/dist/extract/writer.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import yaml from "js-yaml";
|
|
4
|
+
// ── File-based (original, unchanged) ─────────────────────────────────────────
|
|
4
5
|
export async function writeSnapshots(outputDir, architecture, ux) {
|
|
5
6
|
await fs.mkdir(outputDir, { recursive: true });
|
|
6
7
|
const architecturePath = path.join(outputDir, "architecture.snapshot.yaml");
|
|
@@ -9,3 +10,8 @@ export async function writeSnapshots(outputDir, architecture, ux) {
|
|
|
9
10
|
await fs.writeFile(uxPath, yaml.dump(ux, { noRefs: true, lineWidth: 120 }));
|
|
10
11
|
return { architecturePath, uxPath };
|
|
11
12
|
}
|
|
13
|
+
// ── Store-based (new — works with FileSpecsStore or SqliteSpecsStore) ─────────
|
|
14
|
+
export async function writeSnapshotsViaStore(store, architecture, ux) {
|
|
15
|
+
await store.writeSpec("architecture.snapshot", yaml.dump(architecture, { noRefs: true, lineWidth: 120 }), "yaml");
|
|
16
|
+
await store.writeSpec("ux.snapshot", yaml.dump(ux, { noRefs: true, lineWidth: 120 }), "yaml");
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolbaux/guardian",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Architectural intelligence for codebases. Verify that AI-generated code matches your architectural intent.",
|
|
6
6
|
"keywords": [
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"benchmark:llm": "tsx scripts/benchmark-llm-context/index.ts"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
+
"better-sqlite3": "^12.8.0",
|
|
56
57
|
"commander": "^12.1.0",
|
|
57
58
|
"dotenv": "^17.3.1",
|
|
58
59
|
"js-yaml": "^4.1.0",
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"zod": "^3.23.8"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
71
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
70
72
|
"@types/js-yaml": "^4.0.9",
|
|
71
73
|
"@types/node": "^20.11.30",
|
|
72
74
|
"@vitest/coverage-v8": "^4.1.0",
|