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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 13 additions & 32 deletions .github/workflows/case-pinning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,53 +40,33 @@ jobs:
timeout-minutes: 150
steps:
- uses: actions/checkout@v4
with:
path: apcore

# The sweep runs the real drivers, so all three SDKs must be present and
# buildable. A missing checkout is not a pass: the tool raises NoTestsRan
# rather than reading "no tests ran" as "nothing went red", which is the
# bug that manufactured its own first Rust result.
- uses: actions/checkout@v4
with:
repository: aiperceivable/apcore-python
path: apcore-python
- uses: actions/checkout@v4
with:
repository: aiperceivable/apcore-typescript
path: apcore-typescript
- uses: actions/checkout@v4
with:
repository: aiperceivable/apcore-rust
path: apcore-rust

- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: pnpm/action-setup@v4
with:
version: 9
version: 10
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
cache: pnpm
cache-dependency-path: apcore-typescript/pnpm-lock.yaml
cache-dependency-path: typescript/pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable

- name: Test the mutation checker
working-directory: apcore
run: python3 -m unittest conformance.test_check_case_pinning -v

- name: Install SDKs
run: |
python3 -m pip install --quiet -e apcore-python[dev]
pnpm --dir apcore-typescript install --frozen-lockfile
cargo build --manifest-path apcore-rust/Cargo.toml --tests --all-features
python3 -m pip install --quiet -e "./python[dev]"
pnpm --dir typescript install --frozen-lockfile
cargo build --manifest-path rust/Cargo.toml --tests --all-features

# Warm the Rust build so the first mutated case is not charged for a full
# compile inside the per-case timeout.
- name: Prebuild Rust tests
run: cargo test --manifest-path apcore-rust/Cargo.toml --all-features --no-run
run: cargo test --manifest-path rust/Cargo.toml --all-features --no-run

# Four scopes. `any` is the weak question — does SOME driver run this case —
# and it is kept because a wholly dead case fails it first and cheapest.
Expand All @@ -97,20 +77,21 @@ jobs:
# positive cases were fixed in apcore-python and stayed broken in the other
# two for exactly that reason (apcore#93).
- name: Every fixture case is run by some driver, and by each of them
working-directory: apcore
# The baseline is EMPTY: all 651 measurable cases are pinned as of
# apcore#92. The diff below therefore fails on the first case that stops
# being pinned, which is the state this job exists to hold. If the
# baseline ever gains entries again, they are a backlog to shrink, not a
# permanent exemption.
env:
FIXTURE: ${{ inputs.fixture }}
ONLY: ${{ inputs.sdk }}
shell: bash
run: |
FIXTURE="${{ github.event.inputs.fixture }}"
ONLY="${{ github.event.inputs.sdk }}"
: > pinning.txt
for scope in any python typescript rust; do
[ -n "$ONLY" ] && [ "$scope" != "$ONLY" ] && continue
echo "===== scope: $scope" | tee -a pinning.txt
python3 conformance/check_case_pinning.py --sdk-root .. \
python3 conformance/check_case_pinning.py --sdk-root . \
${FIXTURE:+--fixture "$FIXTURE"} \
$([ "$scope" != any ] && echo "--sdk $scope") | tee -a pinning.txt
done
Expand Down Expand Up @@ -154,4 +135,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: case-pinning
path: apcore/pinning.txt
path: pinning.txt
41 changes: 7 additions & 34 deletions .github/workflows/conformance-integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
# of them a configuration version, each stale the moment the next
# release shipped. A reader copies the number and takes it for
# something they must keep in step with their dependency.
run: python3 conformance/check_config_version_examples.py --sdk-root ..
run: python3 conformance/check_config_version_examples.py --sdk-root .

- name: config_key_governance.json is in sync with schemas/
run: python3 conformance/generate_config_key_governance.py
Expand All @@ -224,37 +224,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: apcore

- uses: actions/checkout@v4
with:
repository: aiperceivable/apcore-python
path: apcore-python
continue-on-error: true

- uses: actions/checkout@v4
with:
repository: aiperceivable/apcore-typescript
path: apcore-typescript
continue-on-error: true

- uses: actions/checkout@v4
with:
repository: aiperceivable/apcore-rust
path: apcore-rust
continue-on-error: true

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Every symbol the docs import resolves against the SDK
working-directory: apcore
run: python3 conformance/check_doc_examples.py --sdk-root ..
run: python3 conformance/check_doc_examples.py --sdk-root .

- name: Every `expected` key is asserted by a driver
working-directory: apcore
# --strict, because the backlog is closed: every top-level `expected`
# key is asserted by at least one driver. A key no driver reads is not
# a contract — it reads as covered everywhere while nothing is checked.
Expand All @@ -268,7 +246,7 @@ jobs:
# This is the guard that would have caught `wrapped_in`, declared by the
# fixture and read by nobody, which let the MiddlewareChainError
# wrapping be removed from two SDKs with every test still green.
run: python3 conformance/check_expected_keys_read.py --strict --sdk-root ..
run: python3 conformance/check_expected_keys_read.py --strict --sdk-root .

# The probes below EXECUTE apcore-python. Without its runtime
# dependencies every probe raises ImportError, and this job's whole point
Expand All @@ -279,7 +257,6 @@ jobs:
run: pip install --quiet "pydantic>=2.7,<3" "pyyaml>=6.0,<7" "jsonschema>=4.21,<5"

- name: Every declared config key reaches a consumer
working-directory: apcore
# config_key_governance.json pins that every declared key is ACCEPTED. It
# is generated FROM schemas/, so a key wrong in the schema and in all
# three SDKs identically is invisible to it — the same blind spot the
Expand All @@ -292,10 +269,9 @@ jobs:
# observe an effect OUTSIDE Config: four observability.* keys round-trip
# through Config perfectly and are consumed by nothing, so a set-then-get
# check — the one anybody would write — passes on all four.
run: python3 conformance/check_config_key_consumers.py --sdk-root ..
run: python3 conformance/check_config_key_consumers.py --sdk-root .

- name: The ratchet ledger rejects every way around it
working-directory: apcore
# The ratchet's "may fall, may not rise" lived in a code comment, and the
# first raise under it was made in the same commit that changed the number.
# A ceiling now has to equal the last entry of an append-only ledger, so a
Expand All @@ -305,17 +281,15 @@ jobs:
run: python3 conformance/check_config_key_consumers.py --self-test

- name: Every fixture is driven by all three SDKs
working-directory: apcore
# --strict, because the backlog is closed: all 60 fixtures are driven by
# apcore-python, apcore-typescript AND apcore-rust. A fixture only two
# SDKs load proves two implementations agree, not three — and it reads
# as covered in every inventory. Strict keeps a new fixture from landing
# undriven, which is how the backlog accumulated in the first place.
run: python3 conformance/check_driver_coverage.py --strict --sdk-root ..
run: python3 conformance/check_driver_coverage.py --strict --sdk-root .


- name: Every behavioural decision names an executed case
working-directory: apcore
# --strict, because the ratchet reached ZERO: all 44 behavioural
# decisions from the 2026-09 deep-chain audit are pinned by an executed
# case or by per-SDK tests covering every SDK they bind. The backlog
Expand All @@ -328,10 +302,9 @@ jobs:
# all failures. Those were never backlog — they are the map claiming
# coverage it does not have, the exact failure this audit spent three
# corrections on (D-125, D-126, and D-106's authority attribution).
run: python3 conformance/check_decision_coverage.py --strict --sdk-root ..
run: python3 conformance/check_decision_coverage.py --strict --sdk-root .

- name: A clause one SDK disabled is a claim about that SDK
working-directory: apcore
# NOT --strict: 24 clauses are disabled in one SDK and live in another,
# and several are real API differences rather than defects. What this
# DOES enforce is that the set cannot grow, and that the RECORD cannot
Expand All @@ -350,4 +323,4 @@ jobs:
# `@pytest.mark.skip`. Both directions are pinned in SELF_TEST.
run: |
python3 conformance/check_skip_asymmetry.py --self-test
python3 conformance/check_skip_asymmetry.py --sdk-root ..
python3 conformance/check_skip_asymmetry.py --sdk-root .
92 changes: 92 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Core distribution verification

on:
pull_request:
paths: &sdk-paths
- 'python/**'
- 'rust/**'
- 'typescript/**'
- '.github/workflows/packages.yml'
push:
branches: [main]
paths: *sdk-paths
workflow_dispatch:

permissions:
contents: read

jobs:
python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.12'
- name: Build wheel and sdist
run: |
python -m pip install build
python -m build
- name: Verify installed wheel
shell: bash
run: |
wheel=( "$PWD"/dist/*.whl )
temporary=$(mktemp -d)
python -m venv "$temporary/venv"
cd "$temporary"
"$temporary/venv/bin/python" -m pip install "${wheel[0]}"
"$temporary/venv/bin/python" -m pip check
"$temporary/venv/bin/python" -c 'from apcore import APCore, Registry'
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: core-python-distributions
path: python/dist/

rust:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dtolnay/rust-toolchain@stable
- run: cargo package --locked
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: core-rust-distribution
path: rust/target/package/*.crate

typescript:
runs-on: ubuntu-latest
defaults:
run:
working-directory: typescript
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: pnpm/action-setup@v4
with:
version: '10.30.1'
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Verify packed Node and browser entry points
shell: bash
run: |
temporary=$(mktemp -d)
mkdir -p "$GITHUB_WORKSPACE/dist-archives"
pnpm pack --pack-destination "$GITHUB_WORKSPACE/dist-archives"
archive=( "$GITHUB_WORKSPACE"/dist-archives/*.tgz )
cd "$temporary"
npm init -y
npm install --ignore-scripts "${archive[0]}"
node --input-type=module -e 'import {APCore} from "apcore-js"; import "apcore-js/context-keys"; if (!APCore) throw new Error("APCore is missing");'
node --conditions=browser --input-type=module -e 'if (!import.meta.resolve("apcore-js").endsWith("/dist/browser/index.js")) throw new Error("browser entry did not resolve"); await import("apcore-js");'
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: core-npm-distribution
path: dist-archives/*.tgz
59 changes: 59 additions & 0 deletions .github/workflows/sdk-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Core SDK (python)

permissions:
contents: read

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: python
env:
CONFORMANCE_SPEC_REPO: ${{ github.workspace }}
# container:
# image: python:${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
# Pin CI to a single, consistent Python version to reduce version-related
# test flakiness. Use 3.12 for CI stability; expand matrix later if desired.
python-version: ["3.12"]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: python/pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
# If a constraints.txt file is present, use it to pin critical dependency versions.
if [ -f constraints.txt ]; then
pip install -e ".[dev]" -c constraints.txt
else
pip install -e ".[dev]"
fi

- name: Verify canonical conformance fixture checkout
run: pytest tests/conformance/test_fixture_checkout.py -q

- name: Lint with Ruff
run: |
ruff check src/ tests/

- name: Run tests
run: |
pytest
Loading
Loading