From 063cecec96172d96a50e40d60ff96e6d25654d90 Mon Sep 17 00:00:00 2001 From: Aaron Stainback Date: Fri, 24 Apr 2026 03:30:21 -0400 Subject: [PATCH] backlog: P2 Schema-as-Graph first-class entities (Aaron Otto-127) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aaron Otto-127 directive: 'would it be possible to have a graph view of the entire table and relations so the whole schema is first class i the graph plus we could have special edge node whatever else we need entities if needed for more fidelity than reguarl sql table structrue and relationships allow. backlog'. Natural extension of Graph substrate (PR #317/#319). Schema-as- Graph is NOT a visualization — it's canonical representation with typed node/edge/entity kinds for higher fidelity than SQL: - Nodes: Table / Column / Index / Constraint / View / etc. - Edges: ForeignKey / Contains / DependsOn / InheritsFrom / etc. - Custom entities: Domain / Aggregate / EventStream / Retraction (first-class 'relationship was removed' edges with timestamp) / Provenance (migration / who / when for each edge) Round-trip tests ensure SQL ↔ Graph preserves invariants. Bidirectional mutations: Graph changes emit SQL DDL; DDL changes mutate Graph. Schema-change-over-time becomes Graph event stream with retraction- native semantics. P2; effort M+M+L. Aminata threat-pass: BP-11 (schema-as-data-not- directives; tool-generated DDL requires review). Composes with Graph substrate (PR #317/#319) + Otto-121 tight-in- all-aspects directive. Co-Authored-By: Claude Opus 4.7 --- docs/BACKLOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/BACKLOG.md b/docs/BACKLOG.md index aea80aab..2f7e1b2f 100644 --- a/docs/BACKLOG.md +++ b/docs/BACKLOG.md @@ -4275,6 +4275,8 @@ systems. This track claims the space. ## P2 — research-grade +- [ ] **Schema-as-Graph — entire database schema (tables + relations + custom entities) as a first-class graph view, with typed edge/node/entity kinds for higher fidelity than SQL allows.** Aaron 2026-04-24 Otto-127 directive: *"would it be possible to have a graph view of the entire table and relations so the whole schema is first class i the graph plus we could have special edge node whatever else we need entities if needed for more fidelity than reguarl sql table structrue and relationships allow. backlog"*. Natural extension of the Graph substrate landed Otto-124/126 (PR #317 + PR #319). Scope: (1) define schema-node types — Table / Column / Index / Constraint / View / StoredProcedure / Trigger (or broader if non-SQL); (2) define schema-edge types — ForeignKey / Contains / References / DependsOn / InheritsFrom / ImplementsInterface (higher-fidelity than SQL's binary FK-or-not); (3) define custom entity types beyond SQL — e.g. Domain (conceptual grouping), Aggregate (DDD-style consistency boundary), EventStream (for event-sourced entities), Retraction (first-class "this relationship was removed" edge with timestamp), Provenance (which migration / who / when for each edge); (4) round-trip tests: SQL schema → Graph → SQL schema preserves invariants; (5) bidirectional: mutations in Graph can emit SQL DDL; SQL DDL can mutate Graph. This is NOT just a visualization; it's the canonical representation. Database schema becomes a `Graph` with all retraction-native + event-stream + operator-algebra properties Otto-121 codified. Schema-change-over-time = Graph-event-stream. Aminata threat-pass: schema-as-data-not-directives; tool-generated DDL requires review (BP-11). Priority P2 research-grade; effort M (type design + operators) + M (round-trip tests) + L (DDL emitter if shipped). Composes with Graph substrate (PR #317/#319) + ZSet's retraction-native semantics + Otto-121 tight-in-all-aspects directive. + - [ ] **Git-native PR-conversation preservation — extract PR review threads + comments to git-tracked files on merge.** Aaron 2026-04-24 Otto-113 directive: *"you probably need to resolve and save the conversations on the PRs to git for gitnative presevration"*. Currently PR review threads (Copilot / Codex connector / human reviewer comments) live GitHub-side only; if repo is mirrored / forked / GitHub has an outage / repo is migrated, the conversation substrate is lost. For glass-halo transparency + retractability, PR discussions belong in-repo. Proposed mechanism: workflow (or post-merge skill) that fetches all review threads + general PR comments for a merged PR, serialises them as markdown at `docs/pr-discussions/PR--.md` with attribution (reviewer id/bot), timestamps, thread structure, and resolution status. Scope: (1) design PR-discussion schema + file shape; (2) fetch-on-merge mechanism (GHA workflow using `gh api graphql`); (3) privacy pass (strip anything sensitive from reviewer comments); (4) backfill historical PRs or declare cutover-forward. Priority P2 research-grade; effort S (mechanism) + M (backfill if chosen). Composes with Otto-113 bootstrap-attempt-1 memory + docs-lint/memory-no-lint policy (discussions go in docs/) + the ChatGPT-download-skill (PR #300) pattern. - [ ] **Ongoing memory-sync mechanism — keep in-repo `memory/` mirrored with auto-memory writes during each Otto tick.** Aaron 2026-04-24 Otto-113 directive *"our memories should all be checked in now"* + Otto-114 confirmation that in-repo memory/ is the natural home for ALL memory types. Otto-113 one-shot sync (PR #307) mirrored 439 files. Going forward, every Otto tick that writes to `~/.claude/projects/.../memory/` should also land new/updated files in-repo `memory/` with matching MEMORY.md pointer update (per memory-index-integrity + memory-reference-existence-lint workflows). Proposed mechanisms: (a) end-of-tick skill that rsyncs new memories to a branch + PRs them; (b) direct-to-repo writes with auto-memory as read-cache; (c) GHA cron periodic sync. Initial preference: (a) for CLI-tool compatibility today, (b) long-term. Also includes path-unification design (decide whether to deprecate the `~/.claude/projects/...` path for this project entirely or keep as staging). Priority P2 research-grade; effort S (rsync skill) + M (direct-write tooling). Composes with `memory/feedback_natural_home_of_memories_is_in_repo_now_all_types_*.md` (Otto-114 policy) + PR #307 one-shot sync + memory-index-integrity workflow.