# alpha_dri_interventions — dictionary
The meaning layer over `intervention_requests`. Read this before interpreting a field,
writing a filter, or claiming an absence.

Built to the data source skill contract (`GET https://data-source-skills.vercel.app/contract`).
No measured figure appears in this document: **the wire owns the data.** Where a claim below
could be read as an assertion, the query that re-derives it sits beside it — run that, not this.

## The judgment layer

This document tells you how to read the data. It does not tell you what the data means.

That is the **BrainLift**, written and maintained by the source owner:
<https://workflowy.com/s/brainlift-academic-d/aIltlfOWBSCHVAjc> — human-authored, kept alive as
the owner's thinking changes.

It is a Workflowy outline rendered client-side, so **a plain fetch returns an empty shell, not
an empty document.** Render it in a browser. If you cannot, say the judgment layer was
unavailable to you — do not report it as absent, and do not substitute your own inference for
it.

**Read it before answering any question of meaning, severity or sufficiency** — whether a
volume is normal or alarming, whether an intervention type signals a platform failure or routine
remediation, how quickly a stuck student ought to be unstuck. This document cannot settle those,
and an agent that infers them from the rows is inventing a standard the owner already holds.

**Precedence, when sources disagree:**

| Question | Authority |
|---|---|
| What a column is, what values it takes, how to query it | this document |
| What a value MEANS, and whether a number is good or bad | the BrainLift |
| How a metric is defined and computed | the TimeBack metric standard |

The BrainLift never overrides a mechanical fact here, and neither ever overrides the metric
standard.

**Cite it with the date you read it.** It is a living document, and a judgment quoted without a
date cannot be checked later.

**It is public and keyless.** Do not quote anything student-identifying out of it, even if it
appears there — the no-PII obligation on this source is not relaxed by the fact that a document
is publicly served.

## Grain

**One row = one filing.** A filing is a record a DRI created about a student's stalled
progress in one subject at one grade. One row is therefore **a touch, not a failure**: the
same stall can carry several filings.

**A filing about a whole campus carries no student.** The front lets a filer target "a whole
campus" instead of one student; those rows have `email` and `full_name` empty **by design** —
the absent email is what marks a row as campus-wide. 150 of 2,929 rows on 2 Nov 2026 (146 of
2,650 request-log rows, 4 of 279 work-log rows), and every one of them also has no
`full_name`. Count them as campus-wide filings, never as missing data, and keep them out of
any per-student fold: they have no student to join to.

### Coverage window — nothing earlier exists

| Log | Earliest `created_at` | Note |
|---|---|---|
| request log (`campus_dri`) | **4 Sep 2026** | the earliest row in the table; no filing predates it |
| work log (`subject_dri`) | **7 Sep 2026** | its first rows are a one-time pipeline load (`built_by = 'pipeline'`) |

A reader comparing filings with the school year must start the window at these dates: a
campus or subject with no row before them has no data, not zero interventions.

### Who files into the request log

Every campus on the dashboard roster can file — the front offers the full roster, and a
filing about a student takes the student's own roster campus. That covers the Alpha School
campuses, Alpha Anywhere and GT (school and Anywhere), the sports academies (Texas Sports
Academy and its programs), and the partner and public-school programs on the roster. **A
campus with few or no rows is in scope and filing little, not out of scope.** Filing depends
on a Campus DRI being assigned: a campus with no assignment can still file, but its rows carry
an empty `campus_dri` (see §Fields).

## Two independent logs share this table

`section` does not mark a stage in one workflow. It marks **which log the row belongs to**, and
the two logs record different things kept by different roles [owner]:

| `section` | What it logs | Kept by |
|---|---|---|
| `campus_dri` | a **request** — a stalled student handed on for help | Campus DRI |
| `subject_dri` | a **work log** — manual curriculum work that was done | Curriculum DRI |

**Neither log is the other's counterpart.** A work-log row is not a response to a request row,
and a request row does not become a work-log row. They co-occupy one table because one filing
front writes both.

Three consequences, and each one is a way this source is commonly misread:

- **Never total across the two.** A single number over both counts two unlike things.
- **Never expect them to pair.** A request with no matching work-log row is not unfulfilled,
  and a work-log row matching no request is not orphaned. A link column, `answers_request_id`, is
  served and partly populated — measure it before any join ([Enablement §9](https://4mxev38j.function2.insforge.app/dss/enablement)). The failure key is never
  a link.
- **Never compare their coverage causally.** A subject present in one log and absent from the
  other says only that: the logs differ. It is **not** evidence about what any automated path
  covers, because neither log is a census of anything.

Answer questions of one log at a time, and say which log answered.

### `entry_kind` is a second axis INSIDE the request log

`section` is the log axis and stays two-valued. **`entry_kind` divides the request log — and
only the request log — into the two costs it was pooling:**

| `entry_kind` | What the row is | What it measures |
|---|---|---|
| `intervention_request` | work the Campus DRI **pushed to a Curriculum DRI** | latency and backlog — a student is waiting |
| `manual_work` | work the Campus DRI **absorbed themselves** | DRI hours burned — nobody is waiting |
| `unclassified` | **no declaration exists.** A backfill state, not a kind of work | nothing; it is missing metadata |
| `referral` | a **Curriculum DRI asking a Campus DRI to check a student** — filed from the Curriculum DRI tab, landing in the Campus DRI's queue (since 2026-10-15) | a hand-off in the other direction; **enumerate by query** — rare |

It is **NULL on every work-log row**, by constraint. That is a shape, not a gap: the work log
is a different log and the distinction does not exist there.

The two members are not two views of one queue — they are **different units**, exactly as the
two logs are. A single "campus workload" figure over both is the same error as a total across
`section`, one level down. Backlog, age and approval belong to `intervention_request`; minutes
and DRI cost belong to `manual_work`.

## Grains above the row

Two grains sit above the row and neither is served — both are the reader's fold:

- **failure** = `email` + `subject` + `grade`
- **type** = `subject` + artefact + trigger, where the trigger exists **only in `reason`**

## Person-bearing columns

Marked, because knowing which columns carry a person is one of the most useful things this
document holds. These describe **a minor's records**.

| Column | Carries |
|---|---|
| `email`, `full_name` | the student, directly |
| `reason` | free text; **students are named inside it** |
| `request_type_other` | free text; **should carry a category label only, but a filer can type a name into it** |
| `approval_notes` | links whose filenames may name a student |
| `campus_dri`, `subject_dri`, `created_by`, `updated_by`, `completed_by` | staff identity |
| `campus`, `level`, `grade` | indirect — small cells re-identify |

Publish the grouping, never the identity. Never paste `reason` or `approval_notes` into a
report: identity travels in free text even when the identity columns are clean.

## Fields — genesis, shape, allowable values

Genesis vocabulary: **captured** (crossed the world→data boundary here) · **copied** (from a
named system) · **computed** (a derivation ran) · **judged** (someone decided) · **truly
unknown**.

| Field | Genesis | Shape / allowable values |
|---|---|---|
| `id` | captured — assigned at write | opaque row identity |
| `section` | captured — which filing front was used | **`campus_dri`** · **`subject_dri`**. Closed set. **Names which of two INDEPENDENT LOGS the row belongs to — see below** |
| `entry_kind` | **judged — declared by the filer at write time**, from the form's first question | **`intervention_request`** · **`manual_work`** · **`unclassified`** · **`referral`**. Closed set (`referral` added 2026-10-15). **Populated iff the row is `campus_dri`**; NULL on the work log. Never inferred, at write time or read time — that is the point of the column. `unclassified` carries rows that predate the question; it is **not a third kind of work** (trap 13) and must never be written by a new filing. **Required on `campus_dri` rows on both write paths since 2026-09-09**, so no new campus row can arrive without a declaration. A campus row with NULL should not exist: the store forbids it on new writes and the count is 0 as of 2026-11-02 — if one appears, report it as a store defect. **Rows created before 2026-09-09T09:30Z predate the form question:** any value they carry was assigned afterwards in a backfill, not declared at filing. The store refuses `unclassified` on rows created at or after that instant, so `created_at < 2026-09-09T09:30Z` separates backfilled values from declared ones. **Governs `minutes_spent` — see below** |
| `full_name` | copied — from the roster [owner] | free text, person-bearing |
| `email` | copied — from the roster [owner] | school address, person-bearing. Failure-key component. **Empty on campus-wide filings by design** (see §Grain) — never a missing value |
| `campus` | copied — autopopulated from the roster [owner] | campus label; **enumerate by query, never assume a list**. One label per campus, the roster's `Alpha <City>` form: rows filed before 14 Oct 2026 carried `Alpha School <City>` for 20 campuses and were relabelled on 2 Nov 2026 (which moved those rows' `updated_at` — see *Vintage*). Three unpaired legacy labels (`Alpha School`, `Alpha School Lake Forest`, `Alpha School Palm Beach`) keep their old form. `campus` is often empty on the work log and rarely on the request log |
| `level` | copied — autopopulated from the roster [owner] | roster level label; **enumerate by query** — not constrained at the store. Expect members beyond `L1` · `L2` · `MS` · `HS` (e.g. `LL`, `WL`), a few one-off labels, and NULLs |
| `subjects` | captured — the filer ticks several on the manual-work form | text array, or null. **The subjects one manual filing covered.** Set only on `campus_dri` + `manual_work` rows spanning **two or more** subjects, where `subject` is NULL because the work had no single one — the two are alternatives and never both, which the store enforces. **`minutes_spent` on such a row is the time for the WHOLE filing, not per subject: never multiply it by the list length**, and never explode the row into one per subject to fold by subject, which would multiply the DRI hours. NULL on every request and every work-log row. Rows from before 2026-09-14 may span subjects with this NULL — the selection was not stored then |
| `subject` | captured — dropdown on the front [owner] | subject name; **enumerate by query**. **NULL on a `manual_work` row means the work was not subject-specific** — one deep dive covering everything, recorded once rather than once per subject — so it is a value, not a gap. A fold by subject must report the NULL count for manual work separately rather than dropping those rows, because they carry real minutes. On any other row a NULL subject is missing data |
| `grade` | captured — dropdown on the front [owner] | **integer** (`smallint` at the store — a bad value returns `400 invalid input syntax for type smallint`, not a silent zero). Ordered comparisons therefore work: `grade=gte.<n>`. **Enumerate by query.** Failure-key component. **Not required on `manual_work` filings** [owner, 2026-11-02] — manual work often spans grades or none, so a NULL grade there is a value, not a gap; only a request about a named student is expected to carry one |
| `request_type` | captured — **a dropdown on the request log, free text on the work log** | artefact kind. Includes an **`Other`** member; see trap 6. **The vocabulary is actively being widened** to cover kinds of DRI work that previously could not be filed — **re-enumerate it every run** and never hard-code the members you saw last time. Because only the request log is constrained, an `Other`-looking value on the work log is one writer's word, **not** the catch-all member — see `request_type_other`. **On `manual_work` rows created before 2026-09-09T12:00Z this column is unreliable and `action_taken` is not:** only one type was scoped to manual work until then, so every such filing carries it regardless of what was done. Prefer `action_taken` on those rows, say which column you folded on, and expect the two to disagree |
| `request_type_other` | captured — the filer's own words for a kind of work the dropdown does not carry | short free text (label length is capped at the front), or null. **Set only where `section = 'campus_dri'` AND `request_type = 'Other'`** — a value anywhere else contradicts a constraint that IS enforced, on both write paths, and is worth reporting. **The presence half is NOT currently enforced at the table:** it was relaxed on 2026-09-08 because the store began requiring the label before the deployed form could collect it, which blocked filing entirely. So a campus `Other` row with a NULL label is expected for filings made since that date and is **not** a defect to report; the write API still requires it. **The work log is not covered by it** — it takes free text for `request_type`, so a work-log row reading `Other` is not the catch-all and carries no label. Meant to hold a category label, so **treat any name-shaped content in it as a leak and mask it** (trap 16) |
| `reason` | **genesis varies by row — check `section`, then `built_by`. Request log: judged**, the filer's short account of why the platform did not handle it. **Work log: mixed** — some rows are **computed** text emitted by a serve pipeline, others are **judged** text written by a person. `built_by` says which; the wording does not | free text, person-bearing. **The only field naming the trigger, the plan size or the severity.** Several grammars coexist here and new ones appear — **type each row by its opening phrase before parsing it.** Parse the machine grammars, quote the human ones — [Enablement §4](https://4mxev38j.function2.insforge.app/dss/enablement) |
| `approval_needed` | captured — defaults from `intervention_request_types.approval_needed` for the chosen type; **the filer can override it** | boolean |
| `approval` | **judged** — by an approver, at approval time | **`Pending`** · **`Approved`** · **`Rejected`**, NULL where `approval_needed` is false. **A `Rejected` request is CLOSED and counts as DELIVERED** [owner, 2026-11-02]: the decision was the answer, even though `completed` stays false. So **exclude `approval=eq.Rejected` from every backlog or open count**, and count it with completions in any closure or delivery rate. No column stamps when the decision was made |
| `approval_notes` | captured — a link to the artefact | URL text. Person-bearing |
| `created_by` / `updated_by` | captured — the account that wrote or last edited the row | staff identity, person-bearing. **The ACTOR, distinct from the assignment named in the DRI columns** |
| `campus_dri` / `campus_dri_id` | captured — the Campus DRI who filed the request | staff identity; **populated on the request log only** |
| `subject_dri` / `subject_dri_id` | captured — the Curriculum DRI whose work-log row this is | staff identity |
| `archived` | judged — by a person retiring the filing | boolean. **A closed set as of 2026-09-17**: the app's remove control deletes the row outright rather than archiving it, and neither write API can set this, so nothing adds to the 12 rows that carry it. Still filter on it (trap 15) — it is dormant, not gone |
| `completed` | judged — set when the artefact is **delivered** [owner] | boolean. **Not meaningful on `entry_kind = 'manual_work'` rows** — it answers "was the requested artefact delivered", and manual work is not a request for an artefact: it is already done when it is filed, which is what `minutes_spent` records. The filing UI offers no completion control there, so the value is whatever it was left at and cannot be read as a state. **Scope any completed/open count on the campus log to `entry_kind = 'intervention_request'`**, where the flag is set by the DRI who did the work — and count `approval = 'Rejected'` rows as closed and delivered alongside `completed = true` (see `approval`) |
| `created_at` / `updated_at` | captured — write time | ISO timestamp |
| `completed_at` | captured — stamped when `completed` is set | ISO timestamp; see trap 4 |
| `completed_by` | captured | staff identity |
| `built_by` | **judged — declared by the writer at write time** | **`human` · `pipeline` · `unknown`.** Closed set. **The provenance authority — see [Enablement §4](https://4mxev38j.function2.insforge.app/dss/enablement).** Do not re-derive it from `reason` |
| `minutes_spent` | captured — effort recorded by the writer | integer minutes, or null. **On the request log its nullability is a CONSTRAINT, not a coverage figure:** NULL on every `entry_kind = 'intervention_request'` row (the work went to someone else, so the Campus DRI's minutes are not the cost) and required on every `manual_work` row. Unconstrained where `entry_kind` is `unclassified` or NULL, and on the work log, where it must still be measured. **A `0` is a real zero-minute entry** [owner, 2026-11-02], not a form default: include it in sums and in coverage. **Never average it over the whole campus log — trap 14** |
| `completion_minutes` | captured — entered by the Curriculum DRI at the moment they close the request | integer minutes, or null. **The time the person who ANSWERED a request spent on it.** Set only on `campus_dri` + `entry_kind = 'intervention_request'` rows that are **completed or Rejected** (on a Rejected request it records the time spent deciding, while `completed` stays false); refused anywhere else at the store. **Not the same column as `minutes_spent` and not interchangeable with it** — that one is the Campus DRI's own time on manual work and is forbidden on a request. **Disjoint from the other record of Curriculum DRI time by construction:** a request closed by hand carries this, a request closed automatically because a linked work-log row was completed leaves this NULL and keeps its time on that row's `minutes_spent`. So Curriculum DRI effort on a request is this value **plus** the `minutes_spent` of work-log rows pointing at it — never one as a substitute for the other. **Required by the completion dialog, not by the store**, so requests completed before 2026-09-11T11:30Z carry none — **check `completed_at`, not `created_at`**. Requests closed through the update API (`functions/update-api.ts`, which sets `completed: true` and sends no minutes) or by propagation from a linked work-log row also carry none, so coverage after the boundary is not 100% and **a NULL there is not a defect**. Cleared if the request is re-opened |
| `app` | captured — the application the work was done in | app label; **enumerate by query**. **Measure population** |
| `action_taken` | captured — what was done | **Closed set at the store:** `built_plan` · `built_practice_test` · `built_study_guide` · `assigned_hole_filling` · `changed_placement` · `scheduled_test` · `approved_test_out` · `corrected_record` · `added_removed_app` · `met_with_guide` · `deep_dive` · `other`. `other` has no companion text column. **NULL on `intervention_request` rows filed from 2026-09-11T09:00Z**, by design: the form stopped asking, because on a request the work has not happened yet and any answer would be invented — and from 2026-09-17 the write API refuses it there rather than accepting it. Rows filed before then may carry a value that describes nothing. **A blank on a campus `manual_work` row does NOT mean nobody recorded an action.** Until 2026-09-17 the campus write path silently discarded this field: it was parsed for work-log items and had no column in the campus filing function, so an API filing that sent it was stored NULL and returned 200. 40 campus manual-work rows are blank for that reason or because their filer left it, and the two are indistinguishable. Treat pre-2026-09-17 blanks on API-filed rows as **unrecorded, not absent**, and do not read the gap as a compliance problem |
| `course_id` | copied — the course the artefact was built against | opaque course identity. **Written by the pipeline writer only:** set on every `built_by = 'pipeline'` work-log row, almost never on human rows, never on the request log. Measure it per `built_by` over work-log rows before folding by course |
| `answers_request_id` | captured — the request this work row answers | row identity referencing a `campus_dri` row, or null. **Measure population before attempting any join — see [Enablement §9](https://4mxev38j.function2.insforge.app/dss/enablement).** A null has two causes and they are not distinguishable here: never linked, or the request it pointed at was **deleted** — the store nulls the pointer rather than deleting the work row, so the minutes survive without their request |

### A column existing is not the same as a column carrying data

Several fields above were added to the schema ahead of the writers that fill them. Treat schema
presence as permission to measure, never as evidence that a question is now answerable — and
never as evidence that it is *not*, because these columns acquire writers without warning.

**Before using any of `minutes_spent`, `app`, `action_taken`, `answers_request_id`, `course_id`, measure its
population and state the figure beside any result that depends on it.** This document does not
say which of them are populated. Any such statement would be a reading of one moment, and a
form shipping overnight falsifies it while the sentence still looks authoritative.

**Measure the rate against the writer floor, not against the whole table.** A column gains a
writer on a date; every row filed before that date is null because the field did not exist to
fill, not because anyone declined to fill it. Pooling the two makes a working writer look
broken:

- **The writer floor** is the earliest `created_at` at which the column is non-null. Everything
  before it is out of scope for the rate.
- **Report both figures, labelled** — `k of N since the floor` beside `k of T overall`. The
  first says whether the writer works; the second says how much of the history you can use.
  They answer different questions and neither substitutes for the other.
- **A floor inside the window you are reporting on splits it.** Say so rather than averaging
  across the discontinuity.
- **A floor that equals the newest row means one writer has fired once.** That is a signal the
  writer exists, not a rate — do not publish a percentage from it.

**Distinguish an unwritten column from a conditionally-null one.** `request_type_other` is null
on most rows **by design** — it is only ever set where a campus filing picks `Other` — so its
denominator is *campus `Other` rows*, not the table, and a low overall rate is the rule working
rather than a gap. Reporting it as sparse misreads a constraint as a defect.

**`minutes_spent` is the same trap with higher stakes**, because it is the column every
cost question lands on. On the request log its denominator is *`manual_work` rows*, never the
campus log and never the table: NULL on an `intervention_request` row is the constraint doing
its job, and counting those rows into a coverage figure or an average produces a number that is
wrong in a direction nobody notices (it understates DRI time). Measure it **per `entry_kind`**,
and on the work log — where no such rule exists — measure it as the writer-floor section
above describes.

If a column measures empty, the honest answer to the question it was meant to settle is still
the refusal in [Enablement §9](https://4mxev38j.function2.insforge.app/dss/enablement) — say the column exists and is unwritten **as measured, with the date of your
read**, which is a different and more useful statement than saying the data does not exist.

```bash
curl -sS -K ~/.dri.curlrc \
  "$BASE/read-api?table=intervention_requests&select=created_at,minutes_spent,app,action_taken,answers_request_id&limit=1000"
# per column: non-null-and-non-empty count / total, distinct value count,
#             earliest non-null created_at (the writer floor),
#             and the count / total among rows at or after that floor
```

**Vintage.** **No field on this surface is computed at read time** — every value was
captured, copied or judged by a writer. That does not make a row a snapshot of the filing
moment, and reading it as one is a live error. Four kinds of change reach a filed row:

- **The lifecycle fields are written later, by whoever answers it** — `approval`,
  `approval_notes`, `completed`, `completed_at`, `completed_by`, `completion_minutes`. That is
  the point of them; the age and latency work in [Enablement §6](https://4mxev38j.function2.insforge.app/dss/enablement) and [Enablement §7](https://4mxev38j.function2.insforge.app/dss/enablement) depends on it.
- **`entry_kind` on a backfilled row is classified later** by the Campus DRI, which is why
  `unclassified` exists (see *`entry_kind` is a second axis INSIDE the request log*).
- **`request_type`, `request_type_other` and `reason` can be CORRECTED after filing**, on an
  open or a completed row, by a manager, the filer or the assigned DRI. Since 2026-09-16 the
  Campus DRI tab offers this directly. The identity of the failure — student, subject, grade —
  is not editable there, so a correction never re-points a row at a different problem.
- **A row can be DELETED.** Since 2026-09-17 the Campus DRI tab has a delete control, open to
  a manager, the filer, the row's Campus DRI and its assigned Curriculum DRI — the same four
  who can correct it. It is a real delete, not the `archived` flag: the row leaves the table.
  **So a count can go DOWN between two reads, and a past month's total can shrink without any
  new filing.** There is no tombstone on the wire and no `deleted_at` to filter on; a deleted
  row is simply absent on the next read. If a figure has to be reproducible, keep the pull you
  computed it from, because re-pulling is not guaranteed to reproduce it.

Every correction and every delete is written to `audit_log` with the old and new row and the account that made
it, but **that table is never served to a credential**, so from the wire your signal is
`updated_at`: `updated_at > created_at` means the row was touched after filing, and
`updated_by` names the account that last did it. Both are readable
(`select=created_at,updated_at,updated_by`). **Not every touch is a correction.** Bulk
operations re-stamp many rows at one instant: all 63 `pipeline` work-log rows were loaded in one
batch on 2026-09-07 (12:36–12:38Z) and re-stamped together at 2026-09-08T10:43Z; all 8 `unknown`
rows share one re-stamp at 2026-09-08T08:28Z; and the campus relabel of 2026-11-02 re-stamped the
660 relabelled rows. A batch of rows sharing one `updated_at` is a bulk touch, not a filer
correction. The pipeline's serving rhythm is in `reason`'s assigned date, not in `created_at`. A delete leaves no such signal at all — the only
way to notice one is to diff two pulls on `id`, which is worth doing if you are comparing a
figure against one you published earlier.

What that costs a reader: `reason` is the trigger **as currently described**, not necessarily
the words typed at filing; a `request_type` histogram can move between two reads with no new
filing behind it; and a row you quoted last week may not exist this week. For any figure or quotation that has to hold still, carry the date of
your read — and for a quotation you are leaning on, the row's `updated_at` with it.

The roster-copied fields (`campus`, `level`, `full_name`) are a different staleness and the
one correction does not touch: they are a claim owned by the roster as it stood at filing, and
they do not follow a later transfer.

### Enumerate any field's real values with the wire, not this document

```bash
curl -sS -K ~/.dri.curlrc \
  "$BASE/read-api?table=intervention_requests&select=<field>&limit=1000"
# then count distinct in the reader's context
```

## The type catalogue — a second readable table

`intervention_request_types` is the vocabulary behind `request_type` on the request log, and a
credential scoped for it can read it. It is the reason the request-log `request_type` is a
closed set while the work log's is free text.

| Field | Genesis | Shape / allowable values |
|---|---|---|
| `name` | judged — the owner names a kind of work | the value that appears in `request_type` on request-log rows |
| `applies_to` | **judged — owner ruling** | **`intervention_request`** · **`manual_work`** · **`both`** · **`referral`**. Which `entry_kind` a type may be filed under; `referral` scopes a type to a Curriculum DRI → Campus DRI referral (`entry_kind = 'referral'`) and is not offered on either Campus DRI form. Each form's picker offers only the types scoped to it plus `both`, and the write API refuses a mismatched pair |
| `approval_needed` | judged | boolean — whether filing this type routes to a Curriculum DRI for approval |
| `requires_note` | judged | boolean — whether `reason` is mandatory for this type |
| `active` | judged | boolean. **A type can be RE-SCOPED without being deactivated**, and that is what happened to `Test-out approval` on 2026-09-09: it moved to `manual_work` and stayed active, because live rows point at it. An inactive type is not offered on new filings and still describes old ones |

**Enumerate it, do not hard-code it.** Both the member list and the scopes move:

```bash
curl -sS -K ~/.dri.curlrc \
  "$BASE/read-api?table=intervention_request_types&select=name,applies_to,approval_needed,requires_note,active&limit=200"
```

## Nullability — measure it, do not trust a figure

Sparse columns are the ones that mislead. Re-derive the profile per `section`, because a
column filled on one section and empty on the other is a **shape** difference, not missing
data:

```bash
for S in campus_dri subject_dri; do
  curl -sS -K ~/.dri.curlrc "$BASE/read-api?table=intervention_requests&section=eq.$S&limit=1000"
done
# fold: non-null count per column, per section
```

Expect `approval`, `approval_notes`, `campus_dri`, `campus_dri_id` to be sparse and
section-dependent. Run it rather than assuming which.

## Invariants, each with the query that falsifies it

| Invariant | Falsify with |
|---|---|
| `section` is one of two members | `select=section&limit=1000`, count distinct |
| A work-log row names no Campus DRI (the logs are independent) | `section=eq.subject_dri&select=campus_dri_id&limit=1000` |
| `completed_at` is present iff `completed` | `select=completed,completed_at&limit=1000` |
| `completed` is only interpretable where it can be set | `select=entry_kind,completed&limit=1000` — on `manual_work` rows the flag has no control behind it and no meaning; a mix of true and false there is not a finding. Count open work only within `entry_kind = 'intervention_request'` |
| `completed_at` ≥ `created_at` | `select=section,created_at,completed_at&limit=1000` — **fails, and fails per log; see trap 4. Always split by `section` before reading this one** |
| The failure key is complete on every request about a named student | `entry_kind=eq.intervention_request&select=email,full_name,subject,grade&limit=1000` (paged), count rows with a named student and a null key part. Out of scope by design: campus-wide filings (no student), and `manual_work`, where `grade` is not required [owner, 2026-11-02] |
| `request_type_other` is set only on a campus `Other` row | `select=section,request_type,request_type_other&limit=1000` — labels on non-`Other` rows must be zero, and a non-zero count there is a store defect. Campus `Other` rows with **no** label are a different matter: the presence half of the check is currently relaxed, so count them and report the count rather than calling it a defect |
| `entry_kind` is populated **iff** the row is `campus_dri` | `select=section,entry_kind&limit=1000` — count work-log rows carrying a value and campus rows carrying none. Both directions are enforced at the store on both write paths as of 2026-09-09, so **either count being non-zero is a store defect.** The expected count today is 0 in both directions |
| `minutes_spent` is NULL on every `intervention_request` row and populated on every `manual_work` row | `select=entry_kind,minutes_spent&limit=1000` — count minutes on request rows (must be zero; it is forbidden at the store) and manual-work rows with no minutes (a small residue from the backfill is expected and is surfaced for correction in the filing UI) |
| `subject` and `subjects` are never both set, and `subjects` never holds one member | `select=section,entry_kind,subject,subjects&limit=1000` — both populated, or a single-element list, contradicts the store's constraint. A one-subject filing belongs in `subject` |
| A manual-work filing appears once, not once per subject | fold `minutes_spent` on `entry_kind = 'manual_work'` by (`email`, `reason`, `created_at` truncated to the minute) — several rows sharing all three AND carrying the same minutes is one piece of work counted repeatedly. It happened once: a 30-minute deep dive written as seven rows of 30 on 2026-09-11, corrected 2026-09-14. Run it rather than trusting this |
| `completion_minutes` is set only on campus requests that are completed or Rejected | `select=section,entry_kind,completed,approval,completion_minutes&limit=1000` (paged) — a value on a work-log row, on manual work, or on a request that is neither completed nor `Rejected` contradicts the store's own constraint and is worth reporting. A value on an open `Rejected` request is legal: it is the decision time |
| Every request-log `request_type` is a catalogue `name` | campus rows whose `request_type` is not in `intervention_request_types.name` (read both tables). Expected 0. The store does not enforce it (no foreign key), so a non-zero count is a renamed or retired type — report it in its own bucket with the count |
| `completion_minutes` and a linked work-log row's `minutes_spent` never both describe the same request | `select=id,answers_request_id,minutes_spent&limit=1000` plus the requests — propagation leaves `completion_minutes` NULL, so a request with both is either hand-completed after propagation or a defect. Sum them; do not pick one |
| `Test-out approval` appears only on `manual_work` rows | `select=section,request_type,entry_kind&limit=1000` — count campus rows whose `request_type` is `Test-out approval` and whose `entry_kind` is anything else. Owner ruling 2026-09-09: the type is work the Campus DRI performs, so a request row carrying it contradicts the catalogue |

## Traps

1. **A row is a touch, not a failure.** Counting rows as failures overstates what broke and
   hides what each break cost. Fold on the failure key and report **both numbers, labelled**.
2. **A bad operator fails in two different ways, and the column's type decides which.**
   **Branch on the HTTP status, not on `ok`.** On a TEXT column a malformed
   `<col>=<op>.<value>` is not an error: it returns `200` with `ok:true` and a zero count, so
   a typo looks exactly like a clean empty result. On a TYPED column — `uuid`, `timestamp`,
   `boolean`, `smallint` — the same malformed filter returns **`400` with an error body that
   carries no `ok` key at all**, so a reader that tests `response["ok"]` raises on precisely
   the responses it most needs to report. Verified 2026-09-07: `section=bogus.x` and
   `reason=bogus.x` returned `200 ok:true count:0`; `id=`, `campus_dri_id=`, `created_at=`,
   `completed_at=`, `archived=` and `grade=` with the same bad operator all returned `400`.
   Re-derive either way: run the same read with the filter removed and compare.
   **Operators honoured:** `eq neq gt gte lt lte like ilike is`. A day window is
   `created_at=gte.2026-10-01T00:00:00Z&created_at=lt.2026-10-02T00:00:00Z`; an exclusion is
   `built_by=neq.pipeline`. **Timestamps are served with `+00:00`: in a filter write the plus as
   `%2B` or use the `Z` form** — a raw `+` is decoded as a space and returns `400`.
   **Two more shapes, neither with an `ok` key:** a table this credential may not read answers
   **`403`** "not scoped to read" (a misspelt table name looks the same, so check it against
   `readableTables` first), and an unknown column answers **`400`** "… does not exist".
3. **A wrong-case VALUE is silent on text and silently HONOURED on a boolean.** On a text
   column a member spelled with the wrong case returns zero rows and no error, so an absence
   is indistinguishable from a typo. On a boolean column the value COERCES and the filter is
   obeyed: verified 2026-09-07, `archived=eq.False`, `archived=eq.TRUE`, `archived=eq.yes` and
   `completed=eq.FALSE` all returned `200` with real, non-zero row counts. So a zero count is
   **not** a reliable canary for a casing mistake — it only ever fires on text. Write booleans
   as `eq.true` / `eq.false` and nothing else, and **never report an absence from a filtered
   read** without re-running unfiltered.
4. **Born-complete rows are a property of a whole log, not a scattered anomaly.** Where
   `completed_at` precedes `created_at` — by well under a second — the filing records an
   artefact already built and delivered, so one write stamps both clocks. The work was real;
   whether it was human is read from `built_by`, never from the born-complete shape. What is
   missing is any record of how long it took.
   **Measured 2026-09-07: every row in the work log was born complete, and no row in the
   request log was.** Re-derive with the invariant query above, split by `section`, before
   relying on it. If that split still holds, **latency is computable only in the request log**,
   and computing it over the work log is not an approximation — there is nothing there to
   measure. Treating the interval as zero drags any average to the floor; dismissing the rows
   as noise erases real work. Isolate the rows with a real interval, say how many you dropped,
   and name the log.
5. **Do not try to pair the two logs.** `campus_dri_id` is null on work-log rows, and the
   failure key fails whenever a work-log row leaves a key part null — but the deeper point is
   that **the failure key is not a link**: the logs are independent (see *Two independent logs*),
   and the only served link is `answers_request_id`, partly populated — measure it first ([Enablement §9](https://4mxev38j.function2.insforge.app/dss/enablement)).
   A key appearing in both is a coincidence of the same student stalling in the same subject
   and grade, not a request being answered. Reading a low overlap as "requests went
   unfulfilled", or a work-log row as an "orphan", invents a workflow the data does not
   describe.
6. **`Other` in `request_type` is a taxonomy gap, not a residual, and the gap now names
   itself.** A campus `Other` filing means the dropdown is missing a member, and
   **`request_type_other` carries the filer's own words for what was missing** — read that
   column first and `reason` second. Fold the labels rather than reading them one by one:
   near-identical labels recurring across filers are a single missing member with several
   spellings, and that fold is the change request. Report the fold, not the raw strings. Where
   the label is null on a campus `Other` row, count it and report the count. Since 2026-09-08 the
   store does not require the label (see the `request_type_other` row), so it is not a defect.
   Do not read `reason` to fill it in. **Do not apply any of this to the work
   log**, whose `request_type` is unconstrained free text.
7. **Identity travels in free text.** See the person-bearing table.
8. **`select` narrowing breaks any analysis that needs the full row.** The failure key, the
   section split and the trigger all live in different columns.
9. **No superseding link.** An archived-never-completed filing beside a live one *looks* like
   rework, but the relation is inferred by the reader, never served.
10. **The default page size is smaller than the maximum.** The maximum is 1000 and the default
    100; the clamp is silent. Page until `count` is less than the limit the response ECHOES.
    **Every `limit=1000` recipe in this file is a first page only** — the request log alone is past
    1000 rows, so loop each one as [Enablement §1](https://4mxev38j.function2.insforge.app/dss/enablement) shows.
11. **A null part of the failure key makes a row unfoldable.** Never group nulls together —
    that invents a student who does not exist. Hold them out, count them, and give distinct
    failures as a **range**.
12. **`request_type` is a label, not a type.** It does not carry the trigger. A type without
    `reason` is a name for the artefact and tells you nothing about the failure.

13. **`unclassified` is not a third kind of work.** It is rows of **missing metadata** — filings
    made before the form asked the question (before 2026-09-09T09:30Z). The store refuses
    `unclassified` on anything later, so this population is closed. Treating it as a category invents a way of working that nobody does. Any breakdown by
    `entry_kind` must **report the unclassified count beside it** until it reaches zero, because
    the two real members do not sum to the campus log while it is non-zero. The same applies to
    campus rows where `entry_kind` is NULL: same problem, same treatment.
14. **Total DRI minutes cannot be read off the whole campus log.** Request rows are NULL by
    constraint, so a naive `avg(minutes_spent)` over all campus rows divides by the wrong
    denominator and **understates DRI time**; a naive `sum` over the log is right only by
    accident and stops being right the moment an unclassified row is classified. **Scope every
    minutes figure to `entry_kind = 'manual_work'` and say so.** This is not a coverage caveat
    to be measured away — it is a rule at the store, and it does not relax.
15. **Archived rows can still carry minutes.** Six rows archived on 2026-09-14 were also zeroed
    precisely because nothing here told a reader to exclude archived work from a minutes total, so
    archiving alone would have left the figure wrong. Do not assume a future correction will zero
    them: scope a minutes total to `archived = false` as well as to `entry_kind = 'manual_work'`.

### Trap 16 · `reason` can contain a student's name — mask before quoting

The work log's artefact links are built from filenames, and **some of those filenames are the
student's own name**. A row quoted verbatim can therefore publish a child's identity even
though no name column exists and the email column was never read.

**Before quoting or printing any `reason` value, from either log, replace every URL with a
placeholder.** Quote the sentence, never the link. This is not optional and it is not a
formatting preference: it is the difference between an intervention summary and a disclosure.

Measure it rather than assuming — the count is a property of the pull, not of this document:

```bash
# rows whose reason embeds a name-shaped filename in a URL
python3 -c "
import json,re,sys
n=sum(1 for l in sys.stdin if re.search(r'https?://\S*[A-Z][a-z]+_[A-Z][a-z]+', json.loads(l).get('reason') or ''))
print('rows needing URL masking:', n)" < pull.jsonl
```

**The only licensed reads of a person-bearing column are as fold keys held in your own
context:** `email` in [Enablement §2](https://4mxev38j.function2.insforge.app/dss/enablement), `request_type_other` and `created_by` in [Enablement §4a](https://4mxev38j.function2.insforge.app/dss/enablement). Never
print, list or export their values.

## Not asserted

- Whether `subject`, `grade`, `campus` and `level` are **enforced at the store**. The owner
  states the filing front constrains them; that is testimony about the front, and a row
  written outside the front is not bound by it.
- Whether the artefact store behind `approval_notes` is publicly readable. That is a question
  for its owner.
- **The human share of any filing.** Some `reason` text describes an artefact assigned by a
  scheduled pipeline and names a generator; the owner states the work is DRI curriculum work.
  Both can hold — something reasons the artefact, a job assigns it — and **this surface does
  not separate build from assignment.** `built_by` states who produced the row; it does not
  state how long it took. An effort column (`minutes_spent`) is served and, on the request log,
  is confined to `entry_kind = 'manual_work'` by constraint — so **Campus DRI manual work can be
  priced over that scope**, with its coverage and its unclassified count published. Nothing else
  here can be: the work log's minutes must still be measured before use, and no filing carries
  the build time of an artefact a pipeline assigned. Report artefacts delivered and lessons
  assigned, which is what the rows evidence.
- Any rate. Re-derive the data floor before using a per-day figure:
  `order=created_at.asc&limit=1` and `order=created_at.desc&limit=1`.

## Relationships

Two tables are readable: `intervention_requests` and `intervention_request_types` (see *The
type catalogue*). Confirm with a KEYED read that omits `table`, which lists what that credential
may read; a keyless read answers `401`.

**`email` is the only key this source shares with other Alpha sources, and the join is the
reader's — this source holds no crosswalk.** Its mapping, in four parts:

- **Rule:** copied, not resolved or matched. `email` is the student's school address, copied
  from the OneRoster roster into the row at filing; it is never re-derived.
- **Grain and cardinality:** here, many filings per email (one row per filing, across both logs),
  and **no email at all on campus-wide filings**. On the other side, one row per student at that
  source's own grain, as its own contract states. So the join is many-to-one from this table.
- **Publication:** this source does not serve the roster or any mapping table. The correspondence
  holds because both sides copy the same school address from OneRoster; nothing else ties them.
- **Audit read:** page `select=email` over the table (keyed), count distinct non-empty values and
  the empty ones, and report both beside any joined figure; an email absent from the other source
  is a roster mismatch to report, not a dropped student.
