Cognifix is a command-line debugging agent that automatically detects programming errors, applies corrective fixes, and re-executes programs to validate successful execution.
The tool introduces a self-correcting execution pipeline that reduces the time developers spend identifying and fixing repetitive runtime errors.
Debugging is one of the most time-consuming tasks in software development. Developers often encounter common issues such as:
- Syntax errors
- Runtime exceptions
- Undefined variables
- Logical mistakes
- Incorrect calculations
Cognifix automates this process by executing code, capturing failures, and applying automated fixes until the program runs successfully.
Cognifix detects the programming language of the provided source file.
Each language is executed through a dedicated runtime engine.
Applies immediate fixes for common errors to restore execution quickly.
Performs deeper analysis of runtime errors and applies structured fixes.
After each fix, Cognifix automatically re-runs the program until it executes successfully or reaches the retry limit.
The system is designed to support additional languages and debugging strategies with minimal changes.
Cognifix follows a modular debugging pipeline.
Source Code
│
▼
Language Detector
│
▼
Execution Engine
│
▼
Error Capture
│
▼
Repair Strategy
(QuickFix / DeepFix)
│
▼
Re-Execution
Each component is independent, making the system easier to extend and maintain.
cognifix
│
├── main.py
│ CLI entry point
│
├── agent.py
│ Core debugging pipeline
│
├── language_detector.py
│ Language identification logic
│
├── engines
│ ├── python_engine.py
│ ├── javascript_engine.py
│ └── c_engine.py
│
├── modes
│ ├── quickfix.py
│ └── deepfix.py
│
├── test_programs
│ ├── test_code.py
│ ├── calculator_program.py
│ ├── grading_system.py
│ └── pi_program.py
│
└── README.md
Clone the repository.
git clone https://github.com/Tharshini272006/cognifix.git
cd cognifix
Ensure the following runtimes are installed:
- Python
- Node.js (for JavaScript execution)
- GCC (for C programs)
Run Cognifix from the command line.
python main.py test_programs/test_code.py --mode quickfix
python main.py test_programs/test_code.py --mode deepfix
Starting Cognifix...
Detected language: python
Error detected:
ZeroDivisionError: division by zero
Applying QuickFix...
Program executed successfully
Modularity
Execution engines and repair strategies are implemented as separate modules.
Extensibility
New languages and debugging strategies can be integrated without changing the core pipeline.
Fault Tolerance
Programs are executed multiple times until a fix succeeds or the retry limit is reached.
- Create a new engine inside
engines/ - Implement a runner function
- Register the engine inside
agent.py
Example:
engines/java_engine.py
Create a new debugging strategy inside the modes/ directory and integrate it into the debugging loop.
- AI-assisted debugging using LLMs
- IDE integrations (VS Code extension)
- Static code analysis
- GitHub pull request auto-repair bot
- Support for additional programming languages
Tharshini GitHub: https://github.com/Tharshini272006
This project is released under the MIT License.