Skip to content

Recycler: the clanker / Clanktank bot, split into its own service (AI via Sojourns)#1

Closed
HiLleywyn wants to merge 3 commits into
mainfrom
claude/clanker-ai-packaging-YW3Uz
Closed

Recycler: the clanker / Clanktank bot, split into its own service (AI via Sojourns)#1
HiLleywyn wants to merge 3 commits into
mainfrom
claude/clanker-ai-packaging-YW3Uz

Conversation

@HiLleywyn
Copy link
Copy Markdown
Owner

@HiLleywyn HiLleywyn commented May 31, 2026

What this is

Recycler is the clanker bot: the standalone Clanktank containment system — the ,clanker command set, evidence clustering, cases, and the multi-station escape room — carved out of the old all-in-one Discoin build into its own Discord bot.

It does exactly one job. The economy, games, NFTs and markets stay in Discoin. Recycler's cog registry (core/framework/bot.py) is trimmed to a single cog, cogs.clanktank, so only the ,clanker surface runs.

Note: an earlier revision on this branch wrongly copied the whole economy; the latest commits prune it down to the clanker-only bot. The diff reflects the corrected scope.

No built-in AI

Recycler ships no model brain. The clanker's few AI-assisted touches (e.g. escape-room reflection reformulation) call out to the Sojourns platform over an OpenAI-compatible HTTP backend, through one seam (core/framework/ai/client.py):

Variable Default Purpose
AI_BACKEND_URL https://openrouter.ai/api/v1 /v1 base of the Sojourns AI backend; OpenRouter default keeps a standalone run working
AI_BACKEND_KEY falls back to OPENROUTER_API_KEY bearer token; must match Sojourns' AI_BACKEND_KEY
AI_ENABLED on when a key is present master switch; AI_ENABLED=0 runs the clanker with zero AI calls

AI is optional — with it off or the backend unreachable, containment, cases and the escape room run in full; only the AI-flavoured extras stand down.

What changed structurally

  • Keep cogs/clanktank.py; remove every other economy cog and trim COGS to cogs.clanktank.
  • Remove the economy REST API/dashboard (api/, frontend/, charts/) and Discoin's local AI memory sidecar (ai/).
  • Skip the embedded FastAPI cleanly when the package is absent (Railway injects PORT); drop the Railway healthcheck since Recycler serves no HTTP.
  • Keep core/, database/, configs/, services/, constants/ as the shared runtime substrate — verified no module-load dependency on any removed package.

Deploy (Railway)

Three services in one Railway project: Sojourns (controlling platform / AI host), Discoin (economy), Recycler (clanker). Recycler reaches the AI at http://sojourns.railway.internal:8080/v1 with a matching AI_BACKEND_KEY. Volume recycler_data at /data holds the containment DB.

Caveats

  • Could not boot in sandbox (no DB/token/deps); verification is py_compile on changed files plus import-closure analysis confirming the boot path has no module-load deps on removed packages.
  • services//configs/ remain as the shared substrate; further physical slimming is a follow-up that needs runtime verification.

Pairs with the Sojourns PR (#115, AI backend) and the Discoin PR (AI routed out + clanker removed).

Lleywyn added 3 commits May 31, 2026 09:33
…Sojourns

Recycler is the clanker economy split out as its own bot with the model
brain lifted into the Sojourns platform. The full economy (tokens,
networks, trading, staking, shops, minigames, NFTs, seasons, quests)
ships intact; only AI inference changes.

- Centralize every model call through one configurable seam in
  core/framework/ai/client.py (and auto_repair.py): an OpenAI-compatible
  backend selected by AI_BACKEND_URL / AI_BACKEND_KEY.
- Add AI_ENABLED master switch. AI is optional: with it off, or the
  backend unreachable, the economy runs and AI-gated features (Disco /
  AI Chat, clanker pattern controller, AI helpers) degrade gracefully
  instead of erroring.
- Default AI_BACKEND_URL to OpenRouter so a standalone deploy still
  works; point it at a Sojourns host to serve AI through the platform.
- README, .env.example and CHANGELOG document the split and wiring.
- .env.example: concrete AI_BACKEND_URL pointing at Sojourns over Railway
  private networking (sojourns.railway.internal:8080/v1), shared
  AI_BACKEND_KEY example, AI_ENABLED=1, with public-domain and local-dev
  alternatives documented.
- railway.toml: rename persistent volume discoin_data -> recycler_data.
- README: Railway deploy topology (Sojourns = controlling platform / AI
  host, Recycler = economy service beside it; both Dockerfied).
Corrects the scope: Recycler is the clanker / Clanktank containment bot,
not the economy. The economy / games / NFTs stay in Discoin.

- Prune to a single cog: keep cogs/clanktank.py, remove every other
  economy cog; trim the COGS registry in core/framework/bot.py to
  cogs.clanktank so only the ,clanker command surface runs.
- Remove the economy REST API/dashboard (api/, frontend/, charts/) and
  Discoin's local AI memory sidecar (ai/). Skip the embedded FastAPI
  cleanly when the package is absent (PORT injected on Railway); drop the
  Railway healthcheck since Recycler serves no HTTP.
- Keep core/, database/, configs/, services/, constants/ as the shared
  runtime substrate (verified no module-load deps on the removed
  packages).
- AI stays routed to Sojourns via the AI_BACKEND_* seam; clanker's one
  AI touch degrades gracefully when AI is off.
- README, CHANGELOG and railway.toml updated to the clanker-only bot.
@HiLleywyn HiLleywyn changed the title Package clanker economy as standalone Recycler bot (AI served by Sojourns) Recycler: the clanker / Clanktank bot, split into its own service (AI via Sojourns) May 31, 2026
@HiLleywyn HiLleywyn closed this May 31, 2026
@HiLleywyn HiLleywyn deleted the claude/clanker-ai-packaging-YW3Uz branch May 31, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants