Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
470 changes: 0 additions & 470 deletions agent/AGENCY.md

This file was deleted.

189 changes: 73 additions & 116 deletions agent/CLAUDE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion agent/agency-report
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _render_image_text_file(args: argparse.Namespace) -> str | None:
except Exception:
return None

# AGENCY.md tells callers to write `\n` in shell args; bash double-quotes
# Callers write `\n` in shell args (see image-text rules); bash double-quotes
# don't expand the escape, so argv carries the literal 2-char sequence.
# Translate it (and `\\n`) into real newlines before splitting, otherwise
# the renderer draws a literal "\n" glyph in the image.
Expand Down
12 changes: 0 additions & 12 deletions agent/agency-skill.md

This file was deleted.

30 changes: 14 additions & 16 deletions agent/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,12 @@ if [ -e /home/bux/CLAUDE.md ]; then
chown -h bux:bux /home/bux/AGENTS.md
fi

# --- agency skill stub for Claude Code -------------------------------------
# Claude Code auto-loads skills from ~/.claude/skills/<name>/SKILL.md and
# surfaces their trigger phrases to the skill picker. The agency skill's
# canonical doctrine lives in agent/AGENCY.md; agent/agency-skill.md is a
# thin stub that just owns the trigger phrases ("start agency", "scan
# everything", etc.) and points back at AGENCY.md. We symlink the stub
# into place so a `git pull` to a newer AGENCY.md propagates without
# re-running bootstrap, and so the stub itself stays under version
# control instead of drifting on-disk per-box.
install -d -o bux -g bux -m 0755 /home/bux/.claude/skills/agency
ln -sfn "$AGENT_DIR/agency-skill.md" /home/bux/.claude/skills/agency/SKILL.md
chown -h bux:bux /home/bux/.claude/skills/agency/SKILL.md
# --- clean up legacy agency-skill stub -------------------------------------
# Before v2, agency was triggered by phrases ("start agency", "scan everything")
# via a Claude Code skill at ~/.claude/skills/agency/SKILL.md. After v2 agency
# is the default; the skill gate is dead. Remove it so it doesn't keep firing
# on old boxes after a git pull.
rm -rf /home/bux/.claude/skills/agency

# Agency DB lives at /var/lib/bux/agency.db (created by agency_db on
# first use). Make sure the directory is writable by `bux` so any
Expand Down Expand Up @@ -317,11 +311,15 @@ systemctl enable box-agent.service
systemctl enable bux-ttyd.service
systemctl enable bux-browser-keeper.service

# bux-tg / bux-miniapp / bux-miniapp-tunnel stay enabled-but-conditional —
# only run once /etc/bux/tg.env is written by the agent's tg_install handler.
# bux-tg is the main UX, enabled-but-conditional on /etc/bux/tg.env.
systemctl enable bux-tg.service
systemctl enable bux-miniapp.service
systemctl enable bux-miniapp-tunnel.service

# bux-miniapp + tunnel are lazy-started by the bot on /miniapp invocation
# (see _start_miniapp_service in telegram_bot.py). They aren't enabled at
# boot — they only run if the user opens the Mini App, and the cloudflared
# tunnel stops when not in use. Disable any prior enables to make this
# rollout self-healing.
systemctl disable bux-miniapp.service bux-miniapp-tunnel.service 2>/dev/null || true
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new lazy-start change is undermined because bootstrap still starts bux-miniapp-tunnel.service whenever /etc/bux/tg.env exists, so the tunnel can run at boot/update without /miniapp usage.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At agent/bootstrap.sh, line 322:

<comment>The new lazy-start change is undermined because bootstrap still starts `bux-miniapp-tunnel.service` whenever `/etc/bux/tg.env` exists, so the tunnel can run at boot/update without `/miniapp` usage.</comment>

<file context>
@@ -317,11 +311,15 @@ systemctl enable box-agent.service
+# boot — they only run if the user opens the Mini App, and the cloudflared
+# tunnel stops when not in use. Disable any prior enables to make this
+# rollout self-healing.
+systemctl disable bux-miniapp.service bux-miniapp-tunnel.service 2>/dev/null || true
 
 # Boot-time pull runs ahead of the others on every reboot.
</file context>
Fix with Cubic


# Boot-time pull runs ahead of the others on every reboot.
systemctl enable bux-boot-update.service
Expand Down
12 changes: 4 additions & 8 deletions agent/mini_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,12 +902,12 @@ def _goal_agent_prompt(
f"User context:\n{context or title}"
f"{cadence_line}"
f"{goals_block}\n\n"
"Use the Agency skill and /opt/bux/repo/agent/AGENCY.md. "
"Card-shape doctrine is in CLAUDE.md (## Composing a card). "
f"Scan the user's available context and generate {count} high-signal action items for this goal. "
"This is the generator lane for a personal social feed: create cards the user will want to accept. "
"Read the goals file and agency.db history first so you do not repeat skipped ideas. "
"Do all reversible/internal work before posting a card, then ask only at the visible boundary. "
"If the user explicitly says to work autonomously, that they are going away, or that no approval is needed, switch to Autopilot: do the private/reversible work directly, post concise progress updates in this topic, and create approval cards only for visible/external side effects. "
"If the user explicitly says to work autonomously, that they are going away, or that no approval is needed, switch to autopilot: do the private/reversible work directly, post concise progress updates in this topic, and create approval cards only for visible/external side effects. "
"Do not generate generic channel ideas like 'monitor Slack' or 'check GitHub'. "
"Every concrete card must name a person, company, thread, repo, PR, incident, signup, page, post, or file. "
"If goals or context are still unknown, create high-level goal-lock cards or ask one short goal question instead of leaving the feed empty. "
Expand Down Expand Up @@ -997,7 +997,7 @@ def _topic_generate_prompt(thread_id: int, title: str) -> str:
f"Existing recent cards:\n{context}\n"
f"Recent tap history:\n{history}\n"
f"{goals_block}\n"
"Use the Agency skill and /opt/bux/repo/agent/AGENCY.md. "
"Card-shape doctrine is in CLAUDE.md (## Composing a card). "
"The user explicitly wants more cards/action items for this topic. "
"Treat this topic as a generator lane. Read the private goals and the existing card history, learn from skipped/accepted decisions, and avoid duplicates. "
"Do not generate generic channel/workflow ideas. Each card must name a specific person, company, thread, repo, PR, incident, signup, page, post, or file and explain why it moves the topic goal. "
Expand Down Expand Up @@ -1385,11 +1385,7 @@ def do_GET(self) -> None:
except PermissionError as exc:
_json_response(self, 401, {"error": str(exc)})
return
if path == "/":
path = "/tinder.html"
if path == "/feed":
path = "/index.html"
if path == "/tinder":
if path in ("/", "/tinder"):
path = "/tinder.html"
if path == "/favicon.ico":
self.send_response(204)
Expand Down
Loading
Loading