diff --git a/docs/roadmap/plan-recheck.md b/docs/roadmap/plan-recheck.md index 0fdbc2cd26..d70dadf0cf 100644 --- a/docs/roadmap/plan-recheck.md +++ b/docs/roadmap/plan-recheck.md @@ -54,8 +54,9 @@ Before it judges a plan, the command applies the rewrite to the files in memory. on the task groups that `parse_task_groups` gives, and it edits by line number. It makes three edits and no other: -- **A `Verification:` line.** A group with no such line gets one under its first task. The command - comes from the plan: `uv run devops ci test` with the test files of the `Changes:` line of the +- **A `Verification:` line.** A group with no marked command gets a line under its first task. A + marked command is a code span of the line that starts with `$ `; the step reads no other code span + as a command. The command comes from the plan: `uv run devops ci test` with the test files of the `Changes:` line of the group, or `uv run devops ci docs` when the group changes only documents. A group of the kind `behavior` gets the `fails on the base` form, and any other group gets the `passes` form. The rewrite writes no command that the implement step refuses. A group that changes no test file and @@ -74,7 +75,7 @@ edits and no other: Then the command judges the rewritten plan with the plan reader, the stage gates and `openspec validate`. A plan gets `rewrite` only when the rewritten plan passes all three. A plan that the rewrite does not fix stays `new-plan`, and its refusals come from the rewritten plan. The -counts of folders with no `Verification:` line and of folders that fail the plan reader still +counts of folders with no marked `Verification:` command and of folders that fail the plan reader still describe the merged plan as it is. ## Write the rewrite with confirm @@ -133,7 +134,7 @@ to `ProposalGate`, and the report then shows the hits of that gate under its nam A folder of a closed issue is in no count. The report prints these counts for the other folders: -- how many folders have no `Verification:` line, so the implement step requires no plan command; +- how many folders have no marked `Verification:` command, so the implement step requires no plan command; - how many folders the plan reader refuses; - the number of folders for each result. diff --git a/openspec/changes/2742-bound-the-number-of-prewarm-model/tasks.md b/openspec/changes/2742-bound-the-number-of-prewarm-model/tasks.md index eed5703a56..09517c40b7 100644 --- a/openspec/changes/2742-bound-the-number-of-prewarm-model/tasks.md +++ b/openspec/changes/2742-bound-the-number-of-prewarm-model/tasks.md @@ -5,16 +5,16 @@ Kind: behavior. Reads: `src/devops_cli/commands/ai.py`, `src/devops_cli/ai/endpoints.py`, `src/devops_cli/ai/client/ollama.py`, `src/devops_cli/ai/client/unified.py`, `tests/support/fakes/otlp.py`. Changes: `src/devops_cli/telemetry/instruments.py`, `src/devops_cli/config/constants.py`, `src/devops_cli/ai/client/unified.py`, `src/devops_cli/ai/client/ollama.py`, `src/devops_cli/commands/ai.py`, `tests/support/fakes/model.py`, `tests/ai/mcp/test_ai_prewarm.py`, `tests/ai/client/test_ai_client_providers_and_embeddings.py`. - [ ] 1.1 Write failing tests, and change the 11 test cases that hold the old label and traffic. In `tests/support/fakes/model.py`, give `ModelFake.list_models` the argument `urls` and a list `list_models_calls`. In `tests/ai/mcp/test_ai_prewarm.py`, drive `devops ai prewarm` through `cli`, `model_fake` and `otlp`, and read the counter points and the `ai.prewarm` spans for the scenarios of the two requirements: a model that no server reports gives `other` in both records, `ai.model` and a reported model pass, a reported model with symbols or of 300 characters gets the inner bound, a failing `list_models` (`AIClientError`) gives `other` and the prewarm still runs, `--url` asks only the named server, and `ai.provider` `openai` asks no server. In `tests/ai/client/test_ai_client_providers_and_embeddings.py`, add a test that `list_models(urls=[...])` of the Ollama client sends its request to the named URL only. Give the 5 cases of the label test and the 2 cases of the counter test `model_fake.set_available_models`. Make the 3 traffic tests of `TestPrewarmToolTakesNoUrlFromTheModel` (4 failing cases) count the `POST /api/generate` requests and dials of the prewarm (script one more answer for each `GET /api/tags`) - - Verification: `uv run devops ci test tests/ai/mcp/test_ai_prewarm.py tests/ai/client/test_ai_client_providers_and_embeddings.py` fails on the base + - Verification: `$ uv run devops ci test tests/ai/mcp/test_ai_prewarm.py tests/ai/client/test_ai_client_providers_and_embeddings.py` fails on the base - [ ] 1.2 Add `CONST_METRIC_LABEL_OTHER` and `bounded_model_label` and change the description of `AI_PREWARMS_TOTAL`. Give `list_models` and `_ollama_models` the optional `urls`. In `prewarm`, for the provider `ollama`, call `client.list_models(urls=[server])` for each server of the run, catch `AIClientError` and `ConfigurationError`, set the span attribute `ai.model` and give the counter the same label - - Verification: `uv run devops ci test tests/ai/mcp/test_ai_prewarm.py tests/ai/client/test_ai_client_providers_and_embeddings.py tests/commands/test_ai_cmd.py` + - Verification: `$ uv run devops ci test tests/ai/mcp/test_ai_prewarm.py tests/ai/client/test_ai_client_providers_and_embeddings.py tests/commands/test_ai_cmd.py` ## 2. Documents Kind: other. Reads: `src/devops_cli/telemetry/instruments.py`. Changes: `docs/TELEMETRY.md`. - [ ] 2.1 Run `uv run devops docs generate --sync-readme`. Only `docs/TELEMETRY.md` changes - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Workflow follow-up diff --git a/openspec/changes/3230-decide-the-free-text-mcp-parameters/tasks.md b/openspec/changes/3230-decide-the-free-text-mcp-parameters/tasks.md index a98f25fa0b..60b9b2250a 100644 --- a/openspec/changes/3230-decide-the-free-text-mcp-parameters/tasks.md +++ b/openspec/changes/3230-decide-the-free-text-mcp-parameters/tasks.md @@ -5,38 +5,38 @@ Reads: `src/devops_cli/ai/mcp/generator.py`, `tests/ai/mcp/test_mcp_exposure_table.py`. Changes: `src/devops_cli/ai/mcp/generator.py`, `tests/ai/mcp/test_mcp_exposure_table.py`. - [ ] 1.1 In `tests/ai/mcp/test_mcp_exposure_table.py`, add a test that gives a path restriction a `denied` set holding `env` and asserts that the generated schema of the tool has no `env` property - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` fails on the base + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` fails on the base - [ ] 1.2 Read `denied` in `_introspect_command_parameters` of `src/devops_cli/ai/mcp/generator.py` and skip each parameter that it names, before any `allowed` check. Document the key in the comment above `_PATH_PARAM_RESTRICTIONS` - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` passes + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` passes ## 2. Deny env on sandbox deploy, drop valkey set, and update dependent tests Reads: `src/devops_cli/ai/mcp/generator.py`, `src/devops_cli/config/constants.py`, `tests/ai/mcp/test_mcp_exposure_table.py`, `tests/ai/mcp/test_mcp_tool_registry.py`. Changes: `src/devops_cli/ai/mcp/generator.py`, `src/devops_cli/config/constants.py`, `tests/ai/mcp/test_mcp_exposure_table.py`, `tests/ai/mcp/test_mcp_tool_registry.py`. - [ ] 2.1 In `tests/ai/mcp/test_mcp_exposure_table.py`, add a test that asserts the schema of `sandbox_deploy` has no `env` property and that the generated tool names hold no `valkey_set` - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` fails on the base + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` fails on the base - [ ] 2.2 Add `("sandbox", "deploy")` to `_PATH_PARAM_RESTRICTIONS` with `denied` holding `env`. Remove `("valkey", "set")` from `CONST_MCP_EXPOSURE_TABLE` in `src/devops_cli/config/constants.py` and from `_PATH_PARAM_RESTRICTIONS` - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` passes + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py` passes - [ ] 2.3 Add `("valkey", "set")` to `mcp_command_exclusions` and update `test_export_schemas_command` to check `tf_apply.json` in `tests/commands/test_mcp_tools_and_schema_export.py`. Update `floor_expected_false` in `tests/ai/mcp/test_mcp_tool_registry.py` and the input contract tests in `tests/ai/mcp/test_mcp_argument_refusal.py` to use `tf_apply` instead of `valkey_set` - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py tests/commands/test_mcp_tools_and_schema_export.py tests/ai/mcp/test_mcp_tool_registry.py tests/ai/mcp/test_mcp_argument_refusal.py` passes + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_exposure_table.py tests/commands/test_mcp_tools_and_schema_export.py tests/ai/mcp/test_mcp_tool_registry.py tests/ai/mcp/test_mcp_argument_refusal.py` passes ## 3. Add the free-text sink guard and allow-list k8s_diff_helm values Reads: `SECURITY.md`, `src/devops_cli/ai/mcp/generator.py`, `src/devops_cli/config/constants.py`, `tests/ai/mcp/test_mcp_tool_secrets.py`. Changes: `src/devops_cli/config/constants.py`, `tests/ai/mcp/test_mcp_tool_secrets.py`. - [ ] 3.1 In `tests/ai/mcp/test_mcp_tool_secrets.py`, add a test that registers a tool publishing a text parameter named `value` with no allow-list entry and asserts that the guard fails and names the tool and the parameter, and a test that asserts a stale entry fails - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_tool_secrets.py` fails on the base + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_tool_secrets.py` fails on the base - [ ] 3.2 Add `CONST_MCP_FREE_TEXT_SINK_PARAMETER_NAMES` with `env`, `values`, `value` and `data`, and `CONST_MCP_FREE_TEXT_SINK_ALLOWLIST` with `("k8s_diff_helm", "values")` and its reason in `src/devops_cli/config/constants.py`. Add the schema scan to `tests/ai/mcp/test_mcp_tool_secrets.py` beside the guard of #3222 - - Verification: `uv run devops ci test tests/ai/mcp/test_mcp_tool_secrets.py` passes + - Verification: `$ uv run devops ci test tests/ai/mcp/test_mcp_tool_secrets.py` passes ## 4. State the guard in the security policy and update documentation Reads: `SECURITY.md`, `docs/MCP_TOOLS.md`, `src/devops_cli/config/constants.py`. Changes: `SECURITY.md`, `docs/MCP_TOOLS.md`. - [ ] 4.1 Update rule 11 of `SECURITY.md` to state five valkey commands are MCP tools and that `valkey set` is not an MCP tool. Update rule 12 with the free-text sink names, the allow-list with its reason, and the stale-entry check - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes - [ ] 4.2 Run `uv run devops docs generate --sync-readme` to regenerate `docs/MCP_TOOLS.md` without `valkey_set` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Criteria diff --git a/openspec/changes/3254-list-the-registry-and-ratchet-entries/tasks.md b/openspec/changes/3254-list-the-registry-and-ratchet-entries/tasks.md index 75d3142a12..5da7cee36c 100644 --- a/openspec/changes/3254-list-the-registry-and-ratchet-entries/tasks.md +++ b/openspec/changes/3254-list-the-registry-and-ratchet-entries/tasks.md @@ -5,54 +5,54 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `tests/roadmap/test_roadmap_limit_classes.py`. Changes: `src/devops_cli/roadmap/stage_registry.py` (new), `tests/roadmap/test_roadmap_stage_registry.py` (new). - [ ] 1.1 Write `tests/roadmap/test_roadmap_stage_registry.py::test_a_declaration_enters_the_table_with_its_path_and_line` first: a module holding a `REGISTRY_COUNTS` literal gives one entry with its token, its kind, its declared path and its line - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py` fails on the base - [ ] 1.2 Add `src/devops_cli/roadmap/stage_registry.py` with a `RegistryCount` record of `kind`, `token` and `path`, a `counts_in(path)` reader that parses one module with `ast` and reads the module-level `REGISTRY_COUNTS` tuple of literals, and a `registry_table(root)` builder that walks the modules under the tests directory and returns each entry with `path:line`. Import no test module. The test writes a temporary module and reads it back - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py` passes ## 2. Declare what each registry test counts Reads: `tests/roadmap/test_roadmap_limit_classes.py`, `tests/support/fakes/roadmap_store.py`, `tests/telemetry/test_telemetry_instruments.py`, `tests/roadmap/test_roadmap_dry_runs.py`. Changes: `tests/roadmap/test_roadmap_limit_classes.py`, `tests/support/fakes/roadmap_store.py`, `tests/telemetry/test_telemetry_instruments.py`, `tests/roadmap/test_roadmap_dry_runs.py`. - [ ] 2.1 Add a module-level `REGISTRY_COUNTS` tuple to each of the four test modules. `tests/roadmap/test_roadmap_limit_classes.py` declares the `CONST_ROADMAP_` and `DEFAULT_ROADMAP_` constant prefixes. `tests/support/fakes/roadmap_store.py` declares the `WRITES` table. `tests/telemetry/test_telemetry_instruments.py` declares the `INSTRUMENTS` table and the `devops_cli_` metric prefix. `tests/roadmap/test_roadmap_dry_runs.py` declares `stage_requests` and `implement_requests`. Each entry names the path that must carry the entry: the declaring test, `src/devops_cli/telemetry/instruments.py`, `src/devops_cli/roadmap/request_plan.py` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py tests/telemetry/test_telemetry_instruments.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py tests/telemetry/test_telemetry_instruments.py` passes ## 3. List the matching places in the plan context Reads: `src/devops_cli/roadmap/stage_registry.py`, `src/devops_cli/roadmap/stage.py`, `tests/roadmap/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage.py`, `src/devops_cli/roadmap/stage_registry.py`, `tests/roadmap/test_roadmap_stage_plan.py`, `docs/ROADMAP_WORKFLOW.md`. - [ ] 3.1 Add to `tests/roadmap/test_roadmap_stage_plan.py` a case where a plan that adds `DEFAULT_ROADMAP_EXAMPLE_LIMIT` gets `tests/roadmap/test_roadmap_limit_classes.py` in its context - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 3.2 Add `matches(table, texts, paths)` to `src/devops_cli/roadmap/stage_registry.py`: it returns each entry whose token appears in the task texts or in a changed path, with `path:line`. Call it from `src/devops_cli/roadmap/stage.py` where the plan context is built, and add a `Registry places` section to that context. A plan that adds no counted item gets no section - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes - [ ] 3.3 Update `docs/ROADMAP_WORKFLOW.md`, and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## 4. Refuse a plan that misses a listed place Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_registry.py`, `tests/roadmap/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `tests/roadmap/test_roadmap_stage_plan.py`. - [ ] 4.1 Add to `tests/roadmap/test_roadmap_stage_plan.py` a case where a plan that adds a write method gets the dry-run test, the fault-test table, the contract test and the request-plan entry in its context and, with no task for the fault-test path, gets a problem naming it; and a case where a plan naming every listed place gets none - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 4.2 Extend `check_proposal` in `src/devops_cli/roadmap/stage_change.py`: for each matched entry, refuse when no task text of the plan names the declared path, and name the path and its declaring `path:line` in the problem - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes ## 5. Refuse a stale test path in a docstring or a spec Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_registry.py`, `tests/roadmap/test_roadmap_stage_form.py`. Changes: `src/devops_cli/roadmap/stage_registry.py`, `src/devops_cli/roadmap/stage_change.py`, `tests/roadmap/test_roadmap_stage_registry.py`, `tests/roadmap/test_roadmap_stage_form.py`. - [ ] 5.1 Add to `tests/roadmap/test_roadmap_stage_registry.py` two cases: a spec text that names a test module the commit does not hold returns that name, and a docstring that names `tests/roadmap/test_roadmap_limit_classes.py` returns nothing - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py tests/roadmap/test_roadmap_stage_form.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py tests/roadmap/test_roadmap_stage_form.py` fails on the base - [ ] 5.2 Add `missing_test_paths(root, texts)` to `src/devops_cli/roadmap/stage_registry.py`: it reads the test module names of each text, keeps the ones that name no file of the commit, and returns them sorted. Call it from `check_proposal` for the changed Python docstrings and the spec files of the change, and add each missing name to the refusal list - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py tests/roadmap/test_roadmap_stage_form.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_registry.py tests/roadmap/test_roadmap_stage_form.py` passes ## 6. Correct the stale test path in the telemetry doc Reads: `docs/TELEMETRY.md`, `tests/telemetry/test_telemetry_instruments.py`. Changes: `docs/TELEMETRY.md`. - [ ] 6.1 In `docs/TELEMETRY.md`, replace the sentence that names the old root-level telemetry test module with `tests/telemetry/test_telemetry_instruments.py`, and keep the rest of the paragraph on `INSTRUMENTS` as it is - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes - [ ] 6.2 Update `docs/TELEMETRY.md`, and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Criteria diff --git a/openspec/changes/3307-the-plan-check-names-a-caller/tasks.md b/openspec/changes/3307-the-plan-check-names-a-caller/tasks.md index 72c851f05e..e2053e5d87 100644 --- a/openspec/changes/3307-the-plan-check-names-a-caller/tasks.md +++ b/openspec/changes/3307-the-plan-check-names-a-caller/tasks.md @@ -5,9 +5,9 @@ Reads: `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage.py`, `src/devops_cli/roadmap/stage_eval_cases.py`, `tests/roadmap/test_roadmap_stage_paths.py`. Changes: `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_paths.py`. - [ ] 1.1 Write `test_a_plan_that_leaves_out_a_caller_is_refused` in `tests/roadmap/test_roadmap_stage_paths.py`. It makes a checkout where src/a.py and src/b.py call `check_proposal`, and asserts that a plan whose `changes` list omits src/b.py gets a problem that names `check_proposal` and src/b.py - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` fails on the base - [ ] 1.2 Read the function name from each task text that adds a parameter, search the callers with `git grep` on the checkout of `StagedTree`, and return one problem for each caller file that `changes` leaves out. Skip a tree with no checkout - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` passes ## Workflow follow-up diff --git a/openspec/changes/3308-the-plan-check-compares-a-number/tasks.md b/openspec/changes/3308-the-plan-check-compares-a-number/tasks.md index 2e6fa72689..c9cc13bf6e 100644 --- a/openspec/changes/3308-the-plan-check-compares-a-number/tasks.md +++ b/openspec/changes/3308-the-plan-check-compares-a-number/tasks.md @@ -5,43 +5,43 @@ Reads: `src/devops_cli/roadmap/stage_probe.py`, `src/devops_cli/roadmap/pull_form.py`, `src/devops_cli/lang/en/messages.py`. Changes: `src/devops_cli/roadmap/stage_constants.py` (new), `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_constants.py` (new). - [ ] 1.1 In `tests/roadmap/test_roadmap_stage_constants.py`, assert that a source with `SUMMARY_MAX_CHARS: Final[int] = 60` gives 60, that an alias resolves to the integer in another module, that a value from a call is left out, that a name that two modules define with different values is left out, and that a plan text with `SUMMARY_MAX_CHARS` and 40 in one sentence yields one problem that names the constant, 40 and 60. Assert that a matching number yields no problem, that a note reference (`#2714`) and a line location (`:12`) are no candidate number, and that a sentence with two candidate numbers yields no problem. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` fails on the base - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` fails on the base - [ ] 1.2 Add `src/devops_cli/roadmap/stage_constants.py` with `candidate_names(texts)`, `staged_constants(source, sha, names)` and `constant_problems(texts, constants)`. `staged_constants` finds each name with `git grep` under `src/` at `sha`, reads only the files it names with `git show`, parses them with `ast.parse`, resolves an alias across modules, and returns no value for an assignment that is no integer literal and no value for an ambiguous name. `constant_problems` splits a text into sentences, finds one known constant and one candidate number in a sentence, and returns one message for each number that differs, naming the constant, the plan's number and the staged value. Add the message to `src/devops_cli/lang/en/messages.py`, and verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` passes - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` passes ## 2. Refuse the plan in `check_proposal` Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage.py`, `src/devops_cli/roadmap/stage_constants.py`, `tests/roadmap/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage.py`, `tests/roadmap/test_roadmap_stage_plan.py`. - [ ] 2.1 In `tests/roadmap/test_roadmap_stage_plan.py`, assert that `check_proposal` with `constants={"SUMMARY_MAX_CHARS": 60}` returns one problem for a proposal whose spec scenario says 40, returns none for one that says 60, returns none for a proposal with no constants, and returns none for the text of a task group that holds 40, and verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 2.2 Add `plan_texts(proposal)` to `src/devops_cli/roadmap/stage_change.py`: the fields that render to `proposal.md`, `design.md` and each spec delta, with no task group. Add the `constants` keyword to `check_proposal` and add its problems to the list that the function returns. In `Stage._settle` in `src/devops_cli/roadmap/stage.py`, read the constants with `staged_constants(self._source, self._sha, candidate_names(plan_texts(proposal)))` and pass them to `check_proposal`. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes ## 3. Ask the plan stage prompt for the staged value of a constant Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. - [ ] 3.1 Add one rule to `src/devops_cli/ai/tasks/roadmap_stage_change.md`: cite the staged value of each constant that the plan relies on, with the constant name and its value, as `feasibility` quotes the probe lines, and give no new name to the bound of a constant that the staged tree defines. Add the assertion of that rule to `tests/roadmap/test_roadmap_stage_prompt_rules.py` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes ## 4. Carry recorded constants through the stage eval replay Reads: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`. Changes: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`. - [ ] 4.1 In `tests/roadmap/test_roadmap_stage_eval_gates.py`, assert that a case with no `constants` field replays as it does today, and that a case with `constants` refuses a plan whose spec scenario names a different value. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base - [ ] 4.2 Add `constants: tuple[tuple[str, int], ...] = ()` to `CaseFacts`, and a `constants` field with an empty default to `PlanUnderTest`. `PlanUnderTest.of_case` reads `dict(case.facts.constants)`, and `_path_gate` passes `plan.constants` to `check_proposal`. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes ## 5. Check the OpenSpec change against the base specs Reads: `openspec/config.yaml`. Changes: `openspec/changes/3308-the-plan-check-compares-a-number/proposal.md`, `openspec/changes/3308-the-plan-check-compares-a-number/design.md`, `openspec/changes/3308-the-plan-check-compares-a-number/tasks.md`, `openspec/changes/3308-the-plan-check-compares-a-number/.openspec.yaml`, `openspec/changes/3308-the-plan-check-compares-a-number/specs/roadmap-stage/spec.md`. - [ ] 5.1 Keep the change folder `openspec/changes/3308-the-plan-check-compares-a-number/` with its proposal, its design, its `tasks.md` and the spec delta of `roadmap-stage`, then run the validation - - Verification: `uv run devops openspec check` passes + - Verification: `$ uv run devops openspec check` passes - [ ] 5.2 The change folder is the record of the item, and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Criteria diff --git a/openspec/changes/3318-the-stage-context-lists-the-sibling/tasks.md b/openspec/changes/3318-the-stage-context-lists-the-sibling/tasks.md index 5bf3633612..a63380da23 100644 --- a/openspec/changes/3318-the-stage-context-lists-the-sibling/tasks.md +++ b/openspec/changes/3318-the-stage-context-lists-the-sibling/tasks.md @@ -5,27 +5,27 @@ Reads: `src/devops_cli/roadmap/stage_paths.py`. Changes: `src/devops_cli/roadmap/stage_paths.py`, `tests/roadmap/test_roadmap_stage_paths.py`. - [ ] 1.1 In `tests/roadmap/test_roadmap_stage_paths.py`, assert that `sibling_trees(".claude/skills/new-scaffold/SKILL.md", files)` returns `[".agents/skills/", ".kilocode/skills/"]` for a tree that holds `.agents/skills/openspec-x/SKILL.md` and `.kilocode/skills/openspec-y/SKILL.md`, returns no tree for a tree with one skill folder, leaves out `.agents/notes/SKILL.md`, and sorts `.agents/skills/` before `.kilocode/skills/`. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` fails on the base - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` fails on the base - [ ] 1.2 Add `sibling_trees(path, files)` to `src/devops_cli/roadmap/stage_paths.py`. Replace the first segment and the directory before the file name with `*`, match each file with `PurePosixPath.full_match`, return the sorted first two segments of each match without the tree of `path`, and return no tree when `path` has fewer than three segments. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` passes - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` passes ## 2. Put the sibling trees in the stage context Reads: `src/devops_cli/roadmap/stage.py`, `src/devops_cli/roadmap/refine.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/roadmap/stage_paths.py`, `docs/roadmap/stage.md`. Changes: `src/devops_cli/roadmap/stage.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_plan.py`, `docs/roadmap/stage.md`. - [ ] 2.1 In `tests/roadmap/test_roadmap_stage_plan.py`, assert that the request context of an item whose body cites `.claude/skills/new-scaffold/SKILL.md` holds a `Sibling trees` section with `.agents/skills/` and `.kilocode/skills/` when the staged tree holds those trees, and holds no section when the staged tree holds one skill tree. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 2.2 In `src/devops_cli/roadmap/stage.py`, read `cited_paths(item.body)`, keep the paths that `self._tree` does not hold, call `sibling_trees` for each of them, and append the `Sibling trees` section to the value of `collect_context`. Add the heading and the instruction to `src/devops_cli/lang/en/messages.py`, and leave the section out when the list is empty. Verify that `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes - [ ] 2.3 State the `Sibling trees` section and the rule that the plan covers each tree or gives a reason in `docs/roadmap/stage.md` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## 3. Ask the stage prompt to cover each tree Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. - [ ] 3.1 Add one rule to `src/devops_cli/ai/tasks/roadmap_stage_change.md`: when the context holds a `Sibling trees` section, the plan creates the file in each listed tree, or states in `decisions` why one tree is enough. Assert the rule in `tests/roadmap/test_roadmap_stage_prompt_rules.py` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes ## Workflow follow-up diff --git a/openspec/changes/3320-a-plan-that-deletes-a-guard/tasks.md b/openspec/changes/3320-a-plan-that-deletes-a-guard/tasks.md index d5a1e25432..4ab1b817be 100644 --- a/openspec/changes/3320-a-plan-that-deletes-a-guard/tasks.md +++ b/openspec/changes/3320-a-plan-that-deletes-a-guard/tasks.md @@ -5,41 +5,41 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_plan.py`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_weakened_checks.py` (new), `tests/roadmap/test_roadmap_stage_prompt_rules.py`, `tests/roadmap/test_roadmap_plan_read_weakened.py`. - [ ] 1.1 Write `tests/roadmap/test_roadmap_stage_weakened_checks.py` with a reply whose task deletes `test_all_cli_commands_are_either_exposed_or_excluded` and no entry, and assert that `check_proposal` names it - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` fails on the base - [ ] 1.2 Add `_guard_deletions` and the check that calls it from `check_proposal`, with the texts in `MESSAGES.roadmap` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` passes - [ ] 1.3 Remove `SkipJsonSchema` from the field `weakened_checks` of `StageProposal`, so the reply schema shows it, and delete `test_the_reply_schema_of_the_stage_model_does_not_show_the_field` from `tests/roadmap/test_roadmap_plan_read_weakened.py`. Add the `weakened_checks` key and its rule to `src/devops_cli/ai/tasks/roadmap_stage_change.md`, and add `WeakenedCheck` to the models of `tests/roadmap/test_roadmap_stage_prompt_rules.py` that must list their keys - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes ## 2. Write the weakened checks into the proposal file Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_weakened_checks.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_weakened_checks.py`. - [ ] 2.1 Add a case to `tests/roadmap/test_roadmap_stage_weakened_checks.py` that renders one entry, asserts the `## Weakened checks` section and reads the entry back with `read_change`, and one that renders none and asserts no section - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` fails on the base - [ ] 2.2 Render the section in `_proposal_file` between `## Impact` and `## Feasibility` when `weakened_checks` is not empty, with `stage_weakened_checks_title` and `stage_weakened_entry` of `MESSAGES.roadmap` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_weakened_checks.py` passes ## 3. Ask for the section in the proposal rules Reads: `openspec/config.yaml`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `openspec/config.yaml`. - [ ] 3.1 Add one rule to `rules.proposal` that asks a plan which deletes a guard check to give a `## Weakened checks` entry with the check, what it stopped and the safeguard - - Verification: `uv run devops openspec check` passes + - Verification: `$ uv run devops openspec check` passes ## 4. Replay a plan that deletes a guard check Reads: `src/devops_cli/roadmap/stage_eval_cases.py`, `docs/ROADMAP_WORKFLOW.md`. Changes: `src/devops_cli/roadmap/stage_eval_cases.py`. - [ ] 4.1 Add the case of a plan that deletes `test_all_cli_commands_are_either_exposed_or_excluded` and records no weakened check, with its defect of the new gate - - Verification: `uv run devops roadmap eval stage --dry-run` passes + - Verification: `$ uv run devops roadmap eval stage --dry-run` passes ## 5. State the score of the stage gate Reads: `docs/ROADMAP_WORKFLOW.md`, `src/devops_cli/roadmap/stage_eval_run.py`. Changes: `docs/ROADMAP_WORKFLOW.md`. - [ ] 5.1 Update `docs/ROADMAP_WORKFLOW.md` with the weakened-check gate, the new replay case and the model score before and after the change, then run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Criteria diff --git a/openspec/changes/3321-the-plan-check-refuses-a-self/tasks.md b/openspec/changes/3321-the-plan-check-refuses-a-self/tasks.md index f966b6f9fb..3ad83bf6f6 100644 --- a/openspec/changes/3321-the-plan-check-refuses-a-self/tasks.md +++ b/openspec/changes/3321-the-plan-check-refuses-a-self/tasks.md @@ -5,47 +5,47 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/roadmap/stage.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `src/devops_cli/lang/en/messages.py`. Changes: `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_own_change.py` (new). - [ ] 1.1 Write `tests/roadmap/test_roadmap_stage_own_change.py` with a group that lists `openspec/changes/3321-plan-check/proposal.md` in `changes`, and `check_proposal(..., change="3321-plan-check")`, and assert one problem that names the path and the own change folder. Add a task code span that names `openspec/changes/3321-plan-check/tasks.md`, and assert one problem that names the group and the path, and add a group that names `openspec/changes/3307-other/proposal.md` and assert no own-change problem - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_own_change.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_own_change.py` fails on the base - [ ] 1.2 Add `own_change_problems(groups, change)` to `src/devops_cli/roadmap/stage_paths.py`, with the two messages in `MESSAGES.roadmap`; add the `change` keyword to `check_proposal` and call the function there - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_own_change.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_own_change.py` passes - [ ] 1.3 Pass `change=target.change` from `_settle` in `src/devops_cli/roadmap/stage.py`, and pass `case.change` from `PlanUnderTest.of_case` and `_path_gate` in `src/devops_cli/roadmap/stage_eval_gates.py` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes ## 2. Refuse a scenario that names code with no behavior test Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/roadmap/step_files.py`, `src/devops_cli/lang/en/messages.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_scenario_evidence.py` (new). - [ ] 2.1 Write `tests/roadmap/test_roadmap_stage_scenario_evidence.py` with a spec scenario whose `then` names `_loki_mode` in a code span and no behavior group's `test` or `verify` names it; assert one problem that names the scenario and `_loki_mode`, and add a scenario that also names `helm template` and assert no problem for it, and add a behavior group whose `test` names `_loki_mode` and assert no problem - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_scenario_evidence.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_scenario_evidence.py` fails on the base - [ ] 2.2 Add `_scenario_problems` to `src/devops_cli/roadmap/stage_change.py`, with the identifier and command span helpers and the message in `MESSAGES.roadmap`, and call it from `check_proposal` after `_delta_problems` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_scenario_evidence.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_scenario_evidence.py` passes ## 3. Require a quoted references answer to be covered Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_references.py`, `src/devops_cli/lang/en/messages.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_reference_coverage.py` (new). - [ ] 3.1 Write `tests/roadmap/test_roadmap_stage_reference_coverage.py` with `feasibility` that holds `References to 'SingleBinary': files 1, lines 1.` and `tests/commands/k8s/test_k8s.py: 1 (line 12)` and no group or design decision that names the file; assert one problem that names `tests/commands/k8s/test_k8s.py`, and add a decision that names the file and assert none, and add `openspec/changes/archive/2026-10-24-1000-old/proposal.md` to the answer and assert none - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_reference_coverage.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_reference_coverage.py` fails on the base - [ ] 3.2 Add `_reference_problems` to `src/devops_cli/roadmap/stage_change.py`, with the header and file line expressions and the message in `MESSAGES.roadmap`, and call it from `check_proposal` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_reference_coverage.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_reference_coverage.py` passes ## 4. Replay the plan of PR #3278 Reads: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `tests/fixtures/roadmap_eval/stage/3167-a-comment-by-a-person-on/case.json`, `tests/fixtures/roadmap_eval/stage/3167-a-comment-by-a-person-on/plan.json`, `tests/fixtures/roadmap_eval/stage/3167-a-comment-by-a-person-on/facts.json`. Changes: `tests/fixtures/roadmap_eval/stage/3278-a-plan-that-names-its-own/case.json` (new), `tests/fixtures/roadmap_eval/stage/3278-a-plan-that-names-its-own/issue.txt` (new), `tests/fixtures/roadmap_eval/stage/3278-a-plan-that-names-its-own/plan.json` (new), `tests/fixtures/roadmap_eval/stage/3278-a-plan-that-names-its-own/facts.json` (new). - [ ] 4.1 Add the plan of PR #3278 with `change` set to its change folder, and record three defects: the group and the task that name the own change folder with the gate `paths`, the scenario that names `_loki_mode` with no behavior test with the gate `paths`, and `tests/commands/k8s/test_k8s.py` from a quoted `References to 'SingleBinary'` answer with the gate `paths` - - Verification: `uv run devops roadmap eval stage --dry-run` passes + - Verification: `$ uv run devops roadmap eval stage --dry-run` passes - [ ] 4.2 Run the replay on the whole set and fix a case until each defect is caught and the good plans still pass - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes ## 5. Ask for the rules in the prompt and state the score Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `docs/ROADMAP_WORKFLOW.md`, `src/devops_cli/roadmap/stage_eval_run.py`, `src/devops_cli/roadmap/stage_eval_gates.py`. Changes: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `docs/ROADMAP_WORKFLOW.md`. - [ ] 5.1 Add the three rules to `src/devops_cli/ai/tasks/roadmap_stage_change.md`: no path of the own change folder in a group or a task, a behavior test for each scenario that names code unless the scenario names a command, and a group or a design decision for each file of a quoted `References to` answer - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes - [ ] 5.2 Run `uv run devops roadmap eval stage` with one model before and after the gates, then update the gate counts and the score in `docs/ROADMAP_WORKFLOW.md` and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Workflow follow-up diff --git a/openspec/changes/3328-the-stage-probe-checks-prompt-reply/tasks.md b/openspec/changes/3328-the-stage-probe-checks-prompt-reply/tasks.md index eaad9e352b..b76c007c50 100644 --- a/openspec/changes/3328-the-stage-probe-checks-prompt-reply/tasks.md +++ b/openspec/changes/3328-the-stage-probe-checks-prompt-reply/tasks.md @@ -5,25 +5,25 @@ Reads: `src/devops_cli/roadmap/stage_eval_gates.py`, `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`. - [ ] 1.1 In `tests/roadmap/test_roadmap_stage_eval_gates.py`, assert that `gate_for(DefectType.PROMPT_KEY_MISSING)` is `GateName.PROMPT_KEYS`, that the gate refuses a plan whose group adds a field to `StageProposal` and changes no prompt reply key, and that the gate accepts the plan when a group changes `src/devops_cli/ai/tasks/roadmap_stage_change.md` with the reply key and its rule, and raise the gate-set baseline of `test_every_gate_still_refuses_every_known_bad_plan_it_must` with the name `prompt_keys` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base - [ ] 1.2 Add `PROMPT_KEY_MISSING = "prompt_key_missing"` to `DefectType` and `PROMPT_KEYS = "prompt_keys"` to `GateName` in `src/devops_cli/roadmap/stage_eval_cases.py`. Add `_prompt_key_gate` to `src/devops_cli/roadmap/stage_eval_gates.py`: it reads the groups that change `src/devops_cli/roadmap/stage_change.py` and whose title, implementation or documentation names `StageProposal` with a new field, and it returns one problem when no group changes `src/devops_cli/ai/tasks/roadmap_stage_change.md` with the reply key. Add `Gate(GateName.PROMPT_KEYS, "#3328", DefectType.PROMPT_KEY_MISSING, _prompt_key_gate)` to `GATES`. Add the message to `src/devops_cli/lang/en/messages.py`; it names the prompt file and the reply key. Run the gate in the stage job through `run_gates`, so a plan with the defect returns to the model once - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes ## 2. Record the missing prompt key in the golden set Reads: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `tests/roadmap/test_roadmap_stage_eval_cases.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`. Changes: `tests/roadmap/test_roadmap_stage_eval_cases.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`, `tests/fixtures/roadmap_eval/stage/3328-missing-prompt-key/case.json` (new), `tests/fixtures/roadmap_eval/stage/3328-missing-prompt-key/issue.txt` (new), `tests/fixtures/roadmap_eval/stage/3328-missing-prompt-key/plan.json` (new), `tests/fixtures/roadmap_eval/stage/3328-missing-prompt-key/facts.json` (new). - [ ] 2.1 Add the case folder `tests/fixtures/roadmap_eval/stage/3328-missing-prompt-key/`. Its `plan.json` holds one group that changes `src/devops_cli/roadmap/stage_change.py` and names a new field of `StageProposal`, and no group that changes `src/devops_cli/ai/tasks/roadmap_stage_change.md`. Its `case.json` holds one defect of the type `prompt_key_missing` with the gate `prompt_keys` and the message that names the prompt file. Its `facts.json` holds the tracked files that the gates need, and its `issue.txt` the body of this item, and raise the case count and the evaluated pulls of `tests/roadmap/test_roadmap_stage_eval_cases.py` and the judged baseline of `test_the_counts_of_each_type_are_the_baseline_that_a_change_of_a_gate_beats` for the case - - Verification: `uv run devops roadmap eval stage --replay` passes + - Verification: `$ uv run devops roadmap eval stage --replay` passes ## 3. State the prompt-key rule in the project documents Reads: `AGENTS.md`, `docs/TESTING.md`, `openspec/config.yaml`. Changes: `docs/TESTING.md`. - [ ] 3.1 Add one sentence to `docs/TESTING.md` that a plan which adds a field to `StageProposal` changes the reply-key bullets and the rule in `src/devops_cli/ai/tasks/roadmap_stage_change.md`, and that the `prompt_keys` gate refuses a plan that leaves the update out - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes - [ ] 3.2 Add the sentence to `docs/TESTING.md` beside the rules of a staged plan, and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Criteria diff --git a/openspec/changes/3343-the-stage-probe-checks-defecttype-membership/tasks.md b/openspec/changes/3343-the-stage-probe-checks-defecttype-membership/tasks.md index 34d28ea84a..265ddde1a6 100644 --- a/openspec/changes/3343-the-stage-probe-checks-defecttype-membership/tasks.md +++ b/openspec/changes/3343-the-stage-probe-checks-defecttype-membership/tasks.md @@ -5,11 +5,11 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_plan.py`. - [ ] 1.1 In `tests/roadmap/test_roadmap_stage_plan.py`, write `test_a_finding_kind_outside_defect_type_is_refused`, which passes a proposal whose group test text says `kind: placeholder` to `content_problems` and expects one problem that names `placeholder` and each member of `DefectType`. Add `test_a_finding_kind_inside_defect_type_passes`, `test_a_mapped_classification_to_other_passes`, `test_an_other_group_kind_is_no_finding_type` and `test_a_qualified_defect_type_outside_the_members_is_refused`, which expects a problem that names `PLACEHOLDER` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 1.2 Add `_FINDING_TYPES` and a helper `finding_type_problems(proposal)` to `src/devops_cli/roadmap/stage_change.py`. The helper collects the free text of the proposal: `summary`, `why`, each group `title`, `test`, `implementation` and `documentation`, each spec delta requirement `name`, `text` and scenario texts, each criterion text and `pull_request_body`. It skips `reads`, `changes`, `creates` and `kind`. It matches a `DefectType.` reference anywhere. It also matches a backticked `kind` or `type` and its value, only in a sentence that holds the word `finding` or `defect`, with `_one_line` applied first. A value that is not a member of `DefectType` gives a problem from `MESSAGES.roadmap.stage_problem_finding_type`, which names the value, lists the members and says to add the enum member or map the classification to `DefectType.OTHER`. Call the helper from `content_problems` and append its problems to the returned list - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes - [ ] 1.3 Add `stage_problem_finding_type` to `class RoadmapMessages` in `src/devops_cli/lang/en/messages.py`. The text takes the value and the members of `DefectType`, names the value and lists the members, and says to add the enum member or map the classification to `DefectType.OTHER` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes ## Criteria diff --git a/openspec/changes/3344-the-stage-probe-checks-client-model/tasks.md b/openspec/changes/3344-the-stage-probe-checks-client-model/tasks.md index 6c89afaafa..adff0c1e19 100644 --- a/openspec/changes/3344-the-stage-probe-checks-client-model/tasks.md +++ b/openspec/changes/3344-the-stage-probe-checks-client-model/tasks.md @@ -5,27 +5,27 @@ Reads: `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/roadmap/implement_hooks.py`, `src/devops_cli/github/client.py`, `tests/roadmap/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage_models.py` (new), `tests/roadmap/test_roadmap_stage_models.py` (new). - [ ] 1.1 Write `tests/roadmap/test_roadmap_stage_models.py` first: `referenced_classes` returns `PullStatus` for texts that hold `PullStatus.labels` and no name for a plain word; `model_fields` on a commit whose `src/devops_cli/github/client.py` defines `PullStatus` with `state` and `head_sha` gives the module and those field names; a class that inherits no `BaseModel` is left out; a module that `ast` cannot parse gives no class and fails no other class - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_models.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_models.py` fails on the base - [ ] 1.2 Add `src/devops_cli/roadmap/stage_models.py`. `referenced_classes(texts)` returns the first part of each dotted reference. `model_fields(source, sha, names)` runs `git grep -n "^class ("` at `sha` under `src/`, reads each match with `git show`, parses it with `ast`, keeps each class that subclasses `BaseModel` or a class of the same module, and returns the module path and the annotated field names of each named class. Read a module that raises `SyntaxError` as a module with no model - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_models.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_models.py` passes ## 2. Refuse a missing model attribute Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_models.py`, `src/devops_cli/roadmap/stage.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_plan.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_plan.py`. - [ ] 2.1 Add to `tests/roadmap/test_roadmap_stage_plan.py` tests of `check_proposal` with a `models` map whose `PullStatus` defines `state` and no `labels`: a group that names `PullStatus.labels` returns one problem that names `PullStatus.labels` and `src/devops_cli/github/client.py`; the same plan with that module in `changes` returns no problem; a group that names `PullStatus.state` returns no problem; a call with no `models` returns no problem. Add a plan run whose first reply keeps the gap and whose second reply is the sample proposal, and a run whose two replies keep the gap and end with `RoadmapStageError` and no ready change - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 2.2 In `check_proposal`, add the keyword-only `models` argument and collect each dotted reference of the group texts, the spec delta texts, the decisions and the rejected alternatives. For a reference whose class is in the map, compare the second part with the field names. Return a problem that names the reference and the module when the field is missing, and ask for the module in a group's `changes` when no group lists it. Keep the existing order of the problems. Add the problem texts to `MESSAGES.roadmap`. In `StageSession._settle`, call `referenced_classes`, read the map once, and pass it - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes ## 3. Replay the missing-field defect Reads: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`, `docs/ROADMAP_WORKFLOW.md`. Changes: `src/devops_cli/roadmap/stage_eval_cases.py`, `src/devops_cli/roadmap/stage_eval_gates.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`, `tests/fixtures/roadmap_eval/stage/3344-a-plan-that-reads-an-absent-field/` (new). - [ ] 3.1 Add `models` to `CaseFacts`, pass it through `PlanUnderTest.of_case` and `_path_gate`, and add the case folder for the #3264 example: its issue text, a plan with a group that reads `PullStatus.labels` and leaves `src/devops_cli/github/client.py` out of `changes`, a `facts.json` that records `PullStatus` with `state` and no `labels`, and a `missing_path` defect with the gate `paths`, the path of the module and the message of the problem. Extend the replay test so the report lists the case and catches its defect - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` fails on the base - [ ] 3.2 State the new rule at the `paths` gate in `docs/ROADMAP_WORKFLOW.md`: the gate refuses a read of a missing field of a named Pydantic model and names the module. Then run `uv run devops roadmap eval stage --replay` and state the counts of the `paths` gate before and after the change - - Verification: `uv run devops ci docs` passes and `uv run devops roadmap eval stage --replay` lists the new case as caught + - Verification: `$ uv run devops ci docs` passes and `$ uv run devops roadmap eval stage --replay` lists the new case as caught ## Criteria diff --git a/openspec/changes/3373-a-move-plan-covers-each-reference/tasks.md b/openspec/changes/3373-a-move-plan-covers-each-reference/tasks.md index 2bf79c67ae..bd768215df 100644 --- a/openspec/changes/3373-a-move-plan-covers-each-reference/tasks.md +++ b/openspec/changes/3373-a-move-plan-covers-each-reference/tasks.md @@ -5,27 +5,27 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_references.py`, `src/devops_cli/roadmap/stage.py`, `tests/roadmap/test_roadmap_stage_plan.py`, `tests/support/builders.py`. Changes: `src/devops_cli/roadmap/stage_references.py`, `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage.py`, `tests/roadmap/test_roadmap_stage_plan.py`. - [ ] 1.1 In `tests/roadmap/test_roadmap_stage_plan.py`, assert that reference_files returns every path of a `git grep` answer, with 70 files that hold one name and no cap; that the move derivation gives the old path and the dotted name of a module that a group moves and skips a test module and `conftest.py`; and that check_proposal refuses a probed path that no group changes - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` fails on the base - [ ] 1.2 Add reference_files to `src/devops_cli/roadmap/stage_references.py`, and the move derivation and the references argument of check_proposal to `src/devops_cli/roadmap/stage_change.py`. In `_settle` of `src/devops_cli/roadmap/stage.py`, probe the old path and the dotted name of each moved module after the reply, pass the hits to check_proposal, and probe them again for the groups that a split gives - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` passes ## 2. Refuse an uncovered reference and record an unchanged one 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`. - [ ] 2.1 In `tests/roadmap/test_roadmap_stage_content.py`, assert that check_proposal names a probed path that no group changes and that is not unchanged, that it returns no problem when a group changes that path, that the schema refuses an unchanged reference with no reason, and that the rendered `design.md` holds the path, the kind and the reason of an unchanged reference - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base - [ ] 2.2 Add the reference coverage check to check_proposal in `src/devops_cli/roadmap/stage_change.py`, with its message texts in `src/devops_cli/lang/en/messages.py`, require a reason for an unchanged reference, and write each unchanged reference with its path, its kind and its reason into `_design_file` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes ## 3. Name the references and the verification in the stage prompt Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. - [ ] 3.1 Add a failing test to `tests/roadmap/test_roadmap_stage_prompt_rules.py` that reads the prompt and asserts the quoted target, the logger name, the snapshot file, the two `references` searches, the `! git grep` verification of a direct move, the dotted prefix of a prefix move, and the narrower search when the answer leaves files out - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base - [ ] 3.2 Name the two `references` searches, the three reference kinds, the `! git grep` verification of a direct move with the old dotted name, the old dotted prefix and the refused single-module literal of a prefix move, and the narrower search when the `references` answer leaves files out in `src/devops_cli/ai/tasks/roadmap_stage_change.md` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes ## Workflow follow-up diff --git a/openspec/changes/3394-the-plan-check-refuses-a-placeholder/tasks.md b/openspec/changes/3394-the-plan-check-refuses-a-placeholder/tasks.md index 07644602bf..965a07b8a6 100644 --- a/openspec/changes/3394-the-plan-check-refuses-a-placeholder/tasks.md +++ b/openspec/changes/3394-the-plan-check-refuses-a-placeholder/tasks.md @@ -5,18 +5,18 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `tests/roadmap/test_roadmap_stage_content.py`, `tests/support/builders.py`. Changes: `src/devops_cli/roadmap/stage_change.py`, `tests/roadmap/test_roadmap_stage_content.py`. - [ ] 1.1 In `tests/roadmap/test_roadmap_stage_content.py`, add a case that `content_problems(make_stage_proposal(pull_request_body="placeholder"))` holds a problem naming `pull_request_body` and the placeholder word, a case that `content_problems(make_stage_proposal(what_changes=["placeholder"]))` holds a problem naming `what_changes` and the placeholder word, a case that a `pull_request_body` shorter than `PLAN_FIELD_MIN_CHARS` is refused with the least length, a case that a `what_changes` line shorter than `PLAN_FIELD_MIN_CHARS` is refused with the least length, and a case that a valid body and valid What Changes lines give no problem - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base - [ ] 1.2 In `_plan_texts` of `src/devops_cli/roadmap/stage_change.py`, add `("pull_request_body", proposal.pull_request_body)` to `named` and append one `("what_changes", line)` pair for each line of `proposal.what_changes`, so that the existing loop of `content_problems` applies the length rule and `is_placeholder` to both fields - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes ## 2. State the two checked fields in the plan stage prompt Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.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`, add a test that reads the Texts rule of the prompt and asserts that it names `pull_request_body` and each `what_changes` line - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base - [ ] 2.2 In the Texts rule of `src/devops_cli/ai/tasks/roadmap_stage_change.md`, name `pull_request_body` and each `what_changes` line beside `why`, `existing_tool`, each line of `feasibility`, each decision and each task, with the same least length and the same placeholder rule - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes ## Workflow follow-up diff --git a/openspec/changes/3427-refuse-a-group-verify-that-runs/tasks.md b/openspec/changes/3427-refuse-a-group-verify-that-runs/tasks.md index bdaa54849b..7c38202bed 100644 --- a/openspec/changes/3427-refuse-a-group-verify-that-runs/tasks.md +++ b/openspec/changes/3427-refuse-a-group-verify-that-runs/tasks.md @@ -5,22 +5,22 @@ Reads: `src/devops_cli/roadmap/stage_form.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/roadmap/implement_shell_policy.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_form.py`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/roadmap/stage_form.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_form.py`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. - [ ] 1.1 Add `test_a_verify_command_that_runs_an_unnamed_test_module_is_refused` to `tests/roadmap/test_roadmap_stage_form.py`: a group that changes `src/devops_cli/ai/tasks/roadmap_stage_verify.md` and `tests/roadmap/test_roadmap_stage_verify.py` with `uv run devops ci test tests/roadmap/test_roadmap_stage_task_verification.py` gets one problem that names group 1, the command and the module, and holds the remedy - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` fails on the base - [ ] 1.2 Add the message `stage_problem_verify_test` to `RoadmapMessages` in `src/devops_cli/lang/en/messages.py`, formatted with `group`, `command` and `path`, and ending with the remedy: list the module in `reads`, or give the command of the group's own test. In `src/devops_cli/roadmap/stage_form.py`, add `_verify_test_problems(number, group)`: skip a command whose first word is `NEGATIVE_SEARCH_WORD`, split the other `verify` command into words with `shlex.split` and fall back to `str.split` when it fails, keep the words that `_is_test_module` accepts as `PurePosixPath`, and return one problem for each kept path that is in none of the group's `changes`, `creates` and `reads`. Call it from `form_problems` beside `_verify_problems`. Add cases for `reads`, `changes`, `creates`, two unnamed modules, a command with no test module, and a negative search that names a test module - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` passes - [ ] 1.3 Add the rule to the `verify` paragraph of `src/devops_cli/ai/tasks/roadmap_stage_change.md`: a verify test module is one of the group's own `reads`, `changes` or `creates`. Add `test_the_prompt_says_a_verify_command_runs_a_test_the_group_names` to `tests/roadmap/test_roadmap_stage_prompt_rules.py` and assert the sentence - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes - [ ] 1.4 Add the rule to the module docstring of `src/devops_cli/roadmap/stage_form.py`, and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## 2. Keep the recorded plans and the form tests inside the new rule Reads: `tests/roadmap/test_roadmap_stage_form.py`, `tests/roadmap/test_roadmap_stage_eval_gates.py`, `tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-exchange-of-the/plan.json`. Changes: `tests/roadmap/test_roadmap_stage_form.py`, `tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-exchange-of-the/plan.json`. - [ ] 2.1 Change the `_plan` helper of `tests/roadmap/test_roadmap_stage_form.py` to take its default `verify` from the case's own test module in `changes`, instead of the sample's `tests/test_sample.py`. Where a case gives a `verify` that names a module the case does not change, add that module to the case's `reads` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` passes - [ ] 2.2 Add `tests/github/test_github_app_identity.py` to the `changes` of group 1 in `tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-exchange-of-the/plan.json`, because the `test` task of that group updates the module. Run the golden set replay and make no change to a verdict: a good case that the rule refuses gets its plan corrected - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes with no good plan refused + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` passes with no good plan refused - [ ] 2.3 Run `uv run devops ci test tests/roadmap/test_roadmap_stage_form.py tests/roadmap/test_roadmap_stage_task_verification.py tests/roadmap/test_roadmap_stage_plan.py tests/roadmap/test_roadmap_stage_eval_gates.py tests/roadmap/test_roadmap_stage_prompt_rules.py` on the full change, and correct each case that the new rule refuses - Verification: the five modules pass diff --git a/openspec/changes/3433-refuse-a-plan-group-that-only/tasks.md b/openspec/changes/3433-refuse-a-plan-group-that-only/tasks.md index 8257210021..702dfcee59 100644 --- a/openspec/changes/3433-refuse-a-plan-group-that-only/tasks.md +++ b/openspec/changes/3433-refuse-a-plan-group-that-only/tasks.md @@ -5,22 +5,22 @@ Reads: `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/roadmap/stage_form.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_content.py`, `tests/roadmap/test_roadmap_stage_plan.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 Add cases to `tests/roadmap/test_roadmap_stage_content.py`: an other group whose changes are all under tests and whose implementation names no test function is refused, the same group with `test_conditional_group` in a code span is accepted, the same group with `tests/roadmap/test_roadmap_stage_content.py::test_conditional_group` in a code span is accepted, an other group that also changes `src/devops_cli/roadmap/stage_change.py` is accepted, and the refusal sentence holds the title of the group - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base - [ ] 1.2 Add the refusal sentence to the messages table in `src/devops_cli/lang/en/messages.py`, formatted with the group title. Add a helper in `src/devops_cli/roadmap/stage_change.py` that reads each code span of the implementation and accepts a span whose last segment, after the last `::` when it holds one, starts with `test_`, with optional parentheses. Call it from `content_problems` for each other group whose changes all start with tests - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py tests/roadmap/test_roadmap_stage_plan.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py tests/roadmap/test_roadmap_stage_plan.py` passes - [ ] 1.3 Run `uv run devops roadmap eval stage --replay` on the base and on the branch, and state the counts of the content gate before and after the new rule - - Verification: `uv run devops roadmap eval stage --replay` exits 0 + - Verification: `$ uv run devops roadmap eval stage --replay` exits 0 ## 2. State and prove the rule in the planner prompt Reads: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. Changes: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `tests/roadmap/test_roadmap_stage_prompt_rules.py`. - [ ] 2.1 Add a test to `tests/roadmap/test_roadmap_stage_prompt_rules.py` that loads `src/devops_cli/ai/tasks/roadmap_stage_change.md` and asserts that its text states that a group gives one exact change and names the failing test that it updates in a code span - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` fails on the base - [ ] 2.2 State in `src/devops_cli/ai/tasks/roadmap_stage_change.md` that a group gives one exact change: the planner names the failing test that the change updates in a code span, or it plans no group. State that a group never fixes a test only if it breaks - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes and `uv run devops roadmap eval stage --replay` exits 0 + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_prompt_rules.py` passes and `$ uv run devops roadmap eval stage --replay` exits 0 - [ ] 2.3 The prompt is the planner's instruction, so the rule is written there and in no other document, and run `uv run devops docs generate --sync-readme` - - Verification: `uv run devops ci docs` passes + - Verification: `$ uv run devops ci docs` passes ## Workflow follow-up diff --git a/openspec/changes/3446-the-stage-job-refuses-a-task/tasks.md b/openspec/changes/3446-the-stage-job-refuses-a-task/tasks.md index 872cd248d3..0f55f77d9f 100644 --- a/openspec/changes/3446-the-stage-job-refuses-a-task/tasks.md +++ b/openspec/changes/3446-the-stage-job-refuses-a-task/tasks.md @@ -5,9 +5,9 @@ Reads: `src/devops_cli/roadmap/stage_paths.py`, `src/devops_cli/roadmap/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_stage_content.py`, `openspec/specs/roadmap-stage/spec.md`. Changes: `src/devops_cli/roadmap/stage_paths.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 case that stages a proposal whose group names `tests/roadmap/test_roadmap_stage_eval_cases.py` in a task code span while the group lists it in no field, and asserts that `path_problems` returns one problem that names the group and the path. Add cases for a listed path, a path under `openspec/changes/` and `openspec/specs/`, a folder of a created path, and a missing unlisted path that keeps the missing-path problem - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` fails on the base - [ ] 1.2 In `src/devops_cli/roadmap/stage_paths.py`, add `_SPECS_DIRECTORY: Final[str] = "openspec/specs"` and a helper that says whether a path sits under the change folder or the living spec folder. In `path_problems`, build the set of paths that the group lists, with `_folders_of` over its `creates`. For a path of `_Place.TASK` that the tree holds or that an earlier group creates, report the new message when the path is in neither set and sits under neither write folder. Add the field to `RoadmapMessages` in `src/devops_cli/lang/en/messages.py`, with the group and the path as its placeholders, and report it through `_problem` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_content.py` passes ## Criteria diff --git a/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/.openspec.yaml b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/.openspec.yaml new file mode 100644 index 0000000000..e582ee4a2c --- /dev/null +++ b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-11-07 diff --git a/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/design.md b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/design.md new file mode 100644 index 0000000000..07b322c28b --- /dev/null +++ b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/design.md @@ -0,0 +1,25 @@ +# Design + +## Context + +See proposal.md (#3596). A `Verification:` line holds one or more code spans. The step ran all of them, so a prose span stopped the group. + +## Decisions + +### 1. The mark is `$ ` at the start of the code span + +- **Decision**: A code span that starts with `$ ` is a command. The parser removes the two characters. Any other code span is prose. +- **Rejected**: A label such as `cmd: ` in the span. No document or tool uses it, so it adds a private rule. +- **Rejected**: The first code span of the line. A line with two commands would run only the first, and a prose span in first position would still be refused. +- **Rejected**: A span whose first word is an allowed program. The step would never refuse a command, so a marked command that the step refuses could not stop it. + +### 2. No mark gives no command + +- **Decision**: A line with no marked span gives the group no command. The project keeps no old form (`AGENTS.md`), and the mechanical rewrite of `plan-recheck` adds a marked line to a group with none. +- **Rejected**: Read the first span as a command when no span is marked. It keeps two rules, and a new plan can still have its prose refused. +- **Rejected**: Stop the step on an unmarked line. A merged plan would stop its group until a person edits it. + +### 3. The templates write the mark + +- **Decision**: `stage_task_test`, `stage_task_pass` and `stage_task_documents` write `$ ` before the command, and so does the task that `implement_amend` adds. `FAILS_ON_BASE` reads the text after the last backtick, so the mark does not change it. +- **Rejected**: Leave the templates. A staged plan would give no command to its step. diff --git a/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/proposal.md b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/proposal.md new file mode 100644 index 0000000000..048119b922 --- /dev/null +++ b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/proposal.md @@ -0,0 +1,43 @@ +# Proposal + +## Why + +The implement step reads every code span of a `Verification:` line as a command (#3596). `_task_of` in `src/devops_cli/roadmap/step_files.py` collects them all. A code span that is prose, such as `tagged_image` in the plan of #2610, is then refused as a program that is not in the allowed list, and the step stops the group. #3595 removed the 13 refused spans of the active plans by rewriting those plans. That fix keeps the cause: the next plan with a prose code span stops its step again. + +## What Changes + +- `_task_of` reads as a command only a code span of a `Verification:` line that starts with `$ `. It removes the mark, and it keeps every other code span as prose. The mark is the shell prompt that documents use for a command line, so a reader needs no new rule. The docstring of `_task_of` states the rule. +- A line with no marked span gives the group no command. The project keeps no old form before `1.0.0`, so there is no fallback to the first span or to the allowed program list. +- The stage templates `stage_task_test`, `stage_task_pass` and `stage_task_documents` write the mark, and so does the task that the plan amendment adds (`implement_amend`). +- The active plans, the test fixtures and the snapshots that hold a `Verification:` line are written again with the mark. The rule for plans in `openspec/config.yaml` and the text of the `plan-recheck` document name the mark. +- `devops roadmap plan-recheck` counts a folder as unverified when it has no marked command, and its mechanical rewrite adds a marked line to a group with none. A merged plan in the old form gets that line from the rewrite. +- The change alters what the implement step observes, so it carries a delta for `roadmap-implement-step` and `roadmap-stage`. +- The change fits one pull request. + +## Capabilities + +### New Capabilities + +None. + +### Modified Capabilities + +- `roadmap-implement-step`: the verification commands of a group are the marked code spans. +- `roadmap-stage`: the stage writes the mark. + +## Impact + +- Code: `src/devops_cli/roadmap/step_files.py`, `src/devops_cli/roadmap/implement_amend.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/roadmap/plan_rewrite.py`, `src/devops_cli/roadmap/plan_recheck.py`. +- Tests: `tests/roadmap/test_roadmap_step_files.py` (new) and the tests, snapshots and support files that write a `Verification:` line. +- Plans: the `Verification:` lines of the active `tasks.md` files get the mark. Their owners rebase onto this change. A plan on a branch that does not hold the mark has no command until `plan-recheck` rewrites it or its owner adds the mark. +- Documents: `openspec/config.yaml` and `docs/roadmap/plan-recheck.md`. + +## Feasibility + +- Command output at `origin/main` confirms the premise. `_task_of` takes `_code_spans(line)` of each `Verification:` line without a filter, and `verification_problem("tagged_image")` returns the reason that the program is not in the allowed list. #3595 (merged as #3809) rewrote the plans so that no span is refused, and it added the invariant test; it did not change `_task_of`. #3482 changed the plan reader only. So neither covers this issue. +- `markdown-it-py`, already a dependency, gives the code spans of the line. No tool reads a `Verification:` line or tells a marked span from prose. +- The plan reader (`plan_read._task`) reads `task.verification[0]`, and `_verification_suffixes` reads the text after the second backtick, so both work with the mark. `FAILS_ON_BASE` reads the text after the last backtick of the template, which the mark does not change. + +## Existing Tool Considered + +No open, maintained tool or library covers the need: the rule is the plan format of this repository. The change builds about 10 lines in `_task_of`, plus the template and fixture edits. Cost: about 40,000 tokens to build (most of it the fixture edits), about 2,000 tokens a year to keep, and about 3 hours. It deletes the read of unmarked spans as commands. diff --git a/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/specs/roadmap-implement-step/spec.md b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/specs/roadmap-implement-step/spec.md new file mode 100644 index 0000000000..5c82727b7c --- /dev/null +++ b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/specs/roadmap-implement-step/spec.md @@ -0,0 +1,20 @@ +## MODIFIED Requirements + +### Requirement: The verification commands of a group are the code spans of its Verification lines +The verification commands of a group SHALL be the code spans of the `Verification:` lines of its tasks that start with `$ `, with the mark removed, each one once, in the order of the file. Every other code span of such a line SHALL be prose. The step SHALL run each command as a list of words, never through a shell, and SHALL stop with the reason when the first word is not a program of the verification list or the `!` of a negative search in the fixed shape. + +#### Scenario: Two lines name one command +- **WHEN** two tasks of the group name `$ uv run devops ci test tests/test_sample.py` and the second names `$ uv run devops docs check` as well +- **THEN** the step runs `uv run devops ci test tests/test_sample.py` once and `uv run devops docs check` once, in that order + +#### Scenario: A prose code span beside a marked command +- **WHEN** a task holds a `Verification:` line with the code span `tagged_image` and the code span `$ pytest tests/roadmap/test_step_files.py` +- **THEN** the commands of the group are `pytest tests/roadmap/test_step_files.py` only + +#### Scenario: A line with no mark +- **WHEN** a task holds a `Verification:` line with the code span `pytest tests/roadmap/test_step_files.py` and no mark +- **THEN** the group has no command from that line + +#### Scenario: A marked command that the step refuses +- **WHEN** a task holds the code span `$ nosuchprogram --version` on its `Verification:` line +- **THEN** the step stops with a reason that names `nosuchprogram` as a program that is not in the allowed list diff --git a/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/specs/roadmap-stage/spec.md b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/specs/roadmap-stage/spec.md new file mode 100644 index 0000000000..e0f3eb8327 --- /dev/null +++ b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/specs/roadmap-stage/spec.md @@ -0,0 +1,8 @@ +## ADDED Requirements + +### Requirement: The stage writes the mark before each verification command +The stage job SHALL write the code span of each `Verification:` line it writes as `$ ` followed by the command, for a task that tests, a task that implements and a task that documents, so that the implement step reads the command. + +#### Scenario: A staged group +- **WHEN** the stage job writes the tasks of a `behavior` group with the `verify` command `uv run devops ci test tests/test_sample.py` +- **THEN** the `Verification:` line of each of its first two tasks holds the code span `$ uv run devops ci test tests/test_sample.py`, and `parse_task_groups` reads the command without the mark diff --git a/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/tasks.md b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/tasks.md new file mode 100644 index 0000000000..44ca560b5c --- /dev/null +++ b/openspec/changes/archive/2026-11-07-3596-read-only-the-marked-code-spans/tasks.md @@ -0,0 +1,24 @@ +# Tasks + +## 1. Read only the marked code spans + +Kind: behavior. Reads: `src/devops_cli/roadmap/step_files.py`, `src/devops_cli/roadmap/implement_amend.py`, `src/devops_cli/lang/en/messages.py`. Changes: `tests/roadmap/test_roadmap_step_files.py` (new), `src/devops_cli/roadmap/step_files.py`, `src/devops_cli/roadmap/implement_amend.py`, `src/devops_cli/lang/en/messages.py`. + +- [x] 1.1 In `tests/roadmap/test_roadmap_step_files.py`, test that a prose span beside a marked command gives only the command, that the mark is removed before the program is read, that a marked command of an unknown program is refused with its reason, that an unmarked line gives no command, that the stage templates write the mark, and that the docstring of `_task_of` states the rule + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_step_files.py` fails on the base +- [x] 1.2 In `_task_of`, read as commands only the code spans that start with `$ `, and write the mark in the three stage templates and in the task that the plan amendment adds + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_step_files.py` passes + +## 2. Write the active plans, tests and documents with the mark + +Reads: `openspec/config.yaml`, `docs/roadmap/plan-recheck.md`. Changes: `openspec/config.yaml`, `docs/roadmap/plan-recheck.md`, the `tasks.md` files of the active changes, `tests/invariants/test_change_folders.py`, `tests/roadmap/test_roadmap_plan_rewrite.py`. + +- [x] 2.1 Add the mark to each `Verification:` command of the active plans, the test fixtures and the snapshots, and name the mark in the plan rule of `openspec/config.yaml` and in `docs/roadmap/plan-recheck.md` + - Verification: `$ uv run devops ci test tests/invariants/test_change_folders.py` passes + +## 3. Archive the change + +Reads: nothing. Changes: `openspec/changes/3596-read-only-the-marked-code-spans` (moved by the archive command). + +- [x] 3.1 Archive the change + - Verification: `$ uv run devops openspec check` diff --git a/openspec/config.yaml b/openspec/config.yaml index 56dc035290..b52100e21b 100644 --- a/openspec/config.yaml +++ b/openspec/config.yaml @@ -30,7 +30,7 @@ rules: - >- Write the tasks of the one pull request in "## . " groups. The pull request that closes the issue leaves no task unticked. - >- - Give each group a kind. A `behavior` group adds or changes what the code does: order its tasks as failing test, then implementation, and name each task's verification command on a nested line under the task that starts with `Verification:` and holds the command in a code span (the implement step reads and runs it), such as `uv run devops ci test tests/roadmap/test_.py`, where the folder under `tests/` mirrors the package of the code under `src/devops_cli/`. Every other group (documents, manifests, workflows, a deletion or a refactor that keeps behavior, test-only edits, data) has no test: it gives its work with a verification command that can run again, such as `uv run devops ci docs`, `uv run devops openspec check` or `! git grep -n src/ tests/` (a command that exits 0 when it finds nothing), or the steps of a repeatable manual check. A documentation task comes last, in a group that changes a document. A group that names no verification command is ticked by the job when its exit checks pass. + Give each group a kind. A `behavior` group adds or changes what the code does: order its tasks as failing test, then implementation, and name each task's verification command on a nested line under the task that starts with `Verification:` and holds the command in one code span, with `$ ` before the command (the implement step runs only the code spans that start with `$ `, and reads every other code span of the line as prose), such as `uv run devops ci test tests/roadmap/test_.py`, where the folder under `tests/` mirrors the package of the code under `src/devops_cli/`. Every other group (documents, manifests, workflows, a deletion or a refactor that keeps behavior, test-only edits, data) has no test: it gives its work with a verification command that can run again, such as `uv run devops ci docs`, `uv run devops openspec check` or `! git grep -n src/ tests/` (a command that exits 0 when it finds nothing), or the steps of a repeatable manual check. A documentation task comes last, in a group that changes a document. A group that names no verification command is ticked by the job when its exit checks pass. - >- Delete obsolete code and its tests in the group that replaces them. - >- diff --git a/openspec/specs/roadmap-implement-step/spec.md b/openspec/specs/roadmap-implement-step/spec.md index 6211cae542..163e5dc7e6 100644 --- a/openspec/specs/roadmap-implement-step/spec.md +++ b/openspec/specs/roadmap-implement-step/spec.md @@ -79,12 +79,24 @@ The first exit check SHALL put `HEAD` back at the commit where the step started, - **THEN** the step reports stopped with the class `head_moved`, and the reason names the reset command, its exit status and the output of git ### Requirement: The verification commands of a group are the code spans of its Verification lines -The verification commands of a group SHALL be the code spans of the `Verification:` lines of its tasks, each one once, in the order of the file. The step SHALL run each one in the checkout as a list of words, never through a shell. It SHALL refuse to run one whose first word is not a program of the verification list (the shell allowlist, `openspec` and `devops`) and is not the `!` of a negative search in the fixed shape. +The verification commands of a group SHALL be the code spans of the `Verification:` lines of its tasks that start with `$ `, with the mark removed, each one once, in the order of the file. Every other code span of such a line SHALL be prose. The step SHALL run each command as a list of words, never through a shell, and SHALL stop with the reason when the first word is not a program of the verification list or the `!` of a negative search in the fixed shape. #### Scenario: Two lines name one command -- **WHEN** two tasks of the group name `uv run devops ci test tests/test_sample.py` and the second names `uv run devops docs check` as well +- **WHEN** two tasks of the group name `$ uv run devops ci test tests/test_sample.py` and the second names `$ uv run devops docs check` as well - **THEN** the step runs `uv run devops ci test tests/test_sample.py` once and `uv run devops docs check` once, in that order +#### Scenario: A prose code span beside a marked command +- **WHEN** a task holds a `Verification:` line with the code span `tagged_image` and the code span `$ pytest tests/roadmap/test_step_files.py` +- **THEN** the commands of the group are `pytest tests/roadmap/test_step_files.py` only + +#### Scenario: A line with no mark +- **WHEN** a task holds a `Verification:` line with the code span `pytest tests/roadmap/test_step_files.py` and no mark +- **THEN** the group has no command from that line + +#### Scenario: A marked command that the step refuses +- **WHEN** a task holds the code span `$ nosuchprogram --version` on its `Verification:` line +- **THEN** the step stops with a reason that names `nosuchprogram` as a program that is not in the allowed list + ### Requirement: A step refuses an input that does not fit the window The step SHALL count the tokens of its instructions and its user message before the first model request. When the count is more than the `context_window` of `ai.tasks.implement` minus `CONST_ROADMAP_IMPLEMENT_TURN_RESERVE_TOKENS`, the step SHALL raise `RoadmapImplementError`, SHALL name the measure and the limit in its message, and SHALL make no model request and change nothing in the checkout. diff --git a/openspec/specs/roadmap-stage/spec.md b/openspec/specs/roadmap-stage/spec.md index d883a899d5..6769be9d0c 100644 --- a/openspec/specs/roadmap-stage/spec.md +++ b/openspec/specs/roadmap-stage/spec.md @@ -2544,3 +2544,10 @@ The context window of the task `analysis` in `k8s/devops/configmap.example.yaml` #### Scenario: The example window - **WHEN** a test reads the window of the task `analysis` in the example ConfigMap - **THEN** the point where the run ends its tools is at least the tokens of the first request plus the tokens of the least number of long tool answers, and the window of 65536 tokens is below that point + +### Requirement: The stage writes the mark before each verification command +The stage job SHALL write the code span of each `Verification:` line it writes as `$ ` followed by the command, for a task that tests, a task that implements and a task that documents, so that the implement step reads the command. + +#### Scenario: A staged group +- **WHEN** the stage job writes the tasks of a `behavior` group with the `verify` command `uv run devops ci test tests/test_sample.py` +- **THEN** the `Verification:` line of each of its first two tasks holds the code span `$ uv run devops ci test tests/test_sample.py`, and `parse_task_groups` reads the command without the mark diff --git a/src/devops_cli/lang/en/messages.py b/src/devops_cli/lang/en/messages.py index 3b183ed346..a057b7f139 100644 --- a/src/devops_cli/lang/en/messages.py +++ b/src/devops_cli/lang/en/messages.py @@ -3683,10 +3683,11 @@ class RoadmapMessages: ) # The implement step reads a verification command from the line `Verification:` under a task, # and from no other text (`step_files`). So a task is its work, a line break, and that line. - stage_task_test: str = "{test}\n - Verification: `{verify}` fails on the base" - stage_task_pass: str = "{work}\n - Verification: `{verify}` passes" + # The command is the code span that starts with `$ `. The step reads no other code span as one. + stage_task_test: str = "{test}\n - Verification: `$ {verify}` fails on the base" + stage_task_pass: str = "{work}\n - Verification: `$ {verify}` passes" stage_task_process: str = "{work}, and run this check by hand: {process}" - stage_task_documents: str = "{work}\n - Verification: `uv run devops ci docs` passes" + stage_task_documents: str = "{work}\n - Verification: `$ uv run devops ci docs` passes" # The step that regenerates the documents. A group that changes a command, an option or a # message ends its documents task with it. The plan reader splits the task at this text. stage_task_regenerate: str = ", and run `{command}`" @@ -3847,7 +3848,9 @@ class RoadmapMessages: plan_recheck_live: str = ( "{live} folders count. {cleanup} folders of closed issues are left out of every count." ) - plan_recheck_unverified: str = "{count} of {live} folders have no `Verification:` line." + plan_recheck_unverified: str = ( + "{count} of {live} folders have no marked `Verification:` command." + ) plan_recheck_unreadable: str = "{count} of {live} folders fail the plan reader." # The refusals of each gate and the comparison with a branch (#3498). plan_recheck_case: str = "case to review" diff --git a/src/devops_cli/roadmap/implement/implement_amend.py b/src/devops_cli/roadmap/implement/implement_amend.py index 07632d1b95..4a64175f92 100644 --- a/src/devops_cli/roadmap/implement/implement_amend.py +++ b/src/devops_cli/roadmap/implement/implement_amend.py @@ -19,6 +19,7 @@ from devops_cli.roadmap.stage.stage_form import is_valid_verify from devops_cli.roadmap.stage.stage_paths import StagedTree from devops_cli.roadmap.step_files import ( + COMMAND_MARK, MARKDOWN, TaskGroup, parse_task_groups, @@ -210,7 +211,7 @@ def _judge_task(request: PlanRequest, target: TaskGroup) -> tuple[str, Amendment task_num = f"{target.number}.{len(target.tasks) + 1}" task_lines = [f"- [ ] {task_num} {request.new}"] if request.verify: - task_lines.append(f" - Verification: `{request.verify}`") + task_lines.append(f" - Verification: `{COMMAND_MARK}{request.verify}`") task_block = "\n".join(task_lines) new_text = target.text.rstrip() + f"\n{task_block}\n\n" amendment = Amendment( diff --git a/src/devops_cli/roadmap/plan_recheck.py b/src/devops_cli/roadmap/plan_recheck.py index e451140633..fef75ecda4 100644 --- a/src/devops_cli/roadmap/plan_recheck.py +++ b/src/devops_cli/roadmap/plan_recheck.py @@ -172,7 +172,7 @@ def count(self, result: PlanResult) -> int: @property def unverified(self) -> int: - """How many live folders have no `Verification:` line.""" + """How many live folders have no marked `Verification:` command.""" return sum(1 for record in self.live if not record.verified) @property diff --git a/src/devops_cli/roadmap/plan_rewrite.py b/src/devops_cli/roadmap/plan_rewrite.py index 03990d2fec..34f956fb6a 100644 --- a/src/devops_cli/roadmap/plan_rewrite.py +++ b/src/devops_cli/roadmap/plan_rewrite.py @@ -3,8 +3,8 @@ A plan that the stage job wrote before a gate existed can fail that gate today. Three edits fix most of these plans, and each one is mechanical: -- A group with no `Verification:` line gets one under its first task. The command comes from the - plan: `uv run devops ci test` with the test files of the `Changes:` line, or `uv run devops ci +- A group with no marked `Verification:` command (a code span that starts with `$ `) gets a + line under its first task. The command comes from the plan: `uv run devops ci test` with the test files of the `Changes:` line, or `uv run devops ci docs` when the group changes only documents. A command that the step refuses is not written, and a group that names neither gets no line. - A path in a task text that the tree lacks, and that no group lists or creates, is a sample path diff --git a/src/devops_cli/roadmap/step_files.py b/src/devops_cli/roadmap/step_files.py index 312d8b41d6..374bdeb145 100644 --- a/src/devops_cli/roadmap/step_files.py +++ b/src/devops_cli/roadmap/step_files.py @@ -27,6 +27,9 @@ MARKDOWN = MarkdownIt("commonmark") CHECKBOXES = ("[ ]", "[x]", "[X]") _VERIFICATION = "Verification:" +# A code span of a `Verification:` line is a command only when it starts with this mark, as a +# shell prompt marks a command in a document (#3596). Every other code span is prose. +COMMAND_MARK = "$ " # The suffix of the `Verification:` line of a test that must fail on the base commit (the stage # template), and the `Kind:` line that a plan may write for a group (#3042). FAILS_ON_BASE = MESSAGES.roadmap.stage_task_test.rsplit("`", 1)[1].strip() @@ -101,12 +104,19 @@ def _list_items(tokens: Sequence[Token]) -> Iterator[Sequence[Token]]: def _task_of(item: Sequence[Token]) -> GroupTask | None: - """The task a list item is, or None when its text starts with no checkbox.""" + """The task a list item is, or None when its text starts with no checkbox. A code span of a + `Verification:` line is a command only when it starts with `$ `, and the task keeps the command + without the mark. Every other code span of the line is prose and gives no command (#3596).""" lines = [token for token in item if token.type == "inline"] if not lines or lines[0].content[:3] not in CHECKBOXES: return None checks = [line for line in lines[1:] if line.content.startswith(_VERIFICATION)] - verification = tuple(command for line in checks for command in _code_spans(line)) + verification = tuple( + span.removeprefix(COMMAND_MARK) + for line in checks + for span in _code_spans(line) + if span.startswith(COMMAND_MARK) + ) return GroupTask( text=lines[0].content, ticked=lines[0].content[:3] != CHECKBOXES[0], diff --git a/tests/invariants/test_change_folders.py b/tests/invariants/test_change_folders.py index bdf98c62f2..0b7af11900 100644 --- a/tests/invariants/test_change_folders.py +++ b/tests/invariants/test_change_folders.py @@ -34,7 +34,7 @@ from devops_cli.roadmap.implement.implement_test_names import defined_tests from devops_cli.roadmap.plan_read import PlanReadError, recorded_tests, weakened_checks from devops_cli.roadmap.stage.stage_change import GroupKind, render_change -from devops_cli.roadmap.step_files import parse_task_groups +from devops_cli.roadmap.step_files import COMMAND_MARK, parse_task_groups from tests.support.builders import make_stage_proposal from tests.support.paths import REPO_ROOT @@ -185,7 +185,7 @@ def test_every_active_change_folder_is_a_plan() -> None: def _line_of(lines: list[str], task_line: int, command: str) -> int: """The one-based line of the `Verification:` line that holds the code span `command` in the task that starts at the zero-based `task_line`. It is the line of the task when none holds it.""" - span = f"`{command}`" + span = f"`{COMMAND_MARK}{command}`" for number in range(max(task_line, 0), len(lines)): stripped = lines[number].lstrip() if stripped.startswith(_VERIFICATION_LINE) and span in stripped: @@ -478,7 +478,7 @@ def _plan(tmp_path: Path, name: str, verification: str) -> Path: def test_a_verification_command_that_the_step_accepts_is_no_problem(tmp_path: Path) -> None: changes = _plan( - tmp_path, "1900-widget-export", "`uv run devops ci test tests/test_widget.py` passes" + tmp_path, "1900-widget-export", "`$ uv run devops ci test tests/test_widget.py` passes" ) assert verification_problems(changes) == [] @@ -488,7 +488,7 @@ def test_a_negative_search_with_word_boundaries_is_reported_with_path_line_and_c tmp_path: Path, ) -> None: """The grammar of the negative search has no `-E`, so the step refuses the line.""" - changes = _plan(tmp_path, "1900-widget-export", r"`! git grep -n -E '\bfoo\b' src/`") + changes = _plan(tmp_path, "1900-widget-export", r"`$ ! git grep -n -E '\bfoo\b' src/`") [problem] = verification_problems(changes) @@ -497,8 +497,8 @@ def test_a_negative_search_with_word_boundaries_is_reported_with_path_line_and_c assert "is refused: the option `-E` is not allowed" in problem -def test_a_prose_code_span_in_a_verification_line_is_reported(tmp_path: Path) -> None: - changes = _plan(tmp_path, "1900-widget-export", "`the log is empty`") +def test_a_marked_span_with_a_program_that_is_not_allowed_is_reported(tmp_path: Path) -> None: + changes = _plan(tmp_path, "1900-widget-export", "`$ the log is empty`") [problem] = verification_problems(changes) @@ -509,7 +509,7 @@ def test_each_span_of_a_verification_line_is_read_not_only_the_first(tmp_path: P changes = _plan( tmp_path, "1900-widget-export", - "`uv run devops ci test tests/test_widget.py` passes, and `test -z x` holds", + "`$ uv run devops ci test tests/test_widget.py` passes, and `$ test -z x` holds", ) [problem] = verification_problems(changes) @@ -520,8 +520,8 @@ def test_each_span_of_a_verification_line_is_read_not_only_the_first(tmp_path: P def test_the_line_of_a_problem_is_the_verification_line_of_its_own_task(tmp_path: Path) -> None: tasks = ( "## 1. Export\n\n" - "- [ ] 1.1 Write the file\n - Verification: `uv run devops ci docs` passes\n" - "- [ ] 1.2 Document it\n - Verification: `docker buildx` passes\n" + "- [ ] 1.1 Write the file\n - Verification: `$ uv run devops ci docs` passes\n" + "- [ ] 1.2 Document it\n - Verification: `$ docker buildx` passes\n" ) changes = _folder(tmp_path, tasks=tasks).parent @@ -531,19 +531,20 @@ def test_the_line_of_a_problem_is_the_verification_line_of_its_own_task(tmp_path def test_a_plan_under_the_archive_directory_is_not_read(tmp_path: Path) -> None: - changes = _plan(tmp_path, "1900-widget-export", "`uv run devops ci docs` passes") + changes = _plan(tmp_path, "1900-widget-export", "`$ uv run devops ci docs` passes") archived = changes / ARCHIVE_DIR_NAME / "2026-11-01-1901-old-plan" archived.mkdir(parents=True) (archived / "tasks.md").write_text( - "## 1. Old\n\n- [x] 1.1 Done\n - Verification: `docker buildx` passes\n", encoding="utf-8" + "## 1. Old\n\n- [x] 1.1 Done\n - Verification: `$ docker buildx` passes\n", + encoding="utf-8", ) assert verification_problems(changes) == [] def test_every_active_plan_is_read(tmp_path: Path) -> None: - _plan(tmp_path, "1900-widget-export", "`docker buildx` passes") - changes = _plan(tmp_path, "1901-widget-import", "`test -d src` passes") + _plan(tmp_path, "1900-widget-export", "`$ docker buildx` passes") + changes = _plan(tmp_path, "1901-widget-import", "`$ test -d src` passes") assert [problem.split(":")[0] for problem in verification_problems(changes)] == [ "1900-widget-export/tasks.md", diff --git a/tests/roadmap/implement/__snapshots__/test_roadmap_implement_step.ambr b/tests/roadmap/implement/__snapshots__/test_roadmap_implement_step.ambr index 7fc28849ce..6f69f478a7 100644 --- a/tests/roadmap/implement/__snapshots__/test_roadmap_implement_step.ambr +++ b/tests/roadmap/implement/__snapshots__/test_roadmap_implement_step.ambr @@ -30,14 +30,14 @@ ## 1. The first group - [ ] Add the failing test `tests/test_sample.py` for `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` + - Verification: `$ uv run devops ci test tests/test_sample.py` - [ ] Add `shout` to `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` and `uv run devops docs check` + - Verification: `$ uv run devops ci test tests/test_sample.py` and `$ uv run devops docs check` ## 2. The second group - [x] Document the function in `docs/SAMPLE.md` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Workflow follow-up @@ -48,9 +48,9 @@ ## 1. The first group - [ ] Add the failing test `tests/test_sample.py` for `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` + - Verification: `$ uv run devops ci test tests/test_sample.py` - [ ] Add `shout` to `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` and `uv run devops docs check` + - Verification: `$ uv run devops ci test tests/test_sample.py` and `$ uv run devops docs check` # The tasks file diff --git a/tests/roadmap/implement/test_roadmap_implement_amend.py b/tests/roadmap/implement/test_roadmap_implement_amend.py index 090232ee47..a5910752fc 100644 --- a/tests/roadmap/implement/test_roadmap_implement_amend.py +++ b/tests/roadmap/implement/test_roadmap_implement_amend.py @@ -21,7 +21,7 @@ Reads: `src/devops_cli/sample.py`. Changes: `tests/commands/test_sample.py`, `src/devops_cli/new_file.py` (new). - [ ] 1.1 In `tests/commands/test_sample.py`, write tests. Verify that `uv run pytest tests/commands/test_sample.py` passes - - Verification: `uv run pytest tests/commands/test_sample.py` + - Verification: `$ uv run pytest tests/commands/test_sample.py` - [ ] 1.2 Implement the change ## 2. Second group @@ -29,9 +29,9 @@ Reads: `src/devops_cli/sample.py`. Changes: `src/devops_cli/sample.py`. - [ ] 2.1 First task of group 2 - - Verification: `uv run devops ci test tests/roadmap/test_sample.py` + - Verification: `$ uv run devops ci test tests/roadmap/test_sample.py` - [ ] 2.2 Second task of group 2 - - Verification: `uv run devops ci test tests/roadmap/test_sample.py` + - Verification: `$ uv run devops ci test tests/roadmap/test_sample.py` ## Criteria @@ -50,7 +50,7 @@ Reads: `src/devops_cli/sample.py`. Changes: `tests/roadmap/test_sample.py`. - [x] 1.1 In `tests/roadmap/test_sample.py`, write tests - - Verification: `uv run devops ci test tests/roadmap/test_sample.py` + - Verification: `$ uv run devops ci test tests/roadmap/test_sample.py` ## Workflow follow-up @@ -165,7 +165,7 @@ def test_judge_applies_path_request_for_tracked_file_with_same_name() -> None: assert "Changes: `tests/roadmap/test_sample.py`" in outcome.tasks_md assert "In `tests/roadmap/test_sample.py`" in outcome.tasks_md assert "Verify that `uv run pytest tests/roadmap/test_sample.py` passes" in outcome.tasks_md - assert "Verification: `uv run pytest tests/roadmap/test_sample.py`" in outcome.tasks_md + assert "Verification: `$ uv run pytest tests/roadmap/test_sample.py`" in outcome.tasks_md # Group 2 should be unchanged assert "## 2. Second group" in outcome.tasks_md # Criteria should keep the old path untouched @@ -314,7 +314,9 @@ def test_judge_applies_task_request_as_new_unticked_task() -> None: outcome = judge(request, SAMPLE_TASKS, tree) assert isinstance(outcome, Applied) assert "- [ ] 2.3 Third task of group 2" in outcome.tasks_md - assert "Verification: `uv run devops ci test tests/roadmap/test_sample.py`" in outcome.tasks_md + assert ( + "Verification: `$ uv run devops ci test tests/roadmap/test_sample.py`" in outcome.tasks_md + ) assert "- [ ] 2.1 First task of group 2" in outcome.tasks_md assert "- [ ] 2.2 Second task of group 2" in outcome.tasks_md diff --git a/tests/roadmap/implement/test_roadmap_implement_amend_job.py b/tests/roadmap/implement/test_roadmap_implement_amend_job.py index 607363ccb0..a464de687b 100644 --- a/tests/roadmap/implement/test_roadmap_implement_amend_job.py +++ b/tests/roadmap/implement/test_roadmap_implement_amend_job.py @@ -26,14 +26,14 @@ Reads: `CONTEXT.md`. Changes: `src/devops_cli/shout.py` (new). - [ ] 1.1 Add `src/devops_cli/shout.py` - - Verification: `uv run devops ci test tests/commands/test_shout.py` + - Verification: `$ uv run devops ci test tests/commands/test_shout.py` ## 2. The second group Reads: `CONTEXT.md`. Changes: `CONTEXT.md`. - [ ] 2.1 Document the function in `CONTEXT.md` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` """ TASKS_PATH = f"{CHANGE_DIR}/tasks.md" @@ -205,7 +205,7 @@ def test_path_request_whose_old_is_only_in_criteria_changes_nothing( Reads: `CONTEXT.md`. Changes: `src/devops_cli/shout.py` (new). - [ ] 1.1 Add `src/devops_cli/shout.py` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Criteria diff --git a/tests/roadmap/implement/test_roadmap_implement_job.py b/tests/roadmap/implement/test_roadmap_implement_job.py index 3680caed58..eaa1b1df76 100644 --- a/tests/roadmap/implement/test_roadmap_implement_job.py +++ b/tests/roadmap/implement/test_roadmap_implement_job.py @@ -1489,18 +1489,18 @@ def test_the_pr_comment_shows_the_fail_to_pass_result_of_each_behavior_group( Reads: `CONTEXT.md`. Changes: `tests/test_shout.py` (new), `src/devops_cli/shout.py` (new). - [ ] 1.1 Add the failing test `tests/test_shout.py` for `src/devops_cli/shout.py` - - Verification: `uv run devops ci test tests/test_shout.py` fails on the base + - Verification: `$ uv run devops ci test tests/test_shout.py` fails on the base - [ ] 1.2 Add `shout` to `src/devops_cli/shout.py` - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 2. The second group Reads: `CONTEXT.md`. Changes: `tests/test_whisper.py` (new), `src/devops_cli/whisper.py` (new). - [ ] 2.1 Add the failing test `tests/test_whisper.py` for `src/devops_cli/whisper.py` - - Verification: `uv run devops ci test tests/test_whisper.py` fails on the base + - Verification: `$ uv run devops ci test tests/test_whisper.py` fails on the base - [ ] 2.2 Add `whisper` to `src/devops_cli/whisper.py` - - Verification: `uv run devops ci test tests/test_whisper.py` + - Verification: `$ uv run devops ci test tests/test_whisper.py` ## Criteria @@ -1578,22 +1578,22 @@ def _guard_tasks(name: str, *, behavior: bool) -> str: "Reads: `CONTEXT.md`. Changes: `tests/test_shout.py` (new), " "`src/devops_cli/shout.py` (new).\n\n" "- [ ] 1.1 Add the failing test `tests/test_shout.py` for `src/devops_cli/shout.py`\n" - " - Verification: `uv run devops ci test tests/test_shout.py` fails on the base\n" + " - Verification: `$ uv run devops ci test tests/test_shout.py` fails on the base\n" f"- [ ] 1.2 Add the guard `{name}` to `src/devops_cli/shout.py`\n" - " - Verification: `uv run devops ci test tests/test_shout.py`\n" + " - Verification: `$ uv run devops ci test tests/test_shout.py`\n" ) else: first = ( "Reads: `CONTEXT.md`. Changes: `src/devops_cli/shout.py` (new), `tests/test_shout.py` (new).\n\n" f"- [ ] 1.1 Add the guard `{name}` to `src/devops_cli/shout.py`\n" - " - Verification: `uv run devops ci test tests/test_shout.py`\n" + " - Verification: `$ uv run devops ci test tests/test_shout.py`\n" ) return ( f"# Tasks\n\n## 1. The first group\n\n{first}\n" "## 2. The second group\n\n" "Reads: `CONTEXT.md`. Changes: `CONTEXT.md`.\n\n" "- [ ] 2.1 Document the function in `CONTEXT.md`\n" - " - Verification: `uv run devops docs check`\n\n" + " - Verification: `$ uv run devops docs check`\n\n" "## Criteria\n\n- Group 1: The job keeps every comment.\n" ) diff --git a/tests/roadmap/implement/test_roadmap_implement_negative_search.py b/tests/roadmap/implement/test_roadmap_implement_negative_search.py index 6408d0a974..6bf6801f3d 100644 --- a/tests/roadmap/implement/test_roadmap_implement_negative_search.py +++ b/tests/roadmap/implement/test_roadmap_implement_negative_search.py @@ -268,7 +268,7 @@ def test_the_stage_prompt_gives_the_options_and_the_signs_that_the_step_reads() def test_a_negative_search_in_a_verification_line_is_a_command_of_the_group_and_the_step_runs_it( checkout: Path, programs: ProcessFake ) -> None: - tasks = f"## 1. Remove it\n\n- [ ] Remove `old_name`\n - Verification: `{GONE}`\n" + tasks = f"## 1. Remove it\n\n- [ ] Remove `old_name`\n - Verification: `$ {GONE}`\n" (group,) = parse_task_groups(tasks) diff --git a/tests/roadmap/implement/test_roadmap_implement_plan_reason.py b/tests/roadmap/implement/test_roadmap_implement_plan_reason.py index 89b54d15e3..6804163bbc 100644 --- a/tests/roadmap/implement/test_roadmap_implement_plan_reason.py +++ b/tests/roadmap/implement/test_roadmap_implement_plan_reason.py @@ -82,7 +82,7 @@ def test_a_planned_item_with_a_refused_merged_plan_leaves_the_queue_and_explain_ # and it has no `Verification:` line, so the plan reader refuses it. NO_WAY_FORWARD_TASKS = PLACEHOLDER_TASKS.replace("1.1 x", "1.1 Add `src/devops_cli/shout.py`") NO_WAY_FORWARD_TASKS = NO_WAY_FORWARD_TASKS.replace(", `tests/test_shout.py` (new)", "").replace( - "\n - Verification: `uv run devops ci test tests/test_shout.py`", "" + "\n - Verification: `$ uv run devops ci test tests/test_shout.py`", "" ) diff --git a/tests/roadmap/implement/test_roadmap_implement_resplit.py b/tests/roadmap/implement/test_roadmap_implement_resplit.py index bdd713bdcd..701408df33 100644 --- a/tests/roadmap/implement/test_roadmap_implement_resplit.py +++ b/tests/roadmap/implement/test_roadmap_implement_resplit.py @@ -52,21 +52,21 @@ Reads: `CONTEXT.md`. Changes: `src/devops_cli/shout.py` (new). - [ ] 1.1 First task - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 2. The second group Reads: `src/devops_cli/heavy_0.py`, `src/devops_cli/heavy_1.py`, `src/devops_cli/heavy_2.py`, `src/devops_cli/heavy_3.py`, `src/devops_cli/heavy_4.py`, `src/devops_cli/heavy_5.py`. Changes: `src/devops_cli/shout.py`. - [ ] 2.1 Heavy task reading `src/devops_cli/heavy_0.py`, `src/devops_cli/heavy_1.py`, `src/devops_cli/heavy_2.py`, `src/devops_cli/heavy_3.py`, `src/devops_cli/heavy_4.py`, `src/devops_cli/heavy_5.py` - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 3. The third group Reads: `src/devops_cli/shout.py`. Changes: `CONTEXT.md`. - [ ] 3.1 Document the function in `CONTEXT.md` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Criteria @@ -333,21 +333,21 @@ def test_a_second_group_over_the_limit_stops_the_item_as_plan_defect( Reads: `CONTEXT.md`. Changes: `src/devops_cli/shout.py` (new). - [ ] 1.1 First task - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 2. The second group Reads: `src/devops_cli/heavy_0.py`, `src/devops_cli/heavy_1.py`, `src/devops_cli/heavy_2.py`, `src/devops_cli/heavy_3.py`, `src/devops_cli/heavy_4.py`, `src/devops_cli/heavy_5.py`. Changes: `src/devops_cli/shout.py`. - [ ] 2.1 Heavy task reading `src/devops_cli/heavy_0.py`, `src/devops_cli/heavy_1.py`, `src/devops_cli/heavy_2.py`, `src/devops_cli/heavy_3.py`, `src/devops_cli/heavy_4.py`, `src/devops_cli/heavy_5.py` - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 3. The third group Reads: `src/devops_cli/heavy_0.py`, `src/devops_cli/heavy_1.py`, `src/devops_cli/heavy_2.py`, `src/devops_cli/heavy_3.py`, `src/devops_cli/heavy_4.py`, `src/devops_cli/heavy_5.py`. Changes: `src/devops_cli/shout.py`. - [ ] 3.1 Another heavy task reading `src/devops_cli/heavy_0.py`, `src/devops_cli/heavy_1.py`, `src/devops_cli/heavy_2.py`, `src/devops_cli/heavy_3.py`, `src/devops_cli/heavy_4.py`, `src/devops_cli/heavy_5.py` - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## Criteria diff --git a/tests/roadmap/implement/test_roadmap_implement_size.py b/tests/roadmap/implement/test_roadmap_implement_size.py index f5552af6fe..c0f9cb2172 100644 --- a/tests/roadmap/implement/test_roadmap_implement_size.py +++ b/tests/roadmap/implement/test_roadmap_implement_size.py @@ -55,7 +55,7 @@ def test_a_file_is_counted_once_and_a_command_or_a_setting_is_no_file() -> None: tasks = ( "# Tasks\n\n## 1. The work\n\n" "- [ ] 1.1 Change `src/devops_cli/a.py` and `tests/test_a.py`\n" - " - Verification: `uv run devops ci test tests/test_a.py`\n" + " - Verification: `$ uv run devops ci test tests/test_a.py`\n" "- [ ] 1.2 Change `src/devops_cli/a.py` again, set `roadmap.implement.max_memory_limit`, " "read `PYTEST_XDIST_AUTO_NUM_WORKERS` and `devops_cli.roadmap.implement.implement_size`\n" "- [ ] 1.3 Document it in `k8s/README.md` and `CONTEXT.md`\n" diff --git a/tests/roadmap/implement/test_roadmap_implement_step.py b/tests/roadmap/implement/test_roadmap_implement_step.py index 3576610618..4c82c592eb 100644 --- a/tests/roadmap/implement/test_roadmap_implement_step.py +++ b/tests/roadmap/implement/test_roadmap_implement_step.py @@ -148,7 +148,7 @@ def test_the_text_of_a_group_runs_from_its_heading_to_the_next_heading() -> None second.text.splitlines()[0], ) == ( "## 1. The first group", - " - Verification: `uv run devops ci test tests/test_sample.py` and `uv run devops docs check`", + " - Verification: `$ uv run devops ci test tests/test_sample.py` and `$ uv run devops docs check`", "## 2. The second group", ) @@ -402,7 +402,7 @@ def test_a_task_that_the_agent_removes_is_restored_and_the_group_is_ticked( ) -> None: shorter = TICKED.replace( "- [x] Add `shout` to `src/sample.py`\n" - " - Verification: `uv run devops ci test tests/test_sample.py` and `uv run devops docs check`\n", + " - Verification: `$ uv run devops ci test tests/test_sample.py` and `$ uv run devops docs check`\n", "", ) script = ModelScript( diff --git a/tests/roadmap/implement/test_roadmap_implement_step_fail_to_pass.py b/tests/roadmap/implement/test_roadmap_implement_step_fail_to_pass.py index ca6241b39c..0973a3462c 100644 --- a/tests/roadmap/implement/test_roadmap_implement_step_fail_to_pass.py +++ b/tests/roadmap/implement/test_roadmap_implement_step_fail_to_pass.py @@ -42,9 +42,9 @@ ## 1. The first group - [ ] Add the failing test `tests/test_sample.py` for `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` fails on the base + - Verification: `$ uv run devops ci test tests/test_sample.py` fails on the base - [ ] Add `shout` to `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` + - Verification: `$ uv run devops ci test tests/test_sample.py` """ TICKED_BEHAVIOR = BEHAVIOR.replace("- [ ] Add", "- [x] Add") TEST_PATH = "tests/test_sample.py" @@ -255,7 +255,7 @@ def test_a_group_that_says_it_is_behavior_needs_a_test_file( Kind: behavior. - [ ] Add `shout` to `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` + - Verification: `$ uv run devops ci test tests/test_sample.py` """ checkout = make_checkout(tmp_path, tasks) ticked = tasks.replace("- [ ] Add", "- [x] Add") diff --git a/tests/roadmap/implement/test_roadmap_implement_step_own_text.py b/tests/roadmap/implement/test_roadmap_implement_step_own_text.py index 1dc6ea5e61..b365285441 100644 --- a/tests/roadmap/implement/test_roadmap_implement_step_own_text.py +++ b/tests/roadmap/implement/test_roadmap_implement_step_own_text.py @@ -149,7 +149,7 @@ def test_a_command_that_the_model_rewrites_to_pass_does_not_run_and_the_original store: InMemoryRoadmapStore, checkout: Path, programs: ProcessFake ) -> None: head = git(checkout, "rev-parse", "HEAD") - weak = TICKED.replace(f"Verification: `{CHECK}`\n", f"Verification: `{DOCS}`\n", 1) + weak = TICKED.replace(f"Verification: `$ {CHECK}`\n", f"Verification: `$ {DOCS}`\n", 1) programs.answer( lambda call: command_text(call) == CHECK, ProcessAnswer(returncode=1, stdout="no test\n") ) @@ -182,8 +182,8 @@ def test_a_line_of_the_group_that_is_no_task_is_restored( ) -SECOND = f"- [x] Add `shout` to `src/sample.py`\n - Verification: `{CHECK}` and `{DOCS}`\n" -FIRST = f"- [x] {FIRST_TASK}\n - Verification: `{CHECK}`\n" +SECOND = f"- [x] Add `shout` to `src/sample.py`\n - Verification: `$ {CHECK}` and `$ {DOCS}`\n" +FIRST = f"- [x] {FIRST_TASK}\n - Verification: `$ {CHECK}`\n" SWAPPED = TICKED.replace(FIRST + SECOND, SECOND + FIRST) ADDED = TICKED.replace(SECOND, SECOND + "- [x] Do more\n") REMOVED = TICKED.replace(SECOND, "") diff --git a/tests/roadmap/implement/test_roadmap_implement_step_repair.py b/tests/roadmap/implement/test_roadmap_implement_step_repair.py index bf42d1b429..955ba41162 100644 --- a/tests/roadmap/implement/test_roadmap_implement_step_repair.py +++ b/tests/roadmap/implement/test_roadmap_implement_step_repair.py @@ -417,7 +417,7 @@ def test_an_extra_turn_that_changes_the_verification_command_leaves_the_tasks_fi store: InMemoryRoadmapStore, checkout: Path, programs: ProcessFake ) -> None: _lint_fails_on_an_unused_import(programs) - changed = TICKED.replace("`uv run devops ci test tests/test_sample.py`", "`true`") + changed = TICKED.replace("`$ uv run devops ci test tests/test_sample.py`", "`$ true`") assert changed != TICKED script = ModelScript( tool_calls(*NOT_TICKED, TICK), diff --git a/tests/roadmap/implement/test_roadmap_implement_step_ticks.py b/tests/roadmap/implement/test_roadmap_implement_step_ticks.py index a328a912ec..52b4e06984 100644 --- a/tests/roadmap/implement/test_roadmap_implement_step_ticks.py +++ b/tests/roadmap/implement/test_roadmap_implement_step_ticks.py @@ -143,8 +143,8 @@ def test_the_extra_turn_that_ticks_a_later_group_is_restored( EDITS = { "text": EVERY_TICK.replace("Document the function", "Describe the function"), "command": EVERY_TICK.replace( - "Verification: `uv run devops docs check`\n\n## Workflow", - "Verification: `uv run devops docs check --all`\n\n## Workflow", + "Verification: `$ uv run devops docs check`\n\n## Workflow", + "Verification: `$ uv run devops docs check --all`\n\n## Workflow", ), "added group": EVERY_TICK.replace( "## Workflow follow-up", "## 3. A third group\n\n- [x] Do more\n\n## Workflow follow-up" diff --git a/tests/roadmap/implement/test_roadmap_implement_strays.py b/tests/roadmap/implement/test_roadmap_implement_strays.py index 8b84dc6a2a..f114fc3cb9 100644 --- a/tests/roadmap/implement/test_roadmap_implement_strays.py +++ b/tests/roadmap/implement/test_roadmap_implement_strays.py @@ -50,7 +50,7 @@ "## 1. The group\n\n" "Reads: none. Changes: `src/sample.py`, `tests/test_sample.py` (new).\n\n" "- [ ] 1.1 Add the test `tests/test_sample.py`\n" - " - Verification: `uv run devops ci test tests/test_sample.py`\n" + " - Verification: `$ uv run devops ci test tests/test_sample.py`\n" "- [ ] 1.2 Write `docs/NOTES.md`\n" )[0] diff --git a/tests/roadmap/implement/test_roadmap_implement_wip_job.py b/tests/roadmap/implement/test_roadmap_implement_wip_job.py index 39c958f45e..39e4766109 100644 --- a/tests/roadmap/implement/test_roadmap_implement_wip_job.py +++ b/tests/roadmap/implement/test_roadmap_implement_wip_job.py @@ -28,7 +28,7 @@ "# Tasks\n\n## 1. The five files\n\n" f"Reads: `CONTEXT.md`. Changes: {FILES_AND_TESTS}.\n\n" + "".join( - f"- [ ] 1.{i} Add `src/devops_cli/f{i}.py`\n - Verification: `uv run devops ci test tests/test_f{i}.py`\n" + f"- [ ] 1.{i} Add `src/devops_cli/f{i}.py`\n - Verification: `$ uv run devops ci test tests/test_f{i}.py`\n" for i in range(1, FILES + 1) ) + "\n## Criteria\n\n- Group 1: The job keeps every comment.\n" diff --git a/tests/roadmap/stage/__snapshots__/test_roadmap_stage_plan.ambr b/tests/roadmap/stage/__snapshots__/test_roadmap_stage_plan.ambr index 724d25e318..5749c40d8c 100644 --- a/tests/roadmap/stage/__snapshots__/test_roadmap_stage_plan.ambr +++ b/tests/roadmap/stage/__snapshots__/test_roadmap_stage_plan.ambr @@ -80,9 +80,9 @@ Reads: `src/devops_cli/sample.py`. Changes: `src/devops_cli/sample.py`, `tests/test_sample.py` (new). - [ ] 1.1 Write `test_the_job_keeps_the_last_comment` in `tests/test_sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` fails on the base + - Verification: `$ uv run devops ci test tests/test_sample.py` fails on the base - [ ] 1.2 Keep the last comment in `src/devops_cli/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` passes + - Verification: `$ uv run devops ci test tests/test_sample.py` passes ## Workflow follow-up diff --git a/tests/roadmap/stage/test_roadmap_stage_job.py b/tests/roadmap/stage/test_roadmap_stage_job.py index e312ff8dbb..bdf9a19c82 100644 --- a/tests/roadmap/stage/test_roadmap_stage_job.py +++ b/tests/roadmap/stage/test_roadmap_stage_job.py @@ -373,7 +373,7 @@ def outage(*_: Any, **__: Any) -> Any: Reads: `src/devops_cli/shout.py`. Changes: `{NEW_MODULE}` (new). - [ ] Add `{NEW_MODULE}` - - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` + - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py` """ diff --git a/tests/roadmap/stage/test_roadmap_stage_kind.py b/tests/roadmap/stage/test_roadmap_stage_kind.py index f41f00edd5..60dc09c2fe 100644 --- a/tests/roadmap/stage/test_roadmap_stage_kind.py +++ b/tests/roadmap/stage/test_roadmap_stage_kind.py @@ -171,7 +171,7 @@ def _task_lines(*groups: dict[str, Any]) -> list[str]: def test_a_deletion_that_keeps_behavior_renders_one_task_with_its_command_and_no_test() -> None: assert _task_lines(OTHER) == [ "- [ ] 1.1 Delete `unused_probe` from `StreamingTokenProcessor`", - " - Verification: `! git grep -n -w unused_probe src/ tests/ docs/` passes", + " - Verification: `$ ! git grep -n -w unused_probe src/ tests/ docs/` passes", ] @@ -182,7 +182,7 @@ def test_the_groups_of_the_mutation_report_plan_render_with_no_contrived_test() "- [ ] 1.1 Run `uv run devops ci mutate` and write one row for each test file, and run " "this check by hand: Open the report. Check that a row names each of the 18 test files.", "- [ ] 2.1 Delete each test file with no unique mutant in the report", - " - Verification: `uv run devops ci test tests/commands` passes", + " - Verification: `$ uv run devops ci test tests/commands` passes", ] @@ -197,9 +197,9 @@ def test_an_other_group_renders_no_test_and_no_failure_on_the_base(group: dict[s def test_a_behavior_group_renders_its_failing_test_first_and_then_its_implementation() -> None: assert _task_lines(BEHAVIOR) == [ "- [ ] 1.1 Write `test_the_job_keeps_the_last_comment` in `tests/test_sample.py`", - " - Verification: `uv run devops ci test tests/test_sample.py` fails on the base", + " - Verification: `$ uv run devops ci test tests/test_sample.py` fails on the base", "- [ ] 1.2 Keep the last comment in `src/devops_cli/sample.py`", - " - Verification: `uv run devops ci test tests/test_sample.py` passes", + " - Verification: `$ uv run devops ci test tests/test_sample.py` passes", ] @@ -223,7 +223,7 @@ def test_a_group_with_documentation_renders_the_documentation_task_after_its_wor assert len([line for line in lines if line.startswith("- [ ] ")]) == number assert lines[-2:] == [ f"- [ ] 1.{number} Document the change in `docs/TESTING.md`", - " - Verification: `uv run devops ci docs` passes", + " - Verification: `$ uv run devops ci docs` passes", ] @@ -244,7 +244,7 @@ def test_a_group_that_changes_a_command_renders_the_regeneration_step_in_its_doc assert lines[-2:] == [ f"- [ ] 1.{number} Document the flag in `docs/CLI_REFERENCE.md`, and run " "`uv run devops docs generate --sync-readme`", - " - Verification: `uv run devops ci docs` passes", + " - Verification: `$ uv run devops ci docs` passes", ] @@ -259,7 +259,7 @@ def test_a_group_that_changes_only_a_document_renders_no_regeneration_step() -> assert lines[-2:] == [ "- [ ] 1.2 Document the disclosure contact in `SECURITY.md`", - " - Verification: `uv run devops ci docs` passes", + " - Verification: `$ uv run devops ci docs` passes", ] diff --git a/tests/roadmap/stage/test_roadmap_stage_plan.py b/tests/roadmap/stage/test_roadmap_stage_plan.py index 941241b4a9..2776564836 100644 --- a/tests/roadmap/stage/test_roadmap_stage_plan.py +++ b/tests/roadmap/stage/test_roadmap_stage_plan.py @@ -931,7 +931,7 @@ def test_a_documentation_text_that_starts_with_a_path_gets_the_edit_verb( ) -> None: tasks = _tasks_of(_group(documentation=documentation)) - assert f"- [ ] 1.3 {task}\n - Verification: `uv run devops ci docs` passes" in tasks + assert f"- [ ] 1.3 {task}\n - Verification: `$ uv run devops ci docs` passes" in tasks def test_a_rendered_group_has_no_double_stop_and_no_task_that_starts_with_a_comma() -> None: @@ -1322,7 +1322,7 @@ def _open_plan_creating(path: str) -> str: "# Tasks\n\n## 1. The module\n\n" f"Reads: `src/devops_cli/shout.py`. Changes: `{path}` (new).\n\n" f"- [ ] Add `{path}`\n" - " - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py`\n" + " - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py`\n" ) diff --git a/tests/roadmap/stage/test_roadmap_stage_planned.py b/tests/roadmap/stage/test_roadmap_stage_planned.py index 04c2a5ec2d..f0d4cb41de 100644 --- a/tests/roadmap/stage/test_roadmap_stage_planned.py +++ b/tests/roadmap/stage/test_roadmap_stage_planned.py @@ -237,7 +237,7 @@ def _plan_creating(path: str) -> str: "# Tasks\n\n## 1. The module\n\n" f"Reads: `src/devops_cli/shout.py`. Changes: `{path}` (new).\n\n" f"- [ ] Add `{path}`\n" - " - Verification: `uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py`\n" + " - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_stage_constants.py`\n" ) diff --git a/tests/roadmap/stage/test_roadmap_stage_split.py b/tests/roadmap/stage/test_roadmap_stage_split.py index 554b63d023..ea50cd7c3f 100644 --- a/tests/roadmap/stage/test_roadmap_stage_split.py +++ b/tests/roadmap/stage/test_roadmap_stage_split.py @@ -86,7 +86,7 @@ def test_ask_split_sends_group_with_text_as_it_is() -> None: "title": "Group from tasks.md", "tokens": 45000, "over_budget": True, - "text": "## 2. Group from tasks.md\n\n- [ ] Task in group\n - Verification: `uv run devops ci test`\n", + "text": "## 2. Group from tasks.md\n\n- [ ] Task in group\n - Verification: `$ uv run devops ci test`\n", } request: dict[str, Any] = { "number": 99, diff --git a/tests/roadmap/stage/test_roadmap_stage_task_verification.py b/tests/roadmap/stage/test_roadmap_stage_task_verification.py index 1b0c40d8df..57addeee43 100644 --- a/tests/roadmap/stage/test_roadmap_stage_task_verification.py +++ b/tests/roadmap/stage/test_roadmap_stage_task_verification.py @@ -93,8 +93,8 @@ def test_the_failing_test_task_says_on_its_verification_line_that_it_fails_on_th verification = [line for line in lines if "Verification:" in line] assert verification == [ - " - Verification: `uv run devops ci test tests/test_sample.py` fails on the base", - " - Verification: `uv run devops ci test tests/test_sample.py` passes", + " - Verification: `$ uv run devops ci test tests/test_sample.py` fails on the base", + " - Verification: `$ uv run devops ci test tests/test_sample.py` passes", ] diff --git a/tests/roadmap/stage/test_roadmap_stage_text_lines.py b/tests/roadmap/stage/test_roadmap_stage_text_lines.py index 1c131328b9..9656b7cc70 100644 --- a/tests/roadmap/stage/test_roadmap_stage_text_lines.py +++ b/tests/roadmap/stage/test_roadmap_stage_text_lines.py @@ -73,7 +73,7 @@ PAYLOADS = [ "- [ ] 9.9 Extra", "## 9. Extra", - " - Verification: `git push origin HEAD`", + " - Verification: `$ git push origin HEAD`", ] @@ -112,7 +112,7 @@ def test_a_heading_inside_a_list_or_a_quote_is_no_group(heading: str) -> None: "1. ## 2. Extra", "```", "---", - "Verification: `git push origin HEAD`", + "Verification: `$ git push origin HEAD`", "Fine criterion\r## 2. Extra", "Fine criterion\x85## 2. Extra", "Fine criterion\u2028## 2. Extra", @@ -230,11 +230,11 @@ def test_a_line_break_in_verify_becomes_one_space_and_keeps_the_other_spaces( @pytest.mark.parametrize("field", ["title", "test", "implementation"]) def test_a_text_set_after_validation_is_folded_and_adds_no_command(field: str) -> None: group = StageGroup.model_validate(BEHAVIOR) - setattr(group, field, "Do it\n - Verification: `git push origin HEAD`") + setattr(group, field, "Do it\n - Verification: `$ git push origin HEAD`") parsed = parse_task_groups(f"# Tasks\n\n{group_text(1, group)}") - assert getattr(group, field) == "Do it - Verification: `git push origin HEAD`" + assert getattr(group, field) == "Do it - Verification: `$ git push origin HEAD`" assert [g.verification_commands for g in parsed] == [(BEHAVIOR["verify"],)] diff --git a/tests/roadmap/test_roadmap_plan_read.py b/tests/roadmap/test_roadmap_plan_read.py index 3fda4db77d..4021391791 100644 --- a/tests/roadmap/test_roadmap_plan_read.py +++ b/tests/roadmap/test_roadmap_plan_read.py @@ -268,9 +268,9 @@ def _two_tasks(second_verification: str) -> dict[str, str]: "## 1. Render the values\n\n" "Reads: `src/devops_cli/roadmap/stores/store.py`. Changes: `k8s/loki-values.yaml`.\n\n" "- [ ] 1.1 Change the values.\n" - " - Verification: `uv run devops ci docs`\n" + " - Verification: `$ uv run devops ci docs`\n" "- [ ] 1.2 Document the values.\n" - f" - Verification: `{second_verification}`\n" + f" - Verification: `$ {second_verification}`\n" ) diff --git a/tests/roadmap/test_roadmap_plan_rewrite.py b/tests/roadmap/test_roadmap_plan_rewrite.py index a12b81d31b..75c07f3152 100644 --- a/tests/roadmap/test_roadmap_plan_rewrite.py +++ b/tests/roadmap/test_roadmap_plan_rewrite.py @@ -99,9 +99,9 @@ def test_a_behavior_group_gets_the_fails_on_the_base_form_and_any_other_group_pa added = _added_lines(NO_VERIFICATION, rewritten) assert added == [ - " - Verification: `uv run devops ci test tests/test_sample.py` fails on the base", - " - Verification: `uv run devops ci test tests/test_keep.py tests/test_more.py` passes", - " - Verification: `uv run devops ci docs` passes", + " - Verification: `$ uv run devops ci test tests/test_sample.py` fails on the base", + " - Verification: `$ uv run devops ci test tests/test_keep.py tests/test_more.py` passes", + " - Verification: `$ uv run devops ci docs` passes", ] first = parse_task_groups(rewritten)[0] assert first.tasks[0].verification == ("uv run devops ci test tests/test_sample.py",) @@ -129,13 +129,13 @@ def test_a_group_that_has_a_verification_line_is_left_as_it_is() -> None: tasks = NO_VERIFICATION.replace( "- [ ] 3.1 Describe the sample in `docs/guide.md`", "- [ ] 3.1 Describe the sample in `docs/guide.md`\n" - " - Verification: `uv run devops ci docs` passes", + " - Verification: `$ uv run devops ci docs` passes", ) rewritten = rewrite_plan(ROOT, _files(tasks), TREE).files[TASKS_PATH] assert len(_added_lines(tasks, rewritten)) == 2 - assert rewritten.count("`uv run devops ci docs`") == 1 + assert rewritten.count("`$ uv run devops ci docs`") == 1 def test_a_command_that_the_step_refuses_is_not_written() -> None: @@ -156,7 +156,7 @@ def test_a_command_that_the_step_refuses_is_not_written() -> None: - [ ] 1.1 Write the failing test in `tests/test_real.py`, and let it write `tests/test_sample.py` and read `src/devops_cli/sample.py` and `tests/test_late.py` - - Verification: `uv run devops ci test tests/test_real.py` passes + - Verification: `$ uv run devops ci test tests/test_real.py` passes - [ ] 1.2 Add `src/devops_cli/missing.py` (new) ## 2. Add the late test @@ -164,7 +164,7 @@ def test_a_command_that_the_step_refuses_is_not_written() -> None: Reads: none. Changes: `tests/test_late.py` (new). - [ ] 2.1 Write the late test - - Verification: `uv run devops ci test tests/test_late.py` passes + - Verification: `$ uv run devops ci test tests/test_late.py` passes """ @@ -200,14 +200,14 @@ def test_a_path_on_a_reads_line_stays_and_a_verification_line_is_never_edited() .replace("read `src/devops_cli/sample.py`", "read `docs/note.md`") .replace( "passes\n- [ ] 1.2", - "passes\n - Verification: `uv run devops ci test tests/test_sample.py` passes\n- [ ] 1.2", + "passes\n - Verification: `$ uv run devops ci test tests/test_sample.py` passes\n- [ ] 1.2", ) ) rewritten = rewrite_plan(ROOT, _files(tasks), TREE).files[TASKS_PATH] assert "read `docs/note.md`" in rewritten - assert " - Verification: `uv run devops ci test tests/test_sample.py` passes" in rewritten + assert " - Verification: `$ uv run devops ci test tests/test_sample.py` passes" in rewritten def test_a_folder_with_no_design_gets_a_stub_that_the_plan_reader_accepts() -> None: diff --git a/tests/roadmap/test_roadmap_step_files.py b/tests/roadmap/test_roadmap_step_files.py new file mode 100644 index 0000000000..04ea1f2324 --- /dev/null +++ b/tests/roadmap/test_roadmap_step_files.py @@ -0,0 +1,78 @@ +"""The code spans of a `Verification:` line that the implement step reads as commands (#3596). + +Only a code span that starts with `$ ` is a command. Every other code span of the line is prose and +gives the group no command. +""" + +from __future__ import annotations + +from devops_cli.lang import MESSAGES +from devops_cli.roadmap.implement.implement_shell_policy import verification_problem +from devops_cli.roadmap.step_files import TaskGroup, _task_of, parse_task_groups + +TEST_COMMAND = "uv run devops ci test tests/roadmap/test_roadmap_step_files.py" + + +def _group(verification: str) -> TaskGroup: + """The group of a plan whose one task has the `Verification:` line `verification`.""" + tasks = f"## 1. A group\n\n- [ ] 1.1 Change the file\n - Verification: {verification}\n" + [group] = parse_task_groups(tasks) + return group + + +def test_a_prose_code_span_beside_a_marked_command_is_no_command() -> None: + group = _group(f"`tagged_image` splits the reference, and `$ {TEST_COMMAND}` passes") + + assert group.verification_commands == (TEST_COMMAND,) + assert group.tasks[0].verification == (TEST_COMMAND,) + + +def test_the_mark_is_removed_before_the_step_reads_the_program() -> None: + [command] = _group("`$ uv run devops ci docs` passes").verification_commands + + assert command == "uv run devops ci docs" + assert verification_problem(command) is None + + +def test_a_marked_command_of_a_program_that_is_not_allowed_is_refused_with_the_reason() -> None: + [command] = _group("`$ nosuchprogram --version` passes").verification_commands + + reason = verification_problem(command) + + assert command == "nosuchprogram --version" + assert reason is not None + assert "nosuchprogram" in reason + + +def test_a_line_with_no_marked_code_span_gives_the_group_no_command() -> None: + group = _group(f"`{TEST_COMMAND}` passes") + + assert group.verification_commands == () + + +def test_each_marked_command_of_a_line_is_read() -> None: + group = _group("`$ uv run devops ci docs` and `$ uv run devops openspec check` pass") + + assert group.verification_commands == ("uv run devops ci docs", "uv run devops openspec check") + + +def test_the_line_that_the_stage_template_writes_gives_its_command() -> None: + for template in (MESSAGES.roadmap.stage_task_test, MESSAGES.roadmap.stage_task_pass): + text = template.partition("\n")[2].format(verify=TEST_COMMAND) + group = _group(text.removeprefix(" - Verification: ")) + + assert group.verification_commands == (TEST_COMMAND,) + + +def test_the_documents_task_of_the_stage_template_gives_its_command() -> None: + text = MESSAGES.roadmap.stage_task_documents.partition("\n")[2] + group = _group(text.removeprefix(" - Verification: ")) + + assert group.verification_commands == ("uv run devops ci docs",) + + +def test_the_docstring_of_the_task_reader_states_the_rule() -> None: + doc = _task_of.__doc__ or "" + + assert "$ " in doc + assert "prose" in doc diff --git a/tests/support/base_replay.py b/tests/support/base_replay.py index d184787eab..4b1860911e 100644 --- a/tests/support/base_replay.py +++ b/tests/support/base_replay.py @@ -20,16 +20,16 @@ Reads: `CONTEXT.md`. Changes: `tests/test_shout.py` (new), `src/devops_cli/shout.py` (new). - [ ] 1.1 Add the failing test `tests/test_shout.py` for `src/devops_cli/shout.py` - - Verification: `uv run devops ci test tests/test_shout.py` fails on the base + - Verification: `$ uv run devops ci test tests/test_shout.py` fails on the base - [ ] 1.2 Add `shout` to `src/devops_cli/shout.py` - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 2. The second group Reads: `CONTEXT.md`. Changes: `CONTEXT.md`. - [ ] 2.1 Document the function in `CONTEXT.md` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Criteria diff --git a/tests/support/implement_step.py b/tests/support/implement_step.py index f982aa9d5f..5610a5111c 100644 --- a/tests/support/implement_step.py +++ b/tests/support/implement_step.py @@ -27,14 +27,14 @@ ## 1. The first group - [ ] Add the failing test `tests/test_sample.py` for `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` + - Verification: `$ uv run devops ci test tests/test_sample.py` - [ ] Add `shout` to `src/sample.py` - - Verification: `uv run devops ci test tests/test_sample.py` and `uv run devops docs check` + - Verification: `$ uv run devops ci test tests/test_sample.py` and `$ uv run devops docs check` ## 2. The second group - [x] Document the function in `docs/SAMPLE.md` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Workflow follow-up diff --git a/tests/support/roadmap_implement.py b/tests/support/roadmap_implement.py index 8a38aa6a7b..92965d0489 100644 --- a/tests/support/roadmap_implement.py +++ b/tests/support/roadmap_implement.py @@ -70,14 +70,14 @@ Reads: `CONTEXT.md`. Changes: `src/devops_cli/shout.py` (new), `tests/test_shout.py` (new). - [ ] 1.1 Add `src/devops_cli/shout.py` - - Verification: `uv run devops ci test tests/test_shout.py` + - Verification: `$ uv run devops ci test tests/test_shout.py` ## 2. The second group Reads: `CONTEXT.md`. Changes: `CONTEXT.md`. - [ ] 2.1 Document the function in `CONTEXT.md` - - Verification: `uv run devops docs check` + - Verification: `$ uv run devops docs check` ## Criteria