What
CodeQL raises js/stack-trace-exposure (medium) at three sinks:
| File |
Line |
Paths |
backend-ts/src/routes/runs.ts |
157 |
5 |
backend-ts/src/routes/measures.ts |
163 |
1 |
backend-ts/src/worker.ts |
194 |
1 |
Each is the module's json() helper; the flagged flow is an caught error whose message ends up in the response body.
Why this is filed as review rather than a fix
Unlike the other three items from the first scan, this one has no mechanically correct answer. It is a judgement call about how much diagnostic detail the API should return, and the two failure modes point in opposite directions:
- Returning error text leaks internals — module paths, driver messages, and on a WebChart-backed stack potentially fragments of clinical data in a serialization error.
docs/PRODUCTION_READINESS_2026-07.md sets the PHI posture this has to satisfy.
- Returning nothing useful makes a 500 undiagnosable for MIE, who consume the versioned compliance API (
docs/COMPLIANCE_API.md) and cannot read our logs.
The likely shape is a correlation id in the response plus the detail in run_logs / the audit trail, but that is a design decision, not a find-and-replace.
Scope
- Enumerate the seven flows and classify each: developer-facing detail vs client-facing message.
- Decide the contract — probably an opaque id the client can quote back.
- Check it against the stability statement in
docs/COMPLIANCE_API.md, since response-body shape is part of that contract.
Not urgent
Auth is on for these routes and the deployed stack is a demo tenant. This is worth doing properly rather than quickly.
What
CodeQL raises
js/stack-trace-exposure(medium) at three sinks:backend-ts/src/routes/runs.tsbackend-ts/src/routes/measures.tsbackend-ts/src/worker.tsEach is the module's
json()helper; the flagged flow is an caught error whose message ends up in the response body.Why this is filed as review rather than a fix
Unlike the other three items from the first scan, this one has no mechanically correct answer. It is a judgement call about how much diagnostic detail the API should return, and the two failure modes point in opposite directions:
docs/PRODUCTION_READINESS_2026-07.mdsets the PHI posture this has to satisfy.docs/COMPLIANCE_API.md) and cannot read our logs.The likely shape is a correlation id in the response plus the detail in
run_logs/ the audit trail, but that is a design decision, not a find-and-replace.Scope
docs/COMPLIANCE_API.md, since response-body shape is part of that contract.Not urgent
Auth is on for these routes and the deployed stack is a demo tenant. This is worth doing properly rather than quickly.