simplify: kill agency-mode gate, fold doctrine into CLAUDE.md, drop old Mini App
MA
7mo ago+242+242+012345678901234567890123456789-2865-2865-0123456789012345678901234567890123456789
Summary
Stacked on #209 (goal-flow-v1). Net −2865 / +242 LOC.
After v1 made agency the default, the separate doctrine file, the skill activation gate, and the legacy Mini App UI were all carrying their weight.
- agency-skill.md deleted. Agency is the default after v1, no trigger phrase to register. Bootstrap removes the legacy
~/.claude/skills/agencysymlink from existing boxes. - AGENCY.md deleted. The essential card-shape doctrine (~25 lines) folded directly into
CLAUDE.md (## Composing a card). One operating manual, not two. - CLAUDE.md trimmed 259 → 161 lines. Tighter "How you talk", merged Conventions+Don't, new "Composing a card" section is ~25 lines.
- Old Mini App deleted —
index.html/app.js/app.css(~2230 LOC). The legacy "feed" UI wasn't reachable from the bot's/miniappbutton anyway (that one goes to/tinder)./feedroute also dropped frommini_app.py. - Mini App services lazy-start.
bux-miniapp.service+bux-miniapp-tunnel.serviceno longer enabled at boot. The bot already lazy-starts them on/miniappinvocation; cloudflared no longer burns free-tier quota 24/7. Bothinstall.shandbootstrap.shupdated.
Silent-failure fixes (from the dead-air scan)
_handle_agency_callback: missingchat_id→ toast "card is gone (chat or message was deleted)"._handle_agency_callback: malformedcallback_data→ toast "data is malformed", not empty._handle_agency_callback: DBrecord_decisionfailure → posts a one-line warning to the chat._handle_agency_callback:createForumTopicfall-through → tells the user "running in this thread instead" with the error reason.
Tests
8 new test cases for /autopilot, /copilot, default mode, invalid-mode fallback, mode flip, prompt mode-awareness. 29 tests pass total.
Deferred to v3 (intentionally)
- Full
install.sh→bootstrap.shconsolidation. Needs a fresh-box test pass; touching every entrypoint in one PR is risky. telegram_bot.pymodule split (7741 LOC, 115 top-level fns).- Remaining silent path (refine context-injection swallow — likely drops with the whole refine kind in v3).
Test plan
-
pytest agent/test_telegram_bot.py agent/test_mini_app.py— 29 pass -
python3 -c "ast.parse(...)"all touched .py files -
bash -n install.sh agent/bootstrap.sh - Run
bootstrap.shon a box that has~/.claude/skills/agency/from a prior version — verify the legacy symlink is cleaned up -
/miniappfrom TG — verify lazy-start ofbux-miniapp.servicestill works after the boot-time enable was removed -
/goal <X>→ tap a card with malformed callback_data (mock) — verify the new "data is malformed" toast appears
🤖 Generated with Claude Code
Summary by cubic
Make agency the default and simplify the stack: folded doctrine into CLAUDE.md, removed the agency skill/gate, deleted the legacy Mini App, and switched Mini App services to lazy‑start. This cuts code and boot-time load, and fixes several silent failure paths.
-
Refactors
- Folded card-shape doctrine into
CLAUDE.md(new “Composing a card”); deletedAGENCY.mdand trimmedCLAUDE.md. - Removed
agency-skill.mdand cleaned up the legacy~/.claude/skills/agencysymlink inbootstrap.sh. - Dropped the old Mini App UI and
/feedroute; prompts now referenceCLAUDE.md;/miniappflow unchanged. - Stopped enabling
bux-miniapp.serviceandbux-miniapp-tunnel.serviceat boot; lazy-start on/miniapp; updatedinstall.shandbootstrap.sh. - Added 8 tests for
/autopilot//copilotand prompt mode-awareness; 29 total pass.
- Folded card-shape doctrine into
-
Bug Fixes
_handle_agency_callback: toast on missingchat_idor malformedcallback_data; warn on DBrecord_decisionfailure.- On
createForumTopicfall-through, inform the user and run in the current thread with the error reason.