Commit Graph

10 Commits

Author SHA1 Message Date
3b63d92976 docs: delete metagraph.md, migrate data model into metagraph-module.md
The historical reference doc was exactly the confusing artifact we were
cleaning up. Its unique content (the three-level type system overview
and ASCII diagram) now lives in metagraph-module.md as an introductory
section. Everything else was redundant:

- Schema types → metagraph-module.md (Module entries)
- SchemaBuilder → metagraph-module.md (SchemaBuilder Equivalence section)
- Usage patterns → metagraph-module.md + encrypted-data.md (Module examples)
- Composite identity / attributes storage → sqlite-host.md (table definitions)
- Versioning → schema-evolution.md (thorough treatment)
- Ecosystem context → overview.md (Ecosystem Integration section)

All cross-references updated: AGENTS.md, sqlite-host.md, schema-evolution.md.
2026-05-29 05:27:08 +00:00
95e02f939d docs: add schema-evolution.md — TypeBox Value.Diff/Patch/Cast for schema evolution 2026-05-28 16:31:25 +00:00
1e804b9174 docs: remove backward compatibility framing from architecture specs 2026-05-28 16:18:54 +00:00
5ce93b1357 docs: add metagraph-module and forward-look architecture specs, remove SchemaBuilder legacy support
Graph type definitions as TypeBox Modules — the core architecture evolution
for @alkdev/storage. The SchemaBuilder is removed (no existing consumers),
replaced by direct TypeModule construction with Metagraph.Import() for
base attribute composition and Type.Composite() for node/edge type
specialization.

Key additions:
- metagraph-module.md: Module pattern, edge constraints as named entries,
  SchemaBuilder equivalence, DB bridge contracts (moduleToDbSchema return
  type, validateNode/validateEdge signatures), 10 design decisions (DD1-DD10)
- forward-look.md: pointer abstraction (ujsx ValuePointer analogy, JPATH
  Module), dbtype table rendering relationship, ujsx as universal IR pipeline

Critical corrections from architecture review:
- Type.Composite uses IntersectEvaluated (intersection, not Object.assign
  override) — overlapping keys with subtype relationships resolve correctly
- Type.Ref inside Type.Composite within a Module is verified working
- BaseNode/BaseEdge use Metagraph.Import() for same-package Modules (Option B),
  not local re-declaration (no circular dep within same package)
- Edge constraints use Type.String() for node type name arrays (not Type.Ref) —
  constraints contain names, not schemas
2026-05-28 15:32:56 +00:00
33a5b0816d docs: correct ecosystem dependency direction and add integration context
Architecture docs previously referenced the hub as the authoritative source
for call/identity specs. In reality, call protocol, identity, and access control
come from @alkdev/operations; call graph schemas from @alkdev/flowgraph; task
graph schemas from @alkdev/taskgraph; event transport from @alkdev/pubsub. The
hub is a consumer of @alkdev/storage, not the other way around.

Key changes:
- overview.md: add Ecosystem Integration section with dependency direction
  diagram, What Comes From Where table, repo layer bridging pattern, and
  circular dependency avoidance guidance
- overview.md: promote repo-layer vs operations-bridging from open question
  to explicit decision (CRUD in storage, bridging in consumer)
- overview.md: add zero-ecosystem-dependency statement; fix taskgraph type
  names (TaskGraphNodeAttributes, DependencyEdge)
- overview.md: fix terminology (hub is consumer, not authority)
- metagraph.md: add Ecosystem Context section; replace hub references with
  correct ecosystem sources; fix GraphStatus/GraphBaseType enum
  mischaracterization (C1); unify empty-array semantics with sqlite-host (C2);
  clarify repo layer does NOT import operations (C3); add flowgraph canonical
  schema note; add versioning cross-reference to graph_types table
- encrypted-data.md: reframe hub as provenance not authority; update What
  Lives Where table; fix standalone table advice; update references
- sqlite-host.md: fix actors table description; unify empty-array semantics;
  contextualize hub as reference consumer; add operations identity reference
2026-05-28 14:25:16 +00:00
bb544469fd fix: use import type for GraphConfig, remove verbatim-module-syntax exclusion
The verbatim-module-syntax lint rule was correctly flagging that
GraphConfig is only used in a type position (typeof GraphConfig). Since
typeof resolves purely at the type level, import type works fine here
and is the correct form. No lint exclusion needed.

Also: deno fmt across all files (markdown line wrapping).
2026-05-28 13:38:42 +00:00
b0298663dc 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
2026-05-28 13:18:56 +00:00
351fc98ec1 docs: add AGENTS.md and fix agent role defs for deno-first project
- Add AGENTS.md with project overview, conventions, commands, and heritage notes
- Fix all npm→deno command references in coordinator, implementation-specialist, poc-specialist
- Fix project name in coordinator spawn template (@alkdev/operations→@alkdev/storage)
- Remove hub-specific content (future model, hub operations) from coordinator
- Add project-specific conventions to implementation-specialist (no comments, TypeBox, slow types, etc.)
- Add deno-specific review checks to code-reviewer
- Fix file path examples in implementation-specialist (packages/core→src/graphs)
- Update sdd_process.md to remove hub-specific references and architecture doc list
- Update architect examples to use storage component names
2026-05-28 12:29:39 +00:00
8c68dd6b07 feat: deno-first storage package with sqlite host and graph schemas
Scaffolded @alkdev/storage from @ade/storage_sqlite and @ade/core/graphs:
- graphs/ module: TypeBox schema types + SchemaBuilder (from @ade/core/graphs)
- sqlite/ module: Drizzle table defs, relations, injectable client (from @ade/storage_sqlite)
- pg/ module: placeholder for Postgres host
- deno.json configured for JSR with subpath exports (./graphs, ./sqlite, ./pg)
- Imports swapped: @sinclair/typebox → @alkdev/typebox, drizzle-typebox → @alkdev/drizzlebox
- Client is now injectable (no hardcoded env vars or module-level side effects)
- no-slow-types lint excluded (Drizzle generics); --allow-slow-types on publish
2026-05-28 12:19:48 +00:00
c6ea6c15e9 init 2026-05-28 11:16:10 +00:00