{
  "preregistration_version": "nt-post-state-prereg:v0",
  "title": "Does checking the observed post-crossing state against the declared post-state catch what consequence-path matching misses?",
  "status": "proposed",
  "synthetic": true,
  "written_before": "the checker in src/lib/poststate.ts existed; this file is committed on its own first",
  "author_note": "Cases and predictions are written by the same author who will write the checker. The commit order shows the predictions came first; it does not make them independent.",
  "background": "Every proposal already declares s_before and s_proposed (the pre- and post-crossing states; S- and S+ in the relata vocabulary). The gate checks s_proposed against the class's invariants. Nothing checks what was actually executed against s_proposed. Consequence observations are matched only by path id.",
  "hypotheses": {
    "H1": {
      "statement": "Checking an observed post-crossing state against the declared s_proposed, and re-running the class's invariants on the observed state, flags divergences that consequence-path matching does not.",
      "falsified_if": "In every case where the post-state check reports DIVERGED or DIVERGED_BREAKS_INVARIANT, consequence-path matching also registers the case at the same or an earlier observation time."
    },
    "H2": {
      "statement": "Post-state checking does not replace consequence-path matching.",
      "falsified_if": "In every case where path matching registers a consequence, the post-state check also reports a divergence."
    }
  },
  "rules": {
    "field_comparison": "For each field the class declares in state_fields.proposed, and each extra field in the observed state: MATCHES, DIFFERS, NOT_OBSERVED, or UNDECLARED (observed, not declared). Values compare by canonical JSON.",
    "invariants_on_observed": "The class's invariants re-run on the proposal with s_proposed replaced by the observed state.",
    "verdict": "NO_STATE_OBSERVED if no state was observed; else DIVERGED_BREAKS_INVARIANT if any field differs and an invariant fails on the observed state; else DIVERGED if any field differs or is undeclared; else INCOMPLETE if any declared field was not observed; else AS_DETERMINED. Absence of an observed field is never read as a match.",
    "path_registers": "Path matching registers a case only if a consequence observation exists for it; it then reports MATCHED or UNMATCHED against the frozen class's declared paths.",
    "base": "Each case starts from a published warranted example whose determination is EXECUTE."
  },
  "cases": [
    { "case_id": "PS-01", "base": "INS-001", "label": "Executed as determined",
      "observed_state": { "observed_at": "2026-09-10T12:00:00Z", "state": { "claim_id": "C-1001", "status": "denied", "notices": ["denial_with_appeal"] } },
      "consequence": null,
      "prediction": { "post_state": "AS_DETERMINED", "path": "none", "adds": "neither" } },
    { "case_id": "PS-02", "base": "INS-001", "label": "Denial issued without the appeal notice",
      "observed_state": { "observed_at": "2026-09-10T12:00:00Z", "state": { "claim_id": "C-1001", "status": "denied", "notices": [] } },
      "consequence": null,
      "prediction": { "post_state": "DIVERGED_BREAKS_INVARIANT", "path": "none", "adds": "post_state" } },
    { "case_id": "PS-03", "base": "INS-001", "label": "Executed as determined; a settlement follows on a declared path",
      "observed_state": { "observed_at": "2026-09-10T12:00:00Z", "state": { "claim_id": "C-1001", "status": "denied", "notices": ["denial_with_appeal"] } },
      "consequence": { "observed_at": "2026-10-02T15:00:00Z", "attempted_path": "wrongful_denial_settlement", "independent": false },
      "prediction": { "post_state": "AS_DETERMINED", "path": "MATCHED", "adds": "path" } },
    { "case_id": "PS-04", "base": "LED-001", "label": "Posted unbalanced",
      "observed_state": { "observed_at": "2026-09-30T18:00:00Z", "state": { "ledger_id": "GL-UK", "period": "2026-09", "postings": [{ "account": "6100 Hosting", "amount_minor": 125000 }, { "account": "2100 Accruals", "amount_minor": -120000 }] } },
      "consequence": null,
      "prediction": { "post_state": "DIVERGED_BREAKS_INVARIANT", "path": "none", "adds": "post_state" } },
    { "case_id": "PS-05", "base": "LED-001", "label": "Posted balanced, to a different expense account",
      "observed_state": { "observed_at": "2026-09-30T18:00:00Z", "state": { "ledger_id": "GL-UK", "period": "2026-09", "postings": [{ "account": "6200 Software", "amount_minor": 125000 }, { "account": "2100 Accruals", "amount_minor": -125000 }] } },
      "consequence": null,
      "prediction": { "post_state": "DIVERGED", "path": "none", "adds": "post_state" } },
    { "case_id": "PS-06", "base": "MOD-001", "label": "Served in a context it was not evaluated for",
      "observed_state": { "observed_at": "2026-09-11T08:00:00Z", "state": { "model_id": "model-m4", "stage": "deployed", "contexts": ["claims-triage-uk", "claims-triage-ie", "claims-triage-fr"] } },
      "consequence": null,
      "prediction": { "post_state": "DIVERGED_BREAKS_INVARIANT", "path": "none", "adds": "post_state" } },
    { "case_id": "PS-07", "base": "MOD-001", "label": "A different model deployed to the evaluated contexts",
      "observed_state": { "observed_at": "2026-09-11T08:00:00Z", "state": { "model_id": "model-m5", "stage": "deployed", "contexts": ["claims-triage-uk", "claims-triage-ie"] } },
      "consequence": null,
      "prediction": { "post_state": "DIVERGED", "path": "none", "adds": "post_state", "note": "The coverage invariant reads contexts only, so it passes on the observed state; only the field comparison sees the model change." } },
    { "case_id": "PS-08", "base": "SCI-001", "label": "Claim published with a stronger statement than determined",
      "observed_state": { "observed_at": "2026-09-12T09:00:00Z", "state": { "claim_id": "CLAIM-SCI-001", "claim": "Removing the bundle-type guard loses all malformed-shape detections", "mappings": [{ "mapping_id": "builder report", "value": "4 of 5" }, { "mapping_id": "independent re-execution", "value": "4 of 5" }] } },
      "consequence": null,
      "prediction": { "post_state": "DIVERGED", "path": "none", "adds": "post_state" } },
    { "case_id": "PS-09", "base": "INS-005", "label": "The existing INS-005 observations, which carry no state",
      "observed_state": null,
      "consequence": { "observed_at": "2026-10-20T09:00:00Z", "attempted_path": "regulator_complaint_fee", "independent": true },
      "prediction": { "post_state": "NO_STATE_OBSERVED", "path": "UNMATCHED", "adds": "path", "note": "No existing observation record carries a post-crossing state, so the check has nothing to run on without a new observation type." } },
    { "case_id": "PS-10", "base": "INS-001", "label": "Only the status observed",
      "observed_state": { "observed_at": "2026-09-10T12:00:00Z", "state": { "status": "denied" } },
      "consequence": null,
      "prediction": { "post_state": "INCOMPLETE", "path": "none", "adds": "neither" } },
    { "case_id": "PS-11", "base": "MOD-001", "label": "Extra context at deployment; a coding error in that context later",
      "observed_state": { "observed_at": "2026-09-11T08:00:00Z", "state": { "model_id": "model-m4", "stage": "deployed", "contexts": ["claims-triage-uk", "claims-triage-ie", "claims-triage-fr"] } },
      "consequence": { "observed_at": "2026-10-05T10:00:00Z", "attempted_path": "unevaluated_context_error", "independent": false },
      "prediction": { "post_state": "DIVERGED_BREAKS_INVARIANT", "path": "MATCHED", "adds": "earlier", "note": "Both register it; the post-state check does so at deployment, 24 days before the consequence." } }
  ],
  "predicted_outcome": {
    "H1": "not falsified on these cases: PS-02, PS-04 to PS-08 are flagged by the post-state check with no consequence observation, and PS-11 is flagged earlier",
    "H2": "not falsified: PS-03 and PS-09 are registered by path matching and not by the post-state check"
  },
  "limits": [
    "Constructed cases: they can show the category of divergence exists and that the checker separates it; they cannot show how often it happens.",
    "Comparing desired with actual state is established practice (reconciliation, configuration drift detection). What is tested here is only whether doing it against the determination's own s_proposed and invariants adds to consequence-path matching in this engine.",
    "Observed state is declared by the observer, as observations are today; it is not verified.",
    "The refund fixture named when this test was proposed lives in another repository; the four published classes here are used instead."
  ]
}
