Skip to content

Add blueprint release summary#384

Merged
txmed82 merged 2 commits into
masterfrom
codex/blueprint-release-summary
Jun 4, 2026
Merged

Add blueprint release summary#384
txmed82 merged 2 commits into
masterfrom
codex/blueprint-release-summary

Conversation

@txmed82

@txmed82 txmed82 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • add blueprint dataset release summary builder and JSON writer
  • aggregate validation tiers, judge coverage, repair attempts, organ systems/settings, and materialization coverage
  • surface non-ready blueprints and missing validation reports for release audit workflows

Tests

  • .venv/bin/python -m pytest tests/test_blueprint_release_summary.py -q
  • .venv/bin/python -m ruff check src/casecrawler/export/blueprint_release.py tests/test_blueprint_release_summary.py
  • .venv/bin/python -m pytest tests/test_blueprint_release_summary.py tests/test_blueprint_materializer.py tests/test_blueprint_storage.py tests/test_blueprint_export.py -q
  • .venv/bin/python -m pytest -q -m 'not optional_backend and not network and not slow'

Summary by CodeRabbit

  • New Features

    • Added blueprint release summary generation and persisted JSON export to produce aggregated dataset statistics (counts, readiness tiers, materialization and per-system breakdowns).
    • Listing operations can now return unbounded results when requested.
  • Tests

    • Added tests covering summary aggregation, JSON output fidelity, and unbounded listing behavior.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a4e8db49-0460-47f3-a80a-dd7fb52d27d7

📥 Commits

Reviewing files that changed from the base of the PR and between fbacd16 and 18088b4.

📒 Files selected for processing (4)
  • src/casecrawler/export/blueprint_release.py
  • src/casecrawler/storage/dataset_store.py
  • tests/test_blueprint_release_summary.py
  • tests/test_blueprint_storage.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/test_blueprint_release_summary.py
  • src/casecrawler/export/blueprint_release.py

📝 Walkthrough

Walkthrough

Adds a blueprint release summary exporter that aggregates dataset metrics from DatasetStore (readiness tiers, validation/judge/attempt counts, materialization IDs, organ/setting breakdowns), produces a non-ready issues list, writes the summary as sorted pretty JSON, and includes tests; DatasetStore listing APIs now support limit=None for unbounded results.

Changes

Blueprint Release Summary Export

Layer / File(s) Summary
Summary aggregation and non-ready computation
src/casecrawler/export/blueprint_release.py
build_blueprint_release_summary() fetches blueprints, records, judge reports, generation attempts, and validation reports from DatasetStore; computes readiness tier counts (including "missing"), judge pass counts, generation attempt status/role counts, materialized blueprint IDs (via record metadata["blueprint_id"]), per-organ-system and per-setting counts, and assembles non_ready_blueprints with either a standardized "missing" payload or fields copied from persisted validation reports.
Summary persistence
src/casecrawler/export/blueprint_release.py
write_blueprint_release_summary() calls the builder, ensures parent directories exist, writes the summary as indented, sorted JSON, and returns the summary dict.
DatasetStore unbounded listing
src/casecrawler/storage/dataset_store.py
list_blueprints(), list_generation_attempts(), and list_judge_reports() now accept `limit: int
Tests and fixtures
tests/test_blueprint_release_summary.py, tests/test_blueprint_storage.py
Factory helpers create ClinicalBlueprint, JudgeReport, and BlueprintValidationReport objects with configurable ReleaseReadinessTier. Tests validate aggregation of readiness/materialization/judge/attempt stats, JSON output equality from write_blueprint_release_summary(), and that DatasetStore list methods return all items when called with limit=None.

Possibly Related PRs

  • txmed82/case-crawler#383: Populates blueprint materialization metadata (metadata["blueprint_id"]) that this PR aggregates to count materialized records.
  • txmed82/case-crawler#372: Related changes to DatasetStore listing APIs; #372 introduced the listing methods this PR extends to support limit=None.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I tally blueprints in a quiet heap,
Counting tiers both wide and deep,
Missing flags and judges' nods,
I write the sums to tidy mods,
A JSON hop — release looks sweet!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add blueprint release summary' directly and clearly matches the main changeset: a new module that generates and persists blueprint release summaries, plus supporting tests and API updates.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/blueprint-release-summary

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 2

🤖 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 `@src/casecrawler/export/blueprint_release.py`:
- Around line 19-22: The calls to store.list_blueprints,
store.list_judge_reports, and store.list_generation_attempts currently pass a
hard cap limit=100_000 which silently truncates large datasets; update these
usages to read unbounded (e.g., remove the numeric limit and use limit=None) or
implement the same pagination/exhaustion loop used by store.list_records so that
blueprints, judge_reports, and attempts are fully iterated (refer to the
functions list_blueprints, list_judge_reports, list_generation_attempts and
mirror the records handling).
- Around line 90-99: The JSON shape changes because _tier_counts builds the
Counter dynamically; ensure the "missing" bucket is always present by seeding
counts["missing"] = 0 before iterating validation_reports. In function
_tier_counts, initialize the Counter with a zeroed "missing" key (and keep the
existing loop that increments counts["missing"] when report is None), and leave
the subsequent loop over ReleaseReadinessTier that sets default tier keys
unchanged.
🪄 Autofix (Beta)

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: d065fb86-67e2-4786-9365-be5b577dbb1f

📥 Commits

Reviewing files that changed from the base of the PR and between 71cee3b and fbacd16.

📒 Files selected for processing (2)
  • src/casecrawler/export/blueprint_release.py
  • tests/test_blueprint_release_summary.py

Comment thread src/casecrawler/export/blueprint_release.py Outdated
Comment thread src/casecrawler/export/blueprint_release.py
@txmed82 txmed82 merged commit d32acd1 into master Jun 4, 2026
4 checks passed
@txmed82 txmed82 deleted the codex/blueprint-release-summary branch June 4, 2026 02:21
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