Skip to content

fix: retain unpublished drafts until explicit removal - #26

Merged
forrestlinfeng merged 2 commits into
EvoMap:mainfrom
imxyanua:codex/fix-draft-retention
Nov 3, 2026
Merged

forrestlinfeng merged 2 commits into
EvoMap:mainfrom
imxyanua:codex/fix-draft-retention

Conversation

@imxyanua

@imxyanua imxyanua commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The documented review flow keeps drafts until publication or discard, but adding a draft silently removes entries older than eight days and evicts entries beyond twenty. Listing and discarding also hide/drop old or unstamped legacy drafts.

add draft → deduplicate its ID → retain every other draft
remove draft → remove only the selected ID

Remove automatic draft expiry and capacity eviction. Candidate/session/report retention policies remain separate.

Evidence

  • Before: a public command/store regression retains only the new draft instead of 25 older drafts plus a legacy unstamped draft.
  • After: all 27 drafts remain visible and persisted; discard removes exactly the selected one.
  • Draft, distillation and architecture tests: 27 passed on Windows Node 24.21.0. All eight hosts pack; independent code review and diff-check passed.
  • The existing deduplication test still verifies replacement by ID, now also preserving more than twenty drafts and old entries.

Merge Danger

Door: two-way

Existing stored drafts need no migration. Already deleted drafts cannot be recovered by this change.

Blast Radius: persistence

The local draft list can grow until the user publishes or discards entries. This favors preservation of unreviewed user data over silent eviction; pagination/archival is outside this fix.

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。

另有 1 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=26、head_sha="01f44fcfc3c9a71a23bc97718a681b581842e55e",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 01f44fcfc3c9

@evomap-aiqa-bot

Copy link
Copy Markdown

Sentinel 保留了 1 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
开发 agent:请 review 以下 advisory,并逐条给出“已验证无风险 / 已修复 / 转为后续事项”的结论;不要只做整体确认。

  • [P3] 完整草稿资产改为无限期保留,扩大敏感数据落盘窗口 — 本 PR 同时移除 8 天 TTL 和 20 条上限;而 draftOf 会原样保存 Proxy 返回的完整 gene、capsule ...(truncated) · lib/distill.js · advisory_4932ad3350e38add168d80c8

需要完整证据时,可用行末 finding_key 查询 Sentinel PR review context。

由 Sentinel 审核 · 目标提交 01f44fcfc3c9

@forrestlinfeng forrestlinfeng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code review — approve after cleanup

Matches the documented contract (drafts are kept until the person publishes or discards them, docs/architecture.md), and doesn't conflict with lib/retention.js.

Minor

  • Leftover now arguments: withDraft / withoutDraft no longer take now, but callers still pass clock.now() — lib/app/commands/drafts.js, lib/app/commands/status.js, lib/app/distill-session.js, and the new tests. withoutDraft(list, null, now) in drafts.js and status.js now just copies the list; replace with a plain read().
  • No size limit at all now: the JSON file is fully rewritten on every update and /evolver-drafts prints every draft. Growth is slow (one per verified session), so fine as a deliberate choice — consider a high limit that warns rather than deletes.
  • Nit: test/app/draft-retention.test.js:15 writes list =>; the repo writes (list) =>.

Suggest merging this before #25, which can then be simplified.

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。

另有 2 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=26、head_sha="09660bcb68243385bf684867c1b6dbea1f394c75",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 09660bcb6824

@evomap-aiqa-bot

Copy link
Copy Markdown

Sentinel 保留了 2 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
开发 agent:请 review 以下 advisory,并逐条给出“已验证无风险 / 已修复 / 转为后续事项”的结论;不要只做整体确认。

  • [P2] 草稿队列取消全部容量约束,持续蒸馏可导致存储和命令处理退化 — 本 PR 同时删除 8 天 TTL 和 20 条上限;每个新 distill_id 都会永久追加包含完整 Gene/Capsule 资�...(truncated) · lib/distill.js · advisory_554754641a8d2960764fed63
  • [P3] 完整草稿资产改为无限期保留,可能延长敏感内容落盘周期 — draftOf() 将 Proxy 返回的完整 gene、capsule 对象写入草稿;本 PR 同时删除 8 天 TTL 和 20 条��...(truncated) · lib/distill.js · advisory_0b629c54222aac62c1e4b27d

需要完整证据时,可用行末 finding_key 查询 Sentinel PR review context。

由 Sentinel 审核 · 目标提交 09660bcb6824

@forrestlinfeng
forrestlinfeng merged commit 5303981 into EvoMap:main Nov 3, 2026
4 checks passed
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