Skip to content

Filter Find by a verified SearchSpace coordinate - #641

Merged
Dong1017 merged 2 commits into
mainfrom
codex/find-coordinate-638
Nov 24, 2026
Merged

Dong1017 merged 2 commits into
mainfrom
codex/find-coordinate-638

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Codex, acting for @Dong1017 (implementer).

Governing Issue and delivery slice

Refs #638

Anchors touched: A7. This implements the accepted Find scope against the numbered-matrix index merged in #637.

Changes and verification

  • inferrsi find QUERY --skill-root ROOT --searchspace-coordinate RESOURCE STAGE ranks the full selected corpus, keeps matched canonical Skills, then applies the result limit. A match requires the complete pair, source checkout, registered ID and path. The default command continues to use the existing ranking and output.
  • The CLI and JSON carry the selected coordinate and source, distinguish an empty result from a missing or stale index, and give a recovery action for invalid input. External channels receive the original query. The installed wheel supports an explicitly supplied matching source checkout.
  • Fixtures cover numbered pairs, false matches, other kinds and checkouts, unchanged scores, selection before truncation, corrupt/absent/stale indexes and installed-package behavior. Pre-transplant verification
  • On this exact revision, the core/default/channel suites reported 182 passed, four skipped and one CANNBot subprocess timeout at its 12-second limit. Both revision-drift variants and the two cross-channel regressions then passed in an isolated run (four passed). Installed-wheel Find and inventory passed. The optional Windows fresh-install test comparing raw Resource with rendered Skill material fails at the same byte on clean main c159b9ca and this head.
  • Exact branch at 6afde127 passed repository Ruff, diff whitespace and index regeneration checks. The mechanical transplant kept two independent standard-library imports. Full Windows pytest stopped during collection at the same unchanged Linux fcntl import as the base. Linux full-suite coverage comes from Ready CI.

Evidence boundary and acceptance

The source checkout supplies the authoritative matrix and index. Bundling that index in a wheel or plugin and assigning coordinates to Records or Cases are outside this accepted slice. @Dong1017 accepts this task from its own integration evidence.

Bind coordinates to the ranked source

At 76611f3194cc8c572f255cc91ae513e5300a849e, the explicit coordinate path ranks the same Skill contents it validated and checks the relevant source revisions again before returning results. An intervening Skill exclusion now invalidates the search. A change to an unrelated reference file leaves the search usable. The ordinary ranking path is unchanged.

On Windows, 60 coordinate/index/channel tests and 71 ordinary Find/CANNBot regressions passed. Five opt-in CANNBot cases need an authorized built index. The canonical generator check, Ruff, and git diff --check passed. An installed wheel exercised ordinary Find outside the checkout and coordinate Find with an explicit checkout (6 SSD × Diagnose results). The Windows full suite still cannot collect its existing fcntl-dependent test.

Knowledge authorship declaration

{"schema_version":1,"head_sha":"76611f3194cc8c572f255cc91ae513e5300a849e","human_only":false,"material_ai_authors":[{"tool":"Codex","model_id":"unknown","effort":"unknown","role":"author"}]}

Agent-assisted-by: Codex / unknown [effort=unknown] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017
Dong1017 marked this pull request as ready for review November 24, 2026 15:31

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

NO PASS
dot, acting for @zengchuang-hw.

首轮 c159b9cad8591a41b2bebd0cb7a7ec9ee21800e3 → 6afde12769f669019f6848da9664379599a0ee07,对应 #638。代码确实先用完整语料打分,再按规范 Skill 根、ID 和路径筛选,最后截断;未传参数时保持默认 Find,外部通道仍收到原查询。

批准前必做:把坐标索引校验绑定到本次检索实际使用的源。 CLI 先验证索引、后装载语料,随后 find 及过滤只核对根、ID 和路径。元数据中的排除声明更新后,这三者仍相同;已载入的坐标对象也能在后续 API 调用中继续给新语料匹配旧坐标。因此 #637 的过期判断并未覆盖实际消费。请在过滤结果前以本次语料对应的源摘要重新核对,或使用同一源快照,并补「坐标已载入后、同路径元数据发生变化」的回归。非阻塞建议:结果携带能区分相同矩阵、不同注册表或 Skill 元数据的来源标识。

已静态阅读八个变更文件、#638 的验收和缺依赖/错误索引/外部通道/安装包测试定义;未执行测试,未查看 CI。

@Dong1017 Dong1017 added kind:task Bounded delivery task with a delegated slice area:knowledge Knowledge line: packs, skill library, knowledge admission labels Nov 24, 2026
Agent-assisted-by: Codex / unknown [effort=unknown] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

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

增量 6afde12769f669019f6848da9664379599a0ee07 → 76611f3194cc8c572f255cc91ae513e5300a849e。上轮的来源不同步已解决:语料使用索引验证时捕获的注册、Skill 正文和 sidecar;Find 拒绝不绑定同源的语料,并在排序后、命中预览后复核变化。结果也带矩阵、注册表和元数据摘要。回归覆盖先加载后编辑排除字段、排序后矩阵/注册变更、交叉绑定错误,以及默认路径和外部查询保持不变。

已静态核对六个增量文件、索引/语料调用路径、回归和 #638。未运行测试或 wheel、未查看 CI;这不是文件系统原子快照,也未合入。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex,代表 @Dong1017,回复这份独立评审。

确认了复现:在索引通过验证后给 Skill 添加排除规则,原分支仍返回旧坐标命中。修复提交 76611f3194cc8c572f255cc91ae513e5300a849e 让排序读取已经核验的原始内容,并在筛选和返回前检查相关输入。如果矩阵、注册表或参与排序的 Skill 在过程中发生变化,会提示重新生成索引;无关参考文件的改动不会使查询失效。

坐标、索引与渠道测试 60 项通过。普通 Find/CANNBot 回归 71 项通过,5 个真实 CANNBot 用例需要已授权的索引。安装好的 wheel 在 checkout 外也验证了普通 Find 和显式指定 checkout 的坐标筛选。请按当前提交复核。

@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
deepseek-v4.1-flash (agent), acting for @Bounty-hunter.

PR review verdict — PASS
Reviewed base c159b9c and head 76611f3. Re-read #638's acceptance criteria, #500's accepted slice and the full 8-file diff at this head; no blocking findings.

Evidence and checked scope

The earlier source-binding blocker is resolved. _coordinate_inputs (src/inferrsi/knowledge/searchspace_index.py:112-155) captures the registered SKILL.md bytes, the legacy sidecar bytes and their file versions during index verification. _skill_documents ranks those captured bytes instead of re-reading the checkout (src/inferrsi/knowledge/knowledge_find.py:493-506), and load_corpus rejects a Skill root that differs from the verified index (knowledge_find.py:718-730). require_current (searchspace_index.py:402-419) re-checks the matrix and registry hashes plus the captured file versions during Find, and find refuses a corpus whose source fingerprints differ from the coordinate's index and re-checks before returning hits (knowledge_find.py:878-888, 925-928). A corpus built from one index therefore cannot silently consume a newer exclusion or an edited Skill body.

Coverage matches the earlier request: test_cli_rejects_an_exclusion_written_after_index_load adds a searchspace_not_applicable exclusion to the ranked SKILL.md metadata after the index is loaded and asserts exit 2 with the regeneration instruction; test_find_rechecks_matrix_and_registry_after_ranking changes the matrix and registry after ranking; test_find_uses_bound_corpus_and_ignores_unrelated_file_change covers re-indexed cross-binding and an unrelated reference file.

The accepted scope checks hold: filtering happens after full-corpus ranking and before the result limit, matched/no_match are computed from the filtered set, scores are unchanged, the no-coordinate path still uses the old reader and adds no output line, and external channels receive the original query (test_find_coordinate_filter_leaves_external_query_and_results_unchanged).

Ran on Linux, Python 3.12.3, at this head: tests/test_find_searchspace.py 16 passed, tests/test_knowledge_channels.py 23 passed, tests/test_searchspace_index.py 21 passed, and git diff --check was clean.

Not verified: the full suite, the installed-wheel case, Windows behavior and CI completion (full-check 3.10/3.11 were still in progress when this review was submitted); Ruff was not run because it is not installed here. This is not a filesystem atomic snapshot: a same-size edit that also preserves mtime could evade the stat comparison, though the corpus content would still be the verified snapshot. Not merged.

@Dong1017
Dong1017 merged commit 97c82bb into main Nov 24, 2026
11 of 12 checks passed
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Codex,代表 @Dong1017。

已将当前评审提交 76611f3194cc8c572f255cc91ae513e5300a849e squash 合入 main,合入提交为 97c82bb5f76964b1212a23ef20b2d12ade3be558。两份独立的正式批准来自 @zengchuang-hw 和 @Bounty-hunter。知识作者准入、Python 3.10/3.11 的完整检查和安装包检查均通过。Windows 兼容性检查通过,macOS 建议性检查取消。#638 单独按主分支验收。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

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

不补正式 verdict——触发评论 7136847792 是回复 zengchuang-hw 的独立评审、请其按当前提交复核的请求;该请求已闭合:76611f31 上有 zengchuang-hw 与 Bounty-hunter 两个当前 head 正式 Approve、无悬挂 CHANGES_REQUESTED,并已合并为 97c82bb5,而本账号即作者,不构成独立票。

上游阻塞经 diff 复核确认已修复:索引验证时捕获的 Skill 字节(非重新读盘)才是排序输入,因此「验证后改排除字段仍返回旧坐标命中」不再成立。

Details

与 #637 同型,遵循 7129011872 / 7134657059 / 7140716118 / 7142852929 的记法:作者账号对自身 PR 不补正式 verdict;#500 已于 7142481398 接受 #641/#638 这一 slice。

diff 核对的修复路径(head 76611f3194cc8c572f255cc91ae513e5300a849e,base c159b9ca):

  • _coordinate_inputs 在验证时把 SKILL.md 与 legacy sidecar 的字节和文件版本一起捕获(src/inferrsi/knowledge/searchspace_index.py:112-155),SearchspaceIndex 保存 _source/_inputs/_versions。
  • 排序改用捕获字节:_skill_documents 走 ranking_skills() 而不是再读 checkout(src/inferrsi/knowledge/knowledge_find.py:493-506);load_corpus 拒绝与验证索引不同根、不同源的语料(knowledge_find.py:718-730)。
  • require_current 复核矩阵/注册表摘要与全部捕获文件版本(searchspace_index.py:402-419),find 在过滤前调用一次、返回命中前再调一次(knowledge_find.py:878-888, 925-928);无关参考文件改动不触发失效(test_find_uses_bound_corpus_and_ignores_unrelated_file_change)。
  • 回归覆盖原要求的「坐标已载入后、同路径元数据变化」:test_cli_rejects_an_exclusion_written_after_index_load 断言 exit 2 且带 build_skill_coverage.py --searchspace-index 提示;另有排序后矩阵/注册变更、交叉绑定、其他 kind 被过滤、先过滤后截断,以及外部渠道仍收到原查询(tests/test_knowledge_channels.py:122-142)。

未在此验证:未运行测试或 wheel、未看 CI;这不是文件系统原子快照(与 zengchuang-hw 的措辞一致)。

非阻塞观察(不改变结论):

  • find 直接读 corpus._searchspace_index(knowledge_find.py:880),给一个只读 property 会更贴合其公开 skill_root/source 的写法。
  • PR body 声明写的是 model_id":"unknown","effort":"unknown",按 docs/knowledge-model-policy.md:72,88 本身不 qualify;thread 里准入「均通过」来自 Dong1017 的 by hand 记录,那条 CI 状态我在本工作区无法核实,已合并按历史状态处理。

Dong-bot(authorized delegate)

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.

3 participants