A composition-only layer installs, and its includes land beside it - #191
Merged
Merged
Conversation
avrabe
enabled auto-merge (squash)
September 24, 2026 17:39
Both found building the `covalent` realm — the worked multi-realm example: one
pin over the PulseEngine toolchain and the bytecodealliance component tools.
It deposited and signed, and then neither command that had to read it worked.
FIRST: install refused it outright.
layer 2026.09.0 carries no entry for platform x86_64-unknown-linux-gnu —
refusing to install a wrong-architecture toolchain
The fail-closed platform rule is right and stays: a fully-stamped layer with
nothing for this host must never install looking complete. It asked the wrong
question. A composition edge is not a payload — it names another layer's
manifest and the fetch loop deliberately skips it — so a pure composition has
ZERO entries that could ever match a platform, and "none matched" is not
evidence of a wrong architecture. The check now counts payload entries rather
than all entries. `a_layer_with_nothing_for_the_host_platform_fails_closed`
still passes, which is the point: the rule is unchanged, its question is not.
This is the deposit-side defect one stage down. `deposit` learned that a
composition-only layer is not an empty layer; `install` had not.
SECOND, and mine: the included realms were nested inside the composing one.
`fetch_included_layer` computed the included realm's partition with
`realm.effective_root(ctx.store.root())`. That function maps a BASE root to
`<base>/realms/<fingerprint>`, and `ctx.store.root()` is already a partition —
so a transitive install wrote `realms/<covalent>/realms/<pulseengine>/…`.
Install reported "fetched composed layer 2026.09.12 from realm 'pulseengine'"
and succeeded; the very next command said the layer was not installed, because
the composition walk looks at siblings.
`ProjectCtx` now carries `base_root` explicitly, named for what it is, so a
caller cannot reach for the wrong root without noticing which field it typed.
The partitions are siblings again, and the composition installs, inspects and
verifies:
composition: 3 layers —
2026.09.0 (verified against realm 'covalent') [pinned]
2026.09.12 (verified against realm 'pulseengine')
2026.09.0 (verified against realm 'pulseengine-wasm')
66 payload(s): 59 DISPATCHED, 7 HELD
Neither was reachable by unit test: one needs a layer with no payloads, the
other needs two realms in one store. Both are one command in the product.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu
avrabe
force-pushed
the
fix/install-composition-only
branch
from
September 24, 2026 17:39
280857f to
c3c9af7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two defects, both found building the
covalentrealm — the worked multi-realmexample: one pin over the PulseEngine toolchain and the bytecodealliance
component tools. It deposited and signed, and then neither command that had
to read it worked.
1. Install refused a layer made only of includes
The fail-closed platform rule is right and stays. It asked the wrong
question:
matched == 0 && !manifest.entries.is_empty(). A composition edge isnot a payload — it names another layer's manifest and the fetch loop
deliberately skips it — so a pure composition has zero entries that could
ever match a platform, and "none matched" is not evidence of a wrong
architecture. The check now counts payload entries.
a_layer_with_nothing_for_the_host_platform_fails_closedstill passes. That isthe point: the rule is unchanged, only its question.
This is the deposit-side defect one stage down —
depositlearned that acomposition-only layer is not an empty layer (#171);
installhad not.2. The included realms nested inside the composing one — mine, from #177
fetch_included_layerusedrealm.effective_root(ctx.store.root()). That mapsa base root to
<base>/realms/<fingerprint>, andctx.store.root()isalready a partition, so a transitive install wrote:
Install printed "fetched composed layer 2026.09.12 from realm 'pulseengine'"
and succeeded; the very next command said the layer was not installed, because
the composition walk looks at siblings.
ProjectCtxnow carriesbase_root, named for what it is, so a caller cannotreach for the wrong root without noticing which field they typed.
The result
Neither defect was reachable by unit test: one needs a layer with no payloads,
the other needs two realms in one store. Both are one command in the product.
Control: reverting the emptiness test to count every entry fails the new test.
Gate: fmt · clippy -D warnings · 1038 tests, 0 failed · trace-gate OK.
(trace-gate also caught me inventing
REQ-COMPOSEONLY-001from a PR title —the marker now names
REQ-COMPOSE-001, which exists.)🤖 Generated with Claude Code
https://claude.ai/code/session_019TNtfRjLNhEz82G2ggeeNu