Repository navigation
feat(flow4d): bounded pathway-serving machinery (build; activation gated) - #119
Merged
Merged
Conversation
…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).
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.
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 apathway_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 (instantiateenforces 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 missingdraft→approvedmilestone/stage promotion. Scope required,--confirmrequired (never promotes the whole catalog).review_stateisn'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
PatientPathwayInstanceService::instantiate), and serving stays gated bycare-pathways.assignment_enabled+ the flow4d flag.clinical_use=false.Test plan
Flow4dPathwayServingTest— 5 tests (full loop, activation-required guard, no-grant null, command orchestration, promote scope/confirm guards). Green. Pint clean.PatientJourneyEndpointTest's event-count assertion fails locally only (pre-existing, from Salvage the Nightingale governance layer from #92, and stop identity collisions recurring #111's identity-collision changes; main CI is green) — unrelated to this branch.🤖 Generated with Claude Code