Skip to content

Card Discovery Refinement Alignment [Spec + Impl]#380

Open
rhuss wants to merge 8 commits into
kagenti:mainfrom
rhuss:002-card-discovery-alignment
Open

Card Discovery Refinement Alignment [Spec + Impl]#380
rhuss wants to merge 8 commits into
kagenti:mainfrom
rhuss:002-card-discovery-alignment

Conversation

@rhuss
Copy link
Copy Markdown
Contributor

@rhuss rhuss commented May 27, 2026

Review Guide for full context: motivation, key decisions, and scope boundaries.

Spec for review

PR #372 introduced card discovery on AgentRuntime. This follow-up aligns the API surface with Kubernetes conventions and the community refinement document before external consumers lock in the current field names and condition types.

Why now

The card discovery API has no consumers yet. Field renames and condition type changes are free today but require migration tomorrow. This is the last window to get the API right before it becomes a compatibility constraint.

Proposed changes (spec only, no code yet)

Transport security visibility (new transportSecurity field on CardStatus)

A card fetched over plain HTTP within the cluster network has no transport-level identity guarantee. Platform engineers currently cannot tell from the AgentRuntime status whether a card was fetched securely. Adding transportSecurity ("mTLS" or "plainHTTP") makes the security posture observable without digging into operator logs.

Condition model cleanup (rename CardSynced to CardFetched)

  • CardSynced implies ongoing synchronization, which is misleading for an event-driven, non-polling architecture
  • CardSynced True CardSynced stutters in kubectl describe output (condition type and reason are identical)
  • Transport-aware reasons (Fetched vs FetchedInsecure) give immediate security posture visibility
  • WorkloadNotReady split from ServiceNotFound maps each reason to one diagnostic action

Field name accuracy

  • cardId renamed to cardHash: the field holds a SHA-256 content hash for change detection, not a unique identifier
  • fetchedAt renamed to lastCardFetchTime: disambiguates "when the controller fetched it" from "when the agent created it"

Protocol-aware port resolution

  • kagenti.io/port annotation override for multi-port Services where auto-detection picks the wrong port
  • Port named a2a takes priority over generic http since we're fetching A2A protocol cards specifically

Artifacts

File Purpose
spec.md 4 user stories, 9 functional requirements, 5 success criteria
plan.md Technical context, constitution check, file map
tasks.md 31 tasks across 6 phases
research.md 6 research decisions
data-model.md CardStatus field changes, condition model
REVIEWERS.md Review guide

Assisted-By: 🤖 Claude Code

Copy link
Copy Markdown
Contributor

@pdettori pdettori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This is a well-structured spec that makes the right architectural call at the right time. The API surface improvements are genuine — better naming, security observability, clearer diagnostics — and the cost is minimal given the absence of external consumers.

The synthesis approach is sound: cherry-picking transport security awareness and workload readiness from the refinement doc while preserving PR #372's event-driven model and FetchSkipped semantics. The timing argument for breaking changes is valid.

A few design questions below (none blocking), mostly around ensuring the spec is explicit on edge cases that will matter during implementation.

Areas reviewed: Data model, condition semantics, port resolution, workload readiness, CRD UX
Commits: 3, all signed-off
CI: All passing (E2E pending)

Comment thread specs/002-card-discovery-alignment/REVIEWERS.md
Comment thread specs/002-card-discovery-alignment/spec.md
Comment thread specs/002-card-discovery-alignment/data-model.md
Comment thread specs/002-card-discovery-alignment/research.md
@rhuss rhuss marked this pull request as ready for review May 28, 2026 07:47
@rhuss rhuss requested a review from a team as a code owner May 28, 2026 07:47
@rhuss rhuss changed the title Card Discovery Refinement Alignment [Spec] Card Discovery Refinement Alignment [Spec + Implementation] May 28, 2026
@rhuss rhuss force-pushed the 002-card-discovery-alignment branch from 885f495 to 23c8050 Compare May 28, 2026 09:42
@rhuss rhuss changed the title Card Discovery Refinement Alignment [Spec + Implementation] Card Discovery Refinement Alignment [Spec + Impl] May 28, 2026
Comment thread kagenti-operator/config/crd/bases/agent.kagenti.dev_agentruntimes.yaml Outdated
Comment thread kagenti-operator/internal/controller/agentruntime_controller.go Outdated
Comment thread kagenti-operator/internal/controller/agentruntime_controller.go Outdated
AgentCardData: *cardData,
CardHash: newCardHash,
Protocol: protocol,
TransportSecurity: transportSecurity,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between "Protocol" and "TransportSecurity" ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are orthogonal concepts:

  • protocol = the application-level agent discovery protocol ("a2a"), identifying which card endpoint convention was used
  • transportSecurity = the transport layer authentication used for the fetch ("mtls" or "http")

An A2A card can be fetched over either transport. protocol tells you what was fetched, transportSecurity tells you how securely it was fetched.

rhuss added 8 commits May 28, 2026 18:14
Spec, plan, research, data-model, tasks, and REVIEWERS.md for aligning
the card discovery implementation with the RHAIENG-4948 refinement
document. Covers transport security field, condition model restructure,
field renames, and protocol-aware port resolution.

Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
All arguments now stand on live testing findings, Kubernetes conventions,
and API quality rather than referencing external documents.

Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
- transportSecurity: validated enum instead of free-form string
- scale-to-zero: explicit edge case (WorkloadNotReady is correct)
- Sandbox exemption: added rationale for skipping readiness check

Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
Generation-based change detection triggers false WorkloadNotReady on
scale events. Documented as known limitation with a planned improvement
to switch to pod template hash detection.

Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
Add transport security visibility, unified condition model, accurate
field names, and protocol-aware port resolution for AgentRuntime card
discovery.

Key changes:
- Add transportSecurity field (mTLS/plainHTTP/configMap) to CardStatus
- Rename CardSynced condition to CardFetched with transport-aware reasons
- Rename cardId to cardHash, fetchedAt to lastCardFetchTime
- Add kagenti.io/port annotation and a2a port name resolution chain
- Add workload readiness check before card fetch attempt
- 464 unit tests passing, full spec compliance verified

Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
Rename transportSecurity enum values from mTLS/plainHTTP/configMap to
mtls/http, add typed TransportSecurity enum with Go constants, and
remove unused configMap value.

Assisted-By: 🤖 Claude Code
Signed-off-by: Roland Huß <rhuss@redhat.com>
@rhuss rhuss force-pushed the 002-card-discovery-alignment branch from 2ba4372 to 1cb6539 Compare May 28, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New /:ToDo

Development

Successfully merging this pull request may close these issues.

3 participants