Skip to content

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

Closed

Description

@dan-petty

Problem or Motivation

  • 9 files in src/devops_cli/ai/tasks/ have 0 code readers: agent_direct_response_from_reasoning, agent_direct_response_from_tools, agent_invoke_tool_request, agent_tool_already_called, agent_tool_feedback, guardrails_isolation, summarize_memory, summarize_memory_system and tool_execution_protocol. The 2 files in src/devops_cli/ai/prompts/ also have 0 code readers. git grep outside the prompt folders gives 0 matches.
  • review_prompt_digest (src/devops_cli/ai/personas/__init__.py:89-96) hashes every tasks/*.md. So an edit of an orphan file moves the review benchmark arm.
  • load_task_prompt returns '' for a missing file (src/devops_cli/ai/task_loader.py:20-22). This keeps 2 fallback prompt copies in code (src/devops_cli/ai/research/socratic.py:139 and src/devops_cli/ai/research/mental_model.py:225).

Proposed Solution & Architectural Design

  • Delete the 11 files and the 2 fallback copies.
  • Remove the glob src/devops_cli/ai/prompts/**/*.md from CONST_DOCS_CLASS_PROMPT (src/devops_cli/config/constants.py:499).
  • Make load_task_prompt raise the project error type for a missing prompt.
  • Correct tests/ai/test_ai_task_loader.py:5, which says that the benchmark_suite files never existed.

Target Subsystem

AI & Agentic Review Pipeline (src/devops_cli/ai/tasks/ and src/devops_cli/ai/task_loader.py).

Existing Tool Considered

The change deletes code. git grep proves that no code reads the files. No tool is necessary. Cost: about 90 lines removed, about 60,000 tokens and 1 hour.

Acceptance Criteria

  • ls src/devops_cli/ai/tasks/*.md | wc -l gives 51 (60 today).
  • A test: load_task_prompt('missing.md') raises.
  • A test loads every prompt name that the code gives to load_task_prompt (collected with git grep), and each one exists.
  • uv run devops ci passes.

Dependencies

None.

Source: #4627

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/refactor
    scope/ai
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/refactor. The refactor prefix of the title gives the type.
    • Scope: scope/ai. The (ai) scope of the title gives the scope.
    • Priority: P3-Low. Dead-code cleanup with no user-facing defect; it prevents benchmark drift but blocks nothing.
    • Value: Medium. Removes 11 files that can silently move the review benchmark and eliminates two stale fallback copies.
    • Effort: Low. About 90 lines removed, one constant glob edit, one error-path change, and two small tests; the body estimates 1 hour.
    • Related: refactor(review): the review guards of .devops/review.md get a reader, or the guards and the unread constant are deleted #1916, which asks for a different change. Both delete unread prompt-related files, but the candidate targets src/devops_cli/ai/tasks/*.md and the task loader, while #1916 targets .devops/review.md and its conventions constant.
  4. added
    priority/p3-low
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 11, 2026
  5. removed
    status/in-progress
    owner/agent
    on Nov 11, 2026
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor
  7. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 19:36 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowscope/aisource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions