Skip to content

Feat/issue 3617 annotations - #3655

Open
shankgan wants to merge 5 commits into
agent-substrate:mainfrom
shankgan:feat/issue-3617-annotations
Open

shankgan wants to merge 5 commits into
agent-substrate:mainfrom
shankgan:feat/issue-3617-annotations

Conversation

@shankgan

@shankgan shankgan commented Nov 5, 2026

Copy link
Copy Markdown

See #3617

External orchestrators, build pipelines, and observability tools need a way to attach decorative, non-queryable pass-through metadata (such as build provenance, owner/runbook references, or external correlation IDs) to Actor and ActorTemplate resources without Substrate interpreting or indexing those fields.

Summary of changes

  1. API & validation (ateapi, apivalidation):

    • Add map<string, string> annotations = 8 on ResourceMetadata (immutable after creation) and map<string, string> actor_annotations = 8 on ActorTemplate.
    • Validate keys as Kubernetes label keys (k8s-label-key), reject reserved ate.dev/ and *.ate.dev/ prefixes, cap entries at 64, and bound combined key and value size at 16 KiB (16384 bytes).
  2. Control plane (controlapi, e2e):

    • Merge ActorTemplate.actor_annotations into Actor.metadata.annotations during CreateActor (with actor-level keys taking precedence on conflict) and re-validate the merged set.
    • Preserve metadata.annotations on UpdateActor prior to immutability validation.
  3. CLI & docs (kubectl-ate, docs):

    • Add --annotations (key=value,...) to kubectl-ate create actor and update the API reference guide.

Fixes #3617

AI use: AI-assisted, I reviewed and tested it.

  • Tests pass
  • [] Docs updated

@shankgan
shankgan marked this pull request as draft November 5, 2026 17:06
@shankgan
shankgan force-pushed the feat/issue-3617-annotations branch 7 times, most recently from 31e61c2 to e7a0247 Compare November 9, 2026 21:56
Add map<string, string> annotations to ResourceMetadata for decorative, non-queryable metadata on resources such as Actor and ActorTemplate.

Signed-off-by: Shankar Ganesan <shankgan@google.com>
@shankgan
shankgan force-pushed the feat/issue-3617-annotations branch 5 times, most recently from 9deff46 to f3f74f3 Compare November 10, 2026 00:21
Validate annotation keys as k8s-label-key while rejecting reserved ate.dev domains, cap entries at 16, and bound total key and value size at 4 KiB.

Signed-off-by: Shankar Ganesan <shankgan@google.com>
Copy incoming metadata.annotations onto the stored metadata during UpdateActor while keeping server-owned metadata fields intact, and add apivalidation, controlapi, and functionaltest coverage.

Signed-off-by: Shankar Ganesan <shankgan@google.com>
Add --annotations flag to kubectl-ate create actor and update actor for passing comma-separated key=value pairs (with --annotations="" clearing annotations on update), add unit tests for CLI flag parsing and ActorTemplate manifest round-trip, and document annotations in the API reference guide.

Signed-off-by: Shankar Ganesan <shankgan@google.com>
Benchmark protobuf serialization, update validation, PostgreSQL CRUD (CreateActor, GetActor, UpdateActor, ListActors at 100 and 1000 per page), and the cold ResumeActor/SuspendActor lifecycle with no annotations and with 4 KiB of annotations in four shapes: one or sixteen entries of random base64, which PostgreSQL stores out of line uncompressed, and one or sixteen entries of text with random identifiers, which it stores out of line compressed. The PostgreSQL sub-benchmarks store a ~1.4 KiB actor status so annotations push the row across the 2 KiB TOAST threshold.

Each run reports pg_column_size, octet_length, TOAST chunk count and relation size, EXPLAIN (BUFFERS, SERIALIZE) block counts for GetActor, WAL bytes and table growth per UpdateActor and per resume/suspend cycle with the two halves timed separately, and the ListActors response size.

Add storetest.Pool so tests can run SQL the store API does not expose, and widen the storetest helpers from *testing.T to testing.TB so benchmarks can provision isolated PostgreSQL test databases.

Signed-off-by: Shankar Ganesan <shankgan@google.com>
@shankgan
shankgan force-pushed the feat/issue-3617-annotations branch from 916ab10 to 709c711 Compare November 14, 2026 00:30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support decorative, non-queryable metadata (annotations) on Actor and ActorTemplate

1 participant