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
12 changes: 12 additions & 0 deletions .github/requirements/framework.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The framework's runtime dependencies, installed hash-pinned before the framework itself
# (`pip install --no-deps --no-build-isolation ./framework`). Mirrors `dependencies` in
# open-coder-ai/chock's pyproject.toml at the ref chock-catalog/.framework-ref names, plus
# its build backend. If that ref changes them, `pip check` in the workflow fails and this
# file is updated and recompiled:
# pip-compile --allow-unsafe --generate-hashes --strip-extras \
# --output-file=.github/requirements/framework.txt .github/requirements/framework.in
pyyaml>=6.0
jsonschema>=4.18,<5
referencing>=0.35,<0.38
agentseam==0.3.5
setuptools>=77
248 changes: 248 additions & 0 deletions .github/requirements/framework.txt

Large diffs are not rendered by default.

140 changes: 140 additions & 0 deletions .github/validator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .github/validator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "chock-plugin-validator",
"private": true,
"description": "Pins the Claude Code CLI whose `claude plugin validate` checks every package; installed with `npm ci` so the lockfile's integrity hashes are enforced.",
"dependencies": {
"@anthropic-ai/claude-code": "2.1.239"
}
}
23 changes: 18 additions & 5 deletions .github/workflows/generated-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ jobs:
python-version: '3.12'

- name: Install the framework from source
run: pip install ./framework
# Dependencies come hash-pinned from this repo's lock; the framework itself is the
# checkout above, built into a wheel with the locked build backend and installed with
# --no-deps, so pip resolves nothing unpinned. `pip check` fails closed if the
# framework ref declares a dependency the lock does not satisfy.
run: |
pip install --require-hashes -r dist/.github/requirements/framework.txt
pip wheel --no-deps --no-build-isolation --wheel-dir wheels ./framework
pip install --no-deps wheels/*.whl
pip check

- name: Verify the lockfile and index match the published tree
working-directory: dist
Expand All @@ -89,11 +97,16 @@ jobs:
- name: Validate every package with Claude Code's own validator
run: |
# Pinned: this binary IS the verification step, so a floating version means the
# check itself changes under us without review.
npm install -g @anthropic-ai/claude-code@2.1.239
# check itself changes under us without review. `npm ci` enforces the lockfile's
# integrity hashes; it installs outside dist so nothing lands in the published tree.
validator="$RUNNER_TEMP/validator"
mkdir -p "$validator"
cp dist/.github/validator/package.json dist/.github/validator/package-lock.json "$validator/"
npm ci --prefix "$validator"
claude="$validator/node_modules/.bin/claude"
failed=0
for d in dist/claude/*/; do
claude plugin validate "$d" || failed=1
"$claude" plugin validate "$d" || failed=1
done
claude plugin validate dist || failed=1
"$claude" plugin validate dist || failed=1
exit $failed
29 changes: 23 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ on:
default: true

permissions:
contents: write
contents: read

jobs:
publish:
runs-on: ubuntu-latest
permissions:
# The one write this repository's automation needs: the job commits and pushes the
# regenerated tree. Scoped to this job rather than the workflow.
contents: write
steps:
- name: Check out this distribution repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Expand Down Expand Up @@ -99,7 +103,15 @@ jobs:
python-version: '3.12'

- name: Install the framework
run: pip install ./framework
# Dependencies come hash-pinned from this repo's lock; the framework itself is the
# checkout above, built into a wheel with the locked build backend and installed with
# --no-deps, so pip resolves nothing unpinned. `pip check` fails closed if the
# framework ref declares a dependency the lock does not satisfy.
run: |
pip install --require-hashes -r dist/.github/requirements/framework.txt
pip wheel --no-deps --no-build-isolation --wheel-dir wheels ./framework
pip install --no-deps wheels/*.whl
pip check

# A policy that cannot prove its claims does not get distributed. Running the
# catalog's own bar again here means a broken policy cannot reach users through a ref
Expand All @@ -126,13 +138,18 @@ jobs:
- name: Validate every package
run: |
# Pinned: this binary IS the verification step, so a floating version means the
# check itself changes under us without review.
npm install -g @anthropic-ai/claude-code@2.1.239
# check itself changes under us without review. `npm ci` enforces the lockfile's
# integrity hashes; it installs outside dist so nothing lands in the published tree.
validator="$RUNNER_TEMP/validator"
mkdir -p "$validator"
cp dist/.github/validator/package.json dist/.github/validator/package-lock.json "$validator/"
npm ci --prefix "$validator"
claude="$validator/node_modules/.bin/claude"
failed=0
for d in dist/claude/*/; do
claude plugin validate "$d" || failed=1
"$claude" plugin validate "$d" || failed=1
done
claude plugin validate dist || failed=1
"$claude" plugin validate dist || failed=1
exit $failed

- name: Show what would change
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Security checks

# zizmor audits the workflows (adoption-day: two input-injection sites in publish.yml,
# six credential-persisting checkouts, and two unpinned validator installs -- all fixed;
# the three deliberate exceptions live in .github/zizmor.yml with their reasons).
# the two deliberate exceptions live in .github/zizmor.yml with their reasons).
# actionlint checks workflow correctness. ShellCheck is deliberately NOT run here: every
# shell script in this repository is generated from the catalog and verified
# byte-identical to its source by the generated-only check, and the catalog lints the
Expand Down
8 changes: 0 additions & 8 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ rules:
# Credential persistence there is the mechanism, not an oversight.
ignore:
- publish.yml
adhoc-packages:
# The claude-code CLI is npm-installed to run `claude plugin validate` -- there is no
# lockfile to install it from in a repo that contains no Node project. The material
# risk (a floating version changing the verification under us) is addressed by
# pinning the exact version in both install lines.
ignore:
- generated-only.yml
- publish.yml
Loading