refactor(export): שם קובץ טיוטת-הביניים → טיוטה-טענות_הצדדים_{N} (הנחיית חיים)
במקום "טיוטת-ביניים-v{N}.docx" — שם מדבר יותר: "טיוטה-טענות_הצדדים_{N}.docx".
הפורמט הסופי ("טיוטה-v{N}") לא משתנה.
- docx_exporter._draft_naming: (prefix, sep) פר-מצב; interim=("טיוטה-טענות_הצדדים","_"),
final=("טיוטה","-v"). glob/parse משתמשים ב-rsplit(sep,1) — נכון גם כשה-prefix
עצמו מכיל "_".
- app.py _generation_output_ready + frontend pickLatestVersioned: matcher-prefix
מעודכן; regex-הגרסה עוגן-לסוף /[_v](\d+)$/ (ה-"_" שבתוך הprefix לא מבלבל).
- docstrings + legal-ceo.md + הערות מעודכנים לשם החדש. types.ts (auto-gen)
יתעדכן ב-api:types.
שינוי-נתון (שם-קובץ), לא layout — בגדר חריג-שער-העיצוב. tsc+eslint+py_compile
ירוקים. הערה: ייצור-השם רץ ב-MCP המקומי (host) → דורש reload; ה-matchers
בקונטיינר (Coolify).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,7 +91,7 @@ function formatDate(epoch: number): string {
|
||||
/**
|
||||
* Pick the newest export file whose name starts with `prefix`, preferring the
|
||||
* highest v-number and falling back to the latest created_at. Used by the
|
||||
* "הפקת מסמכים" card to surface the most recent טיוטת-ביניים-* file (#214).
|
||||
* "הפקת מסמכים" card to surface the most recent טיוטה-טענות_הצדדים_* file (#214).
|
||||
*/
|
||||
function pickLatestVersioned(
|
||||
files: ExportFile[] | undefined,
|
||||
@@ -100,7 +100,10 @@ function pickLatestVersioned(
|
||||
const matches = (files ?? []).filter((f) => f.filename.startsWith(prefix));
|
||||
if (!matches.length) return null;
|
||||
const withVer = matches.map((f) => {
|
||||
const m = f.filename.match(/v(\d+)/);
|
||||
// Version is the trailing integer, after either "-v" (final) or "_"
|
||||
// (interim: טיוטה-טענות_הצדדים_{N}). Anchor to the end so the "_" inside
|
||||
// the interim prefix isn't mistaken for the version separator.
|
||||
const m = f.filename.match(/[_v](\d+)(?:\.\w+)?$/);
|
||||
return { ...f, version: m ? parseInt(m[1], 10) : null };
|
||||
});
|
||||
withVer.sort((a, b) => {
|
||||
@@ -172,8 +175,8 @@ export function DraftsPanel({
|
||||
|
||||
// ── "הפקת מסמכים" derived state (#214) ──
|
||||
// Latest interim ("party-claims") partial draft in the exports table — the poll
|
||||
// target for button 2. The CEO writes it as טיוטת-ביניים-{case}-vN.docx.
|
||||
const latestInterim = pickLatestVersioned(exports, "טיוטת-ביניים-");
|
||||
// target for button 2. The CEO writes it as טיוטה-טענות_הצדדים_{N}.docx.
|
||||
const latestInterim = pickLatestVersioned(exports, "טיוטה-טענות_הצדדים_");
|
||||
const summaryReady = Boolean(summary?.markdown);
|
||||
|
||||
function handleGenerateSummary() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Generation runs on the host (claude_session → claude -p), NOT in the container,
|
||||
* so the trigger endpoints return 202-accepted and the UI POLLS for completion:
|
||||
* • summary → GET /api/cases/{n}/research/party-claims-summary (200 = ready)
|
||||
* • interim draft → the exports list grows a "טיוטת-ביניים-{n}-vN.docx" file
|
||||
* • interim draft → the exports list grows a "טיוטה-טענות_הצדדים_{N}.docx" file
|
||||
* (polled via useExports — see exports.ts).
|
||||
*
|
||||
* The full-decision export ("הפק טיוטת החלטה מלאה") is NOT here — it reuses the
|
||||
@@ -137,7 +137,7 @@ export function useGenerateInterimDraft(caseNumber: string) {
|
||||
`/api/cases/${caseNumber}/generate/interim-draft`,
|
||||
{ method: "POST" },
|
||||
),
|
||||
// The result lands in the exports list (טיוטת-ביניים-*.docx, polled by
|
||||
// The result lands in the exports list (טיוטה-טענות_הצדדים_*.docx, polled by
|
||||
// useExports); re-arm the status chip so it shows the new run immediately.
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({
|
||||
|
||||
Reference in New Issue
Block a user