Skip to content

exact-id membership vs block.effectiveMessageIds: remaining same-class sites (latent until sub-id projections ship) #234

Description

@ranxianglei

来源: #231 分析 sub-id 覆盖时发现

#231 (fixed in PR #233) corrected prune.ts and sync.ts, which compared block.effectiveMessageIds against current-view message ids with exact string membership. The same class of check remains at these sites (verified line numbers on master @ 04bd5ed):

Site Check Impact if projection forms diverge
src/recommend.ts:53 block.effectiveMessageIds.includes(message.id) isSyntheticOrPruned misses → bad compression recommendations
src/decompress.ts:21 block.effectiveMessageIds.some((id) => messageIds.has(id)) block not recognized as covering the view → decompress no-ops
src/decompress.ts:105 b.effectiveMessageIds.includes(message.id) block lookup by message fails
src/compress.ts:155 block.effectiveMessageIds.includes(rawId) false "dangling ref" reports
src/compress.ts:1044 overlap detection: coverage set built from effectiveMessageIds, membership tested against message ids false overlap → legitimate compressions blocked
src/boundaries.ts:259 inherited.has(id) (block owned ids vs another block's inherited content ids) inheritance detection breaks if the two blocks recorded different forms (e.g. after a mid-session projection change)
src/report.ts:75,93 coveredIds set from effectiveMessageIds, coveredIds.has(message.id) status report only (no behavior)

Latency: the kernel itself only emits plain base ids (h_<sha256>, _${N} cluster suffix — src/wire/message-id.ts), so all of these are latent today. They bite the moment an adapter projects sub-ids (base#callId, base#r0, …) or the projection form changes between turns — the same trigger as #231.

Suggested fix: reuse the baseIdOf / base-set normalization introduced in PR #233 at each site. Not done in #233 to keep that PR minimal and focused on the leak path (prune + sync, which is what actually resurrected messages).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions