π fix(user-memory): strengthen anti-bloat rules with HARD RULE blocks and concrete examples#3
Closed
LoveS0ph1e wants to merge 1 commit into
Closed
Conversation
β¦ and concrete examples
Profile descriptions accumulate dated instances over successive UPDATE
cycles β the previous prose-only anti-bloat rule (rule 6) saw ~62%
non-compliance from deepseek-v4-flash, with implicit_traits descriptions
routinely embedding calendar dates and growing into enumerated logs.
Rewrite UPDATE rule 6 and INIT principle 3 as HARD RULE blocks with:
- IF/THEN decision logic so the model knows exactly when to rewrite vs append
- WRONG/RIGHT contrasting examples, including the real-world failure mode
(an already-bloated multi-topic description that receives a third dated
instance β the model previously appended to the end of the mess)
- A closing self-check instruction ("re-read every descriptionβ¦rewrite it
now") that mirrors the bookend technique already proven effective by
CRITICAL LANGUAGE RULE in the same prompt
Verified on production with a real bloated profile: baseline 0/3 clean,
candidate 3/3 clean (zero dates, new information correctly folded in).
LoveS0ph1e
added a commit
to LoveS0ph1e/EverAlgo
that referenced
this pull request
Jul 2, 2026
Replace the earlier prose anti-bloat rule with the HARD RULE version from PR EverMind-AI#3, so the two changes compose cleanly without merge conflicts on rule 6. No other changes β targeting code and prompts are unchanged.
LoveS0ph1e
added a commit
to LoveS0ph1e/EverAlgo
that referenced
this pull request
Jul 2, 2026
β¦ copying the first fact Rebased onto targeting + HARD RULE anti-bloat (PRs EverMind-AI#2 + EverMind-AI#3). Profile.summary was a verbatim copy of the first explicit_info description: the extraction prompts never requested a summary, and _build_summary just returned explicit_info[0]. With this change the prompts request a short paragraph summary, _resolve_summary prefers it, and _build_summary returns "" as the intentional empty fallback β downstream synthesis handles the true holistic portrait. Additive and backward-compatible: callers and prompt overrides that omit summary keep the previous behaviour, and all existing tests pass with updated assertions.
LoveS0ph1e
added a commit
to LoveS0ph1e/EverAlgo
that referenced
this pull request
Jul 2, 2026
β¦ copying the first fact Rebased onto targeting + HARD RULE anti-bloat (PRs EverMind-AI#2 + EverMind-AI#3). Profile.summary was a verbatim copy of the first explicit_info description: the extraction prompts never requested a summary, and _build_summary just returned explicit_info[0]. With this change the prompts request a short paragraph summary, _resolve_summary prefers it, and _build_summary returns "" as the intentional empty fallback β downstream synthesis handles the true holistic portrait. Additive and backward-compatible: callers and prompt overrides that omit summary keep the previous behaviour, and all existing tests pass with updated assertions.
Author
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
The previous anti-bloat rule (UPDATE rule 6, added in an earlier server-side patch) was a single prose paragraph β no examples, no decision logic, no self-check. In production with
deepseek-v4-flash, 62% of implicit_traits descriptions still contained specific dates after UPDATE cycles, because the model treated the rule as advisory rather than mandatory.This PR rewrites the anti-bloat rules using techniques already proven effective in the same prompt file: the
CRITICAL LANGUAGE RULEachieves near-perfect compliance via a HARD RULE label and bookend repetition (appears at both the top and bottom of the prompt). The anti-bloat rules now use the same pattern.Changes
Two sections in
prompts/en/profile.py:UPDATE rule 6 (rewritten)
**Durable abstraction β HARD RULE (anti-bloat)**blockINIT principle 3 (rewritten)
Verification
Tested against a real bloated production profile (26 implicit_traits, 62% dated):
prompt=None, no test-only override)Scope
zh/profile.py) prompts are not imported by the currentProfileExtractorpaths