Skip to content

feat(measure): the Maui sandbox routes the ACO's whole computable set, and a patient outside a measure's population is not a case (ADR-078) - #542

Merged
Taleef7 merged 6 commits into
mainfrom
feat/maui-route-all-measures
Sep 8, 2026
Merged

feat(measure): the Maui sandbox routes the ACO's whole computable set, and a patient outside a measure's population is not a case (ADR-078)#542
Taleef7 merged 6 commits into
mainfrom
feat/maui-route-all-measures

Conversation

@Taleef7

@Taleef7 Taleef7 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

Owner decision (2026-09-08, ADR-078): the Maui sandbox routes every measure the pilot group sent us.
WORKWELL_OFFICIAL_MEASURES on both Maui workflows becomes
cms122,cms125,cms2,cms130,cms165,cms137, and the deploy's vendor step adds CMS137, the one pilot
measure the build did not vendor. The flip is the workflow edit ADR-045 requires; reconcile-maui-mieweb.yml
matches, and official-flip-config.test.ts reads both.

Routing six measures made ADR-043's recorded fan-out the worklist: an official outcome outside the
initial population persisted as MISSING_DATA and opened a MEDIUM case, so 91–97 % of the sandbox's
16,581 open cases were patients the measure does not concern. A subject the OFFICIAL executor marks
inInitialPopulation: false no longer opens a case
(ADR-078 d2): the pipeline and rerun-to-verify treat it
as close-only, planCaseUpsert resolves an active case with closed_reason='OUT_OF_POPULATION' (system
closure, audited with its reason, reopenable), both stores pass the flag through, and the CDS card surface
skips subjects outside every rate's initial population. Gated on the executor's identity: the authored
engine sets the flag too, and an authored MISSING_DATA still opens a case.

Evidence for the flip

measure MADiE deck second engine whole-roster gate (20,000 corpus patients)
cms2 36/36 29/36, the 7 diagnosed to one helper (CROSS_ENGINE_2026-09-07_CMS2.md) 17,795 in IPP, 5,413 actionable, 0 errors (FLIP_GATE_2026-09-08_CMS2.md)
cms130 64/64 63/64 (CROSS_ENGINE_2026-09-07_CMS130_CMS165.md) 9,257 in IPP, 4,997 actionable, 0 errors (FLIP_GATE_2026-09-08_CMS130.md, credentialed run 34258656822)
cms165 68/68 open question, not a number (#532) 6,837 in IPP, 2,431 actionable, 0 errors (FLIP_GATE_2026-09-08_CMS165.md, credentialed run 34258659692)
cms137 45/45 44/45 (CROSS_ENGINE_2026-09-06_CMS137.md) 599 IPP, both rates alive (FLIP_GATE_2026-09-07_CMS137.md)

The two conditions the locked decision named — 305 surviving the final rule for cms137, and
profile-stamped real blood pressures for cms165 — now gate the PHI phase rather than the sandbox flip
(LOCKED_DECISIONS.md §4A.2 SINCE note). cms165 runs on the sandbox because the corpus stamps every
profile it retrieves and #539 stamps a blood pressure from its own codes; it must not be routed over
WebChart data until #533's ingest half is closed.

After merge

  • The first nightly run evaluates 120,000 pairs instead of 40,000 and closes roughly 15,000 existing
    out-of-population cases under OUT_OF_POPULATION, each audited. That run is the timing measurement;
    WORKWELL_RUN_CHUNK_SIZE and the anchor hour are the knobs if it does not fit.
  • Watch the container logs for OFFICIAL_ROUTING_MISCONFIGURED (DEPLOY.md step 5) — a misconfiguration
    does not refuse at boot.

Reviews

Own code-reviewer (8 findings, fixed in 368545b2), Gemini 3.8 Flash via agy (7 findings, fixed in
e50f51e7 — including the authored-engine gate), Codex on the PR (2 threads, both resolved). Backend
typecheck clean; the case, card, pipeline, store-contract and flip-config suites pass (261); all 116
workflow run-blocks parse.

@Taleef7 Taleef7 self-assigned this Sep 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec9cb0bb78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend-ts/src/run/run-pipeline.ts Outdated
Comment thread backend-ts/src/run/run-pipeline.ts Outdated
Taleef added 4 commits September 8, 2026 13:45
…, and a patient outside a measure's population is not a case (ADR-078)

Owner decision 2026-09-08: every measure the pilot group sent us, working
and visible on the sandbox. WORKWELL_OFFICIAL_MEASURES on both Maui
workflows is now cms122,cms125,cms2,cms130,cms165,cms137, and the deploy's
vendor step adds CMS137, the one pilot measure the build did not vendor.

Evidence: cms2's flip gate over all 20,000 corpus patients (36/36 MADiE,
17,795 in the initial population, 5,413 actionable, 0 errors —
docs/evidence/FLIP_GATE_2026-09-08_CMS2.md); cms137's banked gate; the
cross-engine sweeps. cms130 and cms165 pin VSAC-completed sidecars that do
not resolve locally, so a manual flip-gate.yml workflow now vendors with
the secret, sweeps the roster and uploads the report.

Routing six measures made ADR-043's recorded fan-out the worklist: an
official outcome outside the initial population persisted as MISSING_DATA
and opened a MEDIUM case, so 91–97 % of the sandbox's open cases were
patients the measure does not concern. The pipeline now reads the
executor's own inInitialPopulation:false and treats it as close-only — no
case where none exists, an active one closed by the system under
OUT_OF_POPULATION, audited, reopenable — and the CDS card surface applies
the same rule off the persisted evidence. The authored engine never sets
the flag, so an authored MISSING_DATA still opens a case.

The two conditions the locked decision named — 305 surviving the final
rule for cms137, profile-stamped real blood pressures for cms165 — now gate
the PHI phase rather than the sandbox flip (LOCKED_DECISIONS §4A.2 SINCE).
…env array

The flip comment sat inside a single-quoted jq string and its apostrophe
ended the string; the deploy-helper shell test caught it before merge, which
is what it exists for.
…the card surface reads every rate, and the store contract pins the flag

Own review of the flip branch. CASE_RESOLVED now carries closedReason, so
~15,000 OUT_OF_POPULATION closures are not read as auto-resolves in the
ledger; the CDS card filter reads every rate's initial population, the same
reading the pipeline's inInitialPopulation takes on a multi-rate measure;
the case-store contract pins open→closed-once→reopen on both floors; the
gate workflow sets pipefail so tee cannot mask the CLI exit code; and two
stale comments name the new closure path.
…, and rerun-to-verify closes such a case too

Gemini review of the flip branch. The authored engine also sets
inInitialPopulation (deriveInInitialPopulation emits it for every measure
with a boolean Initial Population define), so ungated, an unenrolled
audiogram subject would have stopped opening a case; the pipeline and
rerun-to-verify now read the flag only where logicVersionFor says the
official artifact ran, and tests pin the authored case on both paths.
Rerun-to-verify closes an out-of-population case under OUT_OF_POPULATION
as a system closure (closed_by NULL, reopenable), with a CASE_RESOLVED
event. The gate workflow's routed default is the six-measure list, its
verdict step fails the job on DO NOT FLIP while still uploading the report,
the JSON evidence is asserted before upload, and the reproducibility check
uses the job's working directory.
@Taleef7
Taleef7 force-pushed the feat/maui-route-all-measures branch from 368545b to e50f51e Compare September 8, 2026 17:45
Taleef added 2 commits September 8, 2026 13:51
Codex review of #542: the upsert was gated on the active-case preload, so a
transient failure of that read (caught, leaving the set empty) would have
left every out-of-population case open for another night. planCaseUpsert
is a no-op where no row exists, so the upsert is unconditional, like
COMPLIANT; EXCLUDED stays gated because its no-case branch inserts.
…64/64 and 68/68, 9,257 and 6,837 in the initial population, 0 errors

Both run through the credentialed flip-gate workflow (runs 34258656822 and
34258659692). The workflow now copies the gate JSON out of .flip-gate/
before upload: the artifact glob does not descend into a dot-directory, so
the first two runs uploaded only the text report.
@Taleef7
Taleef7 merged commit 629bd76 into main Sep 8, 2026
23 checks passed
@Taleef7
Taleef7 deleted the feat/maui-route-all-measures branch September 8, 2026 18:15
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