Repository navigation
refactor(dashboard): split updates and knowledge handlers into owners - #22073
Conversation
Sensitive Change ReviewSensitive files changed:
|
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the conftest reset of [DESIGN-REVIEWED] 37a3eff Description read[DESCRIPTION-READ] 6e339c6e6324d5cc6573d682a040483f934db8933c7a5e86338f37f410019d6e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that the re-keyed path lists (the What this change shipsInventory (6 items) — 6 justifiedIntent: let maintainers keep changing the update and Knowledge Library routes without breaking the 2,000-line file cap. This is a REFACTOR, so neither FIX nor ADDITION. It reuses the existing
[FIRST-PRINCIPLES-REVIEWED] 37a3eff Description read[DESCRIPTION-READ] 3e8ce3fc8d3a00b1577e704b9e19528bd0a6f1a0085a6b893c1e123c27d67f20 That sha256 names the PR description this verdict read. Recompute it with |
Sensitive change review
|
Opus 5.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: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 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: |
|
|
handlers/updates.py (3,479 lines) and handlers/knowledge.py (3,271)
were over the 2,000-line cap for hand-written files. Each keeps its
path as the only import path and patch surface and becomes a pure-glue
mirror facade (kiro_crew._facade_mirror); the moved code lives in
sibling owners by responsibility.
updates.py (207) serves updates_{verdict,check,apply,streams,step_up,
channel}; each global a function rebinds sits in one owner with every
function that reads it. knowledge.py (229) serves knowledge_{access,
library,sync,sources,ingest,bundles,embeddings,agent_context,
lifecycle}.
Moved bodies are AST-identical apart from a brand-gate docstring
reword and the folder dialog's explicit UTF-8 decode (a moved
subprocess-encoding offender, fixed rather than carried); comments
reworded for the comment-history gate and for wording that named the
one-module layout. Path-keyed rows and pins follow the moved code,
specs gain owner maps, and new facade tests pin patch reach, owner
order, the rebound globals' homes and the served route table.
Part of #20192
904d84b to
37a3eff
Compare
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Every review lane on the head is clean (only runner notices and PR Scope / Opus size warnings); held by the triage cron on size, path or lane-note rules alone. Approved on the watch holder's request.
…22222) search_for_context stat'ed and read the gateway's config.json inside the coroutine. #22084's fs gate flags that call; its baseline row named handlers/knowledge.py, but #22073 had already moved search_for_context into knowledge_agent_context.py, so main's ratchet lane reads one new offender plus one stale row (red since 28ee969). The read now runs in _read_knowledge_config on asyncio.to_thread (the path is the gateway's own, not the request's). The stale knowledge.py row is pruned with --update-baseline, and test_knowledge_onloop_fs.py drops the on-loop allowance for that call and proves the read leaves the loop thread. Refs #22209 Co-authored-by: Bolin Chen <bolichen@amazon.com>
Problem / Motivation
Goal:
dashboard/handlers/updates.pyanddashboard/handlers/knowledge.pyeach fit under the 2,000-line cap, with every route, import path and test patch working exactly as before.updates.pyhad grown to 3,468 lines andknowledge.pyto 3,361, both over the repository's 2,000-line rule for hand-written files (both are rows of.github/file-line-cap-baseline.txt, andupdates.pyhad already grown past its row).Why it matters
A file this size is hard to review and easy to merge-conflict, and the line cap only shrinks: until these files are split, every change to the update, log and status-stream routes or to the Knowledge Library routes adds to two of the largest handler modules the dashboard has. Splitting them by responsibility gives each new piece of work an obvious home.
Not a goal
What changed (motivation → approach → change)
Both modules become pure-glue mirror facades (
kiro_crew/_facade_mirror.py, the campaign's shared mechanism): the original path stays the only import and patch path, the moved code lives in sibling owner modules, and a patch through the facade still reaches every module that reads the name. Neither facade keeps code of its own.handlers/updates.py3,468 → 207updates_verdict510 (the cached verdict, version display and compare, the forced-update floor, the auto-update effect),updates_check909 (the shared check task, the git/provider/feed checks,status_update_fields,GET /api/update/check),updates_apply822 (POST /api/update, cancel, simulate, tracked policy installs, the restart andPOST /api/restart),updates_streams418 (log ring, log level,GET /api/logs,GET /api/stream),updates_step_up538 (arm, arm status, disarm, approve and their audit),updates_channel444 (auto-update policy, release channel, revalidate, changelog, releases)handlers/knowledge.py3,361 → 238knowledge_access113 (owner gate, SEL audit, the app's store, pipeline and task registry),knowledge_library752 (namespaces, items, entities, graph, source-scoped list,/source-counts, stats),knowledge_sync573 (sync status and claim, the sync route and its tasks),knowledge_sources803 (source CRUD with its off-loop path probe, pause/confirm/resume, folder picker, file rows, config),knowledge_ingest433 (agent-fetched text, uploads, archives, the job row),knowledge_bundles284 (export, import, bundle validation),knowledge_embeddings293 (status, the batch embed that fills missing vectors, the rebuild job),knowledge_agent_context186 (the chat context-injection search, the agent's document add),knowledge_lifecycle354 (setup_knowledge_routes, watcher, artifact ingest, config reloads, pool shutdown)updates.pyrebinds module globals withglobal(the check's clock, generation and task, the auto-update effect, the changelog cache, the log ring's handler). Each such name sits in exactly one owner together with every function that reads or rebinds it, so the facade serves it from there and a write through the facade lands where every reader looks.knowledge_accessis under 150 lines on purpose: it is the lowest layer, which the route owners import for the owner gate, the SEL audit and the app handles (owners never import their facade). Specs gain owner maps; definition-site citations name the owners; path-keyed guards are re-keyed (see "Guard changes").Backwards compatibility
Compatible: every name each facade bound at the merge-base still resolves on it as the same object (
test/campaign_facade_inventories/kiro_crew.dashboard.handlers.{updates,knowledge}.json,test_campaign_facades_base_public_names); the mirror serves owner-bound names and routes writes to every holder (test_updates_handlers_facade,test_knowledge_handlers_facade,test_facade_mirror_guards).Logger (L25): every owner that logs binds
logging.getLogger("kiro_crew.dashboard.handlers.updates")/("...knowledge")by literal name, sorecord.nameis unchanged and the mirror installs underpython -m.Class
__module__:_PolicyApplyStoppedkeeps the facade's__module__(pinned bytest_the_moved_exception_keeps_the_facade_module)._QueueLogHandlerand_RingLogHandlertake their owner's module (updates_streams); nothing in src or tests reads their__module__,__qualname__or pickles them (isinstance and identity checks go through the facade's served object).Reader: src/kiro_crew/dashboard/handlers/updates.py:get_update_info -- chat -- still resolves through the facade, served from updates_verdict.py by the mirror (test_get_update_info, test_dashboard_status_snapshot)
Reader: src/kiro_crew/dashboard/handlers/updates.py:remediation_command -- chat -- still resolves through the facade, served from updates_verdict.py by the mirror (test_get_update_info, test_dashboard_status_snapshot)
Reader: src/kiro_crew/dashboard/handlers/updates.py:record_auto_update_effect -- chat -- still resolves through the facade, served from updates_verdict.py by the mirror (test_get_update_info, test_dashboard_status_snapshot)
Reader: src/kiro_crew/dashboard/handlers/updates.py:prime_status_auto_update_effect -- chat -- still resolves through the facade, served from updates_verdict.py by the mirror (test_get_update_info, test_dashboard_status_snapshot)
Reader: src/kiro_crew/dashboard/handlers/updates.py:status_update_fields -- crew page -- still resolves through the facade, served from updates_check.py by the mirror (test_update_check_install_aware, test_dashboard_status_snapshot)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_check -- crew page -- still resolves through the facade, served from updates_check.py by the mirror (test_update_check_install_aware, test_dashboard_status_snapshot)
Reader: src/kiro_crew/dashboard/handlers/updates.py:policy_applies_in_flight -- chat -- still resolves through the facade, served from updates_apply.py by the mirror (test_update_venv_detection, test_update_channel_and_restart)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_auto -- crew page -- still resolves through the facade, served from updates_channel.py by the mirror (test_update_channel_and_restart, test_changelog_handler)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_changelog -- crew page -- still resolves through the facade, served from updates_channel.py by the mirror (test_update_channel_and_restart, test_changelog_handler)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_releases -- crew page -- still resolves through the facade, served from updates_channel.py by the mirror (test_update_channel_and_restart, test_changelog_handler)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_apply -- crew page -- still resolves through the facade, served from updates_apply.py by the mirror (test_update_venv_detection, test_update_channel_and_restart)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_cancel -- crew page -- still resolves through the facade, served from updates_apply.py by the mirror (test_update_venv_detection, test_update_channel_and_restart)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_simulate -- crew page -- still resolves through the facade, served from updates_apply.py by the mirror (test_update_venv_detection, test_update_channel_and_restart)
Reader: src/kiro_crew/dashboard/handlers/updates.py:apply_log_level -- crew page -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:apply_log_level_from_config -- chat -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_log_level -- crew page -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_log_level_get -- crew page -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:install_log_ring_handler -- chat -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_logs -- crew page -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_stream -- chat -- still resolves through the facade, served from updates_streams.py by the mirror (test_dashboard_updates_coverage, test_cli_logging)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_channel -- crew page -- still resolves through the facade, served from updates_channel.py by the mirror (test_update_channel_and_restart, test_changelog_handler)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_revalidate -- crew page -- still resolves through the facade, served from updates_channel.py by the mirror (test_update_channel_and_restart, test_changelog_handler)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_gateway_restart -- crew page -- still resolves through the facade, served from updates_apply.py by the mirror (test_update_venv_detection, test_update_channel_and_restart)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_arm -- crew page -- still resolves through the facade, served from updates_step_up.py by the mirror (test_update_stepup)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_arm_status -- crew page -- still resolves through the facade, served from updates_step_up.py by the mirror (test_update_stepup)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_disarm -- crew page -- still resolves through the facade, served from updates_step_up.py by the mirror (test_update_stepup)
Reader: src/kiro_crew/dashboard/handlers/updates.py:api_update_approve -- crew page -- still resolves through the facade, served from updates_step_up.py by the mirror (test_update_stepup)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:list_namespaces -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:list_items -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_item -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:update_item -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:delete_item -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_item_content -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:list_entities -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_entity_graph -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_entity_items -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_related_items -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_full_graph -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:source_counts -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:list_sources -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:pick_folder -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:add_source -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:sync_source -- crew page -- still resolves through the facade, served from knowledge_sync.py by the mirror (test_knowledge_sync_local_file, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:delete_source -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:rename_source -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:confirm_source -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:pause_source -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:resume_source -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:list_source_files -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:retry_file -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:skip_file -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:ingest_text -- crew page -- still resolves through the facade, served from knowledge_ingest.py by the mirror (test_knowledge_ingest_magic_byte, test_upload_size_limit)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_config -- crew page -- still resolves through the facade, served from knowledge_sources.py by the mirror (test_folder_watch_handlers, test_knowledge_add_source)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_stats -- crew page -- still resolves through the facade, served from knowledge_library.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_items_source_filter)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:ingest_file -- crew page -- still resolves through the facade, served from knowledge_ingest.py by the mirror (test_knowledge_ingest_magic_byte, test_upload_size_limit)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_job -- crew page -- still resolves through the facade, served from knowledge_ingest.py by the mirror (test_knowledge_ingest_magic_byte, test_upload_size_limit)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:export_item -- crew page -- still resolves through the facade, served from knowledge_bundles.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:export_all -- crew page -- still resolves through the facade, served from knowledge_bundles.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:import_bundle -- crew page -- still resolves through the facade, served from knowledge_bundles.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:get_embedding_status -- crew page -- still resolves through the facade, served from knowledge_embeddings.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:batch_embed_items -- crew page -- still resolves through the facade, served from knowledge_embeddings.py by the mirror (test_knowledge_handlers_coverage, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:search_for_context -- chat -- still resolves through the facade, served from knowledge_agent_context.py by the mirror (test_knowledge_search_upgrade, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:add_agent_document_route -- chat -- still resolves through the facade, served from knowledge_agent_context.py by the mirror (test_knowledge_search_upgrade, test_knowledge_owner_gate)
Reader: src/kiro_crew/dashboard/handlers/knowledge.py:setup_knowledge_routes -- crew page -- still resolves through the facade, served from knowledge_lifecycle.py by the mirror (test_knowledge_effort_pools, test_knowledge_handlers_facade)
Move audit
knowledge.py_run_folder_dialog: the folder-dialogsubprocess.rungainsencoding="utf-8", errors="replace"(L57: a moved subprocess-encoding offender is fixed, not carried; osascript writes UTF-8, the same wayfile_api/desktop.pyand the design-tweak picker already decode it)..github/subprocess-encoding-baseline.txtloses theknowledge.pyrow. This is the PR's one behaviour-adjacent line: on a host whose locale is not UTF-8 a non-ASCII folder path now decodes as UTF-8 instead of the locale code page.knowledge.py_create_embedder: docstring "KiroCrew config" → "Kiro Crew config" (brand gate on moved prose).updates_check.pytwo "no longer follows" → "has left" (comment-history gate); positional wording that named the one-module layout:api_update_check"this module's handlers" → "the update handlers",_changelog_path"updates.py lives at" → "This module lives at",_restart_gateway"re-exports this module" → "re-exports the updates facade",_venv_pip_install"the log ring handler below" → "the log ring handler inupdates_streams",knowledge_library.pylist_items"search_for_context below" → "search_for_context inknowledge_agent_context",knowledge_sync.py_ingest_local_file_task"this file's precedent" → "the precedent inknowledge_embeddings".logger = logging.getLogger(__name__)becomes the literal facade name in each logging owner (the audit pairs the BASE line with an identical line in another touched file, so it is not listed above);_PolicyApplyStopped.__module__restore; the facade glue and its twoTYPE_CHECKINGmanifests (owner-defined names; names served from outside the family, L42).knowledge.pywas black-baselined; the statements black re-wraps in the knowledge owners are AST-identical, andknowledge.pyleaves.github/black-baseline.txt.L36 (default vs
--minimaladded lines): identical for every changed file except the two glue-only facades:updates.py+202/-3463 default vs +198/-3459--minimal(2 blank lines and 2)closers of wrappedTYPE_CHECKINGimports),knowledge.py+226/-3349 vs +224/-3347 (2 blank lines). No kept BASE line is re-shown and no gate token sits on those lines (L41 addendum, glue-only parity). The owners are new files.Guard changes
Each re-pointed pin is a path or row change only (or an L30 facade+owners join), with the assertions unchanged; each has a mutation proof that turns it red.
test_json_object_body_guard._CAP_REGISTERhandlers/knowledge.py::<fn>rowsknowledge_{library,sources,ingest,bundles,embeddings,agent_context}.pytest_spawn_audit.BENIGN_SPAWNSknowledge.py::_run_folder_dialog,updates.py::{_apply,_check_git_checkout,api_update_apply}knowledge_sources.py,updates_apply.py,updates_check.py,updates_apply.pytest_no_config_dir_in_async._ASYNC_CHECKED_FILEShandlers/knowledge.pytest_sandbox_install_root_seal._UPDATER_MODULEShandlers/updates.pytest_cse_2026_08_05_fixes.../knowledge.py.../knowledge_agent_context.py(thesearch_for_contextclamp its docstring names)test_dashboard_updates_coverage::test_neither_chat_message_door_builds_the_frame_by_handdashboard/handlers/updates.pydashboard/handlers/updates_streams.pytest_build_version_override::test_the_feed_check_source_folds_the_stamp.../updates.py.../updates_check.pytest_cpp_seam_failclosed::test_knowledge_extra_connectors_site_uses_safe_context_call...handlers.knowledge...handlers.knowledge_lifecycletest_gateway_restart_uses_respawn_executable::TestDashboardResolverIsLoadedBeforeTheApplygetsource(updates)_OWNERSmoduletest_config_rmw_preserves_settings::test_the_dispatch_cannot_regress_to_a_one_lock_offloadgetsourcefile(updates)_OWNERSfiletest_serving_loop_unified(2 ratchets)Path(updates.__file__)updates_*.pysiblingstest_knowledge_onloop_fs._module_coroutinesgetsourcefile(knowledge)_OWNERSfile, through a new_owner_files()beside it (the shapetest_dashboard_files_onloop_fsalready uses forfile_api)test/integration/test_boot_smoke._KNOWN_SECOND_BOOT_CHANGES("...handlers.updates", "_last_update_check")("...handlers.updates_check", "_last_update_check"), the module that now binds the clocksecurity_posture.NON_EGRESS_REDACTION_MODULEShandlers/knowledge.py,handlers/updates.pyknowledge_{agent_context,bundles,ingest,sources,sync}.py,updates_apply.py(the facades no longer match)Mutation proofs (17, all red, then restored):
onloop-ratchet-reaches-owners,json-body-row-reaches-owner,spawn-row-reaches-owner,spawn-row-updates-check,config-dir-rows-reach-owner,updater-modules-reach-owner,cse-limit-clamp-path,chat-message-door-row,feed-check-literal-path,cpp-seam-module-string,respawn-import-join-apply,rmw-dispatch-join,serving-loop-attr-join,serving-loop-local-join,posture-rows-reach-owner,rebound-global-pin,route-table-served. The boot-smoke row runs only withKIROCREW_INTEGRATION=1; it passes with the new key (and locally with the old one too, since this boot does not move the clock), so the re-key keeps the row truthful for CI's integration lane.Granted edit outside the claim (Master grant):
test/test_update_channel_and_restart.py:772patch.multiple(updates, **patches)→patch.multiple(updates, create=False, **patches).test_facade_mirror_guards::test_no_test_patches_a_mirrored_facade_name_with_create_truereads**patchesas a possiblecreate=Trueon the now-mirrored facade (scan verdictcreate=<dynamic>); an explicitcreate=Falselets the scan read the call statically (verdictcreate=False), and a duplicate key inpatcheswould raise, so behaviour is identical. That guard and the file's 52 tests pass.Tests
test/test_updates_handlers_facade.pyandtest/test_knowledge_handlers_facade.py: every name the test trees patch through each facade (scanned withtest/facade_mirror_scan.py, with a known-seams non-vacuity floor) reaches every module holding it and the undo restores them; the owners are exactly theupdates_*.py/knowledge_*.pysiblings, loaded lowest layer first; the facade forwards no table and defines no code; eachglobal-rebound updates name lives in one owner with every function that reads it (bytecode scan, with a known-rebinders self-test); the knowledge route table registers the very objects the facade serves; names served from outside the family are visible to type checkers (L42); one logger under the facade name; the moved exception keeps the facade module;python -mstill runs; corpus-gate self-test.test/campaign_facade_inventories/kiro_crew.dashboard.handlers.updates.json(93 names, 65 re-bound) and...knowledge.json(94, 54), generated from the merge-base text;check_inventory.pyreports no missing name.reports/S36/port-table.md): the recipe re-cut carries fix: honor proxy settings when checking for updates #21880'sfetch_feed_bytesdelegation intoupdates_check.pyand fix(knowledge): run request-path filesystem checks off the event loop #21791's off-loop path probe intoknowledge_sources.py(five new unitsadd_source/retry_file/skip_fileread) andknowledge_sync.py(_resolved_is_sensitive, read only by_ingest_local_file_task); both owners import_run_path_probeand_PathProbeBusyfromhandlers/files.py, so one patch through the facade reaches both.-n 3: every test file that imports, patches or names either facade or a moved name (the slack gateway helpers' importers included), every source-reading pin re-pointed here, the facade, mirror and inventory guards, and the error-code, posture, line-cap, flake, wait-discipline, black and subprocess-encoding ratchets: 7,490 passed, 31 skipped, 1 failed, on main2375643f7d, then green after the one fix that red asked for: upstream's newtest_knowledge_onloop_fsstatic ratchet scans the handlers module's coroutines, which now live in the owners, so it reads the facade joined with them (L30/L40(8), mutation-proved).test/integration/test_boot_smoke.py::test_a_second_boot_touches_only_known_module_globalspasses withKIROCREW_INTEGRATION=1.scripts/local-gate.py --dry-runselects 1,167 backend + 830 frontend related files, over the campaign's 600-file local cap, so the floor above ran instead; CI owns the full matrix.mypy src/kiro_crew/is clean (3,108 files).-n0and one at-n 3: 22 passed each time.Manual verification
N/A: a pure move; the facade, mirror and composition guards, the importer floor and an installed-wheel import of every new module cover it (a wheel built from a
git archiveexport, each new module imported from the installed copy under an isolated HOME).Docs, citations and source-text pins
docs/system-specs/modules/learn-cron-dashboard.md(updates); owner rows, a facade paragraph and the §5 heading indocs/system-specs/modules/knowledge.md;docs/feature-map/README.mdfacade note names both facades and their owners.file:line old -> new:setup.py:129handlers/updates.py:_changelog_path -> handlers/updates_channel.py:_changelog_pathsrc/kiro_crew/dashboard/kiro_readiness.py:190handlers/updates.py:1381(a stale line cite) ->handlers/updates_streams.py::_log_ringsrc/kiro_crew/cli_logging.py:271handlers/updates.py::apply_log_level->handlers/updates_streams.py::apply_log_levelsrc/kiro_crew/dashboard/ws.py:1349handlers/updates._safe_ws_send -> handlers/updates_streams._safe_ws_sendsrc/kiro_crew/slack/gateway_runtime/update_schedule.py:551dashboard/handlers/updates.py::_update_info ->dashboard/handlers/updates_verdict.py::_update_infosrc/kiro_crew/dashboard/state_parts/transcript_rows.py:62handlers/updates.py:api_stream->handlers/updates_streams.py:api_streamsrc/kiro_crew/dashboard/state_parts/status_payload.py:229handlers/updates.py) -> handlers/updates_verdict.py)src/kiro_crew/dashboard/status_counts.py:227handlers/updates.py imports this module -> handlers/updates_streams.py imports this modulesrc/kiro_crew/changelog.py:8dashboard/handlers/updates.py->dashboard/handlers/updates_channel.pysrc/kiro_crew/platform/feed_trust.py:5dashboard/handlers/updates.py->dashboard/handlers/updates_check.pysrc/kiro_crew/validation_parts/messaging_session_schemas.py:258(handlers/knowledge.py) -> (handlers/knowledge_sources.py)src/kiro_crew/knowledge/store.py:248dashboard/handlers/knowledge.pytakes -> Thedashboard/handlers/knowledge_*.pyowners taketest/test_cpp_seam_failclosed.py:777merge in dashboard/handlers/knowledge.py -> merge in dashboard/handlers/knowledge_lifecycle.pytest/test_cpp_seam_failclosed.py:948"""dashboard/handlers/knowledge.py must route -> """dashboard/handlers/knowledge_lifecycle.py must routetest/test_cse_2026_08_05_fixes.py:29clamp from knowledge.py source -> clamp from knowledge_agent_context.py sourcetest/test_dashboard_updates_coverage.py:2011the SSE arm inhandlers/updates.py-> the SSE arm inhandlers/updates_streams.pytest/test_knowledge_cross_thread.py:4(dashboard/handlers/knowledge.py -> (dashboard/handlers/knowledge_agent_context.pytest/test_build_version_override.py:11dashboard/handlers/updates.py::_local_version->dashboard/handlers/updates_verdict.py::_local_version,updates_check.py(re-wrapped onto :12)src/kiro_crew/dashboard/handlers/__init__.py:621(see updates.py) -> (see updates_streams.py)src/kiro_crew/slack/gateway_runtime/update_schedule.py:1179handlers/updates.py->handlers/updates_check.pysrc/kiro_crew/dashboard/handlers/sessions_parts/live_turn.py:212handlers/updates.py->handlers/updates_step_up.pysrc/kiro_crew/dashboard/part_stream.py:5handlers/knowledge.py->handlers/knowledge_ingest.pydocs/system-specs/modules/knowledge.md:624Source-scoped list API (dashboard/handlers/knowledge.py) -> Source-scoped list API (dashboard/handlers/knowledge_library.py)docs/system-specs/modules/knowledge.md:786_NO_SOURCEindashboard/handlers/knowledge.py->_NO_SOURCEindashboard/handlers/knowledge_library.pydocs/system-specs/modules/knowledge.md:608dashboard/handlers/knowledge.pytakes -> Theknowledge_<role>.pyowners ofdashboard/handlers/knowledge.pytakedocs/system-specs/modules/platform-context.md:966dashboard/handlers/knowledge.py— theSyncScheduler->dashboard/handlers/knowledge_lifecycle.py— theSyncSchedulerdocs/system-specs/modules/platform-context.md:448dashboard/handlers/updates.py, ->dashboard/handlers/updates_verdict.py,dashboard/handlers/updates_check.py,docs/system-specs/modules/app-kit-platform.md:897dashboard/handlers/knowledge.py), and neither ->dashboard/handlers/knowledge_sources.py), and neitherdocs/system-specs/modules/app-kit-platform.md:1778handlers/updates._safe_ws_send->handlers/updates_streams._safe_ws_senddocs/system-specs/modules/config.md:2662handlers/updates.py::apply_log_level_from_config->handlers/updates_streams.py::apply_log_level_from_configdocs/system-specs/modules/learn-cron-dashboard.md:230handlers/updates.py::_restart_gateway. ->handlers/updates_apply.py::_restart_gateway. It coalescesdocs/system-specs/modules/learn-cron-dashboard.md:4520_resolve_restart_targetindashboard/handlers/updates.py->_resolve_restart_targetindashboard/handlers/updates_apply.pydocs/system-specs/modules/instances.md:533dashboard/handlers/updates.py::_restart_gateway->dashboard/handlers/updates_apply.py::_restart_gatewaydocs/system-specs/modules/mcp-gateway-daemon-lifecycle.md:19dashboard/handlers/updates.py::_restart_gateway->dashboard/handlers/updates_apply.py::_restart_gatewaydocs/system-specs/modules/sel.md:188dashboard/handlers/updates.py| ->dashboard/handlers/updates_step_up.py|docs/system-specs/modules/governance.md:3685dashboard/handlers/updates.py, -> the update handler owners (dashboard/handlers/updates_verdict.pydocs/build/release.md:110src/kiro_crew/dashboard/handlers/updates.pyfolds ->src/kiro_crew/dashboard/handlers/updates_verdict.pyfoldsdocs/request-for-change/rfc-update-architecture.md:215dashboard/handlers/updates.py(_do_update_check) ->dashboard/handlers/updates_check.py(_do_update_check)docs/request-for-change/rfc-update-architecture.md:216dashboard/handlers/updates.py(api_update_apply) ->dashboard/handlers/updates_apply.py(api_update_apply)docs/request-for-change/rfc-update-architecture.md:801api_update_autoindashboard/handlers/updates.py->api_update_autoindashboard/handlers/updates_channel.py.github/file-line-cap-baseline.txtrows for both targets deleted (L45);.github/black-baseline.txtrow forknowledge.pydeleted;.github/subprocess-encoding-baseline.txtrow forknowledge.pydeleted (L57);error-code-baseline.jsonredistributed with--update, own rows only: totals unchanged (1044 / 18 / 38),_compliantkeeps main's value (2,767).src/kiro_crew/security_posture.pymain row 3,181, main 3,443 lines, HEAD 3,447 (+4): exact-pathNON_EGRESS_REDACTION_MODULESrows the drift guard requires, with no comment. The row stays as main has it.website/src/types/index.ts:195(_update_info→handlers/updates_verdict.py),website/src/utils/displayVersion.ts:2(_display_version→handlers/updates_verdict.py),website/src/pages/knowledge/SourceGroup.tsx:11andwebsite/src/pages/knowledge/index.tsx:41(list_items→handlers/knowledge_library.py),website/scripts/lib/stub-dashboard-api.mjs:86(get_stats→handlers/knowledge_library.py),website/scripts/capture-session-start-repeat.mjs:103(the restart refusal →handlers/updates_apply.py);website/playwright/logs.spec.ts:24is a test-file comment and stays.CI path references
None: no workflow path filter or explicit file list names
dashboard/handlers/updates.pyordashboard/handlers/knowledge.py;AUTOSDE.yaml'ssrc/kiro_crew/dashboard/handlers/**globs already cover the owners, and noSENSITIVE_GLOBSentry matches them. The edit tosrc/kiro_crew/security_posture.py(aSENSITIVE_GLOBSpath) brings in Sensitive Change Review; its template is posted as a PR comment for the head.Related Issues
Part of #20192
Follow-up: #21320 (comment citations in
website/**deferred under L50)Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.