Repository navigation
refactor(harness,apps): move serving helpers and host bindings, remove the campaign facade - #510
Conversation
Starting a supervised serving process, the timed JSON transport and the image request client are execution helpers, so they move to a new harness/serving package with no forwarder or alias: - infra/processes.py -> harness/serving/server.py - infra/http.py -> harness/serving/http.py - model/protocols/image.py -> harness/serving/image.py The emptied model/protocols package is removed. The serving initializer imports nothing, so importing the HTTP or image client loads no server helper; the installed-wheel check proves this in a fresh interpreter. The server helpers keep their Linux-only process-group contract. infra/campaign.py no longer re-exports launch_server and stop_server, because Infra imports no Harness module; the example campaign imports them from harness/serving/server.py. The optimization session's runtime identity hashes harness/serving/server.py in place of infra/processes.py. A plan made before this change is refused before status or recover runs and is left unchanged; a fixture pins the earlier runtime identity from that commit's own file bytes. CHANGELOG says how to resume such a session with the runtime that planned it. The gate fails any import of the retired paths, and the installed-wheel check asserts that they are absent and the new modules ship. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
…ixture The session CLI reports a refused runtime as an argparse usage error, so the new refusal tests expect SystemExit with status 2 and the message. The R2 gate test built its synthetic Infra tree with infra/processes.py, which is now a retired path and correctly reported; it uses the live infra/commands.py for its "another Infra module" case instead. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
Initial review of Slice 2 at bf65c76f2a7caa6592b4db84e471767254dd5f63. The remaining blocker is the explicit two-runtime acceptance requirement in #498, not the serving module placement.
The refusal test creates a session under the new runtime and substitutes the old runtime-identity map into its plan.json. It does verify the new source CLI rejects that map for status and recover without changing the plan. It does not use a plan, receipts and retained inputs produced together by the pinned pre-move runtime. The added check_installed.py probe checks import retirement and isolation, not old-session refusal by the installed wheel. Neither test shows the same original session recovering from its receipts on the pinned old runtime. Please supply a reproducible two-runtime fixture or linked results using the same untouched session: old runtime produces it, new installed wheel rejects it without rewriting, and old runtime recovers it from its retained inputs and receipts.
I checked the moves, runtime identity path and embedded Linux cleanup-test import. Server/HTTP file bytes are unchanged; image changes its HTTP import. No additional implementation blocker identified. I inspected the diff and check metadata; current-head Ready was queued at inspection. The H200 numbers are author-reported. I did not execute the repository, build a wheel or run old-runtime recovery.
The map still listed infra/http.py after it moved to harness/serving/http.py. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
david6666666
left a comment
There was a problem hiding this comment.
Static review of the installed-runtime identity coverage at bf65c76f.
| path = session / "plan.json" | ||
| plan = json.loads(path.read_text(encoding="utf-8")) | ||
| assert plan["runtime_identity"] == optimization_session._runtime_identity() | ||
| plan["runtime_identity"]["harness/serving/server.py"] = "0" * 64 |
There was a problem hiding this comment.
This changes the frozen plan, not the installed server. Could the regression create a plan with the new wheel, change harness/serving/server.py in a disposable install, then verify status rejects the untouched plan? That covers #498’s canonical-byte drift requirement separately from the old-wheel recovery case.
There was a problem hiding this comment.
Done in c74434b. test_changed_installed_server_bytes_refuse_an_untouched_plan starts a real session. It then points the runtime identity at a disposable copy of the identity files and checks that the unchanged copy is accepted. After that it changes harness/serving/server.py in the copy and expects status to refuse the untouched plan, with the plan bytes unchanged.
On H200 the same check ran against a real installed new wheel in a disposable venv (issuecomment-6999697086).
Review of bf65c76: the drift test edited the frozen plan instead of the server. It now starts a real session, points the runtime identity at a disposable copy of the identity files, accepts the unchanged copy, then changes harness/serving/server.py in the copy and expects status to be refused with the plan bytes unchanged. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
Independent incremental review: bf65c76f2a7caa6592b4db84e471767254dd5f63 → c74434b0e081fa096ae7b2b5784f2e6940a81f44, following my prior review. I inspected the complete two-file increment and rechecked #498's explicit Slice 2 requirements.
The new negative control is better targeted: it first accepts an untouched current-runtime plan, changes the canonical server bytes in a disposable identity-file installation, then verifies refusal and unchanged plan bytes. Removing the obsolete Infra HTTP entry from the architecture tree is also correct. Neither change introduces a new identified blocker.
The original two-runtime requirement remains unfulfilled. tests/test_optimization_session.py:487–503 still creates a current-runtime session and substitutes its runtime_identity map. The new test below it changes copied current-runtime files; it is not a session produced by the pinned pre-move runtime and does not exercise recovery from old receipts. This increment adds neither a genuine retained pre-move session nor its rejection under the new installed wheel and recovery under the pinned old runtime.
Please retain a reproducible fixture or linked evidence for the same untouched old plan, receipts and inputs across both runtimes: new installed wheel rejects status/recover without rewriting the plan; pinned pre-move runtime recovers from the retained receipts. This is the explicit #498 acceptance item, not a request for unrelated device experiments. The changed-byte negative control can remain as a separate regression.
Static code/test-definition review only. No CI status or logs inspected, no repository code/tests/builds executed, and no merge.
|
New head: The head adds two commits:
No source file changed after Two-runtime check with one untouched session (reviews 5968724825 and 5969264012)Setup:
steps.logChanged installed server bytes with an untouched plan (inline 4624039139)On H200:
In CI: drift.logReproductionPut two_runtime_driver.pyimport json
import sys
from pathlib import Path
# Drive one optimization session through the installed inferrsi of this interpreter.
# The same driver runs under the pre-move and the new runtime, so only the runtime
# differs. Usage: two_runtime_driver.py <workdir> <command> [factor]
from inferrsi.apps.cli import main
from inferrsi.benchmark import registry
from inferrsi.harness import optimization_session
work, command = Path(sys.argv[1]), sys.argv[2]
library = work / "library"
session = work / "session"
registry._library_root = lambda: library
def write_task():
# The synthetic CPU task from tests/test_optimization_session.py::task.
task = library / "test-work"
task.mkdir(parents=True)
(library / "index.json").write_text(
json.dumps({"schema_version": 1, "packages": [task.name]}), encoding="utf-8")
(task / "TASK.md").write_text("Synthetic protocol control\n", encoding="utf-8")
(task / "baseline.py").write_text("FACTOR = 1\n", encoding="utf-8")
(task / "optimization.py").write_text(
"import json\n"
"def validate_arguments(args):\n assert not args\n return {}\n"
"def arguments(candidate, output, settings):\n"
" return [str(candidate), str(output)]\n"
"def assess(directory, settings, execution):\n"
" return json.loads((directory / 'measurement/result.json').read_text())\n",
encoding="utf-8")
(task / "benchmark.py").write_text(
"import json, runpy, sys\nfrom pathlib import Path\n"
"value = runpy.run_path(sys.argv[1])['FACTOR']\n"
"output = Path(sys.argv[2])\noutput.mkdir()\n"
"with Path('calls.log').open('a') as stream:\n stream.write(str(value) + '\\n')\n"
"status = 'completed' if value > 0 else 'candidate_failure'\n"
"result = {'status': status, 'verdict': 'PASS' if value > 0 else 'FAIL',\n"
" 'score': value if value > 0 else None}\n"
"(output / 'result.json').write_text(json.dumps(result))\n",
encoding="utf-8")
def run(argv):
try:
return main(argv)
except SystemExit as stopped:
return stopped.code
if command == "start":
write_task()
code = run(["benchmarks", "session", "start", "test-work", "--session", str(session),
"--rounds", "3", "--max-minutes", "5", "--evaluation-timeout-seconds", "15",
"--condition", "synthetic-current-agent", "--evaluation-args", ""])
elif command == "interrupted-round":
# As in test_recovery_collects_completed_execution_without_running_candidate_twice:
# the child finishes and leaves its receipt, then the coordinator is interrupted.
original = optimization_session._session_execute
def crash_after_execution(*args):
original(*args)
raise KeyboardInterrupt("coordinator interrupted after child completion")
optimization_session._session_execute = crash_after_execution
candidate = session / "work/candidate.py"
candidate.write_text(f"FACTOR = {sys.argv[3]}\n", encoding="utf-8")
try:
code = run(["benchmarks", "session", "round", "--session", str(session),
"--candidate", str(candidate), "--hypothesis", "two-runtime check"])
except KeyboardInterrupt as interrupted:
print(json.dumps({"interrupted": str(interrupted)}))
code = 130
elif command in ("status", "recover"):
code = run(["benchmarks", "session", command, "--session", str(session)])
else:
raise SystemExit(f"unknown command {command}")
sys.stdout.flush()
sys.exit(code)two_runtime.sh#!/usr/bin/env bash
# Two-runtime release-boundary check for #498 slice 2. One untouched session:
# the pre-move runtime starts it and leaves an interrupted round with its receipt, the
# new installed wheel must refuse it without changing any session file, and the
# pre-move runtime must then recover it from its receipts.
set -u
work=${WORK:?set WORK to a directory holding the inputs}
cd "$work"
rm -f steps.log
log() { echo "$*" >> steps.log; }
for side in old new; do
rm -rf "tree-$side" "venv-$side" "dist-$side" && mkdir "tree-$side" "dist-$side"
tar -xf "$side.tar" -C "tree-$side"
python3 -I verify.py "tree-$side" "MANIFEST-$side.json" > "verify-$side.json"; log "verify-$side=$?"
SETUPTOOLS_SCM_PRETEND_VERSION=0.1.0.dev0 python3 -m pip wheel --no-deps --no-build-isolation \
-w "dist-$side" "./tree-$side" > "build-$side.log" 2>&1; log "build-$side=$?"
python3 -m venv --without-pip "venv-$side"; log "venv-$side=$?"
python3 -m pip --python "venv-$side/bin/python" install --no-deps --no-index \
"dist-$side"/inferrsi-*.whl > "install-$side.log" 2>&1; log "install-$side=$?"
(cd dist-$side && sha256sum inferrsi-*.whl | sed "s/^/wheel-$side /") >> steps.log
"venv-$side/bin/python" -I -c "import inferrsi, pathlib; print('location-$side', pathlib.Path(inferrsi.__file__).parent)" >> steps.log
done
rm -rf run && mkdir run
step=0
run() {
local side=$1; shift; step=$((step + 1))
(cd "$work/run" && "$work/venv-$side/bin/python" -I "$work/two_runtime_driver.py" "$work/run" "$@" \
> "$work/out-$step-$side-$1.txt" 2> "$work/err-$step-$side-$1.txt")
log "step$step $side $* exit=$?"
}
manifest() { (cd "$work/run/session" && find . -type f -print0 | sort -z | xargs -0 sha256sum) > "$work/$1"; }
run old start
run old interrupted-round 2
manifest manifest-before-new.txt
run new status
run new recover
manifest manifest-after-new.txt
cmp -s manifest-before-new.txt manifest-after-new.txt; log "session-unchanged-by-new=$? files=$(wc -l < manifest-before-new.txt)"
grep -c '"infra/processes.py"' run/session/plan.json | sed 's/^/plan-names-infra-processes=/' >> steps.log
run old recover
run old status
log "calls.log=$(tr '\n' ',' < run/session/calls.log 2>/dev/null)"
log done
tar -czf results.tgz steps.log manifest-before-new.txt manifest-after-new.txt out-*.txt err-*.txtinstalled_drift.sh#!/usr/bin/env bash
# Installed-wheel drift check for #498 slice 2: the new wheel starts a session, then the
# installed harness/serving/server.py changes in a disposable venv. The untouched plan
# must be refused, and no session file may change.
set -u
work=${WORK:?set WORK to a directory holding the inputs}
cd "$work"
rm -f drift.log
log() { echo "$*" >> drift.log; }
rm -rf drift-venv && cp -a venv-new drift-venv
server=$(drift-venv/bin/python -I -c "import inferrsi.harness.serving.server as s; print(s.__file__)")
log "server=$server"
rm -rf drift && mkdir drift
step=0
run() {
step=$((step + 1))
(cd "$work/drift" && "$work/drift-venv/bin/python" -I "$work/two_runtime_driver.py" "$work/drift" "$@" \
> "$work/drift-out-$step-$1.txt" 2> "$work/drift-err-$step-$1.txt")
log "drift-step$step $* exit=$?"
}
manifest() { (cd "$work/drift/session" && find . -type f -print0 | sort -z | xargs -0 sha256sum) > "$work/$1"; }
run start
run status
manifest drift-manifest-before.txt
sha256sum "$server" | sed 's/^/server-before /' >> drift.log
printf '\n# changed canonical bytes\n' >> "$server"
sha256sum "$server" | sed 's/^/server-after /' >> drift.log
run status
manifest drift-manifest-after.txt
cmp -s drift-manifest-before.txt drift-manifest-after.txt; log "session-unchanged-by-drift=$? files=$(wc -l < drift-manifest-before.txt)"
log done
tar -czf drift-results.tgz drift.log drift-manifest-*.txt drift-out-*.txt drift-err-*.txtNot claimed:
The PR body's |
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
Evidence-only follow-up at unchanged head c74434b0e081fa096ae7b2b5784f2e6940a81f44, superseding the missing two-runtime evidence hold in my prior review.
The author has now supplied the two-runtime procedure, driver and execution record: an old installed runtime creates the session and leaves a completed child receipt before coordinator interruption; the new installed wheel refuses status/recover while the 15 session-file hashes remain unchanged; the old runtime then recovers one completed round with score 2, with one candidate invocation in calls.log. A separate installed-wheel drift record changes canonical server bytes while preserving the new plan and session files.
I independently read the driver and orchestration scripts against the pinned old controller. The interruption occurs after execution and before settlement, while recover reads the existing receipt without relaunching the candidate. The driver does not rewrite runtime_identity or bypass its guard; it changes only task discovery and the intentional interruption hook. The tested new runtime f50e27e2605cfa19d12d50988c4b88a4a8a22f1c has the same production source as this head: the complete subsequent delta changes only tests/test_optimization_session.py. Thus this supplies the previously missing, specifically scoped two-runtime evidence, rather than merely the substituted-map unit test.
Evidence boundary: these are author-executed results and an inspectable reproduction procedure, not my independently reproduced run. I have not downloaded or independently hashed the wheel binaries or raw session archive. The supplied results, static lifecycle check and unchanged production bytes address the prior hold; no remaining in-scope blocking implementation issue was found. The earlier module-move/import-retirement assessment remains applicable.
No CI results inspected, no repository code/tests/builds executed, and no merge. Approval is for this bounded Slice 2, not acceptance or closure of all of #498.
infra/campaign.py only re-exported Infra helpers, and its one caller is the Qwen21 example campaign. The example now imports infra.artifacts, infra.environment and infra.targets directly, and helper_hashes moves into it unchanged. The facade had to go before the Infra helpers move to Apps, because Infra may not import Apps. helper_hashes hashes every Python file of the installed package, so a new record no longer lists inferrsi/infra/campaign.py; every other bound path is unchanged and existing records are not rewritten. The gate fails any import of inferrsi.infra.campaign, and the installed-wheel check asserts that it is absent. The example test patches the owning modules. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
There was a problem hiding this comment.
LGTM
PR review verdict — PASS
Reviewed base 092d4f67e8a627afd1fe55abf5a5c825297b9181 and head c74434b0e081fa096ae7b2b5784f2e6940a81f44 (#498 slice 2).
Independent technical/third-party verify as cursor[bot] (collaborator permission none — not a write+ eligible Approver under docs/agent-collaboration.md; this is not a dual-tip / merge-ready claim). Author Dong1017 is ineligible; tip pair is zengchuang-hw Approve on the same head. Merge stays with Dong always-on / write+ humans once required checks and a write+ independent Approve are satisfied.
Verified:
- Pure
git mvofinfra/processes.py→harness/serving/server.pyandinfra/http.py→harness/serving/http.py;image.pyonly changes the relativepost_jsonimport; emptiedmodel/protocolsremoved with no forwarders. harness/serving/__init__.pyimports nothing;infra/campaign.pydropslaunch_server/stop_server; example imports the new server path.- Runtime identity binds
harness/serving/server.py(notinfra/processes.py); pre-move plan fixture refusesstatus/recoverwith exit 2 and unchanged plan bytes; changed installed server bytes also refuse an untouched plan. RETIRED_MODULEScoversinferrsi.model.protocols,inferrsi.infra.processes,inferrsi.infra.http; gate +check_installed.pycover old paths and isolated image-client import.- Local targeted: 175 passed, 4 skipped, 330 subtests.
- Ready 44457533401: full-check 3.10/3.11 5313 passed, 37 skipped, 672 subtests; installed-package / browser / references / declarations / advisory hosts success.
The command probes, the environment facts API, dependency and storage facts, device discovery and source identity serve the Apps host binding, so they move from infra/ to a new apps/host package with no forwarder or alias: commands.py, inspection.py, environment.py, platforms/ and targets/. Only inspection.py changes, in the one import line that reads the neutral data leaf one package level deeper. The permanent neutral-leaf importer rule moves with its file in the same change. LEAF_IMPORTERS and technical_leaf.permanent_importers name inferrsi.apps.host.inspection, the old module is retired, and no state admits two importers. The manifest keeps the A1 state unchanged in revision_history and every leaf lock unchanged. The negative controls move with the importer. The apps/host package keeps Infra's limit: the gate fails any path from it to a Knowledge, Harness or Benchmark module. Callers, the example campaign, tests, the installed-wheel check, docs and CHANGELOG use the new paths. infra/ now holds only artifacts.py. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
Resolve the CHANGELOG conflict with the contract-v1 pattern entry by keeping both entries. No retired path is used by the merged changes. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
6f151a7
|
New head: This push voided the approvals given at The PR had become conflicting with
Evidence:
The two-runtime and installed-drift evidence in issuecomment-6999697086 was taken at #480 changed several files that the runtime identity hashes: Edited: the first version said the covered runtime files did not change in the merge. That was wrong. |
|
@zengchuang-hw can you review and approve again? |
The test imported artifacts and targets from inferrsi.infra on one line; targets moved to inferrsi.apps.host in this slice. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
There was a problem hiding this comment.
LGTM
PR review verdict — PASS
Reviewed base 9b81c9ba1d4d1f7d45bd039a7c02ac2f01859426 and head 6f151a7aab81ed6d6dd8faba4c1d7e2dc490b762.
Re-verify after merge of main voided tip Approves at c74434b0…. Head is an ordinary merge of main 9b81c9b (#480/#508/#514) onto the serving slice; serving move content unchanged vs prior PASS tip.
Verified:
harness/serving/{server,http,image}.pypresent;__init__.pyimports nothing- Retired live paths
infra.processes/infra.http/model.protocolsabsent; gate + installed-wheel checks cover them _runtime_identity()hashesharness/serving/server.py(notinfra/processes.py)- Local targeted: 175 passed, 4 skipped, 330 subtests
- Ready 44474977344: full-check 3.10/3.11, installed-package, dashboard-browser, hosts, pr-references success; declarations 44475212054 success
Technical/third-party verify only (cursor[bot] permission none). Not a write+ eligible Approver claim; not dual-tip / merge-ready under agent-collaboration. Merge still needs write+ independent Approve — left to Dong always-on / write+ humans. Dong1017 is author so this is first formal cursor vote on tip.
zengchuang-hw
left a comment
There was a problem hiding this comment.
NO PASS
应本轮请求增量复核:c74434b0e081fa096ae7b2b5784f2e6940a81f44 → 6f151a7aab81ed6d6dd8faba4c1d7e2dc490b762(上轮检视)。
迁移逻辑与退役路径检查仍在,CHANGELOG 两项都保留;未发现新增确定性实现缺陷。但合入 main 带入了 runtime identity 覆盖的四个文件更新,尤其 session_command 会在身份检查前读取 campaign manifest 并可能分流 service-reuse。此前的两运行时证据 25df477 → f50e27e 不能证明新组合仍满足 #498 的旧 session 兼容要求。
批准前只需补当前 9b81c9ba1d4d1f7d45bd039a7c02ac2f01859426 → 6f151a7aab81ed6d6dd8faba4c1d7e2dc490b762 的两运行时记录:同一旧计划在新运行时的 status/recover 拒绝、原运行时仍可恢复、旧计划 canonical bytes 未改写,并能核查没有重执行。不是要求因 SHA 变化重跑无关硬件测试。静态核对了提交变化、运行时入口与 #498 要求;没有执行仓库代码、测试或查 CI。
The R2 gate fixture now proves the host limit that replaced Infra's: a host module may not reach another Apps module, and the leaf importer's core check follows the modernized rule. The qwen21 artifact-ownership test patches the owning module instead of the deleted facade. The contracts violation string is the resolved package, as `_direct_targets` records it. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
Slices 3c and 3a of #498 join this branch, so one PR carries the serving move and the host move. The manifest base commit is the merged main. Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
|
New head: This push voided the approvals given at This PR now carries three slices of #498, as the owner decided in #498 (comment):
Slices 3c and 3a ship together because Slice 3a keeps the permanent-rule change explicit. The owner accepted it in the same decision:
Evidence:
The ready lane on |
zengchuang-hw
left a comment
There was a problem hiding this comment.
PASS
增量检视 6f151a7aab81ed6d6dd8faba4c1d7e2dc490b762 → 2e7c8630d89d3c14957f5eef6d868b22d2f51146,上轮意见。
上轮证据缺口解除:补充记录覆盖了现有旧/新运行时组合的 status/recover 拒绝、旧计划字节不变、旧运行时从 receipt 恢复且候选仅执行一次,以及 canonical server 字节变化被拒绝。此增量没有再改 runtime identity 的输入文件。
实际新增 3a/3c 与 #498 的范围决定一致:host 实现迁移、facade 删除,无反向依赖或转发壳;neutral-leaf 规则仅保留新 importer,gate、manifest、旧路径负例同步。非阻塞:PR 正文和 CHANGELOG 中的 3c 旧路径可更新为实际的 apps.host.*。
已静态检查增量、规则和现有试验记录,未自行执行仓库或测试,未查询 CI。批准限本次切片,不代表 #498 整体验收。
There was a problem hiding this comment.
LGTM
PR review verdict — PASS
Reviewed base 9b81c9ba1d4d1f7d45bd039a7c02ac2f01859426 and head 2e7c8630d89d3c14957f5eef6d868b22d2f51146.
Tip re-verify after prior cursor Approve on 6f151a7a… was dismissed. Delta since that PASS moves host bindings infra/{commands,environment,inspection,platforms,targets} → apps/host/, deletes the infra.campaign import facade, and updates callers/docs/tests. Local targeted suites: 295 passed, 5 skipped. Ready green on tip (44487819041).
Author is Dong1017 → first formal cursor tip vote (Dong ineligible). Technical/third-party verify only (cursor[bot] permission none) — not a write+ eligible Approver / dual tip / merge-ready claim. Merge stays with Dong always-on / write+ humans (zeng tip Approve already present).
Governing Issue and delivery slice
Refs #498
infra/andmodel/packages into their owning modules #498, as one PR by the owner's decision (issuecomment-7002457678). Slice 2's placement is in issuecomment-6996972802; 3c and 3a ship together becauseinfra/campaign.pyre-exportsenvironmentandtargets, and Infra may not import Apps.harness/serving/:infra.processes,infra.httpandmodel.protocols.imagebecomeserver.py,http.pyandimage.py; the emptiedmodel/protocolspackage is removed; the initializer imports nothing;_runtime_identity()hashesharness/serving/server.pyin place ofinfra/processes.py, and a plan from before the change is refused before dispatch and left unchanged.infra/campaign.pyis deleted andhelper_hashesmoves intoexamples/qwen21_turbo_b300.pyunchanged, its only caller; the example importsinfra.artifacts,infra.environmentandinfra.targetsdirectly.apps/host/:infra/{commands,inspection,environment}.py,infra/platforms/andinfra/targets/move; the permanent neutral-leaf importer moves frominferrsi.infra.inspectiontoinferrsi.apps.host.inspectionin the source,LEAF_IMPORTERSandtechnical_leaf.permanent_importers, with the earlier state kept inrevision_history; the gate fails any path fromapps/host/to a Knowledge, Harness or Benchmark module, or to any Apps module outside the package; every leaf lock is unchanged.tests/check_installed.pyreject every retired path, including with no file behind it.inferrsi.infranow holds onlyartifacts.py, and themodel/provider modules stay. Theharness/scenarios/rename is out of scope (task: retire theinfra/andmodel/packages into their owning modules #498 body, "Out of scope").Knowledge authorship declaration
No path protected by
docs/knowledge-model-policy.mdchanges. The declaration below is disclosure only.Changed artifacts and evidence
harness/serving/git mvof the three files. Onlyimage.pychanges, in one import line (from .http import post_json).test_server_processes.py(including the real Linux cleanup test, which is skipped off Linux),test_image_modules.py(local HTTP image request),test_qwen21_turbo_campaign.py(example campaign): pass on H200server.pybytes are unchangedtest_server_processes.py: non-Linux rejection, inaccessible procfs, real cleanup after the leader exits while an unrelated process survives. The embedded subprocess source imports the new path.harness/serving/__init__.pyholds only a docstringtests/check_installed.py: a fresh-Iinterpreter importsinferrsi.harness.serving.imageand finds onlyserving,serving.imageandserving.http, and noinferrsi.infraorinferrsi.modelmoduleinstalled-packageon this PR_runtime_identity()key swaptest_runtime_identity_covers_migrated_process_domain_and_not_removed_executor: the new key is present, its hash equals the installed file's SHA-256, andinfra/processes.pyis absenttests/fixtures/optimization-session/pre-serving-runtime-identity.json: the runtime identity thatmainat25df477records, computed from that commit's own file bytestest_a_plan_from_before_the_serving_move_is_refused_and_left_unchanged:statusandrecoverboth exit 2 with "Optimization runtime changed" before dispatch, and the plan bytes are unchanged.test_changed_installed_server_bytes_refuse_an_untouched_plan: after a real start, changingserver.pyin a disposable copy of the identity files makesstatusrefuse the untouched plan.RETIRED_MODULESgainsinferrsi.model.protocols(which now covers slice 1's metrics path),inferrsi.infra.processesandinferrsi.infra.http. New gate controls cover imports and returning files. The "not retired" control now uses live paths.test_target_module_import_gate.py: pass on H200tests/check_installed.py:find_specisNonefor the two Infra paths and forinferrsi.model.protocols, the four new modules ship, andinferrsi.infra.campaignhas nolaunch_serverinstalled-packageon this PRdocs/architecture.md(layer table, dependency sentence, directory map, extension table, server note),docs/contributing.md,docs/module-layout.md,src/inferrsi/model/README.md, theinferrsi.modeldocstring, CHANGELOGdocs/assets/modular-directory-map-en.svgwas already stale before this PR (it still shows rootcli.py,runspec.pyandinfra/executors/). It is left for the directory-name follow-up recorded in #498.Checks and dependencies
H200 Linux, Python 3.12.13, the tree committed as
bf65c76. I ran agit archiveof the commit. All 2711 files matched a SHA-256 manifest. A shim outside the tree routed around the H200cufile-pythontestspackage, andPYTHONPATHwas absolute. The run covered 17 files:test_server_processes.py,test_image_modules.pyandtest_optimization_session.py;test_target_module_import_gate.py,test_legacy_run_split.py,test_module_boundaries.pyandtest_first_wave_isolation_policy.py;test_qwen21_turbo_campaign.pyandtest_ltx25_campaign.py;test_knowledge_compatibility_shells.py,test_legacy_run_forwarder_gate.py,test_campaign_record_injection.pyandtest_package_root_inventory.py;test_project_optimization.py,test_architecture_closed_loop.py,test_artifact_helper_copies.pyandtest_flare_adapter.py.Result: 388 passed, 1 skipped, 402 subtests passed. The skip is
test_package_root_inventory.py:153, which needs Git metadata;full-checkruns it.The first H200 run at
0f73c69had 3 failures, all in tests.bf65c76fixes them:SystemExit(2)with the same message.infra/processes.py, which is now correctly reported as retired. It now uses the liveinfra/commands.py.Lint: Ruff 0.17.5 on
src tests toolsandgit diff --checkpass.Two-runtime check on H200 (scripts and results in the PR conversation). The old runtime is a
25df477wheel, the new runtime anf50e27ewheel, each in its own venv, and both drive one untouched session:statusandrecoverwith exit 2, and all 15 session files stay byte-identical.completed_rounds1 and no second candidate run.server.pyis changed, and it then refuses its own untouched plan.installed-packageon this PR runs.ModuleNotFoundError.maingained Add service-reuse evaluation for project campaigns #480, ci: make Windows and macOS host checks advisory and non-blocking #508 and Anchor contract schema patterns at the end of input #514 after this branch was cut.6f151a7mergesmain9b81c9bin. The only conflict was in CHANGELOG, resolved by keeping both entries. None of the merged changes uses a moved module, and the gate reports no violation or blocker on the merged tree.Remaining work and Issue closure
infra/andmodel/packages into their owning modules #498.infra/andmodel/packages into their owning modules #498 body).infra/andmodel/packages into their owning modules #498 stays open.Provenance
The code, tests and docs were written in a Claude Code session reported as
claude-opus-5-5, effortxhigh, confirmed by the owner. This is client and session attribution, not a backend attestation. Each commit has DCO sign-off and anAgent-assisted-byline.🤖 Generated with Claude Code