Skip to content

feat: Move functionality of granite-common to mellea#571

Merged
jakelorocco merged 5 commits into
generative-computing:mainfrom
frreiss:granite_common
Mar 4, 2026
Merged

feat: Move functionality of granite-common to mellea#571
jakelorocco merged 5 commits into
generative-computing:mainfrom
frreiss:granite_common

Conversation

@frreiss

@frreiss frreiss commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Move the functionality of https://github.com/ibm-granite/granite-common to Mellea. Place the new code under mellea.formatters. Update existing code in Mellea to use the imported code. Remove the dependency on the granite-common package.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
chore: Merge changes from main
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
@frreiss
frreiss requested a review from jakelorocco March 4, 2026 01:21
@frreiss
frreiss requested a review from a team as a code owner March 4, 2026 01:21
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify

mergify Bot commented Mar 4, 2026

Copy link
Copy Markdown

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@jakelorocco jakelorocco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; tests pass and ran intrinsic tests locally too

@jakelorocco
jakelorocco added this pull request to the merge queue Mar 4, 2026
Merged via the queue into generative-computing:main with commit 6901c93 Mar 4, 2026
9 checks passed
ajbozarth added a commit to ajbozarth/mellea that referenced this pull request Mar 5, 2026
- Fix incorrect **kwargs type annotation in elasticsearch.py (dict[str, int] -> Any)
- Remove unnecessary type: ignore comments for imports now in pyproject.toml
- Update CI pre-commit cache key to include uv.lock hash
- Ensures MyPy re-checks files when dependencies change

Fixes type errors introduced in generative-computing#571 that were masked by stale CI cache.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
ajbozarth added a commit to ajbozarth/mellea that referenced this pull request Mar 5, 2026
- Fix incorrect **kwargs type annotation in elasticsearch.py (dict[str, int] -> Any)
- Remove unnecessary type: ignore comments for imports now in pyproject.toml
- Update CI pre-commit cache key to include uv.lock hash
- Ensures MyPy re-checks files when dependencies change

Fixes type errors introduced in generative-computing#571 that were masked by stale CI cache.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 5, 2026
- Fix incorrect **kwargs type annotation in elasticsearch.py (dict[str, int] -> Any)
- Remove unnecessary type: ignore comments for imports now in pyproject.toml
- Update CI pre-commit cache key to include uv.lock hash
- Ensures MyPy re-checks files when dependencies change

Fixes type errors introduced in #571 that were masked by stale CI cache.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
planetf1 pushed a commit to planetf1/mellea that referenced this pull request Mar 6, 2026
…uting#571)

* Fix broken tests

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>

* Update test outputs for upstream bug fix

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>

* Import code from granite-common

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>

---------

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
planetf1 pushed a commit to planetf1/mellea that referenced this pull request Mar 6, 2026
…rative-computing#579)

- Fix incorrect **kwargs type annotation in elasticsearch.py (dict[str, int] -> Any)
- Remove unnecessary type: ignore comments for imports now in pyproject.toml
- Update CI pre-commit cache key to include uv.lock hash
- Ensures MyPy re-checks files when dependencies change

Fixes type errors introduced in generative-computing#571 that were masked by stale CI cache.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
ink-pad added a commit to ink-pad/mellea that referenced this pull request Mar 16, 2026
Upstream PR generative-computing#571 renamed GraniteCommonAdapter to IntrinsicAdapter.
Update our _util.py to match before rebasing onto origin/main.
ink-pad added a commit to ink-pad/mellea that referenced this pull request Mar 17, 2026
Upstream PR generative-computing#571 renamed GraniteCommonAdapter to IntrinsicAdapter.
Update our _util.py to match before rebasing onto origin/main.
github-merge-queue Bot pushed a commit that referenced this pull request Mar 17, 2026
* Add uncertainty/certainty intrinsic support

Wire up the uncertainty intrinsic from ibm-granite/granite-lib-core-r1.0
with a high-level check_certainty() API. The intrinsic evaluates model
confidence in its response given a user question and assistant answer.

- Add check_certainty(context, backend) in core.py
- Extract shared call_intrinsic() helper into _util.py
- Update catalog to point uncertainty at granite-lib-core-r1.0
- Add test, example, and README entry

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Fix uncertainty description in README

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Rename _call_intrinsic to call_intrinsic

Drop the underscore prefix and alias — use call_intrinsic consistently
across _util.py, rag.py, core.py, and test_rag.py.

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Rename GraniteCommonAdapter to IntrinsicAdapter in _util.py

Upstream PR #571 renamed GraniteCommonAdapter to IntrinsicAdapter.
Update our _util.py to match before rebasing onto origin/main.

* Feat/requirement_check (#1)

* Add uncertainty/certainty intrinsic support

Wire up the uncertainty intrinsic from ibm-granite/granite-lib-core-r1.0
with a high-level check_certainty() API. The intrinsic evaluates model
confidence in its response given a user question and assistant answer.

- Add check_certainty(context, backend) in core.py
- Extract shared call_intrinsic() helper into _util.py
- Update catalog to point uncertainty at granite-lib-core-r1.0
- Add test, example, and README entry

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Fix uncertainty description in README

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Rename _call_intrinsic to call_intrinsic

Drop the underscore prefix and alias — use call_intrinsic consistently
across _util.py, rag.py, core.py, and test_rag.py.

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* test

* removed test file

* added req check intrinsic

* Update README.md

* Update _util.py

* updated files

---------

Co-authored-by: ink-pad <inkit.padhi@gmail.com>
Co-authored-by: manish-nagireddy <manish.nagireddy@ibm.com>

* fix: add comment on repo structures

* fix: linting

* fix rc repo name

* resolve rc references

* fix: field ref in req check intrinsic

---------

Co-authored-by: inkpad <inkit.padhi@ibm.com>
Co-authored-by: Manish Nagireddy <65432909+mnagired@users.noreply.github.com>
Co-authored-by: manish-nagireddy <manish.nagireddy@ibm.com>
Co-authored-by: jakelorocco <59755218+jakelorocco@users.noreply.github.com>
akihikokuroda pushed a commit to akihikokuroda/mellea that referenced this pull request May 27, 2026
…uting#571)

* Fix broken tests

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>

* Update test outputs for upstream bug fix

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>

* Import code from granite-common

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>

---------

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
akihikokuroda pushed a commit to akihikokuroda/mellea that referenced this pull request May 27, 2026
…rative-computing#579)

- Fix incorrect **kwargs type annotation in elasticsearch.py (dict[str, int] -> Any)
- Remove unnecessary type: ignore comments for imports now in pyproject.toml
- Update CI pre-commit cache key to include uv.lock hash
- Ensures MyPy re-checks files when dependencies change

Fixes type errors introduced in generative-computing#571 that were masked by stale CI cache.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
akihikokuroda pushed a commit to akihikokuroda/mellea that referenced this pull request May 27, 2026
…g#551)

* Add uncertainty/certainty intrinsic support

Wire up the uncertainty intrinsic from ibm-granite/granite-lib-core-r1.0
with a high-level check_certainty() API. The intrinsic evaluates model
confidence in its response given a user question and assistant answer.

- Add check_certainty(context, backend) in core.py
- Extract shared call_intrinsic() helper into _util.py
- Update catalog to point uncertainty at granite-lib-core-r1.0
- Add test, example, and README entry

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Fix uncertainty description in README

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Rename _call_intrinsic to call_intrinsic

Drop the underscore prefix and alias — use call_intrinsic consistently
across _util.py, rag.py, core.py, and test_rag.py.

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Rename GraniteCommonAdapter to IntrinsicAdapter in _util.py

Upstream PR generative-computing#571 renamed GraniteCommonAdapter to IntrinsicAdapter.
Update our _util.py to match before rebasing onto origin/main.

* Feat/requirement_check (generative-computing#1)

* Add uncertainty/certainty intrinsic support

Wire up the uncertainty intrinsic from ibm-granite/granite-lib-core-r1.0
with a high-level check_certainty() API. The intrinsic evaluates model
confidence in its response given a user question and assistant answer.

- Add check_certainty(context, backend) in core.py
- Extract shared call_intrinsic() helper into _util.py
- Update catalog to point uncertainty at granite-lib-core-r1.0
- Add test, example, and README entry

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Fix uncertainty description in README

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* Rename _call_intrinsic to call_intrinsic

Drop the underscore prefix and alias — use call_intrinsic consistently
across _util.py, rag.py, core.py, and test_rag.py.

Co-Authored-By: ink-pad <inkit.padhi@gmail.com>

* test

* removed test file

* added req check intrinsic

* Update README.md

* Update _util.py

* updated files

---------

Co-authored-by: ink-pad <inkit.padhi@gmail.com>
Co-authored-by: manish-nagireddy <manish.nagireddy@ibm.com>

* fix: add comment on repo structures

* fix: linting

* fix rc repo name

* resolve rc references

* fix: field ref in req check intrinsic

---------

Co-authored-by: inkpad <inkit.padhi@ibm.com>
Co-authored-by: Manish Nagireddy <65432909+mnagired@users.noreply.github.com>
Co-authored-by: manish-nagireddy <manish.nagireddy@ibm.com>
Co-authored-by: jakelorocco <59755218+jakelorocco@users.noreply.github.com>
planetf1 added a commit to planetf1/mellea that referenced this pull request Jun 24, 2026
…enerative-computing#1304)

The Granite32InputProcessor, Granite32OutputProcessor, Granite32ChatCompletion,
Granite33InputProcessor, Granite33OutputProcessor, and Granite33ChatCompletion
classes were carried over from granite-common (generative-computing#571) but never wired into any
backend or session routing. Mellea operates at the action/context level via
intrinsic processors; the chat-message-level Granite3x pipeline was never used.

Deletes the entire mellea/formatters/granite/granite3/ subtree (15 files),
removes the six re-exported symbols from the top-level granite/__init__.py,
and deletes the five test files that covered only this dead code. The
nltk_check tests (base.optional) from the shared test file are rescued into
test/formatters/granite/base/test_base_optional.py before deletion.

Domain owner sign-off: frreiss confirmed removal in issue generative-computing#1304.
Closes generative-computing#1304.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
AngeloDanducci pushed a commit to AngeloDanducci/mellea that referenced this pull request Jun 24, 2026
…enerative-computing#1337)

* refactor(formatters): remove unused Granite32/33 processor classes (generative-computing#1304)

The Granite32InputProcessor, Granite32OutputProcessor, Granite32ChatCompletion,
Granite33InputProcessor, Granite33OutputProcessor, and Granite33ChatCompletion
classes were carried over from granite-common (generative-computing#571) but never wired into any
backend or session routing. Mellea operates at the action/context level via
intrinsic processors; the chat-message-level Granite3x pipeline was never used.

Deletes the entire mellea/formatters/granite/granite3/ subtree (15 files),
removes the six re-exported symbols from the top-level granite/__init__.py,
and deletes the five test files that covered only this dead code. The
nltk_check tests (base.optional) from the shared test file are rescued into
test/formatters/granite/base/test_base_optional.py before deletion.

Domain owner sign-off: frreiss confirmed removal in issue generative-computing#1304.
Closes generative-computing#1304.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>

* docs(metrics): remove stale Granite3x entries from coverage snapshot

Removes the 15 mellea.formatters.granite.granite3* module entries that
no longer exist after the previous commit deleted the granite3/ subtree.
Updates total_symbols and coverage_percentage accordingly.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>

* docs(metrics): remove Granite32/33 from parent granite formatter entry

The previous commit pruned the granite3/* submodule keys but missed the
parent mellea.formatters.granite block, which still listed all six removed
symbols. This commit removes them and updates the symbol count (2035→2029)
and coverage percentage (15.38→15.43%) accordingly.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>

* refactor(formatters): remove find_substring_in_text now dead after granite3 removal

The only non-test consumers of find_substring_in_text lived in
granite3/output.py, which was deleted in the previous commits.
Remove the function and its dedicated test file; drop the now-unused
re import from base/util.py.

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>

---------

Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants