Skip to content

feat(ui): delivery gate — embed SPA, bundle guard, smoke, apply lifecycle + legacy removal - #29

Closed
AndyTechnologies wants to merge 19 commits into
svelte-ui/pr2from
svelte-ui/pr3
Closed

AndyTechnologies wants to merge 19 commits into
svelte-ui/pr2from
svelte-ui/pr3

Conversation

@AndyTechnologies

Copy link
Copy Markdown
Owner

Summary

  • Phase 4 delivery of the svelte-ui re-platform: compiled-SPA embedding, binary smoke contract, and full apply/validate lifecycle wired to the real /api/ui/* API
  • Deletes the legacy src/ui/* static SPA (task 4.4) now that the Svelte bundle is authoritative and verify passed

Changes

  • build:binary embeds dist/ui via --asset; build:ui includes bundle guard (app JS gzip ≤ 100 KB)
  • scripts/binary-smoke.ts + test: embedded /ui + /ui/assets/*, disk fallback, UI_DIR override, traversal 404
  • Editor validate/apply adapters now send real payloads (validate (id, payload), apply {chains:{...}}) matching the static-UI envelope
  • Pipelines view refreshes on navigation so an editor apply is observable without reload
  • e2e harness: mutable applied chains, _e2e/reset seam, apply spec drives a real start node — 17/17 green
  • Removed src/ui/* (legacy) and updated references (README, index.ts, server.ts, port-oracle comment)

Testing

  • bun test 716 pass / 0 fail
  • bun run test:e2e 17/17
  • bun test ./scripts/binary-smoke.test.ts 6/6
  • bun run typecheck + bun run lint clean
  • bun run build:ui 32.14 KB gzip ≤ 100 KB
  • sdd-verify passed (0 CRITICAL; WARNING-1 resolved in fdb3f02)

…ract (task 4.3)

Real binary spawns + HTTP probes from throwaway temp cwds verify embedded
/ui and /ui/assets/* serving, SPA fallback with malicious-segment 404,
disk fallback priority, and UI_DIR override. Shared helpers drive both the
CLI (smoke:binary) and the bun:test suite (skips when dist/llm-proxy or
dist/ui is missing).
CF-01 remediation: vite base "/ui/" so compiled index.html references
/ui/assets/* (SPA booted only under /ui); default rest base "" so
fetch(undefined/api/...) never reaches the wire; e2e-smoke regex accepts
the optional /ui/ prefix on hashed assets.
The adapter was binding EditorApi.validate to validatePipeline(id, payload)
and apply to applyConfig with broken argument shapes: validate passed the
payload as the URL id ([object Object]), apply sent no config at all, so
both dialogs 400'd before showing results.

- EditorApi.validate(payload, pipelineId?) maps to
  validatePipeline(pipelineId ?? "nuevo-pipeline", payload)
- EditorApi.apply builds the raw chain config {chains:{...}} from the
  working graph (displayName, llama-server provider, nodes, edges), matching
  the static UI envelope that POST /api/ui/apply accepts
Fix the two remaining RED e2e specs against the real editor contract:

- POST /api/ui/apply was always 400 on an empty editor (nodes.min(1)); the
  spec now inserts a start node first, like a real user would.
- The harness now simulates persistence: reload records applied chains and
  chainSummaries() derives from them, so the Pipelines list reflects the
  editor apply round-trip (3 items after applying).
- POST /api/ui/_e2e/reset rebuilds tracker/bus/app so execution counts stay
  deterministic even when Playwright reuses a running server locally.
Phase 4.4 deletes src/ui/* now that the compiled Svelte bundle in dist/ui
is authoritative. Update the resolver comment in index.ts, the uiDir
docstring in server.ts, the README env/architecture map, and the graph-model
port-oracle comment that documented the rollback boundary.
All 22 svelte-ui tasks complete: legacy src/ui deleted (6898c5f), gate green
(792 unit, 17 e2e, 6 binary-smoke), final verify pending on this branch.
The legacy src/ui/graph-model.test.js (76 cases) was deleted with src/ui/*
in 4.4; its behavior is covered by the TS port oracle, so coverage is
unchanged but the suite now reports 716 pass / 1807 expects. Verify
WARNING-1 resolved.
Archive: move change folder to openspec/changes/archive/2026-09-07-svelte-ui/
(byte-identical diff -r readback); merge delta spec into
openspec/specs/dashboard-ui/spec.md (2 MODIFIED, 7 ADDED, 6 untouched
preserved; 15 requirements / 31 scenarios). All 22 tasks complete, verify
PASS WITH WARNINGS (0 CRITICAL).
Five dashboard regressions across editor and views:

- Align editor CSS selectors with the actual Svelte SVG output so nodes
  are no longer black blocks and edges/ports are visible. Renamed
  .node-box/.socket/.edge-line to .node-rect/.port/.graph-edge and added
  the data-cond attribute for branch-aware port styling.
- Reset rafId after each drag frame so pointer-move keeps scheduling rAF
  updates; the node no longer freezes after the first frame.
- Rest-service now unwraps the agents/status object so the store receives
  the AgentEntry[] array, fixing "no agents shown".
- Model status now uses processLoaded as the real VRAM signal: models
  registered but not loaded report "registrado" instead of "cargado".
- Add the missing node inspector as the third editor-layout column, with
  read-only properties and a delete action.

Verified: typecheck, lint, 716 unit tests (0 fail), UI build 33 KB gzip.
…k agent configure

- Ports: start no input, end no output; input/output neutral, only
  condition branches color true=green / false=red (data-cond)
- Edges render as one graph-edge group with curve+tip paths (dropped the
  double stroke); keyed each includes the guard (fixes each_key_duplicate
  when two condition branches target the same node)
- connectNodes dedupes by (from, to, guard)
- New addLoopMember store action adds a block to a loop body directly,
  instead of relying on positional bucketing that silently failed for a
  keyboard-created loop (fix: members no longer expose external sockets)
- Agents view: one-click Configurar with per-agent pending/error feedback
- Tests: red spec first, then fixes; +component/store tests and E2E
  regression describe for port/graph identity; 733 unit + 22 E2E green
@AndyTechnologies

Copy link
Copy Markdown
Owner Author

Closed without merge: this svelte-ui chain (pr1→pr2→pr3→tracker) was an earlier UI iteration superseded by PR #30 (WeaveLLM 0.1.0 full rewrite, merged as squash). Its work is already absorbed into master via the rewrite; merging it now would reintroduce the legacy UI over the new Astro 7 surface.

@AndyTechnologies
AndyTechnologies deleted the svelte-ui/pr3 branch September 21, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant