Skip to content

DATA_MODEL_CONTRACTS.md §5 presents why_flagged as part of persisted evidence_json; the TS engine derives it at read time #463

Description

@Taleef7

The contract's canonical evidence_json shape includes a why_flagged block, but the TS engine persists expressionResults only. deriveWhyFlagged (backend-ts/src/case/case-detail-read-model.ts:90, applied at :175) adds why_flagged at read time, and that file's docblock says so explicitly at :4-6 ("the TS engine stores expressionResults, not a why_flagged block"). backend-ts/src/case/case-outreach.ts:164-167 documents the same from the other side — renderContext routes through toCaseDetail before computing a due date precisely because "the raw stored outcome evidence has no why_flagged block".

An always-loaded contract doc that misstates the persistence boundary will keep producing the error PR #462's review caught: two proposals in that PR described the due-date inputs as persisted per outcome, taken in good faith from §5.

The fix belongs in its own change, since the file is an always-loaded contract extract and editing it changes what every session believes about the data model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions