Architecture Overview¶
This document provides a high-level overview of SuperQode's internal architecture, explaining how the various subsystems work together to deliver agentic quality engineering.
System Architecture¶
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SUPERQODE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ CLI / TUI โ โ Web Server โ โ LSP Server โ โ
โ โ Interface โ โ (Dashboard) โ โ (IDE) โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโ โ
โ โ Execution Pipeline โ โ
โ โ (Request -> QR Report) โ โ
โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Workspace โ โ Agent Runtime โ โ QR Generator โ โ
โ โ Manager โ โ (Prompts + Tools) โ โ (Reports) โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
โ โ โ โ โ
โ โ โโโโโโโโโโโโดโโโโโโโโโโโ โ โ
โ โ โ โ โ โ
โ โผ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Snapshot โ โ Provider โ โ Tools โ โ Artifacts โ โ
โ โ & Revert โ โ Gateway โ โ System โ โ Storage โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ BYOK โ โ ACP โ โ Local โ โ
โ โ (LiteLLM) โ โ (Agents) โ โ (Ollama) โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Safety & Permissions Layer โ โ
โ โ (Sandbox, Approvals, Dangerous Op Detection) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Core Subsystems¶
1. Execution Pipeline¶
The execution pipeline orchestrates the entire QE session lifecycle:
| Component | Location | Responsibility |
|---|---|---|
| Runner | execution/runner.py | Coordinates QE session execution |
| Modes | execution/modes.py | Quick vs Deep mode configuration |
| Resolver | execution/resolver.py | Resolves roles and execution targets |
| NL Parser (Enterprise) | Enterprise module | Parses natural language requests |
| NL Executor (Enterprise) | Enterprise module | Executes parsed commands |
Data Flow:
User Request
โ
โผ
NL Parser (parse intent, extract targets)
โ
โผ
Role Resolver (select appropriate QE roles)
โ
โผ
Execution Runner (orchestrate session)
โ
โโโโบ Workspace Manager (create sandbox)
โ
โโโโบ Agent Runtime (execute with tools)
โ
โโโโบ QR Generator (create reports)
โ
โโโโบ Artifact Storage (persist results)
2. Workspace Manager¶
The workspace manager provides ephemeral, isolated environments for testing:
| Component | Location | Responsibility |
|---|---|---|
| Manager | workspace/manager.py | Orchestrates workspace lifecycle |
| Snapshot | workspace/snapshot.py | File-based isolation |
| Git Snapshot | workspace/git_snapshot.py | Git stash-based isolation |
| Worktree | workspace/worktree.py | Git worktree isolation |
| Git Guard | workspace/git_guard.py | Prevents accidental commits |
| Diff Tracker | workspace/diff_tracker.py | Tracks all changes |
| Artifacts | workspace/artifacts.py | Manages QE artifacts |
| Watcher | workspace/watcher.py | File system monitoring |
| Coordinator | workspace/coordinator.py | Multi-agent coordination |
3. Agent Runtime¶
The agent runtime manages AI agent interactions:
| Component | Location | Responsibility |
|---|---|---|
| Agent Loop | agent/loop.py | Main agent execution loop |
| System Prompts | agent/system_prompts.py | Base system prompts |
| QE Expert Prompts (Enterprise) | Enterprise module | Role-specific prompts |
| Edit Strategies | agent/edit_strategies.py | Code modification strategies |
| Tool Call | tool_call.py | Tool invocation handling |
| Agent Stream | agent_stream.py | Streaming response handling |
4. Provider Gateway¶
The provider gateway abstracts different AI model sources:
| Component | Location | Responsibility |
|---|---|---|
| Manager | providers/manager.py | Provider lifecycle management |
| Registry | providers/registry.py | Provider registration |
| Models | providers/models.py | Model definitions |
| Health | providers/health.py | Provider health checks |
| Usage | providers/usage.py | Token/cost tracking |
| LiteLLM Gateway | providers/gateway/litellm_gateway.py | BYOK provider |
| OpenResponses | providers/gateway/openresponses_gateway.py | OpenResponses provider |
5. Tools System¶
The tools system provides capabilities to AI agents:
| Component | Location | Responsibility |
|---|---|---|
| Base | tools/base.py | Base tool classes |
| File Tools | tools/file_tools.py | File read/write operations |
| Edit Tools | tools/edit_tools.py | Code editing |
| Shell Tools | tools/shell_tools.py | Command execution |
| Search Tools | tools/search_tools.py | Code search |
| Web Tools | tools/web_tools.py | Web fetching |
| LSP Tools | tools/lsp_tools.py | Language server integration |
| Permissions | tools/permissions.py | Tool permission enforcement |
| Validation | tools/validation.py | Input/output validation |
6. Safety & Permissions¶
The safety layer ensures secure operation:
| Component | Location | Responsibility |
|---|---|---|
| Permission Rules | permissions/rules.py | Permission rule engine |
| Sandbox | safety/sandbox.py | Sandbox enforcement |
| Warnings | safety/warnings.py | Safety warning system |
| Danger Detection | danger.py | Dangerous operation detection |
| Approval | approval.py | User approval workflow |
7. QR Generator¶
The QR (Quality Report) generator creates research-grade reports:
| Component | Location | Responsibility |
|---|---|---|
| Generator | qr/generator.py | Report generation |
| Templates | qr/templates.py | Report templates |
| Dashboard | qr/dashboard.py | QR visualization |
8. SuperQE Orchestrator¶
The SuperQE orchestrator coordinates multi-role sessions:
| Component | Location | Responsibility |
|---|---|---|
| Orchestrator | superqe/orchestrator.py | Multi-role coordination |
| Session | superqe/session.py | QE session management |
| Roles | superqe/roles.py | Role definitions |
| Verifier | superqe/verifier.py | Fix verification |
| Noise Filter | superqe/noise.py | False positive filtering |
| Events | superqe/events.py | JSONL event streaming |
| Constitution | superqe/constitution/ | Behavior constraints |
| Frameworks | superqe/frameworks/ | Test framework support |
| Skills | superqe/skills/ | Reusable QE skills |
Request Lifecycle¶
A complete QE session follows this lifecycle:
1. REQUEST
User runs: superqe run . --mode quick -r security_tester
2. PARSE
- CLI parses arguments
- Resolves roles from registry
- Determines execution mode
3. WORKSPACE SETUP
- Creates ephemeral workspace (snapshot/worktree)
- Initializes git guard
- Starts diff tracking
4. AGENT EXECUTION
- Loads role-specific prompts
- Connects to provider (BYOK/ACP/Local)
- Executes agent loop with tools
- Handles tool calls (file, shell, search)
5. VERIFICATION
- Verifies findings
- Filters noise/false positives
- Validates suggested fixes
6. REPORT GENERATION
- Generates QR (Quality Report)
- Creates patches for fixes
- Generates test files
7. ARTIFACT STORAGE
- Saves QR to .superqode/qe-artifacts/
- Stores patches and tests
- Records session metadata
8. CLEANUP
- Reverts all workspace changes
- Restores original code
- Preserves artifacts only
Configuration Flow¶
superqode.yaml (project)
โ
โผ
~/.superqode.yaml (user)
โ
โผ
Environment Variables
โ
โผ
CLI Arguments (highest priority)
Module Dependencies¶
CLI/TUI
โ
โโโโบ commands/* (Click commands)
โ
โโโโบ execution/* (Pipeline)
โ โ
โ โโโโบ workspace/* (Isolation)
โ โ
โ โโโโบ agent/* (Runtime)
โ โ โ
โ โ โโโโบ tools/* (Capabilities)
โ โ
โ โโโโบ superqe/* (Orchestration)
โ
โโโโบ providers/* (Model access)
โ
โโโโบ safety/* (Security)
โ
โโโโบ qr/* (Reporting)
Extension Points¶
SuperQode can be extended at these points:
| Extension Point | Location | How to Extend |
|---|---|---|
| Custom Roles | superqe/roles.py | Add role definitions |
| New Tools | tools/ | Implement base tool class |
| Providers | providers/gateway/ | Add gateway implementation |
| Frameworks | superqe/frameworks/ | Add test framework support |
| Skills | superqe/skills/ | Add reusable QE skills |
Related Documentation¶
- Execution Pipeline - Detailed execution flow
- Workspace Internals - Isolation mechanisms
- Safety & Permissions - Security model
- Tools System - Tool development
- Session Management - Session persistence