Repository navigation
fix(fold): interpret a composite the host registered (#2442) - #2443
Merged
Merged
Conversation
`findCompositeDefinition` required `Composite` to be chant's own. That is right for a chant project and is the provenance question #1082 settled: a project-local `function Composite(...)` shadowing the name is not chant's, and a call to it is not a registered composite. It had never had to consider a host supplying the form (`F-Host-Composite`), because a chant project's active packages are all lexicons and no lexicon exports a `Composite`. Reaching the new branch at all needs a caller that named its own host packages (`FoldProjectOptions.lexiconPackages`, #2438), so no chant build moves. The second half is the one with teeth. Recognising the form only gets interpretation started; the members it produces are then the host's, and wrapping them in chant's `Composite` runs chant's member validation, which asks for chant's own `Declarable` and refuses an entity carrying a different marker. That was the actual failure the conformance harness hit: `Composite "Good" member "bucket" is not a Declarable or CompositeInstance`. A host's form now returns its members as the factory built them; chant's own form still goes through `Composite`, unchanged. Clears the last three fixtures the specification's harness held out — `S-FactoryBody`, `S-FactoryParams` and `F-IsolatedRefusal` under isolated mode — with every verdict and export matching the reference adapter.
lex00
force-pushed
the
fix/2442-host-composite
branch
from
September 12, 2026 22:15
b1fa9df to
726b7ab
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.
Closes #2442.
What was wrong
findCompositeDefinitionrequiredCompositeto be chant's own. That is right for a chant project and is the provenance question #1082 settled: a project-localfunction Composite(...)shadowing the name is not chant's, and a call to it is not a registered composite.It had never had to consider a host supplying the registration form (
F-Host-Composite), because a chant project's active packages are all lexicons and no lexicon exports aComposite. Reaching the new branch at all needs a caller that named its own host packages (FoldProjectOptions.lexiconPackages, #2438), so nothing about a chant build moves. A test asserts that: unnamed, the host package is not resolvable and the sandbox refuses the invocation arm exactly as before.The half with teeth
Recognising the form only gets interpretation started. The members it produces are then the host's, and wrapping them in chant's
Compositeruns chant's member validation, which asks for chant's ownDeclarableand refuses an entity carrying a different marker.That was the actual failure, found by instrumenting rather than by reading:
The specification's
shapeshost marks its entities withSymbol.for("tsad.conformance.declarable"). Chant was refusing them for not being chant's, not for being malformed. A host's form now returns its members as the factory built them; chant's own form still goes throughComposite, unchanged.I diagnosed this wrong twice on the issue before instrumenting (first
--sandboxblocking step 4, then envelope folding); both are corrected there.Effect
Clears the last three fixtures the specification's conformance harness held out under isolated mode, with every verdict and every export matching the reference adapter:
Gates
scripts/typecheck.ts: 31 known failures, no regressionsnpx vitest run: 7 failed / 17,704 passed, the known local-only baseline (6any-budget, 1carve-bridge)packages/core/src/discovery/fold-host-composite.test.ts, three cases — the host's form folds to the host's own members, a factory outside the subset is still refused rather than invoked, and the form is only recognised when the caller named the package.