Skip to content

Fill the example extraction record; correct the validator tiers in the tutorial - #43

Draft
jdkent wants to merge 1 commit into
mainfrom
example-record-complete
Draft

jdkent wants to merge 1 commit into
mainfrom
example-record-complete

Conversation

@jdkent

@jdkent jdkent commented Oct 17, 2026

Copy link
Copy Markdown
Member

The example record examples/run/records/x7Ex4mpleA01.extraction.json was a skeleton of nulls while the schema tutorial presents it as complete. pondie's validator reported 23 errors on it (Study.groups: 'groups' is multivalued but got NoneType, and so on).

What changed

  • The record is now an extraction of examples/corpus/x7Ex4mpleA01/processed/pubget/text.txt (71 wrapped fields, 52 spans, every span the exact text at its offsets):
    • one group (human, 20 participants; age and is_healthy not_reported), the monetary incentive delay task with Gain, Loss and Neutral conditions, one condition term, and one ModelEstimation;
    • one InferenceSettings from the Methods sentence (height p 0.001, extent 20 voxels, cluster-level p 0.05, family-wise error);
    • two analyses: Gain > Neutral (Table 1, t statistic) and Loss > Neutral (no_significant_effect, no table), both MassUnivariateDetails, whole-brain, n 20, MNI;
    • Table 1 with its caption and headings, its coordinate set, result_reporting: analyses_reported.
  • Where the text is silent the slot is not_reported (hypothesis, blinding, design type, model family/type/stage, measure family/type, prespecification, statistic of the null analysis). Values the text implies but does not state (species, whole-brain scope, single_group, the effect outcomes) are generated with the supporting sentence. No acquisition, device, preprocessing, region or assessment is declared, because the text describes none. Nothing is invented for stable_id, which the store mints.
  • tests/test_example_record.py: the models and the JSON Schema accept an all-null record, so these read the record against its text: no null slot, status/evidence invariants, span offsets, source hash, references resolve, parsed analyses and tables appear in the record, cells name levels their term declares.
  • schema-tutorial.md 12.3 described three tiers that do not match pondie. It now follows validate.py (conformance, with closed vocabulary errors and open vocabulary warnings, evidence, offsets, references, class rules) and rules.py (six error rules, twelve warning rules). I also removed the "routed to review by count" sentence, which no code in the validator does. Two mentions of non_analysis_content in chapter 12 now say purpose.

Open question: pondie's convention and the layout round trip cannot both hold
tests/test_layouts.py::test_round_trip_is_byte_for_byte fails on this branch (1 failed, 219 passed, 1 skipped; it passes on main). pyarty writes model_dump_json, which emits an explicit null for every unset slot and "value": null on a not_reported wrapper. pondie rejects both (must be a string, got NoneType, not_reported fields must omit value). I checked: the model-canonical form of this record gives pondie about 100 errors, and stable_id alone can never be filled. So the committed record uses absent keys (pondie valid, JSON Schema and models valid) and the byte-for-byte test is red. I did not touch that test. Either pondie should read null as absent, or pyarty should dump with exclude_none, or the round trip should skip records. Needs a decision.

I changed one existing test: test_stable_id.py pops stable_id with a default, since the record no longer carries the key.

Verified

  • pondie validator (PR Drop the per-point sign from the coordinate parse; derive it from the values #21 branch publication-status-pin, 14542791; main cannot read this schema layout): 71 fields, 52 spans checked, valid, no warnings.
  • Fresh venv from the branch: 219 passed, 1 skipped (wheel build), 1 failed (the round trip above). tools/generate_models.py --check clean.
  • Mutations, each failing the new tests: record reverted to the skeleton (8 failures), span offset shifted, null slot, hash changed, dangling measure, a cell level not declared by its term.
  • Rules only pondie checks (cell level against term, effect kind, table purpose, value-source honesty) are not re-implemented here.

Not changed, outside this item: schema-tutorial.md 1081, 1443, 1513, extraction-readme.md 144 and representing-models.md 71 still say non_analysis_content, which the extraction schema does not have (Table.purpose is the slot). Tutorial 9.6 says EffectKind has no slot, but the extraction schema has Effect.kind and pondie checks it.

🤖 Generated with Claude Code

… the tutorial

The example record was a skeleton of nulls that pondie's validator rejected
(23 errors, e.g. Study.groups: 'groups' is multivalued but got NoneType). It is now
an extraction of the example paper's text: both analyses (Gain > Neutral with its
Table 1 peaks, Loss > Neutral with no table), the task and its conditions, the
cluster-level FWE inference settings, the group, the table and its coordinate set,
with exact-offset evidence for what the text says and not_reported for what it does
not.

tests/test_example_record.py reads the record against its text, which the models and
the JSON Schema cannot do (they accept an all-null record).

schema-tutorial.md 12.3 described three tiers; pondie has conformance in validate.py
and nineteen rules in rules.py, split into error and warning rules. Rewritten from
the code, and the two chapter 12 mentions of non_analysis_content now say purpose.

test_stable_id pops stable_id with a default, because the record no longer carries
an explicit null for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant