Repository navigation
Release 0.7.0
Minor release, version-aligned with the Python and TypeScript SDKs. Ships the OpenAPI
Backend (feature F-12): point the adapter at an OpenAPI 3.0/3.1 document and every
operation becomes an A2A Skill, proxied over HTTP to the API that published it, with no
apcore project on the other end.
Suite: 224 tests with --all-features (was 190), 194 without — the 26 that need a spec
fetch or an HTTP proxy writer are behind the feature. cargo clippy --all-targets --all-features -- -D warnings and cargo fmt --all -- --check clean.
Added
-
apcore_a2a::openapi_backend, behind the newopenapicargo feature —
openapi_backend(), the asyncopenapi_backend_from_spec()wrapper (apcore-toolkit-rust's
load_specisasync, so the fetch cannot hide inside a document argument),
project_module_id,is_legal_segment,resolve_spec_location,synthesize_description,
build_openapi_backend_from_configandOpenAPIBackendOptions. All re-exported from the
crate root.The pipeline is
load_spec -> OpenAPIScanner::scan -> HTTPProxyRegistryWriter::write -> Registry, all already-shipped apcore-toolkit code; everything downstream is the adapter
that already serves an extensions directory, unmodified. See
apcore-a2a/docs/features/openapi-backend.md. -
BackendSource::OpenApi { spec, options }. It resolves to(Executor, Some(Registry)),
not(Executor, None):apcore::register_sys_modulestakes an ownedArc<Registry>while
Executor::registry()yields only a&Registry, so returningNonewould silently cost
system.*registration on an OpenAPI-backed server — which is the whole reason the feature
spec makes this source produce aRegistryrather than anExecutor. The registry is
populated before the executor is constructed. -
Two repairs the composition cannot work without.
FR-OAS-002: apcore-toolkit derives
module IDs into[A-Za-z0-9_.-]while apcore'sRegistryaccepts only
^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$— measured against apcore 0.30.0 / apcore-toolkit
0.11.1, the canonical Swagger Petstore scans cleanly, registers nothing, and yields an
Agent Card with zero skills without raising anywhere. A projected ID that still carries an
unrepairable segment (2facannot begin with a digit) drops the module and says so at
WARNING, naming both the derived ID and the segment — the scanner'stransform_modulehook
drops aNonereturn silently, so that report cannot be delegated.FR-OAS-003: an
operation with neithersummarynordescriptionyields"", andAgentCardBuilderskips
empty-description modules, so undocumented operations vanished from the card with no
diagnostic; a{METHOD} {path}description is synthesized instead and the affected modules
are named at INFO — by their post-projection IDs, which are the ones that reach the card.The ordering is normative in both directions: the caller's own
transform_modulehook runs
first, then the description repair, then the projection — and the projection runs inside the
scanner's hook, so it happens before the scanner's owndeduplicate_ids, because lowercasing
can create a collision the document did not have (listPets+listpets). -
FR-OAS-005unapproved-write warning. The scanner never infersrequires_approvalfor
any HTTP method, and the 0.6.0 public-card filter subtracts only ACL-denied and
approval-gated skills — so a scannedPOST /chargesis advertised on the unauthenticated
/.well-known/agent-card.json. The warning names that exposure, and is never suppressed
by the presence of an ACL (apcore's ownGovernanceStatereports the absence of a gate,
never the presence of protection), only by having nothing to warn about, by a module
declaringrequires_approvalitself, or by an explicitacknowledge_unapproved_writes. It
is escalated whenbuiltin_approval_gate_wiredisfalse. -
CLI:
--from-openapi,--openapi-base-url,--openapi-prefix,--openapi-include,
--openapi-exclude,--openapi-header(repeatableKEY:VALUE, spec fetch only) and
--openapi-no-deprecated. Each is an overlay on theapcore-a2a.openapiConfig Bus
section, resolved per key. An extensions directory combined with an OpenAPI document
requires a prefix from either route, and they populate one registry so the collision
preflight can see the project modules it must not shadow. -
Config: an
apcore-a2a.openapidefault in the namespace registration — the namespace's
first nested section and its first path-typed key. apcore 0.30.0's protections for
path-typed keys do not reach a consumer namespace:Config::path_typed_keys()is a
hardcoded set of apcore's own keys and never consults a namespace registered through
Config::register_namespace, soresolve_spec_locationowns the three rules instead. -
cli::merge_openapi_settings, which reads that section and overlays the--openapi-*
flags on it per key, flag wins. It returnsNonewhen neither route names aspec—
the ordinary "no OpenAPI configured" outcome, not an error — and the CLI's backend-source
check consults it, soapcore-a2awith no flag at all now serves a spec declared in
the config file. -
New
openapicargo feature, gatingapcore-toolkit/http-proxy(the spec fetch and the
HTTP proxy writer), matching the Python package'sopenapiextra.apcore-toolkitis now
depended on withdefault-features = falseso the toolkit's defaulthttp-proxyfeature
is reached through that gate rather than pulled in unconditionally. -
9 conformance tests (
tests/openapi_backend_conformance.rs) against the shared corpus
inapcore-a2a/conformance/fixtures/openapi_backend.json, plus 17 unit tests. The driver
capturestracingoutput with its level, so every diagnostic the fixture names is
asserted rather than assumed — the two discriminating cases
(projection_unprojectable_segment_dropped_with_warning,
write_warning_not_suppressed_by_permissive_acl) assert nothing but a diagnostic. Three
behaviours the shared corpus cannot reach —timeoutbeing the spec-fetch timeout,
headersreaching the fetch request, andbase_urlsupplying what a document lacks — are
pinned separately, two of them against a real socket.
Fixed (conformance harness)
-
The conformance runner could pass vacuously.
cases()read each fixture group through
unwrap_or_default(), so renaming a group upstream made the loop iterate zero cases and
report success. Measured by renamingtest_cases: this binary reported 9 passing tests while
asserting nothing, and apcore-a2a-typescript silently dropped from 46 to 33, while
apcore-a2a-python failed loudly because it indexes the key directly.cases()now panics on
an absent or empty group. Returning early when the spec repo is not checked out remains a
separate, legitimate case. -
The three CLIs disagreed on the exit code for a usage fault, and Rust disagreed with
itself. Measured before the fix: Python exited2for a usage fault and1for a
configuration fault — correct; TypeScript collapsed everything onto1; and Rust exited2
for--bogus(clap caught it) but1for a missing backend source (its own check did) — the
same class of mistake, two codes, decided by which layer noticed first.All three now implement both tiers:
2the command line is wrong (no backend source, an
unknown flag, a flag missing its value, a malformed--openapi-header) and1the
environment it named is wrong (missing directory, zero modules, unresolvable spec, missing
auth key). The distinction is actionable — a supervisor may retry1and must never retry
2— and2is what argparse, clap and GNU getopt all use, so the bindings agree with the
tools around them as well as with each other.This crate gained
cli::UsageError, whichmaindowncasts to choose the code.mainnow
returnsExitCoderather thanResult, because Rust's runtime exits1for anyErrand
would have collapsed the two tiers again.
Changed
-
APCoreA2AErrorgains aConfig(String)variant for misconfiguration detected before
the server can start (a missingprefixin a mixed deployment, an unresolvable spec, a
document that is not 3.0.x/3.1.x, no usable base URL, an ID collision). Additive;
EmptyRegistryandServerare unchanged. -
--extensions-diris now optional and has no./extensionsdefault. One of it or
--from-openapiis required, and supplying neither is an error naming both. Previously a
bareapcore-a2aserved./extensions.
Fixed
-
--portwas inert.cli::runbuilt itsAPCoreA2AConfigwith..Default::default()
and never copiedcli.port, so the server bound0.0.0.0:8000whatever the operator typed,
with nothing logged. The published--urlnow follows--porttoo (defaulting to
http://localhost:<port>), so the Agent Card cannot advertise a socket the server does not
bind; an explicit--urlstill wins. -
The
apcore-a2a.openapiConfig Bus section reached nothing.
build_openapi_backend_from_confighad no caller anywhere insrc/— it was public API
and a documented first-class surface (feature spec §Configuration, SRS FR-OAS-004 AC 5) that
no live path read.cli::runbuilt its options from the flags alone, sotimeout,
include,excludeandacknowledge_unapproved_writes— none of which has a CLI flag in
any of the three SDKs — were unreachable except by calling the library directly. The CLI now
merges the section with the flags and routes both the OpenAPI-only and the mixed deployment
throughbuild_openapi_backend_from_config, which also means a relativespecresolves
againstConfig::project_rooton the route most deployments use (FR-OAS-004 AC 5).The merge is per key, not per source: a
--openapi-prefixalongside a config-declared
spectakes effect, and every config key without a flag survives beside it. Choosing the
whole source by whoever namedspecis the shape of the apcore-mcp defect this project
filed upstream as apcore-mcp-rust#8. The mixed-deployment prefix preflight reads the merged
value too, so anapcore-a2a.openapi.prefixsatisfies FR-OAS-006 exactly as the flag does. -
--openapi-no-deprecatedcould reverse a config setting by being absent. It was a clap
bool, which collapses "not passed" and "passed false" into the samefalse— so merging
it would have writteninclude_deprecated: trueon every run, silently overriding an
include_deprecated: falsethe operator wrote in the config file. It is nowOption<bool>
(num_args = 0plusdefault_missing_value, which keeps it a bare flag;ArgAction::SetTrue
does not work here, because clap re-applies that action's owndefault_value("false")
inArg::_buildand an absent flag would arrive asSome(false)). -
No
--openapi-timeoutflag was added:timeoutstays Config-Bus-only in all three SDKs.
What changed is that the configured value now actually reaches the spec fetch.
The runtime floor (folded in from the unreleased 0.6.1)
The floor also moves to apcore 0.30.0 / apcore-toolkit 0.11.1, and the apcore
upper bound is dropped (>=0.28, <0.29 -> >=0.30). apcore-toolkit 0.11.0 is what
shipped the OpenAPI Scanner this release is built on, so the two are one change.
The bound existed because apcore 0.27 and 0.28 had each shipped an unannounced source
break into downstream ACLRule struct literals. apcore 0.29.0 closes that route by making
ACLRule #[non_exhaustive] — a future field can no longer reach a struct expression at
all — which is exactly what the bound was buying, at the cost of a hand-edit every apcore
minor. docs/spec/tech-design.md §13.2 in the spec repo records the reasoning.
Six ACLRule struct literals in tests/integration.rs accordingly moved to
ACLRule::new(callers, targets, effect), with approval and conditions assigned
afterwards. Test-only — this crate's src/ constructs no ACLRule; it reads an ACL
the host supplies, through check_access.
Upgrade notes
Two apcore 0.29.0 breaks reach a consumer of this crate directly, because both are on
types the consumer holds rather than ones this crate wraps:
ACLRuleis#[non_exhaustive]. Any struct literal building a rule to hand to
Executor::set_aclstops compiling. Migrate toACLRule::newas above.- A pattern array with no operands is refused at load.
callers/targetsof[],
["$or"],["$not"]or a multi-operand["$not", p1, p2]now raiseACLRuleErrorfrom
ACL::load/try_new/try_add_rule, and panic from the infallibleACL::newand
ACL::add_rule. Such a rule had been contributing nothing to the decision, so under
default_effect: "allow"it permitted the very call it named — and the public Agent Card
advertised the skill accordingly. See apcore's 0.29.0 changelog for the per-shape
migration;["$not", p1, p2]is the one with no mechanical rewrite.