Skip to content

fix(provenance): correct shape dataset ownership - #4

Merged
Steel-tech merged 3 commits into
mainfrom
release/0.2.3
Jul 28, 2026
Merged

fix(provenance): correct shape dataset ownership#4
Steel-tech merged 3 commits into
mainfrom
release/0.2.3

Conversation

@Steel-tech

@Steel-tech Steel-tech commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • record StructuPath as creator and copyright holder of the bundled structural-shapes dataset
  • document StructuPath authorization to redistribute the dataset under MIT
  • keep the release gate fail-closed unless redistribution is authorized
  • prepare package version 0.2.3 with the reviewed pi.dev gallery metadata

Verification

  • python3 -m pytest tests/test_data_provenance.py tests/test_installed_scripts.py tests/test_package_contents.py — 6 passed
  • npm run lint
  • npm run release:check — 133 passed, 2 deselected; privacy, package, and provenance checks passed
  • npm pack --dry-run --json — version 0.2.3 and required gallery/provenance files present
  • primary LSP and Pi Lens diagnostics — zero findings

Release

After merge, publish @structupath/pi-steel@0.2.3, create the matching GitHub release, and verify the updated description and gallery image on pi.dev.

Summary by CodeRabbit

  • New Features
    • Structural-shape lookup now uses the StructuPath structural shapes database (477 documented shapes).
    • Release checks now accept authorized redistribution when the dataset is marked “Ready”.
  • Bug Fixes
    • Data provenance auditing now fails safely on missing/unreadable/malformed inputs and reports clearer validation issues; “Ready” now requires “Authorized”.
  • Documentation
    • Updated terminology and dataset attribution in README and skill materials, including licensing and release guidance.
  • Tests
    • Updated provenance and release-check test coverage to match the new “Ready/Authorized” behavior.
  • Chores
    • Bumped package/project versions to 0.2.3.

Record StructuPath as the creator and copyright holder of the bundled structural-shapes dataset, document its MIT redistribution authorization, and keep the release gate fail-closed unless permission is authorized.\n\nPrepare version 0.2.3 so the reviewed package description and gallery image can be published to npm and reflected on pi.dev.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: 798e63a4-057e-418a-bdf4-979422aacbca

📥 Commits

Reviewing files that changed from the base of the PR and between f17d873 and 36bcceb.

📒 Files selected for processing (1)
  • tests/test_data_provenance.py
📝 Walkthrough

Walkthrough

The release updates provenance metadata and validation from blocked AISC-derived data to an authorized, ready StructuPath structural shapes dataset. Documentation, package versions, diagnostics, takeoff references, and tests are aligned with the new release state.

Changes

Provenance release validation

Layer / File(s) Summary
Provenance contract and audit validation
DATA_PROVENANCE.json, scripts/check-data-provenance.py, tests/test_data_provenance.py
StructuPath metadata, authorized redistribution, ready release status, tolerant audit handling, updated documentation checks, and release-state tests are added.
Release documentation and package version
DATA_PROVENANCE.md, README.md, package.json, pyproject.toml, tests/test_installed_scripts.py
Release documentation and package metadata are updated for version 0.2.3 and the ready provenance state.
Runtime and takeoff wording alignment
scripts/doctor.py, skills/steel-takeoff/SKILL.md, skills/steel-takeoff/scripts/lookup-member.sh
Diagnostic imports and terminology are updated, and takeoff references now identify the StructuPath structural shapes database.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 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 accurately reflects the main provenance change: updating the shape dataset ownership to StructuPath.
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
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/0.2.3

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: 1

🤖 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 `@scripts/check-data-provenance.py`:
- Around line 25-32: Update the provenance validation around record and datasets
before the shipped_file lookup: require record to be a dict, datasets to be a
one-item list, and its sole item to be a dict, appending structured errors and
using an empty dataset when invalid. Validate that dataset.get("shipped_file")
is a non-empty string before constructing shapes_path, while preserving
fail-closed behavior without dereferencing malformed values.
🪄 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: bb342e70-a4e4-4b2a-b535-ceb7b81efd35

📥 Commits

Reviewing files that changed from the base of the PR and between 093370d and 74a81f4.

📒 Files selected for processing (11)
  • DATA_PROVENANCE.json
  • DATA_PROVENANCE.md
  • README.md
  • package.json
  • pyproject.toml
  • scripts/check-data-provenance.py
  • scripts/doctor.py
  • skills/steel-takeoff/SKILL.md
  • skills/steel-takeoff/scripts/lookup-member.sh
  • tests/test_data_provenance.py
  • tests/test_installed_scripts.py

Comment thread scripts/check-data-provenance.py Outdated
Validate the provenance document shape and shipped-file field before dereferencing either value. Malformed records now produce structured audit errors instead of exceptions, with regression coverage for invalid roots, datasets, and paths.

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

🧹 Nitpick comments (2)
tests/test_data_provenance.py (2)

57-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use direct module assignment instead of setattr.

Ruff B010 flags this constant-attribute setattr call; direct assignment is clearer and keeps the lint gate clean.

Proposed fix
-            setattr(module, "PROVENANCE_RECORD_PATH", record_path)
+            module.PROVENANCE_RECORD_PATH = record_path
🤖 Prompt for 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.

In `@tests/test_data_provenance.py` around lines 57 - 60, Replace the setattr call
in the test setup with direct assignment to module.PROVENANCE_RECORD_PATH,
preserving the existing temporary record_path value and test flow.

Source: Linters/SAST tools


51-55: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover unreadable shipped-file paths explicitly.

These cases cover invalid roots, dataset shapes, and a missing shipped_file, but not a non-empty path that cannot be read. Add a case such as {"shipped_file": "missing.json"} and assert the structured "declared shape data is missing or unreadable" error.

🤖 Prompt for 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.

In `@tests/test_data_provenance.py` around lines 51 - 55, Extend the validation
cases in the test covering DATA_PROVENANCE.json to include a dataset with a
non-empty but unreadable shipped_file path, such as “missing.json”. Assert that
validation returns the structured error “declared shape data is missing or
unreadable”, while preserving the existing invalid-root, dataset-shape, and
missing-path cases.
🤖 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.

Nitpick comments:
In `@tests/test_data_provenance.py`:
- Around line 57-60: Replace the setattr call in the test setup with direct
assignment to module.PROVENANCE_RECORD_PATH, preserving the existing temporary
record_path value and test flow.
- Around line 51-55: Extend the validation cases in the test covering
DATA_PROVENANCE.json to include a dataset with a non-empty but unreadable
shipped_file path, such as “missing.json”. Assert that validation returns the
structured error “declared shape data is missing or unreadable”, while
preserving the existing invalid-root, dataset-shape, and missing-path cases.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 303af56d-bbc4-4e47-949c-7b132dfdaab6

📥 Commits

Reviewing files that changed from the base of the PR and between 74a81f4 and f17d873.

📒 Files selected for processing (2)
  • scripts/check-data-provenance.py
  • tests/test_data_provenance.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/check-data-provenance.py

Verify that a non-empty shipped-file path which cannot be read returns the structured fail-closed audit error instead of raising or silently passing.
@Steel-tech
Steel-tech merged commit 6d55670 into main Jul 28, 2026
4 checks passed
@Steel-tech
Steel-tech deleted the release/0.2.3 branch July 28, 2026 23:18
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