mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* feat(bedrock-agentcore): implement AgentCore Memory events
The Memory control plane was emulated but the event data plane was not:
CreateEvent, ListEvents, GetEvent and DeleteEvent were all absent, so an
application that reads a conversation's history had nothing to call.
Rather than answer ListEvents with a fixed empty list, the events are
stored, so a read returns what was written. An empty session is then empty
because nothing wrote to it, not because the answer is hardcoded.
Behaviour captured against real AgentCore in us-west-2:
- events are returned newest first, and the event id is a zero-padded
epoch-millisecond prefix plus a random suffix, so ids sort
chronologically as plain strings
- includePayloads=false omits the payload key rather than emptying it
- maxResults accepts 1 to 100; 101 is a ValidationException quoting the
constraint
- a malformed memory id is a ValidationException ("Invalid memoryId: not
a valid memory ID or ARN") while a well-formed but unknown one is a
ResourceNotFoundException ("Memory not found: <id>"). A memory id is a
name followed by exactly ten alphanumerics: a nine or eleven character
suffix is rejected as malformed before any lookup
- an unknown actor or session is an empty list, not an error
- sessionId is optional on create, and AgentCore assigns a UUID when it
is omitted
- an empty payload is accepted, and a new event lands on the main branch
- DeleteEvent echoes the deleted id rather than returning an empty body
The endpoints live on the memory controller rather than the data-plane one
because a JAX-RS request is matched against a single root resource class:
the class rooted at "/memories" owns that subtree, and a class rooted at
"/" never gets a look in. The behaviour stays in the data-plane service.
Verified with the same AWS SDK an application would use, pointed at a local
floci: create, list, get and delete round-trip, eventTimestamp parses back
to the exact Date, and each error above arrives as its typed exception.
Memory records (extraction and retrieval) remain unimplemented; they need
an extraction engine rather than stored events.
* fix(bedrock-agentcore): satisfy the docs and native-image CI gates
Three CI failures on this branch, all mine.
The action tables under docs/services are generated, not hand written. I
edited bedrock-agentcore.md directly and put the new event rows in the
wrong position, so `make docs-check` reported the table stale. Regenerated
with `make docs-sync`, which orders actions by registration and therefore
keeps ListMemories ahead of the event family.
BedrockAgentCoreEventService holds a static SecureRandom for event ids.
GraalVM captures such an instance in the image heap unless the class is
initialized at run time, so NativeImageRuntimeInitializationTest failed and
took both native image builds with it. Registered the class under
--initialize-at-run-time alongside the other services that hold one.
* fix(bedrock-agentcore): correct the event wire contract
Three gaps against the modelled contract, all confirmed in the bundled
botocore service model rather than taken on trust.
CreateEvent answers 201, not 200. The operation's HTTP trait says so, and
the test was pinning the wrong status.
payload is a required member of CreateEvent whose valid values include the
empty list. Turning a null into an empty list made an omitted member
indistinguishable from a valid empty array, so presence now travels
separately from the value and an omitted payload is a ValidationException.
The model also caps the list at 100 items, which is now enforced.
ListEvents is paginated. The default page size is 20 rather than the 100
this used, and the request and response carry a nextToken. The token is the
last event id of the previous page rather than an offset: ids sort with
time and the order is stable, so resuming cannot be shifted by a concurrent
write. No token is emitted on the final page, which is what ends a caller's
loop.
Verified with the real SDK against a local floci: five events traverse in
three pages of two, two and one with the token absent on the last, and an
omitted payload comes back as ValidationException.
* fix(bedrock-agentcore): match AWS wording for the maxResults range error
AWS quotes the submitted value and cites only the bound that was breached.
The message always cited the upper bound and dropped the value, so
maxResults=0 reported "less than or equal to 100". Add a test for the
lower bound, which had none.