Skip to content

fix(docs): update CLAUDE.md#973

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
falox:fix-claude-md
Jan 9, 2026
Merged

fix(docs): update CLAUDE.md#973
tisnik merged 1 commit intolightspeed-core:mainfrom
falox:fix-claude-md

Conversation

@falox
Copy link
Copy Markdown
Contributor

@falox falox commented Jan 9, 2026

Description

Updated CLAUDE.md documentation to reflect the current codebase structure

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: Claude
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • New Features

    • Authentication module renamed and expanded to support additional identity provider integration.
    • Public client and configuration APIs now expose singleton-style wrappers for simpler usage.
    • Added shared constants and new quota/database model surfaces to the public API.
  • Documentation

    • Updated coding standards and import examples to reflect reorganized public module paths.
  • Chores

    • Project structure reorganized for clarity and linting/tooling rules updated accordingly.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jan 9, 2026

Hi @falox. Thanks for your PR.

I'm waiting for a lightspeed-core member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 9, 2026

Walkthrough

Project structure and public API reorganized: auth/ renamed to authentication/ (adds rh-identity); new top-level src/constants.py; responses.py moved under src/models/ and models/database/ added; client.py and configuration.py changed to Singleton-style exports; import paths and lint exclusions updated.

Changes

Cohort / File(s) Summary
Top-level docs
CLAUDE.md
Documents structural and public-API changes: auth→authentication rename, new constants, models rework, and Singleton patterns for client/configuration.
Public modules / entry points
src/client.py, src/configuration.py, src/constants.py
client.py and configuration.py now expose Singleton wrappers; new constants.py introduces shared public constants.
Authentication module
src/authentication/... (formerly src/auth/...)
Directory rename from auth to authentication; scope extended to include rh-identity; import examples updated accordingly.
Models & database
src/models/..., src/models/database/..., src/models/responses.py
responses.py moved under models/; new models/database/ submodule added.
Linting / tooling configs
(pyright exclusions and docs references)
Updated exclusions and tooling references to reflect new src/authentication/k8s.py path and deprecated endpoints; references to constants.py added.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • tisnik
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating documentation in CLAUDE.md to reflect current codebase structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
CLAUDE.md (1)

30-31: Consider expanding module standards for new modules (quota, metrics).

The project structure has been updated to include quota/ and metrics/ folders, but the module standards section (lines 44–119) does not provide guidance on patterns, conventions, or expectations for these new modules. While this may be intentional, consider adding brief sections describing their expected structure and patterns as the codebase evolves.

Also applies to: 58-58

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3467ee and d7b12b8.

📒 Files selected for processing (1)
  • CLAUDE.md
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2026-01-09T09:40:04.682Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.682Z
Learning: Applies to **/*.py : Llama Stack imports should use: `from llama_stack_client import AsyncLlamaStackClient`

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Applies to src/app/endpoints/**/*.py : Use FastAPI `HTTPException` with appropriate status codes for API endpoints and handle `APIConnectionError` from Llama Stack

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.682Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.682Z
Learning: Applies to **/*.py : Use absolute imports for internal modules: `from auth import get_auth_dependency`

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Run `uv run make verify` to execute all linters (black, pylint, pyright, ruff, docstyle) before completion

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Applies to pyrightconfig.json : Configure pyright to exclude `src/auth/k8s.py` from type checking

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Applies to .pylintrc : Configure pylint with `source-roots = "src"`

Applied to files:

  • CLAUDE.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: E2E: server mode / ci
  • GitHub Check: E2E: library mode / ci
🔇 Additional comments (3)
CLAUDE.md (3)

47-47: Import path update is correct and well-integrated.

The absolute import path has been correctly updated from from auth import to from authentication import to reflect the directory rename, and the new guideline to check constants.py for shared constants is appropriately placed alongside import standards.

Also applies to: 52-52


176-176: Clarify pyright exclusion configuration for deprecated Agent API v1 endpoints.

The documentation has been correctly updated to exclude src/authentication/k8s.py (reflecting the directory rename), but the addition of "deprecated Agent API v1 endpoints" lacks specificity. Clarify what files or patterns constitute these deprecated endpoints and how they should be configured in pyrightconfig.json.


39-40: No issues found. Both client.py and configuration.py correctly implement the Singleton pattern:

  • client.py uses metaclass=Singleton on the AsyncLlamaStackClientHolder class
  • configuration.py uses the __new__ method override in the AppConfig class

The documentation in CLAUDE.md accurately reflects the actual implementation.

Copy link
Copy Markdown
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

LGTM

Reflected authentication module renaming and improved structure

Signed-off-by: Alberto Falossi <afalossi@redhat.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CLAUDE.md (1)

6-11: Clarify tool naming conventions in documentation to match Makefile.

Line 11 correctly lists the targets executed by uv run make verify. However, the detailed Linting Tools section (lines 175–179) uses different names for the same tools:

  • docstyle (Makefile target) is the tool pydocstyle (line 178)
  • check-types (Makefile target) is the tool mypy (line 179)

Use consistent naming throughout: either always use Makefile target names (docstyle, check-types) or always use the underlying tool names (pydocstyle, mypy). Currently, line 11 uses target names while the detailed section mixes both conventions, which may confuse developers about which commands to run.

🧹 Nitpick comments (1)
CLAUDE.md (1)

46-52: Import paths correctly reflect module reorganization; add guidance on Singleton usage.

The absolute import example is properly updated to from authentication import get_auth_dependency, and the reference to check constants.py before defining new ones promotes consistency. However, since client.py and configuration.py are documented as Singletons (lines 39–40), consider adding a brief usage example (e.g., how to access the singleton instance) to guide developers.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7b12b8 and cf48572.

📒 Files selected for processing (1)
  • CLAUDE.md
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.682Z
Learning: Applies to **/*.py : Use absolute imports for internal modules: `from auth import get_auth_dependency`
📚 Learning: 2026-01-09T09:40:04.682Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.682Z
Learning: Applies to **/*.py : Llama Stack imports should use: `from llama_stack_client import AsyncLlamaStackClient`

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Applies to src/app/endpoints/**/*.py : Use FastAPI `HTTPException` with appropriate status codes for API endpoints and handle `APIConnectionError` from Llama Stack

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.682Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.682Z
Learning: Applies to **/*.py : Use absolute imports for internal modules: `from auth import get_auth_dependency`

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Run `uv run make verify` to execute all linters (black, pylint, pyright, ruff, docstyle) before completion

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Applies to pyrightconfig.json : Configure pyright to exclude `src/auth/k8s.py` from type checking

Applied to files:

  • CLAUDE.md
📚 Learning: 2026-01-09T09:40:04.683Z
Learnt from: CR
Repo: lightspeed-core/lightspeed-stack PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-09T09:40:04.683Z
Learning: Applies to .pylintrc : Configure pylint with `source-roots = "src"`

Applied to files:

  • CLAUDE.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build-pr
  • GitHub Check: mypy
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: unit_tests (3.12)
  • GitHub Check: Pylinter
  • GitHub Check: E2E: library mode / ci
  • GitHub Check: E2E: server mode / ci
🔇 Additional comments (3)
CLAUDE.md (3)

15-42: Project structure accurately reflects new module organization.

The restructuring from auth/authentication/, addition of quota/ and metrics/ directories, and relocation of responses.py are all properly documented. The new constants.py and explicit Singleton pattern notes for client.py and configuration.py are clear.


173-179: Linting tools section properly updated with new authentication module path.

The pyright exclusion is correctly updated to src/authentication/k8s.py (reflecting the module rename), and pylint configuration matches required guidance. The detailed tool descriptions are clear and accurate.


67-90: Function standards align with project guidance on error handling and async patterns.

The documentation correctly references FastAPI HTTPException with appropriate status codes and handling of APIConnectionError from Llama Stack. Examples are clear and reinforce best practices.


Summary

This documentation update properly reflects the codebase restructuring (particularly the auth/authentication/ rename and addition of new modules like quota/, metrics/, and the centralized constants.py). The import examples and pyright exclusion paths are correctly updated.

Critical finding: There is a major inconsistency between the linter lists on line 11 and lines 175–179 that must be resolved before merging. The quick reference mentions "docstyle" and "check-types," which don't align with the detailed Linting Tools section that lists "pydocstyle" and "mypy." Additionally, "check-types" is not explained elsewhere in the document. Please verify against the actual Makefile to ensure both sections document the same definitive linter set.

Optional enhancement: Consider adding brief usage examples for the Singleton patterns introduced in client.py and configuration.py to guide developers on how to access and use these singleton instances.

@tisnik
Copy link
Copy Markdown
Contributor

tisnik commented Jan 9, 2026

/ok-to-test

@tisnik
Copy link
Copy Markdown
Contributor

tisnik commented Jan 9, 2026

/ok-to-test

@tisnik tisnik merged commit 4e5629e into lightspeed-core:main Jan 9, 2026
20 of 23 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Mar 2, 2026
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants