Skip to content

feat: 加固 CodeGraph 查询新鲜度与过期标识 - #5

Merged
FaithZL merged 13 commits into
devfrom
codex/codegraph-freshness-hardening
Aug 19, 2026
Merged

FaithZL merged 13 commits into
devfrom
codex/codegraph-freshness-hardening

Conversation

@FaithZL

@FaithZL FaithZL commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

变更内容

  • 将 CodeGraph 查询收敛为一个有界窗口:查询前状态、pending 时至多一次增量 codegraph sync、一次 explore、查询后复查。
  • 移除公共 MCP 与 Agent 表面的 sync_if_needed,调用方不能绕过自动刷新策略。
  • 支持当前 CodeGraph freshness framing,并避免源码或普通文本中的 warning 词造成误判。
  • 明确交付 CURRENT_AT_CHECK、STALE、UNKNOWN、UNAVAILABLE;STALE / UNKNOWN 仅用于导航,实际结论必须由当前源码或 Git 校验。
  • 在查询窗口任一阶段发现仓库、worktree 或响应身份不匹配时阻断或撤销图内容交付。
  • runtime evidence 升级为 bundle v2,耐久 Code Intelligence record 保持 v3;历史 bundle/record 继续可读且不重写。
  • Polaris 协议升级到 0.1.22,Workflow 保持 0.1.3,新增显式 0.1.21 → 0.1.22 相邻迁移。
  • 更新 Skills、模板、README、中文 README、使用文档与产品计划中的统一行为说明。

原因

Polaris 需要尽可能使用新鲜的 CodeGraph 数据;当数据已知过期或无法验证时,仍可把安全图数据用于导航,但必须明确标识并以源码/Git 作为实际结论的权威来源。全量 codegraph index 仍只由用户主动触发。

影响与边界

  • 不修改 CodeGraph 仓库。
  • 不新增第三方运行时依赖。
  • 不增加 daemon、scheduler、database 或新的 Workflow 状态。
  • Validation 保持完全不调用 CodeGraph。
  • CodeGraph 缺失或禁用时,Polaris 继续使用源码/Git fallback。

验证

  • python3 tests/run_tests.py:228/228 通过,0 失败,0 错误,0 跳过。
  • python3 -m compileall -q polaris_cli.py scripts tests:通过。
  • python3 scripts/materialize_task_layout.py:无未解释漂移。
  • git diff --check:通过。
  • 禁用项扫描:Agent/公共表面无 sync_if_needed;codegraph index 仅出现在禁止/用户所有权文档中,无可执行路径。
  • Polaris 与 CodeGraph 两个仓库状态均洁净。
  • 最终整分支审查结论:Ready to merge。

@FaithZL
FaithZL marked this pull request as ready for review August 19, 2026 11:47
@FaithZL
FaithZL merged commit 655449d into dev Aug 19, 2026
3 checks passed
@FaithZL
FaithZL deleted the codex/codegraph-freshness-hardening branch August 19, 2026 14:03
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