Skip to content

fix(adapter-functions): remove deprecated context relevance intrinsic - #1579

Merged
planetf1 merged 3 commits into
generative-computing:mainfrom
planetf1:fix/1338-remove-context-relevance
Aug 25, 2026
Merged

planetf1 merged 3 commits into
generative-computing:mainfrom
planetf1:fix/1338-remove-context-relevance

Conversation

@planetf1

Copy link
Copy Markdown
Contributor

Pull Request

Description

Removes the deprecated RAG check_context_relevance() helper and its Granite
4.0-only adapter surface. This clears the unavailable API from registration,
tests, fixtures, examples, and direct documentation, so users are no longer
directed to an adapter without current-model support.

This is cleanup for epic #929, scheduled for the next minor release. It deliberately retains Guardian's separate CRITERIA_BANK["context_relevance"] criterion: that is an independently supported Guardian check, not the removed RAG adapter function.

Removed surface

  • rag.check_context_relevance() and its adapter catalogue entry
  • Associated contract, formatter, and qualitative tests and fixtures
  • The intrinsic example and direct RAG documentation references
  • The obsolete deprecation-warning configuration

Design notes

There is no direct adapter replacement because this capability was only available
for Granite 4.0 and has no maintained Granite 4.1 implementation. Guardian
criteria using the same name remain in scope and unchanged.

Issue

Fixes #1338

Testing

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

No new behaviour was added; the obsolete coverage and fixtures were removed.

  • uv run pytest test/ -m "not qualitative" — 4,013 passed, 48 skipped, 128 deselected, 2 xfailed, 1 xpassed
  • uv run ruff format --check . && uv run ruff check . — passed
  • uv run mypy . — passed
  • Targeted Markdownlint for docs/docs/advanced/intrinsics.md — passed
  • Whole-documentation Markdownlint has 12 unchanged MD060 failures in unrelated files

Attribution

  • AI coding assistants used

Adding a new component, requirement, sampling strategy, or tool?

  • Component
  • Requirement
  • Sampling Strategy
  • Tool

NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.

@github-actions github-actions Bot added the bug Something isn't working label Aug 24, 2026
@planetf1
planetf1 marked this pull request as ready for review August 24, 2026 10:27
@planetf1
planetf1 requested a review from a team as a code owner August 24, 2026 10:27

@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; will hold off on approving until the nits are commented on / addressed


@pytest.mark.qualitative
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
def test_context_relevance(backend_4_0):

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.

I believe the fixture being used here isn't used by another tests. I think we can remove it.

stacklevel=2,
)
question, context = _resolve_question(question, context, backend)
document = _coerce_to_document(document)

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.

I think all the other adapters use coerce_to_documentS. Can we remove this function?

Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
Assisted-by: Codex
Signed-off-by: Nigel Jones <[email protected]>
@planetf1
planetf1 force-pushed the fix/1338-remove-context-relevance branch from 5dad43a to ebb5eba Compare August 25, 2026 11:39
@planetf1
planetf1 added this pull request to the merge queue Aug 25, 2026
Merged via the queue into generative-computing:main with commit 1c48733 Aug 25, 2026
11 checks passed
@planetf1
planetf1 deleted the fix/1338-remove-context-relevance branch August 25, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated check_context_relevance and context_relevance adapter

2 participants