Skip to content

Feature: workshops with several templates, workshop-only participant access - #64

Merged
theUpsider merged 9 commits into
mainfrom
dev
Sep 25, 2026
Merged

theUpsider merged 9 commits into
mainfrom
dev

Conversation

@theUpsider

Copy link
Copy Markdown
Contributor

Summary

Implements SPEC-0022 (ADR-0010). Before this, joining a workshop gave a participant almost nothing that opening a template from the gallery did not, and anyone could create an anonymous workspace, read every workflow template and run graphs against the deployment's provider keys.

  • Workshops offer several templates. Each entry is pinned to a revision or follows the template's newest revision (resolved when a participant starts it; existing copies never change). New WorkshopTemplate table; the migration backfills every existing workshop as one pinned entry. Facilitators edit entries in /admin/workshops (add, reorder, pin or follow newest), also after publishing. Readiness is reported per template.
  • Workshop overview. After joining, participants see the workshop's templates and their own workflows. A single-template workshop still opens the editor directly. Starting a template twice opens the existing copy.
  • The workshop code is the only way in. POST /api/workspaces, POST /api/workflows/from-template, the public gallery (/templates) and the workflow list page are removed. /api/templates needs a workspace token and serves blocks only (editor palette). Joining is rate-limited per address (WORKSPACE_CREATE_MAX, default now 100/h).
  • Closed or expired workshops are read-only. WorkspaceGuard refuses every non-GET request with 403 workshop_closed; runs are re-checked on every request, so an open socket cannot keep running. The editor shows a banner and hides edit and run actions; the overview stays readable.

Breaking changes

  • Existing anonymous browser workspaces become inaccessible; retention removes the rows later.
  • A fresh deployment has no participant entry until a facilitator publishes a workshop (e.g. a long-running demo workshop).
  • Workshop.templateId / templateRevisionId are nullable and unused; a follow-up migration drops them.

Verification

  • Backend jest 622, frontend vitest 243, yarn typecheck, yarn lint:check, yarn lint:specs green.
  • Integration specs (yarn test:int) green, including the new workshop-templates.int-spec.ts; migration and backfill checked on a scratch database.
  • Playwright Chromium 13/13 green against the debug stack with 2 workers, including the new e2e/workshop-templates.spec.ts. Firefox not run locally.
  • Join, overview, parallel starts (five concurrent starts → one copy) and closing checked by hand against a running backend.

🤖 Generated with Claude Code

theUpsider and others added 9 commits September 25, 2026 16:19
Draft specification for workshops that offer several templates (pinned or
newest revision), a workshop overview, read-only closed workshops and the
removal of anonymous browser workspaces and template access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds WorkshopTemplate (SPEC-0022/FR-001): a workshop references its templates
as ordered entries, each pinned to a revision or following the template's
current revision. The migration backfills every existing workshop's pinned
revision as entry 0 and makes the legacy Workshop columns optional; they are
no longer read or written.

- WorkshopService.resolve no longer rejects a workshop whose template was
  unpublished; pinned entries survive that (FR-002), following entries become
  unavailable (FR-003).
- Readiness reports template, node-type and model checks per entry and fails
  the workshop only when no entry is ready (FR-016).
- Deleting the current revision of a template a workshop follows is refused
  with revision_current_in_use (FR-018); pinned entries count as references.
- The debug seed writes entries instead of the legacy columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC-0022/FR-011, FR-012. A workspace whose workshop is CLOSED or past its
expiry keeps its reads and loses every write:

- WorkspaceService resolves the workshop state with the token, and the
  WorkspaceGuard refuses state-changing requests with 403 workshop_closed,
  so a new write route cannot forget the rule.
- GraphHandlerService re-reads the workshop on every run request and refuses
  it with workshop_closed; a socket authenticates once at connect time and
  must not outlive the workshop.
- GET /workspaces/me returns the workshop (code, title, readOnly).
- The editor shows a read-only banner, stops autosaving, hides edit and run
  actions, and switches to read-only when a save or run is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC-0022/FR-006 to FR-010, FR-015, FR-017.

Backend:
- WorkshopParticipantService owns the join: a re-join returns the workspace
  whatever it holds, a new workspace is admitted through the per-address
  throttle (default raised to 100 per hour), and a single-entry workshop
  opens its copy instead of the overview. A failed start keeps the token.
- GET /workshops/current lists the workshop's entries in order with
  availability and the participant's copy; /entries/:id/structure previews
  one; POST /entries/:id/start opens the existing copy or creates it. Two
  racing starts converge on the oldest copy and the loser deletes its own.
- Entries are looked up through the caller's own workshop only.
- Readiness exposes startable(): revision resolves and node types load.
  Model availability no longer makes an entry unavailable.

Frontend:
- /workshop/:code joins or, with a stored token, shows the overview
  directly, which stays readable after the workshop closed.
- The overview shows template cards (Start / Continue / Preview structure)
  and "My workflows"; TemplateCard holds the shared card pieces.
- The editor's Templates button becomes Workshop, back to the overview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC-0022/FR-005, FR-016.

- POST /admin/workshops takes an ordered list of templates, each pinned to a
  revision or following the newest one; PUT /admin/workshops/:id/templates
  replaces them on a DRAFT or PUBLISHED workshop, updating entries in place
  so entry ids in open participant overviews stay valid. Duplicates, blocks,
  deleted templates and revisions of another template are refused.
- WorkshopAdmin moves out of AdminPage into its own file with an entries
  editor (template, newest or pinned revision, reorder, remove), a warning
  for unpublished templates that follow the newest revision, error reporting
  and readiness grouped per template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC-0022/FR-013, FR-014. BREAKING: anonymous browser workspaces and the
public template gallery are gone.

Backend:
- POST /workspaces is removed; WorkspaceService resolves no BROWSER token
  any more, so tokens issued for one open nothing (HTTP and socket).
  Retention still sweeps the old rows.
- POST /workflows/from-template and createFromTemplateSlug are removed:
  workflow templates reach participants only as workshop entries.
- GET /templates and /templates/:slug are workspace-scoped and serve block
  templates only; /templates/revisions/:id is removed.
- The debug seed no longer creates a browser workspace.

Frontend:
- The start page offers the workshop code, a way back to the workshop last
  joined in this browser, and the facilitator link. It makes no request.
- TemplatesPage, WorkflowListPage and the browser bootstrap are removed;
  /templates and /workflows lead to the active workshop's overview.
- The editor without a workshop session (outside LTI) goes to the start
  page, and the block palette sends the workspace token.
- A browser session stored before this change is dropped on first read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SPEC-0022 is implemented. Superseded requirements in SPEC-0001, -0002,
  -0003, -0004, -0007, -0008 and -0014 are rewritten to point at it (no
  anonymous browser workspace, no public gallery, several templates per
  workshop, read-only closed workshops).
- CLAUDE.md, architecture, module map, debugging notes, frontend rules,
  README and .env_template describe the workshop as the only participant
  entry, the overview, the entries editor and read-only enforcement.
- e2e: a workshop with two templates (pinned and newest) through overview,
  start, continue and preview; closing leaves the participant read-only and
  saves fail with workshop_closed; the start page offers only a code and the
  anonymous endpoints answer 401/404. Helpers publish workshops through the
  facilitator API. The template lifecycle test reads publication from the
  facilitator listing, since there is no public gallery any more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC-0022: workshops offer several templates (pinned or newest revision),
the workshop code is the only participant entry, and closed workshops are
read-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@theUpsider
theUpsider merged commit 3e7a5b5 into main Sep 25, 2026
3 checks passed
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