Repository navigation
fix(app): the harness control's instance ask carries the placement directory (#1799) - #1801
Merged
aarontrowbridge merged 1 commit intoOct 15, 2026
Conversation
…rectory (#1799) The composer's harness control never rendered in the hub-client posture: its GET/POST /amicode/harness were the app's only instance-scoped amicode asks with no ?directory= placement key. In the local posture the panel origin's extension proxy forwards the bare ask to the bound engine, so it worked; at the hub origin the frontdoor cannot place a directory-less instance ask and answers 200 text/html with the SPA index, so the parse collapses and the control's <Show when={liveHarnessState()}> gate stays never-true (live-verified: bare /amicode/harness -> text/html, ?directory=… -> application/json registry). - harness.ts: harnessRoute(directory) builds the placement-correct ask; refreshHarnessState (extracted from the component, the mount effects' body) is sequenced so only the latest ask adopts — the two mount effects can race and a stale SPA-index answer clobbered a fresh registry during hub member switches (observed live). - harness-control.tsx: the mount effects keep the server.current and stream-connected guards and thread the per-directory SDK context's directory; the switch POST carries the same route. - new harness-control.test.tsx drives the mount-path seam under both postures' server contexts (hub frontdoor placement semantics mocked as observed live) + pins the wiring; suite delta: zero new failures (byte-identical failure set vs base), +12 passing.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1799.
The picker bug, root-caused live (and the issue's suspicion FALSIFIED): it was not the server.current guard — that fires fine in the hub-client posture. The control's mount-path fetch was the app's ONLY instance-scoped ask carrying NO ?directory= placement key; the hub frontdoor cannot place a directory-less instance ask, so it landed on the default backend and was answered 200 text/html (the SPA index) — amicodeGet's res.json() threw, the catch adopted undefined, the render gate never opened. In the local posture the extension service's #1549 exception forwards the bare ask, which is why local worked and hub didn't. Second defect in the same chain: two concurrent mount effects, last-writer-wins on a module singleton — the control rendered racily during member switches.
Fix (posture-correct, guard preserved): harnessRoute(directory) builds the placement-correct ask (bare ask preserved for empty directory = local posture); refreshHarnessState extracted and sequenced so only the latest ask adopts; the directory threaded through both mount effects and the switch POST from the per-directory SDK context (the same source every other instance-scoped composer fetch rides).
12 new tests drive both postures' mount-path seam (hub registry mocked with the frontdoor's live-observed placement semantics: directory'd → JSON, bare → SPA index); RED shown two ways (mechanical + behavioral: reverting to the bare ask fails 10/12); local posture, no-connection degradation, stale-answer sequencing, and wiring all pinned.
Director gates: scoped 19/0; full app suite 1613/25 with the failure set diff-empty vs base (+12 passing); drift PASS. Post-deploy confirmation (pickers.mjs shows /amicode/harness?directory= firing + the control rendered) is the director's probe, after the deploy decision (HITL).