[web] SvelteKit app: editor, run, ops, regex, saved #2

Closed
opened 2026-10-23 21:25:06 -05:00 by nicolas_naranjo · 2 comments
Owner

status: tracking issue for the web agent.

Scope:

  • Scaffold web/ with bunx sv create (svelte, TS, minimal, no add-ons)
  • API types from openapi.yaml via openapi-typescript
  • Retro-terminal UI per docs/design.md (no component library, dark only)
  • Editor canvas (@xyflow/svelte): states as nodes, transitions as edges
  • Panels: alphabet, run+trace, ops, regex, saved automata
  • API client + dev proxy in vite.config.ts
  • deploy/web.Dockerfile (multi-stage bun)

Gate: bun run build green. Branch: agent/web.

status: tracking issue for the web agent. Scope: - Scaffold `web/` with `bunx sv create` (svelte, TS, minimal, no add-ons) - API types from `openapi.yaml` via openapi-typescript - Retro-terminal UI per `docs/design.md` (no component library, dark only) - Editor canvas (@xyflow/svelte): states as nodes, transitions as edges - Panels: alphabet, run+trace, ops, regex, saved automata - API client + dev proxy in vite.config.ts - `deploy/web.Dockerfile` (multi-stage bun) Gate: `bun run build` green. Branch: `agent/web`.
Author
Owner

status: DONE — PR opened: #10 (branch agent/web).

  • web/ scaffolded (SvelteKit 3, Svelte 5 runes, @xyflow/svelte 1.7, adapter-node) + deploy/web.Dockerfile
  • All four tabs (EDITOR / OPS / REGEX / SAVED), design.md applied verbatim, API client over generated types, error envelopes surfaced as terminal error lines (engine 501s render gracefully)
  • Gates: bun run check 0 errors, bun run build green, docker image build verified, API_UPSTREAM forwarding + 502 envelope tested against a stub api
  • Semantic decisions in the PR body: adapter-node + optional same-origin forwarder via API_UPSTREAM (compose snippet included for the render/integrator agents), Kit 3 #lib + explicit-extension imports, symbols treated as opaque strings
  • Open contract question in #5 (ε representation) — no frontend change needed either way

Closes #2 once the PR merges.

status: DONE — PR opened: https://git.yhkze.net/k8s-services/rgxr/pulls/10 (branch `agent/web`). - `web/` scaffolded (SvelteKit 3, Svelte 5 runes, @xyflow/svelte 1.7, adapter-node) + `deploy/web.Dockerfile` - All four tabs (EDITOR / OPS / REGEX / SAVED), design.md applied verbatim, API client over generated types, error envelopes surfaced as terminal error lines (engine 501s render gracefully) - Gates: `bun run check` 0 errors, `bun run build` green, docker image build verified, API_UPSTREAM forwarding + 502 envelope tested against a stub api - Semantic decisions in the PR body: adapter-node + optional same-origin forwarder via `API_UPSTREAM` (compose snippet included for the render/integrator agents), Kit 3 `#lib` + explicit-extension imports, symbols treated as opaque strings - Open contract question in #5 (ε representation) — no frontend change needed either way Closes #2 once the PR merges.
Author
Owner

status: review fixes pushed to PR #10 (agent/web @ 57279d5).

[MAJOR] header spoofing in the API_UPSTREAM forwarder — fixed. src/hooks.server.ts now strips client-supplied remote-user / remote-name / remote-email / remote-groups (case-insensitive) before proxying to the upstream — the api trusts those headers per docs/CONTRACT.md, so they were forgeable identity. The forwarding helpers moved to a pure module src/lib/server/forwarding.ts with a regression test (src/lib/server/forwarding.test.ts, bun's built-in runner via bun test — no new runtime dep, @types/bun types-only). X-Forwarded-* is left untouched and the hook only ever runs when API_UPSTREAM is set (compose/dev); in k8s/prod it is inert and Traefik + Authelia own those headers. Verified end-to-end against the rebuilt image with a header-echoing stub api: spoofed Remote-* headers never reach the upstream, other headers pass through unchanged.

[MINOR] dropped the unused @sveltejs/adapter-auto devDependency (scaffold leftover; bun.lock regenerated).

[NIT] corrected the vite.config.ts comment — vite preview does not inherit server.proxy (it has its own preview.proxy); built-app same-origin api access comes from the API_UPSTREAM hook.

Gates: bun test 5/5 pass · bun run check 0 errors · bun run build green.

status: review fixes pushed to PR #10 (`agent/web` @ `57279d5`). **[MAJOR] header spoofing in the API_UPSTREAM forwarder — fixed.** `src/hooks.server.ts` now strips client-supplied `remote-user` / `remote-name` / `remote-email` / `remote-groups` (case-insensitive) before proxying to the upstream — the api trusts those headers per docs/CONTRACT.md, so they were forgeable identity. The forwarding helpers moved to a pure module `src/lib/server/forwarding.ts` with a regression test (`src/lib/server/forwarding.test.ts`, bun's built-in runner via `bun test` — no new runtime dep, `@types/bun` types-only). `X-Forwarded-*` is left untouched and the hook only ever runs when `API_UPSTREAM` is set (compose/dev); in k8s/prod it is inert and Traefik + Authelia own those headers. Verified end-to-end against the rebuilt image with a header-echoing stub api: spoofed `Remote-*` headers never reach the upstream, other headers pass through unchanged. **[MINOR]** dropped the unused `@sveltejs/adapter-auto` devDependency (scaffold leftover; `bun.lock` regenerated). **[NIT]** corrected the `vite.config.ts` comment — `vite preview` does not inherit `server.proxy` (it has its own `preview.proxy`); built-app same-origin api access comes from the `API_UPSTREAM` hook. Gates: `bun test` 5/5 pass · `bun run check` 0 errors · `bun run build` green.
Ghost added this to the SCRUM project 2026-10-23 22:39:21 -05:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
k8s-services/rgxr#2
No description provided.