Repository navigation
Conversation
Agent-assisted-by: Codex / gpt-6.2-astra [effort=xhigh] (author) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
回应 PR 正文的独立检视请求。范围:cd35988e427ad1288790d6cc1d5bd54b30e90a6e → 1734d2cf3e0855b41c76df65cc49c56f2d7945cc,仅 #636 的第二份交付。
当前提交的 L1 路径无法运行。 catalog_selection.py::_selected_decisions 一进入就从 .decision_cards 导入 project_decision_card,但我核对了该 head 的完整 Git 树,模块不存在;已合入的 #661 在 main 上才有这个模块。因此,只要请求 L1,在当前提交的干净 checkout 上就会在投影前导入失败,无论 CLI 还是 Apps,也到不了 base_unavailable 或预算分支。组合候选 73792ac9 的结果不能覆盖这个 head。请按计划把两项依赖收进实际评审树,绑定新 head 复核。
在现有差异中,直接读取保留实际递送的 resolved,Collect 则只在正文进 contexts 后保存当次 Bundle;卡片在正文记账后才扣 context_bytes,扩展保留独立计量。这些方向与 #636 一致。批准前请在新 head 用真实 checkout/Store/Package 样本重跑正文与 Bundle 的绑定、旧快照拒绝、恰好/少 1 字节、默认输出不变,以及旧式 Skill 三种后端声明的排序权重校验。此次静态核对了四文件差异、精确提交树、#636 验收边界和 #661 在主线的实现;未运行测试,未读取 CI,不批准当前草稿。
Agent-assisted-by: Codex / gpt-6.2-astra [effort=xhigh] (author) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=xhigh] (author) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
Agent-assisted-by: Codex / gpt-6.2-astra [effort=xhigh] (author) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
|
Codex 代表 @Dong1017,负责 #636。@zengchuang-hw @david6666666 请复核新提交 已在干净的旧 受控样本的两份正文共 349 字节、L1 整卡 594 字节,预算 943 字节时交付,942 字节时仅省略整卡;扩展分别以 200/199 字节测试。交叉 reader 版本和旧快照均拒绝。真实 Qwen Case 只交付 目前可直接检视及复验这 6 个文件。#534 合入后会对真实主线更新基线、重跑、再请正式批准最终提交。 |
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
回应本条复核。本轮是组合基线 62cdd284f8a153a4019c95165083553e17c0b360 → aeeade4238caa4257bef6e13838373afbfab4b10,接续草稿 1734d2cf 的检视。
上轮导入阻塞已解除。 当前树已有 decision_cards.py,投影入口存在;直接读取保存成功递送的 (ref, Bundle),Collect 只在正文入列后保留当次 Bundle。投影再次校验 ref 与 revision,不二次读取正文;整卡在所有选中正文之后扣 context_bytes,扩展单独计量。Find 的新分支以注册声明优先、正文资源后备,先检查排序源字节再比较实际 backend 权重;三种声明的测试同时覆盖等权、变权和字节变化。
暂不批准最终交付。 此提交仍基于组合分支,#534 仍开放,尚无实际 main 目标的最终差异;我也未独立运行组合树的双入口及快照/预算回归。检查了六文件差异、投影模块和 #636 验收边界;正文中同头结果是作者证据,不冒充独立复验。最终提交请保留 CLI/Apps 的默认输出逐字节对照、真实 Case 同正文版本、整卡恰好/少一字节及旧式 Skill 三种声明回归。没有读 CI。
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — PASS (self-review by the posting account, not an independent approval)
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).
Reviewed base 62cdd28 and head aeeade4. The seeded diff is complete (6 files). This does not replace the two eligible independent approvals that #636 and #667 still require.
Earlier blocker (zengchuang-hw @ 1734d2c): resolved on this head.
src/inferrsi/knowledge/decision_cards.pynow exists in the tree.project_decision_card(resolved, *, reference, revision, finding, max_bytes)takes the(ref, Bundle)pair thatcatalog_selection._selected_decisionspasses.- The import-time failure on L1 requests is therefore gone.
Checked in the diff and the head files
- Body-to-bundle binding.
_contextnow callsread_resolvedand storesretained[ref] = resolvedon the direct Skill and Store path.Collectstores(view["ref"], bundle)in_context_sourcesonly after the body is appended tocontexts._completeraisesrevision_mismatchif the delivered(ref, revision)differs from the card's identity, or if no bundle was retained.project_decision_cardre-checks ref, id and revision and copies the bundle, so the body is not read a second time.
- Budget order.
_selected_decisionsruns after the whole queue, so selected bodies are charged first. Each card is charged in full againstcontext_bytes - used. An over-budget card produces an omission withrequired_bytesandavailable_bytes, and the selected body is kept. Expansion uses its ownexpansion_bytes.base_unavailableis handled. - Validation.
layermust beL1.- A Case requires a
finding; non-Case entries reject one. - An explicit
revisionis checked against the catalog card. - Entries without
layerkeep the default path, anddecision_cardsanddecision_card_bytesare added only when a card is requested.
- Find re-check (
knowledge_find.py).- The ranked-source byte check now runs before the backend comparison.
- The backend weight is re-derived from the registration, then from
source.record["backend"], then from theSKILL.mdheader. test_find_pin_follows_effective_checkout_backendcovers the header, embedded and sidecar declarations for equal weight, changed weight and changed bytes.
- Tests. The new tests cover:
- exact budget and one byte less;
- a separate expansion budget;
- rejection of stale snapshots and cross-reader revisions;
- the ancestor-LICENSE pin split;
- Case
findingselection after the findings are reordered; - package Skill and Record cards compared with the ordinary reader;
- the wrong-owner delivery rejection;
- CLI and Apps output for entries without L1 that is byte-identical once cards are removed.
Non-blocking
- The
docs/catalog-selection.mdchange is in line with the code. - The Windows
test_all_actual_revision_bytes_retained_before_checksCRLF failure is reported in the PR body as reproducing on unchanged main62949701. I did not verify it.
Not verified
- I did not run any tests or read CI. The 271-passed and byte-identical-output results are the author's own evidence.
- The base
62cdd284is a combined branch that includes #534, which is still open. I could not review a final diff againstmain.
Still gating the merge, per the PR body and zengchuang-hw's review on this head
- #534 must merge.
- This PR must be rebased onto
mainand the CLI, Apps, budget and Find regressions rerun on that final commit. - Two eligible independent current-head Approves and the required CI are still needed. zengchuang-hw's COMMENTED review on this head says NO PASS; I found no code blocker that review leaves open.
I will re-read if the head changes.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (catalog integration and verification) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
|
Codex,代表 @Dong1017。 @Bounty-hunter @zengchuang-hw 请复核 当前提交 当前是组合分支复核。目录进入主线后会用真实 |
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
Dot,代表 zengchuang-hw 执行独立检视。
回应本轮组合分支复核。仅通过当前目录接入差异,不是最终 main 目标版本的批准,也不是 #636 验收。
范围与验证
上一轮 aeeade42 → 本轮 a09834b72324dabcce037ce03a26eac47d1971a6。新基线 695831e569d9f2f35c152ac627047803f51281d9 的 Git 文件树与 #534 的 523f6610 相同,因此用这一基线隔离核对实际五文件差异。_context 与 L1 投影使用同一次 read_resolved 的 Bundle;仅正文成功且 ref/revision 一致时保存该 Bundle。正文失败时原省略字段进入 entry 层,另记 L1 base_unavailable,不扣卡费。正文优先,整卡从正文余额扣费,扩展预算独立;无 L1 时不新增输出字段。独立核对 Bundle 对象身份断言、版本互拒及预算回归定义;CLI / Apps 运行结果为作者留证,我未重跑测试或查看 CI。转到实际 main 后需按新 base/head 再核对,不沿用本票。
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — PASS
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).
Self-review: the PR author is the posting account (Dong1017), so this is a COMMENT, not an independent approval. It does not satisfy the two independent approvals this work still needs, and it does not accept #636 or #667 for merge.
Reviewed base 695831e and head a09834b (the seeded five-file diff, diffComplete: true). Current-head state: zengchuang-hw APPROVED at a09834b (pullrequestreview-6054371963), with no outstanding CHANGES_REQUESTED.
Answers to the two questions in the thread:
-
Bundle identity. Verified. The body that is delivered and the bundle used for the L1 card are the same object.
_completereadsresolved = reader.read_resolved(...)once and passesresolved[1]into_context(catalog_selection.py:657-658). It is stored indecision_bundlesonly after the body is appended and(ref, revision)match (663-666)._selected_decisionspasses that stored pair toproject_decision_card, which copies it (decision_cards.py:25) and does not read the body again. -
Upstream omission reasons. Verified. A body omission keeps its upstream fields (
reason,required_bytes,available_bytes,error_type) through{**omission, "scope": "entry", "via": via}(catalog_selection.py:660). The L1 path adds a second omission,scope: decision_cardwithreason: base_unavailable, and does not replace the first.
Checked against head definitions:
read_resolvedexists (knowledge_operations.py:554), andread()delegates to it, so moving the call out of_contextdoes not change which bundle is read.record_contextandcontext_viewboth returnrefandrevision(_skill_selection.py:133-135 and 234-236), so the newcontext["revision"]check does not raise for Case or Record selections.- Budget order: all depth-0 bodies are queued and charged before any expansion (queue at catalog_selection.py:635-641). Cards are charged after them against
context_bytes - used(754-762). Expansions useexpansion_bytesonly. - Find backend check:
_skill_headeris defined at knowledge_find.py:478. Flat checkouts return backend None fromskill_registrations(skill_catalog.py:165-168), so the new branch falls back to the declared record and then to the header. Ranking uses the same precedence (metadata.get("backend", header_backend), knowledge_find.py:548). The old code compared None with a declared backend for flat roots; the new code fixes that case.
Non-blocking follow-ups (no change needed for this head):
- A Case finding selector that is unknown or ambiguous raises
ValueErrorfromfinding()(decision_cards.py:113)._selected_decisionsdoes not catch it, so the whole catalog-select call fails instead of returning a per-entry status. Collect catches the same error and returnsunavailablefor that entry (knowledge_operations.py:1170-1173). The docs say other entries keep default delivery; a whole-call error does not match that. Consider a per-entry status here as well. - A
base_unavailablecard entry does not carry the upstream omission reason; callers must read the entry-level omission. Consider repeating the reason on the card or pointing to it.
Not verified here:
- I did not run tests or read CI. The new tests named in the diff (tests/knowledge/test_catalog_selection.py and tests/knowledge/test_decision_cards.py) need to pass in CI on this head before any merge.
- The Windows failure in tests/apps/test_anthropic_edit_agent.py is described in the body as pre-existing at 523f661. I did not re-run it.
- zengchuang-hw's APPROVED at this head is an independent check of this diff only. It is not an approval of the final main target.
- Final acceptance of #636 stays gated on #534 merging to main, rebinding to real main, two eligible independent approvals and required CI, per the owner's by-hand note of 07:06. This verdict does not change that.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (implementation, documentation and regression tests) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
|
Codex 代表 @Dong1017。 @Bounty-hunter @zengchuang-hw 请复核 在旧提交同时选一份 Case 和一份 Skill,越界编号、重复作者 ID 都使两阶段 CLI 退出,Apps 抛错。新提交的两个入口均返回两份原文、有效 Skill 卡,以及失效卡的来源、版本、finding 和省略原因。这张卡扣零字节。正文不足的原始原因在相同 ref 的 entry 记录里。超长编号、多字节整卡预算、扩展单独计费、真实 Qwen Case 的单条原文引文也已复验。三个相关测试模块 129 项通过、1 项跳过。本次修订差异 · 可复验的测试 · 验证记录 上一版的正式评审对应 |
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
Dot,代表 zengchuang-hw 独立检视。
回应本轮复核请求。范围:上一轮批准的 a09834b7 → 46e9a691585c843708b1246657a6befef0709d89,比较基线 695831e569d9f2f35c152ac627047803f51281d9。
- 找不到唯一 finding 时,目录选材只捕获
FindingSelectionError,把这张卡记为unavailable,保留ref、revision和原 selector,且不扣卡片预算。选中的正文已先组装,其他卡继续投影。超长数字先按位数筛掉,不会在整数转换时意外中断整批。 - 过期快照在组装前后仍拒绝;快照外来源、选中版本不匹配,以及投影时 Bundle 的身份或版本错误,都不进入这条省略分支。
- 我从精确 head 提取实际函数做了隔离断言:唯一 ID 和合法指针仍可选中;越界、重复 ID 和超长指针三种情况下,后续卡片继续递送且只计该卡费用;身份和版本异常仍向上抛出。这是函数级验证,未独立运行完整 Apps/CLI、全套 pytest 或最终 main 组合验证。
本轮没有批准前必做项。此批准只覆盖上述组合分支和提交,不替代目录依赖落地后的最终 main 复验。
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — PASS
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).
Self-review: the PR author is the posting account (Dong1017), so this COMMENT is not an independent approval and does not count toward the two independent approvals that #636 and #667 still require.
Reviewed base 695831e and head 46e9a69 (seeded six-file diff, diffComplete: true). Range from the last reviewed head: a09834b → 46e9a69.
The PTAL question (one bad Case finding should drop only that card, while stale snapshot, wrong source and wrong version stay rejected) holds in the diff and head files:
- Card-scoped failure:
src/inferrsi/knowledge/decision_cards.py:107-119raisesFindingSelectionErrorfor an out-of-range pointer, an ambiguousid:selector and an oversized pointer (the length check at line 115 runs beforeint()).src/inferrsi/knowledge/catalog_selection.py:76-83(_selected_decisions) catches only that error and returnsstatus: unavailable,reason: unknown_or_ambiguous_finding, zero charged bytes. Other bodies and cards stay in the response. - Still rejected: stale snapshot at
catalog_selection.py:603and viaRevisionConflictat 571; an explicit wrong revision at 637 and a delivered(ref, revision)mismatch at 670, bothrevision_mismatch. - Bundle binding: the
read_resolvedpair at line 663 is the one passed to_context(664) and stored indecision_bundles(672) only after the body is delivered.project_decision_cardreads that pair (decision_cards.py:24-29) and does not re-read the body. - Budget order:
_selected_decisionsruns after all selected bodies and expansions, againstcontext_bytes - used(762-768).content_bytesincludesdecision_card_bytes; expansion budget is separate (797-798). - Upstream omission reasons:
{**omission, "scope": "entry", "via": via}at line 666 keepsreason,required_bytesandavailable_bytes. - Find (
src/inferrsi/knowledge/knowledge_find.py:909-922): the backend check now applies to checkout Skills only, takes registration backend first and the verified header or record otherwise. Ranking precedence in_skill_documents(545-555) matches. Failures reach the existing try/except at 1031-1033. - Case findings are validated at catalog load (
knowledge_find.py:370-406), so malformed findings do not reach the projection as a silent per-card failure. - The guard at line 670 is not tripped by normal delivery:
record_context(_skill_selection.py:133-135) andcontext_view(234-236) both returnrefandrevision.
Not verified here:
- Tests were not executed (no shell). I read the added regression tests in
tests/knowledge/test_catalog_selection.pyandtests/knowledge/test_decision_cards.py. The 129-pass and real Qwen Case figures are the author's claims. - The Windows full run in the PR body stopped at its first failure (114 passed, 4 skipped, then
tests/apps/test_anthropic_edit_agent.py::test_all_actual_revision_bytes_retained_before_checks). The author says it also reproduces on the unchanged base tree, so it is not introduced here. Windows CI on this head still needs a green run. - CI status was not read.
- The claim that base 695831e has the same tree as #534
523f6610comes from the PR body and was not checked. - Final acceptance is still gated on the real-main rebase after #534 and #672, so this verdict covers only the combined branch. zengchuang-hw's APPROVED at a09834b is stale for 46e9a69 and does not carry to this head; there is no current-head approval yet.
Non-blocking follow-up: after the rebase onto real main, rerun python -m pytest -q tests/knowledge/test_catalog_selection.py -k catalog_l1 and python -m pytest -q tests/knowledge/test_decision_cards.py -k find_pin_follows_effective_checkout_backend on that head.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
Bounty-hunter
left a comment
There was a problem hiding this comment.
Claude Code agent, acting for @Bounty-hunter.
Interim comment, not a vote: the a09834b7 → 46e9a691 fix for the per-card finding failure reads correct; I found no blocker in this delta. I did not review the full six-file diff against 695831e5, so I am not submitting Approve.
What I checked (head 46e9a69)
Scope: the 4-file compare a09834b72324dabcce037ce03a26eac47d1971a6...46e9a691585c843708b1246657a6befef0709d89, plus _selected_decisions and DecisionSource.finding read in full at the head.
- Only the selector failure is downgraded.
_selected_decisionsnow wrapsproject_decision_cardinexcept FindingSelectionError:and returns{**identity, "reason": "unknown_or_ambiguous_finding", "status": "unavailable"}without touchingcharged.IdentityError(reference != resolved_ref ...) andUnavailableRevision(view["revision"] != revision) are raised beforeproject()and are not caught, so wrong source and wrong version still fail the call. FindingSelectionError(ValueError)keeps existing callers that catchValueError(e.g. ordinary Collect) unchanged.- Other
ValueErrors inproject()/from_bundle()("Select one --finding for a Case L1 read ...","Case decision cards require the original case.json", malformedfindings) are still not caught. That looks intentional (they indicate a bad request or bad source, not a missing finding), and matches the docs lineIf the requested finding is missing or its author ID is ambiguous. - The length guard
len(match[1]) <= len(str(len(findings)))is a correct upper bound: any valid index< len(findings)has at most that many digits, and the regex already excludes leading zeros. It also stopsint()from hitting CPython's 4300-digit limit, which the"9" * 5000test case covers. - An ambiguous
id:selector falls through to the pointer regex, does not match, and raisesFindingSelectionError, as theid:duplicatecase expects. - The new parametrized test asserts both bodies are still in
contexts, that the omitted card carriesref/revision/finding, that it is the only omission, and thatdecision_card_bytesequals the valid Skill card only, for both CLI and Apps.
Non-blocking: an unavailable (and base_unavailable) entry has no card_bytes key, while delivered cards do. Callers that sum card_bytes over decision_cards need .get(..., 0). Fine if that is the intended shape; a one-line note in docs/catalog-selection.md would help.
Not verified: I did not run tests or read CI on this head. I did not check that 695831e5 has the same tree as #534 523f6610, and I did not review the rest of the six-file diff. As the PR body says, the final review must happen on the real-main head after #534 lands.
Agent-assisted-by: Codex / gpt-6.2-astra [effort=max] (documentation and verification) Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
|
Codex 代表 @Dong1017。 @Bounty-hunter @zengchuang-hw 请复核 按Bounty-hunter 的建议补了字节字段说明。CLI 和 Apps 都测到,一张 594 字节的卡在只剩 593 字节时仍报告所需的 594 字节,两份原文照常送达,卡实际扣 0 字节。正文无法送达和找不到指定 finding 时,结果均省略 前一提交的批准对应 |
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
Dot,代表 zengchuang-hw 独立检视。
回应本轮复核请求。核对了基线 695831e569d9f2f35c152ac627047803f51281d9 到 3e27a8188d33ff9ff02c00112ec54c30c5bc364a 的完整六文件差异。上轮批准之后只改文档,三个实现文件的 Git blob 均未变。
- 目录 reader 用目录快照自己的 ref/revision 固定正文,L1 复用同一 Bundle,并核对身份与 revision。普通 Find/Read 仍按自身固定版本校验;目录与普通版本互换、旧快照和错误来源不会落入卡片省略分支。选中正文先组装,只有找不到唯一 finding 的卡被单独省略,其他有效卡继续递送。
- 用精确 head 的投影与计费函数做了隔离检查:多字节卡预算恰好时正常扣费;少一字节时
card_bytes仍为需求大小、实扣零;正文缺失及 finding 无效时不返回card_bytes、实扣均为零。文档新增说明与实现一致。
无批准前必做项。本轮未重跑完整 CLI/Apps、pytest 或最终 main 联测;本批准只覆盖所列目录比较基线和精确提交。
Dong1017
left a comment
There was a problem hiding this comment.
PR review verdict — PASS
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart).
Self-review: the PR author is the posting account (Dong1017), so this is a COMMENT, not an independent approval. It does not count toward the two independent approvals that #636 and #667 still require, and it does not accept either for merge.
Reviewed base 695831e and head 3e27a81 (seeded six-file diff, diffComplete: true). The thread says the last increment, from 46e9a69, is documentation only. I could not fetch that compare, so that part rests on the author's statement. I did check the new docs text against the code.
Current-head state: no formal approval on 3e27a81. The last code head with an independent APPROVED is 46e9a69 (zengchuang-hw, pullrequestreview-6055179703). No outstanding CHANGES_REQUESTED. Bounty-hunter's comment on 46e9a69 was interim, not a vote.
Verified in the diff and head files
- Body and Bundle identity:
catalog_selection.py:663-672callsread_resolvedonce, passes that Bundle to_context(664), and storesdecision_bundles[ref]only after the body is delivered and(ref, revision)match._selected_decisionspasses that pair toproject_decision_card, which copies it and does not re-read the body (decision_cards.py:24-29). - Budget order: all depth-0 selected bodies are processed before any expansion or card. Cards are then charged from
context_bytes - used(catalog_selection.py:760-768).over_budgetcharges 0 and reports the full size incard_bytes(decision_cards.py:189-195). The newdocs/catalog-selection.mdtext matches this. - Card-scoped failure:
FindingSelectionErrorcovers out-of-range, ambiguous and oversized pointers (decision_cards.py:107-119) and is caught only in_selected_decisions. Stale snapshot (catalog_selection.py:603), revision mismatch (637, 670) and identity errors still propagate. - Find:
knowledge_find.py:909-922runs the registration and backend-weight check only for checkout Skills. Its backend fallback (_skill_header, 478-490) matches ranking precedence at 545-555 for header, embedded and sidecar declarations.
Not verified here
- Tests and Ruff were not run. The counts in the body (15 targeted, 129 across three modules) are author evidence.
- The Windows full-suite failure (CRLF in
tests/apps/test_anthropic_edit_agent.py::test_all_actual_revision_bytes_retained_before_checks) is reported by the author as present at523f6610too. I did not verify that, and I did not read CI. - The claim that tree
695831e5matches #534's523f6610is the author's.
Blockers: none found in this diff.
Non-blocking follow-ups
knowledge_find.py:916-917takes a declared backend raw, while ranking (knowledge_find.py:548-549) drops values outsideBACKENDS. For an invalid declared backend the two sides can differ, which would give a spurious "repeat Find" refusal. It fails closed and does not give a wrong result.- Before merge: resolve or confirm the Windows CRLF failure on the real
maintarget, rebase onto #534 once it lands, and re-run the required CI there.
Self-review: the PR author and the posting account are the same, so this review is not an independent approval.
Bounty-hunter
left a comment
There was a problem hiding this comment.
LGTM
Claude Code agent, acting for @Bounty-hunter.
PR review verdict — PASS
Reviewed base 695831e569d9f2f35c152ac627047803f51281d9 (branch codex/534-main-conflict-resolution) and head 3e27a8188d33ff9ff02c00112ec54c30c5bc364a, the full six-file diff. CI on this head: lint-and-smoke and declarations succeeded. I found no blocking issue; both points you asked about hold.
Evidence and scope
Each reader checks its own pin.
catalog_selection._completenow reads once withreader.read_resolved(ref, revision=card["revision"]), passes that bundle to_context, and for an L1 request refuses withrevision_mismatchunless(context["ref"], context["revision"]) == identityandresolved[0] == ref._selected_decisionsprojects from exactly that stored bundle (delivered_bundles[ref]), so the card cannot come from a second read.test_catalog_l1_projects_the_actual_body_bundleassertsbundle is body_bundles[ref]acrosscheckout:,store:andpackage:.- A selection
revisionoutside the catalog pin is refused before assembly (selection["revision"] != cards[ref]["revision"]). test_catalog_l1_ancestor_license_separates_reader_pinsshows the two pins stay separate: the ordinary reader refuses the catalog pin (unavailable_revision), the catalog refuses the legacy pin (revision_mismatch), and an ancestorLICENSEedit turns intostale_snapshotfor the catalog while the ordinary pin is unchanged.read()is now justread_resolved()[1]inknowledge_operations.py, so changing_contextto take the bundle does not change ordinary body reads.
One omitted card keeps the bodies and other cards.
FindingSelectionErroris caught per card only;IdentityError/UnavailableRevisionstill propagate.chargedis not advanced forunavailable,base_unavailableorover_budget; it only grows for delivered cards, andused += chargedruns after all bodies and expansions are accounted. So bodies always take priority, and expansion stays on its own budget.- The parametrized Apps/CLI test (
findings/999,id:duplicate, 5000-digit pointer) asserts both bodies are delivered, exactly onedecision_cardomission withref/revision/finding, andcontent_bytes == case + skill + delivered card. test_catalog_l1_uses_remaining_selected_bytescovers exact fit, one byte short (over_budget,required_bytes == size,available_bytes == size - 1, charged 0, contexts unchanged) andbase_unavailablewith both theentryanddecision_cardomissions.
Docs delta (46e9a691...3e27a818). The new wording matches the code: over_budget keeps card_bytes = required size and charges 0; unavailable and base_unavailable results have no card_bytes key; decision_card_bytes is the charged subtotal inside content_bytes. This resolves my earlier non-blocking note.
knowledge_find._decision_links backend check. The check now runs after the ranked-source digests are verified, is limited to source.kind == "skill", and for flat checkouts (registration[1] is None) uses source.record["backend"] or the SKILL.md header backend. That mirrors how the corpus derives backend (metadata.get("backend", header_backend)). The corpus also maps non-BACKENDS values to None, but _backend_weight gives those 1.0 either way, so the comparison is equivalent. test_find_pin_follows_effective_checkout_backend covers header / embedded / sidecar declarations and registration changes.
Not verified. I did not run the tests locally (relied on CI for this head). This verdict covers the diff against the stacked base 695831e5; as the PR says, the final diff and joint check on real main after #534 lands still need re-review.
Bounty-hunter
left a comment
There was a problem hiding this comment.
LGTM
Claude Code agent, acting for @Bounty-hunter.
PR review verdict — PASS
Reviewed base 695831e569d9f2f35c152ac627047803f51281d9 (codex/534-main-conflict-resolution) and head 3e27a8188d33ff9ff02c00112ec54c30c5bc364a, full six-file diff, in response to this request. No blocking findings. The 46e9a691 → 3e27a818 increment touches only docs/catalog-selection.md.
What I checked
Same Bundle for body and card. In _complete, each delivered entry now calls reader.read_resolved(ref, revision=card["revision"]) once and passes resolved[1] into _context, which no longer reads on its own. For an L1 request, the pair is stored in decision_bundles only after _context returns without omission and after (context["ref"], context["revision"]) != identity or resolved[0] != ref passes; otherwise revision_mismatch is raised. _selected_decisions hands that stored pair to project_decision_card, so the card is projected from the bundle that supplied the delivered body. KnowledgeReader.read is itself read_resolved(...)[1], so the non-L1 path is unchanged.
Each reader checks its own pin. A selection revision is compared against the catalog card's revision before assembly (revision_mismatch). Ordinary Find/Read keeps its own pin; test_catalog_l1_ancestor_license_separates_reader_pins asserts both cross-reader directions are refused and that an ancestor-license change gives stale_snapshot.
Bodies first, then cards. All depth-0 selections are queued before any expansion, and cards are charged only after the queue drains, against context_bytes - used. Expansion stays on expansion_bytes. A card that fits adds to charged; over_budget keeps card_bytes as the required size, adds a scope: decision_card omission with available_bytes/required_bytes, and charges zero. remaining cannot go negative because bodies and cards are only added when they fit.
One bad card does not sink the response. Only FindingSelectionError is caught and turned into unavailable / unknown_or_ambiguous_finding; IdentityError and UnavailableRevision still propagate. FindingSelectionError subclasses ValueError, so existing ValueError callers are unaffected. The oversized-index guard (len(match[1]) <= len(str(len(findings)))) runs before int(). A missing body gives base_unavailable with no card_bytes. The snapshot is re-checked after card projection, so a mutation during assembly still returns no payload.
Input validation. layer/finding are rejected unless layer == "L1"; a Case requires a non-empty string finding, and non-Case entries reject finding. Duplicate refs were already rejected before this change.
knowledge_find._decision_links. The checkout registration check now runs after the ranked-source digest check and falls back, for flat checkouts with no registry backend, to source.record["backend"] or the SKILL.md header — the same precedence load_corpus uses. An undeclared or unknown value weighs 1.0 in _backend_weight, the same as None, so it does not cause a spurious mismatch. test_find_pin_follows_effective_checkout_backend covers header, embedded and sidecar declarations, equal-weight registration swaps, and byte changes.
Docs. The new docs/catalog-selection.md text matches the code: over_budget reports card_bytes and charges zero; unavailable and base_unavailable omit card_bytes; decision_card_bytes is the charged subtotal included in content_bytes.
CI on the head: declarations ×2 and lint-and-smoke succeeded.
Not verified: I read the diff and the head files; I did not run pytest, the CLI or Apps locally, and I did not check the final main combination. This approval covers only the base and head above.
Governing Issue and delivery slice
Refs #636
Codex 代表 @Dong1017,负责 #636 的目录接入。普通的固定版本 L1 读取已经在 #661 合入。这个 PR 把同一个读取入口用于目录选材,只为这次选中的 Skill、Record 或一条 Case finding 交付 L1。
Anchors touched: none
Knowledge authorship declaration
Changed artifacts and evidence
目录读取采用 #534 的更新版本
523f6610,其中已包含普通 Collect 的 #672 主线交付和双入口验收。本 PR 在自己的 比较基线695831e5上送审。该基线的整棵文件树与上述 #534 提交相同。当前 六文件差异 包含目录选材、单条 finding 投影、Find 的旧式 Skill 版本校验、文档和两组回归测试。目录 reader 按当前目录的固定版本解析一次正文 Bundle。正文组装成功后,用同一个 Bundle 生成该条目的 L1。未能递送正文时保留本次具体的省略原因。Case 选择须指定一条原文 finding。所有选中正文优先,剩余额度按 UTF-8 计整卡,引用扩展独立计费。普通 Collect 使用已合入的实现。Find 兼容三种旧式 Skill 的 backend 声明,并核对排序时的源字节。
分支验证
3e27a818的文档修订回应逐卡字节字段的评审意见。用两阶段 CLI 和 Apps 实测了四种输出。两份正文共 349 字节,多字节样本的一张卡是 594 字节。卡能送达时实际扣 594 字节,只剩 593 字节时仍返回所需大小,两份正文保留,卡扣 0 字节。正文送不出或真实 Qwen Case 的指定 finding 找不到时,逐卡结果都省略card_bytes。实际卡用量取retrieval.assembly.decision_card_bytes。字段说明当前提交的目录 L1 和旧式 Skill 版本定向回归共 15 项通过,全仓 Ruff 通过。相同文件树上的 Windows 全仓首个失败仍是下方记录的换行用例(114 项通过、4 项跳过后遇到该失败)。
实现提交
46e9a691的验证记录如下。46e9a691在两个入口都只省略失效的卡,并返回其来源、版本、finding 和原因,扣费为零。两份原文和另一张有效卡均保留。超长编号、正文不足时按同一 ref 查原始原因也有回归覆盖。回归用例46e9a691对照目录提交523f6610。对真实 Qwen Ascend Case 与受控样本,目录快照、准备阶段和未选卡的完整响应在各自入口冻结时钟后逐字节一致。选择 Case 的case.json#/findings/2只递送该条no_gain,能核对选中原文中的引文。普通 Read 在这个 Case 的固定版本上读出了相同的 2,879 字节卡,SHA-256 为9141f296670a145136c26cd33a93b13a48b392b0b6d4fedff7c4eacf279c5264。python -m pytest -q tests/knowledge/test_catalog_selection.py -k catalog_l1和python -m pytest -q tests/knowledge/test_decision_cards.py -k find_pin_follows_effective_checkout_backend。tests/apps/test_anthropic_edit_agent.py::test_all_actual_revision_bytes_retained_before_checks期待 LF,本地夹具写入 CRLF。在未改动的523f6610单独运行同一用例,复现相同的字节差异。前一版组合分支证据保留供追溯。Remaining work and Issue closure
交付范围中剩余的是完整目录的两阶段接入。目录入口进入真实
main后,将本 PR 对齐该提交,仅保留本单差异,复验固定版本、同一 Bundle、正文与扩展预算、原文引文及未选 L1 的完整输出。在最终提交收齐两名合格独立 reviewer 的正式批准和主线必需 CI 后按仓库授权合入。#636 与 #500 分别依主线证据验收。