Skip to content

chore(terminology): adopt agreed Granite Switch / Mellea glossary (#1192)#1256

Draft
planetf1 wants to merge 3 commits into
generative-computing:mainfrom
planetf1:worktree-issue-1192
Draft

chore(terminology): adopt agreed Granite Switch / Mellea glossary (#1192)#1256
planetf1 wants to merge 3 commits into
generative-computing:mainfrom
planetf1:worktree-issue-1192

Conversation

@planetf1

@planetf1 planetf1 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The Epic #929 team agreed a canonical glossary for Granite Switch / Mellea naming, but most existing prose still used the old vocabulary — "intrinsic", "activated-LoRA", "Project Granite Switch". This PR sweeps the Phase 0 code files, AGENTS.md, and the reference glossary to use the agreed terms consistently, before Phase 1 contributors carry old vocabulary into new work.

Python symbol names (IntrinsicAdapter, fetch_intrinsic_metadata, etc.) and import paths are untouched — those renames are deliberately deferred to Phase 1 (#1136) and Phase 4 (#1144). The prose/symbol mismatch that results is intentional and documented in the glossary's Intrinsic entry.

Where this fits

Epic #929 — adapter lifecycle. Sits before Phase 1 (#1136 symbol renames) and addresses the "Done when" items of #1192 directly.

Fixes #1192

Changes

mellea/backends/adapters/ (4 files) + mellea/stdlib/components/adapter_based_component/__init__.py

  • Comments and docstrings only; no symbol renames
  • "intrinsic function" → "adapter function" in all free prose
  • "Activated LoRA" → "aLoRA" in the AdapterType.ALORA enum doc
  • catalog.py Field(description=...) strings updated (user-visible prose)

AGENTS.md

  • Section ## 13. Working with Intrinsics## 14. Working with Adapter Functions
  • Fixes a duplicate ## 13 heading (was two sections both numbered 13)
  • Import paths, Intrinsic class name, docs/examples/intrinsics/ path unchanged

docs/docs/reference/glossary.md

  • Rewrites the aLoRA entry with the agreed KV-cache-sharing definition (cache hits, not "cache rewrite")
  • Rewrites the Granite Switch entry with the agreed architecture definition
  • Updates the Intrinsic entry to point to Adapter function as canonical, noting Intrinsic is the current Python name pending Phase 1/4
  • Adds 8 new entries: Adapter function, Adapter, Capability, Checkpoint, Granite Libraries (with Core/RAG/Guardian table), Granite Switch composer, Mellea, and a References section

Testing

  • uv run ruff format + uv run ruff check — clean
  • uv run pytest test/ -m "not qualitative" — 2083 passed, 7 pre-existing failures (missing huggingface_hub extra — unrelated to this PR, confirmed by stash test)
  • markdownlint (docs) pre-commit hook — passed

@ajbozarth ajbozarth 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 on the executable-code side — pure prose changes, zero risk surface, and the new glossary entries read well. Two things before merge:

  1. The terminology sweep missed a number of prose hits across the repo. Some are inside files this PR already touches (worth fixing here); others are scattered across backends, docstrings, and integration docs (Phase 0 follow-up — your call whether to fold in or defer).
  2. Alphabetical ordering nit on the new Adapter / Adapter function entries — left as a separate inline suggestion.

Note: The replacements below were generated by an AI assistant scanning for the old vocabulary; they reflect the conventions established by this PR's own diff (aLoRA adapter(s) for the plural, adapter function for prose) but may not be 100% correct in every case. Treat the table as a checklist to review, not a mechanical patch — sentence flow may need tweaks beyond the literal find/replace, and a couple of judgment calls are flagged at the bottom.

Remaining old vocabulary

In files this PR already modifies (recommend fixing here)
File Line Find Replace with
docs/docs/reference/glossary.md 382 A Guardian Intrinsic function that A Guardian adapter function that
docs/docs/reference/glossary.md 398 A Guardian Intrinsic function that A Guardian adapter function that
docs/docs/reference/glossary.md 412 A Guardian Intrinsic function that A Guardian adapter function that
docs/docs/reference/glossary.md 458 A Guardian Intrinsic function that A Guardian adapter function that
Out of scope for this PR (file a follow-up issue, or fold in if you'd rather sweep once)

Library code — module/function docstrings:

File Line Find Replace with
mellea/stdlib/components/intrinsic/core.py 1 Intrinsic functions for core model capabilities. Adapter functions for core model capabilities.
mellea/stdlib/components/intrinsic/core.py 15 Intrinsic function that evaluates Adapter function that evaluates
mellea/stdlib/components/intrinsic/core.py 35 Intrinsic function that determines Adapter function that determines
mellea/stdlib/components/intrinsic/core.py 62 Intrinsic function that finds Adapter function that finds
mellea/stdlib/components/intrinsic/rag.py 1 Intrinsic functions related to retrieval-augmented generation. Adapter functions related to retrieval-augmented generation.
mellea/stdlib/components/intrinsic/rag.py 21 Intrinsic function that checks whether the question Adapter function that checks whether the question
mellea/stdlib/components/intrinsic/rag.py 54 Intrinsic function that rewrites Adapter function that rewrites
mellea/stdlib/components/intrinsic/rag.py 82 Intrinsic function that determines Adapter function that determines
mellea/stdlib/components/intrinsic/rag.py 119 Intrinsic function that finds Adapter function that finds
mellea/stdlib/components/intrinsic/rag.py 165 Intrinsic function that checks whether a single document Adapter function that checks whether a single document
mellea/stdlib/components/intrinsic/rag.py 204 Intrinsic function that checks whether the sentences Adapter function that checks whether the sentences
mellea/stdlib/components/intrinsic/guardian.py 1 Intrinsic functions for Guardian safety and hallucination detection. Adapter functions for Guardian safety and hallucination detection.
mellea/stdlib/components/intrinsic/guardian.py 246 Intrinsic function that evaluates the factuality Adapter function that evaluates the factuality
mellea/stdlib/components/intrinsic/guardian.py 262 Intrinsic function that corrects Adapter function that corrects

Library code — backend "Activated LoRA" / "ALora" prose:

File Line Find Replace with
mellea/backends/huggingface.py 3 Span-based context or ALoras Span-based context or aLoRA adapters
mellea/backends/huggingface.py 242 This backend also supports Activated LoRAs (ALoras)](https://arxiv.org/pdf/2504.12397). This backend also supports [aLoRA adapters](https://arxiv.org/pdf/2504.12397).
mellea/backends/litellm.py 318 The LiteLLM backend does not support activated LoRAs. The LiteLLM backend does not support aLoRA adapters.
mellea/backends/watsonx.py 378 The watsonx backend does not support currently support activated LoRAs. The watsonx backend does not currently support aLoRA adapters.
mellea/backends/ollama.py 392 The ollama backend does not support currently support activated LoRAs. The ollama backend does not currently support aLoRA adapters.
mellea/core/requirement.py 263 This includes ALora because This includes aLoRA because

Docs:

File Line Find Replace with
docs/docs/integrations/openai.md 264 these adapters enable intrinsic functions these adapters enable adapter functions
docs/docs/integrations/openai.md 293 The high-level intrinsic wrappers The high-level adapter function wrappers
docs/docs/integrations/openai.md 295 for the full list of available intrinsics. for the full list of available adapter functions.
docs/docs/integrations/openai.md 299 Only intrinsics Only adapter functions
docs/docs/integrations/huggingface.md 86 [Activated LoRA (aLoRA)] [aLoRA]
docs/docs/integrations/huggingface.md 90 For intrinsics without local GPU requirements For adapter functions without local GPU requirements
docs/docs/integrations/huggingface.md 92 [Intrinsics](../advanced/intrinsics) [Adapter Functions](../advanced/intrinsics.md)
docs/docs/advanced/lora-and-alora-adapters.md 21 pre-trained intrinsic adapters embedded pre-trained adapter functions embedded
docs/docs/advanced/lora-and-alora-adapters.md 23 See [Intrinsics](./intrinsics) for details. See [Adapter Functions](./intrinsics.md) for details.
docs/docs/advanced/lora-and-alora-adapters.md 107 as a Mellea intrinsic (so that it can as a Mellea adapter function (so that it can
docs/docs/advanced/lora-and-alora-adapters.md 163 [Intrinsics](./intrinsics) [Adapter Functions](./intrinsics.md)
docs/docs/advanced/prefix-caching-and-kv-blocks.md 135 [Intrinsics](./intrinsics) [Adapter Functions](./intrinsics.md)
Intentionally not flagged
  • The --intrinsic CLI flag and mellea/stdlib/components/intrinsic/ import paths in docs/docs/advanced/lora-and-alora-adapters.md and AGENTS.md — these are symbol/path names, deferred to Phase 1 per the PR description.
  • docs/docs/api/mellea/backends/adapters/adapter.mdx — autogenerated; will refresh from source on the next docs build.
  • glossary.md:54aLoRA (Activated LoRA) is the entry's own definitional expansion, not stale prose.
Judgment calls flagged for review
  • The watsonx.py:378 and ollama.py:392 strings contain a duplicated "does not support currently support" — strict scope is terminology only, but fixing the duplication while you're touching the line is cheap. Drop the typo fix from the replacement if you'd rather keep the PR minimal.
  • lora-and-alora-adapters.md and huggingface.md doc cross-links currently lack the .md suffix that docs/CONTRIBUTING_DOCS.md requires. Adding it where we're already touching the line is consistent; ignore those columns if you'd rather keep the link-suffix sweep separate.
Verification command

After applying the table, this should return zero hits within prose (excluding paths/symbols):

grep -rnE "intrinsic function|Intrinsic function|Activated LoRA|activated[- ]LoRA|\bALoras?\b" \
  mellea/ docs/docs/ \
  | grep -v "/test/" \
  | grep -v "\.mdx:" \
  | grep -v "stdlib\.components\.intrinsic\|formatters\.granite\.intrinsics"

Comment thread docs/docs/reference/glossary.md Outdated
planetf1 added 3 commits June 12, 2026 14:31
…nerative-computing#1192)

Sweeps the five Phase 0 adapter files, AGENTS.md, and the reference glossary
to use the canonical terms agreed under Epic generative-computing#929:
- "adapter function" replaces "intrinsic" / "intrinsic function" in prose
- "aLoRA" replaces "Activated LoRA" / "activated-LoRA"
- "Granite Switch" replaces "Project Granite Switch"
- "cache hit/miss" framing in the aLoRA glossary entry (never "cache rewrite")

Python symbol names (IntrinsicAdapter, fetch_intrinsic_metadata, etc.) and
import paths are untouched — those renames are Phase 1 (generative-computing#1136) / Phase 4 (generative-computing#1144).

Also adds the full agreed glossary set to docs/docs/reference/glossary.md:
Adapter function, Adapter, Capability, Checkpoint, Granite Libraries,
Granite Switch, Granite Switch composer, Mellea, and a References section.
Fixes the duplicate ## 13 heading in AGENTS.md (→ ## 14).

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
…ary (generative-computing#1192)

Address code review findings:
- adapter.py: fix four missed prose descriptions in EmbeddedIntrinsicAdapter
  and CustomIntrinsicAdapter (intrinsic_name param docs, __init__ docstring)
- adapter.py:202: lands → is merged (second TODO comment missed by replace-all)
- adapter.py:335: fix clunky doubled noun in EmbeddedIntrinsicAdapter init doc
- glossary.md aLoRA entry: rewrite to centre base-model KV-cache reuse /
  single-token activation (the fundamental mechanism), keep multi-adapter
  Granite Switch throughput benefit as secondary paragraph
- glossary.md: move ## Mellea above ## MelleaSession (alphabetical order)

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

- Fix Adapter / Adapter function glossary entry ordering (alphabetical)
- Replace "Guardian Intrinsic function" with "Guardian adapter function" in
  all four Guardian glossary entries and the GuardianCheck deprecation note
- Replace "Intrinsic function(s)" with "Adapter function(s)" in module and
  function docstrings: core.py, rag.py, guardian.py
- Replace "activated LoRAs" / "ALoras" with "aLoRA adapters" in backend
  error messages and docstrings: huggingface.py, litellm.py, watsonx.py,
  ollama.py; fix double-"support" typo in watsonx.py and ollama.py error
  messages
- Replace "ALora" with "aLoRA" in requirement.py comment
- Replace "intrinsic functions" / "intrinsic wrappers" / "intrinsics" prose
  in integration docs: openai.md, huggingface.md, lora-and-alora-adapters.md

Assisted-by: Claude Code
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
@planetf1 planetf1 force-pushed the worktree-issue-1192 branch from d35e06c to 71b418c Compare June 12, 2026 13:54
@planetf1 planetf1 marked this pull request as draft June 12, 2026 13:54
@planetf1

Copy link
Copy Markdown
Contributor Author

Still looking at some related usages around guardian

@ajbozarth ajbozarth 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.

All my review items have been addressed, LGTM

@planetf1

planetf1 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Remaining before merge

1. "Guardian adapter functions" — collective term needs confirmation

~12 occurrences of "Guardian Intrinsics" used as a group label remain unchanged in: `safety-guardrails.md`, `common-errors.md`, `metrics.md`, `concepts/architecture-vs-agents.md`, `examples/index.md`, `use-context-and-sessions.md`, `stdlib/requirements/safety/guardian.py`.

Not changed: the glossary defines per-function descriptions ("A Guardian adapter function") but does not give an agreed collective replacement. Options: "Guardian adapter functions", "Guardian Library", or keep "Guardian Intrinsics" as a proper-noun label.

2. Four cross-doc link anchors (may fit in followon issue)

All point to the still-titled "Intrinsics" page; deferred to Phase 1 page rename.

File Current Alex suggests
`docs/docs/integrations/huggingface.md:92` `Intrinsics` `Adapter Functions`
`docs/docs/advanced/lora-and-alora-adapters.md:23` `Intrinsics` `Adapter Functions`
`docs/docs/advanced/lora-and-alora-adapters.md:163` `Intrinsics` `Adapter Functions`
`docs/docs/advanced/prefix-caching-and-kv-blocks.md:135` `Intrinsics` `Adapter Functions`

Continuing next week & look for any additional omissions

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.

chore(terminology): adopt Granite Switch / Mellea glossary across Epic #929 and repo

2 participants