diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock
index db5de7f1..85dd5f21 100644
--- a/.github/workflows/actions.lock
+++ b/.github/workflows/actions.lock
@@ -11,12 +11,13 @@ workflows:
'.github/workflows/build-gossamer-gui.yml':
- 'actions/cache@v6.1.0'
- 'actions/checkout@v7.0.1'
- - 'actions/setup-node@v7.1.0'
- 'actions/upload-artifact@v7.0.2'
- 'dtolnay/rust-toolchain@v1'
+ - 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6'
- 'taiki-e/install-action@v2.90.3'
'.github/workflows/ci-health-sweep.yml':
- 'actions/checkout@v7.0.1'
+ - 'actions/create-github-app-token@v3.3.0'
- 'step-security/harden-runner@v2.22.4'
'.github/workflows/ci.yml':
- 'actions/cache@v6.1.0'
@@ -38,6 +39,7 @@ workflows:
- 'actions/checkout@v7.0.1'
- 'github/codeql-action@v4.38.2'
'.github/workflows/credential-read-check.yml':
+ - 'actions/create-github-app-token@v3.3.0'
- 'step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a'
'.github/workflows/dependabot-automerge.yml':
- 'dependabot/fetch-metadata@v3.1.0'
@@ -54,6 +56,7 @@ workflows:
'.github/workflows/governance.yml':
- 'metadatastician/standards@7641c7fdb01420696b5420ab85d88f599f32f609'
'.github/workflows/hypatia-remediation-sweep.yml':
+ - 'actions/create-github-app-token@v3.3.0'
- 'actions/upload-artifact@v7.0.2'
- 'step-security/harden-runner@v2.22.4'
'.github/workflows/hypatia-scan.yml':
diff --git a/.github/workflows/build-gossamer-gui.yml b/.github/workflows/build-gossamer-gui.yml
index 175dd7d6..5bc37089 100644
--- a/.github/workflows/build-gossamer-gui.yml
+++ b/.github/workflows/build-gossamer-gui.yml
@@ -112,18 +112,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v7.0.1
- - name: Setup Node.js
- uses: actions/setup-node@v7.1.0
+ # Estate policy: no Node.js/npm; JS runs Bun > Deno > pnpm.
+ - name: Setup Bun
+ uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
- node-version: '22'
+ bun-version: 1.4.4 # the release the gossamer tests were run against
- name: Run loader smoke tests
- # Shell-glob picks up every *.test.mjs in test/gossamer/, so
+ # `bun test
` picks up every *.test.mjs in test/gossamer/, so
# adding a new harness (e.g. the panel-surface
- # `browser_smoke.test.mjs` added in #220) doesn't need a second
- # workflow edit. Node 22's `--test` does not yet support a
- # directory argument directly.
- run: node --test test/gossamer/*.test.mjs
+ # `browser_smoke.test.mjs` added in #220) needs no second workflow
+ # edit. The files import `node:test`, which Bun implements.
+ run: bun test test/gossamer/
build-ephapax:
name: Build Ephapax toolchain (pinned)
diff --git a/.github/workflows/ci-health-sweep.yml b/.github/workflows/ci-health-sweep.yml
index 8301bfcd..bdba4d33 100644
--- a/.github/workflows/ci-health-sweep.yml
+++ b/.github/workflows/ci-health-sweep.yml
@@ -55,12 +55,28 @@ jobs:
api.github.com:443
- uses: actions/checkout@v7.0.1
+
+ # Short-lived installation token, replacing the long-lived
+ # HYPATIA_DISPATCH_PAT. Scoped to every repository the App is
+ # installed on (the sweep walks the whole owner).
+ - name: Mint sweep token (GitHub App)
+ id: sweep_app
+ uses: actions/create-github-app-token@v3.3.0
+ with:
+ app-id: ${{ secrets.HYPATIA_APP_ID }}
+ private-key: ${{ secrets.HYPATIA_APP_PRIVATE_KEY }}
+ owner: ${{ inputs.owner || 'hyperpolymath' }}
+ permission-actions: read # detect.sh lists workflow runs and jobs
+ permission-checks: read # detect.sh reads check-run annotations
+ permission-administration: write # allow-list PUT
+ permission-contents: write # fix branches
+ permission-pull-requests: write # PR create
+ permission-issues: write # issue upsert
+ permission-workflows: write # branches that touch .github/workflows
+
- name: Run CI-health sweep
env:
- # PAT needs classic `repo` + `workflow` scope (repo admin for the
- # allow-list PUT, PR create, and issue upsert). Reused from the
- # existing remediation pipeline.
- GH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
+ GH_TOKEN: ${{ steps.sweep_app.outputs.token }}
OWNER: ${{ inputs.owner || 'hyperpolymath' }}
# Scheduled runs remediate live (owner opted into auto-remediation);
# manual dispatch defaults to dry-run for safety.
diff --git a/.github/workflows/credential-read-check.yml b/.github/workflows/credential-read-check.yml
index 15c597ea..8a9563ec 100644
--- a/.github/workflows/credential-read-check.yml
+++ b/.github/workflows/credential-read-check.yml
@@ -21,8 +21,11 @@ on:
HYPATIA_SCAN_PAT:
description: Scanner credential to validate against Hypatia's three alert endpoints
required: true
- HYPATIA_DISPATCH_PAT:
- description: Required only when scanner_only is false
+ HYPATIA_APP_ID:
+ description: GitHub App ID; required only when scanner_only is false
+ required: false
+ HYPATIA_APP_PRIVATE_KEY:
+ description: GitHub App private key; required only when scanner_only is false
required: false
permissions:
@@ -76,12 +79,20 @@ jobs:
with:
egress-policy: block
allowed-endpoints: api.github.com:443
- - name: Check dispatch identity and observation-store visibility
+ - name: Mint dispatch token (GitHub App)
+ id: app
+ uses: actions/create-github-app-token@v3.3.0
+ with:
+ app-id: ${{ secrets.HYPATIA_APP_ID }}
+ private-key: ${{ secrets.HYPATIA_APP_PRIVATE_KEY }}
+ owner: hyperpolymath
+ repositories: verisimdb-data
+ permission-contents: read
+ - name: Check App authentication and observation-store visibility
env:
- GH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
+ GH_TOKEN: ${{ steps.app.outputs.token }}
run: |
set -euo pipefail
- [ -n "${GH_TOKEN:-}" ] || { echo '::error::HYPATIA_DISPATCH_PAT is missing'; exit 1; }
- gh api user --silent
+ [ -n "${GH_TOKEN:-}" ] || { echo '::error::the GitHub App token was not minted (HYPATIA_APP_ID / HYPATIA_APP_PRIVATE_KEY)'; exit 1; }
gh api 'repos/hyperpolymath/verisimdb-data/git/ref/heads/main' --silent
echo 'Dispatch: authentication and store-ref read passed. Write, workflow, administrative and dispatch permissions were not tested.' >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/estate-rescan.yml b/.github/workflows/estate-rescan.yml
index 936a24c8..4331a324 100644
--- a/.github/workflows/estate-rescan.yml
+++ b/.github/workflows/estate-rescan.yml
@@ -73,7 +73,7 @@ jobs:
#
# `scan` builds panic-attack and runs it over ~300 repositories' worth of
# third-party content. Until this split it ran in the same job as
- # HYPATIA_DISPATCH_PAT, and `Checkout verisimdb-data` left that PAT in the
+ # the old write-capable PAT, and `Checkout verisimdb-data` left that PAT in the
# clone's .git/config, readable by every later step, the freshly built
# scanner included. Now `scan` holds no credential and hands its output to
# `publish` as an artifact; the two jobs that hold the PAT run no fetched
diff --git a/.github/workflows/hypatia-remediation-sweep.yml b/.github/workflows/hypatia-remediation-sweep.yml
index 61fba22e..15429270 100644
--- a/.github/workflows/hypatia-remediation-sweep.yml
+++ b/.github/workflows/hypatia-remediation-sweep.yml
@@ -202,10 +202,23 @@ jobs:
| sort -t'|' -k3 -nr >> "$GITHUB_STEP_SUMMARY"
fi
+ # Short-lived (1 h) installation token for the one repository this step
+ # writes to, replacing the long-lived HYPATIA_DISPATCH_PAT.
+ - name: Mint dispatch token (GitHub App)
+ id: dispatch_app
+ if: steps.query.outputs.target_count != '0' && steps.cfg.outputs.dry != 'true'
+ uses: actions/create-github-app-token@v3.3.0
+ with:
+ app-id: ${{ secrets.HYPATIA_APP_ID }}
+ private-key: ${{ secrets.HYPATIA_APP_PRIVATE_KEY }}
+ owner: hyperpolymath
+ repositories: gitbot-fleet
+ permission-contents: write # repository_dispatch needs Contents: write
+
- name: Dispatch findings to gitbot-fleet
if: steps.query.outputs.target_count != '0' && steps.cfg.outputs.dry != 'true'
env:
- GH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
+ GH_TOKEN: ${{ steps.dispatch_app.outputs.token }}
OWNER: ${{ steps.cfg.outputs.owner }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
diff --git a/docs/operations/credential-roles.adoc b/docs/operations/credential-roles.adoc
index ffa8aa52..f8cf3535 100644
--- a/docs/operations/credential-roles.adoc
+++ b/docs/operations/credential-roles.adoc
@@ -6,8 +6,11 @@
alerts and Secret scanning alerts access for the intended repository selection.
Metadata read is automatic; no write or account permissions are needed for
these reads. The remediation sweep's query uses this
-credential. Its later repository-dispatch step still uses
-`HYPATIA_DISPATCH_PAT`; the two values are not fallbacks for one another.
+credential. Its later repository-dispatch step uses a short-lived GitHub App
+installation token minted from `HYPATIA_APP_ID` and `HYPATIA_APP_PRIVATE_KEY`
+(Contents: write on `gitbot-fleet` only; the App must be installed on both
+`gitbot-fleet` and `verisimdb-data`, the latter for the credential read check); the PAT and the App are not
+fallbacks for one another. `HYPATIA_DISPATCH_PAT` has been retired.
Run the manual `Credential read check` workflow after replacing either secret.
Its separate jobs check authentication and specific read endpoints without
@@ -36,7 +39,7 @@ an operator. Pin the reusable to a reviewed full commit SHA and pass only
`scanner_only: true`; the dispatch job is skipped and its secret is optional.
Manual runs default to checking both roles, with a `scanner_only` checkbox
for scanner-only validation. A caller that explicitly checks dispatch must
-also pass `HYPATIA_DISPATCH_PAT`.
+also pass `HYPATIA_APP_ID` and `HYPATIA_APP_PRIVATE_KEY`.
The API targets remain fixed: Hypatia's three alert endpoints and, only for
dispatch validation, the observation-store main ref. A successful call from
@@ -58,7 +61,7 @@ observation publication requires a qualified receipt in addition to access.
`estate-rescan.yml` uses `VERISIMDB_DATA_PUBLISH_PAT` only in its preflight
and publication jobs. The scanner job has no publisher credential. There is
-no fallback to `HYPATIA_DISPATCH_PAT` or `HYPATIA_SCAN_PAT`.
+no fallback to the GitHub App credentials or `HYPATIA_SCAN_PAT`.
Provision a fine-grained token with resource owner `hyperpolymath`, only
`verisimdb-data` selected, Contents read/write and Pull requests read/write;
diff --git a/docs/operations/standards-move-estate-rollout.adoc b/docs/operations/standards-move-estate-rollout.adoc
index a3201e99..2cffbcee 100644
--- a/docs/operations/standards-move-estate-rollout.adoc
+++ b/docs/operations/standards-move-estate-rollout.adoc
@@ -128,8 +128,8 @@ checks out the current one (#1004).
cannot run from CI. After replacing either secret, run
`credential-read-check.yml` to authenticate the scanner and dispatch
credentials separately. A remediation-sweep `dry_run: true` now reads
- `HYPATIA_SCAN_PAT` and skips dispatch; it cannot validate a rotated
- `HYPATIA_DISPATCH_PAT`. The credential read check proves only the reads
+ `HYPATIA_SCAN_PAT` and skips dispatch; it cannot validate the
+ App credentials. The credential read check proves only the reads
named in its summary. Validate the intended write/dispatch operation and
its egress policy separately before claiming rotation complete. See
xref:credential-roles.adoc[credential roles and validation limits].
diff --git a/docs/wiki-pages/Operations.md b/docs/wiki-pages/Operations.md
index ea9ff53e..f198bf45 100644
--- a/docs/wiki-pages/Operations.md
+++ b/docs/wiki-pages/Operations.md
@@ -54,7 +54,7 @@ The supervision tree starts Bandit on port 9090 (9099 under `MIX_ENV=test`):
| Variable | Purpose |
|---|---|
-| `HYPATIA_DISPATCH_PAT` | GitHub PAT with `repo` scope for cross-repo dispatch |
+| `HYPATIA_DISPATCH_PAT` | Optional local-run token for `mix hypatia.*` tasks. The remediation, ci-health and credential-check workflows no longer use it: they mint GitHub App tokens from `HYPATIA_APP_ID` / `HYPATIA_APP_PRIVATE_KEY`. The Phase 2 resync fragment (`scripts/sweeps/phase2-canonical.fragment.yml`) still needs it in consuming repos |
| `HYPATIA_HTTP_PORT` | Override the Bandit listen port (default 9090) |
| `HYPATIA_VERISIM_URL` | verisim-api base URL. No default: unset or blank turns off prover hints, strategy-shift detection and recommender retraining |
| `HYPATIA_ECHIDNABOT_URL` | echidnabot base URL (`/graphql` is appended). No default: unset or blank means strategy-shift re-queues are logged and dropped |
diff --git a/hypatia_chora.deed b/hypatia_chora.deed
index 3e6588a0..fbdeaf45 100644
--- a/hypatia_chora.deed
+++ b/hypatia_chora.deed
@@ -169,7 +169,7 @@
(job
:workflow ".github/workflows/ci-health-sweep.yml"
:job "sweep"
- :secrets ("HYPATIA_DISPATCH_PAT")
+ :secrets ("HYPATIA_APP_ID" "HYPATIA_APP_PRIVATE_KEY")
:endpoints ("github.com:443" "api.github.com:443")
:enforcement harden-runner-block
:reason "Checks out this repo, then every call in scripts/ci-health/ is gh against the GitHub API.")
@@ -190,7 +190,7 @@
(job
:workflow ".github/workflows/hypatia-remediation-sweep.yml"
:job "sweep"
- :secrets ("HYPATIA_SCAN_PAT" "HYPATIA_DISPATCH_PAT")
+ :secrets ("HYPATIA_SCAN_PAT" "HYPATIA_APP_ID" "HYPATIA_APP_PRIVATE_KEY")
:endpoints ("api.github.com:443" "results-receiver.actions.githubusercontent.com:443" "*.blob.core.windows.net:443")
:enforcement harden-runner-block
:reason "Reads vulnerability alerts with the read-only scanner credential, sends repository dispatches with the separate dispatch credential, then uploads the target list as an artifact.")
@@ -204,7 +204,7 @@
(job
:workflow ".github/workflows/credential-read-check.yml"
:job "dispatch"
- :secrets ("HYPATIA_DISPATCH_PAT")
+ :secrets ("HYPATIA_APP_ID" "HYPATIA_APP_PRIVATE_KEY")
:endpoints ("api.github.com:443")
:enforcement harden-runner-block
:reason "Checks token identity and reads the observation-store main ref; does not validate dispatch or write permissions.")
diff --git a/scripts/ci-health/README.adoc b/scripts/ci-health/README.adoc
index 3ee21a85..11e13c80 100644
--- a/scripts/ci-health/README.adoc
+++ b/scripts/ci-health/README.adoc
@@ -92,8 +92,10 @@ from the conclusion alone.
== Operating notes / off-switch
-* Needs `secrets.HYPATIA_DISPATCH_PAT` (classic `repo` + `workflow` scope — repo
- admin for the allow-list PUT, PR create, issue upsert).
+* Needs the GitHub App secrets `HYPATIA_APP_ID` and `HYPATIA_APP_PRIVATE_KEY`.
+ The workflow mints a short-lived installation token with Administration,
+ Contents, Pull requests, Issues and Workflows write, plus Actions and Checks read (allow-list PUT, PR
+ create, issue upsert). See `docs/operations/credential-roles.adoc`.
* Scheduled runs remediate **live**; manual `workflow_dispatch` defaults to
**dry-run**. To pause auto-remediation, set the schedule run to dry-run or
disable the workflow.