Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/roadmap/plan-recheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading
Loading