<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Gadfly%2FOPERATIONS</id>
	<title>Gadfly/OPERATIONS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Gadfly%2FOPERATIONS"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Gadfly/OPERATIONS&amp;action=history"/>
	<updated>2026-12-06T21:39:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Gadfly/OPERATIONS&amp;diff=299&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Gadfly/OPERATIONS&amp;diff=299&amp;oldid=prev"/>
		<updated>2026-11-29T20:19:08Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;a href=&quot;https://mindattic.com/wiki/docs/index.php?title=Gadfly/OPERATIONS&amp;amp;diff=299&amp;amp;oldid=171&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Gadfly/OPERATIONS&amp;diff=171&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Gadfly/OPERATIONS&amp;diff=171&amp;oldid=prev"/>
		<updated>2026-11-29T20:03:45Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Operating Gadfly =&lt;br /&gt;
&lt;br /&gt;
The runbook for whoever runs a Gadfly deployment (MindAttic platform staff): how to see that it is healthy, how to back it up and restore it, how to rotate its secrets, what to do when something goes wrong, and the checklist for a release. Setting a deployment up the first time is in [[Gadfly/DEPLOY|DEPLOY.md]]; what the app keeps about people is in [[Gadfly/PRIVACY|PRIVACY.md]]. Everything here was checked against the code and scripts as they are now; where a name appears in &amp;lt;code&amp;gt;code&amp;lt;/code&amp;gt;, it is the exact setting, route or table the app uses.&lt;br /&gt;
&lt;br /&gt;
The live deployment, for reference:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Piece&lt;br /&gt;
! Name&lt;br /&gt;
|-&lt;br /&gt;
| App Service&lt;br /&gt;
| &amp;lt;code&amp;gt;mindattic-gadfly&amp;lt;/code&amp;gt; in resource group &amp;lt;code&amp;gt;MyApps&amp;lt;/code&amp;gt; (https://mindattic-gadfly.azurewebsites.net)&lt;br /&gt;
|-&lt;br /&gt;
| Database&lt;br /&gt;
| &amp;lt;code&amp;gt;Gadfly&amp;lt;/code&amp;gt; on Azure SQL server &amp;lt;code&amp;gt;sql-mindattic-f65744&amp;lt;/code&amp;gt; (resource group &amp;lt;code&amp;gt;rg-mindattic-data&amp;lt;/code&amp;gt;), serverless, auto-pauses after 60 minutes idle&lt;br /&gt;
|-&lt;br /&gt;
| Key Vault&lt;br /&gt;
| &amp;lt;code&amp;gt;kv-tutor-f65744&amp;lt;/code&amp;gt; (secrets, and the key &amp;lt;code&amp;gt;gadfly-dp-protect&amp;lt;/code&amp;gt; that wraps the Data Protection key ring)&lt;br /&gt;
|-&lt;br /&gt;
| Data Protection key ring&lt;br /&gt;
| blob &amp;lt;code&amp;gt;gadfly-dp-keys/keys.xml&amp;lt;/code&amp;gt; in storage account &amp;lt;code&amp;gt;stmindatticdbf65744&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 1. Monitoring ==&lt;br /&gt;
&lt;br /&gt;
=== Health endpoints ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Route&lt;br /&gt;
! Who may call it&lt;br /&gt;
! Answers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GET /healthz&amp;lt;/code&amp;gt;&lt;br /&gt;
| Anyone (no sign-in)&lt;br /&gt;
| &amp;lt;code&amp;gt;Healthy&amp;lt;/code&amp;gt; (200) when the database answers, &amp;lt;code&amp;gt;Unhealthy&amp;lt;/code&amp;gt; (503) when it does not. The ASP.NET Core health check with one check, &amp;lt;code&amp;gt;database&amp;lt;/code&amp;gt;. Nothing else is in it.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GET /healthz/ready&amp;lt;/code&amp;gt;&lt;br /&gt;
| Anyone (no sign-in)&lt;br /&gt;
| JSON: &amp;lt;code&amp;gt;&amp;amp;#123;&amp;quot;status&amp;quot;:&amp;quot;ready&amp;quot;&amp;amp;#124;&amp;quot;unready&amp;quot;,&amp;quot;checks&amp;quot;:&amp;amp;#91;&amp;amp;#123;&amp;quot;name&amp;quot;:&amp;quot;Database&amp;quot;,&amp;quot;state&amp;quot;:&amp;quot;ok&amp;quot;&amp;amp;#124;&amp;quot;warning&amp;quot;&amp;amp;#124;&amp;quot;failing&amp;quot;&amp;amp;#125;, ...&amp;amp;#93;&amp;amp;#125;&amp;lt;/code&amp;gt;. 200 while nothing is failing, 503 when a check fails. Names and states only: no counts, provider names or error text. Not cached.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GET /healthz/providers&amp;lt;/code&amp;gt;&lt;br /&gt;
| Platform admin only&lt;br /&gt;
| JSON snapshot of each live AI provider&amp;#039;s health: calls, failures, consecutive failures, last error. Read from memory since the server started; it makes no provider call.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GET /healthz/call-timings?session=&amp;amp;lt;id&amp;amp;gt;&amp;amp;amp;limit=200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Platform admin only&lt;br /&gt;
| Plain text: the latest outside calls on live exams (one session&amp;#039;s, or every session&amp;#039;s without &amp;lt;code&amp;gt;session&amp;lt;/code&amp;gt;), newest first; the same calls slowest first; then count, average and maximum milliseconds per call name. &amp;lt;code&amp;gt;limit&amp;lt;/code&amp;gt; is 1 to 2000 (default 200). Read from &amp;lt;code&amp;gt;gadfly.ApiCallTimings&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GET /healthz/voice-recognition&amp;lt;/code&amp;gt;&lt;br /&gt;
| Platform admin only&lt;br /&gt;
| Plain text: the speech recognizer&amp;#039;s latency from the end of speech to its final transcript (count, average, p50, p95, max) and the share of unsure words per answer, over the last 2,000 samples. In memory only: empty after a restart.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Platform admin&amp;quot; is the MindAttic platform administrator account (the &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; account seeded from the bootstrap token, and anyone given that library role), not an organization&amp;#039;s Owner or Admin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/healthz/ready&amp;lt;/code&amp;gt; runs the same checks as the system status page:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Check&lt;br /&gt;
! Fails (503) when&lt;br /&gt;
! Warns when&lt;br /&gt;
|-&lt;br /&gt;
| Database&lt;br /&gt;
| it does not answer&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
| Database migrations&lt;br /&gt;
| migrations are not applied (the database is behind the app), or the database is down&lt;br /&gt;
| the migration history could not be read&lt;br /&gt;
|-&lt;br /&gt;
| AI panel&lt;br /&gt;
|  &lt;br /&gt;
| the mock panel is in use outside Development, or every live provider (or some) is failing&lt;br /&gt;
|-&lt;br /&gt;
| Voice&lt;br /&gt;
|  &lt;br /&gt;
| voice is off, simulated outside Development, or the latest speech call of some kind failed&lt;br /&gt;
|-&lt;br /&gt;
| Background jobs&lt;br /&gt;
|  &lt;br /&gt;
| a job anywhere on the platform failed in the last 24 hours, or a queued job has waited more than 15 minutes (the worker may be stalled)&lt;br /&gt;
|-&lt;br /&gt;
| Webhook deliveries&lt;br /&gt;
|  &lt;br /&gt;
| a delivery was given up in the last 24 hours&lt;br /&gt;
|-&lt;br /&gt;
| Errors in the log&lt;br /&gt;
|  &lt;br /&gt;
| this server logged an error in the last hour&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Only the first two make the app unready. Point an uptime monitor at &amp;lt;code&amp;gt;/healthz/ready&amp;lt;/code&amp;gt; and alert on anything but 200; a second, slower probe of &amp;lt;code&amp;gt;/healthz&amp;lt;/code&amp;gt; tells &amp;quot;the app is down&amp;quot; apart from &amp;quot;the database is behind&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the live app runs in mock mode (&amp;lt;code&amp;gt;Gadfly&amp;amp;#95;_AiMode=mock&amp;lt;/code&amp;gt;) until the owner says otherwise, so its AI panel check reads &amp;lt;em&amp;gt;warning&amp;lt;/em&amp;gt; by design; that does not make it unready.&lt;br /&gt;
&lt;br /&gt;
=== The system status page ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;System status&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt;) is the readable version, for an organization&amp;#039;s Owners and Admins and for the platform admin. It calls no AI or speech provider, so refreshing it costs nothing. It shows the checks above, the app&amp;#039;s version and environment, the AI mode and why it is in force, each provider&amp;#039;s calls and failures, the latest outcome of each kind of speech call, the database and its migrations (and its size, for the platform admin), the organization&amp;#039;s background jobs (waiting, running, and failed or cancelled in the last 7 days, with &amp;lt;strong&amp;gt;Retry&amp;lt;/strong&amp;gt; and &amp;lt;strong&amp;gt;Cancel&amp;lt;/strong&amp;gt;), webhook deliveries, storage use, and how long each outside call on a live exam took in the last 24 hours. The platform admin also sees each provider&amp;#039;s last error and the last 50 errors this server logged (kept in memory since it started). The admin guide&amp;#039;s [[Gadfly/guides/admin-system-status|System status and jobs]] page describes every part.&lt;br /&gt;
&lt;br /&gt;
=== Logs ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Where&lt;br /&gt;
! What&lt;br /&gt;
! How long&lt;br /&gt;
|-&lt;br /&gt;
| App Service application log (&amp;lt;code&amp;gt;LogFiles/Application&amp;lt;/code&amp;gt;, and the &amp;lt;strong&amp;gt;Log stream&amp;lt;/strong&amp;gt; in the portal or &amp;lt;code&amp;gt;az webapp log tail -g MyApps -n mindattic-gadfly&amp;lt;/code&amp;gt;)&lt;br /&gt;
| Everything the app logs at Information and above (EF Core commands and ASP.NET Core at Warning)&lt;br /&gt;
| Files of up to 50 MB, the 10 newest kept. Application logging to the file system must be on for the app: &amp;lt;code&amp;gt;az webapp log config -g MyApps -n mindattic-gadfly --application-logging filesystem --level information&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| MindAttic.Log&amp;#039;s own database&lt;br /&gt;
| The same structured log, in a SQLite file under the instance&amp;#039;s MindAttic Vault folder (&amp;lt;code&amp;gt;Logging\Gadfly.Server\MindAttic.Log.db&amp;lt;/code&amp;gt;)&lt;br /&gt;
| Lives on the instance; not a backup.&lt;br /&gt;
|-&lt;br /&gt;
| System status, &amp;lt;em&amp;gt;Recent errors&amp;lt;/em&amp;gt;&lt;br /&gt;
| The last 50 errors since the server started&lt;br /&gt;
| Memory only.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;gadfly.ApiCallTimings&amp;lt;/code&amp;gt;&lt;br /&gt;
| One row per outside call on a live exam (panel steps, the examiner&amp;#039;s voice)&lt;br /&gt;
| Deleted by the daily &amp;lt;code&amp;gt;privacy.retention&amp;lt;/code&amp;gt; job once older than &amp;lt;code&amp;gt;Gadfly:Logs:CallTimingDays&amp;lt;/code&amp;gt; (default 365). No setting can make it shorter than 184 days.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;gadfly.AuditEvents&amp;lt;/code&amp;gt;&lt;br /&gt;
| Every audited change, refusal, export and download&lt;br /&gt;
| &amp;lt;strong&amp;gt;Never deleted.&amp;lt;/strong&amp;gt; Retention and erasure clear the student&amp;#039;s words and grades from an event&amp;#039;s detail and mark it &amp;lt;em&amp;gt;Redacted&amp;lt;/em&amp;gt;; the row stays.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The six-month floor on both logs is GAD-T466&amp;#039;s reading of the EU AI Act&amp;#039;s log-keeping duties (Arts. 12, 19 and 26(6)); [[Gadfly/COMPLIANCE|COMPLIANCE.md]] marks that reading for counsel. An organization&amp;#039;s transcript retention period (7 days at the shortest) never shortens a log.&lt;br /&gt;
&lt;br /&gt;
Useful log lines to search for:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;Gadfly AI panel: MOCK mode.&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Gadfly AI panel: live providers.&amp;lt;/code&amp;gt; at startup: which panel is running, and why.&lt;br /&gt;
* &amp;lt;code&amp;gt;LLM provider &amp;amp;#123;Provider&amp;amp;#125; has failed &amp;amp;#123;Count&amp;amp;#125; calls in a row; the panel is running without it.&amp;lt;/code&amp;gt; A provider is down.&lt;br /&gt;
* &amp;lt;code&amp;gt;Gadfly:Voice:Mode is live but MindAttic:Avatar:ElevenLabs:VoiceId is not set; voice mode is off.&amp;lt;/code&amp;gt; (standard error at startup).&lt;br /&gt;
* &amp;lt;code&amp;gt;Log retention: deleted &amp;amp;#123;Count&amp;amp;#125; call timing row(s)&amp;lt;/code&amp;gt; from the daily retention job.&lt;br /&gt;
* A warning naming accounts still in the deprecated &amp;lt;code&amp;gt;Gadfly:AdminDesk:Admins&amp;lt;/code&amp;gt; list (see section 4.4).&lt;br /&gt;
&lt;br /&gt;
== 2. Backups and restore ==&lt;br /&gt;
&lt;br /&gt;
=== What Azure does, and what Gadfly does not ===&lt;br /&gt;
&lt;br /&gt;
Gadfly keeps everything durable in the one Azure SQL database (the &amp;lt;code&amp;gt;gadfly&amp;lt;/code&amp;gt; schema, plus the &amp;lt;code&amp;gt;auth&amp;lt;/code&amp;gt; schema of MindAttic.Authentication: accounts, password hashes, MFA). &amp;lt;strong&amp;gt;Gadfly has no backup job of its own&amp;lt;/strong&amp;gt;: it relies on Azure SQL&amp;#039;s automatic backups. No exam audio or video is ever stored, so there is nothing outside the database to back up except the secrets below.&lt;br /&gt;
&lt;br /&gt;
Two things live outside the database and must survive with it:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;The Data Protection key ring&amp;lt;/strong&amp;gt; (blob &amp;lt;code&amp;gt;gadfly-dp-keys/keys.xml&amp;lt;/code&amp;gt;, wrapped by Key Vault key &amp;lt;code&amp;gt;gadfly-dp-protect&amp;lt;/code&amp;gt;). It signs sign-in cookies and launch links, and it encrypts what the database holds in protected form: &amp;lt;strong&amp;gt;every webhook signing secret and Gadfly&amp;#039;s LTI private key&amp;lt;/strong&amp;gt;. A restored database is useless for webhooks and LTI without the ring that was in use when those rows were written. Turn on soft delete and versioning for that storage container, and keep Key Vault&amp;#039;s soft delete and purge protection on.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Key Vault secrets&amp;lt;/strong&amp;gt; (section 3). Key Vault keeps previous versions of each secret; never purge one.&lt;br /&gt;
&lt;br /&gt;
=== Azure SQL settings to check once ===&lt;br /&gt;
&lt;br /&gt;
The database was created with &amp;lt;code&amp;gt;--backup-storage-redundancy Local&amp;lt;/code&amp;gt;: backups stay in one datacenter, so &amp;lt;strong&amp;gt;geo-restore is not available&amp;lt;/strong&amp;gt;. Point-in-time restore keeps 7 days by default; long-term retention is not set up by the provisioning script. To lengthen both (this has a storage cost; get the owner&amp;#039;s approval first):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-powershell&amp;quot;&amp;gt;$rg = &amp;amp;#39;rg-mindattic-data&amp;amp;#39;; $server = &amp;amp;#39;sql-mindattic-f65744&amp;amp;#39;; $db = &amp;amp;#39;Gadfly&amp;amp;#39;&lt;br /&gt;
# Point-in-time restore window: up to 35 days.&lt;br /&gt;
az sql db str-policy set -g $rg -s $server -n $db --retention-days 35 --diffbackup-hours 12&lt;br /&gt;
# Long-term retention: weekly for 8 weeks, monthly for 12 months, the first weekly of each year for 5 years.&lt;br /&gt;
az sql db ltr-policy set -g $rg -s $server -n $db --weekly-retention P8W --monthly-retention P12M --yearly-retention P5Y --week-of-year 1&lt;br /&gt;
# What is configured now&lt;br /&gt;
az sql db str-policy show -g $rg -s $server -n $db&lt;br /&gt;
az sql db ltr-policy show -g $rg -s $server -n $db&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Geo-redundant backups need the redundancy changed to &amp;lt;code&amp;gt;Geo&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;az sql db update ... --backup-storage-redundancy Geo&amp;lt;/code&amp;gt;), which applies to backups taken from then on.&lt;br /&gt;
&lt;br /&gt;
=== Restoring ===&lt;br /&gt;
&lt;br /&gt;
A restore always creates a &amp;lt;strong&amp;gt;new&amp;lt;/strong&amp;gt; database; it never overwrites &amp;lt;code&amp;gt;Gadfly&amp;lt;/code&amp;gt;. Restore beside it, check it, then swap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-powershell&amp;quot;&amp;gt;$rg = &amp;amp;#39;rg-mindattic-data&amp;amp;#39;; $server = &amp;amp;#39;sql-mindattic-f65744&amp;amp;#39;&lt;br /&gt;
# 1. Point in time (UTC), into a new database&lt;br /&gt;
az sql db restore -g $rg -s $server -n Gadfly --dest-name Gadfly-restore --time &amp;quot;2026-11-22T09:30:00Z&amp;quot;&lt;br /&gt;
#    or from a long-term backup&lt;br /&gt;
az sql db ltr-backup list -l &amp;amp;lt;region&amp;amp;gt; -s $server -d Gadfly -o table&lt;br /&gt;
az sql db ltr-backup restore --backup-id &amp;quot;&amp;amp;lt;id from the list&amp;amp;gt;&amp;quot; --dest-database Gadfly-restore --dest-server $server --dest-resource-group $rg&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# In the restored database (portal Query editor, as the server&amp;#039;s Entra admin), run the same &amp;lt;code&amp;gt;CREATE USER ... FROM EXTERNAL PROVIDER&amp;lt;/code&amp;gt; lines for &amp;lt;code&amp;gt;mindattic-gadfly&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gh-mindattic-webapps-deploy&amp;lt;/code&amp;gt; that DEPLOY.md lists: a restored database keeps its users, but check they are there.&lt;br /&gt;
# Swap it in. Either rename (&amp;lt;code&amp;gt;Gadfly&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Gadfly-old&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;Gadfly-restore&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Gadfly&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;ALTER DATABASE ... MODIFY NAME&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;master&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;az sql db rename&amp;lt;/code&amp;gt;), or point the app at the new name by changing the &amp;lt;code&amp;gt;ConnectionStrings&amp;amp;#95;_Gadfly&amp;lt;/code&amp;gt; app setting. Stop the app first (&amp;lt;code&amp;gt;az webapp stop -g MyApps -n mindattic-gadfly&amp;lt;/code&amp;gt;) so no exam writes to the old one meanwhile.&lt;br /&gt;
# Bring the schema up to the deployed code. The restored database may be older than the app. Run the deploy script&amp;#039;s migration step against it, from a checkout of the commit that is deployed (its &amp;lt;code&amp;gt;vN&amp;lt;/code&amp;gt; tag): &amp;lt;code&amp;gt;dotnet ef database update --project Gadfly.Server/Gadfly.Server.csproj --connection &amp;quot;Server=tcp:sql-mindattic-f65744.database.windows.net,1433;Database=Gadfly;Authentication=Active Directory Default;Encrypt=True;&amp;quot;&amp;lt;/code&amp;gt;. The production app never migrates itself at startup.&lt;br /&gt;
# Start the app and check &amp;lt;code&amp;gt;GET /healthz/ready&amp;lt;/code&amp;gt; answers 200 with &amp;lt;code&amp;gt;Database&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Database migrations&amp;lt;/code&amp;gt; both &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;, then sign in and open &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Tell the affected organizations what was lost: everything written after the restore point (attempts, grades, audit events). Exams that were in progress at that moment are gone from the restored copy.&lt;br /&gt;
&lt;br /&gt;
Erasures carried out after the restore point are undone by a restore. Re-run them (the audit log of the old database shows each &amp;lt;code&amp;gt;privacy.erased&amp;lt;/code&amp;gt; event) before the restored copy is used.&lt;br /&gt;
&lt;br /&gt;
== 3. Rotating keys and secrets ==&lt;br /&gt;
&lt;br /&gt;
Secrets reach the app as App Service settings that are Key Vault references (&amp;lt;code&amp;gt;@Microsoft.KeyVault(VaultName=kv-tutor-f65744;SecretName=...)&amp;lt;/code&amp;gt;), read through MindAttic.Vault&amp;#039;s configuration buckets (&amp;lt;code&amp;gt;LLM&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Security&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Notifications&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Payments&amp;lt;/code&amp;gt; for card checkout). On a developer machine the same names come from the local MindAttic Vault files instead. After changing a secret&amp;#039;s value in Key Vault, restart the app (&amp;lt;code&amp;gt;az webapp restart -g MyApps -n mindattic-gadfly&amp;lt;/code&amp;gt;) so the reference is read again.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Secret&lt;br /&gt;
! Key Vault name&lt;br /&gt;
! App setting&lt;br /&gt;
! Rotating it&lt;br /&gt;
|-&lt;br /&gt;
| Password pepper&lt;br /&gt;
| &amp;lt;code&amp;gt;gadfly-pepper-v1&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_Security&amp;amp;#95;_pepper_v1&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;strong&amp;gt;Never replace v1 in place&amp;lt;/strong&amp;gt;: every password would stop verifying. Add a &amp;lt;code&amp;gt;gadfly-pepper-v2&amp;lt;/code&amp;gt; secret and a &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_Security&amp;amp;#95;_pepper_v2&amp;lt;/code&amp;gt; setting, set &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Auth&amp;amp;#95;_Crypto&amp;amp;#95;_CurrentPepperKeyId=v2&amp;lt;/code&amp;gt;, keep v1. Passwords move to v2 as people sign in. See MindAttic.Authentication&amp;#039;s OPERATIONS.md.&lt;br /&gt;
|-&lt;br /&gt;
| Password-reset token key&lt;br /&gt;
| &amp;lt;code&amp;gt;gadfly-reset-token-key&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_Security&amp;amp;#95;_reset_token_key&amp;lt;/code&amp;gt;&lt;br /&gt;
| Replace any time. Reset links already sent stop working.&lt;br /&gt;
|-&lt;br /&gt;
| Bootstrap token&lt;br /&gt;
| &amp;lt;code&amp;gt;gadfly-bootstrap-token&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_Security&amp;amp;#95;_bootstrap_token&amp;lt;/code&amp;gt;&lt;br /&gt;
| Used only when the database has no account at all, to create &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; with this as a must-change password. Replace it with a long random value straight after the first sign-in, and again if it ever leaks. Don&amp;#039;t delete it.&lt;br /&gt;
|-&lt;br /&gt;
| Anthropic, OpenAI, Gemini, DeepSeek keys&lt;br /&gt;
| &amp;lt;code&amp;gt;llm-claude-apikey&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;llm-openai-apikey&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;llm-gemini-apikey&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;llm-deepseek-apikey&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_LLM&amp;amp;#95;_&amp;amp;lt;provider&amp;amp;gt;&amp;amp;#95;_apiKey&amp;lt;/code&amp;gt;&lt;br /&gt;
| Create the new key at the provider, set the secret, restart, check &amp;lt;code&amp;gt;/healthz/providers&amp;lt;/code&amp;gt;, then revoke the old key. OpenAI&amp;#039;s key also serves the backup speech recognizer.&lt;br /&gt;
|-&lt;br /&gt;
| ElevenLabs key&lt;br /&gt;
| &amp;lt;code&amp;gt;llm-elevenlabs-apikey&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_LLM&amp;amp;#95;_elevenlabs&amp;amp;#95;_apiKey&amp;lt;/code&amp;gt;&lt;br /&gt;
| As above; check a speech call on &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; afterwards.&lt;br /&gt;
|-&lt;br /&gt;
| Seeded accounts&amp;#039; temporary password&lt;br /&gt;
| &amp;lt;code&amp;gt;gadfly-classroom-password&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;Gadfly&amp;amp;#95;_Demo&amp;amp;#95;_Password&amp;lt;/code&amp;gt;&lt;br /&gt;
| Read only by &amp;lt;code&amp;gt;--seed-classroom&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;--seed-pilot&amp;lt;/code&amp;gt; for accounts they create (pilot accounts must change it; classroom test accounts sign straight in with it). Replace any time; existing accounts keep their own passwords.&lt;br /&gt;
|-&lt;br /&gt;
| Stripe (only if card checkout is on)&lt;br /&gt;
| (your choice)&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_Payments&amp;amp;#95;_stripe&amp;amp;#95;_secretKey&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;#95;_webhookSecret&amp;lt;/code&amp;gt;&lt;br /&gt;
| Roll in the Stripe dashboard, set both, restart. Without &amp;lt;code&amp;gt;secretKey&amp;lt;/code&amp;gt; the plan page shows no checkout.&lt;br /&gt;
|-&lt;br /&gt;
| Outgoing email (SMTP)&lt;br /&gt;
| &amp;lt;code&amp;gt;smtp-password&amp;lt;/code&amp;gt; (shared with mindattic-tutor)&lt;br /&gt;
| &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Vault&amp;amp;#95;_Notifications&amp;amp;#95;_email&amp;amp;#95;_password&amp;lt;/code&amp;gt; (and &amp;lt;code&amp;gt;smtpHost&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;smtpPort&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;from&amp;lt;/code&amp;gt;)&lt;br /&gt;
| Production sends through Gmail SMTP: &amp;lt;code&amp;gt;smtp.gmail.com:587&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;mindatticinteractive@gmail.com&amp;lt;/code&amp;gt;, password a Gmail app password. Create a new app password in that Google account, set the secret, restart both Gadfly and mindattic-tutor, send a test from &amp;lt;strong&amp;gt;Email preview&amp;lt;/strong&amp;gt;, then revoke the old app password. Links in emails join &amp;lt;code&amp;gt;MindAttic&amp;amp;#95;_Auth&amp;amp;#95;_Reset&amp;amp;#95;_PublicBaseUrl&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;https&amp;amp;#58;//mindattic-gadfly.azurewebsites.net&amp;lt;/code&amp;gt;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Data Protection key ring.&amp;lt;/strong&amp;gt; The ring rolls its own keys every 90 days and keeps the old ones to read with; nothing to do. Never delete the blob or the Key Vault key &amp;lt;code&amp;gt;gadfly-dp-protect&amp;lt;/code&amp;gt;: losing them signs everyone out and, worse, makes every stored webhook secret and the LTI private key unreadable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Gadfly&amp;#039;s LTI signing key.&amp;lt;/strong&amp;gt; Generated once, the first time it is needed (2048-bit RSA), stored in &amp;lt;code&amp;gt;gadfly.LtiToolKeys&amp;lt;/code&amp;gt; with the private half encrypted by the Data Protection ring, and published at &amp;lt;code&amp;gt;/lti/jwks.json&amp;lt;/code&amp;gt;. One key serves every organization, and the newest row signs. &amp;lt;strong&amp;gt;To rotate it&amp;lt;/strong&amp;gt; (GAD-T478), a platform admin opens &amp;lt;strong&amp;gt;Organizations → LTI signing key&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;/platform/lti-key&amp;lt;/code&amp;gt;) and presses &amp;lt;strong&amp;gt;Rotate the signing key&amp;lt;/strong&amp;gt;, then confirms:&lt;br /&gt;
&lt;br /&gt;
# A new key is made and signs everything from that moment (deep-linking replies, roster and gradebook token requests).&lt;br /&gt;
# The old key stays in &amp;lt;code&amp;gt;/lti/jwks.json&amp;lt;/code&amp;gt; next to the new one for a grace period, &amp;lt;code&amp;gt;Gadfly:Lti:KeyGraceDays&amp;lt;/code&amp;gt; (default &amp;lt;strong&amp;gt;7&amp;lt;/strong&amp;gt; days, 1 to 90), so an LMS that cached the old key set keeps accepting Gadfly&amp;#039;s signatures.&lt;br /&gt;
# After the grace period the old key is left out of the key set and its row, private key included, is deleted. This happens the next time the key set is fetched or the page is opened.&lt;br /&gt;
&lt;br /&gt;
Both steps are audited: &amp;lt;code&amp;gt;lti.key.rotated&amp;lt;/code&amp;gt; (who, the new and old key ids, when the old one retires) and &amp;lt;code&amp;gt;lti.key.retired&amp;lt;/code&amp;gt; (system). Key material is never written to the log. Connected LMSs fetch keys from the key-set URL, so nothing needs re-registering in any LMS. Rotate on a schedule (yearly is plenty) or at once if the key may have leaked; after a leak, expect the old key to stay valid for the grace period, so lower &amp;lt;code&amp;gt;Gadfly&amp;amp;#95;_Lti&amp;amp;#95;_KeyGraceDays&amp;lt;/code&amp;gt; to 1 first if that matters more than an LMS with a stale cache. If the Data Protection key ring is lost, the stored private key can&amp;#039;t be read: rotate, and the new key is usable at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Organization API keys and webhook secrets.&amp;lt;/strong&amp;gt; Owners and Admins rotate their own on &amp;lt;strong&amp;gt;API keys&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;/org/api-keys&amp;lt;/code&amp;gt;) and &amp;lt;strong&amp;gt;Webhooks&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;/org/webhooks&amp;lt;/code&amp;gt;); platform staff need not be involved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Research pseudonym key.&amp;lt;/strong&amp;gt; Each organization has its own, made when research is first set up and kept in &amp;lt;code&amp;gt;gadfly.ResearchSettings&amp;lt;/code&amp;gt; (never exported or shown). An organization&amp;#039;s Owner or Admin replaces it on &amp;lt;strong&amp;gt;Research&amp;lt;/strong&amp;gt; (&amp;lt;em&amp;gt;Replace the study codes&amp;lt;/em&amp;gt;); it is audited as &amp;lt;code&amp;gt;research.key.replaced&amp;lt;/code&amp;gt;. Replacing it changes every code from then on: later exports cannot be linked to earlier ones, and a student&amp;#039;s own study code changes too. Do it only when starting a new, separate study, never as routine rotation. Platform staff should not change it in the database.&lt;br /&gt;
&lt;br /&gt;
== 4. Incidents ==&lt;br /&gt;
&lt;br /&gt;
=== 4.1 An AI provider is down ===&lt;br /&gt;
&lt;br /&gt;
What the app does: Gadfly&amp;#039;s AI panel is several providers voting. A provider that fails calls in a row is marked failing (logged once as an error) and the panel carries on without it; &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/healthz/ready&amp;lt;/code&amp;gt; show &amp;lt;em&amp;gt;AI panel: warning&amp;lt;/em&amp;gt;. If every provider fails, AI grading and question generation stall or fall back (the check says so). &amp;lt;code&amp;gt;Gadfly:AiMode&amp;lt;/code&amp;gt; sets the mode at startup: with &amp;lt;code&amp;gt;auto&amp;lt;/code&amp;gt; the app probes the providers and uses the labelled mock panel only if none answered; with &amp;lt;code&amp;gt;live&amp;lt;/code&amp;gt; it stays live. The platform admin can then switch it between mock and live on &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; with no restart (GAD-T802, section 4.1a below).&lt;br /&gt;
&lt;br /&gt;
=== 4.1a Switching between mock and live (GAD-T802) ===&lt;br /&gt;
&lt;br /&gt;
The platform admin&amp;#039;s &amp;lt;strong&amp;gt;Switch AI panel to live / mock&amp;lt;/strong&amp;gt; button on &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; (System status, &amp;quot;App, AI and voice&amp;quot;; shown to the platform admin only, after a confirm step) flips the AI panel at runtime, on localhost and Azure alike:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Stored.&amp;lt;/strong&amp;gt; Each flip is an audit event (&amp;lt;code&amp;gt;platform.ai-mode.switched&amp;lt;/code&amp;gt;, entity &amp;lt;code&amp;gt;AiMode&amp;lt;/code&amp;gt;, no organization: who, from, to); the latest is in force and survives restarts and redeploys. &amp;lt;code&amp;gt;Gadfly:AiMode&amp;lt;/code&amp;gt; is only the default until the first flip.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Every process follows.&amp;lt;/strong&amp;gt; The web app and the worker (and any other instance) re-read the stored choice every 15 seconds (&amp;lt;code&amp;gt;AiModeSync&amp;lt;/code&amp;gt;), so email, grading jobs and new exams follow within that.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Sessions keep their mode.&amp;lt;/strong&amp;gt; A session records the mode it started in (&amp;lt;code&amp;gt;ExamSessions.AiMode&amp;lt;/code&amp;gt;) and its questions, judgments and AI grading all run in that mode (&amp;lt;code&amp;gt;PanelPin&amp;lt;/code&amp;gt;), so an exam is never half mock, half live. New sessions use the new mode. Sessions started before the column existed follow the server.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Live needs keys.&amp;lt;/strong&amp;gt; Switching to live is refused, with the reason, when no provider key is found (MindAttic Vault&amp;#039;s LLM providers) or the live-turn model&amp;#039;s provider (&amp;lt;code&amp;gt;Gadfly:LiveTurn:Provider&amp;lt;/code&amp;gt;, Claude by default) has none. A process that cannot see the keys stays mock and logs a warning once.&lt;br /&gt;
* &amp;lt;strong&amp;gt;Email&amp;lt;/strong&amp;gt; follows the same switch: a server switched to mock sends no real email (&amp;lt;code&amp;gt;EmailDeliveryGate&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;/healthz/providers&amp;lt;/code&amp;gt; (or the provider table on &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt;) to see which provider and its last error.&lt;br /&gt;
# A bad or exhausted key: rotate it (section 3) and restart. An outage at the provider: wait; the rest of the panel keeps working.&lt;br /&gt;
# Every provider down during exams: pause or extend running exams from the live monitor (4.3) rather than let students sit through stalled questions. Do &amp;lt;strong&amp;gt;not&amp;lt;/strong&amp;gt; switch a live deployment to mock to get through: mock output is labelled as simulated and is no evaluation at all.&lt;br /&gt;
# AI preliminary grading that failed shows as failed &amp;lt;code&amp;gt;grading.ai&amp;lt;/code&amp;gt; jobs; &amp;lt;strong&amp;gt;Retry&amp;lt;/strong&amp;gt; them on &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; once the provider is back. A person grades every attempt anyway, so no grade is lost.&lt;br /&gt;
&lt;br /&gt;
Speech: in live voice mode the recognizer falls back from ElevenLabs Scribe to OpenAI Whisper on its own, mid-session, unless &amp;lt;code&amp;gt;MindAttic:SpeechRecognition:Provider&amp;lt;/code&amp;gt; pins a single provider. If the examiner&amp;#039;s voice (ElevenLabs) is down, students cannot hear questions: pause running exams and tell them.&lt;br /&gt;
&lt;br /&gt;
=== 4.2 Answers are slow ===&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt;, &amp;lt;em&amp;gt;Time to the next question&amp;lt;/em&amp;gt;: which kind of outside call is slow (a panel step, or the examiner&amp;#039;s voice to first byte / to the end of the audio).&lt;br /&gt;
# &amp;lt;code&amp;gt;/healthz/call-timings?session=&amp;amp;lt;id&amp;amp;gt;&amp;lt;/code&amp;gt; for one student&amp;#039;s session, or without &amp;lt;code&amp;gt;session&amp;lt;/code&amp;gt; across all, slowest first.&lt;br /&gt;
# &amp;lt;code&amp;gt;/healthz/voice-recognition&amp;lt;/code&amp;gt; for the recognizer&amp;#039;s own delay (p95 above a few seconds means students wait after they stop talking).&lt;br /&gt;
# The first request after the serverless database has auto-paused takes about a minute. If the slowness is only at the start of the day, wake the database before an exam window rather than change anything.&lt;br /&gt;
# A slow provider can be left out by removing its key (and restarting); fewer providers is faster but each vote counts more. Discuss with the owner first.&lt;br /&gt;
&lt;br /&gt;
=== 4.3 A session is stuck ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;Live sessions&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;/admin/live&amp;lt;/code&amp;gt;) shows every exam in progress in the organization, with &amp;lt;strong&amp;gt;Add time&amp;lt;/strong&amp;gt;, &amp;lt;strong&amp;gt;Pause&amp;lt;/strong&amp;gt; / &amp;lt;strong&amp;gt;Resume&amp;lt;/strong&amp;gt;, &amp;lt;strong&amp;gt;End exam&amp;lt;/strong&amp;gt; and &amp;lt;strong&amp;gt;Send a notice&amp;lt;/strong&amp;gt;. Each is audited. Pause holds the exam and closes the microphone; ending grades the attempt with the evidence so far, the same way time running out does.&lt;br /&gt;
* A student who closed the tab and never came back is closed automatically: every 15 minutes a sweep ends any running or paused session 30 minutes past its own deadline (extra time and pauses included). A session staff are holding is left alone.&lt;br /&gt;
* A student who can&amp;#039;t get back in: they reload the page; the session resumes where it was. If the attempt is beyond saving, end it, then give the student another attempt from the admin desk or the assignments console.&lt;br /&gt;
* Background work that is stuck (a job waiting more than 15 minutes, or failed): &amp;lt;strong&amp;gt;Retry&amp;lt;/strong&amp;gt; or &amp;lt;strong&amp;gt;Cancel&amp;lt;/strong&amp;gt; it on &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Several sessions stuck at once usually means the database or a provider: check &amp;lt;code&amp;gt;/healthz/ready&amp;lt;/code&amp;gt; and 4.1 first.&lt;br /&gt;
&lt;br /&gt;
=== 4.4 Nobody can get into the admin desk ===&lt;br /&gt;
&lt;br /&gt;
The admin desk (&amp;lt;code&amp;gt;/admin/desk&amp;lt;/code&amp;gt;) opens only when all of these hold:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;Gadfly:AdminDesk:Enabled&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. &amp;lt;strong&amp;gt;Production turns it off by default&amp;lt;/strong&amp;gt; (&amp;lt;code&amp;gt;appsettings.Production.json&amp;lt;/code&amp;gt;), so the live app needs the App Service setting &amp;lt;code&amp;gt;Gadfly&amp;amp;#95;_AdminDesk&amp;amp;#95;_Enabled=true&amp;lt;/code&amp;gt;.&lt;br /&gt;
# The person is an &amp;lt;strong&amp;gt;Owner or Admin&amp;lt;/strong&amp;gt; of the organization they have open. (The old &amp;lt;code&amp;gt;Gadfly:AdminDesk:Admins&amp;lt;/code&amp;gt; list of user names is deprecated: it is honoured only up to release V2, in the organization named by &amp;lt;code&amp;gt;Gadfly:AdminDesk:Organization&amp;lt;/code&amp;gt;, with a warning in the log, and ignored after that.)&lt;br /&gt;
# They signed in with two-step verification (MFA). Without it the home page says the desk needs MFA and links to &amp;lt;code&amp;gt;/account/mfa/setup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The rest of the admin area (&amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/admin/live&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; and so on) needs only Owner or Admin with MFA, not the desk setting.&lt;br /&gt;
&lt;br /&gt;
If an Owner has lost their authenticator, they sign in with one of their recovery codes. If no Owner or Admin of an organization can sign in, another Owner gives someone the role on &amp;lt;strong&amp;gt;Members&amp;lt;/strong&amp;gt;; failing that, it is a MindAttic.Authentication operator reset of that account&amp;#039;s MFA (dual control for admin accounts, and tell the organization&amp;#039;s owner out of band), done by platform staff, then the role restored. Record what was done.&lt;br /&gt;
&lt;br /&gt;
== 5. Release checklist ==&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; Everything to ship is merged to &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; and pushed; the deploy script refuses a commit that is not on &amp;lt;code&amp;gt;origin/main&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; &amp;lt;code&amp;gt;dotnet build Gadfly.slnx&amp;lt;/code&amp;gt; is clean.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; The owner has run the full test suite (&amp;lt;code&amp;gt;/test&amp;lt;/code&amp;gt;) on that commit and it is green. Agents never run the tests; failures become tickets before the release goes out.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; Migrations: list the new ones since the last tag (&amp;lt;code&amp;gt;git diff --stat v&amp;amp;lt;N&amp;amp;gt;..HEAD -- Gadfly.Server/Data/Migrations&amp;lt;/code&amp;gt;). Read each one: anything that drops or rewrites data needs a fresh backup point noted (section 2) and the owner&amp;#039;s OK. A dry run lists them against the live database: &amp;lt;code&amp;gt;npm run deploy -- --app gadfly --dry-run&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;MindAttic.Deploy&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; App settings the release needs are set in the App Service &amp;lt;em&amp;gt;before&amp;lt;/em&amp;gt; it goes out. Currently (GAD-T289): &amp;lt;code&amp;gt;Gadfly&amp;amp;#95;_AdminDesk&amp;amp;#95;_Enabled=true&amp;lt;/code&amp;gt; to keep the owner&amp;#039;s desk, and the owner&amp;#039;s account is an Owner or Admin of its organization with MFA set up (the &amp;lt;code&amp;gt;Gadfly:AdminDesk:Admins&amp;lt;/code&amp;gt; list no longer grants the desk after V2).&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; &amp;lt;code&amp;gt;Gadfly&amp;amp;#95;_AiMode&amp;lt;/code&amp;gt; is still &amp;lt;code&amp;gt;mock&amp;lt;/code&amp;gt; unless the owner has said to go live (the script refuses otherwise; &amp;lt;code&amp;gt;-AllowLive&amp;lt;/code&amp;gt; only on the owner&amp;#039;s word).&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; The databases are awake (&amp;lt;code&amp;gt;/kickstart gadfly&amp;lt;/code&amp;gt;) so the migration step doesn&amp;#039;t time out on a paused database.&lt;br /&gt;
&lt;br /&gt;
Deploy: the Azure deploy scripts (&amp;lt;code&amp;gt;tools/deploy-azure.ps1&amp;lt;/code&amp;gt;, staging slot and promote) were removed with the Azure decommission on 2026-11-26 (GAD-T804). Until Gadfly is hosted again (GAD-T784, GAD-T786), there is no production deploy; the steps for the new host belong here once it exists. Whatever deploys it must keep these rules:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; Migrations run first, and a failure stops the deploy before any code goes out.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; The version is the next whole number after the highest &amp;lt;code&amp;gt;vN&amp;lt;/code&amp;gt; tag (GAD-T291), and only a successful deploy tags its commit &amp;lt;code&amp;gt;vN&amp;lt;/code&amp;gt;; never otherwise create or move a &amp;lt;code&amp;gt;vN&amp;lt;/code&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
After (smoke checks, all without spending provider credit):&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; &amp;lt;code&amp;gt;GET /healthz&amp;lt;/code&amp;gt; is 200 and &amp;lt;code&amp;gt;GET /healthz/ready&amp;lt;/code&amp;gt; is 200 with &amp;lt;code&amp;gt;Database&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Database migrations&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;ok&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; The browser tab title and header show the new &amp;lt;strong&amp;gt;V&amp;amp;lt;N&amp;amp;gt;&amp;lt;/strong&amp;gt;, and &amp;lt;code&amp;gt;GET /healthz/version&amp;lt;/code&amp;gt; answers &amp;lt;code&amp;gt;V&amp;amp;lt;N&amp;amp;gt; &amp;amp;lt;sha&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; Sign in as the owner: the admin desk opens; &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/admin/status&amp;lt;/code&amp;gt; load, with no new &amp;lt;em&amp;gt;Errors in the log&amp;lt;/em&amp;gt;.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; &amp;lt;code&amp;gt;/help&amp;lt;/code&amp;gt; opens and a guide renders; the public site&amp;#039;s home page loads signed out.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; If any organization uses LTI, &amp;lt;code&amp;gt;/lti/jwks.json&amp;lt;/code&amp;gt; answers with a key.&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; The log stream shows the expected startup lines (AI panel mode; no missing-secret or voice-off surprises).&lt;br /&gt;
* &amp;amp;#91; &amp;amp;#93; Note the release (version, commit, migrations applied) where the team tracks deploys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Gadfly]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Gadfly/blob/main/docs/OPERATIONS.md Gadfly/docs/OPERATIONS.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Gadfly]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>