Skip to content

fix(launcher): one transactional launch path for every analysis kind (S5) - #90

Merged
aMonteSl merged 2 commits into
v1.2.1from
claude/project-thread-kvvyg6-launcher
Nov 25, 2026
Merged

aMonteSl merged 2 commits into
v1.2.1from
claude/project-thread-kvvyg6-launcher

Conversation

@aMonteSl

Copy link
Copy Markdown
Collaborator

Requested by Adrián · project thread

Closes #77 (epic #72, S5: one unified, modular launcher).

What changes

Every launch (XR, LivePanel, VisualizeDOM) now runs as one transaction under a new LaunchControl (core/analysis/launch/launchControl.ts). Each session gets an abort signal, a 10-minute deadline and a teardown stack.

  • Order is fixed for every kind: pre-validation, then analysis, save, server, watcher. Each step that starts something records how to undo it.
  • Close Analysis while it is still analysing kills the Python child (the signal reaches the spawn through AsyncLocalStorage). No server or watcher is started afterwards, and no error is shown. This fixes LAUNCHER-7.
  • A server that cannot start no longer leaves the watcher running, and you get one error toast instead of two. This fixes LAUNCHER-5.
  • The deadline stops the launch and reports "took too long". This fixes LAUNCHER-10.
  • Same target, one session. targetKey() resolves the path, strips the trailing separator, and case-folds on win32 and darwin. The registry reserves the target before its first await, so concurrent launches yield one session. This fixes LAUNCHER-2 and LAUNCHER-17.
  • SSE and the file map are keyed by session id.
    • SessionServerManager and SseNotificationManager are deleted.
    • Close matches servers by metadata.sessionId only. The path-substring matching in serverControl is gone.
    • serverFactory releases a server that failed after creation.
  • Descriptors instead of restated tables.
    • analysisTypes.ts declares the analysis types (what the table shows) and launchKinds.ts the launch kinds (how a page is served).
    • Server capabilities, default controller views and router snapshot probes are now derived from them.
    • The orchestrator dispatches through resolveLauncher, which refuses unsupported combinations by name and does an own-property lookup.
  • Startup cleanup sweeps the folders the launchers actually write (storageFolders.ts). This fixes LAUNCHER-14.
  • Python output is read as UTF-8 (PYTHONIOENCODING/PYTHONUTF8, setEncoding), which matters on Windows.
  • Docs:
    • new guide apps/vscode-extension/docs/adding-an-analysis-type.md;
    • CHANGELOG [1.2.1] Fixed entry;
    • ARCHITECTURE.md pipeline diagram;
    • V1.2.1_STATUS.md session entry.

Verification

  • npm test: 1,113 of 1,113 pass, tsc clean, ESLint 0 errors and 155 warnings. The budget is lowered from 158 to 155.
  • New suite test/analysis/launchTransaction.test.cjs (15 tests):
    • targetKey per platform;
    • concurrent createSession;
    • teardown order and exactly-once;
    • a late push is undone at once;
    • deadline and supersede;
    • the pipeline:
      • success order (server, then watcher);
      • a server failure starts no watcher and shows one toast;
      • a watcher failure stops the server;
      • Close while analysing is silent and starts nothing;
      • the timeout rolls back;
    • signal propagation;
    • resolveLauncher;
    • swept folders;
    • the derived tables are unchanged.
  • The guardrail baseline was regenerated. Metrics improved: any.total 84→83, complexity.over10 53→52.
  • The browser runtimes are untouched, so the XR harnesses were not re-run for this PR.

Not in scope: progress notifications are not cancellable (Close Analysis is the cancel path). LAUNCHER-11 belongs to another story.


Generated by Claude Code

…(S5, #77)

Every launch (XR, LivePanel, VisualizeDOM) now runs as one transaction
under LaunchControl: an abort signal, a 10-minute deadline and a teardown
stack per session. The server starts before the watcher for every kind;
a failure, the deadline or Close Analysis kills the running Python
analysis and undoes the started steps newest first, exactly once. A closed
launch is silent; a failed one shows one error.

- targetKey(): one identity per target (case-folded on Windows/macOS,
  no trailing separator); the registry reserves a target before its first
  await, so concurrent launches yield one session (LAUNCHER-2, -17)
- SSE channel and file map keyed by session id; SessionServerManager and
  SseNotificationManager removed; the close path matches servers by
  metadata.sessionId only, never by path substring
- analysis types and launch kinds are descriptors (core/analysis/launch);
  server capabilities, default controller views and router snapshot
  probes are derived from them; resolveLauncher refuses unsupported
  combinations by name
- startup cleanup sweeps the folders the launchers actually write
  (LAUNCHER-14)
- Python output read as UTF-8 on every platform
- docs/adding-an-analysis-type.md; CHANGELOG [1.2.1] Fixed;
  test/analysis/launchTransaction.test.cjs (15 tests); guardrail baseline
  regenerated; ESLint warning budget 158 -> 155

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC
@aMonteSl aMonteSl added tfm Adds the issue to the TFM board automatically. Do not remove area: extension VS Code extension host (TypeScript): commands, launcher, servers, services area: testing Test suites, harnesses, verification and inventories stream: xr-bugfix-1.2.1 Epic #72: review and fix the XR environment, shipped in 1.2.1 labels Nov 25, 2026 — with Claude
@aMonteSl aMonteSl self-assigned this Nov 25, 2026
CHANGELOG [1.2.1] Fixed keeps both entries; guardrail baseline regenerated
for the lowered ESLint warning budget (158 -> 155).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC
@aMonteSl
aMonteSl merged commit e558a9c into v1.2.1 Nov 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: extension VS Code extension host (TypeScript): commands, launcher, servers, services area: testing Test suites, harnesses, verification and inventories stream: xr-bugfix-1.2.1 Epic #72: review and fix the XR environment, shipped in 1.2.1 tfm Adds the issue to the TFM board automatically. Do not remove

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants