Skip to content

fix(dreaming): version the topic map so an extractor fix reaches existing workspaces (v0.281.2) - #501

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/topics-version
Jul 31, 2026
Merged

fix(dreaming): version the topic map so an extractor fix reaches existing workspaces (v0.281.2)#501
vikasprogrammer merged 1 commit into
mainfrom
feat/topics-version

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Caught while verifying #500 on the live fleet: the extractor fix had no effect on any workspace that was already running.

state.topics is a cumulative map — counts compound across passes and decay only on a 21-day half-life. Fixing what gets extracted doesn't remove what was already extracted. The live instapods state:

stored topics: 300 | top: claude(62), drafts(61), sweep(59), automated(58),
                          incremental(58), support(58), phases(58), every(55)

Every one of those is an artefact of a single shouted prompt header (AUTOMATED INCREMENTAL SUPPORT SWEEP …) that #500 stopped extracting — and every one would have kept headlining the guidance line in every agent's system prompt for weeks, being reinforced faster than it decayed.

Fix

DreamState gains topicsVersion. When a stored state's version is older than TOPICS_VERSION, its topic map is cleared and rebuilt from the current corpus.

The reset runs before the no-activity early return — otherwise a quiet workspace would keep serving the stale line until its next busy pass. Audited as learning.topics.reset with the dropped count.

The alternative was hand-editing five production databases; this way every tenant (including insta-ai and expresstech, which nobody is looking at today) self-heals on its next pass, and the next extractor change is a one-line version bump.

Verified

Against a copy of the live instapods state:

BEFORE: topics=300 | version=undefined
  top: claude(62), drafts(61), sweep(59), automated(58), incremental(58), support(58)
AFTER : topics=0   | version=2
  guidance: (no topic line — map rebuilding)

The topic line disappearing until the map rebuilds is the intended behaviour: saying nothing is correct, saying sweep, automated, drafts was not.

137/137 governance + 18/18 tier-A policy.

🤖 Generated with Claude Code

…ting workspaces (v0.281.2)

v0.281.1 fixed WHAT gets extracted as a topic, but `topics` is a cumulative map: counts
compound across passes and decay only on a 21-day half-life. So on any workspace already
running, the words the OLD extractor admitted keep their large counts and keep headlining
the guidance line that rides in every agent's prompt. Live instapods: 300 stored topics led
by drafts(61), sweep(59), automated(58) — all artefacts of one shouted prompt header, none
of which the fix could remove.

DreamState now carries `topicsVersion`. A state written by an older extractor has its map
cleared and rebuilt from the current corpus. The reset runs BEFORE the no-activity early
return, so a quiet workspace stops serving the stale line today rather than at its next
busy pass. Audited `learning.topics.reset`.

Verified against a copy of the live instapods state: 300 topics (version undefined) →
0 topics (version 2), guidance topic line drops until the map rebuilds.

Every tenant self-heals on its next pass — no hand-edited databases.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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