Integration/pr38 cohort methods#39
Merged
Merged
Conversation
…attributes to prevent collisions with regex during row sanitization - Added mcp_server/study_agent_mcp/tools/_service_registry.py:1 - Switched only mcp_server/study_agent_mcp/tools/_review_row.py:7 to use that helper - Left all other MCP services untouched - Added helper coverage in tests/test_service_registry_helper.py:1
- align step-by-step analytic-settings flow with ATLAS-style UX - separate core settings from remaining-defaults customization - add one-by-one customization for remaining defaults with ATLAS-style descriptions
- Add ACP/MCP/Core support for cohort_methods_intent_split - Add cohort methods prompt assets and multi-outcome split contract with outcome_statement compatibility field - Wire runStrategusCohortMethodsShell() to consume cohort methods intent split and remove hardcoded statement fallback - Add interactive multi-outcome confirmation and per-outcome recommendation handling - Add explicit cohort ID skip path for intent split, recommendation, and phenotype improvements - Harden LLM JSON parsing for schema-echo responses
Register a new MCP tool that ships the Theseus annotated template, a comment-stripped defaults spec, and the instruction/output-style blocks used by the upcoming /flows/cohort_methods_specifications_recommendation ACP flow. Also update the tools-registry test to include the new name.
…ract Replace nested cohort_definitions/concept-set fields with the flat IDs the cohort-methods R shell already sends; replace Theseus-shaped output with the recommendation/theseus_specifications/section_rationales triple the shell already parses.
Pure helper that picks the four LLM-filled Theseus sections and projects them into the cohort-methods R shell's 4-key recommendation shape, with TAR fields routed to time_at_risk and getDbCohortMethodDataArgs nested under study_population.
Take flat IDs from the R shell, build cohortDefinitions internally for metadata merge, validate Theseus output, then project to the 4-key recommendation shape via theseus_to_hanjae_recommendation. Internal Theseus document and per-section rationales remain as response fields for traceability.
… contract Wrapper now sends the same flat IDs the cohort-methods R shell sends and parses the recommendation/theseus_specifications/section_rationales response shape. Local stub mirrors the live wire contract.
LLMCallResult exposes parsed_content (not parsed_payload); the fenced-block fallback should extract from message content_text, not the full HTTP envelope. Plan + tests carried the wrong attribute name and MagicMock masked the bug so unit tests passed while every real LLM response fell back to backfilled defaults. Update tests to mock parsed_content so the bug is catchable.
…f entry - docs/COHORT_METHODS_SPECIFICATIONS_RECOMMENDATION_DESIGN.md: Hanjae-contract revision of the wire shape, internal Theseus pipeline, and projector spec. - docs/COHORT_METHODS_SPECIFICATIONS_RECOMMENDATION_PLAN.md: 8-task subagent- driven implementation plan that produced commits 3a2e0ee..b3cc66a and the parser fix on top. - test.md: manual test runbook for the ACP endpoint + free_text and step_by_step shell modes, with PASS criteria per scenario. - HANDOFF.md: 2026-04-29 entry summarizing the refactor + parser fix and pointing future maintainers at test.md.
- Move cmAnalysis templates from R package templates to MCP prompts - Remove current specifications block from recommendation prompt assembly - Load analysis template and JSON field descriptions from MCP prompt assets - Align section rationales with R shell step-by-step sections - Update cohort-method validation and tests for cmAnalysis-shaped specs
- Replace dummy ACP preview text with success/failure-aware shell output - Show ACP recommendations using step-by-step analytic settings formatting
- narrow suggestCohortMethodSpecs to study intent and analytic settings text - rename cohort-method spec validation module and remove Theseus naming - move cohort-methods prompt templates into prompt files
…d handoff file for pull request review
…valuation methods and results.
…which requires sqlalchemy)
…sProject/OHDSI-Study-Agent/tests/cohort_methods_intent_split_smoke_test.py
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.