Skip to content

Remove unused Granite32/33 formatter processors from public API #1304

Closed

Description

@planetf1

`mellea/formatters/granite/granite3/` contains `Granite32InputProcessor`, `Granite32OutputProcessor`, `Granite32ChatCompletion`, `Granite33InputProcessor`, `Granite33OutputProcessor`, and `Granite33ChatCompletion`, all re-exported from `mellea/formatters/granite/init.py`.

In discussion #1166, @jakelorocco confirmed these classes are not used by any active Mellea code path. Mellea works at the level of actions and contexts via intrinsic processors — the `Granite3x` chat formatter pipeline was carried over from `granite-common` (#571) but never wired into any backend or session routing.

No documentation references them. Nothing in `mellea/` outside the formatter package itself uses them.

Keeping them in `all` is misleading — they look like a supported way to work with Granite models when they are not.

Related: PR #1165 was closed as a result of this finding — the tests targeted code that should go.

Activity

  1. added
    p2
    chore
    area/formatter
    on Jun 19, 2026
  2. psschwei commented on Jun 19, 2026

    @psschwei
    Contributor

    +1

    I would deprecate for a release or two just in case and turn off any testing of them until we decide to remove.

  3. planetf1 commented on Jun 22, 2026

    @planetf1
    ContributorAuthor

    other than docs we could use the warnings.warn(DeprecationWarning, stacklevel=2) in __init__ pattern. - though it's silenced by defaults. Or we could use PEP 702 @warnings.deprecated . Ok to go with consensus - but given the code was never documented I'm wondering if unnecessary

  4. jakelorocco commented on Jun 22, 2026

    @jakelorocco
    Contributor

    I am fine with removing these. The person who implements this should check with @frreiss or someone from the granite-library team to ensure it's okay to remove.

  5. frreiss commented on Jun 22, 2026

    @frreiss
    Collaborator

    I am also fine with removing these.

  6. planetf1 commented on Jun 24, 2026

    @planetf1
    ContributorAuthor

    Proposed approach: direct removal

    After reviewing the discussion history and checking with @frreiss and @jakelorocco, I'm going with direct removal rather than a deprecation cycle.

    Rationale: These classes were never wired into any backend or session routing — there is no production caller to protect. @frreiss (who wrote this code) has signed off on removal, satisfying @jakelorocco's condition. Adding deprecation shims and warning-firing tests would be investment in code with no users; PR #1165 was already closed to avoid exactly that.

    Source deletions

    Entire granite3/ subtree becomes dead once the subdirs go:

    • mellea/formatters/granite/granite3/granite32/ (full subdir)
    • mellea/formatters/granite/granite3/granite33/ (full subdir)
    • mellea/formatters/granite/granite3/input.py — Granite3InputProcessor, only used by granite32/33
    • mellea/formatters/granite/granite3/output.py — output helpers, only used by granite32/33
    • mellea/formatters/granite/granite3/constants.py — only used by granite32/33
    • mellea/formatters/granite/granite3/types.py — Granite3Controls etc, only used by granite32/33 and the dying tests
    • mellea/formatters/granite/granite3/__init__.py

    mellea/formatters/granite/__init__.py — remove the six Granite32*/Granite33* imports and their __all__ entries.

    Test deletions

    Five test files go. Note: test_granite33_output.py was missing from the issue body — it exists and must also be removed.

    • test_granite32_input.py
    • test_granite32_output.py
    • test_granite33_input.py
    • test_granite33_output.py ← not listed in issue, but present
    • test_granite3_shared.py — mostly granite3 output tests, but contains TestNltkCheck (covers base.optional.nltk_check) which has no other coverage

    Rescue: TestNltkCheck is extracted into a new test/formatters/granite/base/test_base_optional.py before the shared file is deleted. TestFindSubstringInText in the shared file is redundant with test_base_util.py and is dropped.

  7. self-assigned this
    on Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/formatterchorep2refactor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions