Skip to content

contract: D-CMR-6 guarded rule catalogue (set_rules) + #1650 closeout - #1651

Merged
AdaWorldAPI merged 4 commits into
mainfrom
claude/eager-albattani-iufugq
Oct 21, 2026
Merged

AdaWorldAPI merged 4 commits into
mainfrom
claude/eager-albattani-iufugq

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Two commits, one per concern. Review them separately.

1. dca11fd: #1650 closeout (board files only)

2. 2e71382: D-CMR-6, the guarded rule catalogue and fixpoint driver

New zero-dependency module lance_graph_contract::set_rules.

  • Measures and semantics. A measure is Count, Sum, CountRows, Add, Sub, Const or Opaque. The semantics are explicit: the row count (universe), the arithmetic (exact, wrapping, checked, IEEE), two- or three-valued sets, plain or _sym sums, and distinct rows or a bag.

  • Rules. There are six, stored as data in CATALOGUE:

    • set normalization;
    • Count(¬A) → N − Count(A);
    • Sum(A) − Sum(A∧B) → Sum(A∧¬B), and the same for Count;
    • (a+b) − a → b;
    • range intersection;
    • range count.
  • Guards. Each rule refuses when its conditions fail:

    • NULL (three-valued sets);
    • no fixed row count;
    • checked or IEEE arithmetic;
    • _sym sums;
    • an impure operand;
    • ranges on different row orders;
    • a range bound past the row count;
    • a bag.

    A refused rewrite keeps the original expression and is recorded in the trace.

  • Driver. It applies only rewrites that strictly shrink the expression, and stops when no rule fires or the step budget runs out.

  • Tests (17).

    • A random test runs 600 random measures over random tables against exact i128 and wrapping i64 reference evaluators, with random subsets of the rules enabled. It also checks that most inputs are actually rewritten.
    • Experiment A: under checked arithmetic the difference rule refuses. An eager i32 accumulator is the counterexample: the original overflows, while the rewritten sum gives 5.
    • Experiment D: intersecting three ranges enables the range count.
    • Experiment E: every invalid case above refuses. Each NULL case is also shown giving a wrong answer if the rewrite is forced.
  • Disable runs. I removed each guard in turn, and each removal fails exactly its named test.

  • Gates. All 1,539 contract tests pass. The 26 relalg tests pass unchanged. clippy -D warnings and fmt are clean.

  • Untouched: set_algebra.rs, set_program.rs (U2), crepe (U3), relalg and mask-risc.

Board, updated in the same commit: STATUS sets D-CMR-6 to In PR; new entry entries/2026-10-21-d-cmr-6-rule-catalogue.md; the LATEST_STATE inventory delta; the plan's gap ledger.

Coordination: claimed on EXO-50 as session_013z2e1YXkm6o6HNrDn5BPWA/016; ownership confirmed in gpt-ada-01/004 and /007.

🤖 Generated with Claude Code

https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA

Hygiene only (termination clause: generates no further arc entry).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac8db9c5-771d-4039-ba36-67f6652ef6e9
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

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.

New zero-dependency module lance_graph_contract::set_rules: measures over
one population (Count, Sum, CountRows, Add, Sub, Const, Opaque), explicit
semantics (universe, exact/wrapping/checked/IEEE, two/three-valued, plain
or _sym sums, distinct or bag), and six rules as data: set normalization,
complement, relational difference, additive cancellation, range
intersection, range count. The driver applies only strictly shrinking
rewrites, to a fixpoint or a step budget; refused matches keep the
original and are traced.

Tests (17): differential against i128 / wrapping-i64 oracles over random
tables and random rule subsets; experiments A, D, E; each guard removal
turns its named test red. set_algebra.rs, set_program.rs, crepe, relalg
and mask-risc unchanged; relalg suite passes unchanged.

Board: STATUS D-CMR-6 In PR, plan gap ledger, LATEST_STATE inventory
delta, entry 2026-10-21-d-cmr-6-rule-catalogue.md, entries index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
@AdaWorldAPI AdaWorldAPI changed the title board: #1650 closeout (D-CMR-2 Shipped) contract: D-CMR-6 guarded rule catalogue (set_rules) + #1650 closeout Oct 21, 2026
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 21, 2026 07:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T07:28:36.197241Z 2e71382 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Add Carrot credits or activate Agent usage billing to use Autofix

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e71382a67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/lance-graph-contract/src/set_rules.rs
Comment thread crates/lance-graph-contract/src/set_rules.rs
Comment thread crates/lance-graph-contract/src/set_rules.rs
Comment thread crates/lance-graph-contract/src/set_rules.rs
…of _sym sums, IEEE range count

Codex review of #1651 (four findings). Each new guard has a test; the
bag and checked cases carry an oracle counterexample.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
@AdaWorldAPI
AdaWorldAPI merged commit 6bf4f86 into main Oct 21, 2026
19 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
AdaWorldAPI pushed a commit that referenced this pull request Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013z2e1YXkm6o6HNrDn5BPWA
AdaWorldAPI added a commit that referenced this pull request Oct 21, 2026
D-RA-2: relalg symbolic answers from contract::set_rules + #1651 closeout
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