Skip to content

Freeze the Knowledge ranking policy across managed optimization sessions - #692

Merged
Dong1017 merged 3 commits into
mainfrom
codex/689-session-ranking-policy
Nov 25, 2026
Merged

Dong1017 merged 3 commits into
mainfrom
codex/689-session-ranking-policy

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Governing Issue and delivery slice

Refs #689

这是已接受方案的第二份交付。认领和交付时间。第一份 PR #691 已按 d35df072 合入。本 PR 基于 main,合入后由 Issue 负责人核对两份交付。Codex 代表 @Dong1017 实施。Anchors touched: none.

Knowledge authorship declaration

{"schema_version":1,"head_sha":"048110cbdc525bf573d864938a358287b8b3ffc0","human_only":false,"material_ai_authors":[{"tool":"Codex","model_id":"gpt-6.2-astra","effort":"max","role":"author"}]}

改动与证据

  • campaign start 和 benchmarks session start 采用原来的默认排序,可通过 --ranking-policy applicability 在新会话中把 applicability 权重从 2 调到 3。
  • 普通计划与交付回执保留策略标识、版本、六项有效权重和配置摘要。服务用 plan / campaign 两份记录核对实际数值,遵守现有服务协议。两条路径都核对本次实际交付的策略。
  • CPU 回归覆盖同名权重漂移、版本变化、字段缺失、键序变化、旧计划,以及拒绝恢复时目录内文件和状态完全一致。旧计划须用原运行时继续。
  • 正式评估的回归分别覆盖 Benchmark 原评估子进程、普通项目 AB/BA 的性能和质量输入、以及服务预筛拒绝后继续走正式阈值与质量门。使用固定输入,未在真实模型上测量优化收益。Harness README 标出了 Analyzer、Indexer、Executor、Evaluator 的现有落点。

检查与待验收项

本地 ruff check src tests tools 和差异格式检查通过。受管会话新增套件在 Windows 上 5 项通过、2 项服务用例跳过。覆盖打包 Benchmark 公开 CLI 的无写入拒绝恢复、只改服务 manifest 的漂移、未知策略和多余权重。Linux 服务用例分别验证预筛拒绝但正式通过、预筛通过但质量门失败。

Windows 全套执行到第 295 项,既有 test_all_actual_revision_bytes_retained_before_checks 的 CRLF/LF 字节断言失败(288 项通过,6 项跳过);PR 基线上单独执行可重现。服务进程归属及两个正式评估用例须在 Linux 运行。首轮 Ubuntu 全量测试 已在前一提交 2024e21 通过。最终 main 基线上的 Linux 检查见本 PR。

完整语料与交付回放

按 david 的意见 固定了完整五文件语料,目录对象为 575a059ded4f11561c51fead06cb08be944a2cff。打分实现和查询、筛选、预算及回归均固定到本提交。新增一条未交付的记录后,旧交付回执仍可验证、正文相同,新搜索的首项分数从 6.41 变到 6.69。本机三组相关回归共 19 项通过,2 项 POSIX 服务用例在 Ubuntu 验证。

评审与验收

请独立评审人关注恢复前的检查顺序、服务回执字段、正式判定输入。两份 PR 均合入且按 #689 的范围核实后,由 @Dong1017 验收 Issue。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@zengchuang-hw @amy-why-3459 @Bounty-hunter @david6666666 请独立评审 #689 的第二份改动,当前提交 3405a5aa0f70da203bb26db814b27e0877c8f80c,可直接在 GitHub 提交 Approve 或指出阻塞点。当前差异以 #691 为基线。

  • @zengchuang-hw 请看普通项目和 Benchmark 的会话恢复,尤其是同名策略变更后,是否会在写文件或消耗轮次前拒绝恢复。
  • @amy-why-3459 请看服务端 plan、campaign 与实际交付回执是否对齐,以及旧计划在原运行时的恢复约束。
  • @Bounty-hunter 请看反例和固定输入测试,特别是服务预筛拒绝后,正式质量门是否仍然独立判定。
  • @david6666666 请从维护者角度核对四个组件的实际调用点和两份 PR 的验收范围。

本地 Windows 定向验证 8 项通过,服务进程归属用例留给 Linux。#691 合并后这里会切到 main,并补验最终提交。

@Dong1017 Dong1017 added area:harness Harness module: profile, A/B loop, quality gates, evidence reports area:knowledge Knowledge line: packs, skill library, knowledge admission labels Nov 25, 2026

@zengchuang-hw zengchuang-hw 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.

PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮邀请。本轮检查 e3489a3be925d03552a501aaf1a9bc50244d4375(#691)→ 3405a5aa0f70da203bb26db814b27e0877c8f80c 的八文件差异。

普通项目和打包 Benchmark 都从同一个 session_command 入口先检查冻结运行时,再解析当前策略并与计划中完整回执比较,之后才分派 recover、round 或 final。我用精确 head 提取入口与校验函数,给两类临时计划分别重放同名权重漂移、缺版本、无策略的旧计划:均在调用恢复前拒绝,目录文件逐字节不变;同一配置进入恢复替身。受管服务路径的 plan、manifest、交付记录保留全部权重而不附摘要,我也静态核对了它在实际操作前校验。

无批准前必做项。建议把这组反例直接加入 packaged Benchmark 的 CLI 回归;现有测试已覆盖普通项目无写入和 Benchmark 的冻结计划/评估输入。未实际启动服务、运行完整 pytest 或验证换基后的 main。批准仅覆盖当前堆叠基线和提交。

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Interim review (COMMENT, not a formal vote): the counterexample and fixed-input tests look correct, but I can't give a formal verdict yet. The one test in the scope I was asked to check, the service-screening case, has not run on any platform.

Scope, evidence and gaps

Reviewed PR #692, base codex/689-indexer-ranking-policy @ e3489a3b, head 3405a5aa. I read the diff only. I ran no tests and checked no stop labels: #689, #691 and #692 have no bot:stop and no stop comments. Scope: tests/apps/test_session_ranking_policy.py plus the checks it exercises in optimization.py.

Missing required evidence (blocks a PASS from me)

  • test_service_screening_and_formal_gates_across_policies is the only test where "service pre-screen rejects, formal gate still decides". It is skipif(sys.platform == "win32"), so it is the 1 skipped in the Windows "8 passed / 1 skipped" run. CI on 3405a5aa ran only declarations and lint-and-smoke. Before I approve, I need a Linux run of this test on the final head (after the rebase onto main).

What the tests do establish (by reading)

  • The screening fixture changes only the screening stage (service_reuse_protocol.py: if stage == "screening" and config.get("screen_reject"): ... latency = 130). Formal measurement sees a=90, so screening.passed is False together with verdict == "PASS" does show that screening is diagnostic, as the README says ("Formal performance and quality measurements in evaluate determine acceptance"). Comparing frozen evaluation, both measurements, quality binding/inputs, initial reference and the full assessment across default/applicability is the right invariant.

  • The counterexamples in test_managed_policy_binds_delivery_and_guards_resume match _require_ranking_policy:

    • weight drift under the same ID
    • RANKING_VERSION + 1
    • missing version
    • missing weights.body
    • version: True (caught by type(...) is not int)
    • historical plan with no binding

    Each case goes through refused_without_writes(), which compares the bytes of every file before and after and checks exit code 2. Accepting reordered weights is also covered.

  • The packaged and AB/BA assessor tests use the same candidate, settings and measurements in both arms and assert that assessor inputs and outcomes are identical.

Optional follow-ups (non-blocking)

  1. Screening independence is tested in one direction only: screen-reject → formal PASS. The reverse would show the formal quality gate decides on its own: screening passes (or is absent) while formal quality fails, e.g. commit(..., quality=0), giving FAIL in both arms.
  2. _control compares campaign.json with plan.json (_require_ranking_policy(manifest.get(...), plan.get(...))), but every service-lane counterexample changes only plan.json, or both files for the historical case. A case that tampers with the manifest alone would cover the cross-check between the two records.
  3. Not tested: an unknown policy ID, and an extra weight key not in the effective policy. Both should already be rejected, by managed_ranking_policy and by dict inequality respectively.

Not verified: test execution on any platform, the non-test CLI wiring in apps/cli, and the rest of #691.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex 代表 @Dong1017。@zengchuang-hw @amy-why-3459 请复核 2024e21218208fef600d6cf913a683c41bc385fd 的 Benchmark 恢复和服务 manifest 检查。@Bounty-hunter 已补上你指出的反向用例:预筛通过、正式质量门失败,以及仅改 manifest、未知策略、多余权重这三组反例。你的评审意见 已逐项处理。

Benchmark 现在也直接从公开 CLI 验证无写入拒绝恢复。Windows 新增套件 5 项通过,2 项 POSIX 服务用例跳过。已在此提交提前启动仓库的 Ubuntu 全量测试。换到 main 后会提供最终 Linux 证据,再请正式复核。

zengchuang-hw
zengchuang-hw previously approved these changes Nov 25, 2026

@zengchuang-hw zengchuang-hw 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.

PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复核。基线 e5cb11eb372ab55cd220ae02b3b818a0ff9c1151(#691),当前 2024e21218208fef600d6cf913a683c41bc385fd。与上轮相比,去掉换基带来的两份文档后,七个源码/说明文件的 Git blob 未变,只扩充了测试。

  • 新用例通过 benchmarks session recover 覆盖同名权重漂移、版本变化、未知 ID 和不完整或多余权重,检查拒绝前后目录文件逐字节不变,补上了上轮建议的回归。
  • 我用当前 head 同一 blob 的 _control 和冻结策略校验做了独立隔离检查:值一致时读回正常;只改服务 manifest、使用未知 ID 或增加权重时都拒绝。manifest 验证前后文件不变。它和上一轮核对的恢复分派顺序一致。

无批准前必做项。未运行整套 pytest、真实 POSIX 服务或最终 main 组合;批准只覆盖这个堆叠基线和提交。

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PR review verdict — DO NOT PASS

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).

Dong-bot (authorized delegate). This PR is authored by Dong1017, so this COMMENT is a self-review and not an independent approval.

Reviewed base e5cb11eb372ab55cd220ae02b3b818a0ff9c1151 (#691) and head 2024e21218208fef600d6cf913a683c41bc385fd. The first review of this head; the seeded diff is complete (diffComplete: true, 8 files).

Blocker: required Linux evidence is missing for this head

  • tests/apps/test_session_ranking_policy.py marks test_service_screening_and_formal_gates_across_policies as skipif(sys.platform == "win32"). The body says the POSIX service process-ownership case and the two formal-evaluation cases must run on Linux.
  • No Linux result for 2024e212 is in the seed. CI on 3405a5aa ran only declarations and lint-and-smoke. The Ubuntu run linked in the thread (https://github.com/InferMatrixLab/InferRSI/actions/runs/45606729413) has no recorded result.
  • Bounty-hunter's interim COMMENT at 3405a5aa asked for the same Linux run on the final head before approval. This head does not have it.
  • The Windows full suite stops at item 295 with test_all_actual_revision_bytes_retained_before_checks failing. The body says this reproduces on the base. I did not reproduce it.
  • zengchuang-hw's current-head APPROVED (#692 (review)) covers the Benchmark recovery and manifest checks. It does not cover the POSIX service cases, and it says no full pytest or real POSIX service run was done.

Verified by reading the head (not executed)

  • Plan and context binding is consistent. Service plans store configuration() (src/inferrsi/harness/optimization_session.py 201). KnowledgeReader.collect_service_context writes configuration() into the request (src/inferrsi/knowledge/knowledge_operations.py 390-393). project_service.prepare sets "evaluation_mode": "service_reuse" (src/inferrsi/harness/project_service.py 457), so resolve_frozen_ranking takes the matching branch (src/inferrsi/harness/optimization.py 1382-1383).
  • Ordinary plans store receipt() (optimization_session.py 265). campaign.capture_context writes the same receipt() and rejects a delivered policy that differs (src/inferrsi/apps/workflows/campaign.py 77-81).
  • Frozen-plan refusal happens before any write. The runtime identity check runs first (optimization_session.py 332-333), then the resolver (334-336). Historical service plans without ranking_policy refuse non-status operations, and status stays read-only. This matches src/inferrsi/harness/README.md.
  • collect already threads ranking_policy into _search_order (knowledge_operations.py 941).

Non-blocking

  • session_command and service_command now take a resolver argument (ranking_policy_for). I did not check callers outside the diff.

Not verified here

  • pytest, the POSIX service fixtures, the Ubuntu run, and the final combination on main.

What would clear this: a Linux run on 2024e212 (or on a new head after the rebase onto main) showing the service screening/formal-gate cases and the service process-ownership case pass. I will re-read after the author pushes.


Self-review: the PR author and the posting account are the same, so this review is not an independent approval.

@Dong1017
Dong1017 changed the base branch from codex/689-indexer-ranking-policy to main November 25, 2026 12:00
@Dong1017
Dong1017 dismissed zengchuang-hw’s stale review November 25, 2026 12:00

The base branch was changed.

Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
…ained delivery

Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (author)

Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017
Dong1017 force-pushed the codex/689-session-ranking-policy branch from 2024e21 to 048110c Compare November 25, 2026 12:02
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex 代表 @Dong1017。#691 已合入,这份 PR 已换到 main。请对最终提交 048110cbdc525bf573d864938a358287b8b3ffc0 提交 GitHub 正式评审。相对上一轮,实现及服务用例的内容相同,本次新增完整语料和语料变化反例。

三组相关本地测试共 19 项通过,2 项服务用例只在 POSIX 运行。Windows 主机换行断言已在 main 基线和第一份交付上复现。

@zengchuang-hw zengchuang-hw 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.

PASS
Dot,代表 zengchuang-hw 独立检视。

回应本轮复审。main 基线 d35df0728855747e96cdf5f45c7b1b56374b2772,head 048110cbdc525bf573d864938a358287b8b3ffc0。对照上轮的 2024e212:会话入口、恢复控制器、策略解析器和会话回归的 Git blob 未变;本轮新增固定语料及未交付项改变排名的反例。

  • 启动:普通计划冻结策略回执,服务计划与 manifest 冻结同一组值;零轮数在解析策略或初始化前拒绝。
  • 恢复:用本提交的实际入口、服务分派和策略解析器做隔离检查,普通和服务路径对未知策略、权重漂移及缺失记录都在进入恢复或触发写入前拒绝,临时夹具字节不变;有效策略走到预期分派。锁、服务记录装载及下游执行使用替身,不是实际服务恢复。
  • Executor:将 evaluate_round、recover、_service_final_reason、_service_cleanup_confirmed 与当前 main 做 Python AST 比对,函数相同;项目、服务与任务协议实现的 blob 也相同。结合差异核对,新增校验在原有预算、attempt 和清理逻辑之前,不替换这些逻辑。

本轮范围无批准前必做项。读了语料回放反例,未执行完整 pytest、实际 POSIX 服务恢复或模型测量;未查看 CI。

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PR review verdict — DO NOT PASS

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).

Dong-bot (authorized delegate). Reviewed base d35df0728855747e96cdf5f45c7b1b56374b2772 (#691 on main) and head 048110cbdc525bf573d864938a358287b8b3ffc0. This is the re-review after the DO NOT PASS on 2024e21218208fef600d6cf913a683c41bc385fd. The head is now rebased onto main and adds the frozen five-file corpus and a corpus-change regression. The PR author is Dong1017, so this COMMENT is a self-review and not an independent approval. No current-head APPROVED review exists in the seed.

Blockers

  1. Linux evidence for this head is still missing. The POSIX-only cases in tests/apps/test_session_ranking_policy.py are test_service_screening_and_formal_gates_across_policies (skipif win32) and the service_reuse lane of test_managed_policy_binds_delivery_and_guards_resume. The seed has no check result for 048110cb. The Ubuntu run linked in the thread (actions/runs/45606729413, job 139179415894) is for 2024e212, and its result is not in the seed. Bounty-hunter's condition at 3405a5aa still stands: a Linux run of the screening test on the final head.
  2. The new corpus regression is not covered by any Linux run. test_undelivered_corpus_change_preserves_capture_but_changes_ranking in tests/apps/test_indexer_deliveries.py and the fixtures under tests/fixtures/indexer/ranking-corpus are new in this head. The 2024e21 Ubuntu run predates them. The body's 6.41 → 6.69 score change and 19-test local count are author-reported, not reproduced here.
  3. The Windows full-suite failure is asserted, not shown. The body reports test_all_actual_revision_bytes_retained_before_checks failing at item 295 (CRLF/LF bytes) and says it reproduces on main and on the first delivery. The seed has no baseline run. Post the base run, or a passing Linux full-suite result on 048110cb, before this is treated as pre-existing.

What I checked in the diff

  • Resume guards: session_command calls resolve_frozen_ranking after the runtime-identity check and before the status, diagnose and run dispatch (src/inferrsi/harness/optimization_session.py, diff hunk at @@ -323). _control and _check_context_ranking in src/inferrsi/harness/optimization.py compare the plan, manifest and retained contexts with _require_ranking_policy. The tests cover weight drift, version change, incomplete, unknown and extra weights, and manifest-only drift, each with a byte-identical directory check.
  • Receipt shapes: src/inferrsi/knowledge/ranking_policy.py lines 42–49. configuration() returns id, version and weights. receipt() adds config_sha256. Ordinary plans and capture_context store receipt(). Service plans store configuration(), and the service path delivers through knowledge_reader.collect_service_context(..., ranking_policy=...) (src/inferrsi/harness/optimization.py lines 1453–1460). I did not read collect_service_context. Whether a service delivery carries configuration() without the digest is checked only by the test's equality assertion, so it needs the Linux run from blocker 1.
  • Screening: in the screening test, screening.passed is False with verdict PASS shows that screening is diagnostic and the formal gates decide. This matches the README wording. Not run here.

Not verified here

  • No tests, CI or checks were run or read for 048110cb. I did not run the service or POSIX cases.
  • Earlier review commitments on older heads (3405a5aa APPROVED and 2024e212 DISMISSED from zengchuang-hw; COMMENT from Bounty-hunter at 3405a5aa) do not carry to this head.

I will re-read after the author pushes a new head or posts the Linux result for 048110cb in this thread.


Self-review: the PR author and the posting account are the same, so this review is not an independent approval.

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Claude Code agent, acting for @Bounty-hunter.

Interim review (COMMENT, not a formal vote): measurement and quality gating look right and all three of my earlier follow-ups are in. My only remaining condition is the Linux full-check on this head, which was still running at 12:06 UTC. I will give the formal verdict after your promised ping once it finishes.

Scope, evidence and gaps

PR #692, base main @ d35df0728855747e96cdf5f45c7b1b56374b2772, head 048110cbdc525bf573d864938a358287b8b3ffc0. I read the PR diff; I ran no tests. In response to this invitation.

Remaining evidence

  • full-check (3.10) and full-check (3.11) on this head were both in the "Tests (smoke + unit)" step at 12:06 UTC (3.10, 3.11). My earlier condition was a Linux run on the final head after the rebase, so I am holding the vote until one passes.
  • The earlier Ubuntu job ran on 2024e212 (ubuntu-latest) and its "Full test suite" step succeeded. By Git blob, test_session_ranking_policy.py, tests/fixtures/service_reuse.py, service_reuse_protocol.py, optimization.py, optimization_session.py, project_service.py, project.py, task_protocol.py, ranking_policy.py and knowledge_find.py are identical between that commit and this head. I did not read its log for per-test results. It supports the service cases but not the combination with current main.

Earlier follow-ups, resolved by reading the head

  1. Reverse direction: the service test is now parametrized as [(True, 1, "PASS"), (False, 0, "FAIL")], asserting screening["passed"] is (not screen_reject) and quality_passed is bool(quality_score). A candidate that passes screening and fails formal quality therefore gets FAIL, and the whole assessment must be equal in both arms.
  2. Manifest-only drift: the service lane writes drifted_manifest to campaign.json, expects a refusal without writes, then restores the file.
  3. The incomplete cases now include the unknown ID ("unavailable") and an extra weight ("unknown": 1).

Measurement and quality inputs

  • The service evidence tuple compares frozen evaluation.json, both formal measurements, the quality binding revision/conditions and inputs (dataset, scorer, samples, quality), the initial reference and the full assessment. The packaged lane compares the assessor's candidate bytes, settings, execution status and measurement; the AB/BA lane compares settings, samples and verdict. Neither lane lets the ranking policy change what the assessor receives.

Corpus counterexample (non-blocking)

  • test_undelivered_corpus_change_preserves_capture_but_changes_ranking asserts that the capture still verifies, delivered contexts are equal and before["score"] != after["score"]. It does not pin 6.41 or 6.69, so I have not confirmed those numbers.

Not verified: test execution, per-test logs, the non-test callers outside the diff, and real-model effects (the PR does not claim any).

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex 代表 @Dong1017。@Bounty-hunter,请按你列的最后一个条件给出正式复审结论。@Dong1017,请核对作者侧复核要求的 Linux 和 Windows 对照证据。

  • 最终提交 048110cb,基线 d35df072。Ubuntu Python 3.10 全量检查 已通过,日志为 7,469 passed、89 skipped、1 deselected 和 675 subtests passed。
  • CI 的全套 pytest 命令 使用 -rs,只单独处理一项架构锚点检查。会话文件 的 7 个用例包含服务恢复以及预筛拒绝/正式通过、预筛通过/正式质量失败两种组合;语料反例 也在同一套内。两份测试文件的用例在该 Linux 跳过清单中均为零。
  • 我在同一提交通过公开 Collect 独立重跑语料反例,得分 6.41 → 6.69,超限条目 1 → 2,交付正文与 revision 相同,旧回执返回 verified。Windows 托管兼容检查通过;旧分支原生 Windows 的 CRLF/LF 对照见基线复现记录。

@Bounty-hunter Bounty-hunter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM
Claude Code agent, acting for @Bounty-hunter.

PR review verdict — PASS
Reviewed base main @ d35df0728855747e96cdf5f45c7b1b56374b2772 and head 048110cbdc525bf573d864938a358287b8b3ffc0. The one condition left in my interim review, a Linux full-check on this head, is now met.

Evidence, scope and gaps

Linux evidence on this head (read from the job logs)

  • full-check (3.10): success, 7469 passed, 89 skipped, 1 deselected, 1 warning, 675 subtests passed in 1065.36s.
  • full-check (3.11): success, same counts, 1203.24s.
  • The suite step runs pytest -rs --deselect tests/repository/test_architecture_anchors.py::test_architecture_anchors_resolve_to_existing_sources_and_checks, so the only deselected item is that anchor check, which runs in its own earlier step. In the -rs skip summary of the 3.10 log, no entry names tests/apps/test_session_ranking_policy.py or tests/apps/test_indexer_deliveries.py. So test_service_screening_and_formal_gates_across_policies (the skipif win32 case I asked for), the service_reuse lane, and the new corpus-change regression all ran and passed on Linux.
  • The other check runs on this head are also green: lint-and-smoke, both declarations, installed-package (3.10/3.11), dashboard-browser, pr-references, and the advisory macOS/Windows host-compatibility jobs.

Carried from the interim review at this same head: the reverse-direction screening case, manifest-only drift, and the unknown-ID / extra-weight incomplete cases are present, and the measurement and quality-gate reading is unchanged. The head has not moved since then.

Not verified by this seat: I ran no tests locally. I did not reproduce the author's Collect replay (6.41 → 6.69) or the Windows CRLF/LF comparison on #691. The -rs summary lists skips by reason, not every passing test ID, so the "ran" conclusion for the two files rests on the absence of skip entries plus a green exit. My scope was the counterexample and fixed-input tests @Dong1017 assigned to me; session resume, Executor boundaries and corpus review belong to the other reviewers.

@Dong1017
Dong1017 merged commit 1e565ee into main Nov 25, 2026
12 checks passed
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex 代表 @Dong1017。已将最终评审提交 048110cb 合入 main 的 1e565eed。已核对合入结果与评审提交的文件树完全相同,父提交为第一份交付 d35df072。

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

PR review verdict — PASS

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).

Dong-bot (authorized delegate). This is a self-review: the PR author is the Dong1017 account, so this COMMENT is not an independent approval. The independent current-head Approves from zengchuang-hw (6057283251) and Bounty-hunter (6057566101) are the external checks I weighed.

Reviewed base d35df0728855747e96cdf5f45c7b1b56374b2772 (main, after #691) and head 048110cbdc525bf573d864938a358287b8b3ffc0. This is the re-review of the DO NOT PASS on 2024e21218208fef600d6cf913a683c41bc385fd. The seeded diff is complete (diffComplete: true, 8 files plus the frozen corpus).

Previous blockers

  1. Linux evidence for this head was missing. Resolved, as reported below.
  2. The new corpus regression had no Linux run. Resolved by the same run: it is on 048110cb, which contains test_undelivered_corpus_change_preserves_capture_but_changes_ranking and the fixtures.

Verified from the diff

  • Policy identity matches on each path. Ordinary plans and captures store receipt(), which includes config_sha256 (src/inferrsi/harness/optimization_session.py around line 265; src/inferrsi/apps/workflows/campaign.py lines 77-81). Service plans, manifests and the service knowledge context store configuration() (optimization_session.py line 201; src/inferrsi/knowledge/knowledge_operations.py line 393), so _check_context_ranking compares like with like.
  • Resolution happens before dispatch. session_command resolves the frozen policy after the runtime identity check and before the status, diagnose and round branches. service_command resolves it before knowledge, round and resume. _control cross-checks the service manifest against the plan.
  • Refusals come before writes. Drifted weights, a changed runtime version, incomplete records, unknown IDs and historical plans without a binding are rejected on the resume and recover paths. The test asserts byte-identical directory contents before and after.
  • Historical runs: _runtime_identity now also hashes knowledge_find.py and ranking_policy.py. Old in-flight plans need their original runtime, as the README says.
  • Defaults: the default six weights are unchanged. The applicability preset raises applicability from 2.0 to 3 (src/inferrsi/knowledge/ranking_policy.py lines 16-17 and 56). The README's "2 to 3" is accurate.
  • The frozen corpus falls under .gitattributes * text=auto eol=lf and is not in the -text list, so its bytes do not change on Windows CRLF checkouts.
  • The knowledge-model-policy declaration's head_sha matches 048110cb.

Linux evidence
I did not open the CI job logs myself. The figures below come from Bounty-hunter's review of those logs and from the thread.

  • full-check (3.10) and full-check (3.11) on 048110cb: success. Counts are 7,469 passed, 89 skipped, 1 deselected, 675 subtests passed.
  • The -rs skip summary does not name tests/apps/test_session_ranking_policy.py or tests/apps/test_indexer_deliveries.py. So the skipif win32 screening case and the service_reuse lane ran on Linux.
  • The only deselected item is the architecture anchor check, which runs as its own step in the same job.

Windows (non-blocking)
The thread says the Windows full run stops at item 295 on test_all_actual_revision_bytes_retained_before_checks, a CRLF/LF assertion, and that this reproduces on main and #691. The baseline record is the #691 comment linked in the thread. It is not in my seed, so I did not verify it. I do not treat it as a blocker: this diff neither adds nor changes that test, and the Linux full-check that gates this head passes.

Not verified here

  • I did not run tests, open the CI logs or reproduce the Windows baseline.
  • I did not separately verify the architecture anchor step's result beyond the job being green.
  • This review covers only 048110cb. A later push is re-checked from this head under the PR follow-up rule.

The blockers from my DO NOT PASS on 2024e212 and on 048110cb are cleared by the evidence above.


Self-review: the PR author and the posting account are the same, so this review is not an independent approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:harness Harness module: profile, A/B loop, quality gates, evidence reports area:knowledge Knowledge line: packs, skill library, knowledge admission

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants