From 241dc049c5a8eae65ebdcd0414df68dc2753ad44 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 00:28:50 +0000 Subject: [PATCH 1/3] ci(static-analysis-gate): run the Hypatia scan on OTP 27.3.4.19, not 28.3 OTP 26 has no release that is safe here. Measured on loopback on 2026-11-17 for 301, 302, 303, 307 and 308, GET and POST, to another port and another host: OTP 26.2.5.21, the newest 26 build, forwards an explicit authorization header in 20 of 20 cross-origin redirects, and credentials from the URL (sent as Basic auth) in 20 of 20. OTP 27.3.4.19 forwards neither (0 of 20 each). OTP 28.3 also forwards both. 27.3.4.19 is the release that Hypatia pins in mise.toml and its CI, and that the standards Hypatia reusable uses. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01J4QvDgzT72Tq2HTJmikyNg --- .github/workflows/static-analysis-gate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static-analysis-gate.yml b/.github/workflows/static-analysis-gate.yml index 1bf0818..ce221db 100644 --- a/.github/workflows/static-analysis-gate.yml +++ b/.github/workflows/static-analysis-gate.yml @@ -146,7 +146,7 @@ jobs: uses: erlef/setup-beam@v1.24.1 with: elixir-version: '1.19.4' - otp-version: '28.3' + otp-version: '27.3.4.19' - name: Clone and build Hypatia id: build continue-on-error: true From f865fc7b4c50963ec43e397a69cd64cd4a6c27a7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 00:52:41 +0000 Subject: [PATCH 2/3] fix(deps): bump quinn-udp to 0.5.16 in Cargo.lock (RUSTSEC-2026-0538) Ported from #210 so this PR's Dependency audit job passes. cargo audit fails on main for quinn-udp 0.5.14, which is in Cargo.lock only through an inactive optional path. Once #210 merges, this commit is a no-op. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01J4QvDgzT72Tq2HTJmikyNg --- Cargo.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dfdef01..e1b16fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1268,7 +1268,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3035,16 +3035,16 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.14" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016" dependencies = [ "cfg_aliases", "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -3346,7 +3346,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4050,7 +4050,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4894,7 +4894,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] From 0d6f6872572f6963e70c8e236d1d3b8c27505032 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Tue, 17 Nov 2026 02:09:13 +0000 Subject: [PATCH 3/3] ci(static-analysis-gate): drop the second Hypatia scan (#213) ## Summary Stacked on #211. It waits on #212, the lockfile regeneration. `hypatia-scan.yml` already runs Hypatia through the standards reusable. `static-analysis-gate.yml` ran it a second time. Because its build step carried `continue-on-error`, that copy passed even when the Hypatia build failed. The rsr-template-repo gate dropped the same job in 2026-10, and the owner ruled on 2026-11-17 that echidnabot matches the template. ## Changes - `.github/workflows/static-analysis-gate.yml`: - deletes the `hypatia-scan` job; - `deposit-findings` no longer needs it and no longer downloads `hypatia-findings`; - the unified report now holds the panic-attack findings and the patch-bridge report; - the header says where Hypatia runs instead. ## Checks - **Required checks:** "Hypatia neurosymbolic scan" is not one of `main`'s required status checks (repo rulesets read on 2026-11-17), so removing the job blocks nothing. - **YAML:** the workflow parses, and its jobs are now `panic-attack-assail`, `patch-bridge-triage` and `deposit-findings`. - **actions.lock:** still lists `erlef/setup-beam@v1.24.1` for this workflow, which gh-actions-lock v0.2.0 reports as `stale`. The lockfile is tool-owned and not edited by hand. It is regenerated in #212, together with the seven `hyperpolymath/standards` entries already stale on `main`. --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDgzT72Tq2HTJmikyNg)_ Co-authored-by: Claude --- .github/workflows/static-analysis-gate.yml | 161 ++------------------- 1 file changed, 14 insertions(+), 147 deletions(-) diff --git a/.github/workflows/static-analysis-gate.yml b/.github/workflows/static-analysis-gate.yml index ce221db..08c7266 100644 --- a/.github/workflows/static-analysis-gate.yml +++ b/.github/workflows/static-analysis-gate.yml @@ -2,7 +2,10 @@ # SPDX-License-Identifier: MPL-2.0 # This workflow is managed by gh actions-lock. # Static Analysis Gate — Required by branch protection rules. -# Runs panic-attack and hypatia, deposits findings for gitbot-fleet learning. +# Runs panic-attack and patch-bridge, deposits findings for gitbot-fleet learning. +# Hypatia does not run here: .github/workflows/hypatia-scan.yml runs it, once, +# as the rsr-template-repo gate does. This file used to run a second copy that +# passed even when the Hypatia build failed. name: Static Analysis Gate on: pull_request: @@ -46,7 +49,7 @@ jobs: PA_EXIT=$? set -e - # Same defect class as the Hypatia job below: `2>&1` folded the + # A defect class seen before in this workflow: `2>&1` folded the # scanner's stderr into the JSON payload, so every jq parse failed, # every count silently became 0 via `|| echo 0`, and "Fail on critical # findings" could never fire on any input. Keep stderr on the log. @@ -58,7 +61,7 @@ jobs: # release binary whose exit-code and output contract are not verified # here, and it has no confirmed --exit-zero equivalent, so we surface a # malformed payload in the log rather than block on an unverified tool. - # Promote to `exit 1` (as the Hypatia job does) once that contract is + # Promote to `exit 1` once that contract is # confirmed -- see the follow-up issue linked from this PR. if ! jq -e 'type == "array"' panic-attack-findings.json >/dev/null 2>&1; then echo "::warning::panic-attack output is not a JSON array (exit ${PA_EXIT}); counts below are unreliable" @@ -129,133 +132,7 @@ jobs: echo "::error::panic-attack found ${{ steps.assail.outputs.critical }} critical issue(s) — blocking merge" exit 1 # --------------------------------------------------------------------------- - # Job 2: hypatia-scan - # --------------------------------------------------------------------------- - hypatia-scan: - name: Hypatia neurosymbolic scan - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Checkout repository - uses: actions/checkout@v7.0.1 - with: - fetch-depth: 0 - - name: Setup Elixir for Hypatia scanner - id: beam - continue-on-error: true - uses: erlef/setup-beam@v1.24.1 - with: - elixir-version: '1.19.4' - otp-version: '27.3.4.19' - - name: Clone and build Hypatia - id: build - continue-on-error: true - run: | - git clone https://github.com/hyperpolymath/hypatia.git "$HOME/hypatia" 2>/dev/null || true - if [ -f "$HOME/hypatia/mix.exs" ]; then - cd "$HOME/hypatia" - # Build escript if neither hypatia nor hypatia-v2 exists - if [ ! -f hypatia ] && [ ! -f hypatia-v2 ]; then - mix deps.get - mix escript.build - fi - echo "ready=true" >> "$GITHUB_OUTPUT" - else - echo "::notice::Hypatia scanner not available — skipping scan" - echo "ready=false" >> "$GITHUB_OUTPUT" - fi - - name: Run Hypatia scan - id: scan - if: steps.build.outputs.ready == 'true' - run: | - set +e - HYPATIA_FORMAT=json "$HOME/hypatia/hypatia-cli.sh" scan . --exit-zero > hypatia-findings.json - HYP_EXIT=$? - set -e - - # --exit-zero is Hypatia's own documented CI recipe (lib/hypatia/cli.ex), - # for exactly this case: "use in CI when a downstream step gates on - # severity counts". Findings go to stdout, the one-line summary to - # stderr, and the process exits 0 unless the SCANNER itself failed. - # - # Do NOT redirect stderr into the payload with `2>&1`: that folds the - # summary line into the JSON, so every parse fails, the old `[]` - # fallback substituted a clean result, CRITICAL was always 0, and the - # gate below could never fire on any input. Keep stderr on the log. - if [ "$HYP_EXIT" -ne 0 ]; then - echo "::error::Hypatia scanner execution failed with exit ${HYP_EXIT}" - exit "$HYP_EXIT" - fi - # `jq empty` is NOT sufficient -- it succeeds on any valid JSON, - # including a bare string, object or null. Assert the array. - if [ ! -s hypatia-findings.json ] || ! jq -e 'type == "array"' hypatia-findings.json >/dev/null; then - echo "::error::Hypatia did not produce a valid JSON findings array" - exit 1 - fi - - TOTAL=$(jq '. | length' hypatia-findings.json 2>/dev/null || echo 0) - CRITICAL=$(jq '[.[] | select(.severity == "critical")] | length' hypatia-findings.json 2>/dev/null || echo 0) - HIGH=$(jq '[.[] | select(.severity == "high")] | length' hypatia-findings.json 2>/dev/null || echo 0) - MEDIUM=$(jq '[.[] | select(.severity == "medium")] | length' hypatia-findings.json 2>/dev/null || echo 0) - LOW=$(jq '[.[] | select(.severity == "low")] | length' hypatia-findings.json 2>/dev/null || echo 0) - - echo "total=$TOTAL" >> "$GITHUB_OUTPUT" - echo "critical=$CRITICAL" >> "$GITHUB_OUTPUT" - echo "high=$HIGH" >> "$GITHUB_OUTPUT" - echo "medium=$MEDIUM" >> "$GITHUB_OUTPUT" - echo "low=$LOW" >> "$GITHUB_OUTPUT" - - name: Emit check annotations - if: steps.build.outputs.ready == 'true' - run: | - # Findings carry no `.message` (keys: action,file,line,reason,rule_module, - # severity,type), so every annotation read "null". `.file` is an absolute - # runner path, which GitHub cannot anchor to the diff, so it is made - # workspace-relative here. - jq -r --arg ws "$GITHUB_WORKSPACE" '.[] | select(.file != null) | - (.file | ltrimstr($ws + "/")) as $f | - (.reason // .message // .type // "finding") as $m | - if .severity == "critical" then - "::error file=\($f),line=\(.line // 1)::[hypatia] \($m)" - elif .severity == "high" then - "::error file=\($f),line=\(.line // 1)::[hypatia] \($m)" - else - "::warning file=\($f),line=\(.line // 1)::[hypatia] \($m)" - end - ' hypatia-findings.json || true - - name: Write step summary - if: steps.build.outputs.ready == 'true' - run: | - cat <> "$GITHUB_STEP_SUMMARY" - ## Hypatia Scan Results - - | Severity | Count | - |----------|-------| - | Critical | ${{ steps.scan.outputs.critical }} | - | High | ${{ steps.scan.outputs.high }} | - | Medium | ${{ steps.scan.outputs.medium }} | - | Low | ${{ steps.scan.outputs.low }} | - | **Total**| ${{ steps.scan.outputs.total }} | - EOF - - name: Create stub findings (when Hypatia unavailable) - if: steps.build.outputs.ready != 'true' - run: | - echo "[]" > hypatia-findings.json - echo "## Hypatia Scan" >> "$GITHUB_STEP_SUMMARY" - echo "" >> "$GITHUB_STEP_SUMMARY" - echo "Skipped: Hypatia scanner not available in this environment." >> "$GITHUB_STEP_SUMMARY" - - name: Upload hypatia findings - uses: actions/upload-artifact@v7.0.2 - with: - name: hypatia-findings - path: hypatia-findings.json - retention-days: 90 - - name: Fail on critical security findings - if: steps.build.outputs.ready == 'true' && steps.scan.outputs.critical > 0 - run: | - echo "::error::Hypatia found ${{ steps.scan.outputs.critical }} critical security issue(s) — blocking merge" - exit 1 - # --------------------------------------------------------------------------- - # Job 3: patch-bridge triage (CVE contextual assessment) + # Job 2: patch-bridge triage (CVE contextual assessment) # --------------------------------------------------------------------------- patch-bridge-triage: name: Patch Bridge CVE triage @@ -337,13 +214,13 @@ jobs: # Warning only, not blocking. Unmitigable means the developer needs # to make an architectural decision, not that the PR is wrong. # --------------------------------------------------------------------------- - # Job 4: deposit-findings (combines + archives for gitbot-fleet) + # Job 3: deposit-findings (combines + archives for gitbot-fleet) # --------------------------------------------------------------------------- deposit-findings: name: Deposit findings for gitbot-fleet runs-on: ubuntu-latest timeout-minutes: 15 - needs: [panic-attack-assail, hypatia-scan, patch-bridge-triage] + needs: [panic-attack-assail, patch-bridge-triage] if: always() steps: - name: Download panic-attack findings @@ -351,11 +228,6 @@ jobs: with: name: panic-attack-findings path: findings/ - - name: Download hypatia findings - uses: actions/download-artifact@v8.0.2 - with: - name: hypatia-findings - path: findings/ - name: Download bridge report uses: actions/download-artifact@v8.0.2 with: @@ -365,18 +237,14 @@ jobs: id: combine run: | PA_FILE="findings/panic-attack-findings.json" - HYP_FILE="findings/hypatia-findings.json" - # Ensure both files exist and are valid JSON arrays - for f in "$PA_FILE" "$HYP_FILE"; do - if [ ! -s "$f" ] || ! jq empty "$f" 2>/dev/null; then - echo "[]" > "$f" - fi - done + # Ensure the file exists and is a valid JSON array + if [ ! -s "$PA_FILE" ] || ! jq empty "$PA_FILE" 2>/dev/null; then + echo "[]" > "$PA_FILE" + fi # Tag each finding with its source scanner jq '[.[] | . + {"scanner": "panic-attack"}]' "$PA_FILE" > /tmp/pa-tagged.json - jq '[.[] | . + {"scanner": "hypatia"}]' "$HYP_FILE" > /tmp/hyp-tagged.json # Read bridge report (CVE triage, not findings array) BRIDGE_FILE="findings/bridge-report.json" @@ -392,7 +260,6 @@ jobs: --arg run_id "${{ github.run_id }}" \ --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ --slurpfile pa /tmp/pa-tagged.json \ - --slurpfile hyp /tmp/hyp-tagged.json \ --slurpfile bridge "$BRIDGE_FILE" \ '{ schema_version: "1.1.0", @@ -401,7 +268,7 @@ jobs: ref: $ref, run_id: $run_id, timestamp: $ts, - findings: ($pa[0] + $hyp[0]), + findings: $pa[0], patch_bridge: $bridge[0] }' > findings/unified-findings.json