Skip to content

feat: assert every node has an id and every edge has subject, predicate, and object in final graph QC - #107

Merged
SkyeAv merged 1 commit into
mainfrom
qc-required-slots
Aug 21, 2026
Merged

feat: assert every node has an id and every edge has subject, predicate, and object in final graph QC#107
SkyeAv merged 1 commit into
mainfrom
qc-required-slots

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Aug 21, 2026

Copy link
Copy Markdown
Owner

The --qc stage-7 study pass now asserts the core KGX join slots outright: every node must carry a non-empty id, and every edge must carry non-empty subject, predicate, and object — completing the required-slot ladder begun by #106's unnamed-nodes.

Study assertions (src/tablassert/study.py)

  • unidentified-nodes: a node record whose id key is missing, null, or strips to empty fails the study. Since the id is exactly what's absent, examples key on the node's name (or <no name>), making the offender identifiable from the stderr summary.
  • incomplete-edges: an edge record missing any of the three core slots — missing key, null, or strips-to-empty — fails, counted per slot (e.g. predicate (2)), matching the whitespace-values example format.
  • Node name already asserted by feat: assert no unnamed nodes and no null or empty values in final graph QC #106's unnamed-nodes; that check is untouched. A record with neither id nor name deliberately fires both assertions (pinned by test).

Design

  • Conventions mirror the name assertion. Non-string, non-null values pass (no writer emits them); the assertions target absent slots, not JSON types. strip_nulls (rust/src/json.rs) deletes a null slot outright rather than emitting it, so on pipeline output a hit means the slot was null upstream and the record shipped broken — exactly the condition these assertions exist to catch loudly.
  • Full e2e suite green — no legitimate build path emits slotless records, so the assertions tighten the contract without breaking real builds.

Docs

  • docs/cli.md (--qc row), the build_kg docstring in src/tablassert/cli.py (rendered by --help), and CHANGELOG.md (Unreleased).

Testing

  • uv run --no-sync pytest -q --no-cov1056 passed, 15 skipped
  • uv run --no-sync pytest tests/test_study.py --no-cov -q28 passed
  • uv run --no-sync ruff check + ruff format --check → clean; uv run --no-sync pyright on changed files → 0 errors
  • One CODE_REVIEWER pass: verdict approve, all three findings (non-string-slot test gap, variable shadowing, fixture cross-fire) addressed

@coderabbitai

coderabbitai Bot commented Aug 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fcec136e-753e-4076-b724-c43c8ec6ea9a


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.

@SkyeAv
SkyeAv merged commit 104927d into main Aug 21, 2026
5 checks passed
@SkyeAv
SkyeAv deleted the qc-required-slots branch August 21, 2026 17:48
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.

1 participant