Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/hermes-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
upstream-contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: NousResearch/hermes-agent
path: .hermes-agent-upstream
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand Down
66 changes: 27 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
version: ${{ steps.identity.outputs.version }}
steps:
- name: Check out the triggering main revision
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
Expand All @@ -62,7 +62,7 @@ jobs:
EXPECTED_SHA: ${{ github.sha }}
run: just release-attach-trigger
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
sha256sum release-source.bundle > release-source.sha256
- name: Upload the immutable release source
if: steps.intent.outputs.released == 'true'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ steps.identity.outputs.source_artifact_name }}
path: |
Expand All @@ -175,18 +175,12 @@ jobs:
outputs:
enabled: ${{ steps.verify.outputs.enabled }}
steps:
- name: Mint a current-repository administration-read token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.SOURCE_PROMOTION_APP_CLIENT_ID }}
private-key: ${{ secrets.SOURCE_PROMOTION_APP_PRIVATE_KEY }}
permission-administration: read
- name: Fail closed unless immutable releases are enabled
id: verify
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.SOURCE_PROMOTION_TOKEN }}
run: |
: "${GH_TOKEN:?SOURCE_PROMOTION_TOKEN must be configured in source-promotion}"
enabled="$(gh api "repos/$GITHUB_REPOSITORY/immutable-releases" --jq '.enabled')"
test "$enabled" = "true"
echo "enabled=true" >> "$GITHUB_OUTPUT"
Expand All @@ -199,13 +193,13 @@ jobs:
contents: read
steps:
- name: Check out a fresh trigger workspace
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.sha }}
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand All @@ -214,7 +208,7 @@ jobs:
with:
just-version: "1.58.0"
- name: Download the immutable release source
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.materialize.outputs.source_artifact_name }}
- name: Restore and verify the exact release source
Expand Down Expand Up @@ -255,13 +249,13 @@ jobs:
contents: read
steps:
- name: Check out a fresh isolated trigger workspace
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.sha }}
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand All @@ -270,7 +264,7 @@ jobs:
with:
just-version: "1.58.0"
- name: Download the immutable release source
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.materialize.outputs.source_artifact_name }}
- name: Restore and verify the exact release source
Expand Down Expand Up @@ -318,7 +312,7 @@ jobs:
test "$(git rev-list -n 1 "$TAG")" = "$RELEASE_SHA"
test -z "$(git status --porcelain --untracked-files=no)"
- name: Upload isolated Hermes evidence only
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: hermes-evidence-${{ needs.materialize.outputs.release_sha }}
path: hermes-source-sha.txt
Expand All @@ -338,13 +332,13 @@ jobs:
version: ${{ needs.materialize.outputs.version }}
steps:
- name: Check out a fresh build workspace
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.sha }}
- name: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand All @@ -353,11 +347,11 @@ jobs:
with:
just-version: "1.58.0"
- name: Download the immutable release source
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.materialize.outputs.source_artifact_name }}
- name: Download isolated Hermes evidence
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: hermes-evidence-${{ needs.materialize.outputs.release_sha }}
- name: Restore and verify the exact release source
Expand Down Expand Up @@ -417,7 +411,7 @@ jobs:
sha256sum release-source.bundle release-manifest.json dist/* \
> release-payload.sha256
- name: Upload the tested release payload
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ needs.materialize.outputs.artifact_name }}
path: |
Expand All @@ -443,29 +437,23 @@ jobs:
version: ${{ needs.materialize.outputs.version }}
steps:
- name: Check out the guarded parent revision without credentials
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.sha }}
- name: Mint the dedicated source-promotion token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.SOURCE_PROMOTION_APP_CLIENT_ID }}
private-key: ${{ secrets.SOURCE_PROMOTION_APP_PRIVATE_KEY }}
permission-contents: write
- name: Download the tested release payload
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.materialize.outputs.artifact_name }}
- name: Validate and atomically push only the tested source
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.SOURCE_PROMOTION_TOKEN }}
RELEASE_SHA: ${{ needs.materialize.outputs.release_sha }}
TAG: ${{ needs.materialize.outputs.tag }}
TRIGGER_SHA: ${{ github.sha }}
run: |
: "${GH_TOKEN:?SOURCE_PROMOTION_TOKEN must be configured in source-promotion}"
sha256sum --check release-payload.sha256
git bundle verify release-source.bundle
git fetch release-source.bundle \
Expand Down Expand Up @@ -513,7 +501,7 @@ jobs:
id-token: write
steps:
- name: Download the tested release payload
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.promote-source.outputs.artifact_name }}
- name: Recheck the immutable payload before publication
Expand All @@ -534,13 +522,13 @@ jobs:
receipt_artifact_name: ${{ steps.receipt.outputs.artifact_name }}
steps:
- name: Check out the published source identity
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ needs.promote-source.outputs.release_sha }}
- name: Download the published release payload
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.promote-source.outputs.artifact_name }}
- name: Verify PyPI bytes and finalize the discoverable receipt
Expand All @@ -560,7 +548,7 @@ jobs:
--receipt release-receipt.json
echo "artifact_name=release-receipt-$RELEASE_SHA" >> "$GITHUB_OUTPUT"
- name: Upload the finalized discoverable receipt
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ steps.receipt.outputs.artifact_name }}
path: release-receipt.json
Expand All @@ -574,11 +562,11 @@ jobs:
contents: write
steps:
- name: Download the published release payload
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.promote-source.outputs.artifact_name }}
- name: Download the finalized discoverable receipt
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.verify-pypi.outputs.receipt_artifact_name }}
path: final-receipt
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand All @@ -27,8 +27,8 @@ jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand Down Expand Up @@ -56,13 +56,13 @@ jobs:
env:
DEPLOYED_HERMES_REVISION: f80f453ae0679347e38abc917c7f94f717bf96c5
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: NousResearch/hermes-agent
ref: f80f453ae0679347e38abc917c7f94f717bf96c5
path: .hermes-agent-deployed
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.11"
enable-cache: true
Expand Down
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,13 @@ tests together so consuming Hermes plugins have a reliable migration path.
Keep `skills/hermes-plugins/references/plugin-kit.md` aligned with public API
and contract changes so the repo-owned authoring skill does not teach stale
behavior.

Release authentication uses `SOURCE_PROMOTION_TOKEN` from the main-only
`source-promotion` environment. A suitable PAT or existing GitHub credential
is valid; a particular token-minting mechanism is not a release invariant.
Keep the Administration-read immutability check, tested-source identity,
atomic guarded push, PyPI OIDC and published-byte verification intact.
Never expose the promotion credential to source-testing/build jobs, silently
fall back to the default Actions token, or change branch-policy bypasses as
part of credential wiring. An environment restriction narrows availability,
not the underlying token's permissions.
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ fails closed. Major releases are published but their receipt is always

The workflow first creates the version/CHANGELOG commit and tag locally, then
bundles that exact final source before executing tests. Fresh, separate jobs
restore the bundle for unit/public tests, the mutable upstream-Hermes contract,
restore the bundle for unit/public tests, the pinned Hermes contract,
and the one artifact build. The build job is gated on both test jobs and never
checks out or executes Hermes code. Every lane verifies the release SHA, tag,
parent, and clean tracked source before continuing.
Expand Down Expand Up @@ -877,27 +877,34 @@ prerequisites have been reviewed:
release intent is materialized but before source promotion, and verifies
`isImmutable` after publication. Non-releasing commits never enter a
protected environment;
- a protected environment named exactly `source-promotion` contains variable
`SOURCE_PROMOTION_APP_CLIENT_ID` and secret
`SOURCE_PROMOTION_APP_PRIVATE_KEY` for a dedicated GitHub App installed only
on this repository. The App has repository Administration read and Contents
write permissions; no PAT is used;
- the `main` ruleset requires the ordinary test workflow and names that
dedicated GitHub App as its sole source-promotion bypass actor. Generic
Actions credentials and the default `GITHUB_TOKEN` must not bypass it;
- the existing `0.7.0` source baseline has a reviewed immutable `v0.7.0` tag.

This change does not create or mutate any of those external controls. At review
time immutable releases were disabled, the required environments/ruleset/App
were not configured, and the PyPI project did not yet exist; a pending Trusted
Publisher supports that first OIDC publication. Keep
`SEMANTIC_RELEASE_ENABLED` unset until the full checklist is configured and a
generic-token rejection plus dedicated-App promotion have been exercised in an
isolated validation. A missing switch, control, baseline tag, test, build,
metadata check, source identity, or artifact hash stops before publication. The
final release receipt is the discoverable boundary for downstream
qualification; polling and recovery from a missed notification belong to that
downstream system.
- an environment named exactly `source-promotion`, restricted to the `main`
branch, contains secret `SOURCE_PROMOTION_TOKEN`. Use an approved PAT or
existing GitHub credential with repository Administration read and Contents
write access. The two guarded steps pass it as `GH_TOKEN`; they fail before
any operation if it is absent. No App client ID or private key is required;
- the source-promotion identity is authorized under the repository's branch
and tag policies. A PAT does not inherently bypass those policies, and this
workflow must not remove protections or grant a generic Actions bypass;
- the source baseline has its reviewed, matching immutable version tag.

Prefer a repository-limited fine-grained PAT. Reusing an operator credential
retains that credential's existing scopes; the environment restriction limits
where it is available, not what it can access. Keep it confined to the two
guarded jobs, never the source-testing/build jobs. Provision it through the
secure secret-management path, not plaintext files, command-line arguments, or
workflow logs. Branch rulesets are managed separately; this credential change
does not create a bypass.

`GH_TOKEN` is a CLI environment variable, not a token type. The default Actions
`GITHUB_TOKEN` still handles the final GitHub Release, but is not a fallback
for this Administration-read/source-promotion credential. PyPI publication
continues to use OIDC, not the GitHub token.

A missing switch, credential, control, baseline tag, test, build, metadata
check, source identity, or artifact hash stops before publication. The final
release receipt is the discoverable boundary for downstream qualification;
source/build success alone is insufficient. Polling and recovery from a
missed notification belong to that downstream system.

## License

Expand Down
Loading
Loading