Skip to content

refactor(cli): the five functions and properties that nothing calls and that #1910 does not list leave src #2175

Closed

Description

@dan-petty

What happened

Five functions and properties in src/ have no caller, and #1910 does not list them. git grep -n -w <name> origin/main -- src tests docs '*.md' '*.yaml' '*.toml' at b170358 finds only the definition. None of them carries a decorator that registers it, and none overrides a method of a library class.

Definition Name
src/devops_cli/ai/client/streaming.py:164 StreamingTokenProcessor.thinking_detected (property)
src/devops_cli/ai/client/unified.py:215 LLMClient._get_ollama_semaphore (classmethod)
src/devops_cli/ai/thinking_stream.py:339 ThinkingStreamProcessor.unique_thinking (property)
src/devops_cli/config/settings.py:219 _validation_error_key
src/devops_cli/grafana/schema.py:145 Dashboard.grid_width (property)

What should happen

The five definitions are deleted, with any import or constant that only they use.

Evidence

Acceptance criteria

  • The five definitions are deleted.
  • git grep -n -w <name> prints nothing in src/, tests/ and docs/ for each name.
  • A test that only calls a deleted name goes with it, and the pull request names it.
  • uv run devops ci passes, and the coverage stays at or above fail_under.

Related: #1910 deletes the other 17 names.

Source: #1910

Proposed design

Problem statement

Five functions and properties in src/ have no caller, no registering decorator, and no library override. Issue #1910 lists 17 other dead-code names for the same check. These five are the remainder and should be deleted to remove dead code from the tree.

Acceptance criteria

  • Criterion 1: All five definitions are deleted from their files.
    Verification: Open each of the five files and confirm the named definition is absent.
  • Criterion 2: No reference to any of the five names remains in src/, tests/, or docs/.
    Verification: Run git grep -n -w for each of the five names. Confirm the output is empty across src/, tests/, and docs/.
  • Criterion 3: Any test that exclusively calls a deleted name is removed, and the pull request description names it.
    Verification: Read the pull request description. Confirm it lists every removed test by name. Confirm the test file no longer contains the removed test.
  • Criterion 4: The CI gate passes and coverage stays at or above the fail_under value.
    Verification: Run uv run devops ci. Confirm the exit code is 0 and the reported coverage is at or above the fail_under value in pyproject.toml.

Key questions

  • Are any of the five names called, registered by a decorator, or overriding a library method?: No. A git grep at commit b170358 finds only the definition line for each name. None carries a decorator, and none overrides a base-class method. [sources: src/devops_cli/ai/client/streaming.py:164, src/devops_cli/ai/client/unified.py:215, src/devops_cli/ai/thinking_stream.py:339, src/devops_cli/config/settings.py:219, src/devops_cli/grafana/schema.py:145]
  • Is issue refactor: Delete unused functions after manual caller check #1910 a prerequisite for this work?: No. Issue refactor: Delete unused functions after manual caller check #1910 deletes 17 other dead-code names. This issue deletes the remaining five. They are independent and can be delivered in any order. (proposed)
  • Do any of the five definitions have exclusive imports or constants that must also be removed?: This must be confirmed during implementation. If a deleted name is the sole user of an import or constant, that import or constant is removed in the same pull request. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/refactor
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/refactor. The candidate proposes a refactor to remove unused code elements from the source tree.
    • Priority: P2-Medium. The task removes dead code that improves codebase hygiene but does not fix a bug or add a feature.
    • Value: Low. Removing dead code has minimal direct value to end users but improves maintainability.
    • Effort: Low. Deleting unused functions and properties is a simple task with no complex logic involved.
    • Related: test(hygiene): tombstone tests for deleted code are deleted and a dead-code tool is trialled #1871, which asks for a different change. Both items relate to dead code hygiene. However, the candidate deletes specific unused functions while item #1871 addresses tombstone tests for deleted code.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    effort/low
    value/low
    scope/cli
    on Oct 28, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Staged: branch refactor/2175-the-five-functions-and-properties-that, draft pull request #2983. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Delete thinking_detected from streaming.py: 2906 tokens
    2. Delete _get_ollama_semaphore from unified.py: 2930 tokens
    3. Delete unique_thinking from thinking_stream.py: 2906 tokens
    4. Delete _validation_error_key from settings.py: 2907 tokens
    5. Delete grid_width from schema.py and run CI: 2877 tokens
  6. 14 remaining items

  7. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at group 2 by the rule digest: the runner image changed since the stop, from sha256:59fd1dd8fc8586f5c4fc86d4fe6818fa0a6706468788fcfc6508544092eb788e to sha256:a90f6ade2b0e8f17e7e6ceb55a64b5ec8cc7571040ea99968cc09598b784566c. The item is Planned again, and the Service takes it in the next round. The Service clears a stop one time for each runner image. A new stop on this image waits for a comment implement: retry.

  8. added a commit that references this issue on Nov 1, 2026
  9. added
    owner/service
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 1, 2026
  10. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Pull request #3086 is ready for review. The checks passed.

    Spend: 138 model requests, 2800221 input tokens, 13240 output tokens.

  11. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261101-151258-42fe ended: succeeded.
    Image digest: sha256:04d655904252706a7321aed38fa5cafd293625c5db469f252f57163a7c463f16

    The last lines of its log:

    b'Tool call: shell, started: uv run devops ci test tests/grafana/ ...\nTool call: shell, program uv, ok.\nTool call: shell, started: uv run devops ci lint\nTool call: shell, program uv, ok.\nTool call: shell, started: git grep -n -w -e thinking_detected ...\nTool call: shell, program git, ok.\nTool call: shell, started: git grep -n -w -e thinking_detected ...\nTool call: shell, program git, ok.\nTool call: shell, started: uv run devops ci\nTool call: shell, program uv, ok.\nTool call: shell, started: uv run devops ci test tests/config/test_settings.py ...\nTool call: shell, program uv, ok.\nTool call: shell, started: uv run pytest tests/config/test_settings.py tests/ai/client/test_ai_streaming.py tests/ai/test_thinking.py ...\nTool call: shell, program uv, ok.\nTool call: shell, started: git grep -n -w grid_width -- ...\nTool call: shell, program git, ok.\nTool call: shell, started: other\nTool call: shell, program other, refused.\nTool call: shell, started: other\nTool call: shell, program other, refused.\nTool call: read_file, ok.\nTool call: shell, started: git grep -n -w grid_width -- ...\nTool call: shell, program git, ok.\nTool call: shell, started: git grep -n -w thinking_detected -- ...\nTool call: shell, program git, ok.\nTool call: shell, started: git grep -n -w unique_thinking -- ...\nTool call: shell, program git, ok.\nTool call: shell, started: git grep -n -w _get_ollama_semaphore -- ...\nTool call: shell, program git, ok.\nTool call: shell, started: git grep -n -w _validation_error_key -- ...\nTool call: shell, program git, ok.\nTool call: shell, started: other\nTool call: shell, program other, refused.\nTool call: shell, started: git grep -n -w grid_width -- ...\nTool call: shell, program git, ok.\nTool call: edit_file, ok.\nTool call: shell, started: other\nTool call: shell, program other, refused.\n\xe2\x9c\x93 Took 1 item(s) to a ready pull request, stopped 0.\nElapsed: 31m 57s\n'
    
  12. removed
    owner/service
    on Nov 1, 2026
  13. removed
    status/in-review
    on Nov 1, 2026
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/p2-mediumscope/clisource/agenttype/refactorvalue/low

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions