Skip to content

knowledge: move seven bodies into inferrsi.knowledge and revise the manifest (K01) - #418

Merged
Dong1017 merged 3 commits into
mainfrom
impl/k01-knowledge-first-wave
Nov 13, 2026
Merged

Dong1017 merged 3 commits into
mainfrom
impl/k01-knowledge-first-wave

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Governing Issue and delivery slice

Refs #407

@amy-why-3459 @zengchuang-hw: formal review request for this K01 PR, including the manifest revision and the new protected_paths. Please review this head (18271323cd4360809ed25b4cb7ac4689e794eca4).

Knowledge authorship declaration

{
  "schema_version": 1,
  "head_sha": "18271323cd4360809ed25b4cb7ac4689e794eca4",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Claude Code",
      "model_id": "claude-opus-5-5",
      "effort": "xhigh",
      "role": "author"
    }
  ]
}

Local implementation (commit be86c658319ee28133575aae71dff0e44cfa7df2) used Claude Code with --model claude-opus-5-5 and --effort xhigh. A CLI exit code is not independent proof of backend model identity. The merge (c5b626a65083ed54c87a4d01d88dce07b88394ef) and the review-comment commit (18271323cd4360809ed25b4cb7ac4689e794eca4) were written by the coordinator, not by Claude.

Seven-leaf hashes (P0b → K01 base)

Computed from raw git show bytes (no trailing-whitespace strip), for @zengchuang-hw:

git show 0da7e2f960cd4ec994ae8eddea5b71023c5379ca:src/inferrsi/<path> | sha256sum
git show e2f4cd1e39b369f06835cdd655ad5dc9f6808918:src/inferrsi/<path> | sha256sum
Path at those commits SHA-256 at P0b 0da7e2f960cd4ec994ae8eddea5b71023c5379ca SHA-256 at K01 base e2f4cd1e39b369f06835cdd655ad5dc9f6808918 Note
src/inferrsi/catalog.py e3241a3203595f116925ebb3fa6b4e2c0cb588b4c3a3575369bf50f253a3a947 e3241a3203595f116925ebb3fa6b4e2c0cb588b4c3a3575369bf50f253a3a947 unchanged
src/inferrsi/_source_snapshot.py ba6b799731a73cca55f211813d512fcaf46a123ce3997ad3ff918ce65ea7f39b ba6b799731a73cca55f211813d512fcaf46a123ce3997ad3ff918ce65ea7f39b unchanged
src/inferrsi/skill_catalog.py 86d465e245b4cd6b72ca175d05124dbb88d510a78568b6bc4c44b332870c08a3 86d465e245b4cd6b72ca175d05124dbb88d510a78568b6bc4c44b332870c08a3 unchanged
src/inferrsi/_skill_selection.py acbec7c91bfa05bc2008b939e009fe600a40518051229fb7618c56b092ad36b9 7bcf1930b73e09fcadf78e7c9e384b30411ed599d83c32e6837f04ca25cbda77 changed in #389, before K01
src/inferrsi/research.py 9bfe59dd17b5476c18ce50d671711053c62800521c50d6b710e8140a2b4dca04 9bfe59dd17b5476c18ce50d671711053c62800521c50d6b710e8140a2b4dca04 unchanged
src/inferrsi/knowledge_store.py 70dfca059b0a682579206d4376d191667934b3ca869ae847098c4c6964d86abe 70dfca059b0a682579206d4376d191667934b3ca869ae847098c4c6964d86abe unchanged
src/inferrsi/knowledge_operations.py 3725781bcedb308af6ad9edc0b970c63f82accf6b04ebee4008c1081b63bed9c 686b196e03ca0a1dba5ff5e246563f305ba2bea412172833905af41a6c6ad886 changed in #389, before K01

On this head, the six moved files under src/inferrsi/knowledge/ are SHA-256-identical to the K01-base root files above. knowledge/catalog.py differs only by the D020 split. The new technical leaf src/inferrsi/_repo_pack_data.py has file_sha256 a14edac8283b1f7b6b5794381c44d7c2632dda5cc01f03c557dc293d05523afd (not one of the seven leaves).

Changed artifacts and evidence

Independent coordinator checks at base e2f4cd1e39b369f06835cdd655ad5dc9f6808918 (2026-11-12 Asia/Shanghai) and again on this merged head 18271323cd4360809ed25b4cb7ac4689e794eca4. A local pass is not CI and is not branch protection.

Requirement Actual change Check / evidence and result Remaining gap
K01-1 same objects / __all__ / signatures Seven root shells re-export moved objects; catalog REPO_TYPES is one tuple on three routes Independent: six moved bodies SHA-256-identical to base; catalog differs only by the D020 split; shells have no function/class bodies and import inferrsi.knowledge.*. Focused suite includes test_root_names_are_the_moved_objects and __all__ checks — see focused run below CI on this new head is still running
K01-2 old root consumers equal new K results Consumers still go through root names Implementer equivalence digests (12) recorded as equal; included in the focused set via manifest-consumer tests Coordinator did not re-run the separate equivalence harness
K01-3 Bundle / revision / CAS fixtures unchanged No fixture or data/ change; D1–D8 seams retargeted Empty diff vs K01 base for src/inferrsi/data, plugins, pyproject.toml, MANIFEST.in; focused set includes bundle, store, contract, snapshot tests —
K01-4 wheel outside checkout; repository_pack / infra New leaf; inspection rewired in one import line Independent: inspection diff is exactly that one import. Wheel / installed-package checks were run by the implementer (check_installed.py, check_k01_installed.py) and recorded as exit 0. Ubuntu evidence: installed-package 3.10 and 3.11 succeeded on be86c658319ee28133575aae71dff0e44cfa7df2 Coordinator did not rebuild the wheel on the merged head; sdist was not built (host path-length limit)
K01-5 overall false; Knowledge closure clean Gate tests otherwise unchanged; K01-5 expectation updated after merging #338 Independent first_wave_report() on this head: violations empty; residuals only inferrsi.harness.skill_evaluation -> inferrsi.knowledge_operations; blockers are absent: apps/, allowlist: 9 compatibility pairs, that residual, harness reaches model/infra (inferrsi.harness.agent_sessions -> inferrsi.infra, 41 hits), and runtime resource loaders: 5. absent: knowledge/ and absent: benchmark/ are gone. new_core_closure_isolated is false solely because of those loaders (added by #338); Knowledge has no closure violation. isolation_complete remains false. The K01-5 test now asserts this post-#338 report —
K01-6 packaging keeps old resources data/ and plugin layout untouched Independent empty diff vs K01 base for src/inferrsi/data, plugins, pyproject.toml, MANIFEST.in Wheel contents not re-inspected by the coordinator on the merged head
Manifest revision (formal review) docs/legacy-knowledge-manifest.json: base_commit e2f4cd1e…, revision_history, two #389 hashes, three public exports, leaf file_sha256 a14edac8283b1f7b6b5794381c44d7c2632dda5cc01f03c557dc293d05523afd. Review follow-up: audited sentence for _json / _hash now states that injection points are on inferrsi.knowledge.knowledge_operations and that the root shell is a same-name pass-through (patching the root does not affect Bundle.manifest or KnowledgeReader.collect); catalog and knowledge_operations consumer_evidence keep the base-era patch locations as history and add the current-head modules and lines (tests/test_cli_catalog.py L191, tests/test_knowledge_tiers.py L91, tests/test_research.py L92 and L121 patch inferrsi.knowledge.catalog; tests/test_bundle_manifest.py L74–L75 and tests/test_collect_limit_serialization.py L48–L49 patch inferrsi.knowledge.knowledge_operations). The _skill_selection evidence notes that the observability/knowledge_capture import of TASK_RELEVANCE is removed by OBS (#413); K01 only keeps the root-shell pass-through of that name Independent: base leaf hashes recomputed and match the table above. Not approved by the implementer or the coordinator; awaiting formal review Formal review
New protected_paths .github/knowledge-model-policy.json and docs/knowledge-model-policy.md add the three knowledge/ paths; root paths kept Independent: all six paths present Formal review
infra.inspection → catalog rewired One-line import to _repo_pack_data Independent one-line diff, as above —
Merge with current main Merge commit c5b626a65083ed54c87a4d01d88dce07b88394ef; only docs/module-layout.md conflicted Resolved as a union of the K01 Knowledge move and the #338 benchmark / registry text. The _repo_pack_data paragraph is the K01 “K01 created… formal review” wording —

Checks and dependencies

  • Checks actually run (result and tested scope):
    • Coordinator independent structural / hash / manifest / policy / inspection / untouched-path checks at the K01 base: passed (2026-11-12 21:06 Asia/Shanghai). Seven-leaf hashes recomputed on the merged head and match the table.
    • Coordinator git diff --check on the merged head: clean.
    • Coordinator ruff check on the K01-changed Python (tests/test_knowledge_compatibility_shells.py): all checks passed. A full-tree ruff check src tests tools on the merged head reports five F811 findings in tests/test_engineering_benchmark_plugins.py, which arrived from feat: share RSI optimization management across project and benchmark tasks #338 and are already on main; they are not part of this PR's review-comment commit. feat: share RSI optimization management across project and benchmark tasks #338's own full-check had passed.
    • Coordinator independent first_wave_report() on the merged head: result in the K01-5 row above; isolation_complete is false.
    • Coordinator independent focused pytest on the merged head (25 files, same set as the implementer's focused run, pytest -q -p no:cacheprovider -rfE -n 8 --dist loadfile): 630 tests, 0 failures, 0 errors, 9 skipped, 2026-11-12 Asia/Shanghai.
    • Ubuntu CI on the previous head be86c658319ee28133575aae71dff0e44cfa7df2 (this is the Ubuntu evidence for that implementation; it supersedes earlier local Windows full-suite figures): full-check 3.10, full-check 3.11, installed-package 3.10, installed-package 3.11, pr-references, declarations, and lint-and-smoke all succeeded. CI on this new head will re-run and is not yet the evidence.
    • Implementer focused run on the pre-merge tree (same 25-file set): 626 tests, 0 failures, 0 errors, 9 skipped (symlinks unavailable on the host), junit 2026-11-12 20:50 Asia/Shanghai.
  • Failed, skipped, timed-out or not-run checks (if applicable): CI lanes on this new head are not yet complete. Linux and Python 3.10 / 3.11 were not re-run locally after the merge. sdist was not built (host path-length limit). Coordinator did not rerun the full suite or a wheel install on the merged head.
  • Dependencies / shared interfaces / integration assumptions (if applicable): Nine-pair allowlist and the registered harness.skill_evaluation → knowledge_operations residual stay. Root shells stay until R01. The observability/knowledge_capture import of TASK_RELEVANCE is left for OBS (task: OBS — 解散 observability 过渡包并归位记录与展示 #413); K01 only keeps the root-shell pass-through. #397 is untouched. This PR must not be read as setting overall isolation_complete true. After feat: share RSI optimization management across project and benchmark tasks #338, new_core_closure_isolated is false because of runtime resource loaders; that is not a Knowledge-closure regression.

Remaining work and Issue closure

  • Remaining Issue requirements / follow-up: Formal review of the manifest revision and the new protected paths. R01 retires the root shells and the three root protected_paths after retirement evidence. K02 moves packaged resources. Other first-wave slices are out of scope.
  • Goal-acceptance owner or accepted closure delegation: Formal review: @amy-why-3459 and @zengchuang-hw. #407 is not closed by merging this PR.
  • Goal ready for acceptance? Proposed with the evidence in this body. Manifest revision is not self-approved.

The knowledge-model-policy required status is the admission check for protected paths; the import-gate result above is attached evidence and is not branch protection.

…anifest

Move the seven Knowledge implementations into inferrsi.knowledge, leave
static exact-forwarding shells at the old root names, and add the
_repo_pack_data leaf for REPO_TYPES and repository_pack. Rewire
infra.inspection to that leaf. Revise the legacy manifest at the K01
base (hashes, public exports, technical leaf) and protect the new
paths. Root shells and the three root protected paths stay until R01.
overall isolation_complete stays false.

Agent-assisted-by: Claude Code / claude-opus-5-5 effort=xhigh (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
@Dong1017 Dong1017 added kind:task Bounded delivery task with a delegated slice area:knowledge Knowledge line: packs, skill library, knowledge admission labels Nov 12, 2026

@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

Reviewed base 34c81b0dfa1b4c21f9d54c715d73dd462e0f321e and head be86c658319ee28133575aae71dff0e44cfa7df2 (full diff, first review). prior-reviews.md lists no APPROVED review on this head and no outstanding CHANGES_REQUESTED.

Blocker

Root compatibility shells re-bind injectable names, and the moved bodies read the globals of the defining module. Patching the root name leaves record loading, research, and bundle identity on the original functions.

  • src/inferrsi/catalog.py:13 and :31 re-export files. src/inferrsi/knowledge/catalog.py:7 binds its own files, and knowledge_records calls it at :91. docs/legacy-knowledge-manifest.json still records tests/test_cli_catalog.py (L189) and tests/test_knowledge_tiers.py (L89) as patching catalog.files. A patch of inferrsi.catalog.files does not change that call.
  • src/inferrsi/knowledge/research.py:11 does from .catalog import knowledge_records, search_knowledge, and research_knowledge calls that binding at :72. The same manifest entry records tests/test_research.py (L91, L120) as patching catalog.knowledge_records. The call site that must be patched is inferrsi.knowledge.research.knowledge_records.
  • src/inferrsi/knowledge_operations.py:2 says to patch _json and _hash on the implementation module, and :12-:13 only re-export them. Bundle / KnowledgeReader in src/inferrsi/knowledge/knowledge_operations.py call _hash (:88, used at :173) and _json (:51). The manifest audited sentence still says those names are “re-exported for test injection (D1, D2)”, and consumer evidence still says tests/test_bundle_manifest.py (L73) patches _hash and tests/test_collect_limit_serialization.py (L39-L47) patches _json. Re-export does not make a root-module monkeypatch visible inside Bundle.manifest or collect.

Expected correction: retarget those patches to the defining modules (inferrsi.knowledge.catalog.files, inferrsi.knowledge.research.knowledge_records, inferrsi.knowledge.knowledge_operations._hash / _json), and revise the D1/D2 sentence so the injection module is the implementation module. The line references at base e2f4cd1e39b369f06835cdd655ad5dc9f6808918 can stay as history; the head tests need to match the shells.

The diff text available here ends inside the knowledge_operations.py shell hunk (declared 35 lines; __all__ and everything after it were cut off), so this pass did not see knowledge_store.py, research.py, or skill_catalog.py shells, nor any test hunks. tools/skill_eval_snapshot.py still imports _skill_name and _unique_fields through the root skill leaf; that shell has to re-export them. I will re-read the full head after you push, including a confirmation that those private names are on the skill_catalog shell.

Verified on the visible move

  • Blob-identical bodies: _skill_selection (c696ef571), _source_snapshot (3ced2e330), knowledge_operations (cff710c26). Relative imports resolve inside inferrsi.knowledge with the same text.
  • REPO_TYPES / repository_pack live once in src/inferrsi/_repo_pack_data.py (no inferrsi import; fragment matches the old catalog function). Root catalog and knowledge/catalog.py both bind that same REPO_TYPES tuple. knowledge/catalog.py does not define repository_pack.
  • src/inferrsi/infra/inspection.py changes only from .._repo_pack_data import repository_pack.
  • src/inferrsi/knowledge/__init__.py stays import-free.
  • Protected-path list adds knowledge/catalog.py, knowledge/skill_catalog.py, and knowledge/knowledge_operations.py in both .github/knowledge-model-policy.json and docs/knowledge-model-policy.md.
  • Manifest skill-catalog line refs L279 / L317 / L435 and the call sites L281 / L319 / L438 / L439 / L442 / L445 match the moved knowledge_operations.py body. The #389 task-lexical-v1 collect path matches the new audited sentence (TASK_RELEVANCE is the third RELEVANCE_METHODS element; skill_score rejects it).

Not verified here

  • file_sha256 values were not recomputed against e2f4cd1e39b369f06835cdd655ad5dc9f6808918 or against the new _repo_pack_data.py bytes.
  • Tests were not executed. CI results were not in the review seed.

Optional

Root catalog.py used to bind the _source_snapshot module via from inferrsi import _source_snapshot. The shell does not re-export it. Callers that patched inferrsi.catalog._source_snapshot need inferrsi.knowledge._source_snapshot (the module knowledge/catalog.py actually uses).

This review does not approve the head and does not change K01 scope. I will re-read after the author pushes.

Copy link
Copy Markdown
Collaborator

完整 review:base 34c81b0dfa1b4c21f9d54c715d73dd462e0f321e(merge-base e2f4cd1e39b369f06835cdd655ad5dc9f6808918),head be86c658319ee28133575aae71dff0e44cfa7df2。这是首次 review,看的是完整 diff(32 个文件)。代码搬迁本身没有发现问题,但 manifest 和 PR 描述还有几处要补,所以这次先不 approve。

已核对,没问题

  • e2f4cd1e 到 34c81b0d 之间 main 只改了 README.md,七个根叶在两个提交上逐字节一致,所以 manifest 的 base_commit 用 e2f4cd1e 没有问题。
  • 六个搬迁主体(_skill_selection、_source_snapshot、knowledge_operations、knowledge_store、research、skill_catalog)和 e2f4cd1e 的根文件逐字节一致。knowledge/catalog.py 只多了 D020 拆分:REPO_TYPES 改成从 .._repo_pack_data 导入,repository_pack 删掉,_source_snapshot 改成相对导入。
  • 我在 e2f4cd1e 上重算了 manifest 里的七个 file_sha256,全部一致(两个 Review measured request profiles and decisions across optimization rounds #389 叶子是新值,其余五个没变)。technical_leaf.file_sha256 也和 head 上的 src/inferrsi/_repo_pack_data.py 一致。
  • 根壳的名字:我在整个 head 树里查了原根模块里那些只是顺带 import、壳里不再导出的名字,比如 inferrsi.knowledge_operations.TASK_RELEVANCE、inferrsi.knowledge_store.Bundle、inferrsi.research.search_knowledge,仓库内没有任何消费者。tools/skill_eval_snapshot.py 用到的 _skill_name / _unique_fields 在 skill_catalog 壳里有。test_root_names_are_the_moved_objects 断言了 __all__ 和 manifest exports 完全一致、对象 is 相同,我在 task: K01 — 七个 Knowledge 主体迁移与清单同审 #407 提的第 3 点已经解决。
  • 测试里的 patch 都已经改到实现模块:tests/test_cli_catalog.py L191、tests/test_knowledge_tiers.py L91、tests/test_research.py L92/L121 改 patch inferrsi.knowledge.catalog;tests/test_bundle_manifest.py L74–L75、tests/test_collect_limit_serialization.py L48–L49 改 patch inferrsi.knowledge.knowledge_operations,还加了 __globals__ 断言。Dong1017 在这个 head 上的 DO NOT PASS 说测试 patch 还指向根壳,这一点在 head 上已经不成立了(那次 review 看到的 diff 是截断的)。
  • infra/inspection.py 只改了一行 import;knowledge/__init__.py 里没有 import;protected paths 在 .github/knowledge-model-policy.json 和 docs/knowledge-model-policy.md 里同步加了三个 knowledge/ 路径,根路径保留。
  • head 上 CI 全绿:full-check 3.10/3.11、installed-package 3.10/3.11、lint-and-smoke、declarations、pr-references、knowledge-model-policy。

问题

  1. docs/legacy-knowledge-manifest.json L203 的审计句已经不对了。 这句还是 “_json and _hash are explicitly re-exported for test injection (D1, D2)”。搬家以后,在根壳上 patch _json / _hash 不会影响 Bundle.manifest 和 KnowledgeReader.collect;测试现在 patch 的是 inferrsi.knowledge.knowledge_operations。这一处同意 Dong1017 的意见,请改成:注入点是实现模块,根壳只是同名透传。L44 和 L206 的 consumer_evidence 记的是 base 上的 patch 位置,可以作为历史保留,但建议各补一句 head 上实际 patch 的模块(inferrsi.knowledge.catalog / inferrsi.knowledge.knowledge_operations),免得读者以为 patch 根壳仍然有效。
  2. PR 描述里缺七叶哈希对照表。 我在 task: K01 — 七个 Knowledge 主体迁移与清单同审 #407 第 1 点请求列出七叶“旧哈希 → 新哈希”的对照表和计算命令。现在描述里只写了两个 Review measured request profiles and decisions across optimization rounds #389 叶子。我复核过七个都对,但描述里还是请补上完整的七行表(五行没变的也写出来)和计算命令(例如 git show e2f4cd1e:<path> | sha256sum),方便 @zengchuang-hw 复核。
  3. TASK_RELEVANCE 这条边的归属没有写明。 manifest L138 写了 observability/knowledge_capture (L20) 经根叶导入 TASK_RELEVANCE,但没有说明这条边由 OBS(task: OBS — 解散 observability 过渡包并归位记录与展示 #413)删除,K01 只保证根壳透传。这是我在 task: K01 — 七个 Knowledge 主体迁移与清单同审 #407 第 2 点提的,请在这条 consumer_evidence 或 PR 描述里补一句,免得被当成遗漏。

仅供参考,不阻塞

  • Dong1017 提到 inferrsi.knowledge.research.knowledge_records 这个绑定(knowledge/research.py L10、L71),这不是 K01 引入的问题。base 上根 research.py 也是 from .catalog import knowledge_records,测试 patch catalog.knowledge_records 时,catalog_size 本来就读的是真实记录数。搬家前后行为一致,可以不在 K01 里改,放到后续切片处理。
  • 本地全量测试那组 76 failed / 7 errors 是实现者自己和 base 做的对比,不是 coordinator 复跑的;现在 head 上 CI 的两个 full-check 都通过,可以在描述里把这条证据换成 CI 的结果。

这次只是模块搬迁加文档和 manifest 修订,行为不变,不需要精度或性能实验。

Reviewed: 34c81b0dfa1b4c21f9d54c715d73dd462e0f321e → be86c658319ee28133575aae71dff0e44cfa7df2。

Resolve docs/module-layout.md so both the K01 Knowledge move and the
#338 benchmark contribution are recorded.

Refs #407

Signed-off-by: GUOGUO <xwdong1998@163.com>
Revise the Knowledge compatibility manifest: injection points are on
inferrsi.knowledge.knowledge_operations / catalog, not the root shells;
record the current test patch modules; note that OBS (#413) removes the
TASK_RELEVANCE edge from observability/knowledge_capture.

Update the K01-5 isolation test for #338: runtime resource loaders keep
new_core_closure_isolated false, while Knowledge violations stay empty
and overall isolation_complete stays false.

Refs #407
Signed-off-by: GUOGUO <xwdong1998@163.com>

@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

Reviewed incremental range be86c658319ee28133575aae71dff0e44cfa7df2..18271323cd4360809ed25b4cb7ac4689e794eca4 on base fa3d6421c71cad3be6a918733dfacde1824b1a5e. Prior review on be86c658: #418 (review) (COMMENT / DO NOT PASS). prior-reviews.md lists no APPROVED review on this head and no outstanding CHANGES_REQUESTED.

This review does not approve the head.

Blocker

docs/legacy-knowledge-manifest.json still records the root-shell patch targets, and the sentences added on this head do not name the module global the research call reads.

  • Catalog consumer_evidence (hunk @@ -41,7 +41,7 @@, file ~L44) still says tests/test_cli_catalog.py (L189) and tests/test_knowledge_tiers.py (L89) patch catalog.files, and tests/test_research.py (L91, L120) patch catalog.knowledge_records. The same string then says those tests at L191, L91, L92, and L121 patch inferrsi.knowledge.catalog. Both claims are present tense. On the prior head, research_knowledge calls knowledge_records bound in src/inferrsi/knowledge/research.py (from .catalog import knowledge_records). The call site to patch is inferrsi.knowledge.research.knowledge_records. A patch of inferrsi.knowledge.catalog leaves that binding on the original function, which is the same failure path as the prior review.
  • knowledge_operations (hunk @@ -200,10 +200,10 @@, file ~L203–L209): audited_definitions now says _json and _hash injection is on inferrsi.knowledge.knowledge_operations, and a root-shell patch leaves Bundle.manifest and KnowledgeReader.collect on the original functions. consumer_evidence still says tests/test_bundle_manifest.py (L73) patches _hash and tests/test_collect_limit_serialization.py (L39–L47) patches _json, then adds that L74–L75 and L48–L49 patch the implementation module.

Expected correction: one live patch target per injectable name, matching the module global the body reads. For research, that target is inferrsi.knowledge.research.knowledge_records unless research.py looks the name up on the catalog module at the call. Include the test edits and any shell or body edits in the diff.

Verified

  • Those manifest hunks are the K01 edits present in the readable prefix of pr/diff.patch. The prior root-shell binding failure is still what the updated catalog sentence describes for research.
  • No formal Approve on 18271323.

Not verified here

  • pr/diff.patch ends mid-line inside added src/inferrsi/benchmark/tasks/moe-forward-npu/benchmark.py (except (OSErr). Later paths are absent from the seeded patch, including src/inferrsi/knowledge/**, the root shells, and tests/test_cli_catalog.py, tests/test_knowledge_tiers.py, tests/test_research.py, tests/test_bundle_manifest.py, and tests/test_collect_limit_serialization.py. The new line numbers are unchecked.
  • Tests were not executed. Benchmark, docs, and CLI additions in this range were not reviewed past that cutoff.

I will re-read after the author pushes a patch that includes those files.

@Dong1017
Dong1017 requested review from amy-why-3459 and zengchuang-hw and removed request for amy-why-3459 and zengchuang-hw November 12, 2026 14:56

@amy-why-3459 amy-why-3459 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

PR review verdict — PASS

增量 review:be86c658319ee28133575aae71dff0e44cfa7df2 → 18271323cd4360809ed25b4cb7ac4689e794eca4(新 base fa3d6421c71cad3be6a918733dfacde1824b1a5e)。中间是 merge main 的 c5b626a65083ed54c87a4d01d88dce07b88394ef(带进 #415/#401/#338)和修复提交 18271323。

上次三点都已解决

  1. docs/legacy-knowledge-manifest.json 里 knowledge_operations 的 audited_definitions 改了:注入点在 inferrsi.knowledge.knowledge_operations,根壳只是同名透传。catalog 和 knowledge_operations 的 consumer_evidence 保留了 base 上的 patch 位置作为历史,又补了 head 上实际 patch 的模块和行号。
  2. PR 描述补了七叶哈希对照表(P0b 0da7e2f9 → K01 base e2f4cd1e),还附了计算命令。五行没变,两行在 #389 里改过,和我上次复算的结果一致。
  3. _skill_selection 的 consumer_evidence 补了一句:observability/knowledge_capture 对 TASK_RELEVANCE 的导入由 OBS(#413)删除,K01 只保留根壳透传。

增量核对

  • merge 没有改到七个根叶、knowledge/** 和 manifest。manifest 只有 18271323 里的 4 行文字修改,七个 file_sha256 和 base_commit 都没变。#338 带进来的代码里,唯一新的 Knowledge 引用是 tests/test_optimization_session.py 里 from inferrsi.knowledge_operations import KnowledgeReader,走根壳透传,没问题。
  • docs/module-layout.md 的冲突按并集解决了,K01 和 #338 benchmark 的描述都在。
  • K01-5 测试(tests/test_knowledge_compatibility_shells.py L74–L89)改成断言 runtime resource loaders 这个 blocker,且 new_core_closure_isolated 为 false,violations 仍为空,isolation_complete 仍为 false。这和 #338 之后 first_wave_report() 的结果一致,不是 Knowledge 闭包退化。
  • head 上 CI 全绿:full-check 3.10/3.11、installed-package 3.10/3.11、lint-and-smoke、pr-references、knowledge-model-policy。declarations 第一次失败、更新描述里的 head_sha 后重跑通过。

关于 Dong1017 在这个 head 上的 DO NOT PASS,我逐条核对过,不构成阻塞

  • research 的绑定:src/inferrsi/knowledge/research.py L12 绑定的 knowledge_records 只在 L73 用来算 catalog_size。真正的检索在 L84 调用 search_knowledge,它读的是 inferrsi.knowledge.catalog 模块里的 knowledge_records,正是 tests/test_research.py L117/L136 patch 的那个,所以测试 patch 的是有效的注入点。base 上根 research.py 也是这个结构,K01 没有改变行为,CI 也通过了。
  • consumer_evidence 里同时有 base 的位置和 head 的位置:manifest 记录的是 base_commit 上的证据,新加的句子明确写了 “On this K01 head”,并说明根壳 patch 已经无效,不会有歧义。

不阻塞,可以顺手改

  • 描述里 K01-1 那一行的 “CI on this new head is still running” 和 “CI lanes on this new head are not yet complete” 已经过时了,可以换成 head 上的 CI 链接。

这次只是文档、manifest 和一个测试的期望值修改,行为不变,不需要精度或性能实验。

@david6666666 david6666666 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.

Looks good. The six unchanged bodies and the catalog split preserve the existing call paths. I checked all 32 changed files and ran focused export-identity, leaf-hash, and injection-binding checks; I did not rerun the full suite. CI for this head is green.

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

Independent post-merge review of head 18271323cd4360809ed25b4cb7ac4689e794eca4 against base fa3d6421c71cad3be6a918733dfacde1824b1a5e. This PR was already merged when reviewed; this is a COMMENT, not a merge approval.

No actionable defects identified in the reviewed changes. I compared all seven relocated Knowledge implementations with the original root modules: six are byte-for-byte unchanged, while catalog changes are confined to routing the source-snapshot import and extracting REPO_TYPES/repository_pack into the neutral data leaf. I also inspected the compatibility exports, lazy optional-dependency paths, package discovery, resource paths, infra import rewrite, and protected-path policy updates. Root-shell monkeypatching no longer changes implementation globals; the changed tests and documentation explicitly reflect that boundary.

Checks run on the clean exact-head checkout:

  • 16 focused test files covering compatibility, policy/architecture, manifests, catalog/CLI, collect serialization/selection, store/readers, research, skill parsing and optional dependencies: 431 passed, 2 skipped, plus 4 subtests passed.
  • ruff check src tests: passed.
  • git diff --check against the base: passed.

Limits: the full repository test suite, fresh wheel-install validation, and platform-specific skipped cases were not executed in this review. One pytest-plugin deprecation warning was emitted. Review conclusions are limited to the code and checks above; other reviewers' opinions were not consulted.

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

Historical human-request follow-up — K01 relocation checks passed within the scope below; full acceptance remains unverified.

Explicitly answering 6825142663, updated 2026-11-12T13:37:50Z. The request's technical opinions and author/reviewer retellings were not read. Requirements came from the isolated original K01 scope.

Reviewed current retained head 1827132 against base fa3d642. The source's historical locator was an earlier revision; the checks below apply to the current head only. PR remains closed.

My previous COMMENT 5923779106 is on this same head but does not explicitly reference this request. Same-head/content overlap was not taken as coverage. This revision-bound COMMENT provides the explicit response without reopening the PR or changing the earlier review.

Independent code assessment:

  • Assessed the 32-file relocation diff (2,271 additions / 1,936 deletions). Compared comment/docstring-free ASTs of each old module with its new Knowledge implementation.
  • _source_snapshot, skill_catalog, _skill_selection, research, knowledge_store and knowledge_operations retain identical executable ASTs in that old-to-new comparison. catalog changes the _source_snapshot import route and delegates REPO_TYPES / repository_pack to the new neutral _repo_pack_data leaf; its repository_pack implementation and data path remain the original implementation.
  • Read all seven root forwarding shells and the new leaf. The shells forward the listed public/private compatibility names directly, rather than wrapping functions; tests verify object identity and all against the manifest. Infra inspection routes to the neutral leaf, and the fresh-process test verifies importing Knowledge/inspection does not eagerly load Knowledge implementation bodies.
  • The production package data/pack.json layout is not relocated in this diff. It does not retire root shells or complete the remaining whole-project isolation work.
  • The model-policy JSON delta adds the three moved protected module paths while retaining their original protected paths. That is a source-level observation, not authorization to accept a policy amendment or change GitHub security settings.

Actually executed on an isolated exact-head archive:

  • Eleven affected test modules: compatibility shells, bundle manifest, CLI catalog, collect limit serialization, knowledge model policy, knowledge store, knowledge tiers, research, skill library readers, architecture closed loop and optional-dependency tests.
  • Result: 305 passed, 1 skipped, 4 subtests passed. The skip is the knowledge-store export test requiring Git metadata, absent from the archive. It is NOT a passed export test.
  • Ruff on the moved implementations, shells, leaf, inspection and compatibility test passed; git diff --check passed.
  • Exact-head check-run metadata returned nine entries: eight success and one failure. I did not inspect the failed job's log or infer its cause, and did not verify required-check configuration.
  • Read the applicable AGENTS delta; the review skill is unchanged from the version already read.

Limits and remaining evidence:
I did not run the full repository suite, the skipped Git-backed export, or build/install a wheel outside the checkout. Thus this pass does not establish all outside-checkout packaging/resource compatibility. It also does not establish authenticated acceptance of the revised legacy manifest or policy scope: the clean handoff explicitly lacks complete original AC/decision provenance. Passing tests that consume the revised manifest cannot by themselves authorize that revision. The remaining global isolation blockers are outside the seven-module relocation slice, not evidence that K01 completes the entire architecture transition.

No new blocking defect was identified in the exercised relocation subset. This is not a blanket approval of every compatibility, packaging or policy obligation, nor a claim that the failed CI entry is resolved. Verify the remaining evidence before using this follow-up as overall acceptance. No repository code, labels, permissions, policy configuration, merge/closed state or previous review state was changed; no paid model/device work or stopped task was resumed.

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

Labels

area:knowledge Knowledge line: packs, skill library, knowledge admission kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants