feat(feedback): סימון "יושם" מפעיל CEO לקיפול הלקח לקובץ הנכון
סוגר את לולאת פידבק-יו"ר→ידע-סוכנים. עד כה resolve רק עדכן את ה-DB; עכשיו לחיצה ב-/feedback מעירה את ה-CEO שמקפל את הלקח לקובץ לפי הקטגוריה. - paperclip_client.py: wake_ceo_for_feedback_fold() — יוצר issue ב-Paperclip עם הלקח + rubric ניתוב (style→SKILL.md, wrong_structure→block-schema, אחר→lessons.md), מעיר CEO. משכפל את דפוס wake_for_precedent_extraction - db.py: get_chair_feedback(id) — שליפת הערה בודדת עם case_number/appeal_type - app.py: resolve endpoint מקבל fold (ברירת מחדל true); BackgroundTask fire-and-forget; guard — רק עם lesson_extracted. מחזיר fold_queued - legal-ceo.md: dispatch ל-feedback_fold_ + סעיף "קיפול הערת יו"ר" עם rubric - frontend: useResolveFeedback מקבל fold; /feedback שולח fold=true עם toast; drafts-panel שולח fold=false (bookkeeping per-case, בלי קיפול כפול) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,9 +42,14 @@ function FeedbackCard({ fb }: { fb: ChairFeedback }) {
|
||||
|
||||
const onResolve = () => {
|
||||
resolve.mutate(
|
||||
{ feedbackId: fb.id, applied_to: [] },
|
||||
{ feedbackId: fb.id, applied_to: [], fold: true },
|
||||
{
|
||||
onSuccess: () => toast.success("ההערה סומנה כיושמה"),
|
||||
onSuccess: (res) =>
|
||||
toast.success(
|
||||
res.fold_queued
|
||||
? "סומנה כיושמה — הלקח נשלח ל-CEO לקיפול לקובץ הידע"
|
||||
: "ההערה סומנה כיושמה",
|
||||
),
|
||||
onError: (e) =>
|
||||
toast.error(e instanceof Error ? e.message : "שגיאה בסימון"),
|
||||
},
|
||||
|
||||
@@ -153,8 +153,10 @@ export function DraftsPanel({
|
||||
}
|
||||
|
||||
function handleResolve(id: string) {
|
||||
// fold=false: resolving from the per-case panel is bookkeeping only.
|
||||
// Folding the lesson into the knowledge files is driven from /feedback.
|
||||
resolveMutation.mutate(
|
||||
{ feedbackId: id, applied_to: [] },
|
||||
{ feedbackId: id, applied_to: [], fold: false },
|
||||
{
|
||||
onSuccess: () => toast.success("ההערה סומנה כמטופלת"),
|
||||
onError: () => toast.error("שגיאה בעדכון"),
|
||||
|
||||
@@ -89,13 +89,17 @@ export function useResolveFeedback() {
|
||||
mutationFn: ({
|
||||
feedbackId,
|
||||
applied_to,
|
||||
fold,
|
||||
}: {
|
||||
feedbackId: string;
|
||||
applied_to: string[];
|
||||
/** When true (default server-side), wakes the CEO to fold the lesson
|
||||
* into the right knowledge file. Pass false for pure bookkeeping. */
|
||||
fold?: boolean;
|
||||
}) =>
|
||||
apiRequest<{ status: string }>(
|
||||
apiRequest<{ status: string; fold_queued: boolean }>(
|
||||
`/api/feedback/${feedbackId}/resolve`,
|
||||
{ method: "PATCH", body: { applied_to } },
|
||||
{ method: "PATCH", body: { applied_to, ...(fold === undefined ? {} : { fold }) } },
|
||||
),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: feedbackKeys.all });
|
||||
|
||||
Reference in New Issue
Block a user