Skip to content

Semantic projection#14

Open
gkennos wants to merge 4 commits into
mainfrom
semantic_projection
Open

Semantic projection#14
gkennos wants to merge 4 commits into
mainfrom
semantic_projection

Conversation

@gkennos

@gkennos gkennos commented Jul 19, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 by groundworkers.semantic_projection.enabled) and add a --tui CLI entry point for interactive exploration.
  • Add tests and documentation updates, plus dependency/lockfile updates for omop-semantics and 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 thread src/groundworkers/services/semantic_projection/tui_launcher.py Outdated
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:
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