From 073c292340cc59e296511e7432e354d3566dae69 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Thu, 29 Oct 2026 14:56:11 -0400 Subject: [PATCH] Diff the debt ratchet from the PR's merge-base, not GitHub's stale base.sha pull_request.base.sha is not refreshed when main moves. toad#1320 at c29eaa12c was diffed from 6d83f98ac, fifteen main commits behind its real merge-base 4c3c4f3a0, and charged with a NoneAbsence at screens/main.py:231 and a BroadSwallow at session_navigation.py:319 that main commits 776f7f928 and 961e7ca7b introduced; #1320 touches neither file. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RnH6dR85kyFKcc2tQAJLhK --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b1edccf5..5835d846f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,9 +41,12 @@ jobs: PY - name: Compare production source env: - PR_BASE: ${{ github.event.pull_request.base.sha || inputs.base }} + # pull_request.base.sha is not refreshed when the base branch moves, so it can name a + # revision many commits behind and charge the PR for debt main introduced. The PR's own + # change starts at the merge-base with the base branch's current tip. + BASE_TIP: ${{ github.event.pull_request.base.ref && format('origin/{0}', github.event.pull_request.base.ref) || inputs.base }} PR_HEAD: ${{ github.event.pull_request.head.sha || inputs.head }} - run: PYTHONPATH="$PWD/.core-ratchet/src" PATH="$PWD/.venv/bin:$PATH" .venv/bin/python .core-ratchet/tools/debt_ratchet.py --root src/toad --base "$PR_BASE" --head "$PR_HEAD" + run: PYTHONPATH="$PWD/.core-ratchet/src" PATH="$PWD/.venv/bin:$PATH" .venv/bin/python .core-ratchet/tools/debt_ratchet.py --root src/toad --base "$(git merge-base "$BASE_TIP" "$PR_HEAD")" --head "$PR_HEAD" - name: Run surface guards run: .venv/bin/pytest tests/guards suite: