Commit graph

13 commits

Author SHA1 Message Date
5388f701bd epimetheus: heuristic brevity, not hard cap
Replaced hard rules with judgment heuristics:
- "Does every sentence add something the user doesn't already know?"
- "Earn every paragraph — each needs a distinct insight"
- "Short questions deserve short answers"
Restored max_tokens to 1024. Agent decides length, not a token cap.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-23 12:58:42 +00:00
08aa52659c epimetheus: enforce brevity + fix research regex false positive
1. Response length: "BREVITY IS YOUR DEFAULT. Most responses 1-3 sentences.
   A 4-paragraph response to a simple question is a failure."
   max_tokens cut from 1024 to 512.

2. Research trigger: removed natural language regex (caused false positive
   on "has accumulated" matching "search"). Only explicit /research command.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-23 12:57:09 +00:00
b90e80ed6c epimetheus: don't track silent group messages in history (Ganymede review)
Option A: history only contains actual bot-user exchanges, not unaddressed
group messages. Empty bot responses in history confused the model.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-23 12:31:01 +00:00
251caa3695 epimetheus: DM auto-respond gating (Rio suggestion)
DMs (private chats): conversation window auto-responds — always 1-on-1, no false positives.
Groups (supergroup/group): conversation window tracks context silently, reply-to only trigger.
Simple msg.chat.type check.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-23 10:19:15 +00:00
a75c14e536 epimetheus: auto-learning trigger — bot self-writes learnings from corrections
Opus decides what to learn. Prompt instructs: append LEARNING: [category] [description]
at end of response when genuinely learning something new. Bot parses the line,
strips it from displayed response, calls _save_learning() to persist.

Zero additional API calls (Rhea's design). The model already has full context.
Categories: factual, communication, structured_data.
Most responses have no LEARNING line — only fires on genuine corrections.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-22 16:57:47 +00:00
a11eca90e3 epimetheus: compressed conversation context + decouple archive from lock
1. Conversation history now shows compressed context summary first
   (tickers, key figures, exchange count) before full log.
   "Discussing: $FUTARDIO | Key figures: $0.004, $39.5K | Exchanges: 3"
   20 tokens, unmissable. Plus prompt instruction: "NEVER ask a question
   your history already answers." (Ganymede: Option C+A)

2. Archive file writes decoupled from worktree lock. File written
   unlocked (additive, no coordination needed). Git commit attempted
   with lock — deferred on timeout, file persists on disk for next cycle.
   Fixes "Read-only file system" archive failures. (Ganymede review)

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-21 17:26:02 +00:00
8d10c8ee28 epimetheus: conversation window → silent context only (Ganymede+Rhea+Leo)
Auto-respond stripped from conversation window. Bot only responds to @tag
and reply-to-bot. Window now silently tracks messages for context — when
the user does reply, the bot has full conversation history.

Also: prompt shortened to "1-2 sentences" default. "Do NOT respond to
messages that aren't directed at you."

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-21 16:51:26 +00:00
f7d30ced1a epimetheus: /research command — user-triggered X search from Telegram
User says "@FutAIrdBot /research P2P.me launch" → bot searches X via twitterapi.io
→ archives all tweets as ONE consolidated source file in inbox/queue/ → batch extract
picks up → claims land in KB.

Features (Ganymede+Rhea+Leo+Rio consensus):
- Regex + natural language intent detection (not CommandHandler)
- One source file per research query (not per-tweet)
- Full tweet metadata: author, followers, engagement, date
- Contributor attribution: proposed_by + contribution_type: research-direction
- Rate limit: 3 searches per user per day
- Min engagement filter (3 interactions)
- Worktree lock on source file write

Phase 2 (not built): domain alignment check before searching.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-21 16:32:43 +00:00
e921eda0a0 epimetheus: sanitize learnings before prompt injection (Ganymede review)
Learnings file content now passes through sanitize_message() before injection
into the Opus prompt. Prevents prompt injection via crafted "corrections."
Rio UUID 5551F5AF confirmed as current Teleo v4 Rio.

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-21 15:29:46 +00:00
1b4c6f8d72 epimetheus: agent learning system — learnings.md reader + self-write
Option D (Rhea+Rio+Leo consensus):
- _load_learnings(): reads agents/rio/learnings.md, injects into prompt before KB context
- _save_learning(): appends correction to learnings.md via worktree lock + direct commit
- Learnings prioritized over KB data when they conflict
- Three categories: communication, factual, structured_data
- Prompt updated: tells agent it can save corrections for future conversations

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-21 15:25:52 +00:00
d97f68714a epimetheus: fix 2 nits from Ganymede final review
1. _merge_pr marked as CURRENTLY UNUSED (local ff-push is primary path)
2. Conversation window messages skip cold rate limit check (window counter IS the limit)

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-20 20:25:06 +00:00
d79ff60689 epimetheus: sync VPS-deployed code to repo — Mar 18-20 reliability + features
Pipeline reliability (8 fixes, reviewed by Ganymede+Rhea+Leo+Rio):
1. Merge API recovery — pre-flight approval check, transient/permanent distinction, jitter
2. Ghost PR detection — ls-remote branch check in reconciliation, network guard
3. Source status contract — directory IS status, no code change needed
4. Batch-state markers eliminated — two-gate skip (archive-check + batched branch-check)
5. Branch SHA tracking — batched ls-remote, auto-reset verdicts, dismiss stale reviews
6. Mirror pre-flight permissions — chown check in sync-mirror.sh
7. Telegram archive commit-after-write — git add/commit/push with rebase --abort fallback
8. Post-merge source archiving — queue/ → archive/{domain}/ after merge

Pipeline fixes:
- merge_cycled flag — eval attempts preserved during merge-failure cycling (Ganymede+Rhea)
- merge_failures diagnostic counter
- Startup recovery preserves eval_attempts (was incorrectly resetting to 0)
- No-diff PRs auto-closed by eval (root cause of 17 zombie PRs)
- GC threshold aligned with substantive fixer budget (was 2, now 4)
- Conflict retry with 3-attempt budget + permanent conflict handler
- Local ff-merge fallback for Forgejo 405 errors

Telegram bot:
- KB retrieval: 3-layer (entity resolution → claim search → agent context)
- Reply-to-bot handler (context.bot.id check)
- Tag regex: @teleo|@futairdbot
- Prompt rewrite for natural analyst voice
- Market data API integration (Ben's token price endpoint)
- Conversation windows (5-message unanswered counter, per-user-per-chat)
- Conversation history in prompt (last 5 exchanges)
- Worktree file lock for archive writes

Infrastructure:
- worktree_lock.py — file-based lock (flock) for main worktree coordination
- backfill-sources.py — source DB registration for Argus funnel
- batch-extract-50.sh v3 — two-gate skip, batched ls-remote, network guard
- sync-mirror.sh — auto-PR creation for mirrored GitHub branches, permission pre-flight
- Argus dashboard — conflicts + reviewing in backlog, queue count in funnel
- Enrichment-inside-frontmatter bug fix (regex anchor, not --- split)

Pentagon-Agent: Epimetheus <3D35839A-7722-4740-B93D-51157F7D5E70>
2026-03-20 20:17:27 +00:00
090b1411fd epimetheus: source archive restructure — inbox/queue + inbox/archive/{domain} + inbox/null-result
- config.py: added INBOX_QUEUE, INBOX_NULL_RESULT constants
- evaluate.py: skip patterns + LIGHT tier cover all inbox/ subdirs
- llm.py: eval prompts reference inbox/ generically
- telegram/bot.py: archives to inbox/queue/
- telegram/teleo-telegram.service: ReadWritePaths expanded
- research-prompt-v2.md: paths updated to inbox/queue/
- research-prompt-leo-synthesis.md: paths updated
- migrate-source-archive.py: one-time migration script

Reviewed by: Ganymede, Rhea, Leo (all approved)

Pentagon-Agent: Epimetheus <968B2991-E2DF-4006-B962-F5B0A0CC8ACA>
2026-03-18 11:50:04 +00:00