Skip to content

fix(core): a host's own aspect excludes as far as the host - #762

Merged
sini merged 1 commit into
mainfrom
fix/exclude-reach
Nov 11, 2026
Merged

sini merged 1 commit into
mainfrom
fix/exclude-reach

Conversation

@sini

@sini sini commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reported in Matrix by vipultyagi: with feature in den.default.includes, den.aspects.igloo.excludes = [ den.aspects.feature ] left feature on igloo, while den.hosts.x86_64-linux.igloo.excludes and den.schema.host.excludes removed it. The same was true on v0.19.0.

Cause. An exclude applies only below the include chain it was registered under. check-constraint keeps an entry where the node's chain starts with the entry's ownerChain (handlers/constraint.nix filterByScope).

  • Instance and schema excludes sit on the host root (resolve-entity.nix), where ownerChain is []. So they also reach tux's own copy of den.default, which the transition default lifts to the host.
  • den.aspects.igloo is walked one level down, as the host's <self:host> self-provide. Its excludes register under that chain and stop at the host's own subtree.

Fix.

  • The host's own aspect is the host. Its excludes register at the host root, as the instance's do (children.nix ownerChainOverride). That covers its parametric body (types.nix ownBody) and policy exclude effects in its includes (registerIncludedPolicyExcludes). This is the host kind only.
  • meta.handleWith filters and substitutes keep the aspect's reach. Only excludes change.
  • An aspect-value exclude names the aspect written there. The entry records the value's definition position (refDefPos, from meta.__defPos). A node of the same identity is excluded only when it's the same definition. Before, den.hosts.….igloo.excludes = [ den.aspects.tools ] also removed a user's unrelated inline { name = "tools"; … }. Nodes below the excluded aspect, matched by identity prefix, are unchanged.
  • excludes in a host's provides.<user> or provides.to-users are now refused, with an error. Before, they were accepted and silently did nothing. The provide is delivered at the user's policy dispatch, after the user's includes have been gated, so its excludes can't apply in den v1 (the exclude-timing limit). Registering them early can't be made exact: whether the provide is itself excluded is only decided at dispatch. The error names the spellings that work: den.aspects.<user>.excludes, or the host's own den.aspects.<host>.excludes, which now reaches its users.

Behaviour against main

exclude main this PR
den.aspects.igloo.excludes, plain, parametric, or a policy exclude in its includes host's own subtree the host and its users, as the instance
den.hosts.….igloo.excludes / den.schema.host.excludes the host and its users unchanged
an aspect the host includes, with excludes its own subtree unchanged
any host exclude vs a user's inline aspect sharing the name removed kept
den.aspects.igloo.meta.handleWith the aspect's subtree unchanged
igloo.provides.tux.excludes, igloo.provides.to-users.excludes silently ignored error
another host's users not reached not reached

Validation

  • New cells in templates/ci/modules/public/c1-aspects-schema/:
    • exclude-reach.nix: 10/10 here, 4/10 on main. Covers reach, the end state, another host, an included aspect, and a namesake under each host form.
    • exclude-reach-forms.nix: 9/9 here, 3/9 on main. Covers parametric forms, policy excludes, the refused provides, and handleWith keeping its reach.
  • deadbugs.issue-694-exclude-exactly: 35/35.
  • Full suite (ci.bash, 4 workers): 2165/2165 at 215c74f.
  • Every template's drvs are equal to main: 14 configurations, 9 build and 5 fail to evaluate on both.
  • Self-review: four adversarial rounds.
    • Round 1 caught the namesake over-match, handleWith widening, and the parametric and policy forms. All are fixed, with cells.
    • Round 2 caught all entity kinds getting the reach, so it's now host only.
    • Round 3 showed early registration of provide excludes is order-dependent. That's why they're refused here.
  • Docs: reference/batteries.mdx, reference/aspects.mdx, explanation/structural-introspection.mdx, and the excludes option description.

@github-actions github-actions Bot added the allow-ci allow all CI integration tests label Nov 11, 2026
`den.aspects.<host>.excludes` registered one include level below the host
root, so it stopped at the host's own subtree, while
`den.hosts.<sys>.<host>.excludes` and `den.schema.host.excludes` also reach
what the host's users include. The host's own aspect, its parametric body
and policy excludes in its includes now register at the host root. Its
`handleWith` keeps the aspect's reach.

An aspect-value exclude names the aspect written there: an inline aspect
that only shares its name is no longer excluded.

`excludes` in a host's `provides.<user>` or `provides.to-users` are refused:
the provide is delivered after the user's includes are resolved, so they
could never apply.

Reported in Matrix.
@sini
sini force-pushed the fix/exclude-reach branch from 215c74f to de1566d Compare November 11, 2026 19:50
@sini
sini merged commit a66a778 into main Nov 11, 2026
17 checks passed
@sini
sini deleted the fix/exclude-reach branch November 11, 2026 20:17
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.

1 participant