---
title: "Precheck, verified execution, and diagnosis"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Precheck, verified execution, and diagnosis}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
```

Precheck is diagnostic; execution remains behind the verified boundary.

```{r precheck, eval=FALSE}
precheck <- wf_precheck(
  design$data,
  target,
  id = design$roles$id
)

precheck$issues
```

Resolve blocking support problems through a declared, reviewable cell plan.
Do not change targets after seeing outcomes.

```{r execute, eval=FALSE}
plan <- wf_plan_weights(design, target, dims, method = "raking")
approval <- wf_approve_plan(
  plan,
  approver = "Reviewer full name",
  role = "Statistician"
)
locked <- wf_execute_plan(plan, approval, design, target)

diagnostics <- wf_diagnose(locked, target = target)
```

Direct statistical use is also verified:

```{r direct, eval=FALSE}
via_dispatcher <- wf_calibrate(
  design,
  target,
  method = "raking"
)
```
