Record the four schema and naming decisions: rename, pattern capture groups, null placement, dtype sweep - #124
Merged
Merged
Conversation
…groups, null placement, dtype sweep The decisions ratified 2026-09-07 on #120, #121, #122 and #113, written into the manifests and manifest-schema.yml so the shared validate() (#119) has a spec to read. - #113 naming: business_cycle_data.csv -> gdp_growth_annual.csv while its consumers list is still empty (the only free moment); the six rules sit beside `filename` in manifest-schema.yml and in AGENTS.md. Every reference to the old name follows (builder table and docstring, builders/README.md, migration.yml key, PLAN.md, audit prose, CATALOG.md regenerated). - #120 pattern: `YR\d{4}` -> `YR(\d{4})` in the three World Bank manifests; the capture group is what the validator derives date_range from. The semantics (fullmatch, ordered, contiguous, >=1 match, exhaustive) are the comment on `pattern`. - #121 nulls: integers stay exact; the four dynamic snapshots gain a `nulls:` placement block (along / leading / recent / ended / inner) mirroring what the two builders already assert; `known_nulls_total` leaves the three named- column manifests and stays legal only inside header-less sheet reads. - #122 dtype: 21 `string` + 9 `object` -> `str`, 2 `datetime` -> `datetime64`, forbes `government` -> `bool`; the closed vocabulary and the family-compare rule are the comment on `dtype`. Bytes unchanged: the renamed CSV hashes to the sha256 its manifest records. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
A few documentation inconsistencies remain (including a future-dated policy label, a contradictory dtype description, and a stale reference to the old sidecar path) that should be corrected before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates repository-wide documentation and manifest schema conventions to reflect ratified decisions around dataset naming and the executable schema contract, including a dataset rename from business_cycle_data.csv to gdp_growth_annual.csv and related reference updates.
Changes:
- Renames the dynamic snapshot dataset to
gdp_growth_annual.csv(CSV + sidecar manifest) and updates internal references (builder, migration tracker, audit text, catalog). - Records schema-contract decisions in
manifest-schema.yml(pattern capture groups, null placement rules, dtype vocabulary/family comparisons) and propagates them across manifests. - Normalizes manifest dtype declarations (e.g.,
object/string/datetime→str/datetime64) and adds explicitnulls:placement blocks to dynamic snapshots.
File summaries
| File | Description |
|---|---|
| scripts/render_audit.py | Updates audit rules text to reference gdp_growth_annual.csv. |
| scripts/audit_annotations.yml | Updates annotation note to reflect renamed snapshot filename. |
| PLAN.md | Updates plan narrative to note the rename and related policy references. |
| migration.yml | Rekeys the dataset entry to gdp_growth_annual.csv and documents the rename rationale. |
| manifest-schema.yml | Records naming + schema execution decisions (patterns, null placement, dtype vocabulary). |
| lectures/gdp_growth_annual.csv | Adds the renamed GDP growth dataset under the new filename. |
| lectures/gdp_growth_annual.csv.yml | Renames/updates the GDP growth sidecar manifest (pattern capture group + null placement). |
| lectures/unemployment_rate_annual.csv.yml | Updates pattern to capture-group form and adds nulls: placement rule. |
| lectures/private_credit_to_gdp.csv.yml | Updates pattern to capture-group form and adds nulls: placement rule. |
| lectures/us_business_cycle_monthly.csv.yml | Updates dtype to datetime64, refines null handling into exact-count + placement rule form. |
| lectures/fred_data.csv.yml | Normalizes DATE dtype to datetime64. |
| lectures/forbes-billionaires.csv.yml | Changes government dtype to bool and updates description. |
| lectures/us_adult_heights.csv.yml | Normalizes dtype from object to str. |
| lectures/test_pwt.csv.yml | Normalizes dtype from object to str. |
| lectures/realwage.csv.yml | Normalizes dtype from string to str. |
| lectures/japan_earthquakes.csv.yml | Normalizes dtype from object to str. |
| lectures/epl_match_goals.csv.yml | Normalizes dtype from object to str. |
| lectures/employ.csv.yml | Normalizes dtype from string to str. |
| lectures/countries.csv.yml | Normalizes dtype from string to str. |
| lectures/ames_house_prices.csv.yml | Normalizes dtype from object to str. |
| builders/README.md | Updates builder coverage table to reflect the renamed GDP growth file. |
| builders/business_cycle.py | Updates TABLES entry and docs to output gdp_growth_annual.csv. |
| AGENTS.md | Records naming and schema-contract decisions at the repo guidance level. |
| CATALOG.md | Regenerates catalog to reflect renamed dataset entry. |
Review details
- Files reviewed: 23/24 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…le sidecar path in provenance/README.md Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 6, 2026
Closed
Manifest-driven validate(): the schema block is the spec, shared by the builders and a PR check
#126
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writes the four decisions ratified on 2026-09-07 into the tree, so the shared manifest-driven
validate()(#119) has a spec to read rather than a strawman. No data bytes change: the one renamed CSV hashes to the sha256 its manifest records, andcheck_consumed_files.pypasses locally (44 manifests, 47 files hash-checked, 0 errors).What changes
business_cycle_data.csv→gdp_growth_annual.csv(file + sidecar), renamed whileconsumers: []. The six rules are the comment besidefilenameinmanifest-schema.ymland a paragraph inAGENTS.md. Every reference follows:builders/business_cycle.py(TABLES entry and docstring),builders/README.md, themigration.ymlkey,PLAN.md,scripts/render_audit.py,scripts/audit_annotations.yml, andCATALOG.mdregenerated. The two sibling manifests drop their "FILENAME IS PROVISIONAL" headers.patternsemanticsYR\d{4}→YR(\d{4})in the three World Bank manifests; the capture group is what the validator derivesdate_rangefrom. Full-match, ordered, contiguous, at least one match, exhaustive — recorded as the comment onpattern.known_nullsstay exact. The four dynamic snapshots gain anulls:placement block (along,leading,recent,ended,inner) that mirrors whatbusiness_cycle.pyandbusiness_cycle_fred.pyalready assert by hand.known_nulls_totalleaves the two named-column manifests that used it as a ceiling; it stays legal only insideheader: nullsheet reads (assignat.xlsx,dette.xlsx), where there are no column names to count against — a correction to the #121 comment, recorded there.string+ 9object→str, 2datetime→datetime64, forbesgovernmentstr→bool(it is a boolean column with 2606 nulls). The closed list and the compare-by-family rule are the comment ondtype.Two things for the #119 implementer
YAML reads the period scalars in
nulls.innerback asdatetime.date, the same trapsnapshots.py stampalready guards against fordate_range.end— compare as text. And the validator reads the raw file with pandas defaults (honouringdelimiterandread_as, noindex_col,parse_datesderived fromdatetime64declarations); the manifest describes the bytes on disk, not the frame a lecture builds. Both are now stated at the top of theschemablock inmanifest-schema.yml.Verification
manifest-schema.ymlandmigration.ymlparse; every dynamic snapshot carries anullsblock; every manifest'sfilenamematches its sidecar name.scripts/snapshots.py listreports the four snapshots under their current names.python scripts/build_catalog.pyregeneratedCATALOG.md(one row changed).pattern,nullsordtypeyet — the builders keep their own constants until Manifest-driven validate(): read the sidecar schema block as the spec, shared by builders and a PR-validation workflow #119 lands — so no runtime behaviour changes in this PR.Unblocks block B of #118 (the lecture-wasm adoption, QuantEcon/lecture-wasm#70), since the filenames are now frozen.
Closes #120. Closes #121. Closes #122. Closes #113.
🤖 Generated with Claude Code