Mission: Refactor Gemini Bridge to Meet All Documented Requirements
Agent Platform: Gemini CLI (YOLO Mode)
1. Core Protocol: The Enhanced IPEV Loop with Two-Tiered Checkpointing
For every state-changing action, you MUST follow this enhanced protocol:
Standard IPEV Flow:
- INTENT: State your immediate objective.
- PLAN: Specify the EXACT commands and file modifications.
- EXECUTE: Run the exact command or apply the file modification.
- VERIFY: Perform a check to prove the change was successful (e.g., run a specific
pytesttest).
CRITICAL Checkpointing Protocol (After a successful VERIFY):
- CODE CHECKPOINT (Autonomous): You MUST use git to save the successful changes. Your plan must include
git add .andgit commit -m "Verified Feature: [brief description of feature]". - SESSION CHECKPOINT (Collaborative): After the git commit is successful, you MUST PAUSE and output the following exact phrase: "CODE CHECKPOINT COMPLETE. Please save the session now with
/chat save [descriptive-name]and type 'CONTINUE' to proceed." You will not proceed until I respond with "CONTINUE".
Resilience Extensions:
- Diagnostic Mode: If a
VERIFYstep fails, pivot to diagnosing the failure. Runpytestwith-vfor more verbose output. - Health Checks: After any unexpected error, run
ls -lto ensure the tool environment is responsive.
2. Directive Protocol
Commands prefixed with DIRECTIVE: are for inspection. Use them to examine files before formulating a plan.
* DIRECTIVE: Show me the current content of session_manager.py
* DIRECTIVE: Run git status
3. Environment Context
- Tech Stack: Python 3.10+
- Agent Platform: Gemini CLI.
- External Dependencies: The
geminicommand must be in the system's PATH.
Known Instabilities & Workarounds:
- CRITICAL BUG IDENTIFIED: The command
gemini -is invalid. Thesubprocess.Popencall insession_manager.pyuses this and will fail. This must be the first bug you fix. The correct command is["gemini"].
4. Mission Parameters
Inputs:
- The provided source code for the Gemini Bridge project.
- Feature requirements from
docs/inception/must_should_have_features.md. - Problem statement from
docs/inception/product_requirements.md.
Outputs:
- A refactored codebase where all "MUST HAVE" and "SHOULD HAVE" features are correctly implemented and committed incrementally to git.
- New
pytesttests covering the implemented features.
Critical Constraints:
- Output to the user's file MUST be pure Markdown and must APPEND.
- The application must operate with minimal terminal interaction after setup.
5. Task-Specific Resilient Guidelines
- Fix Before Feature: Always ensure the application is in a working state before adding new features.
- Test-Driven Implementation: For each new feature, your plan must include both the implementation and the creation of a corresponding test.
- Incremental Commits: Follow the IPEV & Checkpointing protocol for every single feature. Do not batch multiple features into one commit.
6. Success Criteria & Verification Strategy
Mission Complete When:
* All 11 features from docs/inception/must_should_have_features.md are implemented and committed.
* python main.py runs the application successfully.
* pytest passes with 100% success.
Verification Methods:
* pytest for automated testing.
* Shell commands (ls, cat) to manually verify the end-to-end file-watching workflow.
7. Enhanced Execution Flow
- Initialize: Acknowledge these instructions and the new two-tiered checkpointing protocol. Perform an initial health check with
ls -Fandgit status. - Survey (Directives): Use
DIRECTIVEto readsession_manager.py,gemini_bridge.py, anddocs/inception/must_should_have_features.md. - Execute Phase 1 (Critical Bug Fix):
- Use the IPEV loop to fix the invalid
gemini -command insession_manager.py. - For your VERIFY step, create a new test in
test_session_manager.pythat confirmsstart_session()now works. - After verification, perform the full Checkpointing Protocol (Code and Session).
- Use the IPEV loop to fix the invalid
- Execute Phase 2 (Feature Implementation):
- Systematically work through each "MUST HAVE" and "SHOULD HAVE" feature. For each one:
- Follow the full IPEV loop.
- Follow the full Checkpointing Protocol upon success.
- Wait for my "CONTINUE" signal before starting the next feature.
- Systematically work through each "MUST HAVE" and "SHOULD HAVE" feature. For each one:
- Final Verification:
- Run the full
pytestsuite one last time. - Perform a final end-to-end manual verification.
- Run the full
- Complete: Announce mission completion and perform a final checkpoint.
Now, begin with the initialization and survey steps.