feat: add architecture docs, fix code issues from review, add analyze_lint script

Architecture docs (docs/architecture/):
- overview.md: package purpose, exports, terminology, design decisions, gaps
- metagraph.md: core graph model, schema types, SchemaBuilder, validation
- sqlite-host.md: SQLite tables, common columns, relations, concurrency model
- encrypted-data.md: encrypted data as a node type, AES-256-GCM crypto utility design

Code fixes from architecture review:
- Remove ConfigSchema duplication in graphTypes.ts (import GraphConfig from types.ts)
- Add missing SelectNodeSchema/SelectNode to nodes.ts
- Fix InsertEdge.key to be Optional (match nullable DB column)
- Replace TypeScript enums with as const objects (GRAPH_STATUS, GRAPH_BASE_TYPE)
- Add verbatim-module-syntax to lint exclusions (TypeBox false positive)
- Add @std/flags and @std/path to deno.json imports

Infrastructure:
- Add scripts/analyze_lint.ts from @ade for grouped lint analysis
- Add deno task lint:analyze
- Update AGENTS.md with architecture doc references, enum convention, crypto todo
This commit is contained in:
2026-05-28 13:18:56 +00:00
parent 351fc98ec1
commit b0298663dc
13 changed files with 1311 additions and 37 deletions

View File

@@ -16,17 +16,20 @@
"drizzle-orm/pg-core": "npm:drizzle-orm/pg-core",
"@libsql/client": "npm:@libsql/client",
"postgres": "npm:postgres",
"@std/assert": "jsr:@std/assert"
"@std/assert": "jsr:@std/assert",
"@std/flags": "jsr:@std/flags",
"@std/path": "jsr:@std/path"
},
"lint": {
"rules": {
"exclude": ["no-slow-types"]
"exclude": ["no-slow-types", "verbatim-module-syntax"]
}
},
"tasks": {
"check": "deno check mod.ts src/graphs/mod.ts src/sqlite/mod.ts",
"test": "deno test --allow-all test/",
"lint": "deno lint",
"lint:analyze": "deno run --allow-read --allow-run scripts/analyze_lint.ts",
"fmt": "deno fmt",
"publish:dry": "deno publish --allow-slow-types --dry-run"
}