-
Notifications
You must be signed in to change notification settings - Fork 1
Architecture Deep Dive
Canary follows a strictly layered, modular pipeline. Each component has a single responsibility, ensuring the system is extensible and vendor-agnostic.
The entry point of intelligence. It uses rule-based intent detection to
analyze the user's prompt. It categorizes the request into test types
like e2e_ui, api, performance, or unit.
The decision engine. It consults the Framework Registry
(agent/frameworks/registry.json) to select the best tool for the
detected test type. It considers strengths, maturity, and ecosystem
alignment.
The system kernel. It coordinates the entire flow:
- Receives input.
- Invokes Classifier & Recommender.
- Builds the LLM generation prompt.
- Calls the LLM Client.
- Writes the generated code to the filesystem.
- (Optional) Invokes the Executor for the feedback loop.
The abstraction layer.
- Factory: Dynamically selects the provider (OpenAI, Gemini, Mock).
- Providers: Implements specific vendor logic, ensuring the rest of the system never "speaks" directly to an API.
The mechanical hand. It runs the generated code in a secure subprocess, capturing exit codes and standard error for the self-healing loop.
User Prompt → CLI → Orchestrator → Classifier → Recommender →
LLM → Executor → Error Feedback → LLM (Fix) → Final Test Output
Canary includes a _sanitize_extension layer to prevent path traversal
and ensure that all generated files follow a strict whitelist of allowed
extensions (.ts, .py, .js, etc.).