Repository navigation
Description
Problem
devops tf notify-plan says that it posts a plan comment to a pull request. It posts nothing.
Evidence
- The docstring of
tf_notify_planinsrc/devops_cli/commands/tf.pysays "Format and post structured, collapsible OpenTofu/Terraform plan diffs to PR comments." - The help of
--prsays "Pull Request number to post plan comment to." - The command sends no request. It puts
pr_numberin the JSON payload and prints the comment. - The command counts a plan by a fixed text match (
"2 to add" in raw_text), and it uses a fixed plan text when the plan file is missing. - The MCP tool
tf_notify_plancopies these words, so a reader of its schema, such as the review of fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235, believes that the tool writes to GitHub.
Expected
The words of the command say what it does, or the command does what its words say.
Acceptance criteria
- The docstring, the help of
--pranddocs/MCP_TOOLS.mdmatch what the command does. - A test fails when the help says "post" and the command makes no request.
Existing tool considered
None. The change edits the text of one command.
Related
Related: #3235.
Source: #3235
Proposed design
Problem statement
The devops tf notify-plan command says that it posts a plan comment to a pull request. It prints the comment and sends no request. The MCP tool and the catalog repeat the claim. The change makes the docstring, the --pr help and docs/MCP_TOOLS.md say what the command does, and adds a guard test.
Acceptance criteria
Requirement: Docstring says the command prints only
The docstring of tf_notify_plan SHALL say that the command formats and prints the plan comment and sends no request.
Scenario: Docstring holds no write
- WHEN A test reads the docstring of
tf_notify_plan. - THEN The docstring names no write verb and says that the command prints the comment.
Requirement: --pr help says no comment is posted
The help of --pr SHALL say that the pull request number appears in the printed output and that the command posts no comment.
Scenario: Rendered help of --pr
- WHEN A test renders
devops tf notify-plan --help. - THEN The help of
--prnames no write verb and says that the command posts nothing.
Requirement: Catalog describes a printed comment
docs/MCP_TOOLS.md SHALL describe tf_notify_plan as formatting and printing the comment and MUST NOT say that it posts.
Scenario: Catalog row and section
- WHEN A test reads the
tf_notify_planrow and section ofdocs/MCP_TOOLS.md. - THEN Both describe a printed comment and hold no write verb.
Requirement: --plan-file help names the sample
The help of --plan-file SHALL say that the command prints a fixed sample plan when the file is absent.
Scenario: Help of --plan-file
- WHEN A test renders
devops tf notify-plan --help. - THEN The help of
--plan-filesays that the command prints a fixed sample plan when the file is absent.
Requirement: Guard test rejects a write word without a request
A test SHALL fail when the docstring, the help or the catalog row of tf notify-plan names a write and tf_notify_plan sends no request.
Scenario: Guard reads the word post
- WHEN The guard helper receives the text
Post the plan comment to the pull request.and a flag that says the command sends no request. - THEN The helper raises an error that names the word
postand the text that holds it.
Existing Tool Considered
No check has run. The nearest maintained tools are typer.testing.CliRunner, which renders the help text offline, and pytest, which runs the guard; neither knows what the command does, so neither covers the need. The project writes its own guard helper and one test file, about 60 lines in all. Cost: about 2,000 tokens to write, about 500 tokens for each later fix, and under one hour elapsed.
Key questions
- Does the fix change the words, or make the command post the comment?: Change the words. The design of fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235 records that the command posts nothing and that this issue fixes the help text, and the MCP tool is
readOnlyHint: true. (best practice) [sources: openspec/changes/archive/2026-11-05-3235-read-only-mcp-tools-have-no-write-option/design.md:15, docs/MCP_TOOLS.md:141, src/devops_cli/commands/tf.py]- Chosen: Change the words of the command, its help and the catalog. The recorded decision of fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235 says that the command posts nothing and that this issue fixes the help text. The tool stays read-only.
- Rejected: Make the command post the comment. It makes a read-only tool a writer, needs a GitHub client and a token, and contradicts the decision of fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235.
- Where does the
--prhelp text live?:HELP.tf.prinsrc/devops_cli/lang/en/help.pyholds the text, andtf_notify_planinsrc/devops_cli/commands/tf.pyreads it. [sources: src/devops_cli/lang/en/help.py, src/devops_cli/commands/tf.py] - Does the catalog repeat the docstring?: The row at
docs/MCP_TOOLS.md:141and the section atdocs/MCP_TOOLS.md:2272hold the docstring words, so all three change together. [sources: docs/MCP_TOOLS.md:141, docs/MCP_TOOLS.md:2272, src/devops_cli/commands/tf.py] - What does the command do when the plan file is absent or missing?: It reads the file when it exists. It prints a fixed sample plan and the fixed counts
+2 ~1 -0when the file is absent or missing. [sources: src/devops_cli/commands/tf.py, tests/commands/test_tf_dry_run.py] - Do the words name the sample plan, or does the command refuse a missing file?: Name the sample plan in the help of
--plan-fileand in the docstring, and keep the behavior. (best practice) [sources: src/devops_cli/commands/tf.py, openspec/changes/archive/2026-11-05-3235-read-only-mcp-tools-have-no-write-option/design.md:15]- Chosen: Name the sample plan in the words. The issue asks for the words to match what the command does, and this keeps the behavior that callers use.
- Rejected: Refuse a missing plan file with an error. It changes behavior that the issue does not ask for, and it can break a caller of the MCP tool.
- Rejected: Parse the counts from the plan text. It is a separate change with its own tests, and the issue does not ask for it.
- Where does the guard test live?: Add
tests/commands/test_tf_notify_plan_text.py. It checks the docstring, the rendered help and the catalog row in one offline test. (best practice) [sources: tests/commands/test_tf_dry_run.py, tests/ai/mcp/test_fastmcp_contracts.py]- Chosen: Add
tests/commands/test_tf_notify_plan_text.py. It checks the command text, the rendered help and the catalog in one place, offline. - Rejected: Extend
tests/ai/mcp/test_fastmcp_contracts.py. It checks the tool schema and does not render the CLI help, so it cannot hold the guard of the--prhelp.
- Chosen: Add
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-07: none.
Tool: none found.
Activity
dan-petty commentedon Nov 5, 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.tf, and .github/labels.yml declares no scope/tf label. Add the label to the file to give the scope to this item.It misleads users and MCP readers but does not break a working feature.It removes a false promise from help text and the MCP schema that misleads operators.The change edits the text of one command and adds one test.Both touch tf commands, but #2249 adds dry-run request plans while the candidate fixes misleading help text and adds a text-behavior test.fix(mcp): mark tools that write not read-only and test the schema (#3649
devops-cli-service commentedon Nov 6, 2026
Status set to Ready at cda72c7 (see proposed design in issue body).
devops-cli-service commentedon Nov 7, 2026
Alternatives check: none
Reason: The web searches returned no results (no search provider answered), and the only facts I could read are the CLI/test frameworks pytest and typer, which render help text and run assertions but know nothing about whether a command actually sends a request. The need is to make one repository's docstring,
--pr/--plan-filehelp anddocs/MCP_TOOLS.mdrow say that the command prints and posts nothing, plus a local guard test; no open tool or library performs that check, and the issue itself asks for a text edit with an in-tree test.Tool: none found
Lacks:
tf notify-plancommand and must be written in-treeTools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
[-]fix(tf): tf notify-plan says it posts a comment and posts nothing[/-][+]fix(terraform): tf notify-plan says it posts a comment and posts nothing[/+]devops-cli-service commentedon Nov 12, 2026
Released in v0.117.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.117.2
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 08:07 UTC