Skip to content

ci(test): add lance-graph-contract unit tests to the test gate#328

Merged
AdaWorldAPI merged 1 commit into
mainfrom
cursor/ci-test-contract-fe75
May 1, 2026
Merged

ci(test): add lance-graph-contract unit tests to the test gate#328
AdaWorldAPI merged 1 commit into
mainfrom
cursor/ci-test-contract-fe75

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Closes the gap that let PR #322's log_norm_growth_negative_when_m_attenuates ship green and sit red on main for almost a day.

The Style Check / clippy job already type-checks crates/lance-graph-contract --lib --tests, but clippy does not execute tests — it just compiles them. So a logically-broken assertion compiles green, ships, and is caught only after merge.

PR #322 hit exactly this trap. Its log_norm_growth_negative_when_m_attenuates asserted that an attenuating M with seed = I produces NEGATIVE log-norm growth, but ‖log(propagated)‖²_F is structurally non-negative for any non-identity propagated, so the assertion was unsatisfiable from the start. Clippy passed, the PR shipped, and the regression sat red on every subsequent PR until PR #326 fixes the test body.

Fix

Add one step to the existing test job in rust-test.yml:

- name: Run contract unit tests
  run: cargo test --manifest-path crates/lance-graph-contract/Cargo.toml --lib

It rides on the existing job's setup — same toolchain, same Swatinem cache, same protobuf-compiler install — so the marginal cost is just the build (~1 s, zero-dep crate per CLAUDE.md) plus test execution (sub-second, 350 logic-only tests).

Cost / blast radius

  • 11 lines of YAML.
  • One additional ~2 s step in the existing test (stable) job. No new job, no new runner, no new cache.
  • Catches contract-crate test regressions before merge instead of after.

Sequencing

This PR depends on PR #326 landing first. If it lands before #326, the new step turns CI red on main, because PR #322's broken test is still on main today (349 passed; 1 failed). Recommended merge order:

  1. Merge PR fix(sigma-propagation): use non-identity seed in log_norm_growth_negative test #326 (test-body fix) → main becomes 350/350 green.
  2. Merge this PR → CI gate locks the green state in place.

If preferred, this can also be rebased on top of #326 directly, but keeping them separate makes the intent clear: #326 = correctness fix, #327 (the rustfmt drift) = style fix, this = process fix.

What this PR does NOT do

  • Does NOT add a coverage gate — test-with-coverage already runs against lance-graph only; widening coverage to the contract crate is a follow-up.
  • Does NOT add doc-test coverage for the contract crate — the contract crate has few doc-tests today; if we want them gated, that's a separate one-line addition.
  • Does NOT touch any other crate's CI surface. cognitive-shader-driver, lance-graph-callcenter, lance-graph-planner are still un-test-gated by CI; bringing them in is a separate scoping decision (some have heavier dep trees that would cost real CI time).

Companion PRs

Open in Web Open in Cursor 

The Style Check / clippy job already type-checks
crates/lance-graph-contract --lib --tests, but clippy does NOT
execute tests — it just compiles them. So a logically-broken
assertion compiles green, ships, and is caught only after merge.

PR #322 hit exactly this trap. Its
log_norm_growth_negative_when_m_attenuates test asserted that an
attenuating M with seed = I produces NEGATIVE log-norm growth, but
‖log(propagated)‖²_F is structurally non-negative for any
non-identity propagated, so the assertion was unsatisfiable from
the start. Clippy passed, the PR shipped, and the regression sat
red on every subsequent PR until PR #326 fixes the test body.

Cost of closing this hole is minimal:

- crates/lance-graph-contract is the zero-dep trait crate (per
  CLAUDE.md and the Cargo.toml), so the test build is fast.
- Same toolchain, same Swatinem cache, same protobuf-compiler as
  the existing lance-graph build — no extra setup.
- Test execution is sub-second (350 tests, all logic / no I/O).

Sequencing: this PR depends on PR #326 (the test-body fix)
landing first. If this lands before #326, the new step turns CI
red on main. Mergers should land #326, then this.

Co-authored-by: AdaWorldAPI <AdaWorldAPI@users.noreply.github.com>
@cursor cursor Bot marked this pull request as ready for review May 1, 2026 12:53
@AdaWorldAPI AdaWorldAPI merged commit 79e98f6 into main May 1, 2026
1 of 2 checks 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