feat: materialize option defaults at feature intake, canonicalizing default-equivalent twins - #876
Merged
Conversation
…efault-equivalent twins (os-008) Rebind each resolved feature's options through options_with_defaults at Engine.add_feature_to_collection, so default-equivalent twin requests merge through the standard duplicate path instead of raising the twin-collapse ValueError at compute time. Dependency declaration (input_features, child option inheritance) keeps observing declared pre-default options via a stash in _process_feature. The compute boundary stays as an idempotent safety net for direct API use. Documents the lifecycle stage table in the memory bank.
…aliased at intake (os-008) Review fixes: a merge that holds only after materialization (declared pre-default options differ) now logs a warning advising deduplication and noting first-listed dependency precedence; intake materialization is memoized per feature group and source Options identity so aliased Options stay aliased; the filter-path identity-no-op invariant is documented in place. Also notes that subtype resolution applies defaults internally in the lifecycle table.
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.
Summary
Declared PropertySpec defaults are now materialized at feature intake (Engine.add_feature_to_collection). Two requests for the same feature that differ only by explicitly setting a key to its declared default merge into one feature during planning instead of raising at compute time; a warning advises deduplicating the request. Dependency declaration (input_features, child option inheritance) still observes declared pre-default options. The compute-boundary materialization remains as an idempotent safety net, and its twin-collapse ValueError is unreachable from engine-driven runs. The lifecycle stage table lives in memory-bank/systemPatterns.md.
Review and tests
Two independent deep reviews. Accepted fixes: merge warning with first-listed dependency precedence, an intake memo keeping shared Options instances aliased, and a filter-path invariant comment. 9 new test pins; full tox gate green (7195 passed, 170 skipped).