Skip to content

feat: add tablassert draft command for graph config generation - #290

Open
ArdaTkn wants to merge 1 commit into
SkyeAv:mainfrom
ArdaTkn:feat/draft-graph-config
Open

ArdaTkn wants to merge 1 commit into
SkyeAv:mainfrom
ArdaTkn:feat/draft-graph-config

Conversation

@ArdaTkn

@ArdaTkn ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Closes #270.

Summary

  • Add tablassert draft TABLES... [-o OUTPUT] [--force] in src/tablassert/cli.py:
    • Derives name from the first table stem, sets version: 0.1.0 and fullmap: .fullmap, and populates honest DRAFT RIG placeholders (infores:tablassert-draft).
    • Validates the generated dictionary through Graph.model_validate before writing, so tablassert validate --schema graph passes immediately.
    • Uses ingests.to_yaml for formatting and prepends a # DRAFT header comment; refuses to overwrite an existing file unless --force is passed.
  • Document tablassert draft in docs/cli.md and llms.txt, and register it in tests/test_docs_cli_coverage.py and vulture_whitelist.py.
  • Add unit/CLI tests in tests/test_draft.py and an Unreleased changelog entry in CHANGELOG.md.

Local gate

  • scripts/check_changelog.py --base upstream/main: PASS
  • ruff check . / ruff format --check .: clean
  • pyright: 0 errors
  • vulture / deptry .: clean
  • mkdocs build --strict: clean
  • pytest tests/test_draft.py tests/test_docs_cli_coverage.py tests/test_docs_source_of_truth.py tests/test_docs_style.py tests/test_docs_examples.py: all passed

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

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

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c66dc4a0-9d28-4f70-b3fe-8959e66bf3c2
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@ArdaTkn
ArdaTkn force-pushed the feat/draft-graph-config branch from c3f0417 to fb2a30f Compare November 19, 2026 22:48

@SkyeAv SkyeAv left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks, @ArdaTkn! The command looks useful, and the targeted tests pass (9 passed). A few small follow-ups:

  • Prevent --force from overwriting an input table when output.resolve() matches one of tables; add a regression test. Directory outputs should also fail cleanly.
  • Add draft to the CLI command list in docs/index.md:36.
  • If #288 lands first, add assert graph.rig is not None before tests/test_draft.py:54 so pyright still passes.

No other blocking findings. Thanks!

@ArdaTkn

ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all review items in 5d4cd3f:

  1. Input-table & directory protection: tablassert draft now rejects output.is_dir() and refuses output.resolve() matching any input table even when --force is set, with test_draft_refuses_to_overwrite_input_table_or_directory covering both cases.
  2. docs/index.md: Added draft to the CLI command list.
  3. Optional-RIG forward compatibility: Added assert graph.rig is not None before graph.rig.source_info in tests/test_draft.py.

Local gates re-run and passing: check_changelog.py, ruff check, ruff format --check, pyright, vulture, deptry, mkdocs build --strict, and pytest (230 passed).

@ArdaTkn
ArdaTkn force-pushed the feat/draft-graph-config branch from fb2a30f to 5d4cd3f Compare November 19, 2026 23:29

This branch has not been deployed

No deployments
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.

Generate a draft graph config from a table config alone

2 participants