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
8 changes: 4 additions & 4 deletions .github/workflows/agentrust-codex-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions:
contents: read

jobs:
stdlib:
drift-without-signing:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -32,9 +32,9 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "${{ matrix.python-version }}"
- name: Run dependency-free capture tests
- name: Run capture tests without the signing packages
run: |
pip install pytest
pip install ./packages/agentrust-capture-core pytest
python -m pytest plugins/agentrust-codex/tests -q

signing:
Expand All @@ -52,7 +52,7 @@ jobs:
python-version: "${{ matrix.python-version }}"
- name: Run signing and conformance tests
run: |
pip install pytest -r plugins/agentrust-codex/requirements.txt
pip install ./packages/agentrust-capture-core pytest -r plugins/agentrust-codex/requirements.txt
python -m pytest plugins/agentrust-codex/tests -q

structure:
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/capture-core-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,9 @@ jobs:
exit 1
fi

# The vendored copies inside each engine must match what is about to be
# published, or the installed path and the fallback path would ship different
# code under the same version.
consistency:
name: Vendored copies match the package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- run: python scripts/sync_vendored_core.py --check

build:
name: Build distribution
needs: [guard, consistency]
needs: [guard]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
63 changes: 34 additions & 29 deletions .github/workflows/capture-core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ on:
pull_request:
paths:
- "packages/agentrust-capture-core/**"
- "scripts/sync_vendored_core.py"
- "**/_vendor/agentrust_capture_core/**"
- ".github/workflows/capture-core-tests.yml"
push:
branches: [main]
paths:
- "packages/agentrust-capture-core/**"
- "scripts/sync_vendored_core.py"
- "**/_vendor/agentrust_capture_core/**"
- ".github/workflows/capture-core-tests.yml"

permissions:
Expand Down Expand Up @@ -40,10 +36,10 @@ jobs:
pip install pytest
python -m pytest tests -q

# Each engine keeps a pinned copy of the core so a bare plugin install still
# gets drift detection. Copies are free to rot, which is the failure this whole
# package exists to end, so they are generated and checked rather than trusted.
vendored-in-sync:
# The engines import the core as a hard dependency now, so the thing worth
# proving is that a fresh install of the built package actually satisfies every
# engine. Previously this job asserted the opposite, that they worked WITHOUT it.
engines-import-against-the-installed-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -52,35 +48,44 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Vendored copies must match the package
run: python scripts/sync_vendored_core.py --check

# The fallback is the path most users are on, since it is what runs before any
# pip install. Exercising it explicitly stops it rotting behind the installed
# path, which nothing else would catch.
bare-install-fallback:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Engines must import with the core NOT installed
- name: Install the core from source, then import every engine
run: |
pip install ./packages/agentrust-capture-core
python - <<'PY'
import importlib.util, sys
assert importlib.util.find_spec("agentrust_capture_core") is None, (
"the core is installed; this job must test the vendored fallback"
)
import importlib.util
for path in (
"claude-code/engine/capture.py",
"plugins/agentrust-codex/engine/capture.py",
"scheduled-agents/engine/capture.py",
"copilot/engine/capture.py",
):
spec = importlib.util.spec_from_file_location("cap_" + path.replace("/", "_"), path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
print("ok:", path)
assert "_vendor" not in module.core.__file__, path + " still loaded a vendored copy"
print("ok:", path, "->", module.core.__version__)
PY

# A missing core must fail loudly. The engines previously fell back to a vendored
# copy; now they must tell the user what to install rather than emitting a vague
# "integrity check skipped".
missing-core-fails-clearly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Engine must name the missing package
run: |
set +e
out="$(python claude-code/engine/capture.py verify 2>&1)"
code=$?
set -e
echo "$out"
if [ "$code" -eq 0 ]; then
echo "::error::engine succeeded without the core installed"; exit 1
fi
echo "$out" | grep -q "pip install agentrust-capture-core" || { echo "::error::error message does not say what to install"; exit 1; }
17 changes: 9 additions & 8 deletions .github/workflows/claude-code-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ permissions:
contents: read

jobs:
# The SessionStart hook and drift check must work with the standard library
# alone. This job installs no crypto packages, so the signing tests skip and
# any accidental dependency on them fails the build.
stdlib:
# The drift path needs only agentrust-capture-core. This job installs no crypto
# packages, so the signing tests skip and any accidental dependency on them fails
# the build. The core is installed from this checkout, not PyPI, so the suite runs
# against the code in the pull request.
drift-without-signing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -27,10 +28,10 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Run stdlib-only tests (no crypto packages)
working-directory: claude-code
- name: Run the drift suite without the signing packages
run: |
pip install pytest
pip install ./packages/agentrust-capture-core pytest
cd claude-code
python -m pytest tests -q

# Full suite including the signing / verification tests, which need the crypto
Expand All @@ -50,5 +51,5 @@ jobs:
- name: Run full suite (with crypto packages)
working-directory: claude-code
run: |
pip install pytest -r requirements.txt
pip install ../packages/agentrust-capture-core pytest -r requirements.txt
python -m pytest tests -q
10 changes: 6 additions & 4 deletions .github/workflows/copilot-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:
jobs:
# Standard library only, so the composite action needs no install step. 3.9 is
# the floor the shared core supports.
stdlib:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -29,10 +29,10 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Run tests with no dependencies installed
working-directory: copilot
- name: Run the suite against the core in this checkout
run: |
pip install pytest
pip install ./packages/agentrust-capture-core pytest
cd copilot
python -m pytest tests -q

# The check runs against this repository, which carries the surfaces it looks
Expand All @@ -47,6 +47,8 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Install the core from this checkout
run: pip install ./packages/agentrust-capture-core
- name: Snapshot this repository's Copilot composition
run: python copilot/engine/capture.py snapshot
- name: Verify against the baseline, reporting without failing
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/scheduled-agents-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ permissions:
contents: read

jobs:
# The SessionStart hook and drift check must work with the standard library
# alone. This job installs no crypto packages, so the signing tests skip and
# any accidental dependency on them fails the build.
stdlib:
# The drift path needs only agentrust-capture-core. This job installs no crypto
# packages, so the signing tests skip and any accidental dependency on them fails
# the build. The core comes from this checkout, not PyPI.
drift-without-signing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -27,10 +27,10 @@ jobs:
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Run stdlib-only tests (no crypto packages)
working-directory: scheduled-agents
- name: Run the drift suite without the signing packages
run: |
pip install pytest
pip install ./packages/agentrust-capture-core pytest
cd scheduled-agents
python -m pytest tests -q

# Full suite including the signing / verification tests, which need the crypto
Expand All @@ -50,5 +50,5 @@ jobs:
- name: Run full suite (with crypto packages)
working-directory: scheduled-agents
run: |
pip install pytest -r requirements.txt
pip install ../packages/agentrust-capture-core pytest -r requirements.txt
python -m pytest tests -q
4 changes: 3 additions & 1 deletion claude-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ I'd know within one session if it wasn't."
```

That's the whole install for drift detection. The SessionStart hook is
dependency-free (Python standard library only), so it never blocks a session.
needs one package, `agentrust-capture-core`, which itself has no dependencies, so
the install stays a single lightweight step rather than a tree. Without it the hook
tells you what to install rather than silently skipping the check.

On your **first** session after install, it records your baseline and tells you:

Expand Down

This file was deleted.

97 changes: 0 additions & 97 deletions claude-code/engine/_vendor/agentrust_capture_core/__init__.py

This file was deleted.

Loading