-
Stefy Lanza (nextime / spora ) authored
Ran both side by side on the same documents instead of reading the spec, and the spec's prose turned out to allow several readings the port took differently. Seven divergences in reference extraction, one in sectioning: * `artt. 163, 164 e 167 c.p.c.` extracted nothing -- the code had to sit immediately after the number, so an enumeration lost the whole citation. It now resolves to its first article, which is what the indexes hold. * `art. 2055-bis c.c.` extracted nothing (only a space was tolerated before the suffix); the hyphen is now kept in the key, a space still squeezed out. * `art. 2043 cod. civ.` extracted nothing -- the code spelled out was in the normalisation table but not in the pattern. * `articolo 2043 c.c.` and `art. 2043 della c.c.` extracted a reference the original does not. Looking like an improvement does not make it one: it puts keys in the field that the corpus it will be matched against lacks. * `legge 241 del 1990` extracted nothing; `l 241/1990` without the dot extracted one. Both inverted. * `art. 360` with no code came back as `art.360`, and `d.p.r. 115/02` as nothing -- the two already reported. And the off-by-one, which was none of the things it looked like. Section bodies were not stripped, so merging two adjacent same-label sections (a filing opening its conclusions twice) joined a body ending in a blank line to the next, turning a line break into a paragraph break -- packed as `\n\n` rather than riding inside one piece. Exactly one character, on exactly the documents that merge. Empty sections were also kept, spending a `parent` id and shifting every id after it. Verified by diffing chunk-for-chunk over 63 generated documents covering CRLF, repeated headers, enumerations, two-digit years and degenerate input: zero divergences in text, section, parent and norm_refs. The one deliberate difference is `**FATTO**`, which the original does not match and `it-legal` does. `it-legal-strict` is added for re-chunking a corpus indexed with the original, where a boundary that moves makes the new index incomparable with the old. Co-Authored-By:
Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXRMe9ZPUQCCCtBai9uqt3
06b7b2e8