Skip to content

feat(dream): autoDream 连续失败退避(#292)+ docs: 配置说明一页(#290) - #322

Merged
modusensus merged 2 commits into
mainfrom
feat/290-292-config-docs-dream-backoff
Sep 26, 2026
Merged

modusensus merged 2 commits into
mainfrom
feat/290-292-config-docs-dream-backoff

Conversation

@modusensus

@modusensus modusensus commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

内容

两件发版前收尾(issue #290 / #292,交接单 .worktrees/HANDOFF-290-292.md 全项验收通过):

#292 autoDream 连续失败退避(d2df61d)

  • 新增 opt-in 键 autoDreamFailureBackoff(默认关 = 行为与现状逐字节一致),config.js schema + settings.js 白名单成对注册,api.test.js 旗标锁累加口径 +1(…+ 2 + 1)并补 effective 默认值断言。
  • 开启后有效最小间隔 = dreamMinIntervalMinutes × 2^连续失败数,成功清零恢复,封顶 30 分钟(封顶只拦指数增长,不把用户配得更大的基数压小;2^N 溢出由 Math.min 兜住)。基数 0 时无闸可翻倍,本键不自己产生间隔。
  • 失败计数口径:ok:false 与抛错计入连败;degraded 走 ok:true(LLM 成功)算成功清零;no-op 桩(无返回结果)不动计数。计数为调度器内存变量,跨重启冷却由 fix(dream): 节流与冷却时刻跨重启持久化——审计表恢复 lastRunAt 种子(#89 连发根因) #291 的 lastRunAt 持久化负责,两者不重叠。
  • 实现与交接单的偏差(已复核采纳):交接单写「lastRunAt 只在成功路径更新」,实际 弱模型(qwen3.8-flash)驱动 autoDream 时 invalid decisions 整单拒绝——建议恢复宽容路径或提供 dreamSkipInvalid #89 设计是开跑即刷新、失败也占用间隔——按交接单字面实现无法止血。本 PR 按「从上次开跑起算、放大同一道闸」实现,不新增状态面。测试 5 例(注入时钟):默认关不翻倍 / 连败 2 次第 3 次推迟 / 成功清零恢复 / 连败 10 次封顶 30 分钟 / 基数 0 无间隔。

#290 配置说明一页(809b3ea)

  • 新增 docs/CONFIGURATION.md(238 行):以 src/config.js schema 为唯一正本,147 键全覆盖(反向核对脚本抓漏后补齐),按功能面分组成表——键 | 默认 | 作用 | 开启后果/冲突;lightMode 联动键逐行标注并附 LIGHT_MODE_OFF 完整清单。两个 README 文档索引各加一行。
  • 反向核对脚本建议沉淀给后续 schema 变更复用。

验证

  • 全量 npm test:1404 tests / 1402 pass / 1 fail / 1 skip——唯一失败为 tools.test.js memory_runtime provision 断言,干净 origin/main(ecfa5d0)主树复测 29/29 全过,仅 worktree+junction 环境复现,与本 PR 无关(CI 即权威判定)。
  • npm run sync + check-sync 平价 ✓;badge:sync 被非绿套件按设计拒绝,合并后补跑(1389 → 1404)。
  • 署名 modusensus guanqishi26@gmail.com 两笔核对,零 AI 署名;分支基于最新 origin/main。

Summary by CodeRabbit

  • 新功能
    • 新增可选的自动巩固失败退避机制:连续失败时逐步延长最小运行间隔,最多 30 分钟;运行成功后恢复计数。该功能默认关闭,可在配置中启用。
  • 文档
    • 新增完整配置参考,并在中英文 README 中添加文档入口。

#89 的最小间隔闸对失败 run 也生效,但间隔恒定——恒定失败的模型(#135
空体面)按固定节奏连发刷配额。新增 opt-in 键 autoDreamFailureBackoff
(默认关 = 行为逐字节不变):有效最小间隔 = dreamMinIntervalMinutes ×
2^连续失败数,封顶 30 分钟(只拦增长,不把用户配得更大的基数压小);
成功一次清零,重启归零(跨重启冷却归 #291 的 lastRunAtSeed)。被退避
推迟的触发没有调用发生,不写审计行(与 #89 间隔内跳过同口径)。

config.js schema 与 settings.js 白名单成对注册;api.test.js 旗标计数锁
按累加口径 +1 并补 effective 断言;新增 test/dream-failure-backoff.test.js
5 例(注入时钟,同 dream-peak-hours 房型):默认关间隔不变 / 连败 2 次
第 3 次推迟 / 成功清零恢复 / 连败 10 次封顶 30 分钟 / 0 基数不产生间隔。
新增 dsh-mneme/docs/CONFIGURATION.md:以 src/config.js schema 为唯一
正本,按功能面分组(全局与存储 / scope 隔离 / 蒸馏 / 注入 / 巩固 / 睡眠 /
反思与冲突 / 实体 / 检索 / 热度 / API 与工具面 / 运行时),每键给默认、
作用与开启后果/冲突;lightMode 联动键逐行标注并附 LIGHT_MODE_OFF 完整
清单;与 settings.js 白名单的对应关系在页首一句话交代。反向核对确认
schema 顶层 147 键无遗漏。两个 README 的文档索引各加一行链接。
Copilot AI lite review requested due to automatic review settings September 26, 2026 20:00

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 reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: slow-stack/mneme/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a5b2dbf2-a8c3-43a9-a41c-ab35e2a51293

📥 Commits

Reviewing files that changed from the base of the PR and between ecfa5d0 and 809b3ea.

📒 Files selected for processing (14)
  • README.md
  • dsh-mneme/CHANGELOG.md
  • dsh-mneme/README.md
  • dsh-mneme/docs/CONFIGURATION.md
  • dsh-mneme/lib/config.js
  • dsh-mneme/lib/dream.js
  • dsh-mneme/lib/index.js
  • dsh-mneme/lib/settings.js
  • dsh-mneme/src/config.js
  • dsh-mneme/src/dream.js
  • dsh-mneme/src/index.js
  • dsh-mneme/src/settings.js
  • dsh-mneme/test/api.test.js
  • dsh-mneme/test/dream-failure-backoff.test.js
 _______________________________________________________________________________________________________________
< Make quality a requirements issue. Involve your users in determining the project's real quality requirements. >
 ---------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@modusensus
modusensus merged commit 123fdf0 into main Sep 26, 2026
8 of 9 checks passed
@modusensus
modusensus deleted the feat/290-292-config-docs-dream-backoff branch September 26, 2026 20:04
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.

2 participants