Skip to content

fix: an aspect reference in a schema collection no longer recurses (#719) - #720

Merged
vic merged 2 commits into
mainfrom
fix/719-schema-excludes
Oct 13, 2026
Merged

vic merged 2 commits into
mainfrom
fix/719-schema-excludes

Conversation

@sini

@sini sini commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Fixes #719.

Cause

Since #717, gen-schema mints a kind's identity from the contents of its schema collections when an instance is imported. includes and excludes hold aspect references, and an aspect reference can reach back into the host being built. Hashing the collection therefore forced that host during its own import. The result was an infinite recursion, or an exclusion that silently did nothing.

Fix

  • den.schema declares includes and excludes with identity = false. gen-schema keeps a collection declared this way out of the kind identity. These collections are policy over aspects, not part of the kind's shape.
  • templates/ci pins gen at 6427d42, which carries gen-schema 10f4d12 with identity = false support. Only the gen input moved (nix flake update gen).

Tests

templates/ci/modules/deadbugs/issue-719-schema-excludes-aspect-ref.nix now has 5 cells:

  • the 3 cells from the reproduction commit, which put a direct reference, a bracket reference and a nested bracket reference in den.schema.host.excludes;
  • 2 cells that put the same references in the parent kind's den.schema.conf.excludes / includes.

The 2 conf cells expect the values den produced before #717, where conf's collections do not apply to a host instance. I checked them against 65c9fd4 and all 5 cells pass there.

nix-unit --override-input den . --flake ./templates/ci#tests:

tree #719 suite full suite
reproduction commit 39c4833 (old gen pin) 0/3, infinite recursion 1270/1273. The only failures are the 3 #719 cells
this PR 5/5 1275/1275
this PR without the identity = false lines 0/5, infinite recursion 1270/1275. The only failures are the 5 #719 cells

just fmt makes no changes.

sini added 2 commits October 13, 2026 06:46
)

The kind identity hashed the contents of every schema collection when an
instance was imported, and an aspect reference in includes / excludes
reaches back into the host being built. den now declares both collections
identity = false, which gen-schema keeps out of the kind identity; the gen
pin moves to the hub revision that carries that support.
@github-actions github-actions Bot added the allow-ci allow all CI integration tests label Oct 13, 2026
@sini
sini requested review from theutz and vic October 13, 2026 20:59
@vic
vic merged commit 05619dc into main Oct 13, 2026
@vic
vic deleted the fix/719-schema-excludes branch October 13, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: aspect ref in den.schema.host.excludes ignored / infinite recursion since #717

2 participants