Skip to content

feat(codegen): split sidecar DDL by dialect; reject json sidecar (#45)#113

Merged
hyperpolymath merged 2 commits into
mainfrom
feat/vsm45-dialect-split
May 18, 2026
Merged

feat(codegen): split sidecar DDL by dialect; reject json sidecar (#45)#113
hyperpolymath merged 2 commits into
mainfrom
feat/vsm45-dialect-split

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Resolves #45 (V-L2-F1) — split overlay DDL by dialect; resolve the json sidecar.

What changed

  • New codegen::overlay::SqlDialect { Sqlite, Postgres } + from_storage() mapping [sidecar].storage.
  • generate_sidecar_schema(schema, octad, dialect) dispatches to overlay::sqlite::generate / overlay::postgres::generate. Portable table bodies are shared via assemble(); the only dialect-divergent fragment (metadata upsert) is per-module: SQLite INSERT OR IGNORE vs PostgreSQL INSERT … ON CONFLICT DO NOTHING.
  • The SQLite-only datetime('now') replaced by portable CURRENT_TIMESTAMP (both engines).
  • storage = "json" is now rejected with a clear error (it previously silently emitted SQLite DDL for a JSON store). Implementing/dropping the JSON store is split out as V-L2-F2: implement the JSON sidecar storage backend (split from #45) #112 (V-L2-F2); SidecarConfig docs updated.
  • main.rs derives the dialect from the manifest.

Acceptance

6 existing overlay tests retained (dialect-explicit) + 5 new. Suite: 112 lib + 9 integration green. The single red is the pre-existing failing-by-design provenance_fork_test (#104, fixed by open PR #109) — on main, unrelated.

Note: developed in an isolated git worktree because a concurrent session was mutating the shared checkout; this branch contains only the #45 change (no #51/#38 contamination).

🤖 Generated with Claude Code

hyperpolymath and others added 2 commits May 17, 2026 06:19
generate_sidecar_schema now takes a SqlDialect and dispatches to new
overlay::sqlite / overlay::postgres modules. The portable table bodies
are shared via assemble(); the only dialect-divergent fragment — the
metadata upsert — is per-module: SQLite INSERT OR IGNORE vs PostgreSQL
INSERT … ON CONFLICT DO NOTHING. The SQLite-only datetime('now') is
replaced by portable CURRENT_TIMESTAMP.

SqlDialect::from_storage maps [sidecar].storage: sqlite→Sqlite,
postgres/postgresql→Postgres, and rejects "json" (previously it
silently emitted SQLite DDL for a JSON store) with a pointer to the
split-out tracking issue #112. main.rs derives the dialect from the
manifest; SidecarConfig docs updated.

6 existing overlay tests retained (now dialect-explicit) + 5 new:
sqlite seed/timestamp, postgres ON CONFLICT, shared bodies, empty
schema, storage→dialect mapping. Suite: 112 lib + 9 integration green.

Closes #45.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit de1e4a3 into main May 18, 2026
11 of 12 checks passed
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 21 issues detected

Severity Count
🔴 Critical 2
🟠 High 8
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Required file missing",
    "type": "missing",
    "file": "SECURITY.md",
    "action": "create",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action actions/checkout@v4 needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action Swatinem/rust-cache@v2 needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/checkout@v4 needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action dtolnay/rust-toolchain@master needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action Swatinem/rust-cache@v2 needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Required file missing (condition: public_repo)",
    "type": "missing_requirement",
    "file": "SECURITY.md",
    "action": "create",
    "rule_module": "cicd_rules",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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.

V-L2-F1: split overlay DDL by dialect (sqlite vs postgres); implement json sidecar or drop the option

1 participant