Skip to content

feat(core): publish sql record catalog - #82

Merged
ian-pascoe merged 2 commits into
mainfrom
feat/core-sql-catalog
Aug 11, 2026
Merged

feat(core): publish sql record catalog#82
ian-pascoe merged 2 commits into
mainfrom
feat/core-sql-catalog

Conversation

@ian-pascoe

@ian-pascoe ian-pascoe commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • publish SQL storage metadata from all 19 Core Record definitions
  • enforce portable key and integer storage bounds while preserving Core public types
  • verify the exact 74-field catalog through PostgreSQL, MySQL, and SQLite resolvers
  • document the catalog and add a minor @commissary/core changeset

Testing

  • pnpm run verify
  • pnpm --filter @commissary/core test

Closes #63

Summary by CodeRabbit

  • New Features

    • Published a complete catalog of 19 built-in Core SQL records with tables, primary keys, column names, and database-specific metadata.
    • Added portable SQL type mappings for PostgreSQL, MySQL, and SQLite.
    • Added clear documentation for record definitions and SQL adapter usage.
  • Bug Fixes

    • String key fields now enforce safe length limits for MySQL compatibility.
    • Numeric fields now require nonnegative safe integers, improving validation reliability.
  • Tests

    • Added comprehensive coverage for all core records and fields across supported databases.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ian-pascoe, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5238d920-aed4-439c-ab9b-96061f57aa41

📥 Commits

Reviewing files that changed from the base of the PR and between 9318e01 and 3357f63.

📒 Files selected for processing (3)
  • .changeset/blue-agents-store.md
  • packages/core/src/store-records.ts
  • packages/core/test/sql-catalog.test.ts
📝 Walkthrough

Walkthrough

The Core record catalog now includes SQL tables, columns, primary keys, portable types, database-specific mappings, bounded string keys, and safe-integer validation. Tests cover all 19 records and 74 fields across PostgreSQL, MySQL, and SQLite.

Changes

Core SQL catalog

Layer / File(s) Summary
SQL metadata and validation contracts
packages/core/src/store-records.ts
Added SQL-aware field helpers, MySQL bounded varchar metadata, 95-code-point string-key validation, and nonnegative safe-integer validation.
Durable and runtime record catalog
packages/core/src/store-records.ts
Updated all built-in durable and runtime records with SQL definitions, table names, primary keys, column metadata, and storage intent.
Catalog verification and publication
packages/core/test/sql-catalog.test.ts, packages/core/README.md, .changeset/blue-agents-store.md
Added cross-database catalog checks, constraint tests, public type checks, documentation, and a minor-release Changeset.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant CoreRecords
  participant SqlRecord
  participant DatabaseResolvers
  participant CatalogTests
  CoreRecords->>SqlRecord: define 19 records with SQL metadata
  SqlRecord->>DatabaseResolvers: resolve PostgreSQL, MySQL, and SQLite columns
  DatabaseResolvers-->>CatalogTests: return table and field signatures
  CatalogTests->>CoreRecords: validate 74 fields, keys, bounds, and public types
Loading

Poem

I’m a rabbit with records in rows,
SQL keys bounded wherever one goes.
PostgreSQL, MySQL, SQLite align,
Nineteen definitions, seventy-four fields shine.
Hop through the catalog—everything’s fine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: publishing the Core SQL record catalog.
Description check ✅ Passed The description explains the changes, verification commands, tests, documentation, and changeset, but uses different headings from the template.
Linked Issues check ✅ Passed The changes satisfy issue #63 by publishing metadata for 19 records and 74 fields, preserving public types, adding resolver tests, documentation, and a changeset.
Out of Scope Changes check ✅ Passed The changes are limited to SQL metadata, validation bounds, tests, documentation, and release metadata required by issue #63.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/core-sql-catalog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/blue-agents-store.md:
- Line 5: Update the changeset entry to add one sentence documenting the
validation tightening: numeric fields now reject negative or non-integer values,
and string key fields reject values exceeding 95 code points, causing writes
with such values to fail validation after upgrading.

In `@packages/core/src/store-records.ts`:
- Line 234: Apply coreStringKeyMaxCodePoints to every identifier reference field
in the store-record definitions: branch.threadId and branch.head,
message.threadId and message.parent, run.threadId, run.branchId, and
run.admittedHead, plus toolCall.parentToolCallId. Extend optionalStringField to
accept and enforce the optional maximum parameter, matching requiredStringField,
so all referenced identifiers share the 95-code-point limit.
- Around line 188-201: Update coreStringKeyField so it accepts only the field
name and schema type, constructs the bounded string schema internally using
coreStringKeyMaxCodePoints, and reuses that schema for both select validation
and the SQL column definition. Remove the duplicated bound argument from all
call sites while preserving the existing mysql.varchar length and field
behavior.

In `@packages/core/test/sql-catalog.test.ts`:
- Around line 164-196: Add coverage counters to the test around
expectedCoreCatalogSignatures, incrementing one when the :text:max95 branch runs
and another when the :integer branch runs; after traversal, assert each counter
is greater than zero so both bounded schema checks are proven to execute.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 81c61e89-af36-430b-a3a2-b722b9b324ae

📥 Commits

Reviewing files that changed from the base of the PR and between 8afad5a and 9318e01.

📒 Files selected for processing (4)
  • .changeset/blue-agents-store.md
  • packages/core/README.md
  • packages/core/src/store-records.ts
  • packages/core/test/sql-catalog.test.ts

Comment thread .changeset/blue-agents-store.md
Comment thread packages/core/src/store-records.ts Outdated
Comment thread packages/core/src/store-records.ts
Comment thread packages/core/test/sql-catalog.test.ts
@ian-pascoe
ian-pascoe merged commit 6d2223c into main Aug 11, 2026
9 checks passed
@ian-pascoe
ian-pascoe deleted the feat/core-sql-catalog branch August 11, 2026 14:01
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.

Publish the Core SQL catalog

1 participant