Skip to content

docs(adr): source-modeling discipline — Track G G0#186

Open
ronsse wants to merge 1 commit into
mainfrom
worktree-agent-a08e0f7ca1e902b04
Open

docs(adr): source-modeling discipline — Track G G0#186
ronsse wants to merge 1 commit into
mainfrom
worktree-agent-a08e0f7ca1e902b04

Conversation

@ronsse

@ronsse ronsse commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds docs/design/adr-source-modeling-discipline.md (~235 lines) codifying the project's stance on graph granularity decisions, with columns as the canonical worked example.
  • Default rule: columns are properties on the parent table node, not standalone nodes. properties.columns (structured) + properties.column_names (flat denormalized list for exact-match search via existing in filter).
  • Enforcement: warn + opt-in flag (allow_structural_leaf: bool = False) on EntityRule and EntityDraft. Soft validator emits structlog WARNING on entity_type in {"Column", "column", "TableColumn", "table_column"} blocklist unless flag set. Does NOT reject mutations.
  • Regulated-column exception: operator sets allow_structural_leaf=True AND node_role="structural" for the rare case where column-level entities earn their own nodes (PII / governance lifecycle).
  • Column-level lineage: no name-match. Stable column identifiers required; cross-table same-name flow is forbidden. v1 column-level lineage stays as table-level edges with optional edge.properties.column_pairs annotations.

Test plan

  • ADR reads cleanly alongside docs/agent-guide/modeling-guide.md (Schema explosion anti-pattern) and docs/agent-guide/source-modeling-cookbook.md (existing column guidance)
  • Cross-references to adr-canonical-graph-layer.md §4 + §8.2 resolve (the deferral of nested-path DSL operators)
  • Blocklist constant name (ENTITY_TYPE_ANTI_PATTERNS) matches sibling Unit G1's implementation
  • Validator helper name (validate_entity_type_not_anti_pattern) matches sibling Unit G1's implementation
  • Sibling Unit G2's cookbook recipe is consistent with §2.2 (denormalization rationale)

🤖 Generated with Claude Code

…mple)

Track G Wave 1 unit G0. Codifies the project's stance on graph
granularity decisions, with columns as the canonical worked example:
columns are properties (not nodes), searchability runs through a
denormalized `column_names` flat list on the existing DSL, the
extractor warns (does not reject) on `entity_type` matching a tight
blocklist, the regulated-column exception requires both
`allow_structural_leaf=True` and `node_role=STRUCTURAL`, and
column-level lineage by name-match across tables is forbidden.

G1 ships the validator + blocklist constant; G2 ships the SDK example
update + cookbook recipe + contract test. This ADR is the contract
they target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant