Skip to content

Commit a2857fa

Browse files
authored
feat: agent fixes + ADR consolidation + UI/lib enhancements (#924, #928, #929) (#931)
* docs(adr): renumber ADRs to 001-027 and consolidate boundaries - Renumber ADR catalog: 001 (Python 3.13) through 027 (Truth Layer) - Consolidate ADRs: 003 (adapter+boundaries+connector registry), 004 (FastAPI+REST/MCP), 007 (memory tiers+builder+partitioning+namespace), 017 (azd+Flux GitOps), 024 (communication+isolation+async) - Remove orphan adr-021-azd-first-deployment.md (duplicate of consolidated 017) - Sanitize historical prose: remove obsolete ADR-NNN breadcrumbs from consolidated docs - Update CHANGELOG, CONTRIBUTING, .gitignore, governance docs to canonical numbers - Update memories/repo/architecture-decisions.md to current 27-ADR scheme * feat(lib): foundry agent improvements + factory endpoint hardening - foundry.py: enhanced Foundry agent client (163 line delta) — pipeline robustness - app_factory.py + endpoints.py + foundry_lifecycle.py: factory hardening, lifecycle hooks - prompt_loader.py: prompt loading enhancements - mcp/server.py: minor MCP server tweak - Tests: +84 lines factory endpoints, +447 lines foundry coverage * chore(infra): align deploy workflow + bicep + helm release with ADR-017/021/026 - deploy-azd.yml: workflow updates - shared-infrastructure.bicep: ADR ref updates and infra alignment - render-helm.sh: ADR ref updates - ecommerce-catalog-search.yaml HelmRelease: minor adjustments * feat(ui): agent invocation telemetry hook + streaming service + semantic search hardening * feat(ui): demo scenarios, agent telemetry, product graph + admin enhancements - New: scenarios pages, AdminLaunchpad, demo components, agent invocation telemetry, fleet summary, agent streaming service - Enhanced: ProductGraphCanvas, AgentRobot/AgentRobotOverlay, Navigation, AdminServiceDashboardPage - Hooks: useAgentInvocationTelemetry, useFleetSummary, expanded useAgentMonitor/useEnrichmentMonitor - API proxy + base URL resolver hardening - Tests: ProductGraphCanvas, AgentProfileDrawer, productService unit tests; cockpit-readiness, dark-mode-regression, demo-narrative e2e specs - Issues #924, #928, #929 (agent-fixes) * feat(ui): commerce cockpit polish, thinking bubble, robot intro, dark mode + test hardening - Add ThinkingBubble and RobotScatterIntro components - Product similarity hook for related items - Commerce agent layout test coverage - Dark mode regression spec fixes - API proxy env test expansion - Agent profiles and streaming service improvements - Theme context and global CSS refinements
1 parent 9787939 commit a2857fa

176 files changed

Lines changed: 11318 additions & 3877 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/agents/Truth_Layer_Pipeline.agent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ class TruthIngestionAgent(BaseRetailAgent):
7777
...
7878
```
7979

80-
### SLM-First Routing (ADR-013)
80+
### SLM-First Routing (ADR-010)
8181
- All agents use SLM first (fast model, e.g., `gpt-5-nano`)
8282
- Automatic escalation to LLM when complexity requires it
8383
- Configure via `FoundryAgentConfig` with `FOUNDRY_AGENT_ID_FAST` / `FOUNDRY_AGENT_ID_RICH`
8484

85-
### MCP Tool Exposition (ADR-010)
85+
### MCP Tool Exposition (ADR-004)
8686
- Register domain MCP tools via `FastAPIMCPServer.add_tool(path, handler)`
8787
- MCP tools return structured dicts for agent-to-agent communication
8888
- Tools are mounted at `/mcp` prefix
@@ -157,7 +157,7 @@ Add 6 route modules to `apps/crud-service/src/crud_service/routes/`:
157157
3. **Every enrichment must include**: confidence score, source model ID, evidence references
158158
4. **Immutable audit trail** — every state change produces an `AuditEvent`
159159
5. **All services follow `build_service_app()`** pattern with FoundryAgentConfig for SLM/LLM
160-
6. Agents expose both **REST endpoints AND MCP tools** (ADR-010)
160+
6. Agents expose both **REST endpoints AND MCP tools** (ADR-004)
161161
7. **Tests required**: unit tests in each `tests/` directory, integration tests for cross-service flows
162162
8. Follow **PEP 8** strictly; use `pyproject.toml` with `uv`
163163
9. Each new app needs a `Dockerfile`, `pyproject.toml`, and proper package structure

.github/agents/code-guidelines-agent.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: CodeReviewer
33
description: "Reviews and writes code for educational content (books, papers, courses, notebooks) ensuring executability, decomposition (≤20 lines per block), prose explanations for every function, and language-specific standards (Python type hints, TypeScript interfaces, Go error handling)."
44
argument-hint: "Review the code examples in Chapter 4 of the AI Operations book for executability, decomposition limits, educational clarity, and version currency"
5-
tools: ['execute', 'read', 'edit', 'search', 'web', 'agent', 'todo']
5+
tools: [execute/runNotebookCell, execute/getTerminalOutput, execute/killTerminal, execute/sendToTerminal, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/getNotebookSummary, read/problems, read/readFile, read/viewImage, read/readNotebookCellOutput, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, agent/runSubagent, edit/createDirectory, edit/createFile, edit/createJupyterNotebook, edit/editFiles, edit/editNotebook, edit/rename, search/changes, search/codebase, search/fileSearch, search/listDirectory, search/textSearch, search/usages, web/fetch, web/githubRepo, azure-mcp/search, workflow-ops-server/assess_report_quality, workflow-ops-server/classify_signals, workflow-ops-server/collect_github_contributions, workflow-ops-server/compose_from_dailies, workflow-ops-server/query_dataverse_opportunities, workflow-ops-server/retitle_copilot_sidebar_chats, workflow-ops-server/retrieve_historical_context, workflow-ops-server/retrieve_live_context, workflow-ops-server/search_copilot_sidebar_chats, workflow-ops-server/smoke_runtime, workflow-ops-server/validate_contracts, workflow-ops-server/validate_journal_structure, browser/openBrowserPage, browser/readPage, browser/screenshotPage, browser/navigatePage, browser/clickElement, browser/dragElement, browser/hoverElement, browser/typeInPage, browser/runPlaywrightCode, browser/handleDialog, todo]
66
user-invocable: true
77
disable-model-invocation: false
88
---

.github/agents/data/holiday-peak-hub-pr-review.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Every PR closure MUST involve the Architecture_Patterns agent. This is non-negot
1414
1. **Before approving any PR**, invoke or defer to the `Architecture_Patterns` agent to validate:
1515
- Adherence to ADRs (Architecture Decision Records) in `docs/architecture/adrs/`
1616
- Correct use of `BaseAdapter`, `BaseRetailAgent`, `AgentBuilder` patterns
17-
- Event-driven patterns follow ADR-005 and ADR-007 (Saga/Choreography)
18-
- Connector patterns follow ADR-024 (Connector Registry)
19-
- Memory tier usage follows ADR-008 and ADR-014
20-
- MCP tool exposition follows ADR-010
17+
- Event-driven patterns follow ADR-006 (Saga/Choreography)
18+
- Connector patterns follow ADR-003 (Connector Registry)
19+
- Memory tier usage follows ADR-007
20+
- MCP tool exposition follows ADR-004
2121
- Data enrichment guardrails are enforced (no AI-generated content without source data)
2222

2323
2. **Architecture_Patterns agent must confirm**:
@@ -149,4 +149,4 @@ If `apps/crud-service/` changes:
149149
Default: **Squash and merge** (preferred for feature branches).
150150

151151
### Branch Naming Convention
152-
Follows ADR-022 pattern. Branches are ephemeral — delete after merge.
152+
Follows ADR-018 pattern. Branches are ephemeral — delete after merge.

.github/agents/data/holiday-peak-hub.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ structure:
3737
adrs:
3838
- id: ADR-003
3939
rule: All retail integrations via adapters — agents NEVER call retailer APIs directly
40-
- id: ADR-005
40+
- id: ADR-004
4141
rule: FastAPI + MCP for dual exposition
42-
- id: ADR-008
42+
- id: ADR-007
4343
rule: Three-tier memory (Redis/Cosmos/Blob)
44-
- id: ADR-010
44+
- id: ADR-004
4545
rule: Dual exposition (REST + MCP)
46-
- id: ADR-012
46+
- id: ADR-003
4747
rule: Domain-driven adapter boundaries, composition over inheritance
48-
- id: ADR-013
48+
- id: ADR-010
4949
rule: SLM-first routing
5050

5151
existing_connectors:

.github/agents/pr-evaluator.agent.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ Check the issue's task list against PR changes:
288288

289289
### Step 4: Architecture Sign-off
290290
Coordinate with Architecture_Patterns agent:
291-
- Event schemas follow ADR-005 patterns
291+
- Event schemas follow ADR-006 patterns
292292
- Webhook → Event Hub → Consumer flow matches the documented architecture
293-
- Idempotency pattern aligns with ADR-007 (Saga/Choreography at-least-once delivery)
293+
- Idempotency pattern aligns with ADR-006 (Saga/Choreography at-least-once delivery)
294294
- No AI content generation without source data (guardrails ADR)
295295

296296
### Step 5: Merge
@@ -336,17 +336,17 @@ holiday-peak-hub/
336336
| ADR | Title | Impact on PR Review |
337337
|-----|-------|---------------------|
338338
| ADR-003 | Adapter Pattern | All integrations via adapters, never direct API calls |
339-
| ADR-005 | FastAPI + MCP | Dual exposition pattern |
340-
| ADR-007 | Saga/Choreography | Event-driven patterns, at-least-once delivery |
341-
| ADR-008 | Memory Tiers | Redis/Cosmos/Blob usage |
342-
| ADR-010 | REST + MCP Exposition | Endpoint conventions |
343-
| ADR-012 | Adapter Boundaries | Domain-driven, composition over inheritance |
344-
| ADR-013 | Model Routing | SLM-first, upgrade to LLM |
345-
| ADR-014 | Memory Partitioning | Partition key strategy |
346-
| ADR-021 | azd-first Deployment | Deployment workflow conventions |
347-
| ADR-022 | Branch Naming | Branch prefix + issue ID |
348-
| ADR-024 | Connector Registry | Connector discovery + health patterns |
349-
| ADR-025 | Product Truth Layer | Truth layer data flow |
339+
| ADR-004 | FastAPI + MCP | Dual exposition pattern |
340+
| ADR-006 | Saga/Choreography | Event-driven patterns, at-least-once delivery |
341+
| ADR-007 | Memory Tiers | Redis/Cosmos/Blob usage |
342+
| ADR-004 | REST + MCP Exposition | Endpoint conventions |
343+
| ADR-003 | Adapter Boundaries | Domain-driven, composition over inheritance |
344+
| ADR-010 | Model Routing | SLM-first, upgrade to LLM |
345+
| ADR-007 | Memory Partitioning | Partition key strategy |
346+
| ADR-017 | azd-first Deployment | Deployment workflow conventions |
347+
| ADR-018 | Branch Naming | Branch prefix + issue ID |
348+
| ADR-003 | Connector Registry | Connector discovery + health patterns |
349+
| ADR-020 | Product Truth Layer | Truth layer data flow |
350350

351351
### CI/CD Pipeline Dependencies
352352
```
@@ -385,7 +385,7 @@ manual trigger
385385

386386
## Branch Naming Convention
387387

388-
Follow ADR-022: `<prefix>/<issue-id>-<short-description>`
388+
Follow ADR-018: `<prefix>/<issue-id>-<short-description>`
389389
- `feature/` — new capabilities
390390
- `bug/` — defect fixes
391391
- `hotfix/` — urgent production fixes

.github/agents/ui-agent.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: UIDesigner
33
description: "Builds inclusive interfaces with semantic HTML, WCAG 2.2 AA/AAA compliance, CSS Grid/Flexbox/Container Queries, fluid typography (clamp), logical properties for RTL, and Core Web Vitals optimization. Supports web (Tailwind), CLI (Ink), and desktop platforms."
44
argument-hint: "Audit this dashboard component for WCAG 2.2 AA compliance, optimize LCP/CLS scores, and add responsive Container Query breakpoints"
5-
tools: ['execute', 'read', 'edit', 'search', 'web', 'agent', 'todo']
5+
tools: [execute/runNotebookCell, execute/getTerminalOutput, execute/killTerminal, execute/sendToTerminal, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, execute/testFailure, read/getNotebookSummary, read/problems, read/readFile, read/viewImage, read/readNotebookCellOutput, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, agent/runSubagent, edit/createDirectory, edit/createFile, edit/createJupyterNotebook, edit/editFiles, edit/editNotebook, edit/rename, search/changes, search/codebase, search/fileSearch, search/listDirectory, search/textSearch, search/usages, web/fetch, web/githubRepo, azure-mcp/search, browser/openBrowserPage, browser/readPage, browser/screenshotPage, browser/navigatePage, browser/clickElement, browser/dragElement, browser/hoverElement, browser/typeInPage, browser/runPlaywrightCode, browser/handleDialog, todo]
66
user-invocable: true
77
disable-model-invocation: false
88
---

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Use this mapping to know the current vs. former names—so you can correctly int
9797

9898
## Git Branch Naming Convention
9999

100-
- Follow the branch naming convention defined in [ADR-022](../docs/architecture/adrs/adr-022-branch-naming-convention.md).
100+
- Follow the branch naming convention defined in [ADR-018](../docs/architecture/adrs/adr-018-branch-naming-convention.md).
101101
- **Branch prefixes**: `feature/`, `issue/`, `bug/`, `hotfix/`, `docs/`, `chore/`.
102102
- **Format**: `<prefix>/<issue-id>-<short-description>` (e.g., `feature/42-cart-intelligence`).
103103
- Always use **lowercase** with **hyphens** as word separators.

.github/prompts/fix-issues-pipeline.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Investigate and resolve the described issue through a fully tracked GitHub workf
5454
## Phase 3: Branch & Implementation
5555

5656
1. **Create Branch** — From the default branch (`main`), create:
57-
- `bug/<issue-number>-<short-description>` (per ADR-022 branch naming convention)
57+
- `bug/<issue-number>-<short-description>` (per ADR-018 branch naming convention)
5858

5959
2. **Implement Fix** — Delegate to the appropriate specialist agents via `#runSubagent`:
6060

.github/workflows/deploy-azd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ jobs:
440440
azd env set KEDA_ENABLED true -e "${{ inputs.environment }}"
441441
# PostgreSQL auth: use password for dev until Entra AD admin is configured
442442
# in Bicep (administrators param on AVM PostgreSQL module). Enabling
443-
# activeDirectoryAuth without an admin has no effect — see ADR-033 follow-up.
443+
# activeDirectoryAuth without an admin has no effect — see ADR-017 follow-up.
444444
azd env set POSTGRES_AUTH_MODE password -e "${{ inputs.environment }}"
445445
446446
- name: Install kubelogin
@@ -2025,7 +2025,7 @@ jobs:
20252025
export AZURE_CLIENT_ID="${WORKLOAD_AZURE_CLIENT_ID}"
20262026
CRUD_IMAGE_REF=$(tr -d '\r\n' < "${RUNNER_TEMP}/tested-image/crud-service/image-ref.txt")
20272027
2028-
# Phase B (ADR-033): Render only — Flux reconciles from Git
2028+
# Phase B (ADR-017): Render only — Flux reconciles from Git
20292029
export SERVICE_CRUD_SERVICE_IMAGE_NAME="$CRUD_IMAGE_REF"
20302030
bash .infra/azd/hooks/render-helm.sh crud-service
20312031
echo "Rendered CRUD manifest for Flux reconciliation (image: ${CRUD_IMAGE_REF})."
@@ -2675,7 +2675,7 @@ jobs:
26752675
SERVICE_IMAGE_VAR_NAME="SERVICE_$(printf '%s' "$SERVICE_NAME" | tr '[:lower:]-' '[:upper:]_')_IMAGE_NAME"
26762676
export "${SERVICE_IMAGE_VAR_NAME}=${IMAGE_REF}"
26772677
2678-
# Phase B (ADR-033): Render only — Flux reconciles from Git
2678+
# Phase B (ADR-017): Render only — Flux reconciles from Git
26792679
bash .infra/azd/hooks/render-helm.sh "$SERVICE_NAME"
26802680
echo "Rendered ${SERVICE_NAME} manifest for Flux reconciliation (image: ${IMAGE_REF})."
26812681
env:
@@ -3432,7 +3432,7 @@ jobs:
34323432
SHARED_GATEWAY_NAME="holiday-peak-agc"
34333433
SHARED_GATEWAY_NAMESPACE="holiday-peak-crud"
34343434
3435-
# Architecturally approved contract (ADR-033):
3435+
# Architecturally approved contract (ADR-021):
34363436
# - Shared AGC uses an in-cluster ApplicationLoadBalancer CR that the
34373437
# ALB controller manages — creating and maintaining the ARM
34383438
# trafficController resource automatically.
@@ -3465,7 +3465,7 @@ jobs:
34653465
34663466
mapfile -t TRAFFIC_CONTROLLER_IDS < <(az resource list -g "$AKS_NODE_RESOURCE_GROUP" --resource-type Microsoft.ServiceNetworking/trafficControllers --query '[].id' -o tsv)
34673467
if [ "${#TRAFFIC_CONTROLLER_IDS[@]}" -eq 0 ]; then
3468-
echo "::error::No Azure Application Gateway for Containers trafficControllers were found in node resource group '$AKS_NODE_RESOURCE_GROUP'. Per ADR-033 the shared ALB must be ARM-provisioned by Bicep." >&2
3468+
echo "::error::No Azure Application Gateway for Containers trafficControllers were found in node resource group '$AKS_NODE_RESOURCE_GROUP'. Per ADR-021 the shared ALB must be ARM-provisioned by Bicep." >&2
34693469
exit 1
34703470
fi
34713471
@@ -3527,7 +3527,7 @@ jobs:
35273527
35283528
echo "Live shared Gateway evidence: ${GATEWAY_CONTRACT_EVIDENCE}"
35293529
3530-
# ADR-033 (updated): require in-cluster managed ALB binding via alb-name/alb-namespace.
3530+
# ADR-021 (updated): require in-cluster managed ALB binding via alb-name/alb-namespace.
35313531
# The BYO alb-id annotation mode is no longer used — ALB controller manages the TC lifecycle.
35323532
if [ -n "$AGC_SHARED_ALB_ID" ]; then
35333533
echo "::warning::Live shared Gateway '$SHARED_GATEWAY_NAME' carries a BYO alb-id annotation ('${AGC_SHARED_ALB_ID}'). The approved binding mode is now managed (alb-name/alb-namespace). ${GATEWAY_CONTRACT_EVIDENCE}"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ DocProject/Help/html
198198
# Click-Once directory
199199
publish/
200200

201-
# Flux reconciles rendered manifests from Git (ADR-033).
201+
# Flux reconciles rendered manifests from Git (ADR-017).
202202
# Only kustomization.yaml is tracked; per-service all.yaml files are committed
203203
# by the CI deploy workflow after render-helm.sh generates them.
204204
# .kubernetes/rendered/ — no longer ignored

0 commit comments

Comments
 (0)