**Rebuilt Requirements - Cleaner Plan:**
Setup Researcher agent with proper database model, permissions configuration, and system prompt.
## 1. Database & Model Updates
**File: app/models/agent.rb**
Update `create_default_set` to include the researcher role.
```ruby
def self.create_default_set(project_name_or_id)
# ... existing setup ...
# Add 'researcher' to the list
%w[worker reviewer orchestrator researcher].each do |type|
agent = create!(
name: "#{prefix}-#{type}",
agent_type: type,
project: project
)
agents << agent
end
# ...
end
```
Note: Ensure agent_type enum (if defined in Agent model) includes researcher.
## 2. Permission Configuration
**File: config/permissions.yml**
Add the researcher definition. It needs access to Tickets (read), Memory (read/write own), and Proposals (create).
```yaml
researcher:
allowed:
- create_proposal # The core output mechanism
- list_proposals # To check existing proposals
- list_tickets # To analyze patterns
- get_ticket # To read details
- search_memory # To find patterns/duplication
- store_memory # To write its own observations/scratchpad
- list_members
- get_status
- get_terminal_logs
blocked:
- create_ticket # MUST be blocked (use proposal)
- update_ticket # MUST be blocked
- transition_ticket # MUST be blocked
- ask_for_memory_deletion # MUST be blocked (use proposal)
- send_message_to_agent # Researcher works autonomously usually
allow_wildcard: false
```
## 3. System Prompt
**Goal:** High-quality analysis, 0% junk target, autonomous operation.
```
You are the Researcher.
Role:
You are an autonomous analyst responsible for improving the project's code quality, system health, and development velocity. You operate in the background, analyzing data to find high-impact improvements.
Capabilities:
- You have read access to all code, tickets, and memories.
- You can store your own observations using 'store_memory'.
- You CANNOT modify code or tickets directly.
- You MUST use 'create_proposal' to suggest actions.
Operational Guide:
1. Analyze deeply. Do not propose superficial changes (e.g., whitespace, minor typos) unless they impact stability.
2. Target 0% noise. Every proposal should offer significant value (performance, security, refactoring, or critical documentation).
3. Evidence is required. When proposing a change, cite specific file paths, ticket IDs, or memory patterns.
4. If you find stale or incorrect memories, do not delete them. Create a 'memory_cleanup' proposal.
Output:
Always structure your work as concrete proposals.
```
## 4. Acceptance Criteria
- [ ] Agent.create_default_set creates a researcher agent
- [ ] Researcher permissions are strictly defined in configuration (Access to create_proposal, blocked from create_ticket)
- [ ] Researcher can read global state (tickets/memory) and write its own memory (store_memory)
- [ ] System Prompt is configured for high-value analysis
---
**Action needed:** Remove the old PR link (https://github.com/RoM4iK/tinker/pull/79) from this ticket.