Skip to content

Feat: Introduce Model-Agnostic auto-classify Command for Automated AI Workflows #74

Description

@raulgomis

Problem Statement

In modern development workflows and Agentic CI/CD pipelines, changesets are increasingly generated by automated tools and AI coding assistants (e.g., Pull Request agents, code-generation bots). Manually executing interactive prompts or writing structured JSON metadata introduces unnecessary friction for automated machines.

To bridge this gap, semversioner should offer an automated mechanism to infer semantic version impact and generate release descriptions directly from unified diffs.

Proposed Feature

Introduce a new auto-classify CLI command that acts as an agnostic middleware between LLMs and semversioner. This command will consume a unified diff file (via standard input or path flag), evaluate it against strict Semantic Versioning rules using a chosen Large Language Model, and generate the corresponding .json file inside .semversioner/next-release/.

To remain lightweight and avoid vendor lock-in, the classification logic should utilize a unified provider abstraction interface (such as liteLLM) wrapped in an optional package extra.


Specification Requirements

1. Decoupled, File-Agnostic Inputs

The command must not depend on a local git binary executable. It should support:

  • Reading input via standard input streams (sys.stdin) for piping.
  • Reading raw diff payloads via a explicit file target parameter (--file, -f).

2. Fully Provider-Agnostic Model Support

  • Integration with a standard interoperability wrapper (liteLLM) to seamlessly route requests across OpenAI, Anthropic, Gemini, or local models (Ollama/Llama.cpp) using standard routing prefixes (e.g., -m ollama/llama3).
  • Enforced Pydantic schema constraints (response_format) to guarantee the underlying model returns a parseable JSON object containing strictly version_type (major | minor | patch) and description.

3. Package Hygiene

  • AI dependencies must be configured inside optional dependency groups (extras_require or project.optional-dependencies) under the ai identifier to keep core runtime dependencies entirely unbloated:
    pip install semversioner[ai]
    ```

---

### Target Usage Patterns

**1. Standard OS Pipe (Local Git Environment)**
```bash
git diff HEAD~1 | semversioner auto-classify --model gemini/gemini-2.5-flash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions