Skip to content

Add declaredKeys property to extension specifications#6980

Draft
ryancbahan wants to merge 7 commits intorcb/phase3-roundtrip-cleanupfrom
rcb/config-lifecycle
Draft

Add declaredKeys property to extension specifications#6980
ryancbahan wants to merge 7 commits intorcb/phase3-roundtrip-cleanupfrom
rcb/config-lifecycle

Conversation

@ryancbahan
Copy link
Contributor

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:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

@ryancbahan ryancbahan force-pushed the rcb/config-lifecycle branch from 0358545 to a391d09 Compare March 12, 2026 14:53
@ryancbahan ryancbahan force-pushed the rcb/phase3-roundtrip-cleanup branch 2 times, most recently from 5d2f349 to c92ffe1 Compare March 13, 2026 18:29
@ryancbahan ryancbahan force-pushed the rcb/config-lifecycle branch from a391d09 to 2204acf Compare March 13, 2026 18:29
ryancbahan and others added 7 commits March 13, 2026 12:33
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>
@ryancbahan ryancbahan force-pushed the rcb/config-lifecycle branch from 2204acf to ca4202a Compare March 13, 2026 18:34
@ryancbahan ryancbahan force-pushed the rcb/phase3-roundtrip-cleanup branch from c92ffe1 to 845af9a Compare March 13, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant