Skip to content

docs(openspec): plan #3218 dry-run config unset writes nothing - #3234

Merged
dan-petty merged 3 commits into
mainfrom
fix/3218-config-unset-with-dry-run-deletes
Nov 2, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/3218-config-unset-with-dry-run-deletes

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Plans #3218

devops --dry-run config unset <key> deleted the key and wrote a backup, which contradicts the config-commands spec. The command called remove_config_key(key, dry_run=False) and never read the removal's diff. This change passes the dry-run flag to remove_config_key, so a dry run changes no config file, writes no backup and no audit record, and prints the diff of the removal. Each credential value in that diff shows as ***REDACTED***, taken from write_history.credential_paths. The tests assert the new behavior: the file is unchanged, no backup exists, and the diff holds no credential value.

Change: openspec/changes/3218-config-unset-with-dry-run-deletes/

dan-petty commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Review of the plan for #3218.

CI: all 18 checks of head d099548 pass. uv run devops openspec check and openspec validate --strict pass on the branch. Premise: TRUE. I reproduced it on main ff9ad06 in a plain clone with a temporary HOME and a copy of the config:

$ devops --dry-run config unset ai.model     # exit 0
Removed ai.model from <tmp>/cfg/config.yaml:7.
The file before the change is in <tmp>/cfg/config.yaml.bak-20261102-170208.
$ ls cfg  ->  config.yaml  config.yaml.bak-20261102-170208      (model line gone)
$ devops config unset ai.model --dry-run     # exit 2, "No such option: --dry-run"
  1. The plan redacts in the wrong place and does not cover the cases that leak. Task 1.2 and design.md put the redaction in unset_value, "with the value of each path in write_history.credential_paths replaced". credential_paths(content: bytes | None, under: KeyPath, credentials) (src/devops_cli/config/write_history.py:120) needs the file bytes, the removed key path and _SECRET_FIELDS. unset_value has none of them, and ConfigKeyRemoval holds only path, key, line, diff, backup. I ran remove_config_key("ai.api_key", dry_run=True) on a copy where api_key is a block scalar. The returned diff holds - FAKE-LINE-ONE and - FAKE-LINE-TWO with no key on those lines, so a per-value replace of the diff text cannot hide them. remove_config_key("ai", dry_run=True) returns the whole section, credential lines included. The scenarios and task 1.1 cover a one-line value only. Open issue fix(config): devops config unset --dry-run prints the credential that it would remove #2740 (Ready) already chose the design: redact the source text with the fix(config): devops config unset leaves the plaintext secret that it removes in its .bak copy #2645 redaction, then diff, inside remove_config_key before the diff is built, and it rejected "post-process the diff lines" for these two reasons. Fix: say in design.md where the redaction runs (src/devops_cli/config/settings.py, write_history._redact) and why. Add src/devops_cli/config/settings.py to the Changes of group 1. Add a failing test in tests/config/test_config_key_removal.py (it has test_a_dry_run_returns_the_removal_and_writes_nothing at line 119) for a block scalar and for unset ai. Name CONST_CONFIG_REDACTED_VALUE (src/devops_cli/config/constants.py:48) and not the literal. Add a SECURITY.md consideration, because the change decides what reaches a terminal or CI log. [C3 missed-existing-code-callers-tests, C8 scope-or-security] (blocker)

  2. Feasibility holds no output of the premise, and one bullet is future tense. The last bullet writes "fails ... before the fix and passes after it" and "leaves the file ... unchanged". These are results the plan expects, not output it produced. The other bullets paraphrase the planner's tool calls (read_file, read_spec) and do not quote command output. Run devops --dry-run config unset <key> on a copy in a temporary HOME and quote the output and the listing, as above. [C2 false-or-unverified-premise] (major)

  3. fix(config): devops config unset --dry-run prints the credential that it would remove #2740 is not named in the plan, and the plan has no Dependencies or Related section. fix(config): devops config unset --dry-run prints the credential that it would remove #2740 ("devops config unset --dry-run prints the credential that it would remove") is open, Ready and P2. fix(config): config unset with --dry-run deletes the key #3218's own body says fix(config): devops config unset --dry-run prints the credential that it would remove #2740 is superseded. The plan PR docs(openspec): plan #2740 Redact config unset dry-run value #3158 for fix(config): devops config unset --dry-run prints the credential that it would remove #2740 closed unmerged at 16:23. The plan must name fix(config): devops config unset --dry-run prints the credential that it would remove #2740 and say it is covered here (a person closes or rewrites it). Otherwise two plans can MODIFY the same requirement, which openspec/config.yaml forbids. [C8 scope-dependency, C11 already-done-or-superseded] (major)

  4. tasks.md: task 2.2 is malformed, and group 2 edits what archive writes. Task 2.2 reads "openspec/specs/config-commands/spec.md, run uv run devops docs generate --sync-readme, and verify ..." and has no verb for the first part. Task 2.1 hand-edits openspec/specs/config-commands/spec.md, but uv run devops openspec archive applies the MODIFIED delta of this change. The docs step sits in the spec group, while the group that changes a message and a command output (group 1) has none. docs/CONFIGURATION.md:18 already says "--dry-run prints the change, with the lines of its unified diff, and writes nothing", so say whether it stays. Fix: drop the hand edit of the spec, put devops docs generate --sync-readme and uv run devops docs check into group 1, and list docs/CONFIGURATION.md as left on purpose. [C5 task-form, C10 generated-doc-step-missing] (major)

  5. The dry-run output is not specified, and an existing tool is not named. The spec asks for "the dry-run response". Before feat(config): preview requests in dry run for config commands #2963 (commit 47cdf0d) the command called render_dry_run_result(command=CONST_CONFIG_UNSET_COMMAND, action=..., target=..., details={key, line, diff}). That renderer still exists (src/devops_cli/output/console.py:820). The plan says "print the response" and gives no format. A new message needs src/devops_cli/lang/en/messages.py (the unset_* strings are at lines 320-321), and that file is not in the Changes line. HELP.config.unset_dry_run (src/devops_cli/lang/en/help.py:1805) is now unused, so delete it or use it. Name the renderer in Existing Tool Considered and list the deleted string. [C6 rule3, C9 wrong-module-or-path] (minor)

  6. design.md rationale for "global option only" uses a fact that does not support it. "As set_value does at config.py:285": set_value also has its own --dry-run option (config.py:267-269) and tests it as config set ... --dry-run (tests/commands/test_config_workspace_docs_dry_run.py:174). That file classifies unset_value as no-external-request, as it does set_value, so the classification does not decide the option. The fact that does: feat(config): preview requests in dry run for config commands #2963 removed the typer.Option("--dry-run", help=HELP.config.unset_dry_run) from unset_value on purpose (47cdf0d). Also, the current spec text says devops config unset <key> --dry-run (spec.md:157, 160), a form that exits 2. The MODIFIED text changes it to devops --dry-run config unset <key>, and What Changes does not say so. State the invocation change. [C2 false-or-unverified-premise] (minor)

  7. Title and body form. The title ends with ... ("...writes nothing and prints..."). pull_form.title_problems returns "The summary ends with ...". Use a summary of 60 characters or less, for example plan #3218 dry-run config unset writes nothing. In the body, devops --dry-run config unset lost its <key>. The body says "no history record" and the spec says "audit record". body_problems returns "The body has no line Closes #<issue>" (the known gap for plan bodies, ignored). [C1 placeholder-or-cut-text, C7 title-or-body-form] (major for the title, minor for the rest)

Sibling check: the same defect is not in the other config commands. config set honors the dry run (config.py:285) and has test_config_set_dry_run_preview. auth-headless writes to memory only. audit-stream only counts lines (src/devops_cli/core/audit.py:103-118). init is a request-plan. There is no config delete command.

Better than the earlier plans:

  • Verify commands all start with uv run devops, test-first order is right, and the tests sit in the mirror folder tests/commands/.
  • Spec delta uses MODIFIED for the right name, with the whole text and the old scenario kept, one new scenario, and 321 characters; skip_specs is correctly absent.
  • Existing Tool Considered gives tokens and time; the premise is cited with file:line that match main (config.py:313-334, test_config.py:158).

Related issues: #2740 (open, same requirement and the redaction design, see 1 and 3); #3158 (closed unmerged plan for #2740); #2963 and #2255 (merged, removed the preview).

Verdict: hold until findings 1, 2, 3, 4 and 7 are fixed.


Generated by Claude Code

Plans #3218

`devops --dry-run config unset <key>` deleted the key and wrote a backup, which contradicts the config-commands spec. The command called `remove_config_key(key, dry_run=False)` and never read the removal's diff. This change passes the dry-run flag to `remove_config_key`, so a dry run changes no config file, writes no backup and no audit record, and prints the diff of the removal. Each credential value in that diff shows as `***REDACTED***`, taken from `write_history.credential_paths`. The tests assert the new behavior: the file is unchanged, no backup exists, and the diff holds no credential value.

Change: `openspec/changes/3218-config-unset-with-dry-run-deletes/`
@dan-petty dan-petty changed the title docs(openspec): plan #3218 config unset dry run writes nothing and prints... docs(openspec): plan #3218 dry-run config unset writes nothing Nov 2, 2026
@dan-petty

Copy link
Copy Markdown
Owner

Remediated the plan for #3218 to address all 7 review findings:

  1. Redaction location and scope: Moved redaction into remove_config_key in src/devops_cli/config/settings.py using write_history._redact before building the unified diff. Redaction replaces credentials with CONST_CONFIG_REDACTED_VALUE (src/devops_cli/config/constants.py:48). This hides single keys, multi-line block scalars, and section removals (unset ai). Added src/devops_cli/config/settings.py to Group 1 changes and added tests in tests/config/test_config_key_removal.py. Added SECURITY.md Principle 1 consideration.
  2. Feasibility premise: Quoted actual command output from offline testing in a temporary directory (devops --dry-run config unset ai.model and devops config unset ai.model --dry-run). Removed all future-tense claims.
  3. fix(config): devops config unset --dry-run prints the credential that it would remove #2740 supersession: Added ## Order and Dependencies section in proposal.md stating fix(config): config unset with --dry-run deletes the key #3218 supersedes fix(config): devops config unset --dry-run prints the credential that it would remove #2740 and covers its requirements so maintainers can close fix(config): devops config unset --dry-run prints the credential that it would remove #2740.
  4. Task form and generated docs: Dropped hand edit of living spec in tasks.md. Moved uv run devops docs generate --sync-readme and uv run devops docs check into Group 1. Noted that docs/CONFIGURATION.md:18 stays unchanged on purpose.
  5. Dry-run output format: Reused render_dry_run_result(command=CONST_CONFIG_UNSET_COMMAND, action="remove_config_key", target=..., details={...}) from src/devops_cli/output/console.py:820. Documented deletion of unused HELP.config.unset_dry_run from src/devops_cli/lang/en/help.py.
  6. Design rationale and invocation: Fixed rationale to cite commit 47cdf0d (feat(config): preview requests in dry run for config commands #2963) removing the command-level option. Explicitly documented the invocation change from devops config unset <key> --dry-run to root CLI devops --dry-run config unset <key>.
  7. Title and body form: Updated PR title to docs(openspec): plan #3218 dry-run config unset writes nothing (45 chars). Restored <key> and used "audit record" in PR body.

@dan-petty
dan-petty merged commit d428c7f into main Nov 2, 2026
20 checks passed
@dan-petty
dan-petty deleted the fix/3218-config-unset-with-dry-run-deletes branch November 2, 2026 22:28
dan-petty pushed a commit that referenced this pull request Nov 14, 2026
…5651)

Plans #3246

The stage context gives the planner the names of a capability's
requirements only, and the duplicate check compares names only (#3246).
A plan then adds a requirement whose name is new while a base
requirement states, or contradicts, the behavior: #3225, #3228 and #3234
each needed a modified block that the planner did not write. This change
adds the text of the matching base requirements to the plan request, cut
to 12 requirements and 6000 characters and ordered by relevance. The
prompt tells the planner to change a requirement that states the
behavior with modified. The review request carries the same text, so a
finding that quotes a stated requirement returns the plan, and a new
golden-set case replays the conflict of #3225.

Change: `openspec/changes/3246-add-requirement-text-to-the-stage/`

Co-authored-by: devops-cli-service[bot] <349441588+devops-cli-service[bot]@users.noreply.github.com>
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