Add declaredKeys property to extension specifications#6980
Draft
ryancbahan wants to merge 7 commits intorcb/phase3-roundtrip-cleanupfrom
Draft
Add declaredKeys property to extension specifications#6980ryancbahan wants to merge 7 commits intorcb/phase3-roundtrip-cleanupfrom
ryancbahan wants to merge 7 commits intorcb/phase3-roundtrip-cleanupfrom
Conversation
This was referenced Mar 11, 2026
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3 tasks
0358545 to
a391d09
Compare
5d2f349 to
c92ffe1
Compare
a391d09 to
2204acf
Compare
Each spec now declares its top-level config keys via declaredKeys[], computed from the Zod schema shape for locally-defined specs and from JSON Schema properties for contract-based specs. This enables declarative slicing (pick keys from raw config) without running a parse. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create sliceConfigForSpec() for declarative config slicing via deep-copy pick. Add findUnclaimedKeys() for detecting unsupported sections. Wire equivalence assertions into createConfigExtensionInstances that compare slice output against existing parse results (key + value parity). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add removeTrailingSlash to the forward transform so deploy payload is identical regardless of whether input was Zod-normalized or raw. The reverse transform already had this normalization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the first parse (parseConfigurationObjectAgainstSpecification) with sliceConfigForSpec() for extracting each spec's portion of the app config. The second parse inside createExtensionInstance stays as a guardrail — instance.configuration is still schema-validated. Key claiming now uses Object.keys(slice) via findUnclaimedKeys(), matching the previous Object.keys(specConfiguration) behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create validateSpecConfig() that validates a config slice against Zod + AJV in fail mode, returning errors only (no data shaping). Deduplicates errors using the same logic as unifiedConfigurationParserFactory. Store normalized contractSchema on merged specs during mergeLocalAndRemoteSpecs for use by the new validator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…t instance creation Replace the double-parse pattern in createConfigExtensionInstances with: 1. sliceConfigForSpec() for data extraction (deep copy) 2. validateSpecConfig() for error collection (Zod + AJV, no data shaping) 3. Direct ExtensionInstance construction with the raw slice instance.configuration is now the raw slice rather than the Zod-parsed output. The only behavioral difference is app_proxy.url may retain a trailing slash (cosmetic, in getDevSessionUpdateMessages log output). Preserves all createExtensionInstance behavior for single specs: - devUUID preservation from previousApp - spec-level validate() call - deployConfig empty-payload check createExtensionInstance is unchanged for uuid/dynamic specs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the strip/fail switch — all specs now use 'fail' mode. Single specs use validateSpecConfig() for validation (no AJV stripping needed). UUID and dynamic specs already used 'fail'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2204acf to
ca4202a
Compare
c92ffe1 to
845af9a
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.

WHY are these changes introduced?
Fixes #0000
WHAT is this pull request doing?
How to test your changes?
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist