Skip to content

feat(dream): dream_runs 重载列保留期——裁列不删行(#557) - #680

Open
modusensus wants to merge 3 commits into
mainfrom
feat/557-dream-runs-trim
Open

modusensus wants to merge 3 commits into
mainfrom
feat/557-dream-runs-trim

Conversation

@modusensus

Copy link
Copy Markdown
Member

Closes #557.

背景

dream_runs 是四个 *RetentionDays 都不覆盖、也没有任何 DELETE 路径的唯一一张表:单行 input 快照体量随记忆数涨、轮数随天数涨,两个因子相乘超线性(报告库占约 43% 的页),再叠加热快照是整库副本,它同时放大库与备份两处开销。

改了什么

  • 新键 dreamRunsTrimDays(opt-in 默认 0 = 不裁,升级后行为逐字节不变)。形态对齐 recallRetentionDays 一族:顶层扁平键、只从配置文件改。
  • 启动期裁掉窗口外轮次的三列重载:input(可由记忆库重建)、decisions、outcome——issue 评论实测这三列占 13.26 MB 列文本的 50.1% / 30.5% / 17.8%。
  • 裁列不删行(维护者拍板 3):行、snapshot_hash、status、provider、receipt、policy_epoch、store_count 等骨架列全部保留;窗口外轮次的离线回放降级为骨架级(与 reclaim 清 input、dreamInputSummaryEnabled 的瘦身同一条口径,docs/CONFIGURATION.md 写明三处互不冲突)。
  • organize 行整体豁免:它的 input 是 apply 的重放载荷、outcome 挂着 dry_run_id / applied_at 链;谓词与 clearDreamRunInputs 同一条边界。
  • 启动期执行(读装配后的 cfg、失败只 warn 不挡启动);真裁到了才出一行 info,常态零日志。

验证

  • 全量 npm test:0 fail(合并最新 main 后重跑)。
  • check-sync:一致。
  • 新增回归 7 条:窗口外裁三列且骨架列逐列不变 / 行永不删 / organize 整体豁免 / 重跑 changes=0 / stats 与执行同口径 / 空表与无命中不抛 / 配置键默认 0 与边界 + 两处文档列出该键 + 接线锁(0 不裁、读 cfg、失败只 warn)。
  • 变异自证 4 例全部变红(删 organize 豁免 / > 0 改 >= 0 / 默认改 90 / 裁剪漏 outcome)。
  • 已过 euthyna 变更面审计:0 TRUE POSITIVE。

已知边界

  • 键未进 settings.js 白名单(与该族现状一致,文档已注明);要上面板需同时补 api.js 的 NESTED 表与 client.js 的面板行。
  • 窗口没有「保留最近 K 轮」的下限;配得很小时,最近的 decisions.demotion 会退化为 null(骨架不受影响)。

Copilot AI lite review requested due to automatic review settings November 12, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d07260a and 51ab32b.

Files selected for processing: 10

  • dsh-mneme/CHANGELOG.md
  • dsh-mneme/README.md
  • dsh-mneme/docs/CONFIGURATION.md
  • dsh-mneme/lib/config.js
  • dsh-mneme/lib/index.js
  • dsh-mneme/lib/store.js
  • dsh-mneme/src/config.js
  • dsh-mneme/src/index.js
  • dsh-mneme/src/store.js
  • dsh-mneme/test/dream-runs-trim.test.js
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.52542% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
dsh-mneme/src/index.js 66.66% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI lite review requested due to automatic review settings November 13, 2026 02:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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.

0.10.1:dream_runs 没有保留期键且无界增长(实测占库约 43% 的页),四个 *RetentionDays 也都不覆盖它

2 participants