Semantic projection#14
Open
gkennos wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new deterministic “semantic projection” capability to groundworkers: projecting an already-grounded OMOP concept into one or more CDM rows via omop-semantics, optionally exposing an interactive TUI, and wiring everything behind a staged-rollout config flag.
Changes:
- Add
SemanticProjectionService+ definition catalogue + request/response models for deterministic projection. - Register a new MCP tool
semantic_project(gated bygroundworkers.semantic_projection.enabled) and add a--tuiCLI entry point for interactive exploration. - Add tests and documentation updates, plus dependency/lockfile updates for
omop-semanticsand TUI-related packages.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Locks new runtime/dev dependencies pulled in by omop-semantics + TUI support. |
pyproject.toml |
Adds omop-semantics dependency and a tui extra; adds textual to dev deps. |
src/groundworkers/config.py |
Introduces SemanticProjectionConfig and exposes it via AppConfig.semantic_projection. |
src/groundworkers/server.py |
Registers semantic_project tool behind config; adds --tui launcher flow. |
src/groundworkers/services/semantic_projection/models.py |
Adds Pydantic request/result models for projection. |
src/groundworkers/services/semantic_projection/definitions.py |
Adds built-in output definitions and domain triggers. |
src/groundworkers/services/semantic_projection/service.py |
Implements the deterministic projection service and matching logic. |
src/groundworkers/services/semantic_projection/tui_launcher.py |
Adds TUI launcher and adapter function for the runtime. |
src/groundworkers/services/semantic_projection/__init__.py |
Exposes semantic projection public API surface. |
src/groundworkers/tools/semantic_projection_tools.py |
Adds the semantic_project MCP tool wrapper and error handling. |
tests/conftest.py |
Adds a shared src/ path insertion for tests. |
tests/unit/test_semantic_projection_tui_launcher.py |
Tests the TUI adapter function behavior vs direct service calls. |
tests/unit/test_semantic_projection_tools.py |
Tests MCP tool wrapper output/error behaviors with a stub service. |
tests/unit/test_semantic_projection_service.py |
Tests built-in definition behaviors and matching outcomes. |
tests/test_server_registry.py |
Tests --tui gating behavior based on semantic projection config flag. |
mkdocs.yaml |
Adds semantic projection pages to MkDocs navigation. |
docs/usage/configuration.md |
Documents --tui and the semantic_projection.enabled flag. |
docs/tools/semantic_projection.md |
Documents the new semantic_project tool contract and usage. |
docs/services/semantic_projection.md |
Documents SemanticProjectionService behavior and catalogue. |
docs/tools/overview.md |
Adds semantic projection to the tool overview and registration rules. |
docs/reference/ref_tools.md |
Adds API reference entry for semantic projection tools. |
docs/reference/ref_services.md |
Adds API reference entry for semantic projection service package. |
docs/architecture.md |
Updates architecture docs to mention the new service and composition exception. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+13
| from typing import Any | ||
|
|
||
| from pydantic import ValidationError | ||
|
|
||
| from groundworkers.base.errors import GroundworkersError | ||
| from groundworkers.base.server import GroundcrewServer | ||
| from groundworkers.services.semantic_projection.models import SemanticProjectionRequest | ||
| from groundworkers.services.semantic_projection.service import SemanticProjectionService | ||
|
|
||
|
|
||
| def register_semantic_projection_tools(server: GroundcrewServer, service: SemanticProjectionService) -> None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.