← pabloduque.dev
Nota 03 · CotejoNote 03 · Cotejo 5 min de lectura5 min read

«No encontrada» no es «no existe»“Not found” is not “does not exist”

En Cotejo, el peor error posible es dar por inexistente una sentencia real. Por eso medí cuánto le falta al buscador oficial antes de dejar que su silencio signifique algo.In Cotejo, the worst possible error is to declare a real ruling non-existent. So I measured how much the official search engine misses before letting its silence mean anything.

6 / 135códigos que cita la propia Corte Suprema y que su buscador no encuentra, aunque son realescodes the Supreme Court itself cites that its search engine can’t find, although they are real
0 / 500sentencias reales de la Corte Constitucional dadas por inexistentesreal Constitutional Court rulings flagged as non-existent
85 %citas inexistentes en escritos de un LLM localnon-existent citations in briefs written by a local LLM

Cotejo es un proyecto propio: lee un escrito jurídico (una tutela, una demanda, un recurso) y comprueba cada providencia de la Corte Constitucional y de la Corte Suprema que cita: que existe, que no fue anulada, que el ponente es el correcto y que los pasajes entre comillas dicen lo que se les atribuye, palabra por palabra. Nació después de que, en febrero de 2026, la Corte Suprema sancionara a un abogado por fundar un recurso en diez sentencias inexistentes generadas con IA (AC739-2026) y fijara un deber positivo de verificación.

Un verificador de citas puede equivocarse de dos maneras. Puede dejar pasar una sentencia inventada, o puede decir que no existe una que sí existe. La segunda es peor: ante un abogado, un falso «no existe» le hace dudar de un escrito correcto o, más grave aún, acusar en falso a la contraparte. Casi todo el diseño de Cotejo sale de tomarse en serio esa asimetría.

Dos fuentes, o ninguna afirmación

Para la Corte Constitucional hay dos fuentes independientes: el índice de datos abiertos (29.474 providencias, de 1992 a hoy) y la relatoría de la Corte. Una sentencia solo se declara inexistente si falta en las dos.

Las dos hacen falta. Durante la evaluación, la doble comprobación encontró una sentencia real, la T-281/26, que la relatoría ya tenía y el índice todavía no. Y hay más protecciones:

  • Un fallo de red nunca produce «no existe». Si la relatoría no responde, la cita queda «sin confirmar». Cuando la relatoría cortó la conexión en mitad de una evaluación, las 26 citas afectadas quedaron así; ninguna como inexistente.
  • Un canario antes de creer una ausencia. La relatoría responde con éxito también a direcciones que no existen, con una página vacía. Si el sitio cambiara su esquema de direcciones, todo daría «no existe». Por eso, antes de aceptar una ausencia, Cotejo comprueba que una sentencia conocida (la T-406/92) se sigue pudiendo leer.
  • La ausencia caduca. Una sentencia recién dictada puede tardar en subirse; su ausencia en la relatoría se recuerda un día, no para siempre.

Con sentencias reales tomadas al azar del índice e inventadas plausibles, escritas en siete formas distintas y en dos muestras independientes: 0 de 500 reales dadas por inexistentes y 499 de 499 inventadas detectadas.

La Corte Suprema no tiene segunda fuente

Para la Corte Suprema solo existe su buscador de providencias; no hay un índice abierto con el que cruzar. Antes de dejar que una ausencia ahí significara algo, había que medir cuántas providencias reales no encuentra.

Lo difícil es conseguir citas que sean reales con certeza. Usé las que hace la propia Corte en sus providencias. En dos muestras independientes salieron 135 códigos:

Códigos
Encontrados por el buscador128
Reales que el buscador no tiene6 (4,4 %)
Errata de la propia Corte (un radicado escrito como código)1

Las seis que faltan son autos o tutelas. Si Cotejo declarara inexistente lo que el buscador no encuentra, acusaría en falso a más de 4 de cada 100 citas reales. Por eso, en la Corte Suprema, una ausencia se marca no encontrada: cuenta como problema, pide comprobarla y enlaza la búsqueda ya hecha, pero no afirma nada que no se sepa.

La medición destapó además dos defectos del conector. El buscador busca en el texto, no en el título, y una providencia como la AP7408-2015 se encabeza «AP – 7408 - 2015», así que hay que probar varias formas del código. Y como la búsqueda es de texto completo, una providencia muy citada queda detrás de todas las que la citan: la AP2118-2020 salía en la posición 149 de 155. Ahora también se busca desde el final.

Lo que encontró en escritos de un LLM

Para ver la herramienta contra el problema real, le pedí a un LLM local (qwen3.5:9b) 15 fundamentos jurídicos de tutela con jurisprudencia, ponentes y citas textuales. Salieron 68 citas de la Corte Constitucional:

  • 58 (85 %) no existen. Las audité a mano: 35 tienen un número que la Corte no alcanzó ese año (una SU-1385/18, cuando ese año llegó a la 124), y las otras 23 las volví a consultar una por una en la relatoría, con controles positivos.
  • 7 existen, con observaciones: un ponente equivocado y seis con un pasaje que la sentencia no contiene.
  • 3 se verificaron sin observaciones.
  • De los 7 pasajes entre comillas, ninguno aparece en la sentencia citada.

Es un modelo pequeño y dice poco de lo que inventa un modelo grande; hay que repetirlo con modelos de frontera.

Estados, no un sí o un no

Todo esto llega al informe como estados distintos, no como un booleano: verificada, existe con observaciones, no existe, no encontrada, sin confirmar y no verificable. Lo que Cotejo todavía no puede comprobar (Consejo de Estado, autos de la Constitucional, citas por fecha) se lista aparte, con el motivo. Un verificador que calla lo que no mira es peor que ninguno, porque el abogado cree que se revisó todo.

La lección es general: el silencio de una fuente es una propiedad de la fuente, no del mundo. Antes de interpretar una ausencia hay que medir cuánto le falta a quien la reporta y, si no se puede medir, decir «no encontrada».

Cotejo is a project of my own: it reads a legal brief (a tutela, a lawsuit, an appeal) and checks every ruling of Colombia’s Constitutional Court and Supreme Court that it cites: that it exists, that it hasn’t been annulled, that the reporting justice is right and that the passages in quotation marks say what is attributed to them, word for word. It started after the Supreme Court, in February 2026, sanctioned a lawyer for basing an appeal on ten non-existent rulings generated with AI (AC739-2026) and set a positive duty to verify.

A citation checker can be wrong in two ways. It can let an invented ruling through, or it can say a ruling doesn’t exist when it does. The second is worse: in front of a lawyer, a false “does not exist” makes them doubt a correct brief or, worse still, falsely accuse the other side. Most of Cotejo’s design comes from taking that asymmetry seriously.

Two sources, or no claim

For the Constitutional Court there are two independent sources: the open-data index (29,474 rulings, from 1992 to today) and the Court’s own case-law archive (the relatoría). A ruling is only declared non-existent if it is missing from both.

Both are needed. During evaluation, the double check found a real ruling, T-281/26, that the archive already had and the index didn’t yet. And there are further safeguards:

  • A network failure never produces “does not exist”. If the archive doesn’t answer, the citation stays “unconfirmed”. When the archive cut the connection in the middle of an evaluation, the 26 affected citations stayed that way; none was marked non-existent.
  • A canary before believing an absence. The archive answers successfully even for addresses that don’t exist, with an empty page. If the site changed its URL scheme, everything would come back “does not exist”. So before accepting an absence, Cotejo checks that a known ruling (T-406/92) can still be read.
  • Absence expires. A newly issued ruling can take time to be uploaded; its absence from the archive is remembered for one day, not forever.

With real rulings drawn at random from the index and plausible invented ones, written in seven different forms and in two independent samples: 0 of 500 real rulings flagged as non-existent, and 499 of 499 invented ones caught.

The Supreme Court has no second source

For the Supreme Court there is only its search engine; there is no open index to cross-check against. Before letting an absence there mean anything, I had to measure how many real rulings it fails to find.

The hard part is getting citations that are certainly real. I used the ones the Court itself makes in its own rulings. Two independent samples yielded 135 codes:

Codes
Found by the search engine128
Real, but missing from the search engine6 (4.4%)
A typo by the Court itself (a docket number written as a code)1

All six missing ones are orders (autos) or tutela rulings. If Cotejo declared non-existent whatever the search engine doesn’t find, it would falsely flag more than 4 in every 100 real citations. So, for the Supreme Court, an absence is marked not found: it counts as a problem, asks the user to check and links to the search already run, but it claims nothing that isn’t known.

The measurement also exposed two connector bugs. The search engine searches the text, not the title, and a ruling such as AP7408-2015 is headed “AP – 7408 - 2015”, so several forms of the code have to be tried. And since the search is full-text, a heavily cited ruling sits behind everything that cites it: AP2118-2020 came up at position 149 of 155. It is now also searched from the end.

What it found in briefs written by an LLM

To test the tool against the real problem, I asked a local LLM (qwen3.5:9b) for 15 tutela legal arguments with case law, reporting justices and verbatim quotes. They contained 68 Constitutional Court citations:

  • 58 (85%) don’t exist. I audited them by hand: 35 carry a number the Court never reached that year (an SU-1385/18, when that year it got to 124), and the other 23 I queried again one by one in the archive, with positive controls.
  • 7 exist, with observations: one wrong reporting justice and six with a passage the ruling doesn’t contain.
  • 3 were verified with no observations.
  • Of the 7 passages in quotation marks, none appears in the cited ruling.

It is a small model and says little about what a large one invents; it has to be repeated with frontier models.

States, not a yes or no

All of this reaches the report as distinct states rather than a boolean: verified, exists with observations, does not exist, not found, unconfirmed and not verifiable. What Cotejo can’t check yet (the Council of State, Constitutional Court orders, citations by date) is listed separately, with the reason. A checker that stays silent about what it doesn’t look at is worse than none, because the lawyer believes everything was reviewed.

The lesson is general: a source’s silence is a property of the source, not of the world. Before interpreting an absence, measure how much the reporter misses and, if that can’t be measured, say “not found”.

EVIDENCIAEVIDENCE

  • Caso «Cotejo»Case study “Cotejo” · en la portadaon the home page
  • El código de Cotejo todavía no es público. Las cifras salen de sus tres bancos de evaluación: dos con etiquetas conocidas de antemano (Corte Constitucional y Corte Suprema) y uno de escritos de un LLM local, auditado a mano.Cotejo’s code is not public yet. The figures come from its three evaluation benches: two with labels known in advance (Constitutional Court and Supreme Court) and one of briefs from a local LLM, audited by hand.
  • La sanción AC739-2026The AC739-2026 sanction · Infobae, 16 de febrero de 2026Infobae, 16 February 2026 (in Spanish)