Create a NEW autonomous agent using architectural patterns from [Claw Code](http://143.198.27.163:3000/Timmy/claw-code), integrated with Gitea for real work dispatch.
## Problem Statement
**Allegro-Primus is IDLE.**
- Gateway running (PID 367883) but zero meaningful output
- No Gitea issues created
- No PRs submitted
- No actual work completed
This agent will **replace** Allegro-Primus with real capabilities.
---
## Claw Patterns to Adopt
### 1. ToolPermissionContext
```python
@dataclass
class ToolPermissionContext:
deny_tools: set[str]
deny_prefixes: tuple[str, ...]
def blocks(self, tool_name: str) -> bool:
return tool_name in self.deny_tools or \
any(tool_name.startswith(p) for p in self.deny_prefixes)
```
**Why:** Fine-grained tool access control vs Hermes basic approval
### 2. ExecutionRegistry
```python
class ExecutionRegistry:
def command(self, name: str) -> CommandHandler
def tool(self, name: str) -> ToolHandler
def execute(self, context: PermissionContext) -> Result
```
**Why:** Clean routing vs Hermes model-decided routing
### 3. Session Persistence
```python
@dataclass
class RuntimeSession:
prompt: str
context: PortContext
history: HistoryLog
persisted_path: str
```
**Why:** JSON-based sessions vs SQLite - more portable, inspectable
### 4. Bootstrap Graph
```python
def build_bootstrap_graph() -> Graph:
# Setup phases
# Context building
# System init messages
```
**Why:** Structured initialization vs ad-hoc setup
**Blocker:** Gitea externally firewalled + no Allegro-Primus RCA
### Critical Issues
1.**Dependency blindness.** Every Claw Code reference points to `143.198.27.163:3000`, which is currently firewalled and unreachable from this VM. If the mirror is not locally cached, development is blocked on external infrastructure.
2.**Root cause vs. replacement.** The epic jumps to "replace Allegro-Primus" without proving he is unfixable. Primus being idle could be the same provider/auth outage that took down Ezra and Bezalel. A 5-line RCA should precede a 5-phase rewrite.
3.**Timeline fantasy.** "Phase 1: 2 days" assumes stable infrastructure. Current reality: Gitea externally firewalled, Bezalel VPS down, Ezra needs webhook switch. This epic needs a "Blocked Until" section.
4.**Resource stalemate.** "Telegram bot: Need @BotFather" — the fleet already operates multiple bots. Reuse an existing bot profile or document why a new one is required.
### Recommended Action
Add a **Pre-Flight Checklist** to the epic:
- [ ] Verify Gitea/Claw Code mirror is reachable from the build VM
- [ ] Publish 1-paragraph RCA on why Allegro-Primus is idle