Repository navigation
Release 0.5.0
Minor release. Task isolation moves into the TaskStore, which makes it survive
a restart — a breaking change to the store traits and to
A2AServerFactory::create; see Changed (BREAKING) below for the migration
table. Also carries conformance and correctness fixes on the A2A server path
from aiperceivable/apexe issues #33, #34 and #35, and raises the apcore floor
to 0.27. Deployments on the default in-memory stores and on build_app /
serve need no migration. 161 tests pass.
Fixed
-
Failed tasks no longer collapse every error to
"Internal server error".
error_to_statusnow routes throughErrorMapper, the crate's single
redaction policy, so the task-status surface classifies like the JSON-RPC
surface. Internal and unrecognized errors keep the fixed string (srs
FR-ERR-004 / FR-ERR-008) and ACL denials stay masked (FR-ERR-003), but
caller-fixable failures — schema validation, invalid input, unknown module —
carry their sanitized detail plusai_guidancewhen apcore supplied one. An
agent that reads a guard refusal can now correct itself. Python and TS emit
the fixed string on this path too, so they need the same change.ai_guidanceis gated on exactly those three classes, not on
err.user_fixable. Six apcore codes carryuser_fixable = Some(true)while
mapping to the fixed "Internal server error" (VERSION_CONSTRAINT_INVALID,
the threeBINDING_*codes,DEPENDENCY_NOT_FOUND,
DEPENDENCY_VERSION_MISMATCH), anduser_fixableis settable per-error by
the module author — so the first version of this change let a fixed,
deliberately-opaque string be extended with internal detail that
sanitize_messagedoes not strip (module ids, versions, env-var names,
hostnames). A unit test now locks the gate toErrorMapper's own branching
across every apcore error code.SCHEMA_VALIDATION_ERRORis no longer treated as caller-fixable in every
direction. apcore raises the one code for input, output and config
validation, so a module returning the wrong shape reached the caller as
-32602 Invalid paramswith"Output validation failed"and guidance
pointing at adetails.errorsfield an A2A caller never receives — a
server-side defect reported as the caller's fault. Output and config
validation now map to the fixed internal string. The direction label apcore
puts at the front of the message is the only signal available, so the two
exact wordings are matched; anything unrecognized (including a module raising
the code with its own wording) keeps the caller-facing detail. -
tasks/cancelis guarded. Unknown ids return-32001instead of
fabricating a CANCELED task, terminal tasks return-32002instead of having
their artifacts destroyed, and a cancelled task keeps the artifacts and
history it had already accumulated (srs FR-TSK-005; matches a2a-python's
on_cancel_task). -
TextPartinput works. The module's input schema is now passed to the
part converter, so a JSON text part is parsed against it rather than arriving
as a bare string — making theapplication/jsoninput mode on the Agent Card
usable without aDataPart. -
JSON-RPC 2.0 envelope validation. Malformed JSON returns
-32700in a
JSON-RPC response instead of atext/plainHTTP 400; a"jsonrpc"other
than"2.0", a missingjsonrpc/method, and a batch array all return
-32600(previously accepted, or reported as-32601).A missing
idis deliberately not an error. That is a JSON-RPC 2.0
notification, and — like a2a-python and a2a-js — this server answers it with
a normal response carrying"id": nullrather than staying silent as strict
JSON-RPC 2.0 would. Clients that send notifications should expect a response
body. -
SSE frames are JSON-RPC responses. Each
data:now carries
{"jsonrpc","id","result":<event>}, matching a2a-python and a2a-js, so an
off-the-shelf A2A client can parse the stream. Event ordering, the terminal
lastChunkmarker and theoneofwrapper keys are unchanged;kindand
finalremain absent, as A2A 1.0 requires.The SSE
id:line also remains absent, but that is a deviation from the
spec repo, which mandates a monotonicid:in three places
(docs/spec/srs.md,docs/features/streaming.md,
docs/spec/tech-design.md). Neither a2a-python nor a2a-js emits one, so
emitting it would put this server alone on the wire, and it buys nothing
untiltasks/resubscribe/Last-Event-IDreplay exists. To be revisited
with resubscribe support, or by amending the spec. -
"role": "user"is accepted. The lowercase A2A 0.3 spellings are
deserialization aliases (ROLE_*is still what is serialized), and an
unreadablemessagenow reports what actually failed to parse instead of
claiming the parameter was missing. -
VERSIONtracks the crate version (CARGO_PKG_VERSION) rather than a
hand-maintained literal that had drifted to0.4.1. -
A store-backend failure is reported as
-32603, never as-32001. The
two demand opposite responses — an A2A agent reading task not found
re-submits work that is actually still there, while internal error is
correctly not caller-fixable — so they must stay distinguishable. This is the
same classification the task-status surface uses (srs FR-ERR-004 /
FR-ERR-008), now applied to every store-addressed method:tasks/get,
tasks/cancel,tasks/list, and all threetasks/pushNotificationConfig/*.Three of those previously answered as though nothing was wrong:
tasks/pushNotificationConfig/deletereturnedresult: nullwhile the
config stayed live and kept delivering — a caller revoking a leaked webhook
was told it had worked;tasks/listreturned[], which reads as "you have
no tasks" rather than "the backend is down"; and
tasks/pushNotificationConfig/getreturned-32001 not foundfor an outage
whilesetreturned-32603for the same one, giving callers two
contradictory signals about a single failure.tasks/cancelis the fourth: recording CANCELED is what cancelling does,
so a failed write there is the operation failing, not "work happened that
could not be recorded". It answered with a CANCELED task while the store
still held the old state, leavingtasks/getto contradict it. -
Task-store write failures are logged instead of discarded. Each
persistence call was a barelet _ =, so a store outage produced tasks that
message/sendreported as COMPLETED andtasks/getthen reported as
missing, with nothing logged in between. The response is unchanged — the work
really did run — but the failure now reaches the operator. -
A JSON-RPC error frame on an SSE stream now raises instead of being yielded
as an event. Upstream reports a mid-stream failure as its own frame, tagged
event: errorwith a JSON-RPC error response indata:. Envelope unwrapping
only looks forresult, so such a frame fell through and was handed to the
caller as though it were an event — a caller readingstatusUpdatesaw
nothing and the failure vanished, while the non-streaming path raised for a
byte-identical payload. Both paths now share the same error mapping, so a
-32001frame producesTaskNotFoundErrorwherever it arrives. Events
received before the error frame are still delivered.
Changed (BREAKING)
-
TaskStorecarries the owner;PushConfigStoreis new. Every
TaskStoremethod now takes a&CallContextand returnsStoreError
instead ofString, andlisttakes a&ListParams. Push-notification
configs moved out of the server's own state into a matching
PushConfigStoretrait.This closes two holes that a process-memory
task_id -> ownermap beside the
store could not: the map had to be capped (100 000 entries), which made an
evicted task permanently unreachable to its owner; and it started empty after
a restart, so every task in a consumer-supplied persistent store was
permanently unreachable to its genuine owner —tasks/get/tasks/cancel
and the three push-config methods returned-32001,tasks/listreturned
[]. SplittingPushConfigStoreout is what stops a restart from restoring
tasks whose webhook targets have evaporated. This is the shape upstream
already uses (a2a-python'sServerCallContext+OwnerResolver, and its
separatePushNotificationConfigStore);apcore-a2a-pythonand
apcore-a2a-typescriptre-export those stores directly and were never
affected.The default
InMemoryTaskStorebuckets by owner, so isolation is a property
of the data structure rather than a check each method has to remember.Change Who is affected Migration TaskStoremethods takectx: &CallContextcustom TaskStoreimplementorsadd the parameter; key storage on (owner, task_id)Result<_, String>->Result<_, StoreError>same use StoreError::backend/backend_msglist()->list(&ListParams, &CallContext)same add both parameters new PushConfigStorecallers of A2AServerFactory::createpass Arc::new(InMemoryPushConfigStore::new()), or a persistent store alongside a persistentTaskStoreA2AServerFactory::create(...)->create(registry, CreateOptions)same build CreateOptions::new(..)and chainwith_task_store/with_auth/with_explorerAppStatefields arepub(crate)anyone hand-building AppStateuse build_app/build_app_with_auth/serve/async_serve, orA2AServerFactory::createbuild_app/build_app_with_auth/serve/async_serveare unchanged;
deployments on the default in-memory stores need no migration. -
AppStateis no longer constructible outside this crate, and
A2AServerFactory::createtakes aCreateOptionsstruct instead of ten
positional arguments. Three releases in a row had broken hand-built
AppStates andcreatesignatures; both surfaces are now closed, so adding
a component later is not a breaking change.CreateOptionsis also the only
way to supply a custom store. -
The
tasks/listmethod is gone; task listing isListTasks(BREAKING).
tasks/listwas not an A2A method name in any version — 1.0 calls it
ListTasks, and 0.3 had no task-listing method at all, which is why its v0.3
compatibility layer routesmessage/send/tasks/get/tasks/cancelbut
not this one. This project invented the name, wrote it into the spec, and
implemented it only in the Rust server, so the result was broken in both
directions: the bundled clients'list_tasks()returned-32601against the
Python and TypeScript servers, and a third-party 1.0 client'sListTasks
returned-32601against the Rust one. Only Rust-server-plus-bundled-client
worked.A2AClient::list_tasksnow sendsListTaskswith anA2A-Version: 1.0
header — required, since both upstream SDKs read a request without it as v0.3
(spec 3.6.2) and reject 1.0 method names with-32009. The other methods keep
their 0.3 spellings, which every SDK still accepts.The parameter names were wrong too, which only an end-to-end call could
surface:ListTasksRequestdeclarespageSize/pageToken/contextId/
status/historyLength, and has nolimitfield at all — so even with the
method name fixed, both SDK-backed servers answered-32602 Invalid params.
The Rust server had never caught it because it ignores list parameters
entirely.list_tasks(limit=…)keepslimitas the friendly parameter name
and sendspageSizeon the wire.Migration: callers sending
tasks/liston the wire must sendListTasks
plus the version header. Users ofA2AClient::list_tasksneed no change. This
affects Rust deployments only; the method never worked on the other two.
Added
storagetypes are re-exported at the crate root —TaskStore,
InMemoryTaskStore,PushConfigStore,InMemoryPushConfigStore,
CallContext,OwnerId,ListParams,StoreError. The documented
use apcore_a2a::InMemoryTaskStore;did not compile before this.
Changed
-
Requires apcore 0.27 (
>=0.27, <0.28). The floor was an unbounded
>=0.26, so cargo was free to resolve a future major-breaking apcore into
this crate. One 0.27 breaking change reaches the Agent Card:
Registry::describereturnsResult<String, ModuleError>instead of
String, and itsOkvalue is now the cross-SDK Markdown document (an
# {module_id}heading,**Tags:**, a**Parameters:**list,
**Documentation:**) where through 0.26 it was the module's one-line
description().AgentCardBuilder::buildfed that value straight into every
AgentSkill.description, so on 0.27 the whole document would have been
published on the card. It now readsModuleDescriptor::description, which is
the fieldapcore-a2a-python's builder has always used
(agent_card.py:147) and is the same string 0.26'sdescribe()returned —
so the card is byte-identical across the bump. Pinned by
skill_description_is_the_one_line_description_not_the_describe_document,
which asserts against the livedescribe()output so it cannot pass
vacuously.No other 0.27 breaking change applies: this crate names none of
ErrorCode::ConfigurationError,RedactionConfig,with_coerce_types,
_config.strict,pipeline.configure,inject_checkedorStepMiddleware,
registers no step middleware, and asserts on no redacted output. -
Source-breaking changes to the
server::handlerssurface. The documented
entry points (build_app,build_app_with_auth,serve,async_serve,
APCoreA2AConfig,BackendSource) are unchanged; only code that constructs
anAppStateby hand or names the handler functions is affected.AppStategained two required fields,input_schemasandtask_owners,
so struct-literal construction no longer compiles.AppState::agent_cardandAppState::explorer_cardchange from
Arc<Value>toArc<FilteredCard>(.unfiltered()returns the original
Arc<Value>,.for_caller(...)the ACL-filtered copy).AppState::task_ownersisArc<Mutex<TaskOwners>>, not
Arc<Mutex<HashMap<String, String>>>.explorer_cardgained anAuthIdentityextractor argument (it must know
the caller to filter the card). As an axum handler it is still routed the
same way; only a direct call has to change.
Security
-
All six task-addressed methods are scoped to the authenticated principal
—tasks/list/tasks/get/tasks/canceland
tasks/pushNotificationConfig/set|get|delete.tasks/listpreviously
returned every caller's tasks including their output; a task could be read or
cancelled by id from any caller; and the push-config methods checked nothing
at all, so a principal holding another's task id could redirect that task's
terminalstatusUpdateto a webhook of its choosing, or silently suppress the
owner's notifications by deleting their config. Only the unguessability of a
UUIDv4 task id stood in the way. Cross-principal access is masked as-32001
so task ids cannot be probed. The push-config methods now also require the
task to exist, matchinga2a-python'son_set/get_task_push_notification_config.Ownership lives inside the store, keyed alongside the task itself, so it
survives whatever the store survives — see the breakingTaskStorechange
below.Callers with no
Identityshare a single""owner bucket, as upstream's
UnauthenticatedUserdoes — that covers both "no authenticator configured"
and "an authenticator configured withrequire_auth = falsethat did not
authenticate this request". Single-tenant deployments are unaffected; a
permissive-mode deployment gets scoping only between authenticated callers,
with every unauthenticated caller sharing one bucket.Known limitation. A consumer-supplied store that ignores its
CallContextdisables task isolation entirely: every caller sees every task.
Rust cannot enforce the contract, and neither can upstream —a2a-python
states the same requirement as a SHOULD on its ownTaskStore. The contract
is documented on the trait; if you supply a custom store, keeping it is
yours. -
The Agent Card advertises only ACL-allowed skills, and the filter agrees
with enforcement. The ACL gated the call but not the advertisement, so a
deny-all-but-one ACL still disclosed the whole module inventory. The filter
now evaluates each skill exactly as apcore's pipeline does — against
acl_context(identity).child(skill_id), using that context's owncaller_id
— instead of against the authenticated principal with aNonecontext. The
first version of this filter got both halves wrong in opposite directions: a
callers: ["@external"] … denyrule matched on the call path but not on the
card, so an authenticated caller was advertised the entire inventory and then
refused every call; and a rule carrying aconditions:block was silently
inert on the card path (apcore'scheck_conditionsreturns false without a
context) while it stayed live on the call path.Writing caller rules:
callers:names the calling module, not the
principal. An inbound A2A request is a top-level call, so it reaches
BuiltinACLCheckwithcaller_id = NoneandACL::checkevaluates it as
@external— on the card path and the call path alike. That is apcore's
contract, not a gap in it:caller_idis the calling module in a nested call
chain, managed exclusively byContext::child(apcoreContext::create
doc — "top-level Contexts always havecaller_id = None"). It is also the
behaviour operators depend on, sincecallers: ["@external"] … denyis the
natural way to lock external traffic out, and it has to keep matching an
authenticated request or it silently stops covering what it was written for.The designed way to discriminate principals is
@system(matched against
identity.identity_type) or anidentity_types/rolescondition. Both
readctx.identity, whichContext::childclones through unchanged and
BuiltinACLCheckpasses toACL::check, so both work today on both
surfaces. A rule naming a principal incallers:—callers: ["u1"]— will
never match, and the card is careful not to pretend otherwise.One real consequence remains: the audit trail's caller dimension, the circuit
breaker's per-caller key and the obs/otel caller attribute readcaller_id
rather thanidentity, so they record@externalfor every inbound request.The filtered card is memoized per caller.
ACL::checkinvokes the consumer's
audit sink — a synchronousFn(&AuditEntry)— once per skill, and the
discovery path is auth-exempt, so filtering on every request let any
anonymous client emitskills.len()governance entries per request at
arbitrary rate (each recordingdecision: "deny", indistinguishable from a
real enforcement decision) while blocking a tokio worker for as long as the
sink took. Memoizing is sound because an installedACLcannot change for
the life of the process. The sink is still driven once per (caller, card):
apcore's publicACLAPI offers no way to suppress it —default_effectis
private, so an audit-free twin cannot be rebuilt fromrules(), and there is
noclear_audit_logger.