{% extends "base.html" %} {% block title %}AI Augmentation Canvas — ICDEV™{% endblock %} {% block content %}
CUI // SP-CTI

AI Augmentation Canvas

Detect AI-augmentable patterns · Score opportunities · Generate modernization roadmap

{% if roadmap %}
{% endif %}

New Scan

{% if roadmap and roadmap.phases %}
{{ opportunities|length }}
Opportunities
{{ roadmap.total_effort_days }}
Est. Days
{{ roadmap.phases|length }}
Phases
{% if scans %}
{{ scans[0].total_files }}
Files Scanned
{% endif %}

Migration Workflow

🔍
1. Detect
Semgrep + AST
pattern scan
📈
2. Score
Value · Feasibility
Risk composite
📋
3. Phase
P1 Quick Wins
P2 Core · P3 Long
4. Implement
Kanban tasks
sprint planning
🚀
5. Deploy
CI/CD gated
agent rollout

Roadmap Phases

{{ roadmap.title }}
{% set phase_colors = {'P1': {'bg': '#1a2e1a', 'border': '#16a34a', 'label': '#4ade80', 'badge': '#14532d'}, 'P2': {'bg': '#1a1a2e', 'border': '#4f46e5', 'label': '#818cf8', 'badge': '#1e1b4b'}, 'P3': {'bg': '#2e1a0e', 'border': '#b45309', 'label': '#f59e0b', 'badge': '#451a03'}} %} {% for phase in roadmap.phases %} {% set ph_key = phase.phase_id if phase.phase_id else 'P3' %} {% set colors = phase_colors.get(ph_key, phase_colors['P3']) %}
{{ ph_key }} {{ phase.label.split('—')[1].strip() if '—' in phase.label else phase.label }}
{{ phase.count }} opportunities · {{ phase.total_effort_days }}d
{% if phase.opportunities %}
{% for opp in phase.opportunities %} {% endfor %}
Module Pattern AI Paradigm Model Score
{{ opp.module_path.split('/')[-1] if '/' in (opp.module_path or '') else (opp.module_path or '—') }} {% set _pt_tips = { 'hardcoded_threshold': 'Literal numeric constant in comparison/arithmetic (e.g. if x > 0.7). Replace with anomaly_detection model to learn thresholds dynamically from historical data.', 'nested_conditionals': 'Decision tree with 3+ nesting levels. Replace with ml_classifier trained on labeled examples.', 'string_template_rendering': 'Template rendering that benefits from LLM-generated, context-aware output.', 'scheduled_cron': 'Time-based trigger — replace with agentic_trigger on event conditions.', 'regex_user_input': 'Regex on user text; nlp_extractor handles variation and ambiguity more robustly.', 'db_render_notify_chain': 'Manual DB→render→notify orchestration; llm_generation pipeline manages context.', 'keyword_list_search': 'Keyword list check; embedding_search enables semantic similarity matching.', 'large_rule_table': 'Dict/map with 10+ business rules; decision_agent reasons with context.' } %} {{ opp.pattern_type or '—' }}{% if _pt_tips.get(opp.pattern_type) %} ⓘ{% endif %} {{ opp.ai_paradigm or '—' }} {% if opp.il_recommended_model %} {{ opp.il_recommended_model }} {% else %}—{% endif %} {% set score = opp.composite_score if opp.composite_score is not none else 0 %} {% set pct = (score * 100)|round(0)|int %} {% if pct >= 70 %}{% set bar_color = '#16a34a' %} {% elif pct >= 50 %}{% set bar_color = '#4f46e5' %} {% else %}{% set bar_color = '#b45309' %}{% endif %}
{{ pct }}%
{% else %}
No opportunities in this phase.
{% endif %}
{% endfor %}

Sprint Timeline

{% set total_days = roadmap.total_effort_days|int %} {% set bar_width = 60 %}
Weeks: {% for w in range(1, (total_days // 5 + 3)) %}W{{ w }}{{ ' ' if loop.index < (total_days // 5 + 3) else '' }}{% endfor %}
{% set ns = namespace(offset=0) %} {% for phase in roadmap.phases %} {% set ph_key = phase.phase_id if phase.phase_id else 'P?' %} {% set days = phase.total_effort_days|int %} {% set start_col = (ns.offset / total_days * bar_width)|int if total_days > 0 else 0 %} {% set width_col = (days / total_days * bar_width)|int if total_days > 0 else 0 %} {% set ph_char = '#' if ph_key == 'P1' else ('=' if ph_key == 'P2' else '-') %} {% set ph_color = '#4ade80' if ph_key == 'P1' else ('#818cf8' if ph_key == 'P2' else '#f59e0b') %}
{{ ph_key }} | {{ ' ' * start_col }}{{ ph_char * [width_col, 1]|max }} {{ days }}d · {{ (days / 5)|round(0)|int }}w
{% set ns.offset = ns.offset + days %} {% endfor %}
{% else %}
🔎
No scan results yet
Enter a source path above and click Run Scan to detect AI-augmentable patterns.
{% endif %} {% if opportunities %}

All Opportunities ({{ opportunities|length }} from latest scan)

{% for opp in opportunities %} {% set score = opp.composite_score if opp.composite_score is not none else 0 %} {% set pct = (score * 100)|round(0)|int %} {% if pct >= 70 %}{% set bar_color = '#16a34a' %} {% elif pct >= 50 %}{% set bar_color = '#4f46e5' %} {% else %}{% set bar_color = '#b45309' %}{% endif %} {% endfor %}
# Module Function Pattern AI Paradigm Model Score
{{ loop.index }} {{ opp.module_path }} {{ opp.function_name }} {% set _at_tips = { 'hardcoded_threshold': 'Literal numeric constant in comparison/arithmetic (e.g. if x > 0.7). Replace with anomaly_detection model.', 'nested_conditionals': '3+ nesting levels of conditional logic. Replace with ml_classifier.', 'string_template_rendering': 'Template rendering; candidate for llm_generation.', 'scheduled_cron': 'Time-based trigger; candidate for agentic_trigger.', 'regex_user_input': 'Regex on user input; candidate for nlp_extractor.', 'db_render_notify_chain': 'DB→render→notify chain; candidate for llm_generation pipeline.', 'keyword_list_search': 'Keyword list check; candidate for embedding_search.', 'large_rule_table': '10+ entry rule dict; candidate for decision_agent.' } %} {{ opp.pattern_type }}{% if _at_tips.get(opp.pattern_type) %} ⓘ{% endif %} {{ opp.ai_paradigm }} {{ opp.il_recommended_model or '—' }}
{{ pct }}%
{% endif %} {% if scans %}

Recent Scans

{% for scan in scans %} {% endfor %}
ID Type Source Summary Files LOC Status Created Actions
#{{ scan.scan_id }} {{ scan.input_type }} {{ scan.input_ref }} {{ (scan.project_summary or '—')[:90] }}{% if scan.project_summary and scan.project_summary|length > 90 %}…{% endif %} {{ scan.total_files }} {{ scan.total_loc }} {% if scan.status == 'completed' %}✓ completed {% elif scan.status == 'running' %}◯ running {% else %}{{ scan.status }} {% endif %} {{ scan.created_at }}
{% endif %} {% include "includes/iqe_query_widget.html" %}
CUI // SP-CTI
{% endblock %}