Skip to content

task: retire the infra/ and model/ packages into their owning modules #498

Open

Description

@Dong1017

Goal

Retire src/inferrsi/infra/ and src/inferrsi/model/. After this work, the package root holds only the four cores (knowledge, harness, benchmark, apps), the two technical leaves (contracts, resources) and the two root files __init__.py and __main__.py.

Today both packages are documented as technical seams, "not a fourth core" (docs/module-layout.md, ownership table). #387 planned only one part of their exit: moving model/validators/ into benchmark/validators/. The other modules have no owner and no exit plan. This issue gives each module an owner and tracks the moves to completion.

Current state (main 76ca44a8b77553b2cb7f08b9f861399a72736fe2)

first_wave_report() reports harness_model_infra == (): no Harness module reaches either package. The users listed below come from a static import scan of src/, tests/ and tools/.

Module Public names Users in src/ Proposed owner
infra/artifacts.py file_lock, digest, sha256, write_json, atomic_write_json apps/delivery/ (3 files), benchmark/tasks/moe-forward-npu/benchmark.py, model/validators/ (2), infra/campaign.py; also 9 tools One copy per owner, as R2 did for Harness (harness/artifact_primitives.py, harness/atomic_json.py): an Apps copy under apps/storage/ and a Benchmark copy. Each tool imports the owner it serves.
infra/campaign.py re-export facade, helper_hashes none (examples/qwen21_turbo_b300.py only) Delete; the examples import the owners directly
infra/commands.py probe_command apps/inspection.py, infra/inspection.py Apps host bindings, in a new apps/host/
infra/inspection.py inspect_environment apps/inspection.py apps/host/. apps/inspection.py stays the public entry (#490). The permanent neutral-leaf importer rule (infra.inspection → resources.repository_packs) moves to the new module. This is a gate change and needs review.
infra/platforms/ inspect_device, PLATFORM_PROBES, qualify_devices infra/inspection.py apps/host/: every user is host inspection or a campaign script
infra/targets/ repository_identity, source_snapshot apps/inspection.py, apps/legacy/run.py, infra/campaign.py, infra/inspection.py apps/host/: every user is in Apps. Harness already takes the source snapshot as an injected value (apps/legacy/ supplies it).
infra/environment.py storage_locations, dependency_versions, semantic_dependency_versions infra/campaign.py apps/host/: campaign host facts and output locations
infra/processes.py launch_server, stop_server infra/campaign.py harness/serving/server.py: starting and stopping a supervised serving process is execution
infra/http.py post_json model/protocols/image.py harness/serving/http.py, with its only user
model/protocols/metrics.py validate_metric, read_metric benchmark/legacy_run_v0.py, the MoE task bundle Benchmark
model/protocols/image.py ImageProtocol none (one example, one test) harness/serving/image.py: the request client sent to a running server
model/validators/flare.py, model/validators/image.py adapt, validate_pair, main; ImageQualityGate, compare_images none benchmark/validators/, as planned in #387
model/anthropic_agent.py, model/anthropic_edit_agent.py, model/request_guard.py provider adapter, bounded edit protocol, request authorization broker each other only; 4 tools apps/integrations/anthropic/: an external provider with its own request authorization, which matches the #490 definition of integrations

Other places that name the two packages:

  • .github/workflows/ci-merge.yml asserts test -d src/inferrsi/model and test -d src/inferrsi/infra.
  • tests/test_module_boundaries.py checks per-plane import rules for infra and model.
  • docs/architecture.md describes Model and Infra planes. docs/flare-qualification.md and docs/operations.md document python -m inferrsi.model.validators.flare. docs/local-skill-evaluation.md imports inferrsi.infra.artifacts.
  • examples/qwen21_turbo_b300.py and examples/qwen21_turbo_quality.py import both packages.
  • Files under evidence/ name the old paths. They are historical records and stay unchanged.

Compatibility

  • No forwarding shells or module aliases, as in R1 (task: R01 — retire legacy root paths and close core dependencies #412). CHANGELOG announces each retired import path and its replacement.
  • The flare CLI path changes from python -m inferrsi.model.validators.flare to python -m inferrsi.benchmark.validators.flare. The arguments, outputs and exit codes (0 validated, 2 rejected) stay the same. The old path fails with ModuleNotFoundError. CHANGELOG and both docs give the new command.
  • New flare receipts change. The receipt's adapter field records the digests of flare.py and artifacts.py. Receipts made after the move keep the same schema and key names, but the digests are those of the new files. The adapter reads packets, not earlier receipts, so no verifier recomputes the old digests. The repository stores no flare receipt: only tests generate them. Evidence elsewhere stays pinned to its original commit.
  • Pinned source references stay. Three files of the inference-benchmark-design Knowledge skill cite src/inferrsi/model/protocols/metrics.py at commit b3ef95a. They keep that spelling, as the K02 move kept pinned source_files.
  • Pickles break. Pickled objects that name an old module path no longer load, as with the R1 retirements.

Slices

Each slice moves code without behavior changes, moves its tests with it, and updates every consumer in the same PR. A module that loses its last consumer in src/ stays until its slice deletes it, so infra/artifacts.py stays until slice 5.

Before a slice's PR opens, the slice owner confirms its placement in a comment here. Dong1017 confirms slices 1, 2 and 5. Slices 3 and 4 were to be confirmed by zengchuang-hw as the Apps owner (#371, #490); the issue owner confirmed them in issuecomment-7002457678.

Each slice runs this checklist:

  • Search for every reference, not only static imports: python -m strings, importlib calls, pyproject.toml entry points and package data, wheel contents, .github/ scripts, and schema or receipt fields that record a module path.
  • Add a gate negative control so that an import of each retired path fails even when its file is absent. Add the matching find_spec(...) is None check to tests/check_installed.py for the installed wheel.
  • Add a CHANGELOG line and update docs/module-layout.md and docs/architecture.md.
  1. Benchmark (confirmed, in progress).

    • Moves:
      • model/protocols/metrics.py → benchmark/metrics.py.
      • model/validators/{flare,image}.py → benchmark/validators/.
      • New benchmark/artifacts.py holds the Benchmark copy of sha256, write_json and atomic_write_json. The bytes match infra/artifacts.py.
    • Consumers updated: benchmark/legacy_run_v0.py and the MoE bundle's benchmark.py switch to these modules. Each MoE evaluate call prepares its own copy of the task files and launches that copy (runpy on the copied benchmark.py) in the same call. A new run therefore binds the new bytes, and no directory prepared before the move is launched again. No tool's literal controller-file inventory names a slice-1 file.
    • Drift guard: a parity test requires every copy of each helper to have the same function source and to write the same bytes. The copies are in infra/artifacts.py, harness/artifact_primitives.py, harness/atomic_json.py, benchmark/artifacts.py, and later the Apps copy. R2 did this for Harness in test_harness_artifact_primitives_match_infra_bytes_and_semantics. The test compares whatever copies exist, so it keeps working after slice 5 deletes infra/.
    • Flare tests: the new CLI keeps arguments, outputs and exit codes. The old path fails in the checkout and in the installed wheel. A new receipt binds the new files.
    • Unchanged: the three Knowledge files pinned at b3ef95a. They are protected by knowledge-model-policy.
    • Session identity: _runtime_identity() names no slice-1 file, so optimization sessions are not affected.
  2. Harness serving (placement confirmed).

    • Decision: the three modules stay library code (owner decision, 2026-11-19). Their only users in src/ are the campaign.py facade or nothing, but an example campaign and their own tests use them, and starting a server and sending it requests is a capability this project needs.
    • Moves: they go to a new harness/serving/ package, whose initializer imports nothing:
      • infra/processes.py → harness/serving/server.py;
      • infra/http.py → harness/serving/http.py;
      • model/protocols/image.py → harness/serving/image.py.
    • Why not harness/scenarios/: that package now holds only external.py, the trial execution for an external command, so its name does not describe these modules.
    • Before the PR opens: confirm that network I/O inside Harness is consistent with the Harness boundary, and that first_wave_report() still holds.
    • Runtime identity: harness/optimization_session.py::_runtime_identity() hashes infra/processes.py by file path. The PR replaces that entry with the canonical file in the same change.
    • Old sessions: session_command compares the whole runtime map before status or recover, so a session planned before the move fails closed on the new wheel, by design. The PR keeps that behavior and the old plan bytes, and documents how to recover such a session with the pinned pre-move runtime.
    • Tests (also raised for apps/campaign.py on task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490):
      • The inventory binds the implementation the session actually runs, not a shim or an identically named file.
      • A genuine pre-move plan fixture keeps its original map and bytes. Under the new installed wheel, it is rejected before status or recover dispatches, and the plan is not modified.
      • Under the pinned pre-move runtime, the same plan recovers from its receipts with its retained inputs. Compatibility is not shown by rewriting the old map, copying a new digest into it, or bypassing the identity guard.
      • A newly started plan records the canonical file keys and hashes from the installed package. A negative case shows that changed canonical bytes are detected. An import-only smoke test or a changed path string is not enough.
  3. Apps host, in two PRs (owner decision issuecomment-7002457678): 3c and 3a ship together, because 3a cannot stand alone while infra/campaign.py re-exports environment and targets, and Infra may not import Apps; 3b follows.

    • 3a: infra/commands.py, infra/inspection.py, infra/platforms/, infra/targets/ and infra/environment.py go to apps/host/. The same PR replaces the one neutral-leaf importer inferrsi.infra.inspection with the apps/host/ module in the source, LEAF_IMPORTERS, docs/legacy-knowledge-manifest.json and the negative controls. There is no apps.* wildcard and no window with two admitted importers. Historical revision records and leaf hashes stay. The policy change needs architecture review on its own.
    • 3b: add the Apps copy of the artifact helpers and move the apps/delivery/ files and the tools onto it. List each tool with the owner it imports, and cover its literal controller-file inventories as well as its imports. Add an installed-wheel regression for the shared .session.lock on Windows and POSIX: a Harness process holds the lock, an Apps progress export in another process cannot read a snapshot while it is held, and it succeeds after release. The bug(apps): Windows busy delivery lock escapes as PermissionError #494 exception mapping stays a separate assertion.
    • 3c: delete infra/campaign.py, choose where helper_hashes goes or record that it is dropped, and migrate the examples. helper_hashes inventories every package Python file, so its disposition changes the path set that new records bind. The PR states that change explicitly.
  4. Providers: the three model/ provider modules go to apps/integrations/anthropic/, and the tools follow. It does not wait for task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490 (owner decision issuecomment-7002457678); task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490's target tree adds apps/host/ and apps/integrations/anthropic/ when it next changes. request_guard.py is an authorization broker, so its logic must not change. The PR may change only two things:

    • its import lines;
    • the live source locators: the path-valued SOURCE in request_guard.py and in anthropic_agent.py, and the controller inventories in tools/skill_eval_compare.py that hash them.

    New controller identities bind the new files. Historical frozen records are not rewritten. The Messages worker loads the adjacent request_guard.py with runpy.run_path under python -I. The new placement keeps that adjacent-file loading and the frozen guard digest, in the checkout and in the wheel. An offline test covers this path with no provider call. An import-only smoke test would miss it.

  5. Retire: delete both directories and update CI (ci-merge.yml) and tests/test_module_boundaries.py. _runtime_identity() also hashes infra/artifacts.py. That entry is replaced by the copies that the session code actually runs, with the same fail-closed recovery note and fixture as in slice 2. Add a package-directory guard that allows exactly apps, benchmark, contracts, harness, knowledge and resources. Its negative cases are a reintroduced infra/ or model/, a new sibling package, and an old import whose target is absent. It keeps the distinction between tracked source and generated wheel metadata such as _version.py.

Slices 1, 2, 3 and 4 are independent of each other. Slice 5 comes last.

Acceptance

  • Each slice's placement is confirmed in a comment here before its PR opens (slices 3 and 4: issuecomment-7002457678). apps/host/ and apps/integrations/anthropic/ are recorded in task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490's Apps target tree when it next changes.
  • src/inferrsi/ contains exactly the directories apps, benchmark, contracts, harness, knowledge and resources, plus the tracked root files __init__.py and __main__.py. A package-directory guard enforces this.
  • No module named inferrsi.infra* or inferrsi.model* exists or is imported, in the checkout or the installed wheel. The gate fails if one returns.
  • first_wave_report() still gives violations == (), blockers == () and isolation_complete is True. The neutral-leaf importer rule names exactly one new importer, with a negative test.
  • Installed-wheel, host-compatibility and full-check jobs pass. CLI arguments, outputs and exit codes, record formats and original evidence bytes are unchanged, apart from the declared exceptions above: the flare CLI path, and the adapter digests in new flare receipts.
  • CHANGELOG lists every retired path and its replacement.

Out of scope

  • Behavior changes, new features, or splitting functions beyond the moves above.
  • Rewriting evidence/ or other frozen records.
  • Renaming directories whose names no longer match their contents, for example harness/scenarios/, which holds only trial execution. harness/scenarios/external.py is in _runtime_identity(), so such a rename rejects sessions planned before it. A separate follow-up issue covers directory names once this issue and task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490 have settled the tree.

Related: #387 (closed by its final-scheme comment, which links here), #412, #490, #371.

Activity

  1. Dong1017 commented on Nov 18, 2026

    @Dong1017
    CollaboratorAuthor

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

    Assessment: The plan is sound and well scoped. Every module gets an owner, there are no forwarding shells, the slices are mostly independent, and each slice has a behavior-neutral acceptance bar. I checked it only for internal consistency. I did not re-run the import scan or check the table against 76ca44a8. Several gaps should be closed before slices 2–4 start.

    Gaps and risks

    1. Slice 2 may move dead code.

      • infra/processes.py (launch_server, stop_server) and infra/environment.py have infra/campaign.py as their only user in src/.
      • Slice 3 deletes campaign.py. After that, the only callers are the examples, and perhaps tools.
      • Please state whether these modules are still wanted as library code in Harness and apps/host/, or whether the scripts and examples should own them.
      • If they stay, say why they sit in src/ with no in-tree user. The same question applies to ImageProtocol, which has no users in src/, only one example and one test.
      • Also confirm that helper_hashes, the only non-facade name in campaign.py, has a destination. The table says "Delete" but doesn't name one.
    2. The artifact-helper split is under-specified.

      • "One copy per owner" leaves two copies of file_lock, digest, sha256 and the JSON writers. The 9 tools and the apps/delivery/ files are not mapped to an owner individually.
      • List the 9 tools and the owner each one imports. Say whether tools/ is allowed to import Apps or Benchmark under the current gate.
      • Add a drift guard. A parity test would be enough, or a statement that the copies are allowed to diverge. R2 did this for Harness, so cite how it handled drift.
      • Slice 1 creates the Benchmark copy while infra/artifacts.py still exists. The issue should say that infra/artifacts.py stays until slice 5, or until its last consumer moves, so slices 1 and 3 really are independent.
    3. Slice 4 is not independent. It is described as independent but "coordinated with task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490's integrations step". Either mark it as blocked on task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490 recording apps/integrations/anthropic/, or give it a fallback. request_guard.py is an authorization broker, so the review for that move should explicitly confirm that there is no behavior diff, for example a byte-identical move apart from imports.

    4. Slice 3 is too large for one PR. It covers five modules, a gate change, apps/delivery/, the tools, the campaign deletion and the example migration. I suggest splitting it as follows:

      • 3a: move to apps/host/ together with the neutral-leaf rule change and its negative test.
      • 3b: the Apps artifact copy plus the delivery and tool consumers.
      • 3c: delete campaign.py and migrate the examples.

      That keeps the gate change reviewable on its own.

    5. Neutral-leaf rule. Acceptance says the rule "names exactly one new importer, with a negative test". Spell out the old and new entries, infra.inspection → resources.repository_packs becoming the apps/host/ module. Also say whether the old entry is removed in the same PR, so there is never a window with two allowed importers.

    6. The static import scan can miss references. Add a string and config grep to the pre-slice checklist. It should cover:

      • python -m strings.
      • importlib and dynamic imports.
      • pyproject.toml entry points and package data.
      • Wheel and manifest contents, since installed-wheel is an acceptance job.
      • Schema or receipt fields that record module names.
      • Scripts under .github/, not just ci-merge.yml.
    7. Flare receipt change.

      • New receipts record the new flare.py and artifacts.py digests. Confirm that no verifier recomputes or pins digests of old file paths when it reads existing receipts. If one does, the compatibility claim of "existing receipts stay pinned" needs a test.
      • The new CLI path should be written out in the issue, for example python -m inferrsi.benchmark.validators.flare, so the CHANGELOG and docs have one agreed string.
    8. Slice 2 and Harness isolation. infra/http.py (post_json, network I/O) moves into Harness. Confirm that the Harness boundary and first_wave_report() rules permit this. harness_model_infra == () is true today, and adding network code to Harness could change the isolation story.

    9. The first acceptance item has no named confirmer. "Placements confirmed or revised in this issue" needs an owner per slice. Suggest listing the Benchmark, Harness, Apps and task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490 owners and recording each confirmation as a comment before its slice starts.

    Suggested next steps

    • Edit the body to resolve items 1–3 and 7, since they affect placement. Then record per-slice owner confirmations.
    • Start with slice 1. It is the smallest, it was already planned in rfc: K/H/B 与 Apps 公开接口详细设计(最小交接与模块边界) #387, and it has no dependency on the open questions above.
    • Add a per-slice checklist: consumers updated, tests moved, CHANGELOG line, boundary-test update, and gate-negative test where relevant.

    There is no explicit ask to Dong1017 in the body, so this is triage only. (Dong-bot, authorized delegate.)

  2. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    Contributor

    Independent scope/acceptance review

    Acting under zengchuang-hw's standing authorization to review other-author Issues. Inspected the original Goal/Compatibility/Proposed slices/Acceptance sections and actual main 76ca44a8b77553b2cb7f08b9f861399a72736fe2; did not use discussion reviews as requirements. This is proposal feedback, not authorization to start slices or confirmation that retirement has happened.

    The owner-based direction is coherent, but three concrete acceptance details should be made explicit before implementation:

    1. The existing root-file guard does not enforce the proposed exact directory set. test_package_root_inventory.py checks root files (path.is_file() / Git root-file listing), not the six permitted subdirectories. It can remain green while an extra package directory exists. Add a separate package-directory inventory/retired-prefix guard with negative cases for reintroduced infra/, model/, a new sibling package, and an old import even when its target is absent. Retain the documented distinction between tracked source and generated wheel metadata such as _version.py; “exactly eight entries” should not accidentally reject supported build output.

    2. The Apps-host leaf move is a coordinated policy migration, not merely an import edit. infra/inspection.py directly imports repository_pack; both LEAF_IMPORTERS and the manifest currently pin the exact old importer, symbol and import-line shape. Slice 3 should replace that one current importer with the agreed Apps-host owner in the source, gate, manifest and negative controls together, preserving historical revision records and leaf hashes. Do not temporarily authorize an apps.* wildcard or leave both live importers admitted. The required architecture review of that policy change remains separate from passing tests.

    3. “CLI behavior / original bytes unchanged” needs the already-declared exceptions spelled out in the acceptance check. flare.py hashes its own file and the imported artifact-helper file into new receipts. The new import path and changed implementation bytes can change those hashes while the receipt schema remains stable. Test separately: old frozen receipts remain byte-identical; newly generated receipts bind the new implementation; the replacement CLI preserves arguments, exit codes and semantics while the old python -m path intentionally fails. Do not regenerate historical goldens merely to make a byte comparison pass. The same no-forwarder intent should be checked in an installed wheel, not only the checkout.

    Source checks also confirm that ImageProtocol.request calls infra.http.post_json, so moving the image protocol and transport together as proposed avoids manufacturing a cross-core request path. This observation is not a validation of the complete consumer closure. Slice-level evidence should include the affected callers/tests, wheel entry points and path-sensitive receipts, rather than infer completion from directory names alone.

    No code/tests, import gate, wheel build or host jobs were executed in this review. Both source packages still exist at the inspected main revision. I have not accepted placements on behalf of the owner, implemented moves, or closed this Issue.

  3. david6666666 commented on Nov 18, 2026

    @david6666666
    Collaborator

    Could slice 3 keep an installed-wheel regression for the shared .session.lock? Apps delivery is switching lock helpers, but Harness remains the writer for the same lock file. On Windows and POSIX, have a Harness process hold the lock, confirm an Apps progress export in a separate process cannot read a snapshot while it is held, then release and retry successfully. Per-copy parity tests can both pass without checking cross-process exclusion on the actual writer/reader pair. Keep #494’s exception mapping as a separate assertion.

  4. added
    kind:taskBounded delivery task with a delegated slice
    on Nov 18, 2026
  5. Dong1017 commented on Nov 18, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    The body is updated after the discussion above. What changed and why:

    • Slice 1 is confirmed and has started (owner decision, 2026-11-18). The body now lists its exact moves, consumers, drift guard, flare tests and the files that stay unchanged.
    • Flare CLI and receipts (zengchuang-hw point 3; Dong-bot point 7):
      • The new command is python -m inferrsi.benchmark.validators.flare, with the same arguments, outputs and exit codes. The old path fails, in the checkout and in the installed wheel.
      • The adapter reads packets, not earlier receipts, so no verifier recomputes the old adapter digests.
      • The repository stores no flare receipt. New receipts keep their schema and key names and bind the new files. This is listed as a declared exception in the acceptance.
    • Artifact helpers (Dong-bot point 2):
      • infra/artifacts.py stays until slice 5.
      • The drift guard compares the function source and the written bytes of every copy that exists. It extends R2's Harness parity test, so it keeps working after infra/ is gone.
    • Reference search (Dong-bot point 6): each slice also searches strings, config, wheel contents and receipt fields, and adds a gate negative control plus a tests/check_installed.py check for each retired path.
    • Slice 2 (Dong-bot points 1 and 8): before it opens, decide whether processes, image and http stay library code, since they have no live user in src/, and confirm that network I/O fits the Harness boundary.
    • Slice 3 is split into 3a, 3b and 3c (Dong-bot points 4 and 5; zengchuang-hw point 2; david6666666):
      • 3a replaces the one neutral-leaf importer in the source, LEAF_IMPORTERS, the manifest and the negative controls together, with no wildcard and no window with two importers.
      • 3b carries the cross-process .session.lock regression on Windows and POSIX, plus the per-tool owner list.
      • 3c handles campaign.py, helper_hashes and the examples.
    • Slice 4 is blocked on task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490 recording apps/integrations/anthropic/ (Dong-bot point 3). The request_guard.py move must be byte-identical apart from imports.
    • Slice 5 adds a package-directory guard (zengchuang-hw point 1). It allows exactly six directories, has negative cases for a reintroduced infra/ or model/, a new sibling and an absent old target, and keeps generated _version.py separate.
    • Confirmers (Dong-bot point 9): Dong1017 confirms slices 1, 2 and 5. zengchuang-hw confirms slices 3 and 4 as the Apps owner.
  6. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    Contributor

    Independent incremental scope review

    Follow-up to my previous review, against the revised Goal/Compatibility/Slices/Acceptance sections and actual main cf671a880ac8037e01922e1be0b701771fb9922f. This assesses the specification, not implementation completion or an Apps-owner commitment.

    The revised specification addresses the three earlier specification gaps: a separate exact-directory guard; atomic replacement of the sole neutral-leaf importer; and explicit flare CLI/new-receipt exceptions. Those are now written acceptance requirements, not verified passing tests. The old packages, old importer policy and root-file-only inventory remain in the inspected source.

    One concrete slice-4 conflict still needs resolution before implementation: request_guard.py contains SOURCE = "src/inferrsi/model/request_guard.py", which is not an import line. skill_eval_compare.py imports it as GUARD_SOURCE, includes it in CONTROLLERS, and hashes each ROOT / name when making a plan. Simply moving the guard and changing imports, while keeping every other byte identical, leaves the controller pointing at a deleted file. The slice needs an explicit decision about this live source locator: narrowly permit its relocation, or relocate the locator's ownership/caller without treating the old value as a live path. Keep authorization-broker logic unchanged; do not silently broaden “import-only” into functional edits. New controller identities must bind existing new files; historical frozen records must not be rewritten. anthropic_agent.py also has a path-valued SOURCE consumed by the planner.

    For the requested slice-3/4 source check:

    • 3a: infra/inspection.py still directly imports repository_pack; tests/_gate_policy_support.py and the manifest still admit precisely inferrsi.infra.inspection. The proposed atomic source/policy/manifest/negative-control change matches this actual dependency. Read-only subprocess probing in commands.py and host/cache/dependency inspection in environment.py support the proposed host grouping, but this is not owner acceptance.
    • 3b/3c: Apps delivery snapshot/projection currently consume Infra sha256/digest; tools also have explicit Infra helper imports and literal controller-file inventories. The per-tool map must cover those inventories, not just imports. The source of the Infra/Harness file locks has distinct Windows msvcrt and POSIX flock branches, so the specified installed-wheel, cross-process regression is materially useful and cannot be replaced by an in-process mocked test. infra/campaign.py::helper_hashes inventories all package Python files; moving/dropping it changes the binding path set for new records, so its explicit disposition remains necessary.
    • 4: the Messages worker launches via python -I and loads the adjacent trusted request_guard.py using runpy.run_path, not an ordinary installed-module import. The new placement must retain that adjacent-file/wheel behavior and frozen guard digest, with offline coverage that does not make provider calls. An import-only smoke test would miss this path.

    I have not confirmed or accepted slices 3/4 on the owner's behalf, changed #490, taken an implementation assignment, or authorized provider calls. Their recorded placement prerequisite remains separate. No repository code, tests, gate, wheel build or host jobs were executed here; no new execution evidence was established by this static review.

  7. Dong1017 commented on Nov 18, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    The body is updated for the points in the review above (issuecomment-6977604801):

    • Slice 4.
      • The path-valued SOURCE in request_guard.py and anthropic_agent.py is a live source locator, and so are the controller inventories in tools/skill_eval_compare.py that hash it. The PR may change these values and the import lines only. The authorization-broker logic stays unchanged.
      • New controller identities bind the new files. Historical frozen records are not rewritten.
      • The adjacent-file runpy.run_path loading under python -I and the frozen guard digest are kept, in the checkout and in the wheel. An offline test covers this path with no provider call.
    • Slice 3b. The per-tool map covers literal controller-file inventories, not only imports.
    • Slice 3c. The PR states explicitly how the disposition of helper_hashes changes the path set that new records bind.
    • Slice 1.
      • The MoE wording is corrected: each evaluate call prepares its own copy and launches it with runpy in the same call. No directory prepared before the move is launched again.
      • No tool's controller inventory names a slice-1 file.

    Slices 3 and 4 still wait for the Apps owner's placement confirmation. Slice 1 is in progress.

  8. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    Contributor

    Independent specification increment for clarification 6978662693, following my previous review. Source baseline remains cf671a880ac8037e01922e1be0b701771fb9922f.

    The slice-4 specification conflict is now resolved at the requirements level. The revised slice expressly permits the two path-valued SOURCE constants and their controller inventories to relocate, in addition to imports, while keeping authorization-broker logic unchanged. I re-read the actual files: request_guard.SOURCE and anthropic_agent.SOURCE still name the old model paths, and skill_eval_compare consumes GUARD_SOURCE in its hashed controller inventory. The narrowly stated exception addresses exactly that live-locator problem; it is not blanket permission for behavior changes.

    The required adjacent-file behavior also matches the real dependency: anthropic_agent loads request_guard.py via runpy.run_path(Path(file).with_name(...)) and starts its worker with python -I. An ordinary import-only check would not cover that execution path. Keep the new identity tied to the actual relocated worker/guard files and test offline checkout and installed-wheel behavior without provider calls; none of that is proven merely by the new wording.

    I also traced the slice-1 clarification in actual MoE source. evaluate calls _prepare in that invocation; _prepare creates a new output directory with exist_ok=False and copies current task bytes; the generated launcher runs that output's task/benchmark.py. This supports the stated per-invocation preparation model rather than silently launching a pre-move prepared directory. I did not execute it or establish whole-tool inventory coverage in this increment.

    The 3b literal-inventory requirement and 3c explicit helper_hashes disposition are now written requirements. Current helper_hashes still enumerates package Python files, so its relocation/deletion changes the new-record binding path set. Historical frozen records must remain unchanged.

    Status: this closes the identified import-only-versus-live-locator ambiguity, not implementation or test acceptance. Slices 3/4 still require the recorded Apps-owner placement prerequisite; I do not confirm placement, accept an implementation assignment, modify #490 or authorize any provider call on the owner's behalf. No fixing PR/run artifact was assessed here. No repository code, wheel build, tests or models were executed; no other reviewers' opinions, source edits, Issue-state changes or merges were used/performed.

  9. Dong1017 commented on Nov 18, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    The two points raised on #490 for apps/campaign.py (issuecomment-6980396082 and issuecomment-6980699040) also apply here. harness/optimization_session.py::_runtime_identity() hashes infra/processes.py and infra/artifacts.py by file path. The body now says:

    • Slice 2 replaces the infra/processes.py entry with the canonical file in the same change.
    • Slice 5 replaces the infra/artifacts.py entry with the copies that the session code actually runs.
    • In both slices: a session planned before the move still fails closed on the new wheel, the old plan bytes are kept, and the PR documents recovery with the pinned pre-move runtime. A fixture shows that the old plan resumes under the old runtime and that a new plan fingerprints the canonical file.

    Slice 1 is not affected: _runtime_identity() names none of its files, and no tool's controller inventory does either.

    The review in issuecomment-6978743994 needs no further body change.

  10. zengchuang-hw commented on Nov 18, 2026

    @zengchuang-hw
    Contributor

    Independent specification increment for 6981683780, following my previous review. I independently inspected current main cf671a880ac8037e01922e1be0b701771fb9922f; this is requirements feedback, not implementation acceptance.

    The added slice-2/5 runtime-identity and release-boundary recovery requirements address a concrete remaining migration surface. In optimization_session.py, _runtime_identity() still hashes literal infra/processes.py and infra/artifacts.py paths from the installed package. New plans retain this map. On every non-start operation, lines 207–209 compare the entire map before dispatching even status or recover. Moving or deleting a listed file without updating that inventory can therefore fail while building the identity; changing the inventory correctly should still reject a pre-move plan under the new runtime.

    Keep the acceptance split explicit:

    • Update the inventories atomically with each relevant slice, binding the implementation the session actually uses, not merely a compatibility shim or an identically named replacement. I traced the current execution entry through scenarios.external.execute_trial to harness.local_process.execute_command; the presence of an Infra path in the map alone does not establish it is the execution implementation.
    • Use a genuine pre-move plan fixture with its original map and unchanged bytes. Under the new installed wheel, assert rejection before status/recovery dispatch and no mutation of that historical plan.
    • Under the pinned pre-move runtime, demonstrate receipt-based recovery of that same plan with the matching retained inputs and runtime. Do not demonstrate compatibility by rewriting its map, copying a new digest into the old plan, or bypassing the identity guard.
    • For a newly started plan, assert the canonical file keys and hashes from the actual installed package, and a negative case showing that changed canonical implementation bytes are detected. An import-only smoke test or checking that a path string changed is insufficient.

    These requirements extend the previously reviewed live-locator exception and frozen-history protections; they do not authorize changing broker behavior or starting the slices. The recorded placement/owner prerequisite remains separate. No fixing revision or primary execution artifact was supplied in this increment, so recovery across the release boundary is still unverified.

    Actually performed: author/type/repository/comment verification, comparison with my own prior reviews, and static reading of the runtime map, plan capture, pre-dispatch guard and execution imports at the pinned main revision. No repository code, tests, wheel build, provider calls, other reviewers' opinions, source edits, Issue-state changes or merges were used/performed.

  11. Dong1017 commented on Nov 18, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    The four test requirements from issuecomment-6981764650 are now in slice 2's runtime-identity tests, and slice 5 refers to the same tests:

    • The inventory binds the implementation that actually runs.
    • A genuine pre-move plan is rejected before dispatch under the new wheel and is left unmodified.
    • The same plan recovers under the pinned pre-move runtime, without rewriting the map or bypassing the guard.
    • A new plan records the canonical keys and hashes, with a negative case for changed bytes.
  12. Dong1017 commented on Nov 19, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    Slice 2 placement is confirmed (owner decision, 2026-11-19). The body is updated.

    • infra/processes.py, infra/http.py and model/protocols/image.py stay library code. An example campaign and their own tests use them, and starting a server and sending it requests is a capability this project needs.
    • They move to a new harness/serving/ package, as server.py, http.py and image.py. Its initializer imports nothing.
    • They do not go to harness/scenarios/. That package now holds only external.py, the trial execution for an external command, so its name does not describe them.

    Renaming directories whose names no longer match their contents, starting with harness/scenarios/, is out of scope here. harness/scenarios/external.py is in _runtime_identity(), so such a rename rejects sessions planned before it. A separate follow-up issue will cover directory names once this issue and #490 have settled the tree.

    Slice 2 starts after slice 1 (#503) merges. The runtime-identity and recovery tests in the body apply to it.

  13. zengchuang-hw commented on Nov 19, 2026

    @zengchuang-hw
    Contributor

    Independent placement follow-up to 6996972802, following my runtime-identity review. Inspected source at main 965ab5cf83399a99530949b04bb934a892ee417c; this is specification feedback, not implementation acceptance or an instruction to start Slice 2 before #503 merges.

    The confirmed harness/serving/{server,http,image}.py grouping is consistent with the inspected dependencies: ImageProtocol calls the shared HTTP transport, while the server helper owns long-lived serving-worker process groups. harness/scenarios/external.py instead delegates individual trials to harness.local_process.execute_command. Keeping that rename separate avoids an unrelated runtime-identity change; the current identity map explicitly includes both infra/processes.py and harness/scenarios/external.py.

    Two concrete migration checks follow from the actual tests:

    • Preserve the existing Linux-only server ownership contract, not a new cross-platform server claim. tests/test_server_processes.py checks rejection before launch/cleanup on Windows and macOS, inaccessible procfs, and real Linux cleanup after the leader exits while preserving an unrelated process. The new package's empty initializer is important so importing HTTP/image utilities does not eagerly initialize server behavior.
    • Update the embedded subprocess import, not just top-level imports: the Linux cleanup test constructs a Python source string containing from inferrsi.infra.processes import launch_server, stop_server. An AST import migration over the test module would miss that string, and the real cleanup test is skipped off Linux. Retain both supervised/standalone cases using the new canonical server path. Also keep the actual HTTP image request test and the example's ImageProtocol caller on the new path; no provider or real-model request is needed for that local synthetic test.

    The existing runtime-identity test asserts several keys and that every listed file exists; it does not by itself prove the new server key/hash or historical-session rejection and recovery. The already specified Slice 2 identity/recovery acceptance still applies. Do not rewrite a pre-move plan to make it compatible, and do not rename scenarios/external.py opportunistically during this slice.

    Performed: original comment/object/repository verification, own-comment deduplication, current-main source and test inspection. Not performed: repository execution, tests/build/wheel installation, server launches, or recovery reproduction. No other reviewers' opinions used, no source or Issue-state change, and no merge.

  14. Dong1017 commented on Nov 19, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    Slice 1 is merged: #503, squash commit 25df4772e4e4a82033f5acd8d5e13e164f8467dd (2026-11-19). It was approved at head 692de7d by zengchuang-hw and cursor[bot].

    • inferrsi.model.protocols.metrics is now inferrsi.benchmark.metrics. inferrsi.model.validators is now inferrsi.benchmark.validators. Neither old path has a forwarder.
    • benchmark/artifacts.py holds Benchmark's helper copy. tests/test_artifact_helper_copies.py keeps every copy equal.
    • The gate and tests/check_installed.py reject the retired paths.
    • On the ready lane at 692de7d, full-check 3.10/3.11 each gave 5224 passed, 37 skipped and 672 subtests.

    Next: slice 2 (harness/serving/). Slices 3 and 4 still wait for the Apps owner's placement confirmation.

  15. Dong1017 commented on Nov 19, 2026

    @Dong1017
    CollaboratorAuthor

    Owner decision, posted by me personally (not by an agent). Slices 3 and 4 may start now.

    1. Slices 3c and 3a ship as one PR. 3a cannot stand alone: infra/campaign.py re-exports environment and targets, and Infra may not import Apps.
    2. 3a placement is confirmed: infra/commands.py, infra/inspection.py, infra/environment.py, infra/platforms/ and infra/targets/ move to apps/host/. The apps/host/ package keeps Infra's limit: it reaches no Knowledge, Harness or Benchmark module.
    3. I accept the change to the permanent neutral-leaf importer rule. It moves with its file to inferrsi.apps.host.inspection in the same change. inferrsi.infra.inspection is retired, and no state admits two importers. The manifest keeps the earlier state in its revision history.
    4. 3c: infra/campaign.py is deleted. helper_hashes moves into the example campaign, its only user.
    5. 3b: Apps gets its own copy of the artifact helpers for apps/delivery/ and the tools.
    6. Slice 4: the three Anthropic provider modules move to apps/integrations/anthropic/. Slice 4 does not wait for task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490. task: 按职责整理 Apps 子模块目录(handoff / storage / workflows / integrations) #490's target tree adds apps/host/ and apps/integrations/anthropic/ when it next changes.
  16. zengchuang-hw commented on Nov 19, 2026

    @zengchuang-hw
    Contributor

    PASS

    Slice 3/4 增量方案检视,不代表实现验收。对照 9b81c9ba1d4d1f7d45bd039a7c02ac2f01859426 的实际依赖:infra/campaign.py 仍转出 environment / targets,3a 与 3c 同一 PR 可以避免中间出现 Infra → Apps。检查模块迁移时,源码、gate 和 manifest 同次替换唯一的 neutral-leaf importer,保留旧名字和通配名的负向断言。Slice 4 的语义应保持不变,留意同步迁移工具记录的源码路径和 controller 文件清单。

    实现时补一个具体回归:helper_hashes() 目前从自身位置的 parents[1] 找包根,并枚举包下所有 Python 源文件。搬到 examples/qwen21_turbo_b300.py 后不能原样搬这行;应仍从实际加载的 inferrsi 包根枚举,并继续生成 inferrsi/... 键。建议从仓库外工作目录运行回归,验证预期包文件进入新记录、示例仍由其原有单独条目覆盖、历史记录不被重写。

    已静态核对现有导入、函数、manifest 和工具路径。未运行代码、未查 CI。

  17. Dong1017 commented on Nov 19, 2026

    @Dong1017
    CollaboratorAuthor

    Posted by an agent on behalf of @Dong1017, the issue owner.

    Slices 2, 3c and 3a are merged: #510, squash commit a3e33851981f1ecdc8b73d7b62633cc598e5d5ae (2026-11-19). zengchuang-hw approved head 2e7c863.

    • Slice 2: harness/serving/{server,http,image}.py. The runtime identity hashes harness/serving/server.py, and the two-runtime check passed on main 9b81c9b → 6f151a7.
    • Slice 3c: infra/campaign.py is deleted, and helper_hashes lives in the example campaign.
    • Slice 3a: the host bindings are in apps/host/, and the permanent neutral-leaf importer is inferrsi.apps.host.inspection.
    • What remains: inferrsi.infra holds only artifacts.py, and inferrsi.model holds only the three Anthropic provider modules.

    Next, one PR for slices 3b, 4 and 5 (owner decision, 2026-11-19):

    • the Apps copy of the artifact helpers, with the cross-process .session.lock regression;
    • moving the provider modules to apps/integrations/anthropic/;
    • deleting infra/ and model/, with the package-directory guard.
  18. zengchuang-hw commented on Nov 19, 2026

    @zengchuang-hw
    Contributor

    PASS

    3b/4/5 合并交付方案增量检视,不代表实现验收。对照已合入的 a3e3385:Apps delivery 仍从 infra.artifacts 获取 .session.lock,Harness 的普通会话 runtime identity 也仍固定该文件。两条依赖在删除旧目录的同一变更中必须分别接到实际新实现,不能只替换导入后漏掉运行时绑定。

    建议在已安装 wheel 的跨进程用例中覆盖双向竞争和释放后重获:Harness 持锁时 Apps 不读快照,Apps 持锁时 Harness 不启动新工作;Windows 与 POSIX 均验证。锁争用判定与 #494 的异常映射分别断言。原会话计划不改写;新 wheel 拒绝旧普通 session、旧 runtime 可恢复的记录要使用这次移除 artifacts 的真实版本对,不沿用 Slice 2 对。当前仅静态核对依赖和既有规则,未运行或查 CI。

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

    kind: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