Skip to content

v0.33.0: format & topic diversity for autonomous posts#13

Merged
ColonistOne merged 3 commits into
mainfrom
post-format-diversity
May 19, 2026
Merged

v0.33.0: format & topic diversity for autonomous posts#13
ColonistOne merged 3 commits into
mainfrom
post-format-diversity

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Summary

Three levers on the monotony observed in high-frequency dogfood agents — primarily eliza-gemma, who posted 66 times in 30 days in a uniform 2000-2500-char academic-essay shape on a recurring handful of themes (RLHF compliance 3×, memory cliff 4×, persona overhead, natural-language coordination).

What changed

  1. COLONY_POST_LENGTH_MIX — new env var. Length rotation. Comma-separated preset names (long / medium / short); each tick picks one uniformly at random. Stateless — no cycle index across restarts. Empty (default) preserves legacy behaviour.

    preset shape
    long 3-6 paragraphs, ~1500-2500 chars (the legacy rule)
    medium 1-2 paragraphs, ~400-1000 chars
    short 1-3 sentences, ~80-400 chars

    Exports LENGTH_PRESETS and chooseLengthRule for downstream introspection / override.

  2. RECENT_POST_RING_SIZE: 10 → 25. The 10-slot dedup cache was being out-paced by 4-8h post intervals over multi-day spans — themes aged out of the suppression window before they stopped repeating. 25 covers ~5 days at the slow end.

  3. Recent-topics instruction strengthened from soft guidance to HARD RULE + explicit SKIP escape. v0.32 prompted "pick something genuinely different this time"; Gemma 4 Q4 / qwen3.6 reliably ignored it. New wording is a HARD RULE + an explicit no-op escape so the model has somewhere to go other than recycling.

Plus a small output-format hint update so the placeholder doesn't fight the length-mix preset.

Migration

Drop-in. Existing deployments preserve byte-for-byte v0.32 behaviour until COLONY_POST_LENGTH_MIX is set.

Recommended for eliza-gemma-style high-frequency originating agents:

COLONY_POST_LENGTH_MIX=long,long,medium,short

(50% long, 25% medium, 25% short.)

Test plan

  • 1923 existing tests pass
  • +5 new tests cover length rotation (legacy fallback, short, medium, invalid-mix fallback) and topic-suppressor wording shift
  • tsc --noEmit clean
  • tsup build succeeds
  • Operator-side: set COLONY_POST_LENGTH_MIX=long,long,medium,short in eliza-gemma's .env, watch the next 5-10 posts for distribution match (roughly 50/25/25) and theme variation

🤖 Generated with Claude Code

ColonistOne and others added 3 commits May 19, 2026 21:24
Three levers on the monotony observed in eliza-gemma's 66-posts-in-30-
days: uniform 2000-2500-char essay shape on a small handful of themes
(RLHF compliance 3+, memory cliff 4+, persona overhead, natural-language
coordination).

1. COLONY_POST_LENGTH_MIX — length rotation. Comma-separated preset
   names (long / medium / short); each tick picks one uniformly at
   random. Stateless. Empty (default) preserves legacy single-rule
   behaviour. Recommended `long,long,medium,short` = 50/25/25.

   - long   = 3-6 paragraphs, ~1500-2500 chars (legacy rule)
   - medium = 1-2 paragraphs, ~400-1000 chars
   - short  = 1-3 sentences, ~80-400 chars

   Exports `LENGTH_PRESETS` + `chooseLengthRule` for introspection /
   override.

2. RECENT_POST_RING_SIZE: 10 → 25. The 10-slot dedup cache was being
   out-paced by 4-8h post intervals over multi-day spans — themes
   aged out of the suppression window before they stopped repeating.
   25 covers ~5 days at the slow end, ~10 days at the fast end.

3. Recent-topics prompt instruction strengthened from soft guidance
   to HARD RULE + explicit SKIP escape. v0.32 prompted "pick something
   genuinely different this time"; Gemma 4 Q4 / qwen3.6 reliably
   ignored it. New wording: "HARD RULE: do NOT post on a theme that
   overlaps any of these recent posts. If your draft would echo any
   of them, output SKIP instead" — paired with an explicit no-op
   escape hatch so the model has somewhere to go besides recycling.

Output-format hint updated so the placeholder ("<body — the full post
content, 3-6 paragraphs>") doesn't fight the length-mix preset; now
reads "<body — the full post content; length governed by the rule
above>".

Tests: existing 1923 pass; +5 new (length rotation: legacy fallback,
short, medium, invalid-mix fallback; topic-suppressor wording shift).

Migration: drop-in. Set COLONY_POST_LENGTH_MIX in agent .env to opt
in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v0.32.0 added the persist-aware-initial-delay path to ColonyPostClient
(read last-post timestamp from the daily ledger, schedule next fire
relative to it) but shipped without tests. CI on main has been failing
the 100% coverage threshold since 2026-04-30 — post-client.ts lines
275-278 (immediate-fire-on-overdue branch) and 292-295 (tick outer
catch) were uncovered. This PR inherited that block.

Three new tests bring those branches back to 100%:

  - fires immediately when last post is older than the interval
    (covers 275-278 — initialDelay clamps to 0, "firing immediately"
    log)
  - sleeps the remaining interval when last post is recent
    (covers the parallel "initial delay Ns" branch)
  - outer catch swallows non-tick errors that throw inside tick()
    (covers 292-295 — maybeRefreshKarma throws, tick's outer catch
    fires, post does not crash)

post-client.ts now back to 100% lines/statements/functions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The existing 'catches unexpected errors in the outer tick loop' test
had getCache throw on every call, including the one from
lastPostTimestamp() which runs BEFORE the tick try/catch is
established. The rejection escaped loop() and surfaced as an unhandled
rejection in vitest, failing CI with exit code 1 even when all 1927
tests pass and coverage is 100%.

Fix: succeed on the daily-ledger key (so lastPostTimestamp returns
cleanly) and only throw on the dedup-cache key. The error now
propagates inside tick() → caught by the outer try/catch on line 292
(which is what the test was always supposed to exercise).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ColonistOne ColonistOne merged commit 78eebcf into main May 19, 2026
2 checks passed
@ColonistOne ColonistOne deleted the post-format-diversity branch May 19, 2026 22:08
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.

1 participant