Support packaged defaults in config layering (#37810)

## What changed

- Load an optional package-supplied config file as the lowest-precedence
  configuration layer, so every existing layer can override its values.
- Report the layer as `packagedDefaults`, including its source path, through
  config diagnostics and the app-server protocol.
- Return an error when a configured packaged defaults file is missing.

## Testing

- Cover precedence across packaged, system, user, and session layers.
- Cover the missing-file error path.

GitOrigin-RevId: 52406890f4d580eedabc90bf2a9ee3affa36fee1
This commit is contained in:
jif authored and copyberry committed 2026-08-10 11:22:55 +00:00
1 parent 09f47c8785
commit 34ecac1f2b
19 files changed
+283 -6

No files matched your search

@@ -8509,6 +8509,32 @@
},
"ConfigLayerSource": {
"oneOf": [
{
"description": "Default configuration supplied with the installed Codex package.",
"properties": {
"file": {
"allOf": [
{
"$ref": "#/definitions/v2/AbsolutePathBuf"
}
],
"description": "Path to the packaged default configuration file."
},
"type": {
"enum": [
"packagedDefaults"
],
"title": "PackagedDefaultsConfigLayerSourceType",
"type": "string"
}
},
"required": [
"file",
"type"
],
"title": "PackagedDefaultsConfigLayerSource",
"type": "object"
},
{
"description": "Managed preferences layer delivered by MDM (macOS only).",
"properties": {