Skip to content

test(catalog/op_bridge): D-AR-6 end-to-end feature matrix regression#41

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/op-bridge-e2e-integration-test
Jun 17, 2026
Merged

test(catalog/op_bridge): D-AR-6 end-to-end feature matrix regression#41
AdaWorldAPI merged 1 commit into
mainfrom
claude/op-bridge-e2e-integration-test

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

The 16 existing bridge tests cover individual mapping primitives (Kind::String → CatalogKind::String, Option<T> → Either(None, T), ASSERT lowering in isolation, etc.). What was missing: a single test that exercises every nexgen-rs-producer feature together through bridge_schema, which is the actual ingress point for downstream ingestors.

What this PR adds

One ast::Schema containing a WorkPackage table with all four kinds of fields the producer side now emits:

Field AST kind Producer source
subject option<string> + ASSERT $value != NONE D-AR-5.2 + D-AR-5.1 (typed scalar + validates_presence)
position option<int> (no assert) D-AR-5.2 (typed scalar)
project_id option<record<Project>> #33 (belongs_to FK direction gating)
assignable_id option<any> #30 (polymorphic FK fallback)

Plus a companion idx_WorkPackage_project_id and table comment with AR-shape annotations.

Why SQL-based assertions

The catalog FieldDefinition internals are pub(crate), so the bridge's catalog output is only observable via to_sql() rendering at the test scope. Assertions probe the rendered SurrealQL: typed kinds present, ASSERT clauses render for validated fields only (not for un-validated ones), record-link semantics carry the target table, polymorphic fallback renders as any, index name preserved.

This locks the bridge contract against drift — a single broken arm in From<ast::*> would fail this test loudly.

Test plan

  • cargo test --features op-bridge -p surrealdb-core --lib op_bridge::tests::d_ar_6_end_to_end passes
  • All 17 bridge tests pass (16 prior + 1 new)

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AdaWorldAPI, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 6 minutes and 30 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f519ff23-13cd-44dd-aa11-d18396525ffd

📥 Commits

Reviewing files that changed from the base of the PR and between 0e39e5b and b10fab0.

📒 Files selected for processing (1)
  • surrealdb/core/src/catalog/op_bridge.rs

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 and usage tips.

The 16 existing tests cover individual mapping primitives
(`Kind::String → CatalogKind::String`, `Option<T> → Either(None, T)`,
ASSERT lowering in isolation, etc.). What was missing: a single
test that exercises every nexgen-rs-producer feature together
through `bridge_schema`, which is the actual ingress point for
downstream ingestors.

Build one `ast::Schema` containing a `WorkPackage` table with all
four kinds of fields the producer side now emits:

- `subject` : `option<string>` + `ASSERT $value != NONE`
  (typed scalar with validates_presence — both Kind + assert
   flow through D-AR-6.2/6.3)
- `position` : `option<int>` (typed scalar, no assert)
- `project_id` : `option<record<Project>>`
  (belongs_to FK after the #33 direction-gating)
- `assignable_id` : `option<any>`
  (polymorphic FK after the #30 fallback)
- A companion `idx_WorkPackage_project_id` index
- A table comment with AR-shape annotations

Assertions probe the catalog SQL render (the internal field
accessors are `pub(crate)`) and check each feature is preserved:
typed kinds present, ASSERT clauses render for validated
fields only, record-link semantics carry the target table,
polymorphic fallback renders as `any`, index name preserved.

This locks the bridge contract against drift as the producer
side keeps evolving — a single broken arm in `From<ast::*>` would
fail this test loudly. 17 tests pass.
@AdaWorldAPI AdaWorldAPI force-pushed the claude/op-bridge-e2e-integration-test branch from 50224c5 to b10fab0 Compare June 17, 2026 11:57
@AdaWorldAPI AdaWorldAPI merged commit 68eaf63 into main Jun 17, 2026
1 check passed
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