czat: wady z kroku 0 w tabeli pilnych (język, UODO, liczba pojedyncza)
Pod angielską odpowiedzią kod pisze koniec umowy i sprawę/umowę po angielsku (tytuły terminów to dane, zostają). Termin procesowy poza postępowaniem cywilnym nie jest „sąd” ani „court”. „overdue by 1 day”, „in 1 day”. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uwxqFNnaMueKrFn1ogB8u
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bfbf02b4fc
commit
b637f96033
@@ -248,3 +248,18 @@ def test_p9_a_name_no_visible_record_carries_is_said_by_code_behind_the_switch()
|
||||
assert len(hit) == 1 and "„Zygzak”" in hit[0] and "nie ma " not in hit[0]
|
||||
for case in ("inflected", "exact", "off"):
|
||||
assert all(k != "atrium:istnienie" for k, _ in got[case]), case
|
||||
|
||||
|
||||
def test_step0_the_english_urgent_table_speaks_english_and_uodo_is_no_court() -> None:
|
||||
# Step-0 defects: Polish "Koniec umowy … kontrahent …" under an English answer, a UODO breach notice called
|
||||
# "court", "overdue by 1 days".
|
||||
got = _run("""const s = session(); const ix = await s.index();
|
||||
return { rows: s.f.chatPick('What are the most urgent deadlines this week?', ix).table.rows,
|
||||
uodo: ix.byKey.get('sygna:termin:d2').text, court: ix.byKey.get('sygna:termin:d4').text };""")
|
||||
rows = {r[1]: r for r in got["rows"]}
|
||||
uodo = rows["Zgłoszenie naruszenia do UODO"]
|
||||
assert uodo[2] != "court" and uodo[4] == "overdue by 1 day"
|
||||
assert rows["Odpowiedź na pozew"][2] == "court" and rows["Odpowiedź na pozew"][4] == "in 2 days"
|
||||
end = next(r for r in got["rows"] if "UM-2026-0006" in r[1])
|
||||
assert "Koniec umowy" not in end[1] and "kontrahent" not in end[5] and end[1].startswith("End of contract")
|
||||
assert "(sąd)" not in got["uodo"] and "(sąd)" in got["court"]
|
||||
|
||||
+12
-5
@@ -1529,7 +1529,7 @@ async function chatCompass(today) {
|
||||
// A question names a deadline group only in that group's own words. Bare substrings picked wrong groups:
|
||||
// "late" in "later", "tygodni" in "w ciągu dwóch tygodni" and "w zeszłym tygodniu", "this week" in "after
|
||||
// this week", "późn" in "najpóźniej".
|
||||
const CHAT_DEADLINE_KINDS = { procedural: 'termin procesowy (sąd)', internal: 'termin wewnętrzny', contractual: 'termin umowny', limitation: 'termin przedawnienia', hearing: 'termin rozprawy' };
|
||||
const CHAT_DEADLINE_KINDS = { procedural: 'termin procesowy', internal: 'termin wewnętrzny', contractual: 'termin umowny', limitation: 'termin przedawnienia', hearing: 'termin rozprawy' };
|
||||
const CHAT_DEADLINE_SHORT = { procedural: 'procesowy', internal: 'wewnętrzny', contractual: 'umowny', limitation: 'przedawnienie', hearing: 'rozprawa', umowa: 'koniec umowy' };
|
||||
const CHAT_ASKS_LATE = /po\s+termin|przekroczon|zaległ|spóźn|piln|overdue|past\s+due|\blate\b|urgent/iu;
|
||||
const CHAT_ASKS_WEEK = /(?<!(?:po|niż|after|than|beyond)\s+(?:w\s+)?)(?<![\p{L}])(?:(?:tym|ten|bieżąc\p{L}*|najbliższ\p{L}*)\s+(?:tydz|tygod)|this\s+week)/iu;
|
||||
@@ -1551,7 +1551,8 @@ async function chatSygna(today, names, contracts = []) {
|
||||
const deadlines = (await askerGet('sygna', 'deadlines?days=365')) || [];
|
||||
// The urgency facts in words: given "rodzaj internal" and a bare date, a model listed overdue titles with no
|
||||
// reason, and once called dates a week past "later than today".
|
||||
const kindPl = (d) => CHAT_DEADLINE_KINDS[d.kind] || 'termin (rodzaj ' + d.kind + ')';
|
||||
// "(sąd)" only where a court is the forum: a breach notice to UODO is procedural, not before a court (step 0, 13.11).
|
||||
const kindPl = (d) => d.kind === 'procedural' && chatCivil(d) ? 'termin procesowy (sąd)' : CHAT_DEADLINE_KINDS[d.kind] || 'termin (rodzaj ' + d.kind + ')';
|
||||
const late = (d) => `po terminie od ${chatPlural(-d.days_left, 'dnia', 'dni', 'dni')}`;
|
||||
for (const d of deadlines) {
|
||||
const state = d.completed_at ? 'wykonany' : d.days_left < 0 ? `PO TERMINIE, niewykonany, ${late(d)}` : `za ${d.days_left} dni`;
|
||||
@@ -1568,7 +1569,7 @@ async function chatSygna(today, names, contracts = []) {
|
||||
const ends = contracts.filter((c) => c.status === 'obowiazuje' && c.ends_on && chatDays(c.ends_on, today) <= 30)
|
||||
.map((c) => ({ title: `Koniec umowy ${c.number} „${c.name}”`, kind: 'umowa', due_date: c.ends_on, days_left: chatDays(c.ends_on, today),
|
||||
who: `umowa ${c.number}, kontrahent ${c.counterparty || 'nie wpisany'}`, ref: `umowa ${c.number}, ${c.counterparty || 'kontrahent nie wpisany'}`, owner: '-',
|
||||
key: 'compass:umowa:' + c.id }));
|
||||
key: 'compass:umowa:' + c.id, contract: c }));
|
||||
const open = [...deadlines.filter((d) => !d.completed_at).map((d) => ({ ...d, key: 'sygna:termin:' + d.id, ref: `sprawa ${d.matter_reference} „${d.matter_name || ''}”`,
|
||||
owner: names[d.owner_id] || '-', who: `sprawa ${d.matter_reference} „${d.matter_name || ''}”, ${chatWho(names, d.owner_id, 'odpowiada', 'osoba odpowiedzialna nie wpisana')}` })), ...ends]
|
||||
.sort((a, b) => a.due_date.localeCompare(b.due_date));
|
||||
@@ -3664,8 +3665,14 @@ function chatPick(question, index) {
|
||||
// No number asked: what is overdue or due within a week; contracts all (they are only the next 30 days).
|
||||
else if (!stress || stress[1][0] !== 'umowa') { const near = items.filter((d) => d.days_left <= 7); items = near.length ? near : items.slice(0, 3); }
|
||||
const en = chatIsEn(question);
|
||||
const state = (d) => en ? (d.days_left < 0 ? `overdue by ${-d.days_left} days` : d.days_left === 0 ? 'today' : `in ${d.days_left} days`) : (d.days_left < 0 ? `po terminie od ${chatPlural(-d.days_left, 'dnia', 'dni', 'dni')}` : d.days_left === 0 ? 'dziś' : `za ${chatPlural(d.days_left, 'dzień', 'dni', 'dni')}`);
|
||||
const rows = items.map((d, i) => [String(i + 1), d.title, (en ? CHAT_KINDS_EN : CHAT_DEADLINE_SHORT)[d.kind] || d.kind, d.due_date, state(d), d.ref, d.owner, chatStep(d, en)]);
|
||||
const days = (n) => `${n} day${n === 1 ? '' : 's'}`;
|
||||
const state = (d) => en ? (d.days_left < 0 ? `overdue by ${days(-d.days_left)}` : d.days_left === 0 ? 'today' : `in ${days(d.days_left)}`) : (d.days_left < 0 ? `po terminie od ${chatPlural(-d.days_left, 'dnia', 'dni', 'dni')}` : d.days_left === 0 ? 'dziś' : `za ${chatPlural(d.days_left, 'dzień', 'dni', 'dni')}`);
|
||||
// Under an English answer the words code writes are English; deadline titles are data and stay as entered.
|
||||
const title = (d) => en && d.contract ? `End of contract ${d.contract.number} „${d.contract.name}”` : d.title;
|
||||
const ref = (d) => !en ? d.ref : d.contract ? `contract ${d.contract.number}, ${d.contract.counterparty || 'counterparty not entered'}`
|
||||
: `matter ${d.matter_reference} „${d.matter_name || ''}”`;
|
||||
const kind = (d) => en ? (d.kind === 'procedural' && !chatCivil(d) ? 'procedural' : CHAT_KINDS_EN[d.kind]) : CHAT_DEADLINE_SHORT[d.kind];
|
||||
const rows = items.map((d, i) => [String(i + 1), title(d), kind(d) || d.kind, d.due_date, state(d), ref(d), d.owner, chatStep(d, en)]);
|
||||
const head = en ? ['No.', 'Item', 'Kind', 'Date', 'Status', 'Matter / contract', 'Owner', 'Next step']
|
||||
: ['Lp.', 'Pozycja', 'Rodzaj', 'Data', 'Stan', 'Sprawa / umowa', 'Odpowiada', 'Następny krok'];
|
||||
const how = `według faktycznej daty, najwcześniejsza pierwsza${stress ? ', ' + stress[2] + ' (tak prosi pytający)' : ', bez względu na rodzaj'}${week ? ', pozycje po terminie i najbliższe 7 dni' : ''}`;
|
||||
|
||||
Reference in New Issue
Block a user