Repository navigation
Conversation
…ntributions distinct Episode evolution treated one identifier as source identity, input revision and content generation order at the same time, so retries, revisions and rebuilds could double-count contributions or validate new content with old trial results. Separate the three concerns without changing the statistics formulas or the table schema. Idempotency - Re-running an episode after it closes again no longer counts the same evidence twice. Multi-trial rejudgement replaces the original contribution in event order, preserving Policy updates and manual checkpoints that sit between them instead of rolling back the whole statistics snapshot. - Implicit feedback can still trigger rejudgement; explicit feedback is protected by record identity, so an ownership change does not add a second contribution. - Restoring an old trial only accepts a verifiable historical snapshot. A log that changed nothing but feedback ownership or settlement time is skipped while the search continues for the real original settlement. Contribution identity - Span: allow a retired Span to be restored at the same source and tool range, so a fixed id no longer collides with its own tombstone. Only an explicit automatic-retirement marker (or a version-matched retirement log) permits restoration; user deletions stay deleted. - Skill eta: recognise Policy sources already counted through crystallization and revise the existing contribution instead of adding a second reward drift for the same source. New independent sources still contribute on their own. - Content rebuild: place a genuine text change after the existing trial history and keep the Skill as candidate, so an earlier successful trial cannot validate content generated later. Same-text refreshes only recompute numbers; A -> B -> A is a new rebuild. - Legacy negative experience: keep protecting unsplittable legacy aggregates while allowing an already tracked source to be revised and withdrawn. A single-source legacy row plus C can be attributed exactly. - Skill generation: when a version conflict discards the draft, release the cooldown recorded by that attempt so the worker retry actually runs. Verification - Memory suite: 1454 passed, 1 skipped. - Memory and viewer TypeScript checks pass. - Installed package rebuilt from this tree (1.2.3, arm64, cn, unsigned): 135/135 targeted tests and 202/202 evolution tests pass against the runtime inside the DMG, versus 25 failures on the previous package. - Real-model smoke test through the packaged CLI replies normally.
Follow-up to the contribution-identity work, covering two places where the separation was still incomplete. Cluster processing identity - processedFingerprint now hashes the evidence actually packed for the model instead of the Episode input revision. The input revision also moves on scoring timestamps and lifecycle metadata, which re-opened unchanged evidence; and it excludes alpha, so a genuine step change could stay invisible. Hashing the packed turns covers both directions. A changed reward still re-opens the member. Policy induction bucket freshness - Re-read the candidate pool for each signature with the current clock. The previous code reloaded candidates but filtered them by a timestamp captured once per job, so a candidate whose TTL expired mid-loop stayed readable, and the evidence revision guard compared two equally stale readings. Expired buckets now stay pending instead of being promoted behind a Policy that never legitimately saw them. Span retirement semantics - Align span-big-turn with the replacement rule MEMMY-647 introduced: a second split retires the previous span set, so only the latest split stays searchable. The test asserted the older accumulate-everything behaviour and now checks that the retired spans are marked deleted as well. Verification (upstream/1.2.7 base): - Root npm test passes end to end: 7079 passed, 134 skipped, 0 failed. - Memory suite 1562 passed, 1 skipped. - Memory and viewer TypeScript checks pass. - Each new expectation was confirmed to fail with its fix reverted.
yxyi123
force-pushed
the
test/memmy-647-reproduction-v126
branch
from
October 26, 2026 12:32
c25e35e to
660b3b9
Compare
This branch has not been deployed
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.
什么问题
Episode 演进用同一个标识同时承担了三件事:来源身份、输入修订、内容生成顺序。三者混在一起,导致重试、修订和重建时会重复计数,或者用旧的 trial 结果去验证后来才生成的内容。
具体表现:
UNIQUE constraint failed: memories.id),整批事务回滚且重试无法消除。怎么改的
不改变统计公式,不做表结构迁移,只补身份与时序边界。
幂等
贡献身份
目标分支与基线
本 PR 目标分支为
1.2.7,基线0ad11348。647 的全部改动以单个提交 cherry-pick 到该基线,未带入同一分支上其他工单的修改。验证
npm testgit diff --check安装包验证(macOS 26.4 / Apple Silicon / arm64 / cn / unsigned,1.2.3):
hdiutil verifymemory-runtime与源码编译产物说明
v1.2.6基线上完成;本轮迁移到1.2.7后重新执行了完整自动化测试,未重新打包 DMG。