Commit Graph

1344 Commits

Author SHA1 Message Date
Maxim 634e1d908f docs(showcase): fix banking docker-compose header infra port comments
Header documented 70xx ports but actual host-port mappings default to
71xx. Update postgres/redis/minio/minio-console/tei comment ports to
match the real mappings. Comment-only; no ports: mapping changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:51 +02:00
Maxim af44459e74 fix(showcase): record approve step before beginRecording resets the feed
In handleApprove for both TransactionsList (transactions-list.tsx) and
PendingApprovalsChat (wow/pending-approvals-chat.tsx) the recorder-feed
narration ran in the wrong order:

    logStep("Approved the charge");
    beginRecording();
    endRecording();

`logStep` early-returns unless `activeRef.current` is true, and that ref is
only set inside `beginRecording()`. Worse, `beginRecording()` calls
`setSteps([])`, resetting the feed. So calling `logStep` first was a no-op and
the "Approved the charge" line never appeared in the recorder HUD.

Reorder to match the correct pattern already used in policy-exception-inline.tsx:

    beginRecording();
    logStep("Approved the charge");
    endRecording();

Adds recording-context.test.tsx (vitest + testing-library): a provider-level
ordering invariant plus a component-level test that clicking Approve in
PendingApprovalsChat lands "Approved the charge" in the feed. RED verified
(step dropped with the inverted order) / GREEN with the fix.

Call-site enumeration (grep logStep/beginRecording/endRecording, all src):
- transactions-list.tsx handleApprove — FIXED (was inverted)
- wow/pending-approvals-chat.tsx handleApprove — FIXED (was inverted)
- policy-exception-inline.tsx handleSubmit — already correct (begin -> logStep -> end)
- transactions-list.tsx:254 / pending-approvals-chat.tsx:184 "Opened the
  exception form" — logStep inside an already-active window; correct
- dashboard/page.tsx, layout.tsx — unconditional nav/tab logStep that
  correctly no-ops when no recording is active; correct
No other site has the inverted begin/log order.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim ad922750cf fix(showcase): align banking memory docs/smoke to kind procedural
The durable memory feature saves kind:"procedural" (route.ts:150) but the
README and drift-smoke script described/seeded kind:"operational", a
doc/code contradiction. Update both to procedural. The learning-tab
back-compat (operational || procedural) is intentionally left untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim 2d9275da1f fix(showcase): correct memory-learning spec path in banking docs
The README, .env.example, and memory-drift-smoke.mjs referenced a
non-existent path 'tests/e2e/memory-learning.spec.ts'. The actual spec
lives at 'e2e/memory-learning.spec.ts' (matching the test:self-learning
script in package.json). Corrected all three references.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 00:47:50 +02:00
Maxim 02c317e55d fix(showcase): resolve rebase fallout in banking demo
Two collisions from rebasing onto main surfaced only at build time (git
didn't flag them since the sides touched different files):

- pending-approvals-chat: a feature commit removed the record-user-action
  seam and migrated its call sites, but this file was added on main later
  and still imported it. Migrate to the same begin/endRecording bracketing
  the sibling approval surfaces use.
- store.reset(): written when DB had no `reports`; main added `reports` to
  the type. Mirror the module-init `Omit<DB, "reports">` seam and re-seed
  reports to [].

Verified: tsc --noEmit clean, next build succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:55:52 +02:00
Maxim 7257068466 feat(showcase): add A2UI Transactions catalog node with status filter
Replace the catalog's fixed PendingTable node with a general Transactions node
that takes a status filter (all | pending | approved | denied, default all);
the agent picks the slice when composing a report and the client binds live
data via useReportData(). render_report's `pendingTable: boolean` param becomes
`transactions: <status>` (presence includes the table). The shared
TransactionsList component and the chat's showPendingApprovals flow are
unchanged — only the A2UI catalog node is generalized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:47 +02:00
Maxim cb50f777ef style(showcase): satisfy lint (no-explicit-any, no-children-prop, react-compiler) + prettier
Post-gate cleanup on the A2UI re-architecture: type the op-builder test helpers
instead of `as any`, disable react/no-children-prop on the RendererProps
render-callback in the StatCard test, drop the manual useMemo in useReportSurface
(the React Compiler can't preserve it; downstream consumers guard on values), and
apply prettier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:46 +02:00
Maxim 128e0894aa test(showcase): rewrite A2UI canvas e2e for the render_report flow
The spec described the abandoned render_a2ui/mirror/injectA2UITool:true path.
Update its docblock + fixture to the render_report backend-tool flow
(injectA2UITool:false, ops detected from the tool result, canvas reads the
agent message stream). Still test.fixme — the aimock fixture isn't wired into
aimock-server.mjs and no headless green run is confirmed; the live path is
verified manually.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:46 +02:00
Maxim 45a9b94fde fix(showcase): re-architect A2UI canvas to injectA2UITool:false + render_report tool
The injectA2UITool:true path stalled: it forced the reasoning agent (gpt-5.4)
to author the full A2UI component JSON inline via the injected tool's streamed
args, so RUN_FINISHED never fired and the surface hung at status:'building'.

Adopt the pattern both working a2ui-canvas apps use (pdf-analyst, genaiui
apartment-finder): injectA2UITool:false + an agent tool that returns
a2ui_operations, which the middleware detects and renders. Adapted to the
built-in TS agent + our bounded catalog:

- render_report: a BuiltInAgent backend tool (execute server-side) taking a
  small selection {title,kpis,charts,pendingTable,summary}; a deterministic
  op-builder expands it into A2UI v0.9 ops. The reasoning model emits only the
  tiny selection, so generation is instant — no stall.
- ReportCanvas now reads the latest a2ui-surface activity ops from the agent
  message stream (useReportSurface) and renders via A2UIProvider +
  SurfaceMessageProcessor + A2UIRenderer with the banking catalog + live
  useReportData. Deletes the legacy surface-bus + mirror-renderer relay.
- CanvasProvider derives active-surface from the stream + a local dismiss.
- wrapper: status-only a2ui-surface renderer (handoff pill); drop includeSchema.

Verified live: report prompt paints KPIs + charts on the canvas with live
figures, run completes in ~100ms, zero console errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:45 +02:00
Maxim fd7ca293ba refactor(showcase): drop dead surfaceIdRef + use cn convention (A2UI canvas)
Post-review cleanup: remove the write-only surfaceIdRef in ReportCanvas
(surfaceId is read from the bus snapshot at render) and switch renderers.tsx
from direct clsx to the app-wide cn helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:45 +02:00
Maxim e17a389135 test(showcase): A2UI canvas e2e + surface testid
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:44 +02:00
Maxim 5f21e23f4d test(showcase): A2UI banking StatCard renderer unit tests
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:44 +02:00
Maxim 36df34bd34 feat(showcase): wire A2UI (runtime tool, catalog context, mirror, canvas, chip)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:41:43 +02:00
Maxim 0567e5871c feat(showcase): swap content region for the A2UI report canvas
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:39 +02:00
Maxim 895a3021b9 feat(showcase): CanvasProvider + ReportCanvas (A2UI surface render slot)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:39 +02:00
Maxim 961d847abc feat(showcase): A2UI mirror renderer → surface bus + chat pill
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:38 +02:00
Maxim b9e6392f42 feat(showcase): assemble A2UI banking catalog (createCatalog + schema)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:38 +02:00
Maxim a3641eb092 feat(showcase): A2UI banking catalog renderers (live-data widgets)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:37 +02:00
Maxim 516ff6b3f5 feat(showcase): A2UI banking catalog definitions
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:37 +02:00
Maxim 34dbef4e30 feat(showcase): report-data context for A2UI banking renderers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:37 +02:00
Maxim 8972b6f5af feat(showcase): add A2UI renderer dep + surface bus (banking canvas)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:40:36 +02:00
github-actions[bot] c76a7940b1 style: auto-fix formatting 2026-07-02 19:37:34 +02:00
Maxim 1bf8c44c5d fix(showcase): load aimock e2e fixtures via addFixtures (LLMock ignored options.fixtures)
new LLMock({ fixtures }) stores options but never copies fixtures into the
server, so the mock served 0 fixtures and every agent LLM turn 404'd. Register
the loaded fixtures with server.addFixtures() and report the served count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:33 +02:00
Maxim f1662bc6c8 fix(showcase): migrate durable memory kind operational -> procedural
A fresh build of the Intelligence composite from current HEAD restricts memory
kind to {semantic, episodic, procedural} and rejects the legacy "operational"
kind the demo was written against (verified: operational -> HTTP 400, procedural
-> 201 against the freshly-built local composite). Migrate the over-limit
procedure write + agent prompts + inspector + unit test/e2e seed/fixture to the
project-scoped "procedural" kind so the demo works on a fresh local build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:33 +02:00
Maxim 1c18b2f3d8 feat(showcase): /dev/reset also forgets learned procedure (booth replay)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:32 +02:00
Maxim 638957e070 feat(showcase): forgetAllMemories helper to clear durable memory (scope-complete)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:32 +02:00
Maxim f807238250 test(showcase): open the docked chat + target input by placeholder in memory e2e
First real run of the e2e (browser was never installed) surfaced that both
tests assumed the chat was already open. The docked CopilotSidebar starts
closed, so getByRole('textbox') had nothing to fill. Open it via the 'Open chat'
launcher first, and target the input by its 'Type a message...' placeholder
(robust against the Memory tab's recall input). Selectors verified live against
the running app via Playwright.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:32 +02:00
github-actions[bot] 5f77e8696a style: auto-fix formatting 2026-07-02 19:37:31 +02:00
Maxim 5544011a93 docs(showcase): document Glass Engine advanced mode + satisfy set-state-in-effect lint
- README: two-gate Glass Engine section (availability + activation).
- Add justified eslint-disable for async fetch-on-mount + localStorage hydration
  (react-hooks/set-state-in-effect false positives — setState is post-await /
  intentional client-only hydration).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:31 +02:00
Maxim 5072792244 test(showcase): e2e — Glass Engine inspector (gate set, streams events + shows learned procedure)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:30 +02:00
Maxim 00f20b59b8 feat(showcase): wire Glass Engine — server flag, providers, conditional mount, toggle, padding
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:37:30 +02:00
Maxim 970bc9915d fix(showcase): cast CSS custom property to satisfy next build typecheck
Pre-existing: `next build` failed type-check on chat-inbox.tsx's
`style={{ "--inbox-width" }}` (not allowed by React.CSSProperties without a
cast). Unrelated to Glass Engine; surfaced while running the build gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:36:22 +02:00
Maxim 0f9524f1a9 feat(showcase): Glass Engine inspector pane shell (gates on active)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:43 +02:00
Maxim 7d38b93cf8 feat(showcase): Glass Engine Learning tab (event-driven teach->save->recall)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:43 +02:00
Maxim 8d9af0778d feat(showcase): Glass Engine Memory tab (event-driven recall + reframed list)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:43 +02:00
Maxim 9a805c1f78 feat(showcase): /api/memories proxy routes (404 availability gate + OSS degrade)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:42 +02:00
Maxim 9b1225ae19 feat(showcase): REST /api/memories/recall caller with per-user TTL cache
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:42 +02:00
Maxim 4090aa64e0 refactor(showcase): extract shared resolveUserId for runtime + memory proxy
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:42 +02:00
Maxim 8ca184f91a feat(showcase): Glass Engine Timeline tab
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:41 +02:00
Maxim 1cb63e654c feat(showcase): AG-UI event subscription bridge for the inspector
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:41 +02:00
Maxim 03201c8ba6 feat(showcase): inspector store (React context) for timeline cards
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:40 +02:00
Maxim 5239a6ce4c feat(showcase): AG-UI event->timeline-card mapping (banking-trimmed)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:40 +02:00
Maxim f7a80553d0 feat(showcase): GlassEngine context with availability + activation gates
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:40 +02:00
Maxim a6b380691f feat(showcase): GLASS_ENGINE_AVAILABLE deployment gate helper
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:39 +02:00
Maxim 88e2d072c4 test(showcase): add vitest unit runner to banking demo
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:39 +02:00
Maxim 24cc2d3829 fix(showcase): enable Enterprise Learning so banking memory tools attach
The durable-memory demo depends on the Intelligence platform's recall_memory /
save_memory tools, which are served from `${apiUrl}/mcp` and attached to the
local BuiltInAgent run via MCP middleware ONLY when CopilotKitIntelligence is
constructed with `enableEnterpriseLearning: true` (gated in
attachIntelligenceEnterpriseLearning). The banking route never set the flag, so
in any real (non-aimock) run the memory tools never loaded: save_memory was a
no-op during teaching and recall_memory was absent, making the agent re-offer
workflow recording on every over-limit charge instead of recalling the learned
procedure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:38 +02:00
Maxim 4730301c4c fix(showcase): bump banking agent gpt-5.4-mini -> gpt-5.4 for reliable tool routing
The teach-flow's multi-step tool sequencing is the weak spot for the mini model;
the non-mini gpt-5.4 follows the recall->offer->demonstrate->save routing far
more consistently. openai/gpt-5.4 is the alias already used across the repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:38 +02:00
Maxim ec946821bb fix(showcase): offer card shows 'Recording started', not 'not recording', after Start
My collapse fix branched on isRecording, but the render closure captures a stale
isRecording (false), so clicking 'Start recording' wrongly collapsed the card to
'Okay — not recording.'. Branch on the resolved `result` instead (fresh on
complete, like the save card): onDeny resolves 'declined' -> 'not recording';
onApprove resolves the directive -> 'Recording started'. Drops the now-unused
isRecording destructure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:38 +02:00
Maxim 57fb3bd64f fix(showcase): remove conflicting over-limit routing cues + temperature 0
The 'Record a workflow?' card appeared inconsistently because two intro prompt
lines still steered the agent the wrong way on an over-limit approve — 'review
... over-limit charges -> showPendingApprovals' and 'showApprovalFlow -> explain
how an over-limit charge gets cleared' — competing with the recall->offer block.
Scope both to browse/explain only and exclude them from the approve path, and
drop the agent temperature 0.3 -> 0 so it picks the same route every time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:37 +02:00
Maxim 744f064621 fix(showcase): collapse the save + demonstrate teach cards once resolved
Same lingering-button bug as the offer card: saveLearnedWorkflow and
awaitDashboardDemonstration only special-cased status 'inProgress', so after
clicking 'Save workflow' / 'I'm done' the card kept its button (confusing —
looked like nothing happened, though the save/respond went through). Add a
status 'complete' branch that collapses each to a static line, using the HITL
render's 'result' to show saved vs discarded / finished vs cancelled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:33:37 +02:00