Skip to content

context-cadence.yml is 114 lines behind its template: re-render it (gregoryfoster/skills#683's two fixes) #165

Done

Description

@gregoryfoster

Problem

.github/workflows/context-cadence.yml is behind its template. It was generated once, by #126 (595ae1b, 2026-11-08), and never re-rendered. After PR #164 merged (a230791, skills 85768b9d), bash .claude/skills/curating-context/scripts/install-cadence.sh --check reads:

re-render:          behind — a re-render rewrites 114 line(s) of the
                    installed workflow. Run install-cadence.sh
                    and review the diff before committing it.

Every other guarantee it checks reads yes: the schedule 14 16 * * 2, the drivers, the drift report, the delta check, the checkout pin v7.0.1 (3d3c42e5aac5), merge_mode pr, and the three merge drivers.

What the re-render changes

Measured in a throwaway worktree on a230791 (removed after): 1 file changed, 114 insertions(+), 16 deletions(-), context-cadence.yml only. .gitattributes and both git-config drivers are unchanged. Its two fixes come from gregoryfoster/skills#683, both committed 2026-11-20, so the drift predates PR #164:

  1. A pr-mode run off the default branch is refused (finding 1, 2e1ec565). A new first step, Hold the run to the default branch, reads origin's HEAD and fails with ::error:: (nothing measured) when the run is on any other ref. Today a workflow_dispatch on another branch would merge the measurement branch into that branch.
  2. A measurement PR that ends during the run (finding 3, 48dcea3c, plus KEEP). The step that takes in the open PR's rows records what it took (TAKEN, TAKEN_PR). If that PR merged into main before the push, the row restarts on main's new tip. If it was closed or deleted, the run fails with ::error:: instead of pushing a row onto a branch no PR carries. The error texts share a $LOST variable.

The rest of the diff is comments.

Fix

In a worktree (never this checkout: scripts/deploy.sh and the skills hook run from it):

  1. bash .claude/skills/curating-context/scripts/install-cadence.sh with no flags. A re-run keeps the schedule and the checkout SHA pin (docs/SKILLS.md:100, docs/DEPENDENCIES.md:26).
  2. Review the diff against the two fixes above: only context-cadence.yml should change, and the actions/checkout pin must stay 3d3c42e5aac5…. No test guards this file's pin: tests/test_ci.py's floor test covers only ci.yml and audit.yml, so read it in the diff.
  3. install-cadence.sh --check reads re-render: none (a re-render writes the installed file back), with every other line unchanged.
  4. PR, CI green, FF merge. No deploy: a workflow file is not a runtime path.
  5. After the merge: gh workflow run context-cadence.yml on main once, and read the run: the new first step logs on main, the default branch, and the row lands on PR chore: weekly context measurement #157's branch (context/weekly-measurement). The first scheduled run is Tue 2026-12-08 16:14Z.

Don't hand-edit the workflow (docs/SKILLS.md § Context budget: it is generated).

Done when

  • install-cadence.sh --check on main reads re-render: none.
  • One dispatched run on main is green, with its row on the open measurement PR.

Known context

🤖 Generated with Claude Code

Activity

  1. gregoryfoster commented on Dec 3, 2026

    @gregoryfoster
    MemberAuthor

    Pre-build review against origin/main (a230791, skills 85768b9d)

    Reproduced: install-cadence.sh --check reads behind — … 114 line(s); a no-flag re-render in a worktree gives 1 file changed, 114 insertions(+), 16 deletions(-), context-cadence.yml only, .gitattributes and both drivers unchanged, checkout pin 3d3c42e5aac5… kept. PR #157 is open (context/weekly-measurement → main, 1 commit, 0 checks). Corrections:

    1. Not the first step. Hold the run to the default branch comes after checkout, Heal vendored symlinks and Read the merge mode, and before Preflight the credential. It needs MERGE_MODE, so a direct run passes it. Still "nothing measured, before the key is spent".
    2. What an off-branch run does today. It doesn't merge into that branch. On feature/x, gh pr list --base feature/x finds no PR, so the measurement branch is kept and merged into the feature/x checkout. The row is pushed to context/weekly-measurement, so PR chore: weekly context measurement #157 (into main) picks up feature/x's commits unreviewed. Then gh pr create --base feature/x opens a second PR from the same head.
    3. Provenance of fix 2. 48dcea3c (finding 3) only factors the PR lookup into one shared block (# >>> which measurement PR), with KEEP and $LOST. The handling for a PR that ends mid-run is finding 2, 0e56503d, plus CRs 2564, 2567, 2571, 2574 and 2575 (0cc4236a, 80b8e5a1, 18ba01bd, ae4ce464, 36ab63eb).
    4. Restart or refuse depends on ancestry, not merged-vs-closed. After a fetch, the run restarts on main's new tip (the row merged into it) when the taken-in tip is an ancestor of origin/main. That happens after a merge commit, or after our FF push, so an FF merge of chore: weekly context measurement #157 during a run takes the restart path. A squash or rebase merge, a close, a branch deletion or a failed fetch all get ::error::.
    5. "The rest of the diff is comments": one more code change. CR 2575, [ -n "$KEEP" ] || OPEN='': an OPEN read before its branch was deleted mid-run no longer reports "updated PR #N". The restart path opens a new PR instead. PR_BRANCH= also moves into the shared block (no behaviour change). The checkout comment gains #675's reason for pinning by SHA.
    6. "No test guards this file's pin": partly. tests/test_dependabot.py::test_every_workflow_pins_each_action_to_a_commit_with_its_tag reads every workflow, this one included, so a re-render that wrote a bare tag would fail CI. You're right that nothing holds the value or a floor (test_ci.py's floor test is ci.yml/audit.yml only), so the SHA still has to be read in the diff.
    7. "First scheduled run Tue 2026-12-08 16:14Z" is the cron slot. GitHub has started this job 5–22 h late every week: 11-10 21:48Z, 11-17 23:30Z, 11-25 00:46Z, 12-02 13:54Z. Expect it late.

    Building as specified otherwise.

  2. gregoryfoster commented on Dec 3, 2026

    @gregoryfoster
    MemberAuthor

    Done. PR #166 was fast-forwarded to main at 58e6f63. No deploy: the merge changes no runtime path.

    • install-cadence.sh --check on main: re-render: none (a re-render writes the installed file back). Checkout pin v7.0.1 (3d3c42e5aac5).
    • Dispatched run 47143783895, on main at 58e6f63: success. Hold the run to the default branch logged on main, the default branch. The take-in step logged measuring after the rows on context/weekly-measurement (PR #157), and the commit step 272bfcf..3bab107 HEAD -> context/weekly-measurement, updated PR #157 with this run's row. The delta check: nothing to repair.
    • Before the merge, a dispatch on the PR branch (47143103359) was refused by the guard as designed. Nothing was measured or pushed.

    Not exercised: the path for a measurement PR that ends mid-run (fix 2) has only been checked by reading the code. PR #157 still needs a close and reopen before its checks run.

  3. gregoryfoster commented on Dec 3, 2026

    @gregoryfoster
    MemberAuthor

    CR 3 (held: the generated workflow cites skills issues as bare #N, four of which are also processor numbers) filed upstream as gregoryfoster/skills#743.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions