Skip to content

Send the project with every recall and inject a local Gene's project notes - #48

Open
forrestlinfeng wants to merge 6 commits into
feat/portable-distill-contractfrom
feat/local-recall-project-notes
Open

forrestlinfeng wants to merge 6 commits into
feat/portable-distill-contractfrom
feat/local-recall-project-notes

Conversation

@forrestlinfeng

Copy link
Copy Markdown
Contributor

Summary

Proxy 的 /asset/fetch 现在也从本地资产库召回(EvoMap/evolver-v2-private-dev#1397)。本 PR 让插件把项目告诉 Proxy,并注入本地 Gene 附带的项目笔记。

 hubGene(proxyFetch, text, { projectDir })
-  POST /asset/fetch { text }
+  POST /asset/fetch { text, project_dir }
   inject:
     [Evolution Memory] <title> (EvoMap network | local memory):
     1. step …
+    Notes for this project:       # 只有本地 Gene 才带,和步骤共用 4000 字预算
+    - note …                      # 超出预算的笔记跳过,策略整体保留
 evolver_distill_conversation
+  body.project_dir = 会话 cwd     # Proxy 据此给本地 Capsule 打项目指纹

叠在 #47(feat/portable-distill-contract)上。

Evidence

  • Before: 插件只发 { text },Proxy 分不清是哪个项目,项目笔记永远注入不了。
    After: 新测试覆盖两点:
    • 召回请求体是 { text, project_dir };本地 Gene 的注入文本带 Notes for this project:,超出预算的笔记被跳过,总长 ≤ 4000。
    • distill 请求带上会话的 project_dir。
  • npm test:160/160 通过。
  • Cloudflare 容器实测:插件发出 project_dir:/app,收到本地 Gene 和 4 条笔记,注入成功。

Merge Danger

Door: two-way

Blast Radius: 召回注入文本

  • 对没有本地召回的 Proxy 没有影响:多出的 project_dir 字段会被忽略,没有 project_notes 时注入文本不变。

🤖 Generated with Claude Code

…notes

The Proxy now recalls from its local store too and keeps a Capsule's project notes to the project that wrote
them, so the plugin names the session's project directory on /asset/fetch and on distillation. A local Gene's
notes follow its steps under the same 4000-character budget; a note that does not fit is left out rather than
the whole strategy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

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

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

由 Sentinel 审核 · 目标提交 9b29cb9732a1

@evomap-aiqa-bot

Copy link
Copy Markdown

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

  • [P3] 网络资产的 project_notes 未进行来源隔离,可能把攻击者内容注入当前项目��...(truncated) — projectNotesWithin() 只检查 asset.project_notes 是否为数组,没有验证资产来源。originOf() 虽然�...(truncated) · src/prime.js · advisory_7e79b8c5287903a368376c52
  • [P3] 延迟召回未校验项目作用域,可能把旧项目的本地 notes 注入新项目会话 — hubMessages 在请求开始时用 projectDirOf(agent.session) 捕获项目目录并传给 hubGene。超时后,��...(truncated) · src/index.js · advisory_d842ee8e9f9ce6318262b651

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

由 Sentinel 审核 · 目标提交 9b29cb9732a1

A network asset could carry a project_notes field of its own; only the local Proxy can vouch that notes were
written by this project, so notes are taken from local recalls alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forrestlinfeng

Copy link
Copy Markdown
Contributor Author

Sentinel advisory 逐条结论:

  • advisory_7e79b8c5287903a368376c52(网络资产的 project_notes 未做来源隔离):已修复(2c8c714)。projectNotesWithin() 现在只在 recall.source === 'local' 时读取笔记,网络资产即使自带 project_notes 字段也不会注入;新增测试 a network asset's project notes are never injected。
  • advisory_d842ee8e9f9ce6318262b651(延迟召回未校验项目作用域):已验证无风险。迟到的结果只通过 agent.inject 注入回发起请求的同一个 agent。projectDirOf(agent.session) 读取的是该会话头 header.cwd,会话创建时就已确定,一个会话不会切换到另一个项目。另外,笔记由 Proxy 按请求里的 project_dir 判定是否同项目后才返回,不会混入别的项目的笔记。

🤖 Addressed by Claude Code

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

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

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

由 Sentinel 审核 · 目标提交 2c8c714e5f02

@evomap-aiqa-bot

Copy link
Copy Markdown

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

  • [P3] 项目切换后迟到的本地召回可能注入旧项目备注 — hubMessages 在请求开始时把 projectDirOf(agent.session) 传给 hubGene。若请求超过 assetPrimeWaitMs�...(truncated) · src/index.js · advisory_7a8750cdc6aade21b9e98c86

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

由 Sentinel 审核 · 目标提交 2c8c714e5f02

A recall that outlives the step's wait is injected into a later step; its notes were chosen for the project
the request named, so it is discarded when the session's project directory has changed since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forrestlinfeng

Copy link
Copy Markdown
Contributor Author
  • advisory_7a8750cdc6aade21b9e98c86(项目切换后迟到的本地召回可能注入旧项目备注):已修复(在上一轮"已验证无风险"之外,又加了一道防线)。hubMessages 记下请求发出时的 projectDir;迟到结果在注入前会重新读取 projectDirOf(agent.session),与请求时不一致就丢弃。新增测试 a late recall is dropped once the session has moved to another project,去掉这道检查后该用例失败。

🤖 Addressed by Claude Code

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

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

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

由 Sentinel 审核 · 目标提交 b09b8e6659da

@evomap-aiqa-bot

Copy link
Copy Markdown

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

  • [P2] 等待窗口内切换项目仍可能注入旧项目召回 — 项目目录仅在“超出等待窗口后的异步 .then()”中重新校验;等待窗口内已完成的检索走��...(truncated) · src/index.js · advisory_af61714d0610cb5c50906a08
  • [P3] 等待预算内完成的召回未重新校验项目作用域 — projectDir 在请求开始时捕获,但仅超时后的 search.then(...) 路径重新比较当前目录。搜索若...(truncated) · src/index.js · advisory_56c71add26ba4d6c07970b5f
  • [P3] 快速召回完成时可能返回旧项目的本地备注 — projectDir 在请求开始时捕获,但新增的 projectDirOf(agent.session) !== projectDir 校验只存在于超�...(truncated) · src/index.js · advisory_518756403247b83787b80491

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

由 Sentinel 审核 · 目标提交 b09b8e6659da

The project check now guards both paths through one helper: a recall that lands inside the wait and one that
arrives after it are dropped alike when the session has moved to another project since the request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forrestlinfeng

Copy link
Copy Markdown
Contributor Author
  • advisory_af61714d0610cb5c50906a08 / advisory_56c71add26ba4d6c07970b5f / advisory_518756403247b83787b80491(等待窗口内完成的召回未重新校验项目):已修复。两条路径(等待窗口内完成的、超时后迟到的)都改为通过同一个 messageFor 生成注入消息,生成前先比对 projectDirOf(agent.session) 与请求时的 projectDir,不一致就丢弃。新增测试 a recall inside the wait is dropped once the session has moved to another project:去掉这道校验后,它和迟到路径的测试都会失败。插件测试 163/163 通过。

🤖 Addressed by Claude Code

@cursor

cursor Bot commented Oct 21, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

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

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

由 Sentinel 审核 · 目标提交 95b8747f1fab

@evomap-aiqa-bot

Copy link
Copy Markdown

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

  • [P2] 缺失 project_dir 时仍允许读写项目专属备注 — hubGene 在 projectDir 为空时直接省略 project_dir,但仍会把代理返回且标记为 recall.source ===...(truncated) · src/prime.js·advisory_8aa37997ea93783af76de86c`
  • [P3] 被作用域校验丢弃的召回仍记为已注入 — hubGene 在调用方完成项目作用域校验之前就报告 status: 'injected';新增的 messageFor 可以随...(truncated) · src/index.js · advisory_2b52d68c2eaff0f4cb3eb8b9
  • [P3] 切换项目后仍沿用旧项目的已列出资产集合 — projectDir 已按当前 session 重新获取,但 listedAssets 仍以 agent 为键跨项目复用。相同资产 ID...(truncated) · src/index.js · advisory_a40472572a5fe8ecb69a1a81

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

由 Sentinel 审核 · 目标提交 95b8747f1fab

A local Gene's notes are injected only when the request named a project. A recall the project check drops is
recorded as discarded (project_changed), so evolver_status no longer reports it as the last injection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forrestlinfeng

Copy link
Copy Markdown
Contributor Author
  • advisory_8aa37997ea93783af76de86c(缺失 project_dir 时仍会注入项目备注):已修复(cf43c42)。projectNotesWithin 只在请求带了 projectDir 且资产来自本地召回时才注入笔记;新增测试 a local Gene's notes are left out when the request named no project。另外,Proxy 侧在没有 project_dir 时也不会返回笔记:指纹为空,projectMatch 为假。
  • advisory_2b52d68c2eaff0f4cb3eb8b9(被作用域校验丢弃的召回仍记为已注入):已修复。丢弃时追加一条 status: 'discarded', reason: 'project_changed' 记录,evolver_status 的 last 与 counts 都会体现;测试里通过 evolver_status 断言,去掉这条记录后测试失败。
  • advisory_a40472572a5fe8ecb69a1a81(切换项目后沿用旧的已列出资产集合):已验证无风险。listedAssets 记录的是已经注入进这个 agent 上下文的资产 id。切换项目后,这些内容仍在同一个 agent 的上下文里,再注入一遍只会重复,所以按 agent 去重是有意为之。

🤖 Addressed by Claude Code

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

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

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

由 Sentinel 审核 · 目标提交 cf43c422e5a6

@evomap-aiqa-bot

Copy link
Copy Markdown

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

  • [P2] 跨项目复用资产去重集合会丢失新项目的专属备注 — 新增逻辑按当前 projectDir 请求项目专属 project_notes,但 listedAssets 仍是以 agent 为键的 We...(truncated) · src/index.js·advisory_bef838c790ec77468c7c3a23`

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

由 Sentinel 审核 · 目标提交 cf43c422e5a6

A Gene injected for one project was kept out for the rest of the session, so after the session moved to
another project that project's own notes could never arrive. The injected set is now kept per project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forrestlinfeng

Copy link
Copy Markdown
Contributor Author
  • advisory_bef838c790ec77468c7c3a23(跨项目复用去重集合会丢失新项目的专属备注):已修复(2e818ff)。已注入资产的记录改为按"agent + 项目目录"分别保存:同一项目内仍只注入一次,切到另一个项目后,同一个 Gene 会带着新项目的笔记重新注入。上一轮我判断为"已验证无风险",这一判断不对:它只考虑了避免重复注入步骤,没考虑笔记随项目而不同。新增测试 a Gene injected for one project is injected again, with that project's notes, in another,回退到上一版本后该测试失败。插件测试 165/165 通过。

🤖 Addressed by Claude Code

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

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

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

由 Sentinel 审核 · 目标提交 2e818ff9af73

@evomap-aiqa-bot

Copy link
Copy Markdown

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

  • [P3] 无项目目录时仍可持久化项目专属备注 — evolverTools 为 projectDirOf 提供了返回 undefined 的默认实现,但蒸馏请求仍会把 project_notes...(truncated) · src/tools.js · advisory_f28f9cdfc3cce5755b3ade31
  • [P3] 无项目目录时仍可提交未作用域化的项目备注 — 新增的工具请求始终携带 project_notes,但 project_dir 可能为空。若 Proxy 在缺失项目目录时�...(truncated) · src/tools.js · advisory_ca7dd0361c5b1285363060ca
  • [P3] 项目备注在无项目目录时失去作用域 — 两条 advisory 实际指向同一条跨模块生命周期风险:即使项目目录不存在,项目专属备注仍��...(truncated) · src/index.js`、`src/prime.js`、`src/tools.js · advisory_e12ea79bdac8ed0ace7243e2

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

由 Sentinel 审核 · 目标提交 2e818ff9af73

@forrestlinfeng

Copy link
Copy Markdown
Contributor Author
  • advisory_f28f9cdfc3cce5755b3ade31 / advisory_ca7dd0361c5b1285363060ca / advisory_e12ea79bdac8ed0ace7243e2(无项目目录时项目备注失去作用域):已验证无风险,三条是同一件事。
    1. 生产装配中 projectDirOf(session) = sessionDir(session?.header?.cwd, fallbackDir),fallbackDir 取配置的 projectDir,没有配置时取 resolveProjectDir()(DSH_PROJECT_DIR、CLAUDE_PROJECT_DIR 或进程 cwd 的 realpath),所以总会得到一个绝对目录。只有直接调用 evolverTools(proxyFetch)、不传选项的测试,才会走到返回 undefined 的默认值。
    2. 即使没有 project_dir,Proxy 存下的 Capsule 也没有 project_fingerprint。本地召回只在指纹匹配时才附带笔记(evolver-v2-private-dev#1397 的 projectMatch),插件也只在请求带了 projectDir 时才注入笔记,所以这类笔记不会出现在任何项目里。它们只留在本机,发布前会被剥掉。

🤖 Addressed by Claude Code

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.

1 participant