From afb7a077eb1fb6fbc144a4e135500510c6ce4022 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 14:44:22 +0000 Subject: [PATCH 1/3] NRA gate: post the gate's findings on the pull request The NRA gate job kept its verdict lines only in a ~1 MB job log. It now captures the gate's stderr and hands it to Core's shared .github/actions/nra-findings action, from the same .core-gate checkout the gate runs from, which upserts one "" comment with the blocking lines first and warn-only ones apart. The job gets pull-requests: write for that comment. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016gZLdttfQjtizEYZGek9Gh --- .github/workflows/ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4314c6a36..ad1a06c3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: name: NRA gate timeout-minutes: 5 runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: - uses: actions/checkout@v4 with: @@ -44,15 +47,29 @@ jobs: *source['project']['optional-dependencies']['dev']], check=True) PY - name: Compare production source + id: gate env: # 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-gate/src" PATH="$PWD/.venv/bin:$PATH" .venv/bin/python .core-gate/tools/nra_client_gate.py --root src/toad --base "$(git merge-base "$BASE_TIP" "$PR_HEAD")" --head "$PR_HEAD" + # The verdict lines go to stderr; they are kept for the pull request comment below. + run: | + status=0 + PYTHONPATH="$PWD/.core-gate/src" PATH="$PWD/.venv/bin:$PATH" .venv/bin/python .core-gate/tools/nra_client_gate.py --root src/toad --base "$(git merge-base "$BASE_TIP" "$PR_HEAD")" --head "$PR_HEAD" 2>gate-findings.txt || status=$? + cat gate-findings.txt >&2 + exit "$status" - name: Run surface guards run: .venv/bin/pytest tests/guards + # Core owns the comment: the same action and Core commit as the gate itself. + - name: The gate's findings on the pull request + if: always() && github.event_name == 'pull_request' && contains(fromJSON('["success","failure"]'), steps.gate.outcome) + uses: ./.core-gate/.github/actions/nra-findings + with: + findings: gate-findings.txt + kind: debt-src + outcome: ${{ steps.gate.outcome }} suite: if: ${{ inputs.release_qualification }} runs-on: ubuntu-latest From c3f83277bb237ca2d9602ff205f074467467b0b2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 14:44:22 +0000 Subject: [PATCH 2/3] Probe, to be reverted: make the NRA gate red to show its PR comment Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016gZLdttfQjtizEYZGek9Gh --- src/toad/platform.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/toad/platform.py b/src/toad/platform.py index fa8ec47f4..fb730912d 100644 --- a/src/toad/platform.py +++ b/src/toad/platform.py @@ -3,7 +3,13 @@ from __future__ import annotations import platform -from typing import ClassVar, Literal, Mapping +from typing import ClassVar, Literal, Mapping, TYPE_CHECKING +import os + +if TYPE_CHECKING: + from pathlib import Path + +PROBE_COUNT: int = "not an int" type OS = Literal["linux", "macos", "windows", "*"] From 7d34cbda3a5a837264eca33874a43d4af3521541 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 14:56:33 +0000 Subject: [PATCH 3/3] Revert the probe: the NRA gate comment was shown on this PR Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016gZLdttfQjtizEYZGek9Gh --- src/toad/platform.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/toad/platform.py b/src/toad/platform.py index fb730912d..fa8ec47f4 100644 --- a/src/toad/platform.py +++ b/src/toad/platform.py @@ -3,13 +3,7 @@ from __future__ import annotations import platform -from typing import ClassVar, Literal, Mapping, TYPE_CHECKING -import os - -if TYPE_CHECKING: - from pathlib import Path - -PROBE_COUNT: int = "not an int" +from typing import ClassVar, Literal, Mapping type OS = Literal["linux", "macos", "windows", "*"]