Skip to content

Support optional project context in skill suggestion (#299) - #202

Merged
DaniloTatti merged 1 commit into
devfrom
feature/299-skill-suggest-optional-project
Sep 20, 2026
Merged

DaniloTatti merged 1 commit into
devfrom
feature/299-skill-suggest-optional-project

Conversation

@DaniloTatti

Copy link
Copy Markdown
Contributor

Summary

Closes part of SprintStartProject/Wiki#299 (Skill suggestion integration).

Relaxes the projectId requirement on POST /api/v1/skills/suggest so roles without project scoping (person-level / global roles) can request AI skill suggestions.

Changes

  • Schema (src/api/schemas.py): SkillSuggestionRequest now inherits BaseModel directly and makes project_id: ProjectId | None = Field(default=None, alias="projectId") optional.
  • Domain logic (src/skills/suggestion.py):
    • suggest_skills accepts project_id: str | None = None.
    • Guarded RAG retrieval: hybrid_retrieve only runs when project_id is not None and store.count() > 0. When project_id is absent, retrieval is skipped (preserving fail-closed scoping against cross-project retrieval).
    • Grounding gate behavior: without retrieved chunks, project-specific skills citing unretrieved chunks are dropped as ungrounded, while catalog/role-based universal skills pass through cleanly.
  • Tests:
    • tests/skills/test_suggestion.py: asserts retrieval is skipped and zero store queries happen when project_id=None.
    • tests/api/test_skills.py: end-to-end API test verifying POST /api/v1/skills/suggest succeeds with 200 without projectId and returns universal suggestions.

@DaniloTatti
DaniloTatti merged commit 062520b into dev Sep 20, 2026
4 checks passed
@LinseCed
LinseCed deleted the feature/299-skill-suggest-optional-project branch September 21, 2026 15:04
@DaniloTatti
DaniloTatti restored the feature/299-skill-suggest-optional-project branch September 22, 2026 04:44
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