Skip to content

feat: refactor canbank-iag and fix gemini bug#81

Merged
cowan-macady merged 1 commit into
masterfrom
upd-iag-mcp2
Jul 21, 2026
Merged

feat: refactor canbank-iag and fix gemini bug#81
cowan-macady merged 1 commit into
masterfrom
upd-iag-mcp2

Conversation

@cowan-macady

@cowan-macady cowan-macady commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

implement ENG-8488

Copilot AI review requested due to automatic review settings July 20, 2026 22:32
@cowan-macady
cowan-macady requested a review from a team as a code owner July 20, 2026 22:32
@deepsource-io

deepsource-io Bot commented Jul 20, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in a69f0aa...6e12506 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 new api/_dataset.py loader.
  • 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.

Comment on lines +118 to +140
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);
}
}
});

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.

updated

Comment thread canbank-iag/api/_dataset.py Outdated
Comment on lines +12 to +15
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.

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.

updated

Comment thread canbank-iag/data/iag/manifest.json Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 22:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 36 changed files in this pull request and generated 2 comments.

Comment thread canbank-iag/README.md Outdated
Comment on lines +118 to +122
<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>

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.

updated

Copilot AI review requested due to automatic review settings July 20, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 43 changed files in this pull request and generated 1 comment.

Comment on lines +100 to +106
e.preventDefault();
submitBtn.disabled = true;
submitBtn.textContent = 'Creating…';
progressBox.classList.remove('d-none');
resultBox.classList.add('d-none');
stepLog.innerHTML = '';

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.

updated

Copilot AI review requested due to automatic review settings July 20, 2026 23:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 43 changed files in this pull request and generated 1 comment.

Comment thread canbank-iag/templates/provision/run_form.html
@cowan-macady
cowan-macady requested review from chahalarora and marvinkite and removed request for chahalarora July 20, 2026 23:14
@cowan-macady
cowan-macady merged commit ca8e7e7 into master Jul 21, 2026
10 of 11 checks passed
@cowan-macady
cowan-macady deleted the upd-iag-mcp2 branch July 21, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants