fix(calibration): drop block-yod + per-cell guard + incremental write (#208) #365
Reference in New Issue
Block a user
Delete Branch "worktree-agent-aeea23e1387d8d3cb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
מה ולמה
ריצת-כיול חיה של
scripts/calibrate_effort.py(#208, מוזג ב-PR #360) קרסה ואיבדה ~2 שעות עבודה. הלולאה per-(תיק,בלוק,effort) ב-_run()קראה ל-_score_cellללא טיפול-שגיאות; כשהגיעה ל-block-yod(בלוק הדיון),block_writer.write_blockזרקValueError("לא ניתן לכתוב בלוק דיון ללא כיוון מאושר…")כי בלוק-הדיון דורש כיוון-מאושר (brainstorm → approve_direction) שתיקי-הכיול חסרים. החריגה הפילה את כל הריצה, ומכיוון שהדוח נכתב רק בסוף ב-main()— כל הייצורים שכבר הושלמו אבדו.שלושה תיקוני-עמידות (ללא שינוי לוגיקת-מדידה/ניקוד — G2):
block-yodהוצא מ-CALIBRATABLE_BLOCKS(ברירת-מחדל) — מחוץ לתחום WS5 של טיוטת-הביניים וגם לא-ניתן-לכיול standalone (דורש כיוון-מאושר). נשמר ב-VALID_BLOCKSחדש כך שאפשר עדיין לכפות--blocks block-yodידנית._run()— כל כשל של תא בודד (תיק,בלוק,effort) נרשם כ-warning (case/block/effort/error) ומדולג, לעולם לא פטאלי. הגנה-לעומק לכפיית block-yod וגם ל-rate-limits חולפים באמצע-ריצה._write_reportנכתב אחרי כל בלוק שמסתיים (tsמושחל ל-_run), כך שקריסה מאוחרת בגריד לא מאבדת בלוקים שהושלמו. צורת ה-JSON/MD זהה — תוצאות חלקיות פשוט משמיטות בלוקים שטרם נגמרו מ-by_block. הכתיבה הסופית ב-main()נשארת.Invariants — הצהרה (חובה)
_score_cell/block_distance_to_final/recommend_effort/aggregate_cellלא נגעתי.צ'קליסט — פרוטוקול כתיבת-קוד
docs/spec/00-constitution.md+ ספ-התחום הרלוונטי לפני הכתיבהdocs/spec/gap-audit.md— אין נגיעה ב-GAP/FU ממופה--self-testALL PASS (14/14)אימות
mcp-server/.venv/bin/python scripts/calibrate_effort.py --self-test→ ALL PASS (14/14 assertions)python -c "import ast; ast.parse(open('scripts/calibrate_effort.py').read())"→ נקיblock-yodהוסר מברירת-המחדל:CALIBRATABLE_BLOCKS = [block-he, block-vav, block-zayin, block-chet, block-tet, block-yod-alef];VALID_BLOCKSכוללblock-yodלכפייה ידנית. לכן--dry-runבברירת-מחדל אינו מציג block-yod.scripts/SCRIPTS.mdעודכן לתיאור ההתנהגות החדשה (כתיבה אינקרמנטלית, שער-per-תא, block-yod מחוץ-לברירת-מחדל).🤖 Generated with Claude Code
A live calibration run crashed with no error handling and lost ~2h of work: the per-cell loop in _run() reached block-yod (discussion), block_writer.write_block raised ValueError("לא ניתן לכתוב בלוק דיון ללא כיוון מאושר…") because the discussion block needs an approved direction calibration cases don't have, and since the report was only written at the very end of main(), every completed generation was lost. Three robustness fixes (no metric/scoring change — G2): 1. Drop block-yod from default CALIBRATABLE_BLOCKS — out of WS5 interim-draft scope AND structurally non-calibratable standalone (needs brainstorm→approve_direction). Kept in new VALID_BLOCKS so a user can still force it via --blocks block-yod. 2. Per-cell try/except in _run(): any single (case, block, effort) cell failure is logged as a warning (case/block/effort/error) and skipped, never fatal — defense-in-depth for a forced block-yod and for transient rate-limits mid-run. 3. Incremental persistence: _write_report flushes after each completed block (ts threaded into _run), so a crash later in the grid never loses finished blocks. JSON/MD shape unchanged — partial results omit not-yet-done blocks from by_block. --self-test: ALL PASS (14/14). block-yod gone from --dry-run defaults. Invariants — נוגע / מקיים: - G8 (eval-harness robustness) — partial results persist; a single-cell failure is non-fatal; the harness survives block-yod's missing-direction raise and rate-limits. - G2 (מקור-מדידה יחיד) — no metric-path change; _score_cell / block_distance_to_final / recommend_effort / aggregate_cell untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>