Skip to content

feat(flow4d): bounded pathway-serving machinery (build; activation gated) - #119

Merged
sudoshi merged 2 commits into
mainfrom
feat/flow4d-pathway-serving-bounded
Jul 28, 2026
Merged

sudoshi merged 2 commits into
mainfrom
feat/flow4d-pathway-serving-bounded

Conversation

@sudoshi

@sudoshi sudoshi commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

The reusable machinery to serve real (non-overlay) governed-pathway progress in the 4D Navigator for the Nightingale investor-demo cohort (#118). Build only — this PR makes no prod changes and enables nothing. Catalog activation + patient assignment remain gated behind [SU] institutional signoff; the serving flag stays off.

Scoped to the 5 cohort pathways (Heart Failure, Simple Pneumonia, Major Joint Replacement, Appendectomy, Vaginal Delivery) — all evidence-verified.

  • Flow4dPathwayAssignmentService — layers a pathway_instance + LOS-driven milestone statuses onto an existing Provision the five-patient Nightingale investor-demo cohort #118 cohort grant (source_encounter_id + pathway:read). Requires the catalog already activated (instantiate enforces version approved+active + release active/signed-off), so it fails loudly on an inactive catalog rather than silently serving nothing.
  • care-pathways:promote-executable-layer — the missing draft→approved milestone/stage promotion. Scope required, --confirm required (never promotes the whole catalog). review_state isn't a protected content column, so the immutability trigger permits it.
  • flow4d:assign-demo-pathways — reads the cohort SSOT (NightingaleDemoCohort::MEMBERS, demo_username→pathway_key) + its grants and assigns each patient their designated pathway.
  • Flow4dPathwayServingTest — proves the full loop end-to-end in the isolated test DB: adopt → author(draft) → promote → activate → cohort grant → assign → serve real progress (PathwayInstanceReadService, demo=false, correct LOS statuses). This is the prod runbook, proven.

Safety

  • No prod writes; no flags changed; no migration in this PR.
  • The assignment service cannot create instances against an inactive catalog (enforced by PatientPathwayInstanceService::instantiate), and serving stays gated by care-pathways.assignment_enabled + the flow4d flag.
  • All demo data is synthetic and clinical_use=false.

Test plan

🤖 Generated with Claude Code

sudoshi added 2 commits July 28, 2026 10:02
…ted)

The reusable machinery to serve REAL (non-overlay) governed-pathway progress in
the 4D Navigator for the Nightingale investor-demo cohort (PR #118). Build only —
no prod writes; catalog activation + assignment remain gated behind [SU] signoff.

- Flow4dPathwayAssignmentService: layers a pathway_instance + LOS-driven milestone
  statuses onto an existing #118 cohort grant (source_encounter_id + pathway:read);
  requires the catalog already activated (instantiate enforces approved+active +
  release signed-off), so it fails loudly otherwise.
- care-pathways:promote-executable-layer: the missing draft→approved milestone/stage
  promotion (scope REQUIRED, --confirm REQUIRED; never promotes the whole catalog).
  review_state is not a protected content column, so the immutability trigger allows it.
- flow4d:assign-demo-pathways: reads the cohort SSOT (NightingaleDemoCohort::MEMBERS
  demo_username→pathway_key) + its grants and assigns each patient their pathway.
- Flow4dPathwayServingTest: proves the full loop end-to-end in the isolated test DB —
  adopt → author(draft) → promote → activate → cohort grant → assign → serve real
  progress (PathwayInstanceReadService, demo=false). This IS the prod runbook, proven.

Scoped to the 5 cohort pathways (all evidence-verified). 5 tests green; Pint clean.
Note: PatientJourneyEndpointTest event-count assertion is a pre-existing LOCAL-only
failure from #111's identity changes (main CI is green) — unrelated to this branch.
…bit-rot)

The journey seeds hardcoded 2026-07-25 events, but the journey window is now-72h;
once the calendar advanced >72h past those dates the events aged out of range and
the ordered-story assertion dropped from 3 to 1. Anchors the seed to now (gaps
preserved: 210 + 525 min) so it's stable. Unrelated to the serving machinery;
unblocks feature-1 CI (and fixes the same latent failure on main).
@sudoshi
sudoshi merged commit a38044c into main Jul 28, 2026
19 checks passed
@sudoshi
sudoshi deleted the feat/flow4d-pathway-serving-bounded branch July 28, 2026 15:11
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.

1 participant