Skip to content

Announce the gene by its name, not by 71 characters of hash - #24

Merged
forrestlinfeng merged 2 commits into
mainfrom
fix/name-the-gene-not-its-hash
Sep 23, 2026
Merged

forrestlinfeng merged 2 commits into
mainfrom
fix/name-the-gene-not-its-hash

Conversation

@forrestlinfeng

Copy link
Copy Markdown
Contributor

Before / after

- [Evolution Memory] Strategy reused from Gene sha256:849680dd516f…3086 (EvoMap network):
+ [Evolution Memory] Chinese Social Media Writing Template (EvoMap network):
  1. …
  2. …

- Apply it where it fits, then report the outcome with evolver_asset_reuse_result.
+ Apply it where it fits, then report the outcome with evolver_asset_reuse_result for sha256:849680dd…3086.

Why

The header is where the model decides whether the strategy is worth reading, and it opened with 71 characters of content address the model cannot act on — on every turn that primes.

The id is kept, and stays visible in the trace for debugging. It moves to the line that asks for the report, because evolver_asset_reuse_result takes an asset_id and the injection is the only place the model learns it. Deleting it would have silently broken self-reporting.

Why short_title and not summary

summary is the obvious source for a name. Measured against a live Hub:

field length
asset_id 71
short_title 4–37
summary 13–300, median 214
nl_summary up to 299

Swapping the hash for a summary would have cost three times what it replaced — the opposite of the intent. short_title is both shorter than the hash and the only one of them worth reading:

Chinese Social Media Writing Template     (37)
Xiaohongshu Store Visit Template          (32)
中文内容创作全流程与核心原则                  (14)

There is also a standing decision here: #8 kept the summary out of the prompt, and test/prime.test.js pinned it with a doesNotMatch. The first draft of this change reintroduced it through a fallback chain and that test caught it. The chain is now short_title → asset type, never the summary, and two tests hold that line.

Net effect

Header loses 71 characters of noise, gains ~30 of signal. Smaller, and it now says what the thing is.

Tests

93/93. Two added: a named gene is announced by its name with no hash in the header and the hash present on the reporting line; an unnamed one falls back to its type rather than reciting a summary. Both assert the long fields stay out.

Five existing assertions moved from the old header text to the new reporting line.

🤖 Generated with Claude Code

forrestlinfeng and others added 2 commits September 23, 2026 17:22
The injected header opened with the content address:

    [Evolution Memory] Strategy reused from Gene sha256:849680dd…86 (EvoMap network):

Seventy-one characters the model cannot act on, in the most prominent line of
the injection, on every turn that primes. The header is where the model decides
whether the strategy is worth reading, and a hash tells it nothing.

It now opens with the asset's short_title, which is both shorter and worth
reading: measured across a live search, titles run 4-37 characters against the
hash's 71, so the header gets smaller and gains the only signal it was missing.

The hash is still needed -- evolver_asset_reuse_result takes an asset_id, and
the injection is the only place the model learns it -- so it moves to the line
that asks for the report, where it is used.

`summary` was the obvious source for a name and is deliberately not used: it
runs to a 214-character median, so it would have cost three times the hash it
replaced, and #8 already decided a summary does not belong in the prompt. The
fallback is the asset type, never the summary, and a test pins that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The T1 correction test slept a fixed 150ms for a fire-and-forget POST, and
went red on CI while passing locally five times running. The line above the
sleep was meant to avoid exactly that and could not: it filtered `requests`
into a new array and then polled that snapshot, which never grows.

It now polls the live array for the report it is waiting on, and the
second-complaint assertion gets a longer settle window, since proving a
request did NOT arrive is the one case where waiting is the whole point.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@forrestlinfeng
forrestlinfeng merged commit 8ba7c14 into main Sep 23, 2026
4 checks passed
forrestlinfeng added a commit that referenced this pull request Sep 23, 2026
#24 put short_title in the header and a live session showed what that costs
when the Hub's title is truncated:

    [Evolution Memory] Object (EvoMap network):
    1. Initialize pool with configurable minimum and maximum object capacity limits
    …

`Object` is what got cut off, not what the gene is.

Measured across forty titles from eight queries, two were fragments and a
character floor cannot find them: `自动化小` is a truncation at four characters,
and `智能缓存优化` is a complete title at six. Chinese says as much in six
characters as a Latin title says in forty, so length is the wrong instrument.

A title now has to look like a name: more than one word if it is Latin,
five characters or more if it is CJK. `Object` fails on the first and
`智能缓存优化` passes on the second. Whatever fails gives way to nl_summary,
present on 39 of the 40 measured, cut to the same 80 characters the title was.

That does put a description in the header, which #8 kept out. The bound is
what makes it different: 80 characters is a name-length excerpt standing in for
a name, not the 214-character median recitation #8 rejected.

Four tests; removing the fragment check fails two of them.

Co-authored-by: forrestlinfeng <linfengchen@tencent.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@forrestlinfeng
forrestlinfeng deleted the fix/name-the-gene-not-its-hash branch September 24, 2026 14:00
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