Imported from Zaikon13/All-in-One-DeFi-Bot (
archive/AGENTS.md). Install upstream withnpx skills add Zaikon13/All-in-One-DeFi-Bot --skill archive. Copyright stays with the author.
AGENTS & MODULE OWNERSHIP MAP
Primary Source of Truth (SOT) — See the SOT table in GROK_COORDINATION.md. All Grok-related changes must be coordinated across Primaries (no fragmented updates). See also GROK_USAGE.md for the complete canonical map of all Grok integrations.
Last Updated: 2026-06-09 (SOT Coordinated PR Helper first inc + Phase 2 worker EOD guard) (structured Grok market analysis output per Review Agent 2026-06 Approved with Conditions (High risk): 6-section Markdown enrichment; analysis only, renamed watchpoints, all 12 conditions + new artifact; Primary SOTs read) (coordinated docs update for Grok SOT structure) (Phase 2: commit 61059a6 addresses reviews/2026-06-09-worker-persistence-phase2.md) (Railway Volume attachment for worker: worker-persistence, 5GB at /data, ID c13adabe-5db7-4050-8d46-2c7c0fa58876)
Current Ownership
| Module / Area | Primary Owner | Secondary | Status |
|---|---|---|---|
| Deployment & Railway | Grok | - | ✅ Active |
| Worker Loop & Background Jobs | Grok | - | Partially Functional - Real new pair alerts + wallet monitoring active. Remaining: persistence, EOD PnL, better filtering. |
| Telegram Handlers & Commands | Grok + ChatGPT | - | Stable |
| PnL Calculation & Reports | Grok | Codex | Refactoring |
| GitHub Actions & CI/CD | Grok | - | ✅ Clean |
| Documentation (all .md files) | Grok | - | ✅ Updated |
| Grok Integration (API calls) | Grok | - | ✅ Stable (see Primary SOT GROK_USAGE.md for full map of runtime/CI/prompts/gates) |
Current Focus
Grok is leading:
- Advance Worker Loop (Partially Functional - real new pair alerts + wallet monitoring active)
- Grok Code Review workflow (strict GROK CODE REVIEW CONTRACT + expanded triggers: branches [main] + paths filter per Review Agent 2026-06 Approved with Conditions (High Risk) for automatic relevant PR reviews; remains advisory)
- Health Check + Telegram automation (strict GROK HEALTH CHECK CONTRACT, improved Telegram value with safe Markdown, worker limitation noted per Review Agent 2026-06)
- Documentation cleanup
- Workflow stability
- Phase 1 Orchestrator + Shared Memory (agents/orchestrator.py + agents/memory/ per Review Agent 2026-06 Approved with Conditions, High Risk): assists Master (Grok retains authority), loads committed context/memory, uses core/grok_client.py, references existing spawn_subagent + Review Gate. Foundation/script only. Coordinated SOT updates (no new Primary SOT).
- Phase 2 first scoped increment (Gated Feedback Loop + Self-Improvement Readiness, 2026-06 per Review Agent "Approved with Conditions"): minimal Improvement Proposer via
orchestrator.py --propose-improvements+ focused prompt. Reads Meta Notes + outcomes from memory; generates proposals only for prompts (grok_orchestrator_plan.txt) + memory schema. Every proposal embeds explicit "requires Review Agent + Master todo_write + handoff before any edit" language. Proposals-only (no auto-apply). Master-driven. No production logic touched. Coordinated SOT updates + reviews/2026-06-XX-phase2-feedback-loop.md. See project-awareness.md 4.7. - Richer-context increment (higher-quality proposals, 2026-06 per Review Agent Approved with Conditions): plan_outcomes gains tiny
meta_summary(Meta Notes excerpt) on plan runs; proposer receives last ~8 outcomes + meta_summary and prompt requires pattern detection + citations of specific runs/timestamps + precise before/after suggestions. Still proposals-only, Review Gate enforced, high-risk memory minimal, core/grok_client only. See updated 4.7 + new reviews/2026-06-XX-improve-proposer-quality.md. # Review Agent 2026-06. - Agent Drift Detection (first inc, 2026-06 per Review Agent "Approved with Conditions", High risk): --detect-drift in orchestrator.py + grok_drift_detector.txt. Detects drift in SOT sections / prompt contracts / memory schema / project_context vs implementation. Structured proposals with full Review Gate enforcement. Detection + proposals only. Tiny records in plan_outcomes (high-risk). Master-driven, core client only. Detector subject to future runs (condition 10). See project-awareness.md + reviews/2026-06-XX-agent-drift-detection.md + 10 conditions. # Review Agent 2026-06.
- Drift Detection v2 (2026-06 per Review Agent "Approved with Conditions", Medium-High risk): modest evolution (extend existing; 1-2 addl high-value areas e.g. arg parsing/modes + SOT cross-refs). Smarter bounded context (targeted + recent plan_outcomes/drift summaries for patterns). Evolved prompt for citations/precision (history quality-only per condition 12). Still proposals-only, full gate (refs v2 review), tiny memory (high-risk), core client only, detector auditable (condition 10). See project-awareness.md + reviews/2026-06-XX-drift-detection-v2.md + 12 conditions. # Review Agent 2026-06.
- SOT Coordinated PR Helper (first inc): Added SOT Coordinated PR Helper (--sot-pr-helper) to agents/orchestrator.py per Review Agent Approved with Conditions (High risk). Read-only advisory only. Analyzes change to one SOT and generates ready-to-paste text for the other 4 SOTs. Reuses dry-run logic. All 12 mandatory conditions followed exactly. Primary SOTs read before implementation and on every run. (see GROK_COORDINATION.md Sec 3 + reviews/2026-06-XX-sot-coordinated-pr-helper.md). # Review Agent 2026-06
- Runtime Grok market analysis second inc (EOD PnL market context, 2026-06 per Review Agent "Approved with Conditions", High risk): exactly one additional point (post-process scheduled EOD only, reuse exact same helper + prompt, no core/pnl_calculator or grok_daily_pnl.txt changes). All 12 conditions + coordinated SOTs + new reviews/ file. # Review Agent 2026-06.
- Structured output enrichment (2026-06 per Review Agent 2026-06 Approved with Conditions, High risk): 6-section Markdown (Summary, Key Metrics, Market Narrative, Risk Signals, Observed Patterns & Contextual Watchpoints [renamed], Confidence & Data Notes) via prompt update + thin helper docs; all prior safety + 12 conditions + new ones (analysis/insights only, safe MD, no execution). Coordinated 5-SOT + new reviews/2026-06-XX-grok-market-analysis-structured.md. # Review Agent 2026-06: Structured inc.
Next Priority: Complete remaining Worker Loop features (persistence, EOD PnL, better filtering) + PnL refactoring. See GROK_COORDINATION.md + GROK_USAGE.md for coordination.
SOT Coordinated PR Helper (first inc, 2026-06 per Review Agent Approved with Conditions, High risk): feat(worker): Worker Persistence First Increment addressing all 12 conditions from Review Agent 2026-06-08 (commit 8d322ad). Enhanced known_pairs persistence in worker.py with last_seen timestamps + last_eod_run (backward-compatible migration from old plain list JSON), atomic writes (temp + os.replace), optional RAILWAY_VOLUME_MOUNT_PATH support (fallback 'data/'), and strong WARNING logs + documentation that data is NOT durable across Railway redeploys without attached Volume. Added all required # Review Agent 2026-06-08 comments. Per condition 7: this is a coordinated Primary SOT status update only. Worker Loop status updated to note the first increment for known_pairs (with last_seen, atomic writes, Railway guards) is now in place; remains 'Partially Functional' overall. Full durability across redeploys still requires Railway Volume. EOD scheduling enhancements are minimal reliability state only. No claim that persistence is 'complete' or production-durable.
SOT Coordinated PR Helper (first inc, 2026-06 per Review Agent "Approved with Conditions", High risk): feat(worker): Phase 1 persistence hardening (commit 30521a3). Still 'Partially Functional'. Volume still REQUIRED for production durability. No SOT changes in this commit (deferred to follow-on via --sot-pr-helper)..
SOT Coordinated PR Helper (Phase 2, 2026-06 per Review Agent "Approve with minor revisions"): feat(worker): Phase 2 EOD PnL guard hardening + startup sanity (commit 61059a6). Addresses Review Agent 2026-06-09-worker-persistence-phase2.md (all 3 Medium issues addressed). EOD PnL guard + startup sanity hardening only (in-process / local-restart behavior only). Still 'Partially Functional'. Volume still REQUIRED for production durability. No over-claims on EOD completeness. Scheduler/target/sleep/report generation and core/ untouched. No SOT changes in this commit (deferred to follow-on via --sot-pr-helper). See reviews/2026-06-09-worker-persistence-phase2.md + 2026-06-08-worker-persistence-first-inc.md + 2026-06-09-worker-persistence-phase1.md (12 conditions + Phase 1 Mediums preserved).
Railway Volume (worker): Volume attached (5GB at /data). Persistence now survives redeploys as long as the Volume remains attached. Still 'Partially Functional'. Full durability depends on Volume + active subscription.
SOT Coordinated PR Helper (first inc, 2026-06 per Review Agent "Approved with Conditions", High risk): feat(agent): Context Strengthening for Drift v2 + Proposer (bounded reviews/ glob+read cross-refs + structured citation-friendly history bullets + one-sentence citation format tightening). Per Review Agent 2026-06-08 (Approve with minor revisions + 5 conditions addressed exactly by Code Agent subagent). Extend-existing only (agents/orchestrator.py private helpers + 2 prompts + 1 reviews/ traceability file). No SOT edits in the inc itself (per conditions 3+5); this is the follow-on coordinated status update. New logic remains subject to condition 10. Full non-bypassable Review Gate preserved (only ref append). See reviews/2026-06-08-drift-proposer-context-strengthening.md . Master retains final authority. Honest status-only language..
All non-trivial implementation work (including the above) must follow the Mandatory Review Gate defined in project-awareness.md Section 4.3 and agents/personas/review-agent.md. The improved Grok Code Review (strict contract + expanded triggers), Health Check CI (strict contracts), and Phase 1 Orchestrator are advisory support for this gate. Master retains final authority.