Skip to content

feat(governance): add hypatia-scan-reusable.yml — consolidate 702-repo drift#191

Closed
hyperpolymath wants to merge 1 commit into
mainfrom
chore/hypatia-scan-reusable
Closed

feat(governance): add hypatia-scan-reusable.yml — consolidate 702-repo drift#191
hyperpolymath wants to merge 1 commit into
mainfrom
chore/hypatia-scan-reusable

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Estate audit (gh search code filename:hypatia-scan.yml org:hyperpolymath) found 702 copies of the 416-line Hypatia Neurosymbolic scan workflow. Sampled heads (vcl-ut, k9iser, bunsenite, affinescript, echidna) are byte-identical apart from the SPDX header drifting between MPL-2.0 and PMPL-1.0-or-later. Largest currently-outstanding template-propagation lever: 702 × 416 ≈ 290k duplicated YAML lines.

Same pattern as #168 (governance / language-policy), #174 (rust-ci / elixir-ci), #187 (mirror), and #190 (secret-scanner).

Behaviour preservation

Reusable preserves the canonical's semantics step-for-step:

  • Build Hypatia escript, run scan, dump findings JSON.
  • Convert findings to SARIF (dependency-free Node — npm-ban-respecting).
  • Upload SARIF on non-fork triggers; skip on fork PRs (read-only token).
  • Best-effort gitbot-fleet learning submission (continue-on-error).
  • PR comment on same-repo PRs (continue-on-error).
  • Advisory critical-finding warning. Gating remains delegated to branch protection per hypatia#213 gate-decoupling.

Inputs (both optional)

  • enable_fleet_submission (default true) — opt out of the Phase 2 gitbot-fleet learning side-channel.
  • enable_pr_comment (default true) — opt out of the PR comment.

Both steps remain continue-on-error; toggles exist for repos that want cleaner step logs rather than a non-fatal warning trail.

secrets: block declares HYPATIA_DISPATCH_PAT as optional so callers can secrets: inherit without per-secret plumbing.

Caller shape

name: Hypatia Security Scan
on:
  push:    { branches: [main, master, develop] }
  pull_request: { branches: [main, master] }
  schedule: [{ cron: '0 0 * * 0' }]
  workflow_dispatch:
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
permissions:
  contents: read
  security-events: write
  pull-requests: write
jobs:
  hypatia:
    uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@<sha>
    secrets: inherit

After merge

Wrapper sweep — ~700 mechanical wrapper PRs following the standards#174 sweep pattern (3 proof PRs first to validate the wrapper file syntax, then fan out via background Bash; sandbox blocks the subagent path per feedback_fanout_needs_bash_allowlist.md).

Refs

🤖 Generated with Claude Code

…o drift

Estate audit (`gh search code filename:hypatia-scan.yml org:hyperpolymath`)
found 702 copies of the 416-line Hypatia Neurosymbolic CI/CD scan
workflow. Sampled heads (vcl-ut, k9iser, bunsenite, affinescript,
echidna) are byte-identical apart from the SPDX header drifting
between `MPL-2.0` and `PMPL-1.0-or-later` — the same self-copied
template pattern fixed by standards#168 (governance/language) and
#174 (rust-ci / elixir-ci).

Largest estate-template-propagation lever currently outstanding:
702 copies × 416 lines = ~290k lines of duplicated YAML across the
estate, all carrying the same scan body.

The reusable preserves the canonical's semantics:
  * Build Hypatia escript, run scan, dump findings JSON.
  * Convert findings to SARIF (dependency-free Node, npm-ban-respecting).
  * Upload SARIF on non-fork triggers; skip on fork PRs (read-only token).
  * Best-effort gitbot-fleet learning submission (continue-on-error).
  * PR comment on same-repo PRs (continue-on-error).
  * Advisory critical-finding warning (gating delegated to branch
    protection per hypatia#213 gate-decoupling).

Two opt-out booleans added:
  * `enable_fleet_submission` (default true)
  * `enable_pr_comment` (default true)

Both still `continue-on-error`; the toggles exist for repos that
want cleaner step logs rather than a non-fatal warning trail.

Caller shape (wrapper pattern):

  name: Hypatia Security Scan
  on:
    push:    { branches: [main, master, develop] }
    pull_request: { branches: [main, master] }
    schedule: [{ cron: '0 0 * * 0' }]
    workflow_dispatch:
  concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true
  permissions:
    contents: read
    security-events: write
    pull-requests: write
  jobs:
    hypatia:
      uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@<sha>
      secrets: inherit

Wrapper sweep gated on owner-merge. Then ~700 mechanical wrapper PRs
following the standards#174 sweep pattern.

Refs:
  * hypatia#213 — gate-decoupling design
  * hypatia#328 — CSA001 self-loop fix precedent
  * burble#35 — SARIF integration history
  * standards#168/#174 — template-propagation pattern
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 26, 2026 11:32
@hyperpolymath
Copy link
Copy Markdown
Owner Author

Closing in favour of #193 (parallel-session implementation filed 17 min after this PR).

After diffing the two reusables:

Hypatia-scan wrapper sweep (264 PRs filed pinned to this branch's HEAD 2569c10e) is being retargeted to #193's HEAD now.

auto-merge was automatically disabled May 26, 2026 12:14

Pull request was closed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant