Skip to content

Integration/pr38 cohort methods#39

Merged
rkboyce merged 55 commits into
mainfrom
integration/pr38-cohort-methods
May 9, 2026
Merged

Integration/pr38 cohort methods#39
rkboyce merged 55 commits into
mainfrom
integration/pr38-cohort-methods

Conversation

@rkboyce

@rkboyce rkboyce commented May 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

rkboyce and others added 30 commits April 23, 2026 08:57
…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.
rkboyce and others added 25 commits May 2, 2026 07:09
- 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
…sProject/OHDSI-Study-Agent/tests/cohort_methods_intent_split_smoke_test.py
Comment thread mcp_server/scripts/build_phenotype_index.py Dismissed
@rkboyce rkboyce merged commit 5116ea6 into main May 9, 2026
2 checks passed
@rkboyce rkboyce deleted the integration/pr38-cohort-methods branch May 9, 2026 15:47
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.

4 participants