Repository navigation
refactor(apps): compose the app registry from pipeline owners - #14674
Conversation
apps/registry.py carried the whole App Store pipeline in one 7,769-line module: subprocess environments, clone-target policy, caches, registry trust, git checkout transport, the store listing and the install transaction. Its rules now live in ten private owners under apps/registry_pipeline/, one per responsibility, and registry.py stays the only import path and patch surface. The facade answers every name the one-module registry bound with the object its owner holds, and a write through it reaches every module that binds the name, so the existing monkeypatch and mock.patch seams keep reaching the moved call sites. Owners import only lower owners and never the facade; the build step and the two index-entry name gates stay in registry.py, where repository guards read them by path. Moved function bodies are unchanged. A new composition-contract test pins the surface, the one-namespace writes, the layering, the facade call sites, reload and a create=True patch guard. Characterization tests pin the seed path, frozen cache filenames and the credentialed-output classes. The App Kit spec gains section 20 with the owner map; the security_posture allowlist, one RFC line cite and the moved-symbol citations in other specs are updated.
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify full CI matrix is green before merge — local-gate exceeded the campaign cap and ran only a subset, and the facade's patch-seam preservation rests entirely on that suite. Real problem (7,769-line module interleaving security rules), sound and proportionate solution: split by responsibility into owners, keep [DESIGN-REVIEWED] f9f4481 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the What this change shipsInventory (8 items) — 8 justifiedIntent: split the monolithic App Store registry module into responsibility owners so a contributor changes one rule in the module that owns it, behavior unchanged. This is a REFACTOR (regroup).
[FIRST-PRINCIPLES-REVIEWED] f9f4481 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Rerun note: |
|
Portability findings on this head are the three lines this refactor moves verbatim from
|
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
|
|
Rerun note: |
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. The waiver counts a backend entry only when the spawn would launch it as Python. backend.py pip-installs the root requirements.txt for every file-style entry but hands the tree to a Python child only (the deps_boot shim, or PYTHONPATH on an ABI match); a shell or node child gets none of it, so a .sh or .js entry beside a requirements.txt was waived into an install whose dependencies land beside a process that can never import them. manifest.spawn_launches_entry_point_as_python mirrors the spawn's dispatch (declared type, node suffix, .sh, the shebang of an extensionless executable) and is cross-pinned to backend._is_shell_entry; such an entry leaves only a stdio server to waive the file, and the build pass refuses it at once. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. The waiver counts a backend entry only when the spawn would launch it as Python. backend.py pip-installs the root requirements.txt for every file-style entry but hands the tree to a Python child only (the deps_boot shim, or PYTHONPATH on an ABI match); a shell or node child gets none of it, so a .sh or .js entry beside a requirements.txt was waived into an install whose dependencies land beside a process that can never import them. manifest.spawn_launches_entry_point_as_python mirrors the spawn's dispatch (declared type, node suffix, .sh, the shebang of an extensionless executable) and is cross-pinned to backend._is_shell_entry; such an entry leaves only a stdio server to waive the file, and the build pass refuses it at once. Rebased onto main after #14656 owner-gated the install-stream route: the route now reads the dashboard identity and app state before the body, so the install-stream refusal test builds its server as the owner, exactly as the class's sibling tests do since that commit (the fixture pins app["state"]). The desktop refusal sentence says "Kiro Crew's desktop build" instead of "the desktop app", which named Kiro Crew with the word the sentence is about installing; the dashboard keys its copy on the code, so only the sentence and its backend test copies change. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. The waiver counts a backend entry only when the spawn would launch it as Python. backend.py pip-installs the root requirements.txt for every file-style entry but hands the tree to a Python child only (the deps_boot shim, or PYTHONPATH on an ABI match); a shell or node child gets none of it, so a .sh or .js entry beside a requirements.txt was waived into an install whose dependencies land beside a process that can never import them. manifest.spawn_launches_entry_point_as_python mirrors the spawn's dispatch (declared type, node suffix, .sh, the shebang of an extensionless executable) and is cross-pinned to backend._is_shell_entry; such an entry leaves only a stdio server to waive the file, and the build pass refuses it at once. Rebased onto main after #14656 owner-gated the install-stream route: the route now reads the dashboard identity and app state before the body, so the install-stream refusal test builds its server as the owner, exactly as the class's sibling tests do since that commit (the fixture pins app["state"]). The desktop refusal sentence says "Kiro Crew's desktop build" instead of "the desktop app", which named Kiro Crew with the word the sentence is about installing; the dashboard keys its copy on the code, so only the sentence and its backend test copies change. The labelled dismiss control may shrink and its label wrap below md: the control's own line at 320px is the notice's content width, and the German label is wider than it, so shrink-0 and whitespace-nowrap hold from md up only; the icon-only shape and the layout from md up are unchanged. The set-aside holder is bound only once its mkdir succeeded, so a parent that refuses the holder is named in every layout file's warning and each later file tries a holder of its own, instead of the rename's missing-directory error standing in for the cause. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. The waiver counts a backend entry only when the spawn would launch it as Python. backend.py pip-installs the root requirements.txt for every file-style entry but hands the tree to a Python child only (the deps_boot shim, or PYTHONPATH on an ABI match); a shell or node child gets none of it, so a .sh or .js entry beside a requirements.txt was waived into an install whose dependencies land beside a process that can never import them. manifest.spawn_launches_entry_point_as_python mirrors the spawn's dispatch (declared type, node suffix, .sh, the shebang of an extensionless executable) and is cross-pinned to backend._is_shell_entry; such an entry leaves only a stdio server to waive the file, and the build pass refuses it at once. Rebased onto main after #14656 owner-gated the install-stream route: the route now reads the dashboard identity and app state before the body, so the install-stream refusal test builds its server as the owner, exactly as the class's sibling tests do since that commit (the fixture pins app["state"]). The desktop refusal sentence says "Kiro Crew's desktop build" instead of "the desktop app", which named Kiro Crew with the word the sentence is about installing; the dashboard keys its copy on the code, so only the sentence and its backend test copies change. The labelled dismiss control may shrink and its label wrap below md: the control's own line at 320px is the notice's content width, and the German label is wider than it, so shrink-0 and whitespace-nowrap hold from md up only; the icon-only shape and the layout from md up are unchanged. The set-aside holder is bound only once its mkdir succeeded, so a parent that refuses the holder is named in every layout file's warning and each later file tries a holder of its own, instead of the rename's missing-directory error standing in for the cause. The consent dialog's copy is one state-keyed table (terminalCopy): each terminal state -- consent, generic failure, granted failure, permanent desktop refusal -- owns its headline, help line and exit sentence together, so no state can inherit another's exit line through a missing guard. The granted failure had rendered the consent state's "Cancel changes nothing" beside a notice saying the app is now trusted; it now says Cancel keeps the app trusted and switched off, the permanent refusal says no trust decision is left to make, and the granted headline names what the retry button re-confirms. Fixes #13446
The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. The waiver counts a backend entry only when the spawn would launch it as Python. backend.py pip-installs the root requirements.txt for every file-style entry but hands the tree to a Python child only (the deps_boot shim, or PYTHONPATH on an ABI match); a shell or node child gets none of it, so a .sh or .js entry beside a requirements.txt was waived into an install whose dependencies land beside a process that can never import them. manifest.spawn_launches_entry_point_as_python mirrors the spawn's dispatch (declared type, node suffix, .sh, the shebang of an extensionless executable) and is cross-pinned to backend._is_shell_entry; such an entry leaves only a stdio server to waive the file, and the build pass refuses it at once. Rebased onto main after #14656 owner-gated the install-stream route: the route now reads the dashboard identity and app state before the body, so the install-stream refusal test builds its server as the owner, exactly as the class's sibling tests do since that commit (the fixture pins app["state"]). The desktop refusal sentence says "Kiro Crew's desktop build" instead of "the desktop app", which named Kiro Crew with the word the sentence is about installing; the dashboard keys its copy on the code, so only the sentence and its backend test copies change. The labelled dismiss control may shrink and its label wrap below md: the control's own line at 320px is the notice's content width, and the German label is wider than it, so shrink-0 and whitespace-nowrap hold from md up only; the icon-only shape and the layout from md up are unchanged. The set-aside holder is bound only once its mkdir succeeded, so a parent that refuses the holder is named in every layout file's warning and each later file tries a holder of its own, instead of the rename's missing-directory error standing in for the cause. The consent dialog's copy is one state-keyed table (terminalCopy): each terminal state -- consent, generic failure, granted failure, permanent desktop refusal -- owns its headline, help line and exit sentence together, so no state can inherit another's exit line through a missing guard. The granted failure had rendered the consent state's "Cancel changes nothing" beside a notice saying the app is now trusted; it now says Cancel keeps the app trusted and switched off, the permanent refusal says no trust decision is left to make, and the granted headline names what the retry button re-confirms. Rebased over the backend split (#14899): the deps-provisioning hunks (requirements_in_tree at the stamp check and the provisioner, the shared requirements cap) now live in backend_runtime/provisioning.py, the spawn body's predicate calls stay in the facade, and the facade's inventory and type-checker list gain the owner-held names. Fixes #13446
…#13568) The install-time build-step gate refused EVERY Python app carrying a root requirements.txt on the desktop build, including the apps whose dependencies the runtime already provisions itself. An app declaring an out-of-process backend.entryPoint (a FastAPI/uvicorn backend is the normal shape) could therefore not be installed at all, even though the runtime support for it shipped in #7901. What the refusal is about is the GATEWAY's own import path: pyproject.toml / setup.py install INTO the bundled interpreter, which lives inside the signed application bundle and cannot be written to. A root requirements.txt the runtime provisions out of process is a different dependency: backend.py installs it with `pip install --target` into the app's own deps dir when a backend.entryPoint spawns, and bridges.py does the same at registration for an app that ships a stdio mcpServers entry — which works on that interpreter and never touches the bundle. So pass the typed cloned manifest (the one the identity and admission gates already judged) into the build and make the waiver the runtime's own condition: pyproject.toml / setup.py keep the loud refusal; a root requirements.txt passes when the manifest declares an out-of-process consumer (backend.entryPoint, or a stdio mcpServers entry) AND declares no backend.hooks, and the install-time pip step is skipped for it; a requirements.txt with neither consumer, or beside pyproject.toml / setup.py, keeps the refusal. Hooks decide because they import INTO the gateway process, which the app deps tree deliberately never reaches, so an app declaring one still has Python that must import from the gateway's interpreter. A source install is unchanged: requirements.txt is still pip-installed there. The trust-and-enable modal discarded the reason on top of that. It showed its generic copy while the install stream's error text existed nowhere the user could reach, so Try again failed identically with the cause only in the security event log. The server string now renders as the ErrorNotice message with the generic copy as its title, which keeps the raw string as the error-journal key so the ask-the-agent hand-off still carries the endpoint, status and code in every locale. Five sites join the link-screen baseline (test/link_screen_sites.py) as the refuse-every-link kind, none held: manager._owned_data_dir answers False for a symlink or a junction and every caller then refuses or skips the move, so the name is never traversed; manager.gateway_data_dir_obstruction returns the refusal sentence for a link at `data` and the install stops before the record; manager.update_app refuses an installed `data` link before the transaction opens, and every later move is a rename by name, which moves a link as a link; registry._layout_cleanup_escaped returns the skip line for a link at the checkout root and the cleanup writers never run; registry._set_aside_new_layout_files moves a link under a layout name as the link it is (`os.rename` acts on the name) and never follows it. install_app asks gateway_data_dir_obstruction a third time, of an app directory already standing at its destination with no record, BEFORE its transaction opens, so a pre-existing link or file at `data` is refused with the predicate's own sentence instead of being unlinked by the orphan cleanup -- the same pre-transaction refusal update_app and uninstall_app make of that shape. Rebased over the registry split (#14674): the registry's rules now live in apps/registry_pipeline/, so this change's registry hunks sit with their owners. _contained_join's symlink-loop catch is in manifests.py; _stale_sibling and the _move_checkout_aside spelling are in recovery.py; the install verb and refusal line, _refuse_identity_mismatch, _clone_build_app(_locked), the desktop gate (_desktop_build_refusal, _installed_tree_preview, _requirements_owned_by_the_runtime), the post-script rollback (_layout_cleanup_escaped, _remove_new_layout_files, _set_aside_new_layout_files, _roll_back_post_script_refusal) and install_from_registry are in install.py. _run_app_build stays in registry.py, which binds the names it reads; the facade's TYPE_CHECKING list and the composition contract's frozen inventory gain the new names. The link-screen baseline records the two refusal sites under install.py, where the gate now finds them: both refuse every link before anything is traversed, so no hold. update_app's preflight asks the same predicate, gateway_data_dir_obstruction, BEFORE its transaction opens, in place of a link-only test: an installed `data` that is a regular file (from before the refusal, or made by the app's own runtime) passed the link test, was skipped by the move-aside, retired with the old tree, missed by the post-copy ask (which reads the new tree) and deleted with the retired tree on the update's success path while app_data_dir made an empty directory in its place -- silently, with ok=True. The update-only link sentence goes away; the refusal carries the predicate's own sentence and is logged in the shape of install_app's pre-transaction refusal. The link-screen baseline drops apps/manager.py::update_app: the function screens no link itself, and the predicate it calls is already declared. The waiver counts a backend entry only when the spawn would launch it as Python. backend.py pip-installs the root requirements.txt for every file-style entry but hands the tree to a Python child only (the deps_boot shim, or PYTHONPATH on an ABI match); a shell or node child gets none of it, so a .sh or .js entry beside a requirements.txt was waived into an install whose dependencies land beside a process that can never import them. manifest.spawn_launches_entry_point_as_python mirrors the spawn's dispatch (declared type, node suffix, .sh, the shebang of an extensionless executable) and is cross-pinned to backend._is_shell_entry; such an entry leaves only a stdio server to waive the file, and the build pass refuses it at once. Rebased onto main after #14656 owner-gated the install-stream route: the route now reads the dashboard identity and app state before the body, so the install-stream refusal test builds its server as the owner, exactly as the class's sibling tests do since that commit (the fixture pins app["state"]). The desktop refusal sentence says "Kiro Crew's desktop build" instead of "the desktop app", which named Kiro Crew with the word the sentence is about installing; the dashboard keys its copy on the code, so only the sentence and its backend test copies change. The labelled dismiss control may shrink and its label wrap below md: the control's own line at 320px is the notice's content width, and the German label is wider than it, so shrink-0 and whitespace-nowrap hold from md up only; the icon-only shape and the layout from md up are unchanged. The set-aside holder is bound only once its mkdir succeeded, so a parent that refuses the holder is named in every layout file's warning and each later file tries a holder of its own, instead of the rename's missing-directory error standing in for the cause. The consent dialog's copy is one state-keyed table (terminalCopy): each terminal state -- consent, generic failure, granted failure, permanent desktop refusal -- owns its headline, help line and exit sentence together, so no state can inherit another's exit line through a missing guard. The granted failure had rendered the consent state's "Cancel changes nothing" beside a notice saying the app is now trusted; it now says Cancel keeps the app trusted and switched off, the permanent refusal says no trust decision is left to make, and the granted headline names what the retry button re-confirms. Rebased over the backend split (#14899): the deps-provisioning hunks (requirements_in_tree at the stamp check and the provisioner, the shared requirements cap) now live in backend_runtime/provisioning.py, the spawn body's predicate calls stay in the facade, and the facade's inventory and type-checker list gain the owner-held names. Fixes #13446
Problem / Motivation
Goal: Let contributors change one App Store rule (subprocess environment, clone-target policy, caches, registry trust, checkout transport, store listing or install transaction) in the module that owns it, with every App Store behaviour, import path and test patch seam unchanged.
src/kiro_crew/apps/registry.pywas one 7,769-line module holding the whole App Store pipeline. Security rules that must be reviewed together (credential-free clone posture, SSRF host gate, subdirectory containment, index-name gates) were interleaved with listing, caching and install code, so every App Store fix touched the same file and reviewers had to rediscover which part owned a rule.Why it matters
The registry decides what code the gateway clones, builds and runs. A change to one rule in a module this size is slow to review and easy to land in the wrong place, and large concurrent changes to it collide. Owners by responsibility make each rule findable and keep a fix inside its owner.
Not a goal
kiro_crew.apps.registryimport path or any of its patch seams._run_app_buildor the two index-entry name gates out ofregistry.py; repository guards read them there by path.install_from_registryor_git_clone_or_pull; they move intact so the move is provably behaviour-preserving.routes.py,manager.py, the app backend, or the catalog JSON.registry.py(logged as a docs-sync follow-up).What changed (motivation → approach → change)
src/kiro_crew/apps/registry_pipeline/subprocess_env.pyminimal_env,anonymous_git_env, the probe envgit_targets.pycaches.pysources.pyrecovery.pycheckout.pyindexes.pymanifests.pyapp.jsonfetch, resolve, mergecatalog.pyinstall.pyThe module mixed seven responsibilities, so each moved to one owner, lowest layer first, with imports pointing only down that order. Function bodies moved unchanged: an AST comparison against the base finds 161 of 165 top-level definitions identical (docstrings aside, where the brand gate respells
KiroCrewon moved lines). Three that differ are call sites that now reach a constructregistry.pykeeps; the fourth is_REGISTRY_FILE, whose path climbs one more directory so it still nameskiro_crew/apps/app-registry.json.registry.pyis the only import path and patch surface, in the shape of the AWS Control backup facade. Every name the module bound resolves to its owner's object, and a write through the facade reaches every module that binds the name, so the existingmonkeypatch.setattr(registry, ...)andmock.patch("kiro_crew.apps.registry...")sites keep reaching the moved call sites. It imports every owner at its own import, keeps thekiro_crew.apps.registrylogger for every owner, and reloads the owners when it is reloaded.Three constructs stay in
registry.pybecause repository guards read them there:_run_app_buildand the twoKEBAB_RE.fullmatchindex-name gates. The owners that call them resolve the facade at call time. The App Kit spec gains §20 with the owner map; Writers lines and the moved-symbol citations in other docs point at the real owners.Backwards compatibility
Compatible: all 218 names the one-module
registry.pybound still resolve fromkiro_crew.apps.registryto the object their owner holds,__all__is the same set, and moved code is unchanged. The composition-contract test pins both.Tests
test/test_apps_registry_composition_contract.py(new): the frozen 218-name surface, one object per name across every holder, facade writes and undo (monkeypatch,mock.patch, nested four deep, delete/restore, builtins), downward-only imports, the exact three facade call sites, reload, star import, theTYPE_CHECKINGview, and acreate=Truepatch guard over every test module with its own reader cases.test/test_apps_registry_coverage.py,test/test_apps_registry.py: characterization cases pass against the base and the split: the bundled seed path, frozen cache file names, the credentialed-output classes, the one-shot transport env, timeouts read where they are used, the index-cache migration failing closed, install-row precedence, and install log identity.test_external_registry.py,test_catalog_inventory.py,test_app_manager.py,test_apps_routes_coverage.pyand 30 more).Manual verification
kiro_crew.apps.registry,kiro_crew.apps.routesand each owner first in fresh interpreters.local-gate.py --dry-runselects 1,912 backend and 873 frontend files (the new package__init__matches most tests), over the campaign cap, so owned, oracle and 152 tree-scanning ratchet suites were run instead; CI runs the full matrix.Shared files (entry-scoped grants)
src/kiro_crew/security_posture.py:NON_EGRESS_REDACTION_MODULESrowapps/registry.pyreplaced by the four owners that call a redactor.docs/request-for-change/rfc-everything-is-an-app.md: theapps/registry.py:4053line cite, which the facade no longer reaches, now namesinstall_from_registry..github/black-baseline.txt:registry.pypruned; the facade is black-clean.docs/system-specs/modules/{security,platform-context,papyrus,dev-fleet}.md,docs/architecture/resource-protection.md,docs/app-kit/manifest-reference.md,docs/request-for-change/rfc-{appstore-official-registry,federated-app-platform}.md,src/kiro_crew/platform/interfaces.pydocstrings.Integration follow-ups (comments outside this claim that still name
registry.pyas the definer; every name still resolves through the facade):.github/docs-lint-baseline.txt:314: the now-inertapps/registry.py:4053triple (report-only).website/src/components/appstore/types.ts:49,186,217:_apply_trust_fields→apps/registry_pipeline/catalog.py.test/test_llm_pool.py:1493:_communicate_with_timeout→apps/registry_pipeline/checkout.py.src/kiro_crew/apps/builtins/command_bar/tests/test_command_bar_manifest_platform.py:6: thesupports_platformcall →install_from_registryinapps/registry_pipeline/install.py.src/kiro_crew/apps/manifest.py:2786andtest/test_app_signing_payload_resource_and_ui_fields.py:18: theclientInstallreturn →apps/registry_pipeline/install.py.src/kiro_crew/apps/official_catalog.py:767: install-status and trust stamping →apps/registry_pipeline/catalog.py.test/test_r8_s33_subprocess_env.py:263: the twodetectInstalledprobes →catalog.py(_detect_installed_probe) andinstall.py.src/kiro_crew/platform/defaults.py:458:_PUBLIC_GIT_HOSTS→apps/registry_pipeline/git_targets.py(the code reads it through the facade).Related Issues
no linked issue: structural refactor from the component-refactor campaign.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)