entity.parent_id -> entity matches every type pair in both directions, and the
discovery loop kept forward whenever reverse also matched — so an array
include compiled as `parent.parent_id = child.id` and every nested list read
back empty. Now cardinality decides: an array lists the children (reverse), a
scalar reaches the parent (forward) — a line's UI can include its invoice. A
single child through this edge is declared as a one-element array, never a
scalar. fixtures/composition.json pins both joins; 1288 library tests pass.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AvkGU4kQ4wsqxHFpXtZKZM
Filter keys arrive as "path/field:$op", so the override check that compared the
key to the bare "archived" never matched: the hidden NOT archived clause was
always added and an explicit archived filter could not return archived rows.
The match is on the node's own archived path, so a root filter lifts the
default for the root only — nested includes the filter never mentioned keep
hiding archived rows. The two queryer fixtures that filter on archived had
snapshotted the contradiction (NOT archived AND archived = $1); they now expect
the filter alone. 1286 library tests pass.
Pinned by api's TestArchive_CascadesDownTheTree (test/punc/lineage_test.go).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AvkGU4kQ4wsqxHFpXtZKZM
Resolves a query compilation bug in JSPG where reverse/incoming polymorphic
edges (where edge.forward == false, e.g. pet ➡️ cover_attachment) mistakenly
appended the destination type constraint to the parent query's WHERE clause
(e.g., producing `entity_1.type = 'attachment'` on a pet entity query,
causing it to match 0 rows and return null).
- Modifies `compile_polymorphic_bounds` in `compiler.rs` to only compile
type checks when `edge.forward` is true. For reverse edges, the parent's
type check does not belong on the parent table and is already implicitly
restricted by parent ID joins.
- Updates the `fk_attachment_attachable_entity` relation in the queryer test
fixture to correctly model a two-column polymorphic relation, ensuring
this code path is exercised by the unit test suite.
parse_and_match_mocks matched mock.type against only the first FROM table —
always 'entity' for hierarchy existence reads — so every merger update-case
mock was silently inert and those cases snapshotted the create path. Now each
UNION arm is matched independently (a mock matching any arm returns once,
mirroring UNION dedup) and the type check accepts any FROM/JOIN table.
Regenerated the five revived cases (their snapshots now show real update /
no-op replace / archive semantics) and added the two previously untestable
probe-disagreement cases: same-row dedup (updates, no error) and id-vs-lookup
conflict (TOO_MANY_LOOKUP_ROWS).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Supersedes the inline-structural approach (0d282cc): inlining erased the value
type's name, so identical nested shapes (weekly_hours at two paths) generated
duplicate leaf types downstream and Dart barrel exports collided. Now a named
non-table value type's filter is synthesized ONCE (like table-backed boundaries)
and property references point at it — mirroring how the entity side generates
one class per named type. Same filter-by-fields capability; laziness also
removes the structural-recursion hazard. A named type with no compilable
structure still gets no filter and is omitted rather than dangled.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A property typed as a named value type (a schema-only config object like
an operating-hours schedule) previously got a dangling {type}.filter
reference — no filter is ever synthesized for a non-table-backed schema,
so the whole parent filter failed downstream (PROXY_TYPE_RESOLUTION_FAILED;
the punc generator emitted an empty filter type).
Naming a value type is a reuse choice, not a semantics choice: it now
compiles structurally into the parent filter, exactly like an inline
object, recursively (including array items). Table-backed boundaries keep
the lazy {type}.filter reference. A named type with no compilable
structure is omitted instead of dangling.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Rename fixtures/items.json to fixtures/array.json to better reflect array testing constraints.
- Update reference paths in src/tests/fixtures.rs and across other fixture JSON files.
- Remove unused HashMap import in src/validator/rules/dict.rs to resolve the compiler warning.