Skip to content

harness: the schema cases move a case's keywords as one unit, so none splits a body across allOf entries #2209

Backlog

Description

@OmarAlJarrah

Problem

The schema cases (internal/harness/openapicases) write a use of a named target T saying K in six spellings, and spellings.go states what the six share: "every keyword the case writes beside the use, moved as one unit". A second construct is written "in the same unit" (seconds.go). Two families of conjunction are therefore never written, and the spelling oracle compares nothing for them:

  1. A body naming no target, with its kind and a keyword on different conjuncts. The inline spelling names no target and has no partner (partnerOf), so {type: string, K} is compared with none of the three other ways to write it.
  2. Two constructs written apart, one beside an allOf and the other on an entry of it, which is the spelling of openapi: a oneOf beside an allOf whose entry writes an anyOf lowers apart from the two on one schema #2110.

For the first family, one document per keyword unit, each writing the unit in four components:

openapi: 3.1.0
info: {title: t, version: "1"}
paths: {}
components:
  schemas:
    Flat: {type: string, contentEncoding: base64}
    BothOnEntries: {allOf: [{type: string}, {contentEncoding: base64}]}
    KeywordOnEntry: {type: string, allOf: [{contentEncoding: base64}]}
    KindOnEntry: {contentEncoding: base64, allOf: [{type: string}]}

Each was compiled with morphic compile, and the four components' nodes compared with IDs, names and provenance removed and each node they reference read in place. Of 46 units at 3.1.0, 15 lower to different nodes across the four spellings; of 39 at 3.0.3, 13 (morphic @9be567bdb).

Units that differ at 3.1.0 What differs Filed as
format as uuid, date-time, int32, int64, double read flat, kept verbatim in the other three #2039, #2107
items, items naming a $ref, items with minItems, prefixItems, prefixItems with items a list of the top type keeping the keyword, where flat is a list of the element or a tuple #2039
contentEncoding kept under no_ir_home, where flat fills the scalar's Encoding #2210
oneOf of two $refs, anyOf of them, oneOf with a discriminator with the kind on an entry the union distributes into composed models; the other three are the plain union #2105
properties with a discriminator the discriminator kept where it is written on an entry #2052

The 31 units that lower alike are the bounds of every kind, pattern, enum, const, the notes and an extension, properties, required, both closures, patternProperties, propertyNames and contains. At 3.0.3 the same units differ, less the three that 3.0 does not define, and nullable differs by the nullable-inference mark a nullable written without a type of its own takes (docs/compilers/openapi.md#nullable).

Each row was found by hand. The committed record of what the cases find cannot hold any of them, since no case writes them:

$ grep -v '^#' internal/harness/openapicases/testdata/full/spelling.txt | awk -F'\t' '{print $3}' | sort | uniq -c
 164 closure-beside-union
  20 entry-missing-items
 229 entry-type-list
  52 residue-per-variant

Expected: a case for each family, so a spelling of them that lowers apart is a line of the record under its issue.

Direction

A draft.

  • First family. Spellings of a body with no target, the flat one being the one the others equal, each citing the rule that makes the two one (allof-inline-residue, allof-refinement). docs/compilers/openapi.md#allof-refinement says a format or items on an entry that names no kind, beside an entry naming it, "decides nothing", so the spelling with the kind and the keyword on two entries lowers apart by rule today. Its lines stand under openapi: an allOf entry's keyword is read for the position only where a list names it, and any other is kept #2210 until that issue settles the rule.
  • Second family. A placement for the second construct: in the unit, as now; beside the allOf; on an entry of its own.
  • Both multiply the full product, so the product is sized before it is committed, and the gate's core takes only what it can afford.

Out of scope

Related: #2110, #2039, #2107, #2129, #2210

Priority: P3. Rule 1 (a test task) gives P4 unless the task names the higher-tier work it unblocks: #2210 and #2110, both P3, are verified by these cases. The counts above are from the comparison described, at morphic @9be567bdb.

Activity

  1. added
    type:test
    priority:P3
    on Nov 24, 2026
  2. OmarAlJarrah commented on Dec 1, 2026

    @OmarAlJarrah
    MemberAuthor

    A further shape no case writes, which a review rule waits on: a target's body written inline on an allOf entry together with the keywords, {allOf: [{<body>, K1, K2}], <outer keywords>}. Every allOf spelling the cases write names the target through $ref.

    It matters for report order. #2356's finding (a refactor that moved the order of reports two keywords raise) came from those shapes. Rebuilt and compiled on the refactor's two sides (7d7208585 → fef2dc422), 1,038 of 7,280 such documents change their findings' order and nothing else. Over the same pair the generated cases change in none: 0 of 33,558 core, 0 of 397,162 full, although 124,094 of the full cases raise two findings or more.

    So .claude/skills/morphic-reviewing-prs/references/correctness.md#moved-report-order keeps its own hand-written generator for now. Once this issue adds a spelling that puts the body inline on an entry beside the keywords, the rule can name openapicases as its default source of shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P3type:test

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions