Repository navigation
Description
Problem or Motivation
Part 1 of #1000. Six hand-written registries describe the settings, and they already disagree (origin/main 4226904, 2026-10-28):
config/options.py: 100 key constants,CONFIG_OPTIONS,SECRET_CONFIG_OPTIONSandKEYRING_KEYS.config/env.py: 84ENV_*constants, theOPTION_TO_ENV_VARmap and the hand-writtenget_all_env_var_specs()list (79 specs).security/secrets.py:build_secret_registryrepeats the keyring name and the variables of each of the 15 credentials.commands/config.py:config showprints 29 hand-written_rowlines.docs/generator.pyreadsOPTION_TO_ENV_VARand the spec list.
Measured drift: 7 options have a variable but no spec, so devops config env and docs/ENV_VARS.md do not show them (ai.tasks.<task>.reasoning_effort for 4 tasks, ai.rag.enabled, ai.rag.top_k, ai.rag.score_threshold). CONFIG_OPTIONS has no reader outside options.py.
Proposed Solution & Architectural Design
- Each environment-bound
Settingsfield declares that it reads a variable, and its description, once on the field. The variable name follows one rule:DEVOPS_CLI_and the key in upper case with_for.. The one segment that differs today (ai.tasksisAI_TASK_in 17 names) is declared once on thetasksfield, not 17 times. - The credential table in
security/secrets.pyis the one declaration of each credential: its keyring name, its variables and whether a file may hold it.KEYRING_KEYSand the secret set are derived from it. OPTION_TO_ENV_VAR, the variable spec list,config show,config env,config set,config audit-keys, the workspace route's redaction and the docs generator read the derived view.config/options.py, theENV_*constants of options, theOPTION_TO_ENV_VARliteral, the spec list and the 29_rowlines are deleted.
Target Subsystem
src/devops_cli/config/, src/devops_cli/security/secrets.py, src/devops_cli/commands/config.py, src/devops_cli/docs/generator.py.
Existing Tool Considered
pydantic field metadata (FieldInfo.description, Annotated metadata) holds the declaration. pydantic-settings' own env binding cannot give today's names for nested fields: it joins nested names with env_nested_delimiter, and the ai.tasks names do not follow the key. Its sources are part 2 of #1000. Nothing new is built: the change deletes four hand-written registries.
Acceptance criteria
- A snapshot test holds the set of variables and the keyring names and secret keys as they were at the start of the change. The 10 options that code reads and that had no variable get one by the rule, and the change names them. The 3 options that no code reads get none (fix(config): telemetry.logfire, cloudflare.access.enabled and cloudflare.access.idp are settings that no code reads #2457).
devops config envanddocs/ENV_VARS.mdlist every variable that sets a setting or a credential, each with a description: the 7 setting variables and the 6 credential variables that the list missed are added.config/options.pyand the hand-written spec list do not exist.git grep -n "OPTION_TO_ENV_VAR = {"finds nothing.devops config showprints every declared setting and credential, sorted by key, with--formatand--json, and has no_rowline for each key.tests/test_config_env_overrides.py,tests/test_config_audit_keys.pyandtests/test_config_cmd.pypass.- The tests run offline, with no keyring daemon and no Vault.
Related
Parent: #1000. Siblings: one resolution order through pydantic-settings sources, and the import boundary of field-backed defaults.
Source: #1000
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fix(config): config set reports an unknown key as unknown, not as a k…
refactor(config): settings resolve in one declared order through pyda…