simplify: kill agency-mode gate, fold doctrine into CLAUDE.md, drop old Mini App

MA
7mo ago
+242-2865

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/agency symlink 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 /miniapp button anyway (that one goes to /tinder). /feed route also dropped from mini_app.py.
  • Mini App services lazy-start. bux-miniapp.service + bux-miniapp-tunnel.service no longer enabled at boot. The bot already lazy-starts them on /miniapp invocation; cloudflared no longer burns free-tier quota 24/7. Both install.sh and bootstrap.sh updated.

Silent-failure fixes (from the dead-air scan)

  • _handle_agency_callback: missing chat_id → toast "card is gone (chat or message was deleted)".
  • _handle_agency_callback: malformed callback_data → toast "data is malformed", not empty.
  • _handle_agency_callback: DB record_decision failure → posts a one-line warning to the chat.
  • _handle_agency_callback: createForumTopic fall-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.sh consolidation. Needs a fresh-box test pass; touching every entrypoint in one PR is risky.
  • telegram_bot.py module 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.sh on a box that has ~/.claude/skills/agency/ from a prior version — verify the legacy symlink is cleaned up
  • /miniapp from TG — verify lazy-start of bux-miniapp.service still 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”); deleted AGENCY.md and trimmed CLAUDE.md.
    • Removed agency-skill.md and cleaned up the legacy ~/.claude/skills/agency symlink in bootstrap.sh.
    • Dropped the old Mini App UI and /feed route; prompts now reference CLAUDE.md; /miniapp flow unchanged.
    • Stopped enabling bux-miniapp.service and bux-miniapp-tunnel.service at boot; lazy-start on /miniapp; updated install.sh and bootstrap.sh.
    • Added 8 tests for /autopilot//copilot and prompt mode-awareness; 29 total pass.
  • Bug Fixes

    • _handle_agency_callback: toast on missing chat_id or malformed callback_data; warn on DB record_decision failure.
    • On createForumTopic fall-through, inform the user and run in the current thread with the error reason.