Skip to content

refactor(ai): delete orphan prompts and the prompt fallbacks - #4710

Merged
dan-petty merged 5 commits into
mainfrom
refactor/4630-delete-orphan-prompts-and-the-prompt
Nov 11, 2026
Merged

dan-petty merged 5 commits into
mainfrom
refactor/4630-delete-orphan-prompts-and-the-prompt

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Delete the nine prompt files of ai/tasks/ and the two files of ai/prompts/ that no code reads. The review prompt digest hashes every file of ai/tasks/, so an edit of an orphan moved the review benchmark arm.

load_task_prompt raises TaskPromptNotFoundError for a name that is not a file of ai/tasks/. An empty prompt no longer reaches a model, and the two fallback prompts in code go.

Two checks of the test-tree row of devops ci fail when the code loads a prompt name (a literal or a constant) that does not exist, or when a file of ai/tasks/ has no reader.

Closes #4630

Change: openspec/changes/archive/2026-11-11-4630-delete-orphan-prompts-and-the-prompt/

Delete the nine prompt files of ai/tasks/ and the two files of
ai/prompts/ that no code reads. load_task_prompt raises
TaskPromptNotFoundError for a name that is not a file of ai/tasks/, so
the two fallback prompts in code go too. Two checks of the test-tree
row fail when the code loads a prompt that does not exist, or when a
file of ai/tasks/ has no reader.
@dan-petty dan-petty added type/refactor Type refactor: a new structure, same behavior scope/ai AI review pipeline, personas, prompts, LLM client, or RAG labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Checks and measurements of this change.

fail-to-pass (uv run devops ci fail-to-pass --base origin/main, exit 0):

failed on base: tests.ai.test_ai_task_loader::test_a_name_that_is_not_a_prompt_of_the_folder_raises[missing] (Failed: DID NOT RAISE DevOpsCLIError)
failed on base: tests.ai.test_ai_task_loader::test_a_name_that_is_not_a_prompt_of_the_folder_raises[outside-the-folder] (Failed: DID NOT RAISE DevOpsCLIError)
2 failed on base (2 failed and 36 passed in tests/ai/test_ai_task_loader.py, tests/invariants/test_agents_md.py, tests/invariants/test_task_prompts_check.py; 0 errored).

Orphan census. The unread_prompts check of the test-tree row, run on origin/main before the deletion, listed exactly the nine files of the issue: agent_direct_response_from_reasoning.md, agent_direct_response_from_tools.md, agent_invoke_tool_request.md, agent_tool_already_called.md, agent_tool_feedback.md, guardrails_isolation.md, summarize_memory.md, summarize_memory_system.md, tool_execution_protocol.md. On this branch it lists none, and missing_prompts is empty.

Acceptance criteria.

  • ls src/devops_cli/ai/tasks/*.md | wc -l gives 51 (60 on the base).
  • load_task_prompt('missing.md') raises: tests/ai/test_ai_task_loader.py.
  • Each prompt name that the code gives to load_task_prompt exists: check_every_prompt_the_code_loads_exists in tests/gate/tree_checks/task_prompts.py. It resolves 34 call sites (31 names), as literals and as constants, also through from imports. The old test resolved literals only (15 names).
  • Local uv run devops ci: every row passed except one pytest case, test_invariant_files_are_listed_in_testing_doc. The second commit fixes it: it lists the new invariant file in docs/TESTING.md. After that commit, tests/invariants/test_source_tree.py passes (32 passed), and uv run devops ci --check --only constructs,docs,openspec passes. The full pytest run took 20 m 49 s while other sessions ran on the host. The run had 23,080 passed and 1 failed (the case above).

Effect on the review benchmark. The prompt digest of a review changes once, because eleven files leave the hashed folders.

No live step is needed: the change does not touch the cluster, a ConfigMap or a Secret.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 17:39
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 17:39
@dan-petty
dan-petty disabled auto-merge November 11, 2026 17:56
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 17:56
@dan-petty
dan-petty merged commit 38a1b13 into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the refactor/4630-delete-orphan-prompts-and-the-prompt branch November 11, 2026 18:18
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.3](v0.112.2...v0.112.3)
(2026-11-11)


### Bug Fixes

* **ai:** record the duration of each agent model request
([#4717](#4717))
([1930b71](1930b71))
* **devcontainer:** poll the Docker daemon through the clock
([#4721](#4721))
([be32268](be32268))
* **roadmap:** confine repair fix turns to the plan files
([#4689](#4689))
([d2e7597](d2e7597))
* **roadmap:** name the nearest test of a module
([#4696](#4696))
([b746c95](b746c95))
* **roadmap:** scoped intake reads a bounded page count
([#4740](#4740))
([f89ccc5](f89ccc5))
* **roadmap:** stage context reads runner facts from the package
([#4723](#4723))
([05e09dc](05e09dc))
* **roadmap:** stage holds an item where openspec is not set up
([#4749](#4749))
([45bd54a](45bd54a))
* **roadmap:** trace gate reads a tool call citation
([#4694](#4694))
([5c71ad4](5c71ad4))


### Performance Improvements

* **ci:** cancel superseded CodeQL runs and idle triggers
([#4763](#4763))
([c951368](c951368))


### Code Refactoring

* **ai:** delete orphan prompts and the prompt fallbacks
([#4710](#4710))
([38a1b13](38a1b13))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/refactor Type refactor: a new structure, same behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(ai): delete orphan prompts and the prompt fallbacks

1 participant