You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(core): fold — composite factory interpretation (removes the last run) #1023
Part of the fold epic. Cold-handoff. Hardest issue — the one that removes the last run. Depends on #4.
Context
A composite is a factory function (VpcStack({...})) the current model evaluates by running. To fold it, the folder must (a) recognize the callee is a registered Composite (not an arbitrary helper — a bare call stays rejected) and (b) interpret the factory body. The body is not arbitrary TS: EVL009/EVL010 already forbid data transforms and extractable constants inside composite factories, so it is limited to props, siblings, imported identifiers, ?? defaults, and resource()/nested-composite calls returning an object map.
Scope
Implement a constrained interpreter for composite factory bodies:
Resolve a call whose callee is a registered Composite; reject any other call (unchanged).
Bind the factory's props param to the folded argument object.
Evaluate the returned resource map: each resource(type, (siblings) => ({...})) callback folds with props and siblings in scope (EVL005 guarantees expression bodies; EVL007 guarantees siblings keys exist).
Support nested composites (recursion), ?? defaults on props.
Respect EVL009/010 constraints; anything outside them → FoldError.
Acceptance criteria
A representative composite (e.g. an aws or k8s composite from a lexicon fixture) folds to the same resource set as running it — differential test vs the run path (Op composite + build pipeline integration #7 corpus).
changed the title [-]feat(core): fold — opt-in build path with run-fallback for composites[/-][+]feat(core): fold — composite factory interpretation (removes the last run)[/+]on Jul 24, 2026
Shipped in PR #1167 with one acceptance box honestly not met: 'corpus folds with zero run-path fallback' was unreachable when written — the 46 run-fallback entries are held by export default / exported functions / nested-new / process.env, not composite calls. What shipped: a closed interpretable subset (contract-documented), interpretation replacing invocation for project-owned registered Composites, verbatim fallback otherwise, execution accounting in both reports, and the boundary suite now asserting projectFactoryInvocations === 0 per entry. On the corpus, #1023's own class is empty; the machinery's real audience is an application's own composites/*.ts. The measured next gate is filed as the nested-new issue above.
Activity
[-]feat(core): fold — opt-in build path with run-fallback for composites[/-][+]feat(core): fold — composite factory interpretation (removes the last run)[/+]feat(discovery): fold composite factory calls, not just resource cons…
docs: adversarial audit of fold / TypeScript-as-Data docs (#1038) (#1043
fix(fold): stop cross-file resolution from hanging sandbox-differential
feat(fold): resolve identifiers across the module graph (#1055)
feat(core): fold interprets composite factory bodies — the last in-pr…
lex00 commentedon Jul 28, 2026
Shipped in PR #1167 with one acceptance box honestly not met: 'corpus folds with zero run-path fallback' was unreachable when written — the 46 run-fallback entries are held by export default / exported functions / nested-new / process.env, not composite calls. What shipped: a closed interpretable subset (contract-documented), interpretation replacing invocation for project-owned registered Composites, verbatim fallback otherwise, execution accounting in both reports, and the boundary suite now asserting projectFactoryInvocations === 0 per entry. On the corpus, #1023's own class is empty; the machinery's real audience is an application's own composites/*.ts. The measured next gate is filed as the nested-new issue above.
feat(core): fold constructs a `new Type(...)` used as a value (#1169) (…
feat(core): fold call-form composite factories and opted-in call-form…