Skip to content

P1 pilot: add lingcod_msy_recovery.csv with its manifest#12

Merged
mmcky merged 6 commits into
mainfrom
datasets/p1-lingcod
Jul 16, 2026
Merged

P1 pilot: add lingcod_msy_recovery.csv with its manifest#12
mmcky merged 6 commits into
mainfrom
datasets/p1-lingcod

Conversation

@mmcky

@mmcky mmcky commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Pilot P1 — local-path static (QuantEcon/meta#338). The first dataset to land in the published tree, and the first manifest written against the schema. Paired with QuantEcon/lecture-python-intro#792, which repoints the lecture.

History note: the Phase 2 restructure (#10) has merged, and this branch has been rebased onto main — so the diff is now just the pilot itself (the lingcod data + manifest, and the schema/AGENTS.md changes it drove). It previously appeared stacked on #10; because #10 was squash-merged, the branch was rebased to drop those commits rather than carry a conflicting copy of them.

Licence — cleared before adding

RAM Legacy is CC BY 4.0, attribution-only, so rehosting this extract is permitted. How that was established is itself a finding: ramlegacy.org states no licence at all. The authority is the Zenodo record behind its DOI (license: cc-by-4.0, access_right: open), confirmed two ways. "Check the homepage" is not a sufficient licence procedure — so the manifest records when and against what a licence was established. An undated licence claim is not evidence.

What meeting a real file did to the schema

The sketch in #10 was written from a clean example. One actual dataset broke it in three places, each folded back into manifest-schema.yml:

Finding Change
Lingcod is a byte-perfect copy of what the lecture consumes, yet its upstream provenance cannot be re-derived at all Migration and upstream are independent questions a single verified field would overstate or understate. Resolution (after review discussion): the manifest carries upstream only (status + optional one-line note, plus against so a verified check is auditable); migration safety is a one-time repoint-PR gate, reproducible later from the manifest's sha256
The file is constructed but ships no builder — the exact bug AGENTS.md names. The tempting fix is to relabel it verbatim, which buries the gap builder_status: unrecovered, so it stays visible in the generated catalog. One of the constructed-but-unscripted set PLAN Phase 9 tracks
F_over_Fmsy is null in the terminal assessment year — correct, and normal known_nulls, so Phase 5's invariant tests can enforce "no unexpected nulls" without a blanket rule rejecting this file

Integrity

Axis Status Basis
migration verified sha256 fc2f873f… byte-identical to intro's copy, so the repoint cannot change lecture output
upstream unverifiable the extract records no stock id, no database version, no transformation — nothing to re-derive from

Recording unverifiable with a reason is deliberate: PLAN Phase 7 says not to promote a file whose integrity status is unknown, and "we checked, and it cannot be checked" is a known status. Silence would not be.

Where each is recorded: upstream in the manifest (status: unverifiable with its note); migration here and in the paired repoint PR — it is a one-time gate, not a manifest field, and stays reproducible from the manifest's sha256.

Data

82 rows, 1928–2009, year / B_over_Bmsy / F_over_Fmsy. Verified readable over https and renders the lecture's figure unchanged.

Part of QuantEcon/meta#338
See QuantEcon/meta#336

Copilot AI 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.

Pull request overview

This PR adds the first “P1 pilot” dataset to the new published lectures/ tree—lingcod_msy_recovery.csv—together with its sidecar manifest, and updates manifest-schema.yml based on lessons from this first real manifest.

Changes:

  • Extend manifest-schema.yml to split integrity into migration vs upstream, add license.verified, add schema.known_nulls, and introduce builder_status.
  • Add lectures/lingcod_msy_recovery.csv and its manifest lectures/lingcod_msy_recovery.csv.yml.
  • Record the pilot dataset’s provenance, schema, consumers, integrity assessment, and known nulls in the new manifest.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
manifest-schema.yml Updates the manifest schema template to reflect pilot-driven requirements (integrity split, known nulls, builder status, license verification date).
lectures/lingcod_msy_recovery.csv.yml Adds a full per-dataset manifest (source/license/integrity/schema/consumers/builder fields).
lectures/lingcod_msy_recovery.csv Adds the lingcod MSY recovery time series data used by the consuming lecture.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lectures/lingcod_msy_recovery.csv.yml
Comment thread lectures/lingcod_msy_recovery.csv.yml
mmcky and others added 2 commits July 17, 2026 08:48
The first dataset to land in the published tree, and the first manifest
written against the schema sketch. Consumed by lecture-python-intro's
msy_fishery lecture, which currently reads it from a relative path — so the
downloaded notebook cannot resolve it. The repoint is the paired lecture PR.

Licence established before adding, per AGENTS.md: RAM Legacy is CC BY 4.0,
attribution-only, so rehosting this extract is permitted. Worth recording how
that was found — ramlegacy.org states no licence at all; the authority is the
Zenodo record behind its DOI (license id "cc-by-4.0", access_right "open").

Meeting a real file changed the schema in three ways, all folded back into
manifest-schema.yml:

- integrity splits into `migration` and `upstream`. Lingcod is a byte-perfect
  copy of what the lecture consumes, yet its upstream provenance cannot be
  re-derived at all. One "verified" field would have to overstate or
  understate it; two fields tell the truth.
- `builder_status` records `unrecovered`. This file is constructed but ships
  no builder — the bug AGENTS.md names. The tempting fix is to relabel it
  verbatim, which buries the gap; instead it is now visible in the catalog.
- `known_nulls` declares nulls that are correct. F/Fmsy is null in the
  terminal assessment year, which a blanket no-nulls validation rule would
  wrongly reject.

Part of QuantEcon/meta#338
See QuantEcon/meta#336

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The P1 lingcod manifest declares `retrieved: null` and `class: constructed`
with `builder: null` / `builder_status: unrecovered`. Copilot flagged both as
out of compliance with AGENTS.md — correctly, because the rules had no wording
for inherited files. Rather than patch the manifest to dodge the rules (which
would mean inventing a retrieval date or misclassifying a constructed file as
verbatim), bless both states explicitly so the gap stays visible in the
generated catalog and the rules and the manifest stop contradicting.

- AGENTS.md: add "Two inherited-file states" under the manifest rules —
  `retrieved: null` permitted for inherited-undated bytes (paired with an
  integrity.upstream reason; never reconstructed from git history), and
  `builder_status: unrecovered` for inherited constructed files (Phase 9),
  inherited-only so a new constructed file still must ship its builder.
- manifest-schema.yml: document the `retrieved` null policy and scope
  `unrecovered` to inherited files at the two field sites.

Provisional P1 decisions, to be folded into the convention.
See QuantEcon/meta#338 and QuantEcon/QuantEcon.manual#108.
@mmcky
mmcky force-pushed the datasets/p1-lingcod branch from 06b1dad to 8d9a167 Compare July 16, 2026 22:48
mmcky and others added 2 commits July 17, 2026 08:51
Two small doc corrections surfaced reviewing the pilot:

- AGENTS.md's manifest field list was written for the #10 schema sketch and
  never gained the fields P1 added: license.verified, the integrity
  migration/upstream split, schema.known_nulls, and builder_status. Bring it
  current and point to manifest-schema.yml as the authoritative field reference
  so the two stop drifting.
- manifest-schema.yml: note that row_count_floor is the exact row count for a
  frozen historical extract by design (P1 lingcod = 82), so it is not later
  "relaxed" as if it were a mistake; a loose floor is for files that grow.

See QuantEcon/meta#338

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ilable

Two tone corrections to the manifest convention, from review discussion — the
fields are unchanged, only the surrounding policy language:

- Reframe the repo's identity as a stability CACHE for lecture data (snapshots
  upstream sources so a build doesn't depend on a live API or third-party host),
  not a content-distribution host. The licence question follows: "is this source
  OK to cache and serve publicly, with attribution?", not "may we republish it as
  our own?". Attribution (the manifest `source` block) is the primary obligation;
  redistribution becomes a cheap binary gate (permitted | restricted) that is a
  fast yes for public data sources and blocks only genuinely restricted ones
  (e.g. FRED third-party series). Softens "promoted public host" / "blocker".
- State the capture-when-available principle explicitly: rich provenance is
  always welcome and worth recording when the source provides it, but a missing
  field is recorded as a reasoned gap, never a bar to landing a useful dataset.
  Effort scales with the source — a clean one gets a short manifest.

Does not touch the integrity method/upstream field structure — that simplification
is still under discussion.

See QuantEcon/meta#338 and QuantEcon/QuantEcon.manual#108

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mmcky and others added 2 commits July 17, 2026 09:44
Applies the simplification agreed in review discussion. The P1 finding stands —
migration and upstream are independent questions with different answers — but
only one of them belongs in the manifest:

- Drop the `migration` sub-block. Migration safety is a ONE-TIME check that
  matters at the repoint and never again, so it lives in the repoint PR as a
  Phase 8 gate rather than as a permanent manifest field. The manifest keeps
  `sha256`, which makes the check reproducible at any later date. Lingcod's
  verified migration (byte-compare against intro's copy, 2026-07-16) is
  preserved as a comment pointing at data-lectures#12 / lecture-python-intro#792.
- Replace free-text `method` with an optional one-line `note`, populated only
  when status is not a clean verified — the valuable prose was always the
  REASON (why lingcod is unverifiable), not a re-typed procedure.
- Move the generic how-to-verify-by-class recipe to AGENTS.md, stated once,
  instead of being repeated in every manifest.
- Add `against`: what a verified check compared to (URL, DOI, or repo path),
  so "verified" is auditable rather than a bare assertion.

Net effect: a clean verbatim file now carries a three-line integrity block with
zero prose; only genuinely messy provenance earns a note.

See QuantEcon/meta#338 and QuantEcon/QuantEcon.manual#108

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AGENTS.md's own rule: when a decision settles, update PLAN.md in the same PR
that acts on it. This PR revised the manifest schema in ways four PLAN
passages still described in their pre-pilot form:

- "Where we're going": the manifest field list predated the pilot — point to
  manifest-schema.yml as authoritative and name the fields P1 added
  (integrity, builder_status, known_nulls, license.verified).
- Phase 5: link both the invariant-tests bullet and the business_cycle.py
  retrofit to #14, which carries the builder template and the schema decisions
  the tests will force (column patterns, known_nulls semantics, dtype
  vocabulary).
- Phase 6: the licence check is per SOURCE, not per file — a cheap binary
  cache-and-serve-with-attribution gate, per the cache-not-host reframe. RAM
  Legacy (P1) joins World Bank as the second source already established.
- Phase 7: the byte-compare is recorded in the repoint PR as a one-time gate
  (not a manifest field); verification results land in integrity.upstream as
  sha256/status/against/date, replacing the retired "method" field; and
  unverifiable-with-note is the honest known status.
- Open-decisions table: licensing strawman restated in cache-not-host terms.

See QuantEcon/meta#338 and QuantEcon/QuantEcon.manual#108

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmcky
mmcky merged commit f01fd93 into main Jul 16, 2026
@mmcky
mmcky deleted the datasets/p1-lingcod branch July 16, 2026 23:57
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.

2 participants