Skip to content

feat: add runtime actor ref and personal workspace in Relay - #186

Merged
sanchitrk merged 1 commit into
canaryfrom
feat/actor-local-workspace
Nov 30, 2026
Merged

sanchitrk merged 1 commit into
canaryfrom
feat/actor-local-workspace

Conversation

@sanchitrk

@sanchitrk sanchitrk commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Introduces the single-user local runtime actor baseline in core (uid 0 / gid 0 equivalent) and gives each Relay account a personal workspace with slug = "local", setting the foundation for future multiplayer workspaces and Zanzibar-style authorization without adding actor or workspace columns to the harness database.

Schema (@codeworksh/schema)

  • Added @codeworksh/schema/actor (ActorRef, root = { id: "local", scope: "local" }, isRoot, and Current Context.Reference defaulting to root).
  • Added WorkspaceSlug, DEFAULT_PERSONAL_WORKSPACE_SLUG ("local"), DEFAULT_PERSONAL_WORKSPACE_NAME ("Personal Workspace"), isPersonalWorkspace, and slug on Relay.Workspace.
  • Added optional personalWorkspaceName query parameter on GET /v1/me and Relay.BadRequest (400) on POST /v1/workspaces.

Harness & Host (packages/harness, packages/codework)

  • Re-exported Actor from @codeworksh/harness/effect and annotated Control (prompt, run, interrupt) and Loop.run spans with codework.actor.id and codework.actor.scope. No harness SQLite changes.
  • Added outer HostActor and actorOf(principal) in packages/codework/src/server/principal.ts and scoped Actor.Current per RPC call in door.ts.

Relay (infra/relay)

  • Added migration 2026113001_workspace_slug adding workspace.slug NOT NULL and UNIQUE (account_id, slug) with backfill.
  • First /v1/me creates the personal workspace (slug = "local", named from personalWorkspaceName when supplied, else "Personal Workspace"), always ordered first.
  • Added infra/relay/src/slug.ts to generate unique ID-tailed slugs for team workspaces on POST /v1/workspaces while refusing "local" (400).

Desktop & Docs (apps/web, docs/internals)

  • Desktop passes the signed-in Clerk user's display name as personalWorkspaceName on /v1/me, defaults to the personal workspace, badges it as Personal in the switcher, and shows Personal · Only you instead of disabled team member invites.
  • Updated 00_glossary.md, 04_runtime.md, and 10_relay.md.

Testing

  • vp run verify (build, format, lint, package typechecks, knip): passed
  • vp check on modified apps/web files & vp run --filter @codeworksh/web typecheck: passed
  • packages/harness/test/control.prompt.test.ts & runner.loop.test.ts: 80/80 passed
  • packages/codework/test/telemetry.test.ts, server.test.ts, pair.test.ts: 50/50 passed (updated telemetry.json snapshot)
  • infra/relay/test/me.test.ts: 3/3 passed against local Postgres & Clerk (default "Personal Workspace", client-passed "Sanchit K", "Local" refusal, generated unique slugs)
  • Live clean-install run against fresh local Relay, RPC server (.scratch/home), and Electron app via agent-browser: verified personal workspace creation (slug = "local", name = "Sanchit"), "Local" 400 inline error, and team workspace creation (slug = "plasma-sensor-of-sub-level-cc137ed4").

Built with Gemini in Antigravity.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@sanchitrk
sanchitrk merged commit d848910 into canary Nov 30, 2026
3 checks passed
@sanchitrk
sanchitrk deleted the feat/actor-local-workspace branch November 30, 2026 09:32
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