trying to improve behavior in opencode

This commit is contained in:
2026-03-07 19:26:19 -05:00
parent 896be1eae2
commit 7f7e456351
5 changed files with 66 additions and 9 deletions

View File

@@ -21,6 +21,7 @@ When planning tracks that touch core systems, consult:
- `docs/guide_tools.md`: MCP Bridge, Hook API endpoints, ApiHookClient methods - `docs/guide_tools.md`: MCP Bridge, Hook API endpoints, ApiHookClient methods
- `docs/guide_mma.md`: Ticket/Track structures, DAG engine, ConductorEngine, worker lifecycle - `docs/guide_mma.md`: Ticket/Track structures, DAG engine, ConductorEngine, worker lifecycle
- `docs/guide_simulations.md`: live_gui fixture, Puppeteer pattern, mock provider - `docs/guide_simulations.md`: live_gui fixture, Puppeteer pattern, mock provider
- `docs/guide_meta_boundary.md`: Clarification of ai agent tools making the application vs the application itself.
## Responsibilities ## Responsibilities

View File

@@ -22,6 +22,7 @@ ONLY output the requested text. No pleasantries.
You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable. You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
### Read-Only MCP Tools (USE THESE) ### Read-Only MCP Tools (USE THESE)
| Native Tool | MCP Tool | | Native Tool | MCP Tool |
|-------------|----------| |-------------|----------|
| `read` | `manual-slop_read_file` | | `read` | `manual-slop_read_file` |
@@ -35,7 +36,18 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
| - | `manual-slop_get_git_diff` (file changes) | | - | `manual-slop_get_git_diff` (file changes) |
| - | `manual-slop_get_tree` (directory structure) | | - | `manual-slop_get_tree` (directory structure) |
### Edit MCP Tools (USE THESE)
| Native Tool | MCP Tool |
|-------------|----------|
| `edit` | `manual-slop_edit_file` (find/replace, preserves indentation) YOU MUST USE old_string parameter IT IS NOT oldString |
| `edit` | `manual-slop_py_update_definition` (replace function/class) |
| `edit` | `manual-slop_set_file_slice` (replace line range) |
| `edit` | `manual-slop_py_set_signature` (replace signature only) |
| `edit` | `manual-slop_py_set_var_declaration` (replace variable) |
### Shell Commands ### Shell Commands
| Native Tool | MCP Tool | | Native Tool | MCP Tool |
|-------------|----------| |-------------|----------|
| `bash` | `manual-slop_run_powershell` | | `bash` | `manual-slop_run_powershell` |
@@ -43,6 +55,7 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
## Session Start Checklist (MANDATORY) ## Session Start Checklist (MANDATORY)
Before ANY other action: Before ANY other action:
1. [ ] Read `conductor/workflow.md` 1. [ ] Read `conductor/workflow.md`
2. [ ] Read `conductor/tech-stack.md` 2. [ ] Read `conductor/tech-stack.md`
3. [ ] Read `conductor/product.md`, `conductor/product-guidelines.md` 3. [ ] Read `conductor/product.md`, `conductor/product-guidelines.md`
@@ -53,16 +66,25 @@ Before ANY other action:
**BLOCK PROGRESS** until all checklist items are confirmed. **BLOCK PROGRESS** until all checklist items are confirmed.
## Primary Context Documents ## Primary Context Documents
Read at session start: `conductor/product.md`, `conductor/product-guidelines.md`
Read at session start:
- All immediate files in ./conductor, a listing of all direcotires within ./conductor/tracks, ./conductor/archive.
- All docs in ./docs
- AST Skeleton summaries of: ./src, ./simulation, ./tests, ./scripts python files.
## Architecture Fallback ## Architecture Fallback
When planning tracks that touch core systems, consult the deep-dive docs: When planning tracks that touch core systems, consult the deep-dive docs:
- `docs/guide_architecture.md`: Thread domains, event system, AI client, HITL mechanism - `docs/guide_architecture.md`: Thread domains, event system, AI client, HITL mechanism
- `docs/guide_tools.md`: MCP Bridge security, 26-tool inventory, Hook API endpoints - `docs/guide_tools.md`: MCP Bridge security, 26-tool inventory, Hook API endpoints
- `docs/guide_mma.md`: Ticket/Track data structures, DAG engine, ConductorEngine - `docs/guide_mma.md`: Ticket/Track data structures, DAG engine, ConductorEngine
- `docs/guide_simulations.md`: live_gui fixture, Puppeteer pattern, mock provider - `docs/guide_simulations.md`: live_gui fixture, Puppeteer pattern, mock provider
- `docs/guide_meta_boundary.md`: Clarification of ai agent tools making the application vs the application itself.
## Responsibilities ## Responsibilities
- Maintain alignment with the product guidelines and definition - Maintain alignment with the product guidelines and definition
- Define track boundaries and initialize new tracks (`/conductor-new-track`) - Define track boundaries and initialize new tracks (`/conductor-new-track`)
- Set up the project environment (`/conductor-setup`) - Set up the project environment (`/conductor-setup`)
@@ -71,6 +93,7 @@ When planning tracks that touch core systems, consult the deep-dive docs:
## The Surgical Methodology ## The Surgical Methodology
### 1. MANDATORY: Audit Before Specifying ### 1. MANDATORY: Audit Before Specifying
NEVER write a spec without first reading actual code using MCP tools. NEVER write a spec without first reading actual code using MCP tools.
Use `manual-slop_py_get_code_outline`, `manual-slop_py_get_definition`, Use `manual-slop_py_get_code_outline`, `manual-slop_py_get_definition`,
`manual-slop_py_find_usages`, and `manual-slop_get_git_diff` to build a map. `manual-slop_py_find_usages`, and `manual-slop_get_git_diff` to build a map.
@@ -78,22 +101,28 @@ Document existing implementations with file:line references in a
"Current State Audit" section in the spec. "Current State Audit" section in the spec.
### 2. Identify Gaps, Not Features ### 2. Identify Gaps, Not Features
Frame requirements around what's MISSING relative to what exists. Frame requirements around what's MISSING relative to what exists.
### 3. Write Worker-Ready Tasks ### 3. Write Worker-Ready Tasks
Each plan task must be executable by a Tier 3 worker: Each plan task must be executable by a Tier 3 worker:
- **WHERE**: Exact file and line range (`gui_2.py:2700-2701`) - **WHERE**: Exact file and line range (`gui_2.py:2700-2701`)
- **WHAT**: The specific change - **WHAT**: The specific change
- **HOW**: Which API calls or patterns - **HOW**: Which API calls or patterns
- **SAFETY**: Thread-safety constraints - **SAFETY**: Thread-safety constraints
### 4. For Bug Fix Tracks: Root Cause Analysis ### 4. For Bug Fix Tracks: Root Cause Analysis
Read the code, trace the data flow, list specific root cause candidates. Read the code, trace the data flow, list specific root cause candidates.
### 5. Reference Architecture Docs ### 5. Reference Architecture Docs
Link to relevant `docs/guide_*.md` sections in every spec. Link to relevant `docs/guide_*.md` sections in every spec.
## Spec Template (REQUIRED sections) ## Spec Template (REQUIRED sections)
``` ```
# Track Specification: {Title} # Track Specification: {Title}
@@ -109,6 +138,7 @@ Link to relevant `docs/guide_*.md` sections in every spec.
``` ```
## Plan Template (REQUIRED format) ## Plan Template (REQUIRED format)
``` ```
## Phase N: {Name} ## Phase N: {Name}
Focus: {One-sentence scope} Focus: {One-sentence scope}
@@ -120,6 +150,7 @@ Focus: {One-sentence scope}
``` ```
## Limitations ## Limitations
- READ-ONLY: Do NOT write code or edit files (except track spec/plan/metadata) - READ-ONLY: Do NOT write code or edit files (except track spec/plan/metadata)
- Do NOT execute tracks or implement features - Do NOT execute tracks or implement features
- Keep context strictly focused on product definitions and strategy - Keep context strictly focused on product definitions and strategy

View File

@@ -18,6 +18,7 @@ ONLY output the requested text. No pleasantries.
You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable. You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
### Research MCP Tools (USE THESE) ### Research MCP Tools (USE THESE)
| Native Tool | MCP Tool | | Native Tool | MCP Tool |
|-------------|----------| |-------------|----------|
| `read` | `manual-slop_read_file` | | `read` | `manual-slop_read_file` |
@@ -32,15 +33,17 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
| - | `manual-slop_get_tree` (directory structure) | | - | `manual-slop_get_tree` (directory structure) |
### Edit MCP Tools (USE THESE) ### Edit MCP Tools (USE THESE)
| Native Tool | MCP Tool | | Native Tool | MCP Tool |
|-------------|----------| |-------------|----------|
| `edit` | `manual-slop_edit_file` (find/replace, preserves indentation) | | `edit` | `manual-slop_edit_file` (find/replace, preserves indentation) YOU MUST USE old_string parameter IT IS NOT oldString |
| `edit` | `manual-slop_py_update_definition` (replace function/class) | | `edit` | `manual-slop_py_update_definition` (replace function/class) |
| `edit` | `manual-slop_set_file_slice` (replace line range) | | `edit` | `manual-slop_set_file_slice` (replace line range) |
| `edit` | `manual-slop_py_set_signature` (replace signature only) | | `edit` | `manual-slop_py_set_signature` (replace signature only) |
| `edit` | `manual-slop_py_set_var_declaration` (replace variable) | | `edit` | `manual-slop_py_set_var_declaration` (replace variable) |
### Shell Commands ### Shell Commands
| Native Tool | MCP Tool | | Native Tool | MCP Tool |
|-------------|----------| |-------------|----------|
| `bash` | `manual-slop_run_powershell` | | `bash` | `manual-slop_run_powershell` |
@@ -48,45 +51,50 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
## Session Start Checklist (MANDATORY) ## Session Start Checklist (MANDATORY)
Before ANY other action: Before ANY other action:
1. [ ] Read `conductor/workflow.md` 1. [ ] Read `conductor/workflow.md`
2. [ ] Read `conductor/tech-stack.md` 2. [ ] Read `conductor/tech-stack.md`
3. [ ] Read `conductor/product.md` 3. [ ] Read `conductor/product.md`
4. [ ] Read relevant `docs/guide_*.md` for current task domain 4. [ ] Read `conductor/product-guidelines.md`
5. [ ] Check `TASKS.md` for active tracks 5. [ ] Read relevant `docs/guide_*.md` for current task domain
6. [ ] Announce: "Context loaded, proceeding to [task]" 6. [ ] Check `conductor/tracks.md` for active tracks
7. [ ] Announce: "Context loaded, proceeding to [task]"
**BLOCK PROGRESS** until all checklist items are confirmed. **BLOCK PROGRESS** until all checklist items are confirmed.
## Tool Restrictions (TIER 2) ## Tool Restrictions (TIER 2)
### ALLOWED Tools (Read-Only Research) ### ALLOWED Tools (Read-Only Research)
- `manual-slop_read_file` (for files <50 lines only) - `manual-slop_read_file` (for files <50 lines only)
- `manual-slop_py_get_skeleton`, `manual-slop_py_get_code_outline`, `manual-slop_get_file_summary` - `manual-slop_py_get_skeleton`, `manual-slop_py_get_code_outline`, `manual-slop_get_file_summary`
- `manual-slop_py_find_usages`, `manual-slop_search_files` - `manual-slop_py_find_usages`, `manual-slop_search_files`
- `manual-slop_run_powershell` (for git status, pytest --collect-only) - `manual-slop_run_powershell` (for git status, pytest --collect-only)
### FORBIDDEN Actions (Delegate to Tier 3) ### FORBIDDEN Actions (Delegate to Tier 3)
- **NEVER** use native `edit` tool on .py files - destroys indentation - **NEVER** use native `edit` tool on .py files - destroys indentation
- **NEVER** write implementation code directly - delegate to Tier 3 Worker - **NEVER** write implementation code directly - delegate to Tier 3 Worker
- **NEVER** skip TDD Red-Green cycle - **NEVER** skip TDD Red-Green cycle
### Required Pattern ### Required Pattern
1. Research with skeleton tools 1. Research with skeleton tools
2. Draft surgical prompt with WHERE/WHAT/HOW/SAFETY 2. Draft surgical prompt with WHERE/WHAT/HOW/SAFETY
3. Delegate to Tier 3 via Task tool 3. Delegate to Tier 3 via Task tool
4. Verify result 4. Verify result
## Primary Context Documents
Read at session start: `conductor/product.md`, `conductor/workflow.md`, `conductor/tech-stack.md`
## Architecture Fallback ## Architecture Fallback
When implementing tracks that touch core systems, consult the deep-dive docs: When implementing tracks that touch core systems, consult the deep-dive docs:
- `docs/guide_architecture.md`: Thread domains, event system, AI client, HITL mechanism - `docs/guide_architecture.md`: Thread domains, event system, AI client, HITL mechanism
- `docs/guide_tools.md`: MCP Bridge security, 26-tool inventory, Hook API endpoints - `docs/guide_tools.md`: MCP Bridge security, 26-tool inventory, Hook API endpoints
- `docs/guide_mma.md`: Ticket/Track data structures, DAG engine, ConductorEngine - `docs/guide_mma.md`: Ticket/Track data structures, DAG engine, ConductorEngine
- `docs/guide_simulations.md`: live_gui fixture, Puppeteer pattern, mock provider - `docs/guide_simulations.md`: live_gui fixture, Puppeteer pattern, mock provider
## Responsibilities ## Responsibilities
- Convert track specs into implementation plans with surgical tasks - Convert track specs into implementation plans with surgical tasks
- Execute track implementation following TDD (Red -> Green -> Refactor) - Execute track implementation following TDD (Red -> Green -> Refactor)
- Delegate code implementation to Tier 3 Workers via Task tool - Delegate code implementation to Tier 3 Workers via Task tool
@@ -97,28 +105,35 @@ When implementing tracks that touch core systems, consult the deep-dive docs:
## TDD Protocol (MANDATORY) ## TDD Protocol (MANDATORY)
### 1. High-Signal Research Phase ### 1. High-Signal Research Phase
Before implementing: Before implementing:
- Use `manual-slop_py_get_code_outline`, `manual-slop_py_get_skeleton` to map file relations - Use `manual-slop_py_get_code_outline`, `manual-slop_py_get_skeleton` to map file relations
- Use `manual-slop_get_git_diff` for recently modified code - Use `manual-slop_get_git_diff` for recently modified code
- Audit state: Check `__init__` methods for existing/duplicate state variables - Audit state: Check `__init__` methods for existing/duplicate state variables
### 2. Red Phase: Write Failing Tests ### 2. Red Phase: Write Failing Tests
- Pre-delegation checkpoint: Stage current progress (`git add .`) - Pre-delegation checkpoint: Stage current progress (`git add .`)
- Zero-assertion ban: Tests MUST have meaningful assertions - Zero-assertion ban: Tests MUST have meaningful assertions
- Delegate test creation to Tier 3 Worker via Task tool - Delegate test creation to Tier 3 Worker via Task tool
- Run tests and confirm they FAIL as expected - Run tests and confirm they FAIL as expected
### 3. Green Phase: Implement to Pass ### 3. Green Phase: Implement to Pass
- Pre-delegation checkpoint: Stage current progress - Pre-delegation checkpoint: Stage current progress
- Delegate implementation to Tier 3 Worker via Task tool - Delegate implementation to Tier 3 Worker via Task tool
- Run tests and confirm they PASS - Run tests and confirm they PASS
### 4. Refactor Phase (Optional) ### 4. Refactor Phase (Optional)
- With passing tests, refactor for clarity and performance - With passing tests, refactor for clarity and performance
- Re-run tests to ensure they still pass - Re-run tests to ensure they still pass
### 5. Commit Protocol (ATOMIC PER-TASK) ### 5. Commit Protocol (ATOMIC PER-TASK)
After completing each task: After completing each task:
1. Stage changes: `git add .` 1. Stage changes: `git add .`
2. Commit with clear message: `feat(scope): description` 2. Commit with clear message: `feat(scope): description`
3. Get commit hash: `git log -1 --format="%H"` 3. Get commit hash: `git log -1 --format="%H"`
@@ -131,12 +146,15 @@ After completing each task:
OpenCode uses the Task tool for subagent delegation. Always provide surgical prompts with WHERE/WHAT/HOW/SAFETY structure. OpenCode uses the Task tool for subagent delegation. Always provide surgical prompts with WHERE/WHAT/HOW/SAFETY structure.
### Tier 3 Worker (Implementation) ### Tier 3 Worker (Implementation)
Invoke via Task tool: Invoke via Task tool:
- `subagent_type`: "tier3-worker" - `subagent_type`: "tier3-worker"
- `description`: Brief task name - `description`: Brief task name
- `prompt`: Surgical prompt with WHERE/WHAT/HOW/SAFETY structure - `prompt`: Surgical prompt with WHERE/WHAT/HOW/SAFETY structure
Example Task tool invocation: Example Task tool invocation:
``` ```
description: "Write tests for cost estimation" description: "Write tests for cost estimation"
prompt: | prompt: |
@@ -151,13 +169,17 @@ prompt: |
``` ```
### Tier 4 QA (Error Analysis) ### Tier 4 QA (Error Analysis)
Invoke via Task tool: Invoke via Task tool:
- `subagent_type`: "tier4-qa" - `subagent_type`: "tier4-qa"
- `description`: "Analyze test failure" - `description`: "Analyze test failure"
- `prompt`: Error output + explicit instruction "DO NOT fix - provide root cause analysis only" - `prompt`: Error output + explicit instruction "DO NOT fix - provide root cause analysis only"
## Phase Completion Protocol ## Phase Completion Protocol
When all tasks in a phase are complete: When all tasks in a phase are complete:
1. Run `/conductor-verify` to execute automated verification 1. Run `/conductor-verify` to execute automated verification
2. Present results to user and await confirmation 2. Present results to user and await confirmation
3. Create checkpoint commit: `conductor(checkpoint): Phase N complete` 3. Create checkpoint commit: `conductor(checkpoint): Phase N complete`
@@ -165,8 +187,11 @@ When all tasks in a phase are complete:
5. Update plan.md with checkpoint SHA 5. Update plan.md with checkpoint SHA
## Anti-Patterns (Avoid) ## Anti-Patterns (Avoid)
- Do NOT implement code directly - delegate to Tier 3 Workers - Do NOT implement code directly - delegate to Tier 3 Workers
- Do NOT skip TDD phases - Do NOT skip TDD phases
- Do NOT batch commits - commit per-task - Do NOT batch commits - commit per-task
- Do NOT skip phase verification - Do NOT skip phase verification
- Do NOT use native `edit` tool - use MCP tools - Do NOT use native `edit` tool - use MCP tools
- DO NOT SKIP a TEST IN PYTEST JUSTS BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX.
- DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVAL SOLUTION TO FIX.

View File

@@ -86,7 +86,7 @@ This file tracks all major tracks for the project. Each track has its own detail
### Misc Side-tracks ### Misc Side-tracks
21. [~] **Track: Test Regression Verification** 21. [x] **Track: Test Regression Verification**
*Link: [./tracks/test_regression_verification_20260307/](./tracks/test_regression_verification_20260307/)* *Link: [./tracks/test_regression_verification_20260307/](./tracks/test_regression_verification_20260307/)*
20. [x] **Track: Enhanced Context Control & Cache Awareness** 20. [x] **Track: Enhanced Context Control & Cache Awareness**