Skip to content

refactor: unify Crabfleet coordinator architecture#44

Merged
steipete merged 110 commits into
mainfrom
codex/crabfleet-architecture-refactor
Jun 15, 2026
Merged

refactor: unify Crabfleet coordinator architecture#44
steipete merged 110 commits into
mainfrom
codex/crabfleet-architecture-refactor

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • split the Worker and browser app into focused route, service, repository, policy, and presentation modules
  • make Crabbox /v1/workspaces the only external workspace lifecycle protocol and /api/terminal/ws terminal protocol v2 the only browser, CLI, and gateway terminal transport
  • remove legacy providers, direct PTY client transport, compatibility aliases, fallback framing, permissive runtime selection, and obsolete host routes
  • replace browser-native session alerts, confirms, and prompts with accessible HTML dialogs, inline errors, stable focus handling, and explicit progress state
  • preserve and integrate scoped OpenClaw embed tickets, configurable interactive runtimes, embedded Ghostty WASM assets, and PTY readiness
  • centralize session creation, reconciliation, stop/finalization, credential-policy cleanup, GitHub Actions, OpenClaw supervision, and terminal persistence ownership

Architecture

  • reduce src/index.ts from the monolithic implementation to Worker entry points, routing, and dependency composition
  • move D1 access into repositories and transactional lifecycle owners
  • share one authorization, presentation, terminal-route, URL-security, deployment, and lifecycle policy per concern
  • split the frontend into state, routing, dialog, drawer, board, session workspace, and shell components
  • share Go control-plane models, HTTP behavior, rendering, and terminal framing between the CLI and SSH gateway

Behavior changes

  • terminal protocol v2 requires exact 20-byte Subscribe payloads and rejects old or trailing framing
  • zero terminal dimensions use the server's 120x34 defaults
  • unsupported runtime profiles, removed providers, old routes, and old environment aliases fail explicitly
  • shared terminal links remain read-only; scoped embed tickets may authorize session-specific terminal input
  • terminal and desktop availability are derived from current runtime capability and route readiness

Validation

  • pnpm test (604 tests)
  • pnpm check
  • pnpm build
  • go test ./...
  • go vet ./...
  • git diff --check
  • local checkpoint autoreview clean, confidence 0.87
  • full branch autoreview clean, confidence 0.72

steipete added 30 commits June 15, 2026 10:37
@steipete steipete requested a review from a team as a code owner June 15, 2026 20:13
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor: unify Crabfleet coordinator architecture This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete steipete merged commit df9bdc9 into main Jun 15, 2026
1 check 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