Skip to content

Tests read built v2 documents in either layout (#414) - #603

Draft
jesshaley wants to merge 6 commits into
V2from
claude/flat-test-reads
Draft

jesshaley wants to merge 6 commits into
V2from
claude/flat-test-reads

Conversation

@jesshaley

Copy link
Copy Markdown
Collaborator

Draft. Flat-layout follow-up (did-schema #414), DID-matlab test code: tests read the v2 documents they build through the layout accessors, so the suite passes on did-schema main (nested) and moves toward passing on the flat kind-cell schema before did-schema switches layout (step 8). Measurements and the list of tests that assert the nested shape itself are being filled in; this body is updated when the runs finish.

The flat-schema runs (test-builder.yml, test-migrators-quick.yml, through the did-schema mirror branch claude/flat-test-reads = did-schema #469's head with main merged) are red by design until step 8.


Generated by Claude Code

did-schema #414, flat document layout. On the flat kind-cell schema the
quick tests failed reading documents they built as nested. The reads named by
the first flat run (V2 614f83f, quick run 47225707855) move, by script
(fix_sites: the failing line, then reads of the same expression in the same
test function), to did2.document.idOf (EXPR.base.id), did2.document.blockOf
(EXPR.<class>.<field>) and, for value cells, the new test helper
did2.unittest.helpers.valueCell, a wrapper of did2.schema.cache/valueCellIn
([no kind value alias]); doc.get('<kind>.value...') reads move to valueCell
in every test file. Reads of v1 inputs (v1*, pre*, legacy*, raw* roots) stay
nested. Hand fixes: testBuild doc.(cls) reads; one dose absence check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
did-schema #414. Helpers that select documents by a block's presence
(isfield(d, 'entity'), isfield(d, 'base') && ...) found nothing on a flat
document, so lookups came back empty or absence checks became vacuous. They
read through did2.document.blockOf / idOf, and value cells through
did2.unittest.helpers.valueCell or did2.schema.cache/valueCellIn (the
 flag: [no kind value alias]): classKey, carryNote,
failureDocuments, tuningSummary, and the local lookups in 20 test files. Two
tests that edit a built document (testTuningDecisions relabel and
withParameter) write the cell or block where the document keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
did-schema #414. From the second flat run (c3d33f7, quick run
47228058895): the next failing reads move to did2.document.idOf / blockOf /
did2.unittest.helpers.valueCell, by the same script, with a hand-kept
exclusion list for reads that are not of a built document (a summary keyed
by class, a time view) or that assert the nested shape (reported in the PR).
Whole-block reads doc.get('<class>') and doc.get('relation.<path>') (the
class relation, whose name a flat directed_relation also uses for its
relation term) read through blockOf. Reads of the value's data-body flag
(value.data_body nested, external flat) read through the new test helper
did2.unittest.helpers.valueIsExternal, the EXTERNAL output of
did2.schema.cache/valueCellIn ([no kind value alias]).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
did-schema #414. From the third flat run (c955223, quick run 47229902613):
the next failing reads, by the same script (now only for an error raised in
the test file itself, not in code it calls) and by hand:
- testBuildGaps names its gap and known-defect paths through
  did2.build.gapPath ([flat accessor names]) and compares the report's
  paths with the same names;
- testBuild's valueNowhere test clears the flag where the document keeps it
  (value.data_body nested, external flat), and its dose reads read the cell
  through valueCell;
- block-guarded absence and presence checks (isfield(X, 'B') &&
  isfield(X.B, f)) read through blockOf, so they are not vacuous on a flat
  document;
- reads of an element of a value cell (X.<kind>.value(1).f) read
  getfield(valueCell(X), {1}, f);
- testRawV1RoundTripElement edits its older-shape entity where the
  document keeps its fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
did-schema #414. From the fourth flat run (e1b6db8, quick run
47231644417): the next failing reads, by the same script and by hand
(testMigratorsJMethodParams' pipeline-entity premise, the
testNonSpecimenGroupOwners body lookup, the release-date value cell in
testResolveOpenmindsCitations). Two script rewrites of reads that are not of
a built document (a rebuilt v1 element, a time view) are left as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
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.

2 participants