Repository navigation
Description
Problem Description
A bare off or on as the value of roadmap.intake.jev stops the settings load. The settings read the config file with PyYAML (yaml.safe_load in _read_config_file, src/devops_cli/config/settings.py). PyYAML follows YAML 1.1, where a bare off is false and a bare on is true. The field type JevMode = Literal["off", "shadow", "on"] refuses a bool, so the settings do not load.
The project's own writer makes this file. devops config set roadmap.intake.jev off writes through round_trip.edit (ruamel.yaml, YAML 1.2), which writes jev: off with no quotes, because off is a string in YAML 1.2. The next load reads false.
k8s/devops/configmap.example.yaml already quotes the value (jev: "off"), so a copy of the template is safe. A person who types jev: off, and the file that devops config set writes, are not.
The field roadmap.decisions of #4397 (pull request #4453) uses the same values (DecisionMode) and has the same gap.
Reproduction Steps
round_trip.edit('roadmap:\n intake:\n jev: shadow\n', {('roadmap', 'intake', 'jev'): 'off'}, name='x').- Load the result with
yaml.safe_load. - Validate
{'jev': False}withRoadmapIntakeConfig.
Expected vs Actual Behavior
Expected: the settings load with the mode off.
Actual: step 1 gives jev: off, step 2 gives {'jev': False}, and step 3 raises ValidationError: "Input should be 'off', 'shadow' or 'on' [type=literal_error]". The text of the error names the value that the person wrote as a valid value, because the error hides the input. With on, the same occurs with True.
Environment Diagnostics
devops-cli at commit 6cf78e7 of main, PyYAML safe_load, ruamel.yaml round trip. Python 3.14. The error does not depend on the host.
Logs, Traces, or Terminal Output
'roadmap:\n intake:\n jev: off\n'
{'roadmap': {'intake': {'jev': False}}}
ValidationError 1 validation error for RoadmapIntakeConfig
jev
Input should be 'off', 'shadow' or 'on' [type=literal_error]
Proposed fix
Fix the cause at the reader (review of plan PR #4599, 2026-11-11). The writer round_trip.edit writes YAML 1.2 (ruamel.yaml), but the readers use yaml.safe_load, which reads YAML 1.1. So off, on, yes, no and 12:30 change type on the next load, for about 100 string settings, not only the two mode fields: devops config set search.language no and devops config set k8s.context 12:30 also write the file, exit 1 and stop each later load.
- Read every config file with ruamel.yaml
YAML(typ="safe"), the library that writes it (pinned in pyproject.toml), and import it lazily inside the reader functions. Readers:settings.py_read_config_file,write_history.py(two readers),commands/config.py(audit reader) andk8s/configmap.py(ConfigMap render). Catch the ruamelYAMLErrorinload_yaml, and keep the rule that a load error quotes no text of the file. - Keep
JevMode,DecisionModeand the feat(roadmap): a shadow mode for the Jev intake labels #4438 guard as they are: a bool still fails to validate (spec roadmap-intake-jev, scenario "The old bool is refused"). A bareofforonloads as the string, so no validator is needed. - Tests first: a bare
offandonin a file forroadmap.intake.jevand forroadmap.decisions(through the settings load);devops config set roadmap.intake.jev offexits 0 and loadsoff;config set search.language noandconfig set k8s.context 12:30load as strings; the ConfigMap render. - Record in the plan the cost (about 29 modules and 16-25 ms of import for each command that loads settings; check with
uv run devops ci --only startup-imports) and the values that change: a typed0755loads 755, a typed1:30float is refused, a duplicate key raises an error. On 5 real config inputs, 0 of 311 values change. - Rejected: a
BeforeValidatoron the two mode types (it fixes 2 of about 100 exposed settings and makestrueandyesload as the live modeon, against feat(roadmap): a shadow mode for the Jev intake labels #4438 and ADR 0019); a PyYAML loader subclass with YAML 1.2 bools (fallback only if the import cost is refused). - One docs sentence: config files are read as YAML 1.2, so a bare
on,off,yesornois a string.
Pre-Submission Checklist
- No sensitive credentials, private keys or internal tokens are in this report.
- I searched the existing issues and pull requests. No duplicate exists.
Source: #4438
Proposed design
Problem statement
A bare off or on in a config file stops the settings load. The writer round_trip.edit writes YAML 1.2 with ruamel.yaml. The readers use yaml.safe_load, which reads YAML 1.1. PyYAML reads a bare off as false and a bare on as true, and the mode types refuse a bool. The same defect hits each string setting, such as search.language no and k8s.context 12:30. The fix reads each config file with ruamel.yaml YAML(typ="safe"), the library that writes it.
Acceptance criteria
Requirement: The settings reader reads YAML 1.2
The settings reader SHALL read each config file with ruamel.yaml YAML(typ="safe").
Scenario: A bare off in the intake file
- WHEN A config file holds
roadmap.intake.jev: offwith no quotes. - THEN
load_settings()givesroadmap.intake.jevequal to the stringoff.
Requirement: A bare on loads the live mode
The settings loader SHALL read a bare on as the mode value on.
Scenario: A bare on in the intake file
- WHEN A config file holds
roadmap.intake.jev: onwith no quotes. - THEN
load_settings()givesroadmap.intake.jevequal to the stringon.
Requirement: A bare mode in the decisions map
The settings loader SHALL read a bare mode of roadmap.decisions as a string.
Scenario: A bare off for a decision point
- WHEN A config file holds
roadmap.decisionswithstage.verify_screen: off. - THEN
load_settings()gives the modeoffforstage.verify_screenand raises no error.
Requirement: A written mode reloads
A mode that devops config set writes MUST load as the same mode.
Scenario: config set writes a bare off
- WHEN
devops config set roadmap.intake.jev offruns on a config file that holdsjev: shadow. - THEN The command exits 0, and
load_settings()givesjevequal tooff.
Requirement: A boolean-like string stays a string
The settings loader SHALL read a bare no as the string no.
Scenario: config set writes search.language no
- WHEN
devops config set search.language nowrites the config file. - THEN The command exits 0, and
load_settings()givessearch.languageequal tono.
Requirement: A time-like string stays a string
The settings loader SHALL read a bare 12:30 as the string 12:30.
Scenario: config set writes k8s.context 12:30
- WHEN
devops config set k8s.context 12:30writes the config file. - THEN The command exits 0, and
load_settings()givesk8s.contextequal to12:30.
Requirement: The ConfigMap render reads YAML 1.2
The ConfigMap render SHALL read the config file with the YAML 1.2 reader.
Scenario: A bare off in the rendered ConfigMap
- WHEN The config file that the render reads holds
roadmap.intake.jev: off. - THEN The rendered ConfigMap holds the string
offforroadmap.intake.jev.
Requirement: The write-history reader reads YAML 1.2
The write-history and audit readers SHALL read the config file with the YAML 1.2 reader.
Scenario: A write of a file that holds a bare no
- WHEN A config file holds
search.language: no, anddevops config set roadmap.intake.jev offwrites it. - THEN The command exits 0, and the audit record holds one entry for the write.
Requirement: A bool is still refused
The settings MUST refuse a bool for roadmap.intake.jev.
Scenario: A YAML bool in the intake file
- WHEN A config file holds
roadmap.intake.jev: true. - THEN
load_settings()raisesValidationErrorthat names the fieldjev.
Requirement: A load error quotes no file text
A load error SHALL name the file and quote no text of it.
Scenario: A file that is not valid YAML
- WHEN A config file holds
roadmap: [unclosed. - THEN
load_settings()raisesConfigurationErrorthat names the file and holds none of its text.
Requirement: The intake page names the YAML version
docs/roadmap/intake.md SHALL state that a config file is read as YAML 1.2.
Scenario: A reader opens the intake page
- WHEN A reader opens
docs/roadmap/intake.md. - THEN The page states that a bare
off,on,yesornoin a config file is a string.
Existing Tool Considered
No alternatives check has run. ruamel-yaml==0.19.1 is an open, maintained library, and pyproject.toml already pins it. Its YAML(typ="safe") reads YAML 1.2, the version that round_trip.edit writes, so a bare off loads as the string off. It lacks a PyYAML-shaped API and a cheap import: its import adds about 29 modules and 16 to 25 ms to each command that loads settings, so the readers import it inside the reader functions. The change builds no code that the project keeps.
Key questions
- Which layer corrects a bare
offoronin a config file?: The reader. Each reader uses ruamel.yamlYAML(typ="safe"), the YAML 1.2 library that writes the file. The writer and the mode types stay as they are. (best practice) [sources: pyproject.toml, src/devops_cli/config/settings.py, src/devops_cli/config/round_trip.py, docs/roadmap/intake.md]- Chosen: Read every config file with ruamel.yaml
YAML(typ="safe"). The reader then reads the version that the writer writes, so each string setting survives the round trip. On 5 real config inputs, 0 of 311 values change. - Rejected: Add a
BeforeValidatorto the two mode types. It fixes 2 of about 100 exposed settings. It also makestrueandyesload as the live modeon, against feat(roadmap): a shadow mode for the Jev intake labels #4438 and ADR 0019. - Rejected: Quote the values in
round_trip.edit. Quotes cover only the files that the writer produces. A typed file and a ConfigMap stay exposed. - Rejected: Add a PyYAML resolver subclass with YAML 1.2 booleans. This is the fallback only. It patches PyYAML and keeps two YAML versions in one process, if the owner refuses the import cost.
- Chosen: Read every config file with ruamel.yaml
- Which readers change?: Five readers:
_read_config_fileinsettings.py, the two readers ofwrite_history.py, the audit reader ofcommands/config.py, and the ConfigMap render ofk8s/configmap.py. Each one imports ruamel.yaml inside the function. [sources: src/devops_cli/config/settings.py, src/devops_cli/config/write_history.py, src/devops_cli/commands/config.py, src/devops_cli/k8s/configmap.py] - Does the import of ruamel.yaml cost too much?: No. The readers import ruamel.yaml inside the reader function, so only a command that reads a config file pays. The cost is about 29 modules and 16 to 25 ms for each such command, and
uv run devops ci --only startup-importsmeasures it. (best practice) [sources: pyproject.toml, src/devops_cli/config/settings.py]- Chosen: Import ruamel.yaml inside each reader function. Only a command that reads a config file pays the import. A command that loads no settings pays nothing.
- Rejected: Import ruamel.yaml at module import. Every command that imports the settings module pays about 29 modules, also when it reads no config file.
- Rejected: Keep PyYAML and add a resolver subclass with YAML 1.2 booleans. This is the fallback if the owner refuses the import cost. It keeps PyYAML's YAML 1.1 reading of each other value.
- Which values change when the readers move to YAML 1.2?: Few. On 5 real config inputs, 0 of 311 values change. A typed
0755loads 755, a typed1:30loads the string1:30, so a float setting refuses it, and a duplicate key raises an error. (best practice) [sources: pyproject.toml, src/devops_cli/config/settings.py, k8s/devops/configmap.example.yaml]- Chosen: Read YAML 1.2 and record the changed values in the plan. The real config files change in no value. The three edge cases are recorded, and each one is a value that YAML 1.1 read wrongly.
- Rejected: Keep YAML 1.1 and normalize each type that a value breaks. About 100 string settings are exposed. Each new type adds one more rule, and the writer keeps a different version.
- Does the change keep the refusal of a bool?: Yes.
JevMode,DecisionModeand the guard of feat(roadmap): a shadow mode for the Jev intake labels #4438 stay as they are. A YAML 1.2trueis a bool, so it still fails validation, and the scenario "The old bool is refused" stays true with no MODIFIED delta. (best practice) [sources: src/devops_cli/config/defaults.py:948, src/devops_cli/config/defaults.py:951, openspec/changes/archive/2026-11-10-4395-a-shadow-mode-for-the-jev/proposal.md]- Chosen: Keep the mode types and refuse a bool. feat(roadmap): a shadow mode for the Jev intake labels #4438 removed the bool with no shim, and ADR 0019 puts shadow first. The YAML 1.2 reader makes the shim unnecessary.
- Rejected: Accept a bool and map it to
on. It makesjev: truestart the live mode. That contradicts feat(roadmap): a shadow mode for the Jev intake labels #4438 and ADR 0019.
- Does
load_yamlcatch the ruamel.yaml error and keep the no-text rule?: Yes.load_yamlcatchesruamel.yaml.error.YAMLErrorin place ofyaml.YAMLError, and it keeps the rule that a load error quotes no text of the file. (best practice) [sources: src/devops_cli/config/yaml_errors.py, src/devops_cli/config/settings.py]- Chosen: Catch
ruamel.yaml.error.YAMLErrorinload_yaml. The helper keeps one error path for every reader, and the error names the file, its line and its column with no text of the file. - Rejected: Let the ruamel.yaml error escape. It breaks the rule of fix(config): a config file that does not parse never prints its line from any command that loads settings #1468: a load error quotes no text of the file, and an unknown error type escapes each caller.
- Chosen: Catch
- Is a new dependency needed?: No.
ruamel-yaml==0.19.1is already a dependency, pinned inpyproject.toml, andround_trip.editwrites with it. [sources: pyproject.toml, src/devops_cli/config/round_trip.py] - Where does the docs sentence go?: In
docs/roadmap/intake.md, beside the modes ofroadmap.intake.jev: a config file is read as YAML 1.2, so a bareoff,on,yesornois a string. (best practice) [sources: docs/roadmap/intake.md, k8s/devops/configmap.example.yaml]- Chosen: State the rule on the intake page. The page documents the three modes of
roadmap.intake.jev, and it is the page that a person reads before aconfig set. - Rejected: Add a comment to
config.example.yamlonly. A comment in an example file is no documentation of the reader, and the intake page is the page that names the modes.
- Chosen: State the rule on the intake page. The page documents the three modes of
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-11: in-use.
The item already names this tool.
Tool: ruamel.yaml (https://pypi.org/project/ruamel.yaml), MIT, last activity 2026-01-02, maintained.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(config)scope of the title gives the scope.A valid config value written by the project's own command crashes every settings load.Any user who types jev: off or runs devops config set gets a hard failure on all commands.The fix is one BeforeValidator shared by two mode types, plus a test and a docs line.Both deal with a PyYAML and ruamel.yaml mismatch in config loading, but #2451 fixes unparseable YAML constructs while this candidate fixes a value-type mismatch for bare off/on.devops-cli-service commentedon Nov 11, 2026
Status set to Ready at 2f6114f (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Staged: branch
fix/4481-a-bare-off-or-on-in, draft pull request #4599. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these open findings. The stage keeps this pull request a draft with the label
plan/needs-fixuntil a later round clears them:spec_delta_wrongat specs: The plan adds a requirement that makes a YAMLtrueload as the modeon, but it leaves the existingroadmap-intake-jevrequirement untouched, and that requirement still holds a scenario saying the booltruefails to validate. No test can assert that scenario after this change, and the plan replaces the only test that asserted it while its delta lists"modified": []. Evidence: "#### Scenario: The old bool is refused - WHEN the setting is the booltrue- THEN the settings fail to validate"The runs of the planner and the review made 38 model request(s), and used 2274156 input tokens and 18771 output tokens. The tool calls, in order:
read_file({"path":"src/devops_cli/config/defaults.py","start_line":920,"end_line":960})search_code({"text":"BeforeValidator"})search_code({"text":"pydantic"})read_file({"path":"src/devops_cli/config/settings.py","start_line":1318,"end_line":1372})search_code({"text":"from pydantic"})list_files({"directory":"tests/commands"})search_code({"text":"test_the_setting_is_off_by_default_and_refuses_the_old_bool"})search_code({"text":"from typing import"})read_file({"path":"tests/roadmap/intake/test_roadmap_intake_jev_shadow.py","start_line":295,"end_line":330})read_file({"path":"src/devops_cli/config/defaults.py","start_line":1,"end_line":30})read_spec({})read_file({"path":"tests/commands/test_cli_startup_imports.py","start_line":1,"end_line":60})read_spec({"capability":"config-commands"})read_spec({"capability":"roadmap-intake-jev"})read_spec({"capability":"roadmap-intake-jev","requirement":"Jev decides the proposal fields"})read_spec({"capability":"config-commands","requirement":"Settings values validate against field types at load and on set"})read_spec({"capability":"decision-steps"})search_code({"text":"\"docs\""})search_code({"text":"name=\"test\","})read_file({"path":"src/devops_cli/commands/ci.py","start_line":760,"end_line":830})read_file({"end_line":760,"path":"src/devops_cli/commands/ci.py","start_line":700})search_code({"text":"ci test"})search_code({"text":"old bool"})search_code({"text":"DecisionMode"})read_file({"path":"openspec/specs/roadmap-intake-jev/spec.md","start_line":1,"end_line":40})search_code({"text":"JevMode"})search_code({"text":"roadmap.decisions"})search_code({"text":"RoadmapIntakeConfig("})search_code({"text":"isolate_devops_cli_config"})search_code({"text":"ENV_VARS.md"})search_code({"text":"intake.jev"})search_code({"text":"safe_load(path.read_text"})file_symbols({"path":"src/devops_cli/config/round_trip.py"})search_code({"text":"YAML 1.1"})read_file({"path":"src/devops_cli/config/settings.py","start_line":1655,"end_line":1685})search_code({"text":"get_args"})search_code({"text":"Literal"})read_file({"path":"src/devops_cli/config/setting_keys.py","start_line":1,"end_line":110})read_file({"path":"src/devops_cli/config/settings.py","start_line":190,"end_line":240})search_code({"text":"jev"})search_code({"text":"jev: true"})search_code({"text":"\"jev\": True"})search_code({"text":"roadmap.decisions"})search_code({"text":"verify_screen"})search_code({"text":"'jev' |"})search_code({"text":"roadmap.intake.jev"})list_files({"directory":"tests/config"})search_code({"text":"decisions"})read_file({"path":"tests/config/test_decision_point_settings.py","start_line":1,"end_line":80})read_file({"path":"src/devops_cli/__init__.py"})search_code({"text":"from devops_cli.config.defaults import"})read_file({"path":"src/devops_cli/main.py","start_line":1,"end_line":80})read_file({"path":"src/devops_cli/config/metadata.py","start_line":1,"end_line":50})search_code({"text":"literal_error"})search_code({"text":"refuses_the_old_bool"})read_file({"path":"tests/docs/test_docs.py","start_line":780,"end_line":845})search_code({"text":"def generate_configuration_docs"})read_file({"end_line":940,"path":"src/devops_cli/docs/generator.py","start_line":840})search_code({"text":"def _format_settings_field_row"})read_file({"path":"src/devops_cli/docs/generator.py","start_line":760,"end_line":840})Tool calls: file_symbols=1 (empty=0), list_files=2 (empty=0), read_file=18 (empty=0), read_spec=6 (empty=0), search_code=33 (empty=3)
devops-cli-service commentedon Nov 11, 2026
Plan pull request #4599 closed with no merge. The job waits for an edit of the text of this item, or for a commit that changes a file that the reason names.
The reason, from the last comment of dan-petty on the pull request:
5 remaining items
devops-cli-service commentedon Nov 11, 2026
Alternatives check: in-use
Reason: The web searches returned only unrelated pages, but the PyPI facts and the issue's own evidence show that ruamel.yaml (already pinned and used by
round_trip.edit) provides a YAML 1.2 safe reader,YAML(typ="safe"), which reads a bareoff,on,yes,noor12:30as a string and so fixes the whole class of reader/writer version mismatches the issue describes, not only the two mode fields.The item already names this tool.
Tool: ruamel.yaml (https://pypi.org/project/ruamel.yaml)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-11. A person decides what this means for the item. The check changes no label and closes no issue.
docs(openspec): plan the YAML 1.2 read of each config file
test(config): a config file is read as YAML 1.2
fix(config): read each config file as YAML 1.2
docs(config): state that a config file is read as YAML 1.2
docs(openspec): plan the YAML 1.2 read of each config file
test(config): a config file is read as YAML 1.2
fix(config): read each config file as YAML 1.2
docs(config): state that a config file is read as YAML 1.2
devops-cli-service commentedon Nov 12, 2026
Released in v0.115.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.115.0
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 04:08 UTC