Roster import and org-member enrollment plan
Status: ratified 2026-09-14; S1–S5 landed 2026-09-14 (9a1de031, 81906dde, e76b1968, 2fd0ba51, 0ffce008, bbd0c3cc);
two follow-ups landed 2026-09-15 (self-service names win over a re-import, under decision 9; one live seat per
person, role and offering, under the migration-impact section). Partially closes backlog 0002 (SIS import trigger; learner
enrollment and direct membership management). Relates to ADR-0013 (identity bindings), ADR-0056 (personal
sentinel), the OneRoster 1.2 CSV binding (@conform-ed/contracts).
Decisions ratified 2026-09-14
Section titled “Decisions ratified 2026-09-14”person_profilegainsgiven_name,family_name,preferred_name(nullable).display_namestays the required workspace label.- Every learner import enters through the existing OneRoster CSV import. A small admin-console page converts a student sheet into a 1.2 package; no direct importer exists.
- Importing people is independent of offerings. The upload picks an organization; the converter emits the roles file for it; the sheet carries no org or role columns.
- The reconciler derives organization affiliation from roles rows, not only from enrollments.
- The “add existing member” picker draws from the active affiliates of the offering’s organization.
- The picker is available to org admins and platform admins only. Teachers keep the read-only roster and invites.
- The upload page lives in the admin console, visible to platform admins (the import endpoint’s own gate).
- Sheet contract:
student_idrequired; eithernameorfamily_name+given_name; optionalpreferred_name,email. Unknown headers reject the file. A singlenameis split heuristically: CJK first character as family name, or the first two when on a fixed two-character surname list; otherwise the last space-separated token. Wrong splits are corrected by re-uploading the corrected row (backlog 0016). - Re-upload is additive. Rows present are created or updated (names included); absent students are
untouched; removal is a deliberate admin act.
Follow-up, 2026-09-15 (Anton): a person’s own name wins over a re-import.
person_profilegainsname_asserted_by_person_at_us(nullable microseconds, server-only — not on the wire). It is stamped when the PERSON says how they are called: at signup from the GoTruefull_name/namemetadata (never from the email local part or theUserfallback, which are labels the system invented), and by any later self-service edit. Once stamped, a roster or SIS re-import still writes the institution-recordedgiven_name/family_name— a school correcting its own register must land — but never touchespreferred_nameordisplay_name. Null (every pre-provisioned person) leaves decision 9 exactly as it was: the import owns all four columns. - The student number is shown on the teacher roster by projecting the identity binding, never by copying it onto the profile.
- Enrollment by sheet is a second mode of the same page, after the picker.
Identity mapping
Section titled “Identity mapping”| sheet | OneRoster users.csv |
emergent |
|---|---|---|
student_id |
sourcedId, identifier, username |
identity_binding.external_subject, provider oneroster, issuer = the org’s sheet source |
family_name / given_name |
familyName / givenName |
person_profile.family_name / given_name |
preferred_name |
preferredGivenName |
person_profile.preferred_name |
email |
email |
contact point; correlation with an existing account |
| chosen org | orgs.csv (sourcedId = org id), roles.csv |
organization_affiliation, kind member |
display_name rule, one helper (packages/domain) shared by every writer: preferred_name when
present; otherwise family + given with no separator when the family name is CJK, given + space + family
otherwise.
Slices
Section titled “Slices”S1. Structured names. Columns on person_profile; migration regenerated; drift test posture. The
three columns ride the teacher wire (projection unchanged otherwise); revision
person-profile-teacher-workspace-read-3. The OneRoster batch mapper keeps identifier,
preferredGivenName, preferredFamilyName; the reconciler writes all name columns plus display_name
through the helper, on pre-provision and on re-import through an existing binding; the CSV and REST
exports read the structured columns and fall back to the first-space split only when they are null.
Roster-invite materialization unchanged.
S2. Affiliation from roles. The reconciler ensures an active member affiliation for every roles row
whose org is mapped, using the same idempotent ensure as the enrollment-derived pairs. A person-only
package now yields org members.
S3. Sheet import page. Admin-console feature roster-import: org picker, file input, in-browser CSV
parse and validation with a row-level report before anything is sent, template download, then package
build with fflate (manifest, orgs, users, roles) and base64 POST to the existing import endpoint. New
server endpoint in the oneroster feature, platform-admin, ensure sheet source: creates the org’s sheet
source (issuer roster-sheet:<org id>) and plants the org mapping row so the reconciler updates the
real org instead of minting a duplicate. Result panel shows counts, issues and held identities with a
link to identity review. Converter is feature-local and pure, unit-tested with fixture sheets including
CJK names.
S4. Affiliation rail and picker. organization_affiliation becomes a readonly sync entry on the
teacher-workspace rail with a claims-branching filter: platform admin sees all non-sentinel orgs’
affiliations; org admins see their orgs’. person_profile filter gains an org-admin branch for active
affiliates, so unenrolled members have names on the wire. identity_binding filter gains a read branch:
provider oneroster bindings of persons in the caller’s admin orgs or reachable offerings. No RLS
SELECT twin: the claim-aware policy builders compare a grant against one scalar org or offering id, and
this branch is set containment, so the readonly consume rests on the row filter alone, as person_profile
does (the platform-admin-only manage policies stay, so the teacher rail gains no write). Roster tab: student number column; for admins,
an “Add members” modal searching affiliates by name or number, multi-select, inserting learner
memberships on the sync rail (owner-or-admin RLS already permits). Revision bumps on all three entries.
S5. Enrollment sheet. Second mode on the import page: pick an offering of the chosen org, upload a
sheet with student_id only. Unknown student numbers are reported, never created. Additive.
Amendment, 2026-09-14 (found while implementing). The ratified text had the converter emit class, course and session rows. Two reconciler facts make that wrong: the CSV import hardcodes bulk mode, and bulk mode withdraws every source-managed membership a package does not assert, across all offerings of the source, so a per-offering sheet would empty every other offering imported through the org’s sheet source; and a class row re-points the offering’s learning container to the course’s and overwrites the offering’s and container’s
metawith the source stamp. So S5 is instead: the importer honours the manifest’s per-filebulk/delta/absentdeclaration (every present filedelta→ delta mode, which never infers absence; mixed → refused); the enrollment package is the manifest plusenrollments.csvalone (classsourcedId= the offering id, school = the org id, user = the student number), with the class mapping planted by the ensure endpoint (offeringIdoptional input); users resolve through the bindings the people import created, so an unknown student number surfaces as the reconciler’s own “user unresolved” issue and creates nobody (decision 11 by construction); and the name upsert skips a row that asserts no name, so a user row without names can never blank a profile. The offering’s title, dates, container and meta are never touched by an enrollment package.
Follow-up, 2026-09-15: one live seat per person, role and offering. S4a’s add verb re-derives its “the seat must be free” check inside the unit transaction, but under READ COMMITTED two concurrent adds could both pass it, and the existing unique index keys on
effective_from, which differs per call — so a duplicate live seat was possible.offering_membership_live_seat_uq— partial UNIQUE on(offering_id, person_id, membership_role) WHERE membership_status <> 'withdrawn'— is the database backstop, with exactly the applier’s rule: a withdrawn seat is history and may repeat, every other status holds the seat. The writers reached for it in turn: the reconciler now reuses the live seat it finds instead of minting a rival (so acompleted/expiredseat is REACTIVATED when the source re-asserts an active registration, and a seat added by hand is adopted rather than duplicated); the NRPS sync leaves a seat written by anyone else alone; the invite materialization reactivates the LIVE row rather than the most recent one; the status verb refuses reviving a withdrawn row while the seat is held, with the roster’s own 409 instead of a raw 23505. The personal-offering provisioner needed nothing — its untargetedON CONFLICT DO NOTHINGalready arbitrates on any constraint.
Offering picker and personal offerings, 2026-09-15. The membership sheet’s offering picker cannot filter on
authority_level: the admin console consumesofferingread-only through the shared entry, whose projection omits that column on purpose (the omit is what stops aperson-authority offering being minted over the sync write rail, ADR-0056 decision 3). The picker is safe by design regardless: it lists the offerings of ONE chosen organization, ADR-0056 decision 1 hosts every personal offering inpersonal-0, and the organization read filter has excluded both sentinels for every caller since backlog 0011, so no personal offering can appear under a pickable org; the ensure endpoint’spersonalOfferingrefusal is the independent second guard. Both are pinned by tests (the sentinel exclusion oracle; the sheet-source service tests). Do NOT close this by putting the authority level on the admin wire — a per-registry projection for one table buys a cosmetic filter at the cost of a second column set for the same shape. Reopen trigger: the first admin surface that enumerates offerings ACROSS organizations, which decision 2 says must key on the authority level, not the org.
Migration impact
Section titled “Migration impact”S1 adds columns. S4 adds no DDL (the affiliation entry changes only the generated sync apply function). Both regenerated the migration set (the practice at the time); nothing else did. The 2026-09-15 follow-ups add one column (person_profile.name_asserted_by_person_at_us, with the signup trigger writing it) and one partial unique index (offering_membership_live_seat_uq), regenerated in the same pass.
Verification
Section titled “Verification”Unit: converter fixtures, name split, display-name helper, reconciler roles path, PGlite oracles for the three filters. Integration: the OneRoster roundtrip lane gains a sheet-package import (names, affiliation, binding), then an enrollment package against a pre-mapped offering, then the CSV export carrying the structured names. Playwright: none this pass.
Backlog
Section titled “Backlog”0016: single-name split is heuristic; add column mapping and a name-review step on demand. 0002 points here for the import trigger and enrollment items; org creation and claim tokens remain open.
Deviation
Section titled “Deviation”The converter lives in packages/domain (src/roster-sheet.ts), not feature-local in the admin console as
S3 says. Two reasons: S5’s enrollment sheet builds a package from the same primitives, so a second copy
would have to be kept in step with this one; and fflate — the zip writer — is already a dependency there
(assessment-package.ts builds the QTI content package with it), where the console would have needed a new
one. The module stays pure and I/O-free either way, and apps/api can therefore build a package too, which
is what the cross-package test in csv-import-service.test.ts does.
Runbook
Section titled “Runbook”Importing a roster (admin console dashboard, platform admins):
- Choose the organization. Everyone in the sheet becomes an active member of it. Offerings are not involved — joining one is a separate act (decision 3).
- Download the template if the school has no sheet yet. The contract is
student_idplus eithernameorfamily_name+given_name, and optionallypreferred_nameandemail. Any other column rejects the file (decision 8). - Upload the sheet. It is parsed in the browser and nothing is sent yet. Either a table of problems
(line, column, what is wrong) or a summary and a preview of the first ten rows appears. The parse is
all-or-nothing: while any problem is listed, the import button stays disabled. Check the preview’s split
names — a single
namecolumn is split by the rule in decision 8, and a wrong split is fixed by editing that row and uploading again (backlog 0016). - Import. The page ensures the organization’s sheet source (
POST /workflow/oneroster/sheet-sources, issuerroster-sheet:<org id>, which also plants the org mapping so the reconcile updates the real organization instead of minting a duplicate), builds the OneRoster 1.2 package, and posts it to the ordinary import endpoint (POST /workflow/oneroster/imports). There is no roster-specific importer (decision 2). - Read the report. The outcome badge, the counts per entity type, and the issues the reconcile raised.
Held for reviewcounts students whose contact evidence matched more than one existing account: nothing is guessed for them, so they are neither bound nor created until somebody decides. The report links to the identity review panel further down the same page, where those correlations wait.
Re-uploading is additive (decision 9): rows present are created or updated, students the sheet no longer mentions are untouched. Removing somebody is a deliberate act, never a side effect of an upload.
Offering members (the second mode)
Section titled “Offering members (the second mode)”The same page, switched to Offering members, adds people who are ALREADY members of the organization to one of its offerings.
- Choose the organization, then the offering. The offering list is the organization’s own, live from the admin sync rail; archived and canceled offerings are not offered, and a personal offering can never appear (it lives in the personal sentinel organization, and the server refuses one outright).
- The sheet is one column:
student_id. One student number per row, nothing else — a sheet carrying names is refused, because names are the People mode’s business and a name sitting unread here would look like it had been applied. Download the template if in doubt. - Import. The page ensures the organization’s sheet source again, this time naming the offering, which
also plants the offering’s class mapping; then it posts a package of exactly two files — the manifest and
the membership file. No class, course or session row is ever sent, so the offering’s title, dates,
Learning Container and
metaare never touched by a membership import. - Read the report. “N student numbers are not members of this organization yet” means exactly that: nobody was created for them and they joined nothing. Import those students under People first, then add them here. Every other issue is shown as the reconcile wrote it.
Additive, and deliberately so. The package declares its file delta, so absence never withdraws: adding
students to one offering leaves every other offering imported through the same organization’s sheet source
exactly as it was, and re-uploading the same sheet changes nothing. Removing somebody from an offering stays
a deliberate act. (A bulk package — what a whole-school SIS extract sends — does withdraw by absence, which
is why the manifest, not the transport, decides the mode.)