Repository navigation
promote: name the removal when a home series drops a lecture dp keeps - #34
Conversation
Follow-up to the switch from the dp-test sandbox to dp (step 1 of QuantEcon/project-monorepo#24), from that pull request's review. When the only canonical-eligible copy of a pool lecture went (its home series removed or renamed it) while dp still republished a copy, a refresh refused the entry as "held only by consumer series (dp)", not as the removal the drift-check reports as canonical-removed. CI now considers dp, so this is the message a nightly would have given. The recorded-entry refusal now comes first and says which consumers still hold a copy. Each refusal also names a canonical-eligible series this run excludes that holds the lecture, so --exclude never hides its home. Tests, for that and for what the switch relies on: - the refusal order, and an excluded holder named; - a consumer's accepted toc is watched, and promoting from the new toc then re-accepting clears the finding; - a refresh that considers the consumer keeps its superseded rows and pin (#19); - a comment-only sync/canonical.yml is an empty map. 127 tests pass. Against the previous tools/promote the two refusal tests fail and the other three pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
A reviewer-identified documentation nit remains in tools/tests/test_promote_collisions.py where the comment inaccurately attributes behavior to YAML rather than the repository’s load_yaml() normalization, so the wording should be corrected before approval.
1 open issue
What changed in this PR
This pull request updates tools/promote refusal messaging for cases where a pool lecture no longer has any canonical-eligible holder considered by the current run (e.g., its home series was removed/renamed upstream or the only canonical-eligible holder is excluded), while consumer series (such as dp) may still republish a copy. It also adds regression tests to pin the updated messaging and related consumer/toc + refresh behaviors.
Changes:
- Refine
resolve_sourcesrefusal text to better explain “no canonical-eligible copy” scenarios, including naming excluded canonical-eligible holders that still have a copy. - Add/extend tests covering: removed-home refusal messaging, excluded-holder naming, consumer accepted TOC watching, refresh behavior preserving consumer superseded rows, and comment-only canonical map behavior.
| File | Summary |
|---|---|
tools/promote |
Updates refusal message construction when no canonical-eligible copy is available; includes context about consumer holders and excluded canonical-eligible holders. |
tools/tests/test_promote_collisions.py |
Adds regression coverage for behavior when sync/canonical.yml contains only comments (no effective mappings). |
tools/tests/test_consumer.py |
Adds regression tests for the new refusal wording/order and for consumer TOC/drift-check + refresh behaviors. |
Review effort: Balanced
PyYAML reads a comments-only file as None; tools/promote's load_yaml() turns that into an empty map. The test's comment said YAML did both. Copilot's review of #34. Co-Authored-By: Claude Opus 5.5 <[email protected]>

A follow-up to #33 (step 1 of QuantEcon/project-monorepo#24), from that pull request's adversarial review.
The refusal
When the only canonical-eligible copy of a pool lecture goes (its home series removed or renamed it) while
dpstill republishes a copy,resolve_sourcesfinds no eligible copy. It then checked for a consumer before checking the ledger, so it refused the entry as "held only by consumer series (dp) — a consumer contributes no lecture to the pool". The removal is the news, and it is what the drift-check reports (canonical-removed). Since #33, CI's refresh considersdp, so this is the message a nightly would have given.The refusal for a recorded entry now comes first, and says which consumers still hold a copy:
Each refusal for a lecture with no eligible copy also names a canonical-eligible series this run excludes that holds it, so
--excludenever hides a lecture's home. That matters for the run the README now gives for a change todp's toc,tools/promote --toc dp --exclude jax: a lecture whose only home isjaxwas refused as held only bydp, and the refusal now ends "; jax, excluded from this run, holds a copy".Only the messages change. Every path through that branch still refuses the lecture, and nothing else is written differently.
Tests
test_a_pool_lecture_its_home_series_dropped_is_refused_as_removedcanonical-removedfor the same entry.test_a_refusal_names_a_holder_the_run_excludestest_drift_check_watches_a_consumers_accepted_toctools/promote --toc dp; promoting from the new toc and then re-accepting clears it.test_a_refresh_that_considers_the_consumer_keeps_its_superseded_rowssuperseded: dprows anddp's pin (#19).test_a_canonical_map_of_comments_only_is_an_empty_mapsync/canonical.ymlwith its header and no entries, as #33 left it, is an empty map that settles nothing.127 tests pass. Against
tools/promotebefore this change the first two fail and the other three pass: those three pin behaviour #33 relies on. On the real pool,tools/promote --toc dp --exclude jax --dry-runandtools/promote --refresh --exclude jax --dry-runplan as before, with no failures, and the drift-check stays clean.🤖 Generated with Claude Code