Documentation

The hidden evaluation set: how to write it and how to run it

Summary

  • The hidden set measures how well the app reads the facts, on cases its developers have never seen.
  • The 61 development cases were used to build and tune the reader, so its score on them is optimistic; the hidden set is the honest measure.
  • It is written by someone who has not worked on the reader, and who may not read its prompts, the development cases or the benchmark results; it never enters the repository and is never sent to the developers: only its summary is shared.
  • About 100 fictitious cases in formal Arabic: 4 or 5 for each of the 21 claim types of the catalogue, and 10 outside it.
  • The cases read like a lawyer’s notes: side details, several dates and amounts, facts that did not happen and facts one party denies.
  • The first run (30 October 2026) got 32 of 90 cases fully right with the claim type given; on 31 October 2026, Nemotron 3 Ultra online got 64 of 90 with the claim type given, and 60 of 90 with the claim type read, the claim type right on 85 of 90 and all 10 out-of-scope cases declined.
  • A second set by an independent author (8 November 2026, 90 cases, the claim type given): the local Gemma 4 E4B got 58 of 90 fully right in 21 s per case, against 39 of 90 in 28 s for the smaller local model, Gemma 3 4B, with the same reader.
  • Once its results have been looked at, a set is no longer hidden: the next measure of a changed reader needs a new set.

What this means for a lawyer The figures show how often the reading of the facts is fully right on cases the developers never saw: the honest measure, not the optimistic one.

Read the full document

Purpose: to measure the fact reading on cases its developers have never seen.

The 61 cases in tests/fact-cases were used to build and tune the reader, so its score on them is optimistic. The hidden set is the honest measure.

Rules

  1. Who writes it. Someone who has not worked on the reader: an independent agent, or a person.
  2. What the author may read:
    • this file;
    • the claim catalogue data/law/claims/*.json, for what each claim type is;
    • data/law/claim-elements.json, for the facts and requests each claim type is read for;
    • the codes in src/DzLegal.Drafting/CaseFacts.cs (FactVocabulary).
  3. What the author must not read:
    • the prompts in data/law/prompts/;
    • the cases in tests/fact-cases/ and tests/grounds-cases/;
    • the benchmark results.
  4. Where it lives. Never in the repository and never sent to the developers. It stays in a folder outside the repository, for example C:\dz-hidden\.
  5. Fictitious data only. Names, places, dates and amounts are invented. Formal Arabic (الفصحى) only.
  6. Runs.
    • It is run once per frozen version. The commit is recorded in manifest.json.
    • Only summary.md is shared.
    • The --out folder holds every case’s text: do not share it.
  7. After use. Once its failures are opened to improve the reader, the set has been seen. It then joins development, and the next measure needs a new hidden set.

Content (about 100 cases)

Coverage:

  • 4 or 5 cases for each of the 21 claim types in the catalogue, about 90 in all.
  • 10 cases outside the catalogue ("claim": "out-of-scope"), for example an inheritance partition, an administrative appeal, a company dispute or a correction of civil status.

Make them read like a lawyer’s notes, not like an exercise:

  • 3 to 10 sentences;
  • side details that do not matter;
  • several dates and amounts, some of them belonging to different facts;
  • a key date given only in the documents list;
  • facts that did not happen («لم يوجه أي إعذار»);
  • facts one party denies («ينكر المدعى عليه…»);
  • the plaintiff on either side when the claim type allows it (the lessee in a commercial lease, the father in a custody case);
  • a monthly amount next to a total;
  • a court section that does not match the facts.

Format

One file, for example hidden-cases.json. It holds an object with a cases list, and each case is:

{
  "name": "h001",
  "partition": "hidden",
  "claim": "unpaid-rent",
  "inputs": {
    "claim.subject": "…",
    "notes.facts": "one fact per line\n…",
    "notes.requests": "…",
    "documents.list": "…",
    "court.section": "القسم المدني"
  },
  "gold": {
    "relation": "lease",
    "position": "lessor",
    "events": [
      { "kind": "contract_concluded", "date": "15/02/2024", "polarity": "affirmed", "decisive": true },
      { "kind": "rent_unpaid", "amount": "400000", "actor": "defendant", "polarity": "affirmed", "decisive": true },
      { "kind": "notice_served", "polarity": "denied", "decisive": false }
    ],
    "forbidden": [ { "kind": "rent_unpaid", "amount": "50000" } ],
    "requests": [ { "kind": "payment", "amount": "400000" }, { "kind": "eviction" } ]
  }
}

The fields

  • name: neutral (h001, h002…). It appears in the shared summary, so it must say nothing about the case.
  • claim: a claim id from data/law/claims/*.json, or out-of-scope.
  • inputs: only these keys. Any of them may be left out except notes.facts.
  • relation, position, event kind, request kind: codes from FactVocabulary. Several accepted answers are separated by | ("lender|creditor").
    • The position must be one of the roles claim-elements.json lists for the claim type.
    • Every event and request must be one that claim type is read for.
  • date:
    • dd/mm/yyyy, or a year (2019);
    • the same date must be written in the case text.
  • amount:
    • digits only (400000 for «400.000 دج»);
    • the same amount must be written in the case text.
  • actor: plaintiff or defendant, only when who did it matters.
  • polarity: affirmed, denied (the text says it did not happen) or disputed (one side claims it, the other denies it).
  • decisive: true when a reader that misses this fact would get the case wrong.
  • forbidden: a reading that must never be made:
    • an event that is absent or denied, read as affirmed;
    • or a value bound to the wrong event (the monthly rent given as the total owed).
  • Out-of-scope cases: fill in relation and position as well as possible, and leave events and requests empty.

Check the file without showing it to anyone

dotnet run -c Release --project src/DzLegal.Harness -- facts check --cases C:\dz-hidden

The check names each problem by case name only, never by text. It reports:

  • unknown codes or claim types;
  • dates and amounts that are not written in the case;
  • answers the reader is never asked for.

Fix them until it prints «No problem found.»

Running it

dotnet run -c Release --project src/DzLegal.Harness -- facts --alpha --cases C:\dz-hidden --partition hidden --models gemma3:4b --out C:\dz-hidden-results

Share only C:\dz-hidden-results\summary.md.

For the whole chain, with the claim type read by the analysis instead of given, add --claims read.

Runs

Date Version Mode Result Summary
30 Oct 2026 83cd421 claim type given 32 of 90 cases fully right, 63 s per case docs/baselines/2026-10-30-hidden-given/
31 Oct 2026 140a353 Nemotron 3 Ultra online, claim type given 64 of 90 cases fully right, 4 s per case, 0 failed calls docs/baselines/2026-10-31-hidden-nemotron-given/
31 Oct 2026 140a353 Nemotron 3 Ultra online, claim type read 60 of 90 in-catalogue cases fully right, claim type right on 85 of 90, 10 of 10 out-of-scope declined, 8 s per case docs/baselines/2026-10-31-hidden-nemotron-read/
8 Nov 2026 cda67fc (codex/alpha-03) set v2, gemma3:4b, claim type given 39 of 90 cases fully right, 28 s per case, mains and Best performance docs/baselines/2026-11-08-hidden-v2-gemma3-given/
8 Nov 2026 cda67fc (codex/alpha-03) set v2, gemma4:e4b with thinking off, claim type given 58 of 90 cases fully right, 21 s per case, model memory peak 7.2 GB docs/baselines/2026-11-08-hidden-v2-gemma4-given/
9 Nov 2026 5ffc12c (codex/alpha-03) set v2, gemma4:e2b with thinking off, claim type given 41 of 90 cases fully right, requests found 63%, 7 s per case, model + app memory peak 5.1 GB docs/baselines/2026-11-09-alpha-03-hidden-v2-phone-models/
9 Nov 2026 5ffc12c (codex/alpha-03) set v2, gemma3n:e2b, claim type given 42 of 90 cases fully right, requests found 69%, 19 s per case, model + app memory peak 6.9 GB docs/baselines/2026-11-09-alpha-03-hidden-v2-phone-models/

The two 31 October runs used the same reader (Alpha-01) as the first run, with only the model changed (and, in read mode, every claim type offered to the online model, the court section given as a hint). The set had already been seen at summary level, so they compare models on the same cases; they are not a fresh unseen measure. Both ran on battery power, recorded by the new run manifest.

The first set (100 cases, written by Codex on 30 Oct 2026) has now been seen at the level of the summary: case names, error types and the codes involved. Its case texts were never opened by the developers; the results folder sent with the summary had its case files deleted unread. Under rule 7, it is no longer hidden for changes made from these results: the next measure of a changed reader needs a new set.

The second set (v2) has 100 cases (n001 to n100, 90 within the catalogue), written on 8 Nov 2026 by an author who had seen neither the reader’s prompts, nor its cases, nor its results, under docs/briefs/HIDDEN-V2-BRIEF.md and the polarity rule agreed then. Both v2 runs used the unchanged Alpha-01 reader at the frozen commit cda67fc, with only the model changed. The owner’s guarded command (tools/alpha-03/Run-OwnerAlpha01.ps1) ran each once, serially, on mains power with Best performance, a model reload every ten cases and a 512 MiB memory guard. It was launched by Codex as a blind operator, who saw only the exit codes, never the cases or the results. Only the two summary.md files left the laptop. Set v2 is now seen at summary level as well: the next measure of a changed reader needs a new set.

The two phone-sized models (9 Nov 2026) were run the same way, with the reader still unchanged, to see how small a model can be before the reading falls apart. gemma4:e2b reads about as well as gemma3:4b on position (93%), decisive events (93%), dates (89%) and stance (85%), four times faster and with less memory, but finds only 63% of the requests, and 36 of its answer lines could not be read by the parser (3 for gemma3:4b): it understands the case but does not always keep the answer format. gemma3n:e2b is slower than gemma4:e2b and weaker on dates (77%). These runs were measured on the laptop, not on a phone. Because they change only the model, set v2 still serves to compare models; a change to the reader to fix the requests would need a new set.