Skip to content

fix(api,szoveg): pont nélküli §, naptári dátum-ellenőrzés, rövid cache - #30

Merged
godavid merged 5 commits into
mainfrom
local/glm-gitjog-glm
Oct 23, 2026
Merged

godavid merged 5 commits into
mainfrom
local/glm-gitjog-glm

Conversation

@godavid

@godavid godavid commented Oct 23, 2026

Copy link
Copy Markdown
Owner

A diffet a GLM 5.3 (z.ai, OpenCode-on át) írta, egy Claude-felügyelő ellenőrizte és fogadta el. Fixes #29, fixes #28, fixes #27. A #26 nyitva marad (tulajdonosi döntés).

Elfogadási feltételek: mindhárom issue viselkedése teljesül, mindegyikhez fókuszált teszt.

Tesztterv (dev-budget alatt, helyben):

  • apps/web: node --test lib/api/datum.test.ts lib/api/cache-ido.test.ts → 7/7 zöld
  • packages/szoveg: vitest run test/paragrafus.test.ts → 5/5 zöld
  • UI-felületet a diff nem érint (csak API-modulok és -route), ezért képernyőkép nem készült.

Review-nitek (nem javítjuk automatikusan):

  • apps/web/lib/api/semak.ts:35: a datum séma a .regex() és az ervenyesDatum miatt kétszer ellenőrzi az alakot; rossz alakú értékre a 400-as üzenet két hibát fűz össze. Elég lenne a .refine(ervenyesDatum, …).
  • apps/web/lib/api/cache-ido.ts:8: a ma UTC-dátum, nem budapesti; éjfél után 1-2 óráig a helyi tegnapi datum is 900 s-ot kap. Ez a biztonságos irány, egy komment jelezhetné, hogy szándékos.
  • model: claude-opus-5.5
    effort: high
    round: 1
    sha: 439a12a
    verdict: clean
    context: fresh
    findings: important 0, nit 2, pre-existing 0
    cost: unknown

🤖 Generated with Claude Code

godavid and others added 3 commits October 23, 2026 12:08
datum, since, until, tol and ig accepted shape-valid but non-existent days (2026-13-01, 2026-02-30, 2026-10-00) and picked a time state by string comparison. A shared ervenyesDatum() round-trip check now backs the REST/MCP zod schema and the API-level checks. Adds a node:test runner for apps/web (test files excluded from the Next typecheck).

Fixes #28

Co-Authored-By: GLM 5.3 (z.ai) <noreply@z.ai>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only a datum before today (UTC) is final and keeps s-maxage 86400; today or later gets 900 s like valtozasok, so the daily delta shows up within minutes.

Fixes #27

Co-Authored-By: GLM 5.3 (z.ai) <noreply@z.ai>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
szam() required the dot, so "18 §" returned 404 on heading-less laws while hivatkozas.ts already treats the dot as optional.

Fixes #29

Co-Authored-By: GLM 5.3 (z.ai) <noreply@z.ai>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@godavid

godavid commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Review — claude-opus-5.5 @ high, round 1, fresh context, head 439a12a

  • [Nit] apps/web/lib/api/semak.ts:35 – a datum séma kétszer ellenőrzi az alakot (.regex() és ervenyesDatum). Zod v4-ben a .refine a bukott .regex után is lefut, így rossz alakú értékre (pl. 2024-2-1) a 400-as üzenet két hibát fűz össze (valasz.ts:13). Elég lenne a .refine(ervenyesDatum, …).
  • [Nit] apps/web/lib/api/cache-ido.ts:8 – a ma UTC-dátum, nem budapesti. Éjfél után 1-2 óráig a helyi tegnapi datum is 900 s cache-t kap. Ez a biztonságos irány; egy komment jelezhetné, hogy szándékos.

Ellenőrizve, rendben: a szakaszKeres a „18 §" és a „18. §" alakot is 18-sz-re képezi; az MCP ugyanazokat a sémákat használja; a DATUM_MINTA minden hívóhelyről eltűnt; a hibaválasz no-store.

verdict: clean
important 0, nit 2, pre-existing 0

@godavid

godavid commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

owner-ok — landolási engedély a tulajdonostól (2026-10-23, az orchestráló sessionben, a GLM-kvóta prioritáslistája után):

hajtsd végre ezeket, subagent -ek felügyelnek, te csak összefogod

Comment thread packages/szoveg/src/paragrafus.ts Fixed
CodeQL js/polynomial-redos flagged szam(): the optional dot made /\.?\s*§\s*$/ quadratic on inputs with many spaces. Strip the trailing § and dot with string operations instead; a 100k-space input now runs in linear time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@godavid

godavid commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Review (claude-opus-5.5@high, round 1, fresh context, head d85942b)

The new commit d85942b fixes the CodeQL js/polynomial-redos alert: szam() in packages/szoveg/src/paragrafus.ts now strips the trailing section sign and dot with string operations instead of /\.?\s*§\s*$/. Checked: old and new give the same result on every realistic input (with and without the dot, letter suffixes, 6:272. style, extra spaces, NBSP) and on 300,000 random strings. The new test fails with the old code (100k spaces, about 4 s) and runs in under 1 ms with the new code. The rest of the PR (ervenyesDatum, szakaszCacheMp, test runner) is unchanged and still correct.

Ran: vitest run test/paragrafus.test.ts 6/6, node --test lib/api/datum.test.ts lib/api/cache-ido.test.ts 7/7.

verdict: clean
important 0, nit 0, pre-existing 0

@godavid
godavid merged commit 8b5588f into main Oct 23, 2026
8 checks passed
@godavid
godavid deleted the local/glm-gitjog-glm branch October 23, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants