Skip to content

task: R01 — retire legacy root paths and close core dependencies #412

Open

Description

@Dong1017

Current delivery decision (2026-11-15)

Split legacy-path retirement and actual dependency closure into three bounded implementation PRs. Retire already-migrated old paths early instead of keeping every shell until the last integration change. Moving implementation, migrating active consumers/docs/tests and deleting old root modules belong in the same PR. Overall isolation is a real-tree result, not an issue-status or merge inference. This issue closes root-level scattering, old entrypoints and core dependency boundaries; it does not promise internal refactors of existing subpackages.

Related: #387, #371, Apps migration #408, shared contracts/resources #451, and Apps-only MindIE relocation #452.

PR checklist

  • R1 — Retire existing legacy root paths and finish canonical inspection binding. Delete the seven Knowledge shells (_skill_selection, _source_snapshot, catalog, knowledge_operations, knowledge_store, research, skill_catalog), the three B01 root paths (evaluation, execution, reporting), and root inspection. In this same PR update all active consumers, including the CLI/arguments if they have not moved yet, tools/current tests/docs, the manifest and affected protected-path rules. Root inspection is not a trivial alias: first preserve its command/snapshot/repository-identity binding in the canonical Apps composition at apps/inspection.py over the existing infra facts API. Do not delete behavior or injection assertions. Maintain the shrinking exact root-file inventory introduced in C1. If R1 is scheduled earlier, record its removals so that C1 initializes the guard from the real tree; R1 does not need a second root guard. When catalog is retired, consumers take REPO_TYPES from resources.repository_packs as the same object (identity assertion), never a copy. Record the exact remaining compatibility pairs at each step: the eight root-shell pairs disappear with the seven shells, and the neutral-leaf importer (infra.inspection -> resources.repository_packs after C2) must be covered by a permanent rule outside compatibility_pairs, with a negative test that only that exact edge is allowed. Leaving it in compatibility_pairs keeps allowlist: 1 in first_wave_report() and makes the final blockers == () unreachable.
  • R2 — Close artifact-primitive dependencies in six Harness modules. Remove the infra.artifacts reachability from agent_sessions, candidates, optimization, optimization_session, project and task_protocol, using equivalent Harness-owned primitives or explicit suitable ports. Preserve writer/digest/hash/lock bytes, atomicity, failure and platform semantics. The existing report has 12 path hits from these six modules, not 12 modules: each module carries both the package-level inferrsi.infra edge and the inferrsi.infra.artifacts edge, so removing both is the completion bar; replacing them with imports of other inferrsi.infra modules does not count. The same PR also verifies that Harness has no inferrsi.model edge (the current tree has none); the final gate counts both inferrsi.infra and inferrsi.model.
  • R3 — Close five real execution boundaries and prove the combined tree. Handle harness/task_protocol.py, the moe-forward-npu benchmark/grader, qwen21-denoise-npu benchmark and qwen3-tts-npu benchmark through legitimate bounded execution/host interfaces. Preserve candidate/sandbox/integrity controls and frozen input semantics. This PR contains real boundary fixes and final integration acceptance; do not create a ninth verification-only PR.

Dependencies and merge discipline

R1 has no hard prerequisite on C1/C2 (#451) or A1 (#408): deleting existing legacy paths does not itself require relocating a neutral resource leaf first. Prefer C1 → C2 → R1 in the serial queue to avoid rewriting contract/resource policy twice; do not wait for A1/A2/M1 to retire the existing eleven paths. C2 does require the contracts package delivered by C1. Start the shrinking root-file inventory guard in C1, then update its exact set here and in every removal PR. The final two-file target is checked only after the actual remaining moves.

R2 is logically independent and may be scheduled earlier if useful, but only one Claude implementation session runs at once. R2 and R3 both touch task_protocol; R3 must integrate R2's actual head. R3 implementation planning can start earlier, but its final integration/tested head must contain all accepted C/A/M/R predecessor changes. Do not represent a planned DAG as authorization for parallel coding sessions.

Acceptance

  • R1 really removes the eleven paths, updates all active consumers in that PR and cleans the corresponding compatibility entries, recording the allowlist count at each step and which PR removes the last pair. Canonical injection behavior remains covered; frozen historical evidence bytes are not edited.
  • R2 eliminates the six modules' infra/model reachability with positive/negative and platform-sensitive checks, covering both the package-level inferrsi.infra and inferrsi.infra.artifacts edges, not a permanent allowance for Harness-to-infra imports, and keeping Harness -> model at zero.
  • R3 resolves the actual five reviewed execution-loader boundaries. Do not merely remove declarations, relax scanners or change expected output to manufacture isolation.
  • On the final exact tree: first_wave_report().blockers == (), new_core_closure_isolated is True, and isolation_complete is True. Harness has zero edges into inferrsi.infra or inferrsi.model; the permanent neutral-leaf importer rule from R1 is part of this gate and is not counted as a compatibility pair. Negative controls reject old core paths, hidden dynamic imports and temporary forwarding.
  • The tracked root-file set is exactly {__init__.py, __main__.py}; wheel checks separately allow only the declared generated _version.py metadata. Installed-wheel/resources/host and Windows/Linux checks pass without changing original byte/fact/security contracts.
  • Record all retired paths and replacements in CHANGELOG. Root physical cleanliness and dependency isolation are both required; neither substitutes for the other.

Delivery discipline

  • One implementation Claude session handles only the current PR in an isolated worktree. A second Claude session may only plan the next PR in a separate planning worktree; it must not edit source.
  • Move implementation, update all active consumers/docs/tests, and delete the corresponding old root modules in the same PR. Do not introduce permanent compatibility shells or module-registry aliases.
  • Preserve CLI command behavior, original evidence bytes, record/format contracts and isolation/security checks. Announce retired Python import/serialization module paths; historical frozen evidence remains pinned to its original commit or wheel, not rewritten.
  • Before each implementation or review handoff, refresh main and confirmed dependencies. A completed plan is not implementation or approval. No automatic merge.

Historical context retained

The 2026-11-12 R01 scope already required retirement of seven Knowledge shells, three B01 root forwarders, the legacy manifest/allowlist and affected protected roots; installed-wheel/host checks and real positive/negative closure remained mandatory. Its final dependency list included K01/H02/B01/S01/OBS/A-entry, with no mandatory tag wait. The earlier permanent root CLI-forwarder carve-out and the assumption that every retirement must wait for the final PR are superseded by the owner's revised delivery decision. The neutral resource leaf still requires an explicitly reviewed no-core-import rule at its new canonical location; infra must not become a fourth core. No new product feature, K02 resource re-migration or formal replay/model experiment is included. Earlier issue discussion is retained; this update does not claim any new review or implementation acceptance.

Activity

  1. added
    kind:taskBounded delivery task with a delegated slice
    area:processRepo-wide process, governance, privacy and security rules
    on Nov 12, 2026
  2. amy-why-3459 commented on Nov 12, 2026

    @amy-why-3459
    Collaborator

    谢谢,R01 作为收尾任务,验收设计得很好:"真实树 isolation_complete is True"加上"加回旧叶子或转发即失败"的反例。补充几点:

    1. "兼容期结束证据"请给出可检查的定义。 例如在合入前用 rg/import 扫描证明 src、tools、tests、docs 以及三个宿主插件里都没有旧根路径的引用;外部消费者的情况也请在 PR 里说明。正文说"不额外等待固定 tag 周期",那么 CHANGELOG 里"移除路径 → 替代路径"的对照表就是用户唯一的迁移指引,建议逐条列出。
    2. 两条永久规则(infra.inspection → _repo_pack_data 技术叶子消费者,以及根 cli/arguments/__main__ 精确转发)建议在门禁里各写一个反例测试,证明规则只放行这一条边或这一种形态,不会变成通配。
    3. 前置顺序。 R01 依赖 K01、H02、B01、S01、OBS、A-entry,其中 A-entry、OBS、S01、B01 都还依赖 Publish standardized Apps run output #397 合入和 task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 接受(task: Apps 应用层详细设计与迁移计划(CLI / Python / Plugin) #371 目前仍是 status:proposed)。建议在 rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387 或本 issue 里维护一张依赖状态表,让 R01 的启动条件一目了然。
  3. changed the title [-]task: R01 — 退役兼容壳与 allowlist,完成整仓隔离[/-] [+]task: R01 — retire legacy root paths and close core dependencies[/+] on Nov 15, 2026
  4. amy-why-3459 commented on Nov 15, 2026

    @amy-why-3459
    Collaborator

    看到正文改成了 R1/R2/R3 三个 PR 的拆分。我在当前 main(1373ef8e)上跑了 first_wave_report(),和新写的内容逐项对照如下:

    1. blockers 共 4 项,能和新拆分对上。 分别是 allowlist: 9 compatibility pairs、legacy run forwarders: 3(对应 R1 的 evaluation / execution / reporting)、harness reaches model/infra ... (12 hits)(对应 R2)、runtime resource loaders: 5(对应 R3)。R1 删除 11 个路径,但 allowlist 只有 9 对。建议在 R1 验收里写明 R1 之后 allowlist 应清空,或者列出剩下的确切几对及其负责 PR。
    2. R2 的 12 处命中。 实际是 6 个模块各有两条边:inferrsi.infra 和 inferrsi.infra.artifacts。这和正文"12 path hits from these six modules"一致。所以 R2 必须连包级的 inferrsi.infra 边一起消除,改成 import infra 下的其他模块不算完成。另外,汇总字符串只显示第一个模块(agent_sessions -> inferrsi.infra (12 hits)),review 时建议看 harness_model_infra 的完整列表。
    3. R1 删除 catalog 会影响 REPO_TYPES。 arguments.py 现在从 .catalog 导入 BACKENDS / KNOWLEDGE_REPOS / KNOWLEDGE_SCOPES / REPO_TYPES,而 REPO_TYPES 实际定义在 _repo_pack_data.py。如果按首选顺序在 C2 之后做 R1,消费者应直接从 resources.repository_packs 取 REPO_TYPES,保持同一个对象(和我在 task: consolidate shared contracts and packaged-resource access #451 提的 identity 检查一致)。如果 R1 提前,也不要在 Knowledge 的 canonical 模块里复制一份元组。
    4. 我上次提的两条永久规则:根 CLI 转发这条已被新决定取消,不再需要。infra.inspection → _repo_pack_data 这条在 C2 后要迁到新位置。建议在 C2 或 R1 里配一个反例测试,证明它只放行这一条边。
  5. Dong1017 commented on Nov 15, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017 (incremental review only; points already raised by Amy are not repeated).

    Ran first_wave_report() on current main d32eb968; the four blockers match Amy's numbers exactly. Two additions to her 6892341854 point 1:

    1. Exact mapping of the 9 compatibility_pairs. Eight are removed by R1 because they are edges from the seven root shells being deleted: _skill_selection -> knowledge._skill_selection, _source_snapshot -> knowledge._source_snapshot, catalog -> knowledge.catalog, catalog -> _repo_pack_data, knowledge_operations -> knowledge.knowledge_operations, knowledge_store -> knowledge.knowledge_store, research -> knowledge.research, skill_catalog -> knowledge.skill_catalog. The ninth, infra.inspection -> _repo_pack_data, is not a root-file edge: src/inferrsi/infra/inspection.py:10 imports the neutral leaf and :56 calls it. Even if C2 rewrites that pair to the new resources.repository_packs location first, R1 would leave allowlist: 1 compatibility pair, not zero. (The three legacy run forwarders are a separate blocker and are cleared by R1; they are not among the nine pairs.)

    2. That last pair cannot stay in compatibility_pairs if R3's acceptance is blockers == (): tests/_gate_policy_support.py:553-554 counts every manifest pair as allowlist: N, and removing the pair while the import remains produces violations: 1 — inferrsi.infra.inspection is a second importer of inferrsi._repo_pack_data (tests/_gate_policy_support.py:489-494; reproduced by calling first_wave_report() with only that pair removed). So reaching the final zero also needs a permanent neutral-leaf importer rule outside the compatibility allowlist (with the negative test Amy asked for), or an equivalent gate change; the acceptance text should name that mechanism, otherwise R1 leaves one blocker that no code deletion in the checklist can remove.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:processRepo-wide process, governance, privacy and security ruleskind:taskBounded delivery task with a delegated slice

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions