docs(plans): add Plan 0 (workspace foundation) and Plan A (desktop skeleton)

Plan 0 · Workspace 底座一等化 (2-3 weeks, blocks Plan A):
  - Phase 0.1 workspaces + workspace_memberships tables with default
    seed; backfill workspace_id onto existing platform_accounts and
    tenant_monitoring_quotas.
  - Phase 0.2 Actor/Claims/JWT add PrimaryWorkspaceID; Login/Refresh
    inject via GetPrimaryWorkspaceForUser query.
  - Phase 0.3 WorkspaceScope middleware driven from Actor only (query
    params rejected); wired to /api/tenant/events / accounts /
    publish-jobs / tasks / monitoring whitelist.
  - Phase 0.4 sqlc queries for platform_accounts and
    tenant_monitoring_quotas filter by workspace_id; ≥10
    cross-workspace penetration test cases.
  - Phase 0.5 workspace-sensitive cache keys.
  - Phase 0.6 monitoring domain migration: rename
    primary_installation_id → primary_client_id; service / handler /
    projection / recovery / cleanup / seed all consume workspace_id;
    regression tests.
  - Phase 0.7 /api/auth/me returns primary_workspace; admin-web memo.
  - Phase 0.8 CI lint guard enforces workspace_id injection on
    desktop lines.
  - Phase 0.9 server-derived SSE topic library + exit-bar smoke +
    code review checklist.

Plan A · 桌面客户端骨架穿透 (5-6 weeks):
  - Phase A.0 CDP spike matrix for Doubao (0.5w, blocks A.4).
  - Phase A.1 server protocol + DB: desktop_clients /
    platform_accounts / desktop_tasks / publish_jobs / attempts /
    traces; lease / LeaseFromParked (strict CAS) / Park / Extend /
    Complete / ReconcileTask / WebCancel queries; RabbitMQ fanout +
    Redis presence + offline→online reclaim; 11-case lease protocol
    integration suite.
  - Phase A.2 Electron desktop-client runtime with modules:
    session-registry, view-pool (hot/cold), vault + vault-export,
    lease-manager, rate-limiter, keep-alive, circuit-breaker,
    crash-recovery, api-client, sse-client, tracing (Alpha scope).
  - Phase A.3 packages/ui-shared H1: design tokens (CSS vars +
    AntD theme light/dark); useAccountSelection composable;
    MarkdownPreview / AccountCard / TagMultiSelect / HealthBadge /
    useSseSubscription components; admin-web no-regress integration.
  - Phase A.4 Doubao monitor adapter based on A.0 matrix.
  - Phase A.5 Toutiao publish adapter with manual parked recovery.
  - Phase A.6 PublishArticleModal H2 rewrite (account-level
    multi-select on useAccountSelection; SSE progress panel; deep
    link for manual review).
  - Phase A.7 fake server + fake platforms + Playwright _electron
    E2E + Mac notarization CI + autoUpdater unit tests.
  - Phase A.8 exit-bar: real-account smoke playbook + chaos test
    (multi-instance SSE routing / parked survival across restarts)
    + plan-a-complete tag.

Plan 0 must complete and tag `plan-0-complete` before Plan A starts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 23:47:13 +08:00
parent e2f26b7468
commit 98f9e95875
2 changed files with 3176 additions and 0 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff