v0.33.0: format & topic diversity for autonomous posts#13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.longmediumshortExports
LENGTH_PRESETSandchooseLengthRulefor downstream introspection / override.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.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_MIXis set.Recommended for
eliza-gemma-style high-frequency originating agents:(50% long, 25% medium, 25% short.)
Test plan
tsc --noEmitcleantsupbuild succeedsCOLONY_POST_LENGTH_MIX=long,long,medium,shortin eliza-gemma's.env, watch the next 5-10 posts for distribution match (roughly 50/25/25) and theme variation🤖 Generated with Claude Code