Decisions
Why things are the way they are, for the ones that are not obvious from the code and that someone would otherwise undo by accident.
Append-only. Add new entries at the bottom with the date you made the call. Do not rewrite or delete an entry when a decision is superseded — add a new one that says so and link back. These are deliberately not numbered ADRs: this is a one- to-two person team and the ceremony costs more than it returns.
Each entry says what was decided, why, and what it costs. The cost line is the important one — it is what tells the next person whether the tradeoff still holds.
Open work lives in OPEN_WORK.md; live deploy state lives in ARCHITECTURE.md. This file is only for reasoning.
2026-08-04 — Site and subsite choices are additive only
Decision. update_site_choices.qmd never deletes or renames a Qualtrics choice. Sites retired from the sheet are left in the survey; qualtrics_checks.qmd reports them as survey-only entries for a human to retire deliberately.
Why. A site’s choice id is a foreign key in four places at once: display logic locators (q://<site_qid>/SelectableChoice/<id>) on the course question and both Participant Feedback facilitator questions, the PF survey flow written by update_pf_flow.qmd, the subsite cascade inside each survey’s local site block, and every historical response already recorded against that choice. Deleting a choice silently breaks all four — nothing errors, the logic just stops matching.
Cost. The choice lists only grow, so the dropdowns carry retired partners until someone prunes them by hand. There is no clean undo for a bad push: once a choice exists it is effectively permanent. Everything else about the gate design below follows from this one constraint.
2026-08-04 — The Official Site List tab is the gate for driving subsites
Decision. A subsite column on the FY27 School/District Selection for Sites tab is only pushed to Qualtrics if its site also appears on the FY27 Official Site List tab.
Why. The subsite tab is hand-maintained and accumulates scratch columns for sites that were never onboarded, holding placeholder school names — SL_EPLA carried “Ava High School” and “Booster High School”; SL_WI Victory, SL_NYC D4 and SL_NYC D8 are the same shape of leftover. Combined with additive-only, a single bad column would put fake schools into six live surveys permanently. The site list is the one tab that gets deliberate attention, so it is the gate.
Cost. Adding a row to the Official Site List is now a live survey change, not a bookkeeping edit — it can create questions in six surveys on the next run. That power sits in a spreadsheet with no review step. Two sites are also blocked harmlessly as collateral: DC_DCPS Cluster 8/9 and TN_Acceleration for All Region/District, which the ambiguity filter already excluded under their old names.
2026-08-06 — The site → question mapping is derived, not declared
Decision. Which subsite question belongs to which site is read back out of each question’s display logic (q://<site_qid>/SelectableChoice/<id>), not looked up in a maintained list.
Why. The maintained list was tlShiny::subsites, and it had drifted measurably. Checked against the live Educator Survey it agreed on only 35 of 38 mappings: it said MA_Boston and NY_CPS_OpenSciEd where both the surveys and the sheet say MA_Boston Prep and NY_NYCPS_OpenSciEd, and it mapped d13_prek_subsite to NY_D13 Pre-K where the question is really conditioned on NY_D13. A declared list is a second copy of something the survey already knows, and the second copy rots.
Deriving also made three former hardcoded exceptions fall out for free: the text-entry NYC districts register as covered (so they are never handed a choice list), a site resolving to two questions (DC_DCPS → clusters and schools) is reported and skipped, and the tn_acceleration2 cascade hangs off the region question so it simply never claims a site.
Cost. The mapping is now only knowable by calling the Qualtrics API — you cannot read it out of the repo. A question with missing or hand-edited display logic silently drops out of the mapping instead of erroring. tlShiny::subsites is deprecated and survives only as a warned fallback in tracker_27.qmd.
2026-08-06 — The subsite tag list is published as a registry object
Decision. update_site_choices.qmd writes the derived mapping to tl-surveys-27/subsite_question_registry_fy27.parquet (survey_id, site, question_tag, question_type, qid). That object, not tlShiny::subsites, is the downstream contract for “which export column holds the subsite for which site”.
Why. Deriving the mapping fixed the drift but left it trapped inside one render log. Publishing it is what makes a newly created question visible downstream with no hand edit — which was the whole point of automating question creation.
Cost. A new cross-repo dependency on an S3 object, and a consumer (tracker_27.qmd) that has to carry fallback code for when it is unreadable. The registry is only as fresh as the last successful run of the job that writes it.
2026-08-06 — FY27 has its own Master Survey Input sheet
Decision. FY27 reads from 1hbs5d1uf2xq… (“FY27 Master Survey Input for Automation”). FY26-and-earlier readers stay on the original sheet (11jlo9UeWxZ…).
Why. L&R split FY27 onto a new sheet in August 2026. The original sheet kept its FY27 tabs, and those copies have since diverged — reading FY27 from there both misses new sites and makes qualtrics_checks.qmd report false differences.
Cost. Two sheets that must both stay alive, and a rule with no enforcement: FY27 must never be read from the old sheet, and FY26 must never be read from the new one, because the new sheet has no FY26 tabs and those readers would hard- error if moved. Seven files are still on FY26 tabs for exactly this reason and cannot migrate until FY27 tabs exist — tracked in OPEN_WORK.md.
2026-08-06 — PF facilitator handling is its own job
Decision. The Participant Feedback facilitator half was split out of update_coach_selection.qmd into update_facilitator_choices.qmd.
Why. They are different shapes of problem despite looking like duplicates. The coach job maintains a choice list — a roster of who exists — from the Monday facilitator board plus full-time employees. The facilitator job writes per-site display logic onto PF’s QID224/QID109, sourced from an S3 pl_today_facilitators_fy27.rds feed refreshed daily by a separate Connect job, so that a participant only sees the people who actually ran their session.
Cost. Two similarly-named jobs that are genuinely easy to confuse, made worse by the same person often being both a coach and a facilitator, and by PF’s second facilitator question carrying the export tag coach_2 while being maintained by the facilitator job. The original file also kept a stale header claiming it still handled PF, which stayed wrong until 2026-08-07. Both files now carry an explicit cross-reference.
2026-08-07 — Target questions are resolved by DataExportTag, not hardcoded QID
Decision. update_coach_selection.qmd resolves its target question by DataExportTag == "coach" in each survey rather than naming QID469/QID39/ QID3 as literals.
Why. Hardcoded QIDs are what let this job’s FY27 migration get missed entirely. It sat live on Connect maintaining coach lists on the FY26 IPG and Student Work surveys while the FY27 copies got no updates at all, and nothing failed — the FY26 QIDs still resolved, so every run looked healthy. A survey id that is wrong should break loudly; with a tag lookup and a stop() on no match, it does. The export tag is stable across fiscal years in a way the QID is not guaranteed to be, even where FY27 happens to reuse the same numbers.
Cost. One extra QSF fetch per survey, and a hard dependency on the export tag being spelled identically across surveys — renaming a tag in Qualtrics now breaks the job rather than silently retargeting it. That is the intended failure mode, but it is a failure mode.
2026-08-08 — The five sites dropped from the FY27 site list are real exits
Decision. ar_osceola, ct_hamden, ma_westspring, tx_elpaso and tx_la_joya fell off the FY27 Official Site List in the sheet move, and that is correct: partner work with all five is finished. They are no longer driven and stop receiving new subsites. Deprecating update_la_joya_pf.qmd on the strength of that drop was the right call, and it stays in posit_automations/deprecated/.
Why. The drop was found by diffing the FY27 Official Site List against the previously driven sites (2026-08-06, commit 9ed7cccc) and was carried as open work because nobody had confirmed it was intentional rather than an oversight in the two-sheet split — see FY27 has its own Master Survey Input sheet. Confirmed 2026-08-08.
Cost. Nothing was removed from Qualtrics, because the choice jobs are additive only — see Site and subsite choices are additive only. All five remain as selectable choices on the FY27 surveys and will keep appearing in dropdowns until someone prunes them by hand, and qualtrics_checks.qmd will keep reporting them as survey-only entries. That report noise is the intended signal, not a bug.
TX_La Joya ISD also stays in the excluded_sites guard at api/monday-webhook/plumber.R:974 and :1163. Removing it there would switch coaching-log processing back on for the site, so the dead entry is the safe state and should be left alone.
2026-09-28 — The FY27 coaching log was bootstrapped past its own save guards
Decision. full_coach_log_27.parquet was overwritten once by hand with a verified 288-row build. The 31-row object it replaced (dev-board test data dated June 2026 and one row in 2027) is kept at coaching-data-tl/archive/full_coach_log_27_dev_seed_2026-07-23.parquet. The job now runs hourly at :15 (Connect schedule 209), just before tracker_27 at :00.
Why. update_coaching_log_27.qmd refuses to save when the new build loses columns, non-NA rate or max date against the previous object. Measured against the seed, the real board lost 27 test-only columns and “regressed” from a 2027 date, so the job could never write. After the one overwrite, the guards compare real data to real data.
Cost. The FY27 board was redesigned and its column titles differ from FY26. Anything the rename map doesn’t list is dropped silently by select(-contains(" ")), so a new board column needs a line in the map. FY27 fields that are the same as an FY26 field keep the FY26 snake_case name (for example Cancelled Coaching becomes cancelled_coaching_activities) so readers that bind both years get one series.
2026-11-16 — The EC2 server was rebuilt on Ubuntu 26.04, not upgraded in place
Decision. For the move off Ubuntu 22.04 (Posit support ends April 2027), a new 26.04 server was built next to production, rehearsed against a snapshot copy of Connect’s data with the scheduler off, and then took over the Elastic IP after a final rsync. 22.04 → 26.04 also kept the existing content: pinned packages that no longer build (later < 1.4.8) were bumped in each bundle’s manifest, rather than dropping to 24.04 or republishing everything.
Why. Posit recommends this path, and it means production is untouched until the final copy. A failed rehearsal costs nothing, and rolling back is just moving the IP. 26.04 is supported to 2031, so the next forced move is years away. The manifest bump changed one package per item and needed no source changes or redeploys from laptops.
Cost. Bundles on the server no longer match what the repo would deploy: 37 items carry a hand-edited later version until their next normal deploy. Unarchived content may need the same bump. The new OS also brought FreeType 2.14, which broke showtext, and the copied package cache needed scanning for 22.04-linked packages. Both are in SERVER.md.
2026-10-07 — ongoing_report versions its data by S3 ETag, not Last-Modified
Decision. The reload check and every bindCache() key use a per-dataset <cache_key>_etag stamp (data_stamps() in R/helpers.R, set in R/data_pull.R), so only the sections whose data changed miss the cache. The _last_modified stamp is still kept, but only for the “last updated” text.
Why. full_coach_log_27.parquet is rewritten every hour with the same content. Its ETag stays the same, but its Last-Modified changes. When the version was Last-Modified, the app reloaded every hour and switched the whole reactive cache to a new namespace. On 2026-10-07 that showed up as a 30s At a Glance load inside a warm process.
Cost. There are two stamps per dataset, and a new loaded dataset needs an entry in data_object_sources or its keys go stale. test_cache_keys.R checks this statically. The “last updated” text reports when an object was last written, which may not be when its content changed. (Folded from handoffs/HANDOFF_2026-10-07_glance_speed.md; shipped in a93f0c8d.)
2026-10-07 — Alchemer cutover: everything by January 2027, one survey at a time, same S3 outputs
Decision. Every FY27 survey moves from Qualtrics to Alchemer by January 2027, at the BOY→MOY break, one survey at a time. The production S3 objects keep their names and schema. After cutover they hold the frozen Qualtrics FY27 rows plus the Alchemer rows. A survey counts as cut over when it’s listed in the cutover registry, and readers switch through TeachingLab::fetch_survey_any() / metadata_any(). Readers never read the *_alchemer parquets directly.
Why. tracker_27 and the pre/post analyses match a teacher’s BOY response to their MOY/EOY one. Switching a survey mid-cycle would split one cycle across two platforms. Keeping the S3 outputs identical means no dashboard needs to change. The 90-day Qualtrics non-renewal deadline was missed in March 2026, so Qualtrics runs to about May 2027 regardless, and Alchemer’s first year is free.
Cost. Both platforms have to be maintained until January: site sync, autocomplete and display-logic changes go to both. Every raw Qualtrics read has to go through the registry-gated helpers, or it misses Alchemer responses after the switch. tracker_27’s Qualtrics resume links stop working when each survey closes; the user chose not to migrate them. (Folded from handoffs/HANDOFF_2026-10-07_alchemer_migration.md.)
2026-10-08 — A multi-subject leader counts under each of their subjects
Decision. Leaders pick content areas from a multi-select (ES QID481, PF QID327). The ETL stores the answer comma-joined in content_area ("ELA/Literacy, Math"). Filters count that response under each subject, but the unfiltered total counts it once. Matching is opt-in through tlShiny::neg_cond_filter(..., multi_value = TRUE). neg_cond_filter itself wasn’t changed globally.
Why. Duncan and Shaye agreed on this for leaders TL supports in several subjects (for example NYC D13, Reads + Solves). neg_cond_filter filters site, subsite, race, course and more in about ten dashboards, and some of those columns (race, grade_level) can legitimately contain ", ". Splitting everywhere would corrupt them.
Cost. Filtered counts can add up to more than the total. Every new reader of survey content_area has to split it (separate_longer_delim then distinct per response) or it silently drops leaders. Dashboards that pass multi_value error on tlShiny 0.1.0, so tlShiny has to be installed from GitHub before they’re deployed. (Folded from handoffs/HANDOFF_2026-10-09_leader_content_area.md.)
2026-10-21 — Data Collection sync owns its Partnerships columns and only syncs exact names
Decision. sync_data_collection() overwrites the Data Collection View columns on board 18426983068, so hand edits there don’t survive. A logistics board feeds a partnership row only when its hub L&R name exactly matches the item name, plus a program token when the name has several rows. Near misses are listed on the Issues sheet’s Missing Partnership Rows tab, not synced. Coaching boards fill first and PL boards fill the gaps. The status and date for one checkpoint come from the same board.
Why. The user asked for a name mismatch to be treated the same as a missing row. A fuzzy match risks writing one project’s data onto another’s row. Coaching templates ship with dates already filled in, so a board’s date only means something next to that board’s own status.
Cost. Any project whose hub name drifts from its partnership row gets nothing until someone fixes the name, and the Issues sheet only helps if someone reads it. Program-token routing depends on the board names and text3__1 staying consistent. (Folded from handoffs/HANDOFF_2026-10-21_data_collection_sync.md.)
2026-10-25 — file-upload-tl stays public and defends itself
Decision. The partner upload form (Connect app 285) stays public. In place of sign-in it uses: - a 50 MB per-submission cap; - an extension allowlist (no .xls, .doc or macro formats), with each file’s content checked against its extension’s signature; - CSV formula-injection rejection; - per-IP limits taken from the first X-Forwarded-For entry.
The daily email job only sends files GuardDuty has tagged NO_THREATS_FOUND. It holds back everything else, including files it can’t read tags for.
Why. The people uploading don’t have teachinglab.org accounts, and Connect sign-in is teachinglab.org only. The per-IP limit can be trusted because Caddy (v2.10.2, no trusted_proxies) discards a client-sent X-Forwarded-For and writes the real peer address. That was checked with a probe app on 2026-10-25.
Cost. - The rate limits live in process memory and reset whenever Connect starts a new R process. - There is no CAPTCHA. - Partners who need .xls, .zip or .json are refused until one of those is added on purpose, with its own content inspection. - If trusted_proxies is ever set, for example behind Cloudflare, the per-IP limit becomes spoofable and has to be revisited.
(Folded from handoffs/HANDOFF_2026-10-25_file_upload_tl.md.)
2026-10-28 — FY27 update emails take rates from the tracker and counts from Project Health
Decision. In automated_emails_fy27.qmd, completion rates (Participant Feedback, Diagnostic Educator Survey, baseline observation only for now) come from the tracker’s Project Overview tab. Counts and NPS come from the FY27 Project Health sheet’s All Metrics tab. Pre-K participants at the six NYC ECE districts are reported as "<site> ECE". The ECE list lives in tracker_27, project_health_27 and the email script, and the three have to stay the same.
Why. Duncan’s call: rates have to be rostered-only, and only the tracker knows the roster. Counts include every submission from the site.
Cost. Counts and rates can look contradictory. DC_DCPS showed 19 observations and a 0% rate, because all 19 were of unrostered teachers. The same pattern shows at TN_McNairy and GA_Continental Colony. Two sheets have to agree for one email to be right. (Folded from handoffs/HANDOFF_2026-10-28_automated_emails_fy27.md.)
2026-11-05 — The project log pipeline joins on employee_id and builds from one long table
Decision. Every project log join uses Employee ID, not name. The targets driver builds one long tl-monday/staffing_weekly.parquet (one row per employee × week × project × role, staffed or logged) with build_staffing_weekly(). The report and the Thursday emails read it. The old wide files are still written, derived from it by the legacy_* functions, until project_log_tl moves off them.
Why. Staffed people were showing 0 hours. The BAD names people by their legal name from FTE/PTE Details, but people log under their preferred names. Two near-duplicate staffing functions (last 4 weeks vs per month) were also drifting apart. One table turns both views into filters.
Cost. Until the legacy files are retired, every change has to keep them byte-identical for project_log_tl. Budgets come from today’s BAD for every week, because the BAD has no history in S3, so past months show today’s staffing. Adding a column to project_log_submissions trips the archive schema-drift guard unless the archive is updated too. (Folded from handoffs/HANDOFF_2026-11-05_project_log_consolidation.md and handoffs/HANDOFF_2026-11-05_dashboard_staffing_weekly.md.)
2026-11-22 — No new FY27 FCOT survey, Recorded Conversations survey or student work sheet, the FY27 Student Survey isn’t being set up, and completed projects get no update email
Decision. FY27 gets no new Facilitation Competency survey (FCOT stays on SV_8ldVeywLkOMgugK), no new Coach-Teacher Recorded Conversations survey (stays on SV_b9pikOzhbXvOapw, SY25-26), and student work needs no sheet beyond the SY26-27 grading sheet 1snMytJMFiuiVj7F167jfrLq-WSFOTKD0cOD40WtTSgY that update_student_work_27.qmd already writes. The FY26 sheet 1uB4-JiTo… in ec2_tl_scripts’ update_student_work.R is the FY26 job’s. The FY27 Teaching Lab Student Survey (SV_cDg05ZZPWuH94km) won’t be activated, and update_student_survey.R stays on the FY26 survey, so get_student_survey(year = "26_27") keeps erroring. Projects in the “FY27 Completed Projects” group of the FY27 staffing board get no FY27 update email, even when they still have rostered people or a timeline running to 2027-06-30.
Why. The user confirmed all four on 2026-11-22. The “FY26”/“SY25-26” ids in update_facilitation_competency.R, qualtrics_checks.qmd, update_coach_selection.qmd and update_coachee_selection_27.qmd are therefore intentional, not missed in the FY27 roll. A second live survey would split the response data.
Cost. Those ids look like stale FY26 leftovers to anyone auditing the FY27 roll. An ops mistake that moves a live project into the Completed group stops its emails without an error.
2026-11-23 — The EC2 server keeps static S3 keys instead of an instance role
Decision. S3 access on the server stays on the static tl-s3-apps key, in the Connect supervisor script and /home/ubuntu/.Renviron. No EC2 instance role.
Why. The keys are no longer readable by other accounts (supervisor 750 root:rstudio-connect, .Renviron 600). Every process on the server would get the role’s permissions anyway, which is the same blast radius as now. The work (an IAM role, aws.ec2metadata for aws.s3 readers, checking every reader) outweighs the gain for a one-server, one-person setup.
Cost. The key never expires, so a leak stays live until someone rotates it by hand: update the supervisor script and .Renviron, then restart Connect and tl-api (see SERVER.md). It also rules out SSM Session Manager, so SSH stays on port 22, behind fail2ban and the scripts/ssh_allow.sh allowlist.
2026-11-23 — Glacier archive skips surveys whose full responses are already in S3
Decision. cutover_archive.R --from-sheet archives the inventory sheet’s “Save to Glacier? = Yes” rows except those with “Already in AWS = Yes”. It also skips the uploaded files of any survey whose “Where in AWS” names a bucket for them (manifest uploaded_files_skipped: true). Rows marked “Yes, copy from that date” or “Scored answers only” are still archived, because S3 holds only part of those responses. The first run (2026-11-23) archived 149 surveys, 55,188 responses, 3.9 GB; the list is s3://tl-backup-qualtrics/qualtrics_archive/index.csv.
Why. Shaye’s rule was “save anything with responses”. The user’s addition was not to save again what we already keep.
Cost. For “Yes” rows, S3 holds processed parquet/rds, not a raw Qualtrics export or the QSF. The FY27 surveys are still archived in full by cutover.R when they close. Exported response counts fall short of the sheet’s Responses (Qualtrics auditable) for 53 surveys, by up to 115 (L&R Feedback SurveyII ’23-’24 exports 0). Those are not in-progress responses (checked on three surveys); they look like deleted responses that auditable still counts. This was not confirmed in the Qualtrics UI.
“Where in AWS” was matched by hand and can be wrong. On 2026-11-24 the SY23-25 Student Work survey (SV_6nwa9Yb4OyXLji6), marked as having its uploads in tl-student-work, had only 1,771 of its 4,670 uploaded files there. It was archived in full by --survey on 2026-11-25 (28.8 GB). Check a survey’s file ids against the bucket before trusting a “uploaded files in” row.