Retrofit: tighten yod-bet pattern, add cover-block fallback
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 6s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 6s
The "על כן" pattern for block-yod-bet was too greedy and matched mid-discussion
transitional sentences (e.g. "על כן, במקום בו..."), which caused forward-scan
to skip block-yod-alef ("סוף דבר") via the pointer advance.
Tightened to require an operative subject (אנו / הערר / הוועדה / ועדת הערר)
so terminal "על כן, אנו מחליטים" still matches but mid-block transitions don't.
Added structural_fallback for cover blocks (alef/bet/gimel/dalet) — these are
template metadata not present in user-edited DOCX bodies. Inject zero-content
anchors so apply_user_edit can still target them later. The frontend toast
distinguishes real content gaps from fallback anchors.
Also expanded heading patterns based on training corpus inspection:
- block-vav: על המקרקעין חלות / במצב התכנוני / התכניות החלות
- block-zayin: טענות העוררת
- block-chet: עיקר תגובת המשיב
- block-tet: הדיון בוועדת הערר
For case 1130-25, this raises detection from 6/12 to 11/12 blocks — only
block-yod-bet remains missing (Daphna's edit ends at "סוף דבר" + numbered
ruling, no terminal "ההחלטה" or "על כן אנו מחליטים" paragraph).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -115,15 +115,17 @@ export function DraftsPanel({
|
||||
onSuccess: (data) => {
|
||||
const added = data.bookmarks_added?.length ?? 0;
|
||||
const missing = data.missing_blocks?.length ?? 0;
|
||||
const fallback = data.structural_fallback?.length ?? 0;
|
||||
const realDetected = added - fallback;
|
||||
if (data.apply_status === "completed" || data.apply_status === "ok") {
|
||||
if (added > 0) {
|
||||
toast.success(`הועלה: ${data.filename} — זוהו ${added} בלוקים`);
|
||||
if (realDetected > 0) {
|
||||
toast.success(`הועלה: ${data.filename} — זוהו ${realDetected} בלוקי תוכן`);
|
||||
} else {
|
||||
toast.success(`הועלה: ${data.filename}`);
|
||||
}
|
||||
if (missing > 0) {
|
||||
toast.warning(
|
||||
`שימו לב: ${missing} בלוקים לא זוהו — ייתכנו בעיות בתיקונים עתידיים`,
|
||||
`שימו לב: ${missing} בלוקי תוכן לא זוהו — בדוק את הכותרות`,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -35,6 +35,7 @@ export type UploadResult = {
|
||||
active_draft?: string;
|
||||
bookmarks_added?: string[];
|
||||
missing_blocks?: string[];
|
||||
structural_fallback?: string[];
|
||||
apply_status?: string;
|
||||
};
|
||||
|
||||
@@ -155,6 +156,7 @@ export function useRetrofit(caseNumber: string) {
|
||||
active_draft_path: string;
|
||||
bookmarks_added: string[];
|
||||
missing_blocks: string[];
|
||||
structural_fallback?: string[];
|
||||
}>(`/api/cases/${caseNumber}/exports/${filename}/retrofit`, {
|
||||
method: "POST",
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user