Skip to content

feat(models)!: accept multiple source URLs per section - #76

Merged
SkyeAv merged 3 commits into
mainfrom
feat/section-multiple-urls
Aug 11, 2026
Merged

feat(models)!: accept multiple source URLs per section#76
SkyeAv merged 3 commits into
mainfrom
feat/section-multiple-urls

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Aug 11, 2026

Copy link
Copy Markdown
Owner

BaseSource.url changes from a scalar HttpUrl to list[HttpUrl] (min_length=1), so one section can back its rows with several provenance URLs — all flow into the edge source_record_urls list. The legacy scalar url: https://... is no longer accepted.

Model

  • url is a list: src/tablassert/models.pyBaseSource.url: list[HttpUrl] = Field(..., min_length=1, ...). One or more URLs per section; order is preserved.
  • Pipeline consumer: src/tablassert/lib.pyretrieval_sources now receives [str(u) for u in self.source.url]. The single-URL path already wrapped the value in a one-element list, so this iterates the field directly with no behavior change for the one-URL case.

Design

  • Clean break, no normalization: per request, url is strictly a list — a scalar is rejected, and an empty list is rejected via min_length=1. No alias or coercion shim, so the old form fails loudly rather than being silently accepted.
  • Provenance only, unchanged fetch: URLs are format-validated and recorded; Tablassert still does not download them. Multi-URL support is additive to source_record_urls (previously always a single-entry list).

Docs

  • Field reference + examples updated to the list form: docs/configuration/table.md (Excel/Text field rows and examples), docs/tutorial.md, docs/examples/tutorial-table.yaml, docs/examples.md, docs/configuration/advanced-example.md, examples/agent/QC_REPORT.md.
  • CHANGELOG.md — a Breaking Changes entry under Unreleased with the migration snippet.
  • Agent authoring prompts (src/tablassert/agent.py) and golden fixtures (tests/fixtures, tests/agent_fixtures) updated so derived configs stay schema-valid.

Testing

  • .venv/bin/python -m pytest -o addopts="--cov=tablassert --cov-report=term-missing" -q747 passed, 34 skipped (87% coverage).
  • New model tests in tests/test_models.py: test_source_url_accepts_multiple (order preserved), test_source_url_rejects_scalar, test_source_url_rejects_empty.
  • Every in-test config dict/kwarg and every shipped YAML fixture/example converted to the list form; test_docs_examples validates the shipped examples against the live schema.
  • ruff check --fix / ruff format clean; pre-commit (ruff + cargo-fmt) passed on commit.

Questions for the reviewer

  • source_record_urls semantics. A section maps a single local file (local) but can now list several urls, all landing in source_record_urls. If downstream Translator/RIG tooling expects a 1:1 source-record-url, say so and I'll split into one primary + extras instead of a flat list.

Summary by CodeRabbit

  • Breaking Changes

    • Source provenance URLs must now be provided as a non-empty list.
    • The previous single-URL format is no longer accepted.
    • Multiple provenance URLs are supported and validated.
  • Documentation

    • Updated configuration guides, tutorials, examples, and generated templates to show the new list format.
  • Tests

    • Updated configuration fixtures and added validation coverage for multiple, empty, and scalar URL values.

`BaseSource.url` changes from a scalar `HttpUrl` to `list[HttpUrl]`
(`min_length=1`), so one section can back its rows with several provenance
URLs. All entries flow into the edge `source_record_urls` list via
`retrieval_sources`; the pipeline already wrapped the single URL in a list,
so it now iterates `self.source.url` directly.

Docs (table/examples/tutorial/advanced), fixtures, agent prompts, and tests
are updated to the list form.

BREAKING CHANGE: the legacy scalar `url: https://...` is rejected; configs
must use a list (`url:\n  - https://...`).
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SkyeAv, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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

How do review limits work?

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

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, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 82dbd91c-6882-492a-aa60-00f5b55a78f0

📥 Commits

Reviewing files that changed from the base of the PR and between a140bff and d73ca1a.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • examples/agent/QC_REPORT.md
  • examples/agent/QC_REVIEW.md
  • src/tablassert/agent.py
  • src/tablassert/models.py
📝 Walkthrough

Walkthrough

source.url now uses a required, non-empty list of validated HttpUrl values. Provenance handling, runtime configurations, tests, fixtures, documentation, and examples now use the list format. Scalar URLs are rejected.

Changes

Source URL List Migration

Layer / File(s) Summary
Source URL contract and provenance handling
src/tablassert/models.py, src/tablassert/lib.py, tests/test_models.py
BaseSource.url now requires a non-empty list of HttpUrl values. Provenance forwarding passes each URL separately. Model tests cover multiple, scalar, and empty URL values.
Runtime configuration and integration updates
src/tablassert/agent.py, tests/agent_fixtures/*, tests/fixtures/*, tests/test_agent_*.py, tests/test_cover_agent_*.py, tests/test_cli_validation.py, tests/test_e2e_smoke.py, tests/test_lib.py, tests/test_progress.py
Generated configurations and test inputs now use list-valued source URLs.
Documentation and example migration
CHANGELOG.md, docs/configuration/*, docs/examples.md, docs/examples/tutorial-table.yaml, docs/tutorial.md, examples/agent/QC_REPORT.md
Configuration references and examples now show URL lists. The changelog records the breaking change and scalar-form rejection.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • SkyeAv/Tablassert#56: Established the broader configuration and model changes related to BaseSource.url.
  • SkyeAv/Tablassert#62: Introduced multi-section source configuration handling related to the url shape.
  • SkyeAv/Tablassert#66: Shares agent configuration usage, although it changes agent execution behavior rather than URL representation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the breaking change that sections now accept multiple source URLs.
Docstring Coverage ✅ Passed Docstring coverage is 97.62% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feat/section-multiple-urls
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/section-multiple-urls

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/agent/QC_REPORT.md`:
- Around line 33-34: Recompute the config sha256 hashes for every affected
report entry after the source.url scalar-to-list change, replacing the stale
parent-commit hash values while preserving the updated URL structure.

In `@src/tablassert/agent.py`:
- Around line 2009-2014: Update the prompt exemplars labeled (a) and (b) near
the shown source mappings to include a non-empty one-item source.url list in
each source mapping. Keep the existing source kind, local path, and other fields
unchanged so both examples remain schema-valid and demonstrate the required URL
field.
- Around line 2612-2614: Update the local payload contract represented by
table_list so every local path requires an original source URL, rather than
describing it as optional. Reject local payloads missing that URL before
constructing BaseSource, and ensure the agent never invents provenance.

In `@src/tablassert/models.py`:
- Around line 92-93: Update the field description near the provenance model to
state that source_record_urls is recorded on the primary entry within the edge
sources list and emitted in the RIG, rather than as a flat edge field. Keep the
existing format-validation and non-fetching semantics.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 795f0121-136a-40f1-b564-af39b5e6d632

📥 Commits

Reviewing files that changed from the base of the PR and between 23414d3 and a140bff.

📒 Files selected for processing (32)
  • CHANGELOG.md
  • docs/configuration/advanced-example.md
  • docs/configuration/table.md
  • docs/examples.md
  • docs/examples/tutorial-table.yaml
  • docs/tutorial.md
  • examples/agent/QC_REPORT.md
  • src/tablassert/agent.py
  • src/tablassert/lib.py
  • src/tablassert/models.py
  • tests/agent_fixtures/GENE_DISEASE/reference_config.yaml
  • tests/agent_fixtures/PMC11708054/ALAMV6.yaml
  • tests/agent_fixtures/PMC11708054/reference_config.yaml
  • tests/fixtures/minimal_section.yaml
  • tests/fixtures/minimal_section_with_sections.yaml
  • tests/test_agent_branches.py
  • tests/test_agent_build.py
  • tests/test_agent_coverage.py
  • tests/test_agent_derive.py
  • tests/test_agent_eval.py
  • tests/test_agent_multisection.py
  • tests/test_agent_propose.py
  • tests/test_agent_storage.py
  • tests/test_agent_supervisor.py
  • tests/test_cli_validation.py
  • tests/test_cover_agent_core.py
  • tests/test_cover_agent_eval.py
  • tests/test_cover_agent_propose.py
  • tests/test_e2e_smoke.py
  • tests/test_lib.py
  • tests/test_models.py
  • tests/test_progress.py

Comment thread examples/agent/QC_REPORT.md
Comment thread src/tablassert/agent.py
Comment thread src/tablassert/agent.py
Comment thread src/tablassert/models.py Outdated
SkyeAv added 2 commits August 10, 2026 20:24
- agent.py: add a one-item `source.url` list to the (a)/(b) few-shot
  exemplars so they are genuinely schema-valid, and reword the local-payload
  contract to state `source.url` is required (no fabrication) now that the
  field is a non-empty list.
- models.py: clarify the `url` description — `source_record_urls` is emitted
  on the primary entry inside the edge `sources` list, not as a flat edge field.
- QC_REPORT.md / QC_REVIEW.md: recompute the `config sha256` values over the
  committed (now list-form) configs and mirror them so the two artifacts stay
  consistent (CI guard compares them).
@SkyeAv
SkyeAv merged commit b137fb4 into main Aug 11, 2026
5 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.

1 participant