[DEV-1438] Wire CLI to session-scoped judge-facts endpoints#13
Merged
alexeyzimarev merged 2 commits intomainfrom Apr 13, 2026
Merged
Conversation
Matches the server-side pivot in kurrent-io/Kurrent.Capacitor#476: judge facts are now scoped to the session's **project (repo)** and shared among all team members working on it, rather than siloed per-user. Client-side changes: - Endpoint URLs: GET /api/judge-facts?category=X -> GET /api/sessions/{id}/judge-facts?category=X POST /api/judge-facts -> POST /api/sessions/{id}/judge-facts - JudgeFactPayload drops source_session_id (URL-bound now). - Prompt template rewritten to frame retained facts as *project-level* observations, with updated examples and an explicit anti-example ("Alice tends to force-push" — individual, not codebase-level). - FetchAllJudgeFactsAsync takes sessionId so per-category GETs hit the correct session-scoped URL. Sessions without a detected repo get empty fact lists from the server, so judges silently see "(no patterns retained yet)" — no special-casing needed on the CLI side. Existing EvalCommand tests continue to pass without changes (ParseVerdict, ExtractRetainFact, Aggregate, FormatKnownPatterns, BuildQuestionPrompt are all server-independent). Full suite 205/205, AOT publish clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review Summary by QodoWire CLI to session-scoped judge-facts endpoints
WalkthroughsDescription• Migrate judge-facts endpoints from user-scoped to session-scoped (repo-level) • Update API URLs to include sessionId in endpoint paths • Remove SourceSessionId from JudgeFactPayload (now URL-bound) • Rewrite prompt template to emphasize project-level patterns over user-level • Update examples to reflect codebase conventions and anti-examples for individual behavior Diagramflowchart LR
A["User-scoped<br/>judge-facts"] -->|"Migrate to"| B["Session-scoped<br/>judge-facts"]
B -->|"URL includes"| C["sessionId parameter"]
D["JudgeFactPayload<br/>with SourceSessionId"] -->|"Remove field"| E["Payload without<br/>SourceSessionId"]
F["User/individual<br/>patterns"] -->|"Reframe as"| G["Project/codebase<br/>patterns"]
File Changes1. src/kapacitor/Commands/EvalCommand.cs
|
Code Review by Qodo
1.
|
Review response on PR #13: FetchAllJudgeFactsAsync (and the other session- scoped URLs in this file) interpolated sessionId directly into the path without escaping. Most sessionIds are GUIDs, but meta-session slugs are free-form and KAPACITOR_SESSION_ID could in principle carry anything, so reserved URL characters would corrupt the path. Encode once at the top of HandleEval and reuse the escaped form for the four session-scoped URLs in EvalCommand: /eval-context (existing), /evals (existing), /judge-facts GET, /judge-facts POST. The category query parameter is also escaped for hygiene even though the canonical four categories are safe ASCII. Note: the same raw-interpolation pattern exists in other CLI commands (RecapCommand, WhatsDoneCommand, etc.). Not fixing those here to keep the PR focused; a follow-up could centralize URL construction. Full suite 205/205, AOT publish clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Matches the server-side pivot in kurrent-io/Kurrent.Capacitor#476: judge facts are now scoped to the session's project (repo) and shared among all team members working on it, rather than siloed per-user.
Changes
Sessions without a detected repo get empty fact lists from the server, so judges silently see "(no patterns retained yet)" — no special-casing on the CLI.
Depends on kurrent-io/Kurrent.Capacitor#476.
Test plan
🤖 Generated with Claude Code