Repository navigation
refactor(apps): group artifact storage under apps.storage - #493
zengchuang-hw wants to merge 2 commits into
Conversation
Signed-off-by: zengchuang <zengchuang3@huawei.com> Agent-assisted-by: Codex (author)
Dong1017
left a comment
There was a problem hiding this comment.
LGTM
PR review verdict — PASS
Reviewed base 8aba657 and head 3a9f9b6 (full diff, first review). pr/prior-reviews.md shows no formal reviews, no Approve on this head and no outstanding CHANGES_REQUESTED. This is the first independent review on this head. Author is zengchuang-hw. Dong-bot (authorized delegate) is not the author.
Verified from the diff
-
The four moves are byte-identical. The git blob hashes of the old and new files match:
apps/archive.py6ca423a4 →apps/storage/archive.py6ca423a4apps/artifact_reader.pye07ac63a →apps/storage/artifact_reader.pye07ac63aapps/result.py23b3eebb →apps/storage/result.py23b3eebbapps/evidence_layout.py8510920e →apps/storage/evidence_layout.py8510920e
There are no behavior changes in the storage code. The relative imports inside the moved modules (
.result,.archive) still resolve withinstorage/, and I found no import cycle. -
The old modules are explicit-export shims. Each is a docstring, an explicit
from .storage.X import (...)and__all__.- The exports match
docs/apps-output.mdanddocs/apps-module-migrations.json, with no*and no aliasing. - Old pickle references to
inferrsi.apps.archive.RunOutput, functions and so on resolve to the same objects. - New pickles name the canonical modules.
- Private helpers (
_logical_path,_check_ref,_selected_verdict,_RECORD_OBSERVATIONS) are intentionally not re-exported. The in-tree consumers (api,bridge,candidate_provider,delivery/*,views/attempt) are repointed toapps.storage.*, and the docs say private-helper patches must target the canonical module.
- The exports match
-
Tests are repointed. Imports and patch targets move to
apps.storage. The newtests/test_apps_module_migrations.pycovers:- shim AST shape and export identity
- old and new pickle round-trips, including a legacy
RunOutputinstance - a consumer registry against the JSON inventory
- no direct or transitive storage → handoff edge, with a back-edge negative case
- an import-free initializer, no I/O in module bodies, and cold imports that load no handoff or heavy modules
tests/check_installed.pyalso checks both import paths against the installed package. -
Docs are consistent with the code.
architecture.md,module-layout.md,operations.md,apps-output.md,current-design.mdand thecontracts/evidence.pydocstring all nameapps.storage.*. The retired rootinferrsi.evidence_pathsstays unaliased. -
Shim removal is not slipped in. It is explicitly deferred to a separate reviewed PR.
Not verified here (non-blocking)
- I did not run the test suite or see CI results. The consumer-registry test and the cold-import test depend on repo-wide state (every importer of the old names, and the
harnesspackage initializer staying light). Please confirm CI is green before merge. - I could not check the governing issue wording for #371/#490. The docs now say #371 "owns" the Apps composition and #490 is an "accepted directory follow-up", where they previously said "proposal / not accepted". The maintainers should confirm that status change is accurate.
- On Python 3.10,
inspect.isclass(ResourceReader)can be True for acollections.abc.Callable[...]alias.test_shim_is_an_explicit_export_of_the_same_objectswould then assertvalue.__module__ == canonicaland fail, because the alias's__module__iscollections.abc. Please confirm the supported Python floor (3.11+ avoids this). Thecheck_installed.pyloop already guards on__module__.
This is one approving vote only. The ruleset still requires two eligible approvals before merge.
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).
Signed-off-by: zengchuang <zengchuang3@huawei.com> Agent-assisted-by: Codex (author)
|
@Dong1017 感谢检视。两点已处理并补充依据。
初版 CI 的安装包、Linux Python 3.11 全量、浏览器和 Windows/macOS 宿主检查已通过,更新后按现有 CI 重跑。请你和 @david6666666 复核当前提交;满足检视条件时请在当前 head 提交首行 |
Dong1017
left a comment
There was a problem hiding this comment.
LGTM
PR review verdict — PASS
Reviewed base 8aba657 and head f4f9a53. This is an incremental re-review of 3a9f9b6..f4f9a53.
State
- My earlier PASS on
3a9f9b62was dismissed when this head was pushed. It is not an Approve on the current head. - There is no outstanding CHANGES_REQUESTED and no other formal review on this head.
- That review verified the four storage moves as byte-identical. The git blob hashes of the old and new files matched. It also verified that the old modules are explicit re-export shims.
Follow-up in f4f9a53d
- Both points from my earlier review are addressed in the PR thread and body:
- The project keeps Python >=3.10.
- The test now uses
typing.get_originto exclude generic aliases such asResourceReaderfrom the class/function__module__definition-origin assertions. It still checks object identity for every export, including the alias. - A new regression simulates
inspect.isclass(ResourceReader)returning true. The author reports all 12 migration tests, Ruff andgit diff --checkpassing.
- The author states the follow-up is test-only and production code is unchanged since
3a9f9b62. - The scope is consistent with the accepted design on #490. This PR is a storage slice that refs #490 and #371 without closing them. Handoff, workflows and integrations remain open.
- The remaining
test_result_delivery.py::test_progress_uses_committed_control_and_a_fixed_clockfailure is documented. It is a WindowsPermissionErrorvsBlockingIOErrorlimitation, reproduced on an unmodified archive of base 8aba657. No assertion was weakened.
Not verified here
- I did not read the
f4f9a53ddelta line by line, and I did not run any tests. - I did not independently confirm that production files are unchanged since
3a9f9b62. - Current-head CI is still rerunning according to the author. Merge should wait for it to go green.
- This is one approval. The ruleset still requires two independent valid approvals, and the Harness interface owner's #475 sealing review is still needed for the later handoff slice.
Optional follow-up, not blocking: before merge, confirm that the CI rerun's installed-package lanes (Python 3.10/3.11) pass on this head.
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).
Governing Issue and delivery slice
Refs #490
Refs #371
The flat Apps artifact modules made storage ownership and dependency direction hard to follow. This first storage slice puts the four unchanged implementations in
inferrsi.apps.storage, migrates API/provider/view/delivery callers, and preserves the registered old public imports.Changed artifacts and evidence
storage/{archive,artifact_reader,result,evidence_layout}.py, import-free initializer, canonical consumers and current docs__all__;docs/apps-module-migrations.jsonrecords only these four migrationsChecks and dependencies
Local environment was Windows with Python 3.12. The broad local regression and package/plugin checks below assessed the first implementation,
3a9f9b62; production code is unchanged by the subsequent test-only review correction.ruff check src tests toolsandgit diff --checkpassed.tests/test_apps_*.py, Harness generation sealing, module boundaries, target import gate, isolation policy, evidence paths, repository-pack facade and result-delivery checks produced 418 passed, 330 subtests passed, 1 failed, 2 skipped.test_result_delivery.py::test_progress_uses_committed_control_and_a_fixed_clock. Windows raisesPermissionErrorduring the nested nonblocking file lock, while the caller catchesBlockingIOError. The identical failure was reproduced from an unmodified archive of base8aba657da79e8ed9f6e6fbb33437e9d9fdd8f1c7. It remains a baseline limitation; no skip or weakened assertion was added.python -I check_installed.py, including canonical/shim identity and legacy pickle loading.f4f9a53dexcludes generic aliases from class/function definition-origin assertions and adds a regression simulatinginspect.isclassreturning true forResourceReader. All 12 migration tests, Ruff and diff checks passed again. Object identity remains checked for every export, including the alias.Remaining work and Issue closure
Handoff, workflows, integrations and integrated acceptance remain in #490. Handoff needs the Harness interface owner's review of the #475 sealing path. Shim retirement requires its own reviewed removal PR and version decision.
This is one implementation slice, not whole-Issue completion. Goal acceptance remains with the #371 Apps owner and affected interface owners. Please review this revision independently before integration.