Repository navigation
feat: add personal current debate context - #72
Conversation
Record results without turning a save failure into a generation failure, add unit tests for the inactivity gate, motion choices, and auto-attach, add a two-debate full-stack journey, and move stubbed browser specs to the new header (tools open from Home and the Current Debate dashboard). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review fixes: - Ask records into the chat it has open, keeps loaded unsorted chats out of the Current Debate, starts fresh when the debate changes, and no longer hands an in-flight chat to a conversation started after clearing. - Regenerating a case and continuing a restored Crossfire round use the result's own debate, falling back to the Current Debate only when the motion matches. - Renaming or deleting a Library folder moves only the Current Debate's sources. - Deleting a debate drops its local work. - The one-time legacy cleanup is anchored to the recorded rollout time and measures last activity (edits, latest chat message), so later one-off work and recently used legacy work survive. pgTAP covers every purged table. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Entering or leaving one-off mode now resets Ask the same way a debate switch does, so one-off exchanges are never saved into the debate and an open debate chat does not continue in one-off mode. A reply still in flight when the scope changes is dropped. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The offline service-worker check now reaches Attack from Home, since the header no longer lists tools. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe application adds Current Debate controls and a dashboard, debate-scoped storage for sources and saved work, and one-off workflows. Tool requests, History, Library, and database records now use debate associations. Tests and architecture documentation cover these changes. ChangesCurrent Debate
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
actor User
participant GeneratePage
participant useDebateMotionGate
participant AIClient
participant SessionStore
User->>GeneratePage: Submit motion
GeneratePage->>useDebateMotionGate: Resolve debate target
useDebateMotionGate-->>GeneratePage: Return debateId or one-off target
GeneratePage->>AIClient: Generate case with debateId
AIClient-->>GeneratePage: Return generated case
GeneratePage->>SessionStore: Record case when debateId exists
Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Database checks limit work to its owner, but deleting a debate can leave a local copy of its work after an in-flight operation completes. The rollout also permanently removes qualifying older work across accounts. These lifecycle and deletion guarantees merit design review. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Note 🎁 Summarized by CodeRabbit FreeYour 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 |
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
- Ask and Factoids no longer save into the retained debate in one-off mode. - Workspace research is not autosaved into a personal debate. - Clear All deletes the debate it was confirmed in, even after a switch. - A debate load that started before a create or switch reloads instead of overwriting it. - The Library hides folders only other debates use. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Programcode has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Pushed 5787c15 in response to Greptile's review. It fixes one-off source saves, workspace autosave scope, the Clear All race, the hydrate race, and folders shared across debates (the Library now hides folders only other debates use). The cleanup migration and Crossfire reopening findings are answered inline. Local runs at 5787c15: 1079 unit tests passed, 226 browser tests passed with 6 skipped, 336 pgTAP tests passed, and 53 full-stack browser tests passed with 1 skipped. @greptileai please re-review. |
There was a problem hiding this comment.
Programcode has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Implements PR 1 of
.hermes/plans/2026-09-25_074255-current-debate-foundation.md: every signed-in user now has a personal Current Debate, and their work is filed under it.What changes
debatesandcurrent_debateswith RLS and composite foreign-key ownership, plus adebate_idon each result table. A private rollout timestamp is recorded when the migration runs.Destructive migration
20260926090100_legacy_debate_cleanup.sqlpermanently deletes legacy work that has no debate and hasn't been touched in the 30 days before rollout. "Touched" means created, edited (flowcharts, sparring rounds) or messaged (chats). Anything newer stays and shows as Unsorted. This must not be applied to staging or production without Adam's explicit approval. Nothing in this PR applies it remotely.Evidence
Screenshots and videos come from the full-stack Playwright journey (
e2e/full-stack/current-debate.spec.ts), run against the local Supabase stack and the fake OpenRouter. It covers two debates, homework and zoos: work on the first, switch to the second, add a source, get the different-motion prompt, check the zoo dashboard, then switch back and see only homework in History. It runs on desktop and mobile Chromium.Local results at
656aae6npm run verifysteps:./.superset/db-gate.sh:workspace-collaboration.spec.ts:353.How verify was run: the first full run hit a 5s timeout in
route-modules.test.tswhile the machine was under load. That test's cold import takes the same 2.1s onmain, and it passed on rerun. The second run stopped at the service-worker check, which still clicked the Attack link this PR removes from the header. The script now reaches Attack from Home, and every step from lint onward was rerun on the final commit. The unit tests, collaboration tests and Edge Function tests last ran one commit earlier, and that commit changes only a CSS class and the service-worker script. The strip unit tests (11) were rerun on the final commit.Not verified
created_atalone, is fixed.🤖 Generated with Claude Code
desktop-two-debate-journey.webm
mobile-two-debate-journey.webm
Summary by CodeRabbit
Do not merge until the cleanup, source ownership, wrong-debate deletion, hydration, and saved-round failures are fixed. The folder-filter concern alone would not block merging.
Fix with agent prompt
Summary
The PR adds personal Current Debates, debate-scoped work and sources, and a one-time legacy cleanup. It is not safe to merge yet: applying the cleanup migration can delete legacy work before approval; one-off and workspace sources can enter personal debates; a Library clear can delete the wrong debate’s sources; initial loading can undo newer debate actions; and saved Crossfire rounds cannot be reopened. The Library also offers folders belonging only to other debates, a non-blocking usability concern.
Reviews (1) · Last reviewed commit: "fix: wrap current debate strip actions o..."