Conversation
dashboard_launcher restated /api/chat/capabilities as its own module-level constant while chat_server dispatches on it. The import is inside the probe: measured on this machine, a module-level import of chat_server raises the launcher import from ~12ms to ~120ms, and the launcher runs on a port that may hold no LoopX process at all. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
The census pins three shapes: the module-level binding, every Python literal, and the browser client's copy by file and count, so a new hardcoded fetch in either runtime fails here. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
same_runtime_forks 11 -> 10, same_runtime_fork_definitions 25 -> 23 and same_runtime_forks_semantic 9 -> 8, measured on this revision. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
|
CI triage for exact head The failed checks do not point to any of this PRs four changed files:
The PR changes only Current This explains the current red checks only; it is not an approval. The PR still needs exact-head review after the branch update. |
Goal And Delivered Outcome
inventory_ratchetsnote inloopx/semantics/vocabulary_v0.json, which makes a repeated module-level constant duplicate knowledge regardless of whether the copies currently agree./api/chat/capabilitiesis a wire identity with three owners.loopx/chat_server.py:100binds it and dispatches on it at line 1309;loopx/dashboard_launcher.py:19bound its own copy and probes with it at line 60 to decide whether an already-running server may be reused; and the shipped browser build fetches the same string inapps/presentation/dashboard/src/data/chat.ts:618. The two Python copies were also a counted fork in the generated inventory, so the drift smoke already treated them as one decision spelled twice.regression_parityrow shows the inventory now reportssame_runtime_forks=10/10,same_runtime_fork_definitions=23/23andsame_runtime_forks_semantic=8/8.mainatf49b4a008.Scope And Continuation
dashboard_launcher.pylost its module-level copy and readschat_server.CHAT_CAPABILITIES_PATHinside_probe_existing_chat, and three budgets were re-anchored to the values measured on this revision. The import sits in the probe, not at module level, for a measured reason: with a module-level import, importingloopx.dashboard_launchercost 118-121ms across three samples against 10-13ms on base, because the launcher is imported byloopx/cli_commands/support_control.pyand frequently runs against a port that holds no LoopX process at all; with the deferred import the same three samples are 12-13ms. The probe path itself is unchanged, and the guard pins it behaviourally.apps/presentation/dashboard/src/data/chat.ts:618keeps its own literal. A browser module cannot import a Python constant, and that file is being changed by in-flight PR fix(chat): recover uncertain instructions after page reloads #5373. The copy is therefore declared by file and count inDECLARED_WEB_CLIENT_RESTATEMENTS, so a second hardcoded fetch, or removing the declared one without updating the census, fails the guard. A generated binding is the real fix and is out of scope here.chat_server.py:1315advertisesloopx_chat_capabilities_v1as an inline literal whiledashboard_launcher.py:21and the browser build declare the accepted set (chat.ts:143accepts both..._v0and..._v1). Advertised-versus-accepted is a per-surface policy decision, so merging them would erase a compatibility window rather than a duplicate. The one visible defect - the advertised version having no name in its owner module - is left as a follow-up with its file:line.Validation
afb94f9b8unitpassedtests/architecture/test_chat_capabilities_route_single_owner.py: 9 passed, covering the module-level binding scan, the Python literal census, the declared browser-build census, the owner's value, the launcher probe through a recordingHTTPConnection, the absence of a private copy in the launcher, and the generated inventory.integrationpassedtests/architectureplustests/canary: 1098 passed, 0 failed. Chat/dashboard selection (test_dashboard_command, bothtest_support_control_*,test_chat_server_cors,test_chat_startup_isolation,test_manager_channel_bindingand the new guard): 145 passed, 5 failed.staticpassedpython -m ruff checkclean on all changed files; configuredpython -m mypysucceeded for 19 source files;git diff --checkclean.python -m ruff format --diffflags the same pre-existing files on base and head, so no format finding is introduced.real_entrypointpassedtests/test_chat_startup_isolation.pystarts the real chat server and reads/healthzand/api/chat/capabilitiesover HTTP, so the owner's route is exercised as a live endpoint rather than a constant.regression_paritypassedtests/test_dashboard_command.py) and otherwise passes 136; the head adds 9 passing tests and no new failure. Those 5 fail for an environment reason this change cannot affect: the compiled Chat bundle is gitignored build output and is absent from the worktree, andexamples/loopx-chat-server-smoke.pystops on the same missing bundle on base and head. The drift smoke was run on both trees; every line is byte-identical except the ratchet line, which movessame_runtime_forks=11/11 -> 10/10,same_runtime_fork_definitions=25/25 -> 23/23andsame_runtime_forks_semantic=9/9 -> 8/8, withschema_version_same_runtime_forksunchanged at2/2.premergepassedloopx canary premergeover the exact four changed files completed 5 checks with 0 failures and no manual hold;loopx check --scan-pathreported the public boundary clean for the changed paths."/api/chat/" + "capabilities", passes the census, because the literal scan looks for the whole quoted value. That is a real gap in the guard, disclosed rather than papered over; the binding scan and the inventory assertion would still catch it if the consumer also bound a name.uv pip install -e ".[test]") instead ofuv sync --extra test, with Node 22.23.2 on PATH and the repository's npm dev dependencies installed, both required by the drift smoke.Frontend / Visual Evidence
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A. This PR does not claim progress against the shared Goal Authority or TypeScript migration RFCs.
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).Technical Direction
Notes For The Reviewer
same_runtime_forks10 -> 9 andsame_runtime_fork_definitions23 -> 21 re-measured on the integrated base;same_runtime_forks_semanticstays at the 8 measured here. The quoted values are measured againstf49b4a008.