Repository navigation
promote: retire a lecture removed or renamed upstream; let a shared include lead - #60
Merged
Merged
Conversation
…nclude lead Retirement (#40). A pool lecture whose canonical copy is gone upstream could only be reported: the refresh failed on it every day. Now: - `--refresh` never retires. It skips an entry whose canonical copy is gone, so the rest still refresh; the drift-check keeps its canonical-removed issue. - `--toc SERIES` retires, before it plans its batch, each entry canonical in SERIES whose lecture left that toc, whose canonical copy is gone and whose name no series in the manifest holds. More than five in one run retires none and fails, naming them. An empty toc retires nothing. - `--retire SLUG...` retires by name, all or nothing. It refuses a lecture its canonical series' toc still lists, and an entry whose canonical series is not in sync/manifest.yml, so nothing of a series the pool has taken over is ever retired. - Retiring removes the pool file and the ledger entry and prunes the assets no other pool lecture uses. There is no tombstone. Shared `_admonition/` includes (#22). Several series carry their own copy and the pool keeps one. A series whose copy was the pool's version and changes it now leads: the refresh takes the new version for every lecture that uses the include, in the batch or not, and records the copies that did not follow as stale on the asset (their own digest and a stale_since time). The drift-check reports a stale copy as info for seven days and as drift after that. Two series that change it differently are refused, and a stale copy may only catch up. A hand-edited pool include is never overwritten. The ledger's header gains three lines describing the new fields. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMXuHMiWb8victibwcU
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
The change still has an active moderate issue where admonition_version() can crash with StopIteration when no eligible series provides an include and there is no ledger record, indicating the tool may fail without an actionable error.
1 open issue
What changed in this PR
Improves robustness of the pool promotion tooling by adding a supported retirement path for lectures removed/renamed upstream and by allowing a shared _admonition/ include to be updated by a leading series while tracking lagging copies as stale.
Changes:
- Add
tools/promote --retireplus--toc-driven auto-retire (with guardrails) and make--refreshskip missing canonicals instead of failing. - Implement shared
_admonition/leader/stale semantics intools/promote, record stale metadata in the ledger, and escalate stale status intools/drift-checkafter a grace period. - Update tests, documentation, and workflow messaging to reflect the new behaviors and remedies.
| File | Description |
|---|---|
| tools/tests/test_retire.py | Adds new test coverage for lecture retirement scenarios, guardrails, and related asset/ledger behavior. |
| tools/tests/test_refresh.py | Updates refresh tests to reflect skipping entries whose canonical copy is missing upstream rather than failing the run. |
| tools/tests/test_consumer.py | Adjusts consumer-related tests to align expectations with the new refresh skip behavior for missing canonicals. |
| tools/tests/test_admonition.py | Adds tests covering shared _admonition/ leader/stale handling, escalation timing, and refusal cases. |
| tools/promote | Implements retirement workflows and shared _admonition/ leader/stale logic, updating refresh/TOC planning and ledger updates accordingly. |
| tools/drift-check | Adds stale-copy reporting/escalation for shared _admonition/ includes and updates guidance around canonical-removed situations. |
| sync/ledger.yml | Updates the ledger header documentation to describe newly recorded stale metadata fields for shared includes. |
| README.md | Documents the retirement behavior and the shared _admonition/ leader/stale model, including recommended remedies. |
| .github/workflows/drift-check.yml | Updates workflow messaging/comments to reflect the new skip/retire and stale-include behaviors. |
Review effort: Balanced
… as last seen; retire by full path - A run with --exclude that moves the pool to a new version of a shared include recorded the left-out series as holding it. Its copy was not read, so it is now recorded as stale at the version it was last seen at, and the next full run judges it. Before, that run could take the pool back. - Retirement works on the entry as keyed, folder included, so a lecture moved into a subfolder is retired at its old path and promoted at the new one; the refresh no longer takes a subfolder entry for one whose copy is gone. A retired file is kept only when a surviving entry is the same file (a case-only rename on a case-insensitive file system). - --retire refuses a lecture another canonical-eligible series still holds and lists in its toc, and points at re-homing. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMXuHMiWb8victibwcU
mmcky
added a commit
that referenced
this pull request
Nov 16, 2026
…corded by its users (#62) The admonition rule from #60 now holds for every pool asset: one pool copy; a series whose copy was the pool's version leads, laggards are recorded stale, and forks are refused. Lectures that share a file stay on one pool path, and are pulled into the batch when that path must change. An asset's sources are its copies in the series its user lectures come from; a copy that was never the pool's version is recorded as `differs: true` and never followed. A destination collision refuses every lecture involved, and a hand-edited shared file is never restored. drift-check applies the same rule to all assets and gains two refresh findings, `asset-caught-up` and `asset-record`. It also repairs #60: a stale copy that caught up by a file-only edit is now recorded as caught up. sync/ledger.yml changes its header comment, and three records (`_static/markov_perf/judd_fig1.png`, `judd_fig2.png`, `mpe_vs_monopolist.png`) lose `advanced` as a source, since no advanced lecture uses them. No pool lecture or asset changes. Closes #23
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.

Two things that could turn the daily run red until someone fixed it by hand: a lecture renamed or removed upstream (#40), and a shared
_admonition/include that one series edits before the others (#22). This is the first of the promote-robustness changes; asset placement and provenance (#23) follow separately.Retirement
tools/promote --refreshnever retires. It skips an entry whose canonical copy is gone, so the rest still refresh. The drift-check keeps reporting it ascanonical-removeduntil it is retired or re-homed.tools/promote --toc SERIESretires on its own, before it plans its batch, each entry canonical inSERIESwhose lecture has left that toc, whose canonical copy is gone, and whose name no series in the manifest holds. A renamed lecture is retired under its old name and promoted under its new one by the same run. More than five in one run retires none and fails, naming them. A toc that lists no lecture retires nothing.tools/promote --retire SLUG …retires by name, all or nothing, for anything the rule above leaves alone (for example a lecturedpstill holds). It refuses a lecture its canonical series' toc still lists, and one another canonical-eligible series still holds and lists (that one is re-homed withtools/promote SLUG).sync/manifest.yml, so nothing of a series the pool has taken over is ever retired.{doc}.A shared include that one series edits first
Today
_admonition/gpu.mdis carried by programming, intermediate and jax, and 55 pool lectures use the pool's one copy. Before this change, an edit in one series was refused ("differs across series") and raised a drift issue until every series had made the same edit.sync/ledger.yml: their owndigestand astale_sincetime (the leading series'synced_at, so a recompute gives the same ledger). An asset with no stale copy is recorded exactly as before.--excludekeeps its record; if the pool's version changes in that run, its copy, which was not read, is recorded as stale at the version it was last seen at.Also
sync/ledger.yml).tools/promote,tools/drift-checkand the refresh workflow name the remedy; the README has a section on each behaviour.Checks
tools/tests: 171 passed, 1 skipped (29 new tests intest_retire.pyandtest_admonition.py; two existing tests updated, since a removed canonical copy is now a skip in the refresh and not a failure).tools/drift-checkandtools/pool-checkclean;tools/promote --refreshhas nothing to refresh.gpu.mdis taken by the refresh with the other two series recorded as stale and the drift-check at information only; a lecture dropped from intermediate is skipped by the refresh and retired by--toc intermediate, with the drift-check and pool-check clean afterwards.--excludedropping a stale record, the holder of the pool's version dropping the file, a falseasset-divergedfor a copy catching up, a hand-edited include overwritten, an empty toc read as "lists nothing", and the order of writes when a retirement is interrupted. The organiser's review then found that a run with--excludecould record a left-out series as holding a new version, so that the next full refresh took the pool back; fixed with a test, with the subfolder and re-homing points above.Known limits, left for later
refreshfinding until the first is retired.{doc}-target check comes with the pool checks.Closes #40. Part of #22.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMXuHMiWb8victibwcU