Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5c506b
chore(release): prepare Surfaces previews for Core alpha.1
tercel Nov 27, 2026
203baac
chore(release): lock Rust surfaces to the verified Core crate
tercel Nov 27, 2026
dfd631c
chore(release): bind the CLI preview to the verified Toolkit crate
tercel Nov 27, 2026
709d4de
chore(release): lock MCP and A2A for Rust 1.86
tercel Nov 27, 2026
6bf5956
ci: allow the Core candidate to verify Surfaces artifacts
tercel Nov 27, 2026
16bac90
test(toolkit): account for TCP reset during listener shutdown
tercel Nov 27, 2026
1ae1998
chore(release): relock Rust surfaces against the verified Toolkit arc…
tercel Nov 27, 2026
bceddb7
test(toolkit): consolidate enabled environment checks
tercel Nov 27, 2026
79ab473
chore(release): bind Rust surfaces to the refreshed Toolkit crate
tercel Nov 27, 2026
2eca45d
fix(a2a): recover settled outcomes after SSE queue eviction
tercel Nov 27, 2026
e6f64b6
fix(mcp): preserve unary tool results with progress
tercel Nov 27, 2026
aadb5d5
fix(mcp): complete cleanup when requests are canceled
tercel Nov 27, 2026
184cc1d
fix(a2a): scope active Rust tasks to their owner
tercel Nov 27, 2026
ad256fd
fix(a2a): release Python terminal claims after save failure
tercel Nov 27, 2026
adb3ce7
fix(a2a): coordinate TypeScript task terminal outcomes
tercel Nov 27, 2026
cf2f2f5
docs(toolkit): clarify Prometheus shutdown timing
tercel Nov 27, 2026
d27d933
fix(cli): preserve nullable container flags across SDKs
tercel Nov 27, 2026
ecee2cf
chore(release): lock Rust surfaces to the reviewed Toolkit crate
tercel Nov 27, 2026
40aec69
fix(cli): accept explicit null for required nullable fields
tercel Nov 27, 2026
148af51
fix(mcp): forward documented Rust wire version hints
tercel Nov 27, 2026
c42ecd4
fix(cli): audit closed output pipes in strict streaming
tercel Nov 27, 2026
3e8705d
fix(mcp): bind Python version hints to the published tool contract
tercel Nov 27, 2026
52d250a
fix(toolkit): verify TypeScript proxy registration after it settles
tercel Nov 27, 2026
17968fa
feat(mcp): store scoped Python approval grants atomically
tercel Nov 27, 2026
f445584
fix(mcp): wire Python scoped approval through the tool transport
tercel Nov 27, 2026
e6c69ba
fix(mcp): enforce scoped approval resumption in Rust
tercel Nov 27, 2026
f099ed8
fix(mcp): enforce scoped approval resumption in TypeScript
tercel Nov 27, 2026
329ce88
docs(mcp): describe the scoped approval wire contract
tercel Nov 27, 2026
d80659c
ci: pin the Golden Path separately from Core distributions
tercel Nov 27, 2026
1247d6e
fix(mcp): validate TypeScript scoped approval wiring
tercel Nov 27, 2026
ea64075
fix(mcp): protect Python approval diagnostics
tercel Nov 27, 2026
670d971
fix(mcp): bind Rust scoped approvals to tool calls
tercel Nov 27, 2026
fa3ab78
docs(mcp): clarify scoped approval configuration
tercel Nov 27, 2026
8f7357a
ci(python): verify Surfaces wheels with local Toolkit
tercel Nov 27, 2026
18ae2bb
ci(rust): verify Surfaces crates with pinned prereleases
tercel Nov 27, 2026
18946f7
ci(typescript): test unpublished Toolkit with local archives
tercel Nov 27, 2026
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
421 changes: 421 additions & 0 deletions .github/workflows/core-candidate.yml

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ jobs:
python -m build
- name: Install and import the built wheel in isolation
shell: bash
env:
COMPONENT: ${{ matrix.component }}
run: |
wheel=( "$PWD"/dist/*.whl )
wheels=( "$PWD"/dist/*.whl )
temporary=$(mktemp -d)
if [[ "$COMPONENT" == a2a || "$COMPONENT" == cli ]]; then
python -m build --wheel --outdir "$temporary/wheels" "$GITHUB_WORKSPACE/toolkit/python"
wheels+=( "$temporary"/wheels/apcore_toolkit-*.whl )
fi
python -m venv "$temporary/venv"
cd "$temporary"
"$temporary/venv/bin/python" -m pip install "${wheel[0]}"
"$temporary/venv/bin/python" -m pip install "${wheels[@]}"
"$temporary/venv/bin/python" -m pip check
"$temporary/venv/bin/python" -c 'import importlib, sys; importlib.import_module("apcore_" + sys.argv[1])' "${{ matrix.component }}"
"$temporary/venv/bin/python" -c 'import importlib, sys; importlib.import_module("apcore_" + sys.argv[1])' "$COMPONENT"
79 changes: 55 additions & 24 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ on:
- '*/rust/**'
- '*/conformance/**'
- '.github/workflows/rust.yml'
- 'scripts/verify-rust-surface.py'
pull_request:
paths:
- '*/rust/**'
- '*/conformance/**'
- '.github/workflows/rust.yml'
- 'scripts/verify-rust-surface.py'
workflow_dispatch:

permissions:
contents: read

env:
# The released lockfiles already reference these prereleases. Bootstrap CI
# from the reviewed Core commit while those versions are unpublished.
CORE_REF: b28e1bfd01b804c8662e9e418d8487d0e08cc0ce
CORE_CRATE_VERSION: 1.0.0-alpha.1
CORE_CRATE_SHA256: bbc1db3680f3d81b7096fa5eb70476a2c043b333681c2a7bba3597a49bbf11f6

jobs:
source:
name: Rust source tests (${{ matrix.component }})
Expand All @@ -34,6 +43,14 @@ jobs:
working-directory: ${{ matrix.component }}/rust
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: aiperceivable/apcore
ref: ${{ env.CORE_REF }}
path: .ci-apcore-core
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.12"
Expand All @@ -48,31 +65,14 @@ jobs:
${{ matrix.component }}/rust/target
key: ${{ runner.os }}-cargo-${{ matrix.component }}-${{ hashFiles('*/rust/Cargo.lock') }}
- run: cargo fmt --all -- --check
- name: Check and test toolkit
if: matrix.component == 'toolkit'
run: |
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo test --locked --all-features
cargo check --locked --no-default-features
- name: Check and test the surface against this checkout's toolkit
if: matrix.component != 'toolkit'
- name: Check and test against the pinned Core and checkout Toolkit
shell: bash
env:
COMPONENT: ${{ matrix.component }}
run: |
patch="patch.crates-io.apcore-toolkit.path='$GITHUB_WORKSPACE/toolkit/rust'"
cargo --config "$patch" metadata --format-version 1 | python -c '
import json, sys
from pathlib import Path
expected = (Path(sys.argv[1]) / "toolkit/rust/Cargo.toml").resolve()
packages = [p for p in json.load(sys.stdin)["packages"] if p["name"] == "apcore-toolkit"]
if len(packages) != 1 or Path(packages[0]["manifest_path"]).resolve() != expected:
raise SystemExit("Consumer did not resolve the toolkit from this checkout")
' "$GITHUB_WORKSPACE"
cargo --config "$patch" clippy --all-targets --all-features -- -D warnings
cargo --config "$patch" test --all-features
cargo --config "$patch" build --examples
if [[ "${{ matrix.component }}" == a2a ]]; then
cargo --config "$patch" check --no-default-features
fi
git -C "$GITHUB_WORKSPACE/.ci-apcore-core" rev-parse HEAD
python "$GITHUB_WORKSPACE/scripts/verify-rust-surface.py" "$COMPONENT" source \
"$GITHUB_WORKSPACE/.ci-apcore-core/rust"

package:
name: Rust crate verification (${{ matrix.component }})
Expand All @@ -86,5 +86,36 @@ jobs:
working-directory: ${{ matrix.component }}/rust
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: aiperceivable/apcore
ref: ${{ env.CORE_REF }}
path: .ci-apcore-core
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- run: cargo package --locked
- name: Build and verify the pinned Core archive digest
working-directory: .ci-apcore-core/rust
shell: bash
env:
CARGO_TARGET_DIR: ${{ runner.temp }}/core-dependency-target
run: |
git rev-parse HEAD
rustup toolchain install 1.86.0 --profile minimal
# Core was already verified upstream. Reproduce the same archive.
cargo +1.86.0 package --locked --all-features --no-verify
archive="$CARGO_TARGET_DIR/package/apcore-$CORE_CRATE_VERSION.crate"
printf '%s %s\n' "$CORE_CRATE_SHA256" "$archive" | sha256sum --check
mkdir "$RUNNER_TEMP/core-dependency"
tar -xzf "$archive" --strip-components=1 -C "$RUNNER_TEMP/core-dependency"
- name: Package and verify the Surface crate
shell: bash
env:
COMPONENT: ${{ matrix.component }}
run: |
python "$GITHUB_WORKSPACE/scripts/verify-rust-surface.py" "$COMPONENT" package \
"$RUNNER_TEMP/core-dependency"
65 changes: 50 additions & 15 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,43 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: '10.30.1'
- name: Install pinned dependencies
run: pnpm install --frozen-lockfile
- name: Build and link the toolkit from this checkout
if: matrix.component != 'toolkit'
- &install-dependencies
name: Install dependencies with the checkout's Toolkit
shell: bash
run: |
toolkit="$GITHUB_WORKSPACE/toolkit/typescript"
if [[ "$PWD" == "$toolkit" ]]; then
pnpm install --frozen-lockfile
exit
fi

pnpm --dir "$toolkit" install --frozen-lockfile
pnpm --dir "$toolkit" build
pnpm link "$toolkit"
node --input-type=module <<'JS'

# Use the local Toolkit before pnpm attempts to fetch the registry
# artifact. Restore both inputs before running build or pack.
saved=$(mktemp -d)
cp package.json pnpm-lock.yaml "$saved/"
trap 'cp "$saved/package.json" "$saved/pnpm-lock.yaml" .; rm -rf "$saved"' EXIT
TOOLKIT="$toolkit" node --input-type=module <<'JS'
import { readFileSync, writeFileSync } from 'node:fs';

const file = 'package.json';
const manifest = JSON.parse(readFileSync(file, 'utf8'));
manifest.pnpm ??= {};
manifest.pnpm.overrides ??= {};
manifest.pnpm.overrides['apcore-toolkit'] = 'link:' + process.env.TOOLKIT;
writeFileSync(file, JSON.stringify(manifest, null, 2) + '\n');
JS
pnpm install --no-frozen-lockfile
TOOLKIT="$toolkit" node --input-type=module <<'JS'
import assert from 'node:assert/strict';
import { realpathSync } from 'node:fs';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const expected = realpathSync(resolve(process.env.GITHUB_WORKSPACE, 'toolkit/typescript/dist/index.js'));
if (realpathSync(fileURLToPath(import.meta.resolve('apcore-toolkit'))) !== expected) {
throw new Error('Consumer did not resolve the toolkit from this checkout');
}

const expected = realpathSync(resolve(process.env.TOOLKIT, 'dist/index.js'));
assert.equal(realpathSync(fileURLToPath(import.meta.resolve('apcore-toolkit'))), expected);
JS
- name: Run the toolkit source checks
if: matrix.component == 'toolkit'
Expand Down Expand Up @@ -86,19 +106,34 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: '10.30.1'
- run: pnpm install --frozen-lockfile
- *install-dependencies
- run: pnpm build
- name: Pack and install as an external consumer
shell: bash
env:
COMPONENT: ${{ matrix.component }}
run: |
temporary=$(mktemp -d)
pnpm pack --pack-destination "$temporary"
archive=( "$temporary"/*.tgz )
if [[ "$COMPONENT" != toolkit ]]; then
toolkit="$GITHUB_WORKSPACE/toolkit/typescript"
pnpm --dir "$toolkit" pack --pack-destination "$temporary"
fi
archives=( "$temporary"/*.tgz )
toolkit_archive=( "$temporary"/apcore-toolkit-*.tgz )
cd "$temporary"
npm init -y
npm install "${archive[0]}"
node --input-type=module - 'apcore-${{ matrix.component }}' <<'JS'
const name = process.argv[2];
npm install "${archives[@]}"
node --input-type=module - "apcore-$COMPONENT" "${toolkit_archive[0]}" <<'JS'
import assert from 'node:assert/strict';
import { readFileSync, realpathSync } from 'node:fs';
import { resolve } from 'node:path';

const [, , name, toolkitArchive] = process.argv;
const lock = JSON.parse(readFileSync('package-lock.json', 'utf8'));
const lockedToolkit = lock.packages['node_modules/apcore-toolkit'].resolved;
assert.ok(lockedToolkit.startsWith('file:'));
assert.equal(realpathSync(resolve(lockedToolkit.slice('file:'.length))), realpathSync(toolkitArchive));
await import(name);
if (name === 'apcore-toolkit') await import(name + '/browser');
JS
2 changes: 2 additions & 0 deletions a2a/conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ every SDK's conformance runner.
| `fixtures/part_conversion.json` | A-PART | A2A `Part` ⇄ module input/output conversion |
| `fixtures/openapi_backend.json` | A-OAS | OpenAPI backend (feature F-12), contract 2.0 (apcore-toolkit >= 0.13.0): registered IDs are the scanner's own, illegal IDs skipped with a warning, the empty-description repair and its report, the path-typed `spec` key, the unapproved-write warning, the collision preflight, public-card exposure |

The separate [event subscriber fixture](fixtures/event_subscriber.json) checks the opt-in A2A event POST transport through the Core subscriber factory and a local HTTP receiver. The cases cover configuration, single delivery, headers, retries, timeouts, circuit breaking, dead letters and filter delegation.

### JSON-RPC Error Code Table

| Code | A2A meaning | apcore source exception |
Expand Down
56 changes: 56 additions & 0 deletions a2a/conformance/fixtures/event_subscriber.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"description": "A2A event delivery through the Core subscriber factory",
"contract_version": "1.0",
"event": {
"event_type": "example.updated",
"module_id": "example.module",
"timestamp": "2026-01-01T00:00:00+00:00",
"severity": "info",
"data": { "value": 42 }
},
"test_cases": [
{
"id": "bearer_success",
"subscriber": { "type": "a2a", "auth": "test-token" },
"status": 204,
"expected": { "requests": 1, "authorization": "Bearer test-token", "skill_id": "apevo.event_receiver", "dead_letters": 0, "circuit_opened": 0 }
},
{
"id": "headers_permanent_failure",
"subscriber": { "type": "a2a", "auth": { "Authorization": "Basic test", "X-Source": "test" }, "skill_id": "example.receiver" },
"status": 403,
"expected": { "requests": 1, "authorization": "Basic test", "source": "test", "skill_id": "example.receiver", "dead_letters": 0, "circuit_opened": 0 }
},
{
"id": "transient_failure",
"subscriber": { "type": "a2a", "retry": { "max_attempts": 2, "initial_backoff_ms": 1 } },
"status": 503,
"expected": { "requests": 2, "skill_id": "apevo.event_receiver", "dead_letters": 1, "circuit_opened": 0 }
},
{
"id": "circuit_breaker",
"subscriber": { "type": "a2a", "retry": { "max_attempts": 3, "initial_backoff_ms": 1 }, "circuit_breaker": { "open_threshold": 1 } },
"status": 503,
"expected": { "requests": 1, "skill_id": "apevo.event_receiver", "dead_letters": 1, "circuit_opened": 1 }
},
{
"id": "timeout",
"subscriber": { "type": "a2a", "timeout_ms": 200, "retry": { "max_attempts": 1 } },
"status": 204,
"delay_ms": 900,
"expected": { "requests": 1, "skill_id": "apevo.event_receiver", "dead_letters": 1, "circuit_opened": 0 }
},
{
"id": "filtered_out",
"subscriber": { "type": "filter", "delegate_type": "a2a", "include_events": ["other.*"] },
"status": 204,
"expected": { "requests": 0, "dead_letters": 0, "circuit_opened": 0 }
},
{
"id": "filter_delegates_once",
"subscriber": { "type": "filter", "delegate_type": "a2a", "include_events": ["example.*"] },
"status": 204,
"expected": { "requests": 1, "skill_id": "apevo.event_receiver", "dead_letters": 0, "circuit_opened": 0 }
}
]
}
41 changes: 16 additions & 25 deletions a2a/docs/features/openapi-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,9 @@ and the `derive_module_id` / `transform_module` hooks — so a `prefix` of `Pet-
4. One skipped operation MUST NOT fail the scan; sibling operations still register.

!!! note "Why skip, when the registry would refuse it anyway"
Handed to `HTTPProxyRegistryWriter`, an illegal ID is rejected by apcore's registry, so the
module never registers either way. But it surfaces as a per-module write-failure **ERROR**
rather than as a report naming the segment and the remedy, and — worse — it is still in the
set every later diagnostic reads: FR-OAS-003's report counts it, FR-OAS-005 warns about a write
operation that will never be on the card, and the zero-modules warning stays silent for a
document none of whose operations registered. Skipping first keeps every diagnostic about the
modules that are actually served.
The scanner can report the specific invalid segment and the remedy before the registry
rejects it. Skipping at that stage lets the bridge accurately report how many modules will
register, which descriptions it synthesized, and which write operations will be served.

**Collisions created by the naming rule are the scanner's to resolve.** `listPets` and `list-pets`
are two distinct operations to OpenAPI and one module ID to apcore (`list_pets`). The toolkit
Expand Down Expand Up @@ -619,16 +615,17 @@ Builds a `Registry` from an OpenAPI document.
| No usable `base_url` | `ValueError` naming both the document and the config key |
| Derived `module_id` collides with a module already in the registry | `ValueError` naming **every** colliding ID, sorted and deduplicated, before anything is written — reporting only the first forces one restart per collision |
| A selected operation cannot be forwarded | Backend construction fails before registration, naming the operation and reason |
| A selected operation fails to register | Backend construction fails, naming each failed or absent module and its diagnostic |

Two failures are deliberately **not** errors: a module whose emitted ID apcore's registry would
reject is skipped with a WARNING (FR-OAS-002), and a per-module write failure is logged at ERROR
while the remaining modules still register. Neither leaves the registry partially populated with respect to the *set* the
preflight approved.
A module with an unprojectable ID is skipped with a WARNING (FR-OAS-002) before determining
which modules must register. The bridge checks each selected ID against the writer results
and the registry. TypeScript waits for pending host registration promises.

### Returns

A populated `Registry`. Never a partially-populated one: the collision preflight and every
validation run before the first `write`.
A populated `Registry` on success. A registration failure can occur after some selected modules
have been written. Assemble in a startup-owned registry and publish it only after backend
construction succeeds.

### Properties

Expand All @@ -639,8 +636,8 @@ validation run before the first `write`.
- **Emits**, in this order, before returning: the FR-OAS-002 illegal-ID skip WARNINGs, the scanner's
per-module warnings for every module that will register (a skipped module's own toolkit legality
warning is not repeated beside its skip line), a zero-modules-produced WARNING, the FR-OAS-003
description-fallback INFO line, per-module write-failure ERRORs (non-fatal), and the FR-OAS-005
unapproved-write WARNING.
description-fallback INFO line, and the FR-OAS-005 unapproved-write WARNING after registration
succeeds.
- **Every registered module ID is apcore-legal**, and every registered module carries a non-empty
description. These two invariants are what FR-OAS-002 and FR-OAS-003 exist to hold, and they are
the reason the backend cannot be a thin `scan`-then-`write` call.
Expand All @@ -649,31 +646,25 @@ validation run before the first `write`.

## Canonical diagnostic text

The six report sites emit at levels that are already normative and identical across the three
SDKs. Their **text** drifted, and a cross-language audit found five of the six carrying
different facts rather than different phrasing — Python's drop message (now the FR-OAS-002 skip
message) named no remedy, its collision error did not say the registry was untouched, and its no-`base_url` error
did not say what breaks. Each of those is a fact the operator needs and one binding withheld.

The table fixes what each message must **contain**. Wording may differ where a language must
name its own API; the listed facts may not go missing.
The three SDKs report at the same levels and include the facts listed below. Each SDK uses
its own public API names in diagnostic messages.

| Site | Level | MUST contain |
|---|---|---|
| Illegal-ID skip (FR-OAS-002) | `warn` | the emitted ID; the offending segment, separately identifiable from the ID; the required segment pattern `^[a-z][a-z0-9_]*$`; and the remedy — supply a `derive_module_id` / `transform_module` hook (spelled in the host language) |
| Per-module scanner warning | `warn` | the module ID and the scanner's own text, unmodified |
| Zero modules produced | `warn` | that the Agent Card will have no skills |
| Description synthesis (FR-OAS-003) | `info` | the count, the denominator (modules `scan` returned), and every affected ID **as emitted** — after normalisation and deduplication |
| Per-module write failure | `error` | the module ID and the writer's `verification_error` |
| Unapproved writes (FR-OAS-005) | `warn` | the count; the methods; the public Agent Card **and its path**; the three remedies |

And for the three fatal errors:
Fatal errors contain the following details:

| Error | MUST contain |
|---|---|
| ID collision (FR-OAS-006) | every colliding ID, sorted and deduplicated; **"Nothing was registered."**; and the `prefix` remedy |
| No `base_url` | that the document has no usable absolute `servers[0].url`, **that every proxied call would otherwise resolve against an unknown host**, and the config key to set |
| Missing `prefix` in a mixed deployment | the key `prefix`, and why — a derived ID can collide with a project module ID |
| Incomplete registration | each failed or absent module ID and the available registration error |

!!! note "Why the required-pattern fragment is in the skip message"
An operator reading *"the derived module ID has a segment (`2fa`) apcore's registry cannot
Expand Down
Loading
Loading