Commit Graph

2860 Commits

Author SHA1 Message Date
Joseph Doherty 0a78d0e3b8 fix(central-ui): Log on the inbound editor diagnostics host; sandbox Log delegates to Instance (Task 7 review) 2026-09-09 12:34:03 -04:00
Joseph Doherty b2418b41e1 feat(scripts): Log global on the compile surface and both Test Run sandboxes; trust-gate pin (D4) 2026-09-09 12:21:23 -04:00
Joseph Doherty 964bb9b2d7 Merge wt/step-logs-t5: Task 5 Log global wired into ScriptRuntimeContext 2026-09-09 12:15:29 -04:00
Joseph Doherty ee8a8e9d3d fix(site-runtime): step-log review — trace-flag-gated ES step scope, shared-script Log, formatter guard
Task 5 code-review follow-ups:
- I1: ExternalSystemHelper gates its TraceStepScope on a new isTraced ctor arg
  (default false for direct construction), not on `_traceSink is not null` — a
  traced run without an inline collector still writes durable ScriptLog rows
  that must name their step.
- I2 (design §5): an inline shared script now SHARES its caller's ScriptLogger
  via the new `sharedLog` ctor param — one line cap, one anchor, one closing
  row. Consequence documented on the Log property: a shared script's lines
  carry the PARENT run's ExecutionId and land on the parent's ScriptRun node.
- M3: TraceCapturingLogger swallows a throwing formatter — most of what it
  captures is best-effort "audit write failed" warnings logged from inside a
  catch block, and a formatting exception must not escape that path.
- Tests: ApiCall step attribution, traced-without-collector, shared-script
  logger sharing, nested batch/wait scope attribution + unwind, throwing
  formatter; test (c) now also pins the anti-recursion property (EmitLog must
  log through the undecorated logger).

CompileSurfaceParityTests stays red until Task 7 mirrors Log on ScriptCompileSurface.
2026-09-09 12:10:17 -04:00
Joseph Doherty a45857ddd6 fix(management): FlowDebugRunner trace sinks use the collector's low-priority lane for ScriptLog rows (build fix after Task 2's Add(lowPriority:)) 2026-09-09 11:54:08 -04:00
Joseph Doherty 9b2dd6ec40 Merge wt/step-logs-t12: Task 12 2026-09-09 11:53:48 -04:00
Joseph Doherty db0fed495d Merge wt/step-logs-t11: Task 11 2026-09-09 11:53:47 -04:00
Joseph Doherty e149d96b9d Merge wt/step-logs-t8: Task 8 2026-09-09 11:53:47 -04:00
Joseph Doherty 488d955ba2 feat(site-runtime): Log global on ScriptRuntimeContext/ScriptGlobals; runtime lines attributed by TraceStepScope (D4-D6) 2026-09-09 11:53:06 -04:00
Joseph Doherty 7b3eaea891 fix(central-ui): FlowStepDetail keeps a still-valid tab across steps; refresh-persistence tests (Task 12 review) 2026-09-09 11:50:28 -04:00
Joseph Doherty 547aaefb02 fix(central-ui): exception subtitle parses inner/generic exception names; pill+badge test (Task 11 review) 2026-09-09 11:47:58 -04:00
Joseph Doherty 7245c63c62 fix(inbound-api): ScriptLog durable write before the Live sink; prove the central write (Task 8 review) 2026-09-09 11:47:23 -04:00
Joseph Doherty 9d9bb70a15 Merge wt/step-logs-t4: Task 4 ScriptLogger, TraceStepScope, TraceCapturingLogger 2026-09-09 11:42:59 -04:00
Joseph Doherty aaec993b84 fix(site-runtime): TraceCapturingLogger rejects double-wrapping; ScriptLogger clip keeps surrogate pairs (Task 4 review) 2026-09-09 11:42:40 -04:00
Joseph Doherty 16cdf0adf1 Merge wt/step-logs-t3: Task 3 FlowGraphBuilder log-line attachment 2026-09-09 11:40:05 -04:00
Joseph Doherty 2eaaed559f feat(inbound-api): Log global for method scripts, central ScriptLog rows when traced (D4/D5) 2026-09-09 11:39:25 -04:00
Joseph Doherty 4f33bff3fb feat(central-ui): FlowStepDetail Log tab — exception block, level-filtered lines, cross-step hint (D8) 2026-09-09 11:38:28 -04:00
Joseph Doherty a4a35bfa97 feat(central-ui): FlowGraphView log-count badge and exception subtitle on failed nodes (D8) 2026-09-09 11:36:42 -04:00
Joseph Doherty 14fb8c889b feat(site-runtime): ScriptLogger (Log global), TraceStepScope, TraceCapturingLogger (D4-D7) 2026-09-09 11:34:17 -04:00
Joseph Doherty 395f38e019 feat(commons): FlowGraphBuilder folds ScriptLog rows onto their owning step (D2) 2026-09-09 11:33:54 -04:00
Joseph Doherty a45c0d47c5 Merge wt/step-logs-t2: Task 2 FlowTraceCollector low-priority lane 2026-09-09 11:33:15 -04:00
Joseph Doherty 25b127b3e3 Merge wt/step-logs-t1: Task 1 Commons ScriptLog kind + FlowStep.ErrorDetail/Logs 2026-09-09 11:29:51 -04:00
Joseph Doherty b73962831c refactor(commons): FlowTraceCollector.Add(lowPriority:) instead of a fourth public method (Commons method-count constraint) 2026-09-09 11:28:01 -04:00
Joseph Doherty befb0e3805 feat(commons): FlowTraceCollector low-priority lane for log lines (D7) 2026-09-09 11:26:05 -04:00
Joseph Doherty 8f88cab7f8 feat(commons): ScriptLog audit kind, log-line trace extra, FlowStep.ErrorDetail/Logs (flow-debugger step logs D1/D3) 2026-09-09 11:25:55 -04:00
Joseph Doherty 99330453ab docs(plans): Flow Debugger step logs + exceptions — design, mockup, 15-task plan (v1.4) 2026-09-09 11:21:52 -04:00
Joseph Doherty f69333776a Merge feat/instance-picker: area-tree instance picker combobox for Flow Debugger + Debug View
Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 10:06:51 -04:00
Joseph Doherty c27b22ead3 chore(plans): instance picker — all tasks complete, gate evidence
Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 10:04:45 -04:00
Joseph Doherty 50eca87e99 Merge branch 'worktree-agent-a327a30cdb2e454ff' into feat/instance-picker 2026-09-08 10:01:47 -04:00
Joseph Doherty 52726cf30d fix(central-ui): Debug View reconnect guards the stored instance; drop select-era sort; deep-link-in-area test
Three final-review findings on the two picker pages:

1. DebugView's localStorage auto-reconnect restored the stored instance id with
   no membership check, where the ?instanceId= path has one — a stored instance
   that is no longer Enabled (or was deleted, or moved sites) is filtered out of
   the list the picker is handed, so the field rendered blank while the page held
   a non-zero id and auto-connected to it anyway. The guard now mirrors the
   deep-link path: forget the stored instance id, tell the operator, and leave the
   site selected and loaded so they can pick again.
2. FlowDebugger's _instances kept an OrderBy(UniqueName) from the flat <select>
   era; InstanceTreeBuilder sorts areas and instances itself.
3. The deep-link test is joined by one where the instance sits two areas deep, so
   the field text is pinned to resolve from the flat list with the panel never
   opened.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 10:01:22 -04:00
Joseph Doherty 4df0cec8d8 Merge branch 'worktree-agent-a710cd8085a729732' into feat/instance-picker 2026-09-08 10:00:40 -04:00
Joseph Doherty a33a2f4456 fix(central-ui): InstancePicker — keyboard activation selects/toggles through TreeView selection; aria-label/InputId; aria-controls only while open
ArrowDown moved focus into the tree, but the picker passed no Selectable /
SelectedKeyChanged, so Enter/Space on a treeitem only moved the roving tabindex —
the pick lived on the label span's @onclick, i.e. mouse only. The tree now runs in
Selectable mode and BOTH gestures arrive at one handler (OnTreeKeyActivatedAsync)
through TreeView's SelectedKeyChanged: an `i:{id}` key selects that instance, an
`a:{id}` key toggles the branch. The label's own @onclick is gone — the click
already bubbles into TreeView's content span, so a second handler there would fire
the callback twice. SelectedKey stays unbound (a combobox shows its pick in the
field, not as a row highlight, and binding it would arm TreeView's
selected-key-not-in-tree reset on every render while the pick is filtered out);
SelectedCssClass is emptied to match.

a11y: the field gains an accessible name via a new AriaLabel parameter (default
"Instance") and an optional InputId so a page can point a <label for> at it;
aria-controls is rendered only while the panel exists, instead of always pointing
at an id that is absent when closed.

Also drops the unused @using of Commons.Entities.Instances from the .razor.

Tests: keyboard activation on an instance row and on an area row, a
one-selection-per-gesture guard across mouse and keyboard, and the labelling
assertions. CentralUI suite 1331 passed / 0 failed; build 0 warnings.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 10:00:17 -04:00
Joseph Doherty 82f6fb949e fix(central-ui): keep the instance picker disabled until the site's instances have loaded (typing raced the load and was wiped)
Both Flow Debugger and Debug View enable the shared InstancePicker as soon as
_selectedSiteId lands, but Blazor renders at the site-change handler's first
await — at which point the picker is still holding the PREVIOUS site's Areas /
Instances lists. Typing into the field in that window (an operator, or
Playwright's FillAsync, which waits only for "enabled") was silently lost: the
picker compares both lists by reference, so the freshly-assigned lists read as
"the site changed" and it clears the field text and closes the panel.

Both pages now hold an _instancesLoading flag across the whole load — set before
the first await, cleared in a finally so a fault or a site-scope refusal cannot
leave the picker disabled forever — and fold it into the picker's Disabled
expression. InstancePicker itself is unchanged.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:58:44 -04:00
Joseph Doherty b19da25d32 docs(plans): instance picker design — keyboard activation via TreeView selection, tab-out does not close, explicit handlers, loading gate
Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:56:07 -04:00
Joseph Doherty d3264ec1b1 Merge branch 'worktree-agent-a24fb696f5eee22f2' into feat/instance-picker 2026-09-08 09:49:19 -04:00
Joseph Doherty 8047de6903 fix(central-ui): Flow Debugger picker — site change clears the pick (test); wider column, shorter placeholder
Pins the site-change behaviour the picker's reference contract exists for: after
picking an instance, switching the site select empties both the page's
_selectedInstanceId and the picker's field text (the new site hands it a
different instance list), and leaves the script select on its placeholder.

Layout: the Instance column goes col-md-2 → col-md-3 so a full instance name
fits — the script-entry branch still sums to 8 of 12 (site 2 + instance 3 +
script 3), and Method never renders beside them — with the placeholder
shortened to "Search instances…" for the narrower field.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:49:05 -04:00
Joseph Doherty f32f08a4c7 Merge branch 'worktree-agent-a9d87141c744e7733' into feat/instance-picker 2026-09-08 09:48:25 -04:00
Joseph Doherty a0292d3063 fix(central-ui): Debug View picker — disabled-while-connected test; drop no-op handler; static label
Task 5 review follow-ups:

- New DebugViewInstancePickerTests.WhileConnected_ThePickerIsDisabled pins that
  a live connection locks the picker: both the input and the chevron carry
  `disabled`. It marks the page connected by reflection, the way the other
  DebugView page tests do (DebugViewAlarmTableTests) — driving the real gRPC
  stream is not available to a bUnit render.
- OnInstanceSelectionChanged() was already a no-op and its comment described the
  @bind that the picker replaced; deleted, and OnInstancePicked now just records
  the id (XML-documented).
- The ItemLabel lambda is hoisted to a private static InstanceLabel(Instance),
  passed as a method group.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:48:13 -04:00
Joseph Doherty 2ec0e63671 Merge branch 'worktree-agent-acdd9dc794506dee9' into feat/instance-picker 2026-09-08 09:45:55 -04:00
Joseph Doherty dd751be917 test(playwright): Flow Debugger instance row matched through the data-test contract
The instance row locator used Locator.GetByText scoped to the panel, which
bypasses the [data-test='flow-instance-row'] contract InstancePicker rows
are documented to carry. Match through the data-test attribute instead,
with an exact-text regex since the test only knows the instance name (not
its id, unlike Debug View's tests).

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:45:41 -04:00
Joseph Doherty a9db239075 Merge branch 'worktree-agent-af2a6023106279956' into feat/instance-picker 2026-09-08 09:45:38 -04:00
Joseph Doherty cccc6e82d2 Merge branch 'worktree-agent-a24fb696f5eee22f2' into feat/instance-picker 2026-09-08 09:45:25 -04:00
Joseph Doherty dfdf480fa1 test(central-ui): InstancePicker — closed-panel ArrowDown, Escape no-op; dispatcher-ordering and overflow notes
ArrowDown on a picker that has never been opened pins the deferred path where
_tree is still null when the keydown is handled: the panel opens in that render
pass and the roving tab stop lands on the first row in the next one. Escape on a
closed picker is pinned as a no-op.

Two notes, no behaviour change: FirstVisibleInstance records WHY it may trust
TreeView.IsExpanded (Blazor Server's single renderer sync context runs the render
plus the pending ExpandAll/CollapseAll before the next keydown is dispatched — an
await that genuinely yields inside OnAfterRenderAsync would break that), and the
stylesheet warns integrators that the absolutely-positioned panel is clipped by
any ancestor with overflow: hidden/auto.

The ArrowDown focus interop assertion is kept — it was stable across repeated
runs — with a comment marking the tabindex as the behavioural check.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:45:15 -04:00
Joseph Doherty 0f97317933 feat(central-ui): Flow Debugger picks the instance through InstancePicker
The script entry's flat instance <select> is replaced by the shared
InstancePicker combobox (design 2026-09-08 §3): the site's areas load
alongside its instances in LoadInstancesAsync and are held in fields, so the
picker sees one stable list reference per site and only closes its panel on a
real site change. Picking a row raises the id, which OnInstancePickedAsync
applies before running the unchanged OnInstanceChangedAsync — the deep link,
the localStorage restore and the site-scope gate are untouched.

Tests: the five instance-select .Change("7") call sites go through a
PickInstance helper (open the panel, click the data-instance-id row), plus a
new test that areas open collapsed and only reveal the instance once both
levels are expanded, and one that ?instanceId= shows the instance name in the
picker field.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:45:07 -04:00
Joseph Doherty 740f5fa6da Merge branch 'worktree-agent-a9d87141c744e7733' into feat/instance-picker 2026-09-08 09:44:43 -04:00
Joseph Doherty 1d622f536d feat(central-ui): Debug View picks the instance through InstancePicker
The flat instance <select> on Debug View is replaced by the shared
InstancePicker area-tree combobox (design 2026-09-08 §3): the page now loads
the site's areas alongside its Enabled instances in LoadInstancesForSite and
hands both lists to the picker with ItemLabel = "UniqueName (State)",
Disabled="@_connected" and DataTestPrefix="debug-instance".

Both lists are now REPLACED rather than cleared in place wherever the site
changes (LoadInstancesForSite, StartFresh) — the picker compares Areas and
Instances by reference and a new object is what tells it the site changed.
The ?siteId=/?instanceId= deep link and the localStorage reconnect keep
setting _selectedInstanceId directly; the picker reads it on parameter set,
so both paths are unchanged.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:44:26 -04:00
Joseph Doherty 45daf31194 Merge branch 'worktree-agent-acdd9dc794506dee9' into feat/instance-picker 2026-09-08 09:43:51 -04:00
Joseph Doherty 07c5d53f39 test(playwright): drive the instance picker on Flow Debugger and Debug View
Flow Debugger's script-entry instance selection and Debug View's instance
selection both go through the shared InstancePicker combobox now instead of
a flat <select>. Update the tests to type into the {prefix}-input, wait for
the matching {prefix}-row, and click it; keep the <select>-polling helper
for the site select, which is unchanged.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:43:37 -04:00
Joseph Doherty a071433096 docs: instance picker on Flow Debugger + Debug View
Note the shared InstancePicker combobox (2026-09-08 design) replacing
the flat instance <select> on both pages, in Component-CentralUI.md's
Flow Debugger and Debug View sections and the CLAUDE.md Flow Debugger
bullet.

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:43:04 -04:00
Joseph Doherty 1c665d3acb chore(plans): instance picker tasks 2-3 complete
Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
2026-09-08 09:40:12 -04:00