From 4aef948b50acd467ea0a33d367a0267908bb52fb Mon Sep 17 00:00:00 2001 From: "devops-cli-service[bot]" <349441588+devops-cli-service[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:20:56 +0000 Subject: [PATCH 1/3] feat(roadmap): Refuse a plan whose own rule would refuse it (#3404) --- .../tasks.md | 4 +- src/devops_cli/lang/en/messages.py | 7 +++ src/devops_cli/roadmap/stage_change.py | 36 +++++++++++++-- tests/roadmap/test_roadmap_stage_content.py | 45 ++++++++++++++++++- 4 files changed, 85 insertions(+), 7 deletions(-) diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md b/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md index ee093bd405..fc8158e6a8 100644 --- a/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md +++ b/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md @@ -4,9 +4,9 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_content.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_content.py`. -- [ ] 1.1 In `tests/roadmap/test_roadmap_stage_content.py`, write a test that builds a proposal with `make_stage_proposal` whose behavior group changes `src/devops_cli/roadmap/stage_change.py`, asserts that `content_problems` names `StageProposal` and `content_problems` for a test text with no such names, and asserts that `content_problems` returns no problem for a test text that builds the plan's own `StageProposal` and asserts no problem for `content_problems` +- [x] 1.1 In `tests/roadmap/test_roadmap_stage_content.py`, write a test that builds a proposal with `make_stage_proposal` whose behavior group changes `src/devops_cli/roadmap/stage_change.py`, asserts that `content_problems` names `StageProposal` and `content_problems` for a test text with no such names, and asserts that `content_problems` returns no problem for a test text that builds the plan's own `StageProposal` and asserts no problem for `content_problems` - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base -- [ ] 1.2 Add the message text to `src/devops_cli/lang/en/messages.py` beside the other text problems of the roadmap stage messages, and add the rule to `content_problems` in `src/devops_cli/roadmap/stage_change.py`: when a behavior group changes `src/devops_cli/roadmap/stage_change.py` and no group test text holds `StageProposal`, `content_problems` and no problem, return one problem that names the symbols and the test that the plan must give +- [x] 1.2 Add the message text to `src/devops_cli/lang/en/messages.py` beside the other text problems of the roadmap stage messages, and add the rule to `content_problems` in `src/devops_cli/roadmap/stage_change.py`: when a behavior group changes `src/devops_cli/roadmap/stage_change.py` and no group test text holds `StageProposal`, `content_problems` and no problem, return one problem that names the symbols and the test that the plan must give - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes ## 2. State the self-acceptance rule in the staging prompt diff --git a/src/devops_cli/lang/en/messages.py b/src/devops_cli/lang/en/messages.py index 645ba6aa7c..1527984e3b 100644 --- a/src/devops_cli/lang/en/messages.py +++ b/src/devops_cli/lang/en/messages.py @@ -3310,6 +3310,13 @@ class RoadmapMessages: "A task text names `MESSAGES.roadmap`, and no group lists `{path}` in `changes`. Add the " "message to that file, and list the file in the group that adds it." ) + # A plan that adds a rule of the plan check gives the test that accepts its own plan (#3404). + stage_problem_self_acceptance: str = ( + "A behavior group changes `{path}`, and no group test builds the plan's own " + "`StageProposal` and asserts that `content_problems` returns no problem. Add a group test " + "that builds the plan's own `StageProposal` and asserts that `content_problems` returns " + "no problem for it, because the rule that the plan adds judges the plan itself." + ) stage_problem_what_changes_path: str = ( "A What Changes item names `{path}`, and no group lists it in `changes` or `creates`. List " "the path in the group that changes or creates it, or remove it from What Changes." diff --git a/src/devops_cli/roadmap/stage_change.py b/src/devops_cli/roadmap/stage_change.py index 4979e7b2e1..2c302114e5 100644 --- a/src/devops_cli/roadmap/stage_change.py +++ b/src/devops_cli/roadmap/stage_change.py @@ -118,6 +118,15 @@ # in `changes`, so the stage check names it when no group lists it (#3405). _MESSAGES_FILE: Final[str] = "src/devops_cli/lang/en/messages.py" _MESSAGE_NAME: Final[re.Pattern[str]] = re.compile(r"\bMESSAGES\.roadmap\b") +# The plan check itself. A plan that adds a rule of it writes the text that the new rule judges, +# so the plan gives a group test that builds its own `StageProposal` and asserts that +# `content_problems` returns no problem for it (#3404). +_PLAN_CHECK_FILE: Final[str] = "src/devops_cli/roadmap/stage_change.py" +_SELF_ACCEPTANCE_MARKS: Final[tuple[str, ...]] = ( + "StageProposal", + "content_problems", + "no problem", +) _SENTENCE_END: Final[str] = f"{string.whitespace}." REGENERATE_DOCUMENTS: Final[str] = "uv run devops docs generate --sync-readme" @@ -550,6 +559,25 @@ def _message_file_problems(proposal: StageProposal) -> list[str]: return [MESSAGES.roadmap.stage_problem_message_file.format(path=_MESSAGES_FILE)] +def _adds_plan_rule(group: StageGroup) -> bool: + """Whether `group` adds or changes a rule of the plan check, which judges the plan that + proposes it (#3404). An `other` group refactors or documents a rule, so it adds none.""" + return group.kind is GroupKind.BEHAVIOR and _PLAN_CHECK_FILE in group.changes + + +def _self_acceptance_problems(proposal: StageProposal) -> list[str]: + """One problem for a plan that adds a rule of the plan check and gives no group test that + builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem + (#3404). The rule that the plan adds does not exist when the stage job reads the plan, so no + check can run it on the plan: the plan gives the test itself, and the implement step runs it.""" + if not any(_adds_plan_rule(group) for group in proposal.groups): + return [] + tests = [group.test for group in proposal.groups if group.test is not None] + if any(all(mark in test for mark in _SELF_ACCEPTANCE_MARKS) for test in tests): + return [] + return [MESSAGES.roadmap.stage_problem_self_acceptance.format(path=_PLAN_CHECK_FILE)] + + def _lists_path(listed: Collection[str], path: str) -> bool: """Whether `listed` holds `path`, a path under it or a folder above it: a group that writes a folder covers every file under it, and a What Changes item may name the folder of the files @@ -578,12 +606,14 @@ def content_problems(proposal: StageProposal, probes: Sequence[str] = ()) -> lis """What is wrong with the text of `proposal` that no schema says (#3200): a text that is too short or a placeholder word (`is_placeholder` of the pull request form), a `feasibility` that quotes no line of `probes` when there are some, a task text that names a `MESSAGES.roadmap` - entry while no group changes the message file (#3405), and a plan that builds its own code and - gives no cost of tokens and time in `existing_tool`. The replay (`stage_eval_gates`) and the - job both call this through `check_proposal`, so one rule set judges both.""" + entry while no group changes the message file (#3405), a plan that builds its own code and + gives no cost of tokens and time in `existing_tool`, and a plan that adds a rule of the plan + check and gives no test that accepts its own plan (#3404). The replay (`stage_eval_gates`) and + the job both call this through `check_proposal`, so one rule set judges both.""" texts = MESSAGES.roadmap problems = [p for field, text in _plan_texts(proposal) for p in _text_problems(field, text)] problems.extend(_message_file_problems(proposal)) + problems.extend(_self_acceptance_problems(proposal)) lines = [_squash(line) for line in probes if line.strip()] if lines: feasibility = _squash(" ".join(proposal.feasibility)) diff --git a/tests/roadmap/test_roadmap_stage_content.py b/tests/roadmap/test_roadmap_stage_content.py index 227413f1a9..d688b69e82 100644 --- a/tests/roadmap/test_roadmap_stage_content.py +++ b/tests/roadmap/test_roadmap_stage_content.py @@ -1,6 +1,7 @@ """`devops roadmap stage`: a plan holds no placeholder text, quotes its probe, gives the cost of -its own code, keeps its summary whole (#3200) and names no What Changes path that no group lists -(#3411).""" +its own code, keeps its summary whole (#3200), names no What Changes path that no group lists +(#3411) and gives the test that accepts its own plan when it adds a rule of the plan check +(#3404).""" from __future__ import annotations @@ -24,6 +25,11 @@ PROBE = "def f(): pass" TREE = StagedTree(["src/devops_cli/sample.py", "tests/test_sample.py"]) MESSAGES_FILE = "src/devops_cli/lang/en/messages.py" +PLAN_CHECK_FILE = "src/devops_cli/roadmap/stage_change.py" +SELF_ACCEPTANCE_TEST = ( + "Write a test that builds the plan's own `StageProposal` and asserts that `content_problems` " + "returns no problem for it" +) LIVING_SPEC = "openspec/specs/roadmap-stage/spec.md" LIVING_SPEC_TREE = TREE.with_files([LIVING_SPEC]) @@ -32,6 +38,14 @@ def _check(proposal: StageProposal, **keywords: Any) -> list[str]: return check_proposal(proposal, ["comment-thread"], TREE, **keywords) +def _plan_that_adds_a_rule(test: str) -> StageProposal: + sample = make_stage_proposal() + group = sample.groups[0].model_copy( + update={"changes": [*sample.groups[0].changes, PLAN_CHECK_FILE], "test": test} + ) + return make_stage_proposal(groups=[group]) + + def test_the_sample_plan_has_no_content_problem() -> None: assert content_problems(make_stage_proposal()) == [] assert _check(make_stage_proposal()) == [] @@ -235,3 +249,30 @@ def test_a_what_changes_folder_that_a_group_writes_under_is_accepted() -> None: problems = _check(plan) assert not any("src/devops_cli/sample/" in p for p in problems) + + +def test_a_rule_of_the_plan_check_needs_its_self_acceptance_test() -> None: + plan = _plan_that_adds_a_rule( + "Write `test_the_rule_refuses_the_plan` in `tests/roadmap/test_roadmap_stage_content.py`" + ) + + problems = content_problems(plan) + + assert any("StageProposal" in p and "content_problems" in p for p in problems) + + +def test_a_rule_of_the_plan_check_with_its_self_acceptance_test_is_accepted() -> None: + assert content_problems(_plan_that_adds_a_rule(SELF_ACCEPTANCE_TEST)) == [] + + +def test_a_plan_check_change_of_another_kind_needs_no_self_acceptance_test() -> None: + sample = make_stage_proposal() + group = sample.groups[0].model_copy( + update={ + "kind": "other", + "changes": [*sample.groups[0].changes, PLAN_CHECK_FILE], + "test": None, + } + ) + + assert content_problems(make_stage_proposal(groups=[group])) == [] From 25995e2480004230f3ffbdefc2cc986f42ff0936 Mon Sep 17 00:00:00 2001 From: "devops-cli-service[bot]" <349441588+devops-cli-service[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:34:43 +0000 Subject: [PATCH 2/3] feat(roadmap): State the self-acceptance rule in the staging prompt (#3404) --- .../3404-the-plan-check-requires-a-new/tasks.md | 4 ++-- src/devops_cli/ai/tasks/roadmap_stage_change.md | 1 + tests/roadmap/test_roadmap_stage_prompt_rules.py | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md b/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md index fc8158e6a8..add64310d8 100644 --- a/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md +++ b/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md @@ -13,9 +13,9 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/message Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`, `src/devops_cli/ai/task_loader.py`. Changes: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. -- [ ] 2.1 In `tests/roadmap/test_roadmap_stage_prompt_rules.py`, write a test that loads the prompt with `load_task_prompt` and asserts that it holds `StageProposal`, `content_problems` and the self-acceptance test rule +- [x] 2.1 In `tests/roadmap/test_roadmap_stage_prompt_rules.py`, write a test that loads the prompt with `load_task_prompt` and asserts that it holds `StageProposal`, `content_problems` and the self-acceptance test rule - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base -- [ ] 2.2 Add the self-acceptance test rule to `src/devops_cli/ai/tasks/roadmap_stage_change.md` beside the other checks of a plan: a behavior group that changes `src/devops_cli/roadmap/stage_change.py` needs a group test that builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it +- [x] 2.2 Add the self-acceptance test rule to `src/devops_cli/ai/tasks/roadmap_stage_change.md` beside the other checks of a plan: a behavior group that changes `src/devops_cli/roadmap/stage_change.py` needs a group test that builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes ## Workflow follow-up diff --git a/src/devops_cli/ai/tasks/roadmap_stage_change.md b/src/devops_cli/ai/tasks/roadmap_stage_change.md index 07c2f1e429..571d1ecc47 100644 --- a/src/devops_cli/ai/tasks/roadmap_stage_change.md +++ b/src/devops_cli/ai/tasks/roadmap_stage_change.md @@ -16,6 +16,7 @@ The rules of the project: - Write `groups` in the order of the work. Each group holds the work of one step of an implementation, and fits in the `budget` with its files: a step reads the instructions of the group, the `AGENTS.md` of the repository and the sections of the documents that it routes the group to, the issue, the change and the files of the group. Keep each group small. A group has these keys: `title`; `kind`, `behavior` or `other`; `reads`, the repository paths that the step reads, an empty list when it reads none; `changes`, the repository paths that the step changes or creates, with at least one path, because every group changes a file; `creates`, the paths of `changes` that do not exist yet, an empty list when it creates none; `creates_lines`, an object that gives the estimated number of lines of each path in `creates`, such as `{"tests/roadmap/test_sample.py": 40}`; `test`, the failing test to write first, and `null` for an `other` group; `implementation`, the work of the step; `documentation`, one text that starts with an imperative verb, such as `Edit`, and names each document in a code span, or `null` when the step changes no document; `verify`, one command that checks the group and gives the same answer on each run, such as `uv run devops ci test tests/roadmap/test_feature.py`, or `null`; and `process`, the steps of a manual check, or `null`. Every task has a text: `title` and `implementation` are never blank, and no other key that you give is blank. - The stage counts 32 tokens for each estimated line of a path in `creates_lines`, so the estimate of a new file counts toward the `budget` of the step. Give a whole number of lines of at least 1 for each path in `creates`. A path in `creates` with no estimate is refused. - Choose the `kind` of each group by what the group does. A `behavior` group adds or changes what the code does. It changes a path under `src/`, it has a `test`, its `verify` runs that test, and it has no `process`. It is written test first. Write tests only for new behavior. Every other group is `other`: a document, a manifest, a workflow, a deletion or a refactor that keeps behavior, an edit of tests only, or data. An `other` group has no `test`, so set `test` to `null`. It has exactly one of `verify` and `process`. `verify` is one command that can run again, such as `uv run devops ci docs`, `uv run devops openspec check`, `! git grep -n src/ tests/` (a command that exits 0 when it finds nothing), or `uv run devops k8s image-pins`. A `verify` command starts with `uv run devops`, and the `! git grep` form is the one other form. The `! git grep` form is not a shell command: it takes the options `-n -I -F -i -w -l -c -q`, then one literal of letters, digits, spaces and the signs `_ . : / = @ + , # % ~ -`, then relative paths, and a pipe, `;`, `&&`, a redirect or any other option is refused. `uv run pytest` is refused. `process` is the steps of a repeatable manual check, and you write it only when no command exists. A reply that breaks these rules comes back to you with the problem. +- A plan that adds a rule of the plan check gives the test that accepts its own plan. A `behavior` group that changes `src/devops_cli/roadmap/stage_change.py` needs a group test that builds the plan's own `StageProposal` and asserts that `content_problems` returns no problem for it, because the rule that the plan adds judges the plan itself. A plan with no such group needs no such test. The check refuses a reply that gives no such test. - A group that moves a set of modules by name prefix lists every module of that prefix in `changes`, and not the entry module only. Its `verify` command covers the whole prefix: run the layout test of the plan, or search the dotted prefix with the separator (`devops_cli.roadmap.stage_`), and never one sampled module. Before you give a `! git grep` command, call `search_code` with its literal on the staged commit and quote the hit count in `feasibility`. A literal that the plan creates a module for, such as a bare package prefix or a name that no file holds, is no check: the search then proves nothing before the change or can never pass after it. - A new test module in `creates` goes in the folder under `tests/` that mirrors the package of the code it tests, such as `tests/roadmap/test_feature.py` for code in `src/devops_cli/roadmap/`, or in `tests/invariants/`. The check refuses a new test module that sits flat under `tests/` when it tests code of a package. - A path is relative to the repository root. It has no `..` and does not start with `/`. A sample file that a test writes at run time, and that no group creates, gets a bare name with no folder, such as `test_sample.py`. Put no folder before such a name: the check reads a name with a folder as a path of the repository. diff --git a/tests/roadmap/test_roadmap_stage_prompt_rules.py b/tests/roadmap/test_roadmap_stage_prompt_rules.py index b9020bd017..f43f50b9e0 100644 --- a/tests/roadmap/test_roadmap_stage_prompt_rules.py +++ b/tests/roadmap/test_roadmap_stage_prompt_rules.py @@ -258,6 +258,22 @@ def test_the_prompt_forbids_a_group_writing_a_change_folder_path() -> None: assert "refuses a `changes` or `creates` path" in _PROMPT +# ── The self-acceptance test of a plan rule (#3404) ────────────────────────── + + +def test_the_prompt_states_the_self_acceptance_rule_of_a_plan() -> None: + """A plan that adds a rule of the plan check gives the test that accepts its own plan (#3404). + The rule does not exist when the stage job reads the plan, so the plan gives the test itself, + and the implement step runs it.""" + prompt = load_task_prompt(_CHANGE_PROMPT) + + assert "`StageProposal`" in prompt + assert "`content_problems`" in prompt + assert "A `behavior` group that changes `src/devops_cli/roadmap/stage_change.py`" in prompt + assert "builds the plan's own `StageProposal`" in prompt + assert "asserts that `content_problems` returns no problem" in prompt + + # ── The spec delta ──────────────────────────────────────────────────────────── From f2024937b231e5894828e18808b1e8f00f0abf7a Mon Sep 17 00:00:00 2001 From: "devops-cli-service[bot]" <349441588+devops-cli-service[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:35:00 +0000 Subject: [PATCH 3/3] docs(openspec): archive the change (#3404) --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/roadmap-stage/spec.md | 0 .../tasks.md | 0 openspec/specs/roadmap-stage/spec.md | 29 +++++++++++++++++++ 6 files changed, 29 insertions(+) rename openspec/changes/{3404-the-plan-check-requires-a-new => archive/2026-11-05-3404-the-plan-check-requires-a-new}/.openspec.yaml (100%) rename openspec/changes/{3404-the-plan-check-requires-a-new => archive/2026-11-05-3404-the-plan-check-requires-a-new}/design.md (100%) rename openspec/changes/{3404-the-plan-check-requires-a-new => archive/2026-11-05-3404-the-plan-check-requires-a-new}/proposal.md (100%) rename openspec/changes/{3404-the-plan-check-requires-a-new => archive/2026-11-05-3404-the-plan-check-requires-a-new}/specs/roadmap-stage/spec.md (100%) rename openspec/changes/{3404-the-plan-check-requires-a-new => archive/2026-11-05-3404-the-plan-check-requires-a-new}/tasks.md (100%) diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/.openspec.yaml b/openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/.openspec.yaml similarity index 100% rename from openspec/changes/3404-the-plan-check-requires-a-new/.openspec.yaml rename to openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/.openspec.yaml diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/design.md b/openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/design.md similarity index 100% rename from openspec/changes/3404-the-plan-check-requires-a-new/design.md rename to openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/design.md diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/proposal.md b/openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/proposal.md similarity index 100% rename from openspec/changes/3404-the-plan-check-requires-a-new/proposal.md rename to openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/proposal.md diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/specs/roadmap-stage/spec.md b/openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/specs/roadmap-stage/spec.md similarity index 100% rename from openspec/changes/3404-the-plan-check-requires-a-new/specs/roadmap-stage/spec.md rename to openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/specs/roadmap-stage/spec.md diff --git a/openspec/changes/3404-the-plan-check-requires-a-new/tasks.md b/openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/tasks.md similarity index 100% rename from openspec/changes/3404-the-plan-check-requires-a-new/tasks.md rename to openspec/changes/archive/2026-11-05-3404-the-plan-check-requires-a-new/tasks.md diff --git a/openspec/specs/roadmap-stage/spec.md b/openspec/specs/roadmap-stage/spec.md index 17f27c074c..f0cf526943 100644 --- a/openspec/specs/roadmap-stage/spec.md +++ b/openspec/specs/roadmap-stage/spec.md @@ -1992,3 +1992,32 @@ The job SHALL start the branch of a staged item at the staged commit of its roun #### Scenario: origin moves after the round read the default branch - **WHEN** `origin/main` gains a commit after the round read it, and the job stages an item - **THEN** the parent of the commit of the new branch is the staged commit of the round, and the new commit of `origin/main` is not an ancestor of the new branch + +### Requirement: A plan that adds a text rule carries its self-acceptance test +A plan with a behavior group that changes `src/devops_cli/roadmap/stage_change.py` SHALL give a group test text that names `StageProposal`, `content_problems` and no problem, so the plan holds no text that its own rule refuses. + +#### Scenario: Plan without the test is refused +- **WHEN** `check_proposal` receives a valid proposal with a behavior group that changes `src/devops_cli/roadmap/stage_change.py` and no group test text that names `StageProposal`, `content_problems` and no problem. +- **THEN** `check_proposal` returns one problem that names `StageProposal` and `content_problems`. + +#### Scenario: Plan with the test is accepted +- **WHEN** `check_proposal` receives a valid proposal with a behavior group that changes `src/devops_cli/roadmap/stage_change.py` and a group test text that names `StageProposal`, `content_problems` and no problem. +- **THEN** `check_proposal` returns no self-acceptance problem. + +### Requirement: A plan that changes no plan check needs no self-acceptance test +A plan whose groups change no path in `src/devops_cli/roadmap/stage_change.py` MUST NOT be refused by the self-acceptance rule. + +#### Scenario: Plan that changes another file is accepted +- **WHEN** `check_proposal` receives a valid proposal whose groups change only `src/devops_cli/roadmap/stage.py`. +- **THEN** `check_proposal` returns no self-acceptance problem. + +#### Scenario: Plan that only refactors the plan check is accepted +- **WHEN** `check_proposal` receives a valid proposal with an other group that changes `src/devops_cli/roadmap/stage_change.py`. +- **THEN** `check_proposal` returns no self-acceptance problem. + +### Requirement: The staging prompt states the self-acceptance test rule +The staging prompt `src/devops_cli/ai/tasks/roadmap_stage_change.md` MUST state the self-acceptance test rule beside the other checks of a plan. + +#### Scenario: Prompt names the self-acceptance test +- **WHEN** A test loads the prompt with `load_task_prompt`. +- **THEN** The prompt text contains `StageProposal`, `content_problems` and the self-acceptance test rule.