fix(learning): honest 3-channel curator card + capture curator findings (source='curator')
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 9s

תיקוני-מבנה ללולאת-הלמידה (TaskMaster #157):

1. כרטיס ה-curator (/training טאב "אוצֵר") ספר decision_lessons WHERE source='curator'
   — ערך שאף מסלול-קוד לא כתב → תמיד 0. עוצב-מחדש (דרך שער-העיצוב Claude Design, אושר)
   להציג ביושר את שלושת ערוצי-ההזנה לכותב: דיסטילציה→appeal_type_rules (180, זורם),
   פאנל→decision_lessons (81, ממתין), אוצֵר→source='curator'. get_curator_stats שוכתב.

2. drift ספ↔סוכן: 07-learning.md §1.1 + INV-LRN3 קבעו שהאוצֵר רושם ממצאים כ-decision_lesson
   source='curator', אך הסוכן כתב comments בלבד — הממצאים האיכותיים אבדו. נוסף כלי-MCP
   record_curator_findings + §A.5b ב-hermes-curator.md (read-only נשמר; הצעה מגודרת-שער).

3. get_recent_decision_lessons(limit=15) חתך בשקט — נוסף WARN על מה שנחתך (חוקה §6);
   הפתרון האמיתי = סינתזת-לקחים (TaskMaster #158).

Invariants: מקיים INV-LRN1/G10 (שער-יו"ר), INV-LRN3 (לכידה מובנית), INV-IA2/IA5 (מקור-אמת
יחיד), G12 (leak-guard עובר), G2 (אין מסלול מקביל — אותם מאגרים). פער-מימוש פתוח מתועד:
§A לא רץ אוטומטית על mark-final (pipeline-wake exits) → נדחה לתכנון נפרד.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 21:20:05 +00:00
parent 4de555367d
commit be774ab87e
9 changed files with 392 additions and 58 deletions

View File

@@ -302,14 +302,39 @@ export type CuratorFinding = {
created_at: string;
};
// One decision_lessons channel split by the INV-LRN1 review gate.
export type LessonChannelStats = {
total: number;
approved: number;
proposed: number;
rejected: number;
};
// The three honest learning channels that feed the writer (INV-IA2/IA5).
// Earlier this was a single flat count of source='curator' — which nothing
// wrote, so it always read 0 while the panel/methodology channels carried all
// the real learning. See get_curator_stats (web/app.py).
export type CuratorStats = {
total_findings: number;
decisions_with_findings: number;
decisions_total: number;
// LRN-5 (INV-IA5): the count of curator lessons with review_status='approved'
// (the real INV-LRN1 writer gate) — replaces the old findings_applied, which
// counted the informative-only applied_to_skill flag.
findings_approved: number;
channels: {
// A — Claude draft↔final distillation → methodology overrides; flows now.
distillation: {
discussion_rules: number;
transition_phrases: number;
items_total: number;
pairs_folded: number;
pairs_total: number;
};
// B — DeepSeek+Gemini panel → decision_lessons; flows when chair-approved.
panel: LessonChannelStats & {
decisions: number;
by_practice_area: Record<string, number>;
};
// C — curator agent's qualitative findings → decision_lessons (source='curator').
curator: LessonChannelStats & {
decisions_reviewed: number;
};
};
recent_findings: CuratorFinding[];
};