Skip to content

backlog: P2 Schema-as-Graph first-class entities (Aaron Otto-127)#320

Closed
AceHack wants to merge 1 commit intomainfrom
backlog/graph-as-schema-first-class-entities
Closed

backlog: P2 Schema-as-Graph first-class entities (Aaron Otto-127)#320
AceHack wants to merge 1 commit intomainfrom
backlog/graph-as-schema-first-class-entities

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented Apr 24, 2026

Aaron Otto-127 directive. Natural extension of Graph substrate PR #317/#319 — canonical schema representation as typed Graph, not visualization. Retraction-native schema-change-over-time via event stream.

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 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 24, 2026 07:30
@AceHack AceHack enabled auto-merge (squash) April 24, 2026 07:30
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new P2 research-grade backlog item to track “Schema-as-Graph” as a first-class, canonical schema representation built on the Graph substrate (PR #317/#319), including retraction-native schema evolution and potential SQL round-tripping.

Changes:

  • Add a P2 backlog entry describing Schema-as-Graph scope, invariants, and desired bidirectional SQL/DDL integration.

Comment thread docs/BACKLOG.md

## 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<SchemaEntity>` 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.
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 (xref): This references “Otto-124/126” as the source for PR #317/#319, but there’s no other in-repo occurrence of Otto-124 or Otto-126 to resolve what those identifiers mean. Consider either (a) replacing Otto-124/126 with a resolvable reference (e.g., the Graph substrate ADR in docs/DECISIONS/...) or (b) dropping the Otto-124/126 mention and just citing PR #317/#319.

Suggested change
- [ ] **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<SchemaEntity>` 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.
- [ ] **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 in PR #317 and 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<SchemaEntity>` 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.

Copilot uses AI. Check for mistakes.
Comment thread docs/BACKLOG.md

## 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<SchemaEntity>` 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.
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 (xref): This entry introduces “Otto-127 directive” but there’s no corresponding in-repo reference to Otto-127 (e.g., a memory or ADR) that readers can follow for context. If Otto-127 is meant to be a durable directive handle, consider adding the backing record (or linking to an existing one) so the identifier is traceable.

Suggested change
- [ ] **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<SchemaEntity>` 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.
- [ ] **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.** Backlog note from 2026-04-24: *"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<SchemaEntity>` 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.

Copilot uses AI. Check for mistakes.
Comment thread docs/BACKLOG.md

## 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<SchemaEntity>` 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.
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 (readability): This backlog row is a single very long line with multiple nested “Scope: (1)…(5)” items, which makes future diffs and review harder. Consider splitting the scope into wrapped lines or nested sub-bullets under the main checkbox (keeping markdown continuation indentation consistent with nearby entries).

Suggested change
- [ ] **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<SchemaEntity>` 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.
- [ ] **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:
- define schema-node types — Table / Column / Index / Constraint
/ View / StoredProcedure / Trigger (or broader if non-SQL)
- define schema-edge types — ForeignKey / Contains / References
/ DependsOn / InheritsFrom / ImplementsInterface
(higher-fidelity than SQL's binary FK-or-not)
- 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)
- round-trip tests: SQL schema → Graph → SQL schema preserves
invariants
- 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<SchemaEntity>`
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.

Copilot uses AI. Check for mistakes.
@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented Apr 24, 2026

Superseded by consolidated resurrect. Same pattern.

@AceHack AceHack closed this Apr 24, 2026
auto-merge was automatically disabled April 24, 2026 07:48

Pull request was closed

AceHack added a commit that referenced this pull request Apr 24, 2026
…+ #320)

PRs #313 (pre-landing sanitizer), #314 (claude --agent flag research),
and #320 (schema-as-graph) all hit DIRTY state from positional
rebase conflicts — each added a row at top of P2, but successive
merges of adjacent BACKLOG PRs kept moving the P2 top anchor. Each
branch's append collided with main's now-different top.

Closed all three and re-filed in a single consolidated PR above
the KSK-naming row. Order chosen by directive date:
1. Schema-as-Graph (Otto-127, most recent)
2. Research claude --agent flag (Otto-120)
3. Pre-landing sanitizer (Otto-119)

Superseded PRs:
- #313 backlog/pre-landing-sanitizer-for-ferry-lint
- #314 backlog/claude-cli-agent-flag-research-map
- #320 backlog/graph-as-schema-first-class-entities

Content preserved + condensed in this PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AceHack added a commit that referenced this pull request Apr 24, 2026
…320) (#325)

* backlog: resurrect 3 BACKLOG rows consolidated (supersedes #313 + #314 + #320)

PRs #313 (pre-landing sanitizer), #314 (claude --agent flag research),
and #320 (schema-as-graph) all hit DIRTY state from positional
rebase conflicts — each added a row at top of P2, but successive
merges of adjacent BACKLOG PRs kept moving the P2 top anchor. Each
branch's append collided with main's now-different top.

Closed all three and re-filed in a single consolidated PR above
the KSK-naming row. Order chosen by directive date:
1. Schema-as-Graph (Otto-127, most recent)
2. Research claude --agent flag (Otto-120)
3. Pre-landing sanitizer (Otto-119)

Superseded PRs:
- #313 backlog/pre-landing-sanitizer-for-ferry-lint
- #314 backlog/claude-cli-agent-flag-research-map
- #320 backlog/graph-as-schema-first-class-entities

Content preserved + condensed in this PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(#325): 2 review threads — priority/section alignment + <agent_name> inline-code escape

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@AceHack AceHack reopened this Apr 24, 2026
@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented Apr 24, 2026

Reopening per 2026-04-24 closed-PR audit (maintainer directive to recover over-closes). This PR captured an Aaron directive into docs/BACKLOG.md row(s); content is NOT on main through any other path; closure was part of my over-close cascade.

Status note: this PR adds rows to docs/BACKLOG.md. Per HB-002 blocker (per-row-BACKLOG migration pending), new flat-file BACKLOG.md rows are on hold. This PR sits open as a recovery landing point:

  • If maintainer wants the content landed as-is pre-split, override the HB-002 hold for this PR specifically.
  • Post per-row-BACKLOG split lands, the row(s) convert to per-row files and this PR can merge via the new substrate.
  • Either way, content is preserved and visible, not lost in a silent close.

Retractability-in-action per Otto-238: visible reopen; no silent reversal.

@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented Apr 24, 2026

Superseded: Schema-as-Graph BACKLOG row already on main (see existing Schema-as-Graph — entire database schema as first-class typed graph P2 row in docs/BACKLOG.md per Otto-127). Branch was DIRTY and content is a no-op against current main. Per Otto-232 bulk-close-as-superseded pattern (three-signal: N<5 but content-already-landed + DIRTY + no fresh threads).

@AceHack AceHack closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants