Skip to content

feat(workspace): connect evidence and practice - #62

Merged
Programcode merged 10 commits into
mainfrom
feat/workspace-evidence-practice
Sep 22, 2026
Merged

Programcode merged 10 commits into
mainfrom
feat/workspace-evidence-practice

Conversation

@Programcode

@Programcode Programcode commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Outcome

  • adds shared evidence with provenance and citations
  • adds opt-in team AI threads with server-owned, idempotent generation
  • carries explicit workspace context through Generate, Attack, Ask, Flowchart, Crossfire, and Sparring
  • persists resumable practice and explicitly shared private results without leaking personal sources, prompts, chat history, or Sparring drafts

Tested journey

  • create shared evidence and a named thread
  • run and reject/accept a reviewable AI rewrite
  • continue Crossfire and Sparring after reload
  • verify stale document epochs, revocation, and duplicate thread requests fail closed

Current head

22ffdb6d8a964cb22ac9bc93966a18fe9242c77d

Checks

  • typecheck
  • 98 focused client/store tests
  • 240 Edge tests
  • database and authenticated browser gates run in CI

Limits

  • browser AI uses a fixture response; no live provider claim
  • no staging run, remote migration, or backend deployment is authorized by the implementation plan

Summary by CodeRabbit

  • New Features
    • Added workspace practice tools for evidence, citations, shared AI threads, saved results, and document rewrites.
    • AI tools now support workspace context, shared sources, and persistent Crossfire and sparring sessions.
    • Added workspace navigation indicators and support for resuming incomplete practice sessions.
    • Private sparring sessions are preserved when entering a workspace and restored when leaving.
  • Bug Fixes
    • Improved workspace session persistence, authorization, and recovery across reloads and interrupted requests.
  • Localization
    • Added workspace collaboration and practice translations in English, Spanish, and Hungarian.

Copilot AI lite review requested due to automatic review settings September 22, 2026 17:59
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Sep 22, 2026 7:07pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 3bc5d1f4-4df6-4468-a659-33cefdbe5049

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae20b0 and c980b35.

📒 Files selected for processing (1)
  • src/test/stores/sparring-store.test.ts
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: c2852220-f865-4874-a24e-86c40af24f76

📥 Commits

Reviewing files that changed from the base of the PR and between 22ffdb6 and 4ae20b0.

📒 Files selected for processing (9)
  • src/lib/workspace/review.ts
  • src/pages/CrossfirePage.tsx
  • src/test/ai/sparring.test.ts
  • src/test/deno-assert-shim.ts
  • src/test/pages/FlowchartPage.test.tsx
  • src/test/workspace/review.test.ts
  • supabase/functions/ai/index.ts
  • supabase/migrations/20260921161000_workspace_evidence_practice.sql
  • supabase/tests/workspace_practice_test.sql

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds workspace evidence, shared AI threads, workspace-scoped tool requests, artifact persistence, document projections, and workspace-aware tool flows. It also adds authorization, session isolation, persistence, integration, SQL, and end-to-end tests.

Changes

Workspace collaboration

Layer / File(s) Summary
Workspace persistence and snapshot projections
services/collaboration/..., supabase/migrations/..., supabase/tests/...
Workspace sources, threads, messages, artifacts, RPCs, policies, generation state, and document text projections are added. Collaboration snapshots persist and backfill validated text projections.
Workspace context and AI authorization
src/lib/workspace/..., src/lib/ai/client.ts, supabase/functions/_shared/..., supabase/functions/ai/index.ts
Workspace context is validated and loaded from durable data. AI requests exclude private sources and custom prompts, use authorized workspace context, and settle thread generations.
Workspace practice interface and tool flows
src/components/features/workspace/..., src/pages/..., src/lib/stores/sparring-store.ts, src/locales/*.json
The workspace UI supports evidence, citations, shared threads, practice tools, rewrite suggestions, artifact inspection, workspace-scoped tool pages, and private-session restoration.
Workspace behavior validation
e2e/..., src/test/..., supabase/functions/_shared/...
Tests cover shared evidence and threads, AI request isolation, context validation, proposal serialization, session restoration, authorization, artifact persistence, and teammate reload recovery.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WorkspacePage
  participant WorkspacePracticePanel
  participant AIClient
  participant AIFunction
  participant WorkspaceDatabase
  WorkspacePage->>WorkspacePracticePanel: provide document and workspace state
  WorkspacePracticePanel->>AIClient: launch workspace-scoped practice request
  AIClient->>AIFunction: send workspace context
  AIFunction->>WorkspaceDatabase: authorize context and claim thread generation
  WorkspaceDatabase-->>AIFunction: return authorized context
  AIFunction-->>WorkspacePracticePanel: return AI result and workspace metadata
  WorkspacePracticePanel->>WorkspaceDatabase: persist thread or artifact result
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode
Programcode merged commit 7ed22d0 into main Sep 22, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — c980b35d Deployed Sep 22, 2026 by vercel[bot]
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.

2 participants