mirror of
https://github.com/openai/codex.git
synced 2026-05-28 15:00:16 +00:00
Introduce an explicit enterprise-managed config layer source and the client-side machinery to materialize cloud-delivered config TOML fragments into the normal config stack. The new ConfigLayerSource::EnterpriseManaged variant carries the backend layer id and display name so diagnostics and debug output can point admins at the exact cloud layer that needs fixing. Add codex_config::cloud_config_layers to build config layers from delivered fragments. The composition keeps backend layer order deterministic, resolves relative path settings against a supplied base directory for consistency with existing MDM-delivered config semantics, and stores the raw TOML with that base directory on ConfigLayerEntry so typed diagnostics can reparse non-file layers without relying on a synthetic filesystem path. Keep this v1 pull-based and snapshot-oriented. The bundle loader/cache work can feed these helpers, but this change does not introduce dynamic refresh or announce/push semantics. Consumers continue to read the config state they are already handed. Tighten provenance and diagnostics for non-file layers: enterprise-managed layers render as enterprise-managed config values in debug output, syntax/type errors use the layer display name, and synthetic hook source paths include the enterprise layer name/id when a filesystem path is needed for existing hook metadata surfaces. Split hook provenance semantically by adding HookSource::CloudManagedConfig. Hooks delivered through enterprise-managed config layers now report cloud_managed_config / cloudManagedConfig, while hooks delivered through requirements remain CloudRequirements. The TUI labels the new source as Cloud-managed config, and analytics/core metric mappings were updated to include the new source. Regenerate app-server protocol JSON and TypeScript schema fixtures for the new ConfigLayerSource and HookSource wire values. Verification: just write-app-server-schema; cargo test -p codex-app-server-protocol; cargo test -p codex-hooks hook_metadata_for_config_layer_source; cargo test -p codex-core hook_run_metric_tags; cargo test -p codex-analytics hook_run_metadata; just fmt; just fix -p codex-protocol -p codex-app-server-protocol -p codex-hooks -p codex-analytics -p codex-core -p codex-tui.
271 lines
7.7 KiB
JSON
Generated
271 lines
7.7 KiB
JSON
Generated
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"AbsolutePathBuf": {
|
|
"description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.",
|
|
"type": "string"
|
|
},
|
|
"ConfigLayerMetadata": {
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "#/definitions/ConfigLayerSource"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"version"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"ConfigLayerSource": {
|
|
"oneOf": [
|
|
{
|
|
"description": "Managed preferences layer delivered by MDM (macOS only).",
|
|
"properties": {
|
|
"domain": {
|
|
"type": "string"
|
|
},
|
|
"key": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"mdm"
|
|
],
|
|
"title": "MdmConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"domain",
|
|
"key",
|
|
"type"
|
|
],
|
|
"title": "MdmConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "Managed config layer from a file (usually `managed_config.toml`).",
|
|
"properties": {
|
|
"file": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AbsolutePathBuf"
|
|
}
|
|
],
|
|
"description": "This is the path to the system config.toml file, though it is not guaranteed to exist."
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"system"
|
|
],
|
|
"title": "SystemConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"file",
|
|
"type"
|
|
],
|
|
"title": "SystemConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "Enterprise-managed config layer delivered by the cloud config bundle.",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Stable identifier for the delivered layer.",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "Admin-facing name for the delivered layer. This is surfaced in diagnostics so users know which cloud layer needs administrator attention.",
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"enterpriseManaged"
|
|
],
|
|
"title": "EnterpriseManagedConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"type"
|
|
],
|
|
"title": "EnterpriseManagedConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory",
|
|
"properties": {
|
|
"file": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AbsolutePathBuf"
|
|
}
|
|
],
|
|
"description": "This is the path to the user's config.toml file, though it is not guaranteed to exist."
|
|
},
|
|
"profile": {
|
|
"description": "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"user"
|
|
],
|
|
"title": "UserConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"file",
|
|
"type"
|
|
],
|
|
"title": "UserConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.",
|
|
"properties": {
|
|
"dotCodexFolder": {
|
|
"$ref": "#/definitions/AbsolutePathBuf"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"project"
|
|
],
|
|
"title": "ProjectConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"dotCodexFolder",
|
|
"type"
|
|
],
|
|
"title": "ProjectConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "Session-layer overrides supplied via `-c`/`--config`.",
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"sessionFlags"
|
|
],
|
|
"title": "SessionFlagsConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "SessionFlagsConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"description": "`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a \"best effort\" while we phase out `managed_config.toml` in favor of `requirements.toml`.",
|
|
"properties": {
|
|
"file": {
|
|
"$ref": "#/definitions/AbsolutePathBuf"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"legacyManagedConfigTomlFromFile"
|
|
],
|
|
"title": "LegacyManagedConfigTomlFromFileConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"file",
|
|
"type"
|
|
],
|
|
"title": "LegacyManagedConfigTomlFromFileConfigLayerSource",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"legacyManagedConfigTomlFromMdm"
|
|
],
|
|
"title": "LegacyManagedConfigTomlFromMdmConfigLayerSourceType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "LegacyManagedConfigTomlFromMdmConfigLayerSource",
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"OverriddenMetadata": {
|
|
"properties": {
|
|
"effectiveValue": true,
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"overridingLayer": {
|
|
"$ref": "#/definitions/ConfigLayerMetadata"
|
|
}
|
|
},
|
|
"required": [
|
|
"effectiveValue",
|
|
"message",
|
|
"overridingLayer"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"WriteStatus": {
|
|
"enum": [
|
|
"ok",
|
|
"okOverridden"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"properties": {
|
|
"filePath": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AbsolutePathBuf"
|
|
}
|
|
],
|
|
"description": "Canonical path to the config file that was written."
|
|
},
|
|
"overriddenMetadata": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/OverriddenMetadata"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/WriteStatus"
|
|
},
|
|
"version": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"filePath",
|
|
"status",
|
|
"version"
|
|
],
|
|
"title": "ConfigWriteResponse",
|
|
"type": "object"
|
|
} |