feat: refactor canbank-iag and fix gemini bug#81
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Secrets | Jul 20, 2026 11:10p.m. | Review ↗ | |
| Python | Jul 20, 2026 11:10p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Pull request overview
This PR refactors the canbank-iag demo app toward “config-as-data” by moving static defaults into a per-dataset manifest, adds a one-click “Provision Everything” workflow to replay the remaining setup steps, and includes updates in the A2A agents to address Gemini/tool-schema and error-reporting issues.
Changes:
- Introduce dataset-backed configuration (
data/<dataset>/manifest.json) and route form defaults through a newapi/_dataset.pyloader. - Add a provisioning UI + API (
/api_provision/run) that streams NDJSON progress and replays post–Getting Started steps. - Update A2A demo agents to harden error formatting and generate explicit array item schemas for Gemini.
Reviewed changes
Copilot reviewed 34 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| canbank-iag/templates/token_introspect/result.html | Removes “Create Another” link from result page. |
| canbank-iag/templates/provision/run_form.html | Adds new provisioning form + streamed progress UI and client-side NDJSON handling. |
| canbank-iag/templates/project/result.html | Removes “Create Another Project” link from result page. |
| canbank-iag/templates/mcp_server/result.html | Removes “Create Another” link from result page. |
| canbank-iag/templates/index.html | Adds a “One-click provisioning” card linking to the provisioning flow. |
| canbank-iag/templates/includes/sidebar.html | Adds sidebar navigation link to “Provision Everything”. |
| canbank-iag/templates/external_data_resolver/result.html | Removes “Create Another” link from result page. |
| canbank-iag/templates/ciq_policy/result.html | Removes “Create Another” link from result page. |
| canbank-iag/templates/ciq_knowledge_query/result.html | Adds conditional “Execute this Query” link after successful creation. |
| canbank-iag/templates/authorization_policy/result.html | Removes “Create Another” link from result page. |
| canbank-iag/templates/application/result.html | Removes “Create Another Application” link from result page. |
| canbank-iag/templates/app_agent/result.html | Removes “Create Another Application Agent” link from result page. |
| canbank-iag/README.md | Updates data paths and documents datasets + manifest-driven defaults. |
| canbank-iag/data/iag/relationships.json | Adds dataset relationship seed data. |
| canbank-iag/data/iag/nodes.json | Adds dataset node seed data. |
| canbank-iag/data/iag/manifest.json | Adds dataset manifest containing CIQ policies/queries, resolvers, and other defaults. |
| canbank-iag/app.py | Registers the new api_provision blueprint and enables its logging. |
| canbank-iag/api/token_introspect.py | Switches token introspect form defaults to come from dataset manifest. |
| canbank-iag/api/relationships.py | Loads relationships seed path from dataset (_dataset.RELATIONSHIPS_PATH). |
| canbank-iag/api/provision.py | Adds provisioning API that runs steps via Flask test client and streams NDJSON progress. |
| canbank-iag/api/project.py | Switches project form defaults to dataset manifest (with env substitution for org id). |
| canbank-iag/api/mcp_server.py | Switches MCP server defaults to dataset manifest. |
| canbank-iag/api/external_data_resolver.py | Moves resolver definitions to dataset manifest while preserving _RESOLVER_DEFS export. |
| canbank-iag/api/ciq_policy.py | Moves CIQ policy definitions to dataset manifest while preserving _POLICY_DEFS export. |
| canbank-iag/api/ciq_knowledge_query.py | Moves CIQ query definitions to dataset manifest; adds execute_path to result context. |
| canbank-iag/api/capture.py | Loads nodes seed path from dataset (_dataset.NODES_PATH). |
| canbank-iag/api/authorization_policy.py | Switches KBAC policy defaults to dataset manifest via _dataset.kbac_form_default(). |
| canbank-iag/api/application.py | Switches application form defaults to dataset manifest. |
| canbank-iag/api/app_agent.py | Switches app-agent defaults (permissions + credential expiry days) to dataset manifest. |
| canbank-iag/api/_dataset.py | Adds dataset loader for manifest + dataset paths and exposes defaults to API modules. |
| canbank-iag/.env.example | Documents/introduces DATASET env var. |
| a2a/iag-mcp-demo/weather_agent/requirements.txt | Pins mcp[cli] version. |
| a2a/iag-mcp-demo/retriever_agent/retriever_agent.py | Improves MCP error formatting, fixes array schema typing for Gemini, adds LLM call error handling. |
| a2a/iag-mcp-demo/retriever_agent/requirements.txt | Pins langchain + mcp[cli] versions. |
| a2a/iag-mcp-demo/analyst_agent/requirements.txt | Pins langchain + mcp[cli] versions. |
| a2a/iag-mcp-demo/analyst_agent/analyst_agent.py | Mirrors retriever_agent fixes (error formatting, array schema typing, LLM call guard). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!response.body) { | ||
| finishWithError('Request failed: ' + response.status); | ||
| return; | ||
| } | ||
|
|
||
| const reader = response.body.getReader(); | ||
| const decoder = new TextDecoder(); | ||
| let buffer = ''; | ||
| while (true) { | ||
| const { value, done } = await reader.read(); | ||
| if (done) break; | ||
| buffer += decoder.decode(value, { stream: true }); | ||
| const lines = buffer.split('\n'); | ||
| buffer = lines.pop(); | ||
| for (const line of lines) { | ||
| const trimmed = line.trim(); | ||
| if (!trimmed) continue; | ||
| let evt; | ||
| try { evt = JSON.parse(trimmed); } catch { continue; } | ||
| handleEvent(evt); | ||
| } | ||
| } | ||
| }); |
| Scaffold scope: currently only the CIQ knowledge queries are sourced from the | ||
| manifest (migrated from ``api/ciq_knowledge_query.py``). Other config sections | ||
| (app agent, mcp server, policies, resolvers, ...) can be added to the manifest | ||
| and exposed here incrementally, following the same pattern. |
5abb028 to
55493dd
Compare
| <p class="text-muted small mb-0">Once the five Getting Started steps above exist, let a | ||
| virtual operator click every remaining button below for you — both captures, the KBAC | ||
| policy, the three external data resolvers, then all CIQ policies and knowledge queries, | ||
| in order. AuthZEN evaluations and CIQ executes are not included; every individual form | ||
| keeps working as before.</p> |
55493dd to
a2179cc
Compare
| e.preventDefault(); | ||
| submitBtn.disabled = true; | ||
| submitBtn.textContent = 'Creating…'; | ||
| progressBox.classList.remove('d-none'); | ||
| resultBox.classList.add('d-none'); | ||
| stepLog.innerHTML = ''; | ||
|
|
implement [ENG-8488]
a2179cc to
6e12506
Compare
implement ENG-8488