Skip to content

fix(dream): refine runs the rewrite guard; cluster joins at 0.75; abstractions get real names (1.11.0) - #145

Merged
idapixl merged 1 commit into
masterfrom
fix/refine-guard-85
Oct 25, 2026
Merged

idapixl merged 1 commit into
masterfrom
fix/refine-guard-85

Conversation

@idapixl

@idapixl idapixl commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Why

#85. In an attended dream on 1.10.0, the signature gate reported clean while refine made two damaging rewrites:

  1. A paper summary joined an unrelated memo-idea memory at cosine 0.712. Refine appended the summary verbatim and dropped the memory's opening "Virgil's memoir-agent idea:" (688 → 1,177 chars).
  2. Another memory lost its closing "(v0.8.1)".

Only hindsight called checkRewrite. Its number check also missed version strings, because \b sees no boundary between v and 0.

What

  • Refine runs checkRewrite with a new limitGrowth option: a definition that grows past max(1.4×, +300 chars) is declined. Declined rewrites keep the old definition, write no belief row, and are counted in phases.refine.declined.
  • New guard checks for every caller:
    • dropped named entities (capitalised words that appear mid-sentence);
    • a lost opening subject;
    • entity comparison by whole word, ignoring case;
    • version strings in the number check.
  • Cluster join floor goes 0.70 → 0.75, configurable with the namespace's cluster_threshold. dream and auto-consolidation now pass it through. A wrong join hands refine unrelated text; a missed join only mints a separate memory.
  • Abstract names an unlabelled synthesis with deriveName, the way create names memories, instead of clipping its first clause.
  • dreamConsolidate now reports phases.hindsight.declined. It was counted but left out of the result.

Verification

  • 459/459 tests. Of those, 12 are new (6 guard units, 6 refine/cluster/abstract end-to-end), and 9 of the new ones fail on master. The fixtures are the two real rewrites from the run.
  • I replayed the guard against a real store's full belief history (233 rows). The 20 rows declined only by the new checks are all inflated stubs, truncations, or generalisations that dropped their specifics.
  • I measured on a copy of the same store with a packed build of this branch:
    • the paper became its own memory;
    • the v0.8.1-dropping rewrite was declined;
    • 0 damaged rows, 0 regressions, 0 belief rows for the diff to flag, salience ≤ 1;
    • abstraction names are concept labels.

Not in this PR

  • Abstraction content quality: two of three abstractions in the measured run restate one theme through loose cross-domain glue.
  • A declined refine consumes its clustered observation: cluster marks it processed before refine runs, so its content reaches no memory.

Both are filed separately.

Closes #85

🤖 Generated with Claude Code

…tractions get real names (1.11.0)

An attended dream on 1.10.0 passed the signature gate while refine did two
damaging rewrites (#85): a paper summary that joined an unrelated memory at
0.712 was appended to it and the memory lost its subject ("Virgil's
memoir-agent idea"), and another memory lost "(v0.8.1)". Only hindsight ran
checkRewrite, and the number check missed version strings.

Refine now runs the guard with a growth limit. The guard also refuses
dropped named entities and a lost opening subject, and compares entities by
whole word, case-insensitively. Cluster's join floor rises to 0.75 (the
legitimate join in that run scored 0.797), configurable per namespace. An
abstraction with no label line is named by deriveName instead of its first
clause cut short.

Measured on a copy of the same store with this build: the paper became its
own memory, the version-dropping rewrite was declined, 0 damaged rows,
0 belief rows to audit, abstraction names are concept labels.

Refs #85

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@idapixl
idapixl merged commit 7e8918c into master Oct 25, 2026
9 checks passed
@idapixl
idapixl deleted the fix/refine-guard-85 branch October 25, 2026 10:20
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.

dream refine generalizes specific facts into boilerplate and bleeds in neighbouring memories' content — no signature catches it

1 participant