Skip to content

feat(crud-service): cutover to MAF runtime #982

@Cataldir

Description

@Cataldir

Problem statement

Migrate the crud-service bounded context from the legacy BaseRetailAgent runtime internals to the MAF-backed runtime introduced in #981. crud-service is a pure microservice with no agent logic, but it binds the new three-tier memory contract (ADR-032, PR #978) and is the first cutover step per the R1 sequencing — establishing the steady-state pattern (eval baselines, AGC canary, MCP-only A2A lint, span contract validation) that every subsequent bounded context follows.

This is a hard sunset: legacy runtime imports are deleted in the same PR. There is no coexistence flag.

Required change

  • Replace any direct usage of lib/src/holiday_peak_lib/agents/ internals in apps/crud-service/src with the public surface backed by the MAF runtime from feat(lib): MAF runtime adapter behind the existing BaseRetailAgent surface #981.
  • Bind the three-tier memory contract: wire MemoryFacade (Hot=Redis, Warm=Cosmos, Cold=Blob) via env vars REDIS_URL, COSMOS_ACCOUNT_URI, COSMOS_DATABASE, COSMOS_CONTAINER, BLOB_ACCOUNT_URL, BLOB_CONTAINER.
  • Confirm REST endpoints (/products, /orders, /cart) remain unchanged in shape; migration is internal.
  • Per-service Foundry config (FOUNDRY_AGENT_ID_FAST, MODEL_DEPLOYMENT_NAME_FAST, FOUNDRY_AGENT_ID_RICH, MODEL_DEPLOYMENT_NAME_RICH, FOUNDRY_STREAM, PROJECT_ENDPOINT) wired via Helm values + Key Vault refs (where applicable for downstream agent calls from CRUD).
  • Delete any pre-MAF imports left in apps/crud-service/src.

Affected components

Acceptance criteria (per spec — Acceptance gate per bounded context)

Risks and dependencies

Risk Mitigation
Memory contract binding regresses Hot/Warm/Cold tier latencies. App Insights workbook compares P50/P95/P99 per memory tier across the cutover; tolerance P95 within 10 %. Outside tolerance halts the canary.
Reach-through into BaseRetailAgent internals from crud-service is found late. Pre-flight grep across apps/crud-service/src for direct use of internal modules; blocks cutover until refactored.
Foundry agent ID provisioning fails for downstream agent calls from CRUD. Provisioning runs ahead of this PR; failure halts this context.
Hard-sunset rollback restores legacy code from the revert. No coexistence state allowed (per spec). Either fully on MAF, or fully on legacy.

Blocked by: #981 (lib MAF runtime seam).

Blocks: the next context (truth-*) per the R1 sequencing rule (one bounded context at a time).

Evidence links

ADR impact

Branch convention

feature/<issue-id>-crud-maf-cutover (per ADR-018).

BPMN process

%%{init: {'theme':'base', 'themeVariables': {
  'primaryColor':'#FFB3BA',
  'primaryTextColor':'#000',
  'primaryBorderColor':'#FF8B94',
  'lineColor':'#BAE1FF',
  'secondaryColor':'#BAE1FF',
  'tertiaryColor':'#FFFFFF'
}}}%%
flowchart LR
  A[Analyze Current Code] --> B[Design Change]
  B --> C[Implement on Issue Branch]
  C --> D[Open PR]
  D --> E[Validation and Fixes]
  E --> F[Merge to Main]
  F --> G[Monitor Workflows]
  G --> H[Close Issue and Cleanup]
Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:appsService applications under apps/context:crudBounded context: crud-servicepriority:highHigh priority worktype:refactorRefactor / restructure with no functional change

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions