Skip to content

promote: name the removal when a home series drops a lecture dp keeps - #34

Merged
mmcky merged 2 commits into
mainfrom
promote/consumer-refusals
Nov 3, 2026
Merged

mmcky merged 2 commits into
mainfrom
promote/consumer-refusals

Conversation

@mmcky

@mmcky mmcky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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 dp still republishes a copy, resolve_sources finds 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 considers dp, 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:

lqcontrol.md is in the pool, but no canonical-eligible series this run considers holds it any more (removed or renamed upstream?); only consumer series (dp) still do — decide whether the lecture was retired, renamed or moved; the drift-check reports it as canonical-removed

Each refusal for a lecture with no eligible copy also names a canonical-eligible series this run excludes that holds it, so --exclude never hides a lecture's home. That matters for the run the README now gives for a change to dp's toc, tools/promote --toc dp --exclude jax: a lecture whose only home is jax was refused as held only by dp, 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 What it pins
test_a_pool_lecture_its_home_series_dropped_is_refused_as_removed The refusal order above, with the drift-check reporting canonical-removed for the same entry.
test_a_refusal_names_a_holder_the_run_excludes An excluded holder is named.
test_drift_check_watches_a_consumers_accepted_toc A consumer's accepted toc is watched although its copies are not; the issue names tools/promote --toc dp; promoting from the new toc and then re-accepting clears it.
test_a_refresh_that_considers_the_consumer_keeps_its_superseded_rows CI's refresh, which never excludes a consumer, keeps the superseded: dp rows and dp's pin (#19).
test_a_canonical_map_of_comments_only_is_an_empty_map sync/canonical.yml with its header and no entries, as #33 left it, is an empty map that settles nothing.

127 tests pass. Against tools/promote before 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-run and tools/promote --refresh --exclude jax --dry-run plan as before, with no failures, and the drift-check stays clean.

🤖 Generated with Claude Code

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]>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 09:39

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.

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_sources refusal 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

Comment thread tools/tests/test_promote_collisions.py Resolved
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]>
@mmcky
mmcky merged commit ac7b1f8 into main Nov 3, 2026
4 checks passed
@mmcky
mmcky deleted the promote/consumer-refusals branch November 3, 2026 09:55
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