diff --git a/app/views/admin/settings/edit.html.erb b/app/views/admin/settings/edit.html.erb
index 2c5a554..bd94f6f 100644
--- a/app/views/admin/settings/edit.html.erb
+++ b/app/views/admin/settings/edit.html.erb
@@ -22,5 +22,14 @@
+ Backups
+ <% kept = Setting::INTEGERS["backups_kept"] %>
+
+ <%= label_tag "settings[backups_kept]", kept[:label], class: "label" %>
+ <%= number_field_tag "settings[backups_kept]", @values["backups_kept"], id: "settings_backups_kept", min: kept[:in].min, max: kept[:in].max,
+ step: 1, required: true, class: "input w-32" %>
+
A verified copy of the database is made nightly in storage/backups; this many of the newest are kept. Back up the whole storage volume off the server too.
+
+
<%= f.submit "Save Settings", class: "btn-primary" %><%= link_to "Cancel", admin_about_path, class: "btn-secondary" %>
<% end %>
diff --git a/app/views/admin_mailer/records_alert.html.erb b/app/views/admin_mailer/records_alert.html.erb
new file mode 100644
index 0000000..6d0fec5
--- /dev/null
+++ b/app/views/admin_mailer/records_alert.html.erb
@@ -0,0 +1,5 @@
+Last night's records check found a problem.
+Backup: <%= @backup.ok ? "OK" : "FAILED: #{@backup.message}" %>
+Integrity check: <%= @check.ok ? "OK" : "#{@check.problems.size} problem(s)" %>
+<% Array(@check.problems).first(20).each do |p| %>- <%= p %>
<% end %>
+See Admin → About for details.
diff --git a/app/views/admin_mailer/records_alert.text.erb b/app/views/admin_mailer/records_alert.text.erb
new file mode 100644
index 0000000..1ab6d1e
--- /dev/null
+++ b/app/views/admin_mailer/records_alert.text.erb
@@ -0,0 +1,9 @@
+Last night's records check found a problem.
+
+Backup: <%= @backup.ok ? "OK" : "FAILED: #{@backup.message}" %>
+Integrity check: <%= @check.ok ? "OK" : "#{@check.problems.size} problem(s)" %>
+<% Array(@check.problems).first(20).each do |p| %>
+- <%= p %>
+<% end %>
+
+See Admin → About for details.
diff --git a/app/views/aircraft/_form.html.erb b/app/views/aircraft/_form.html.erb
index 11b4f3e..7c39ce3 100644
--- a/app/views/aircraft/_form.html.erb
+++ b/app/views/aircraft/_form.html.erb
@@ -25,6 +25,8 @@
To change hours use “Update Hours” on the overview, so component times stay in sync.
<% end %>
<%= f.field :picture, as: :file, accept: "image/*" %>
+ <%= f.field :electronic_records_since, as: :date, label: "Electronic records since", wrapper: { class: "max-w-xs" },
+ hint: "The date this app became the maintenance record. Earlier records stay in the paper logbooks (mark their scans as legacy records)." %>
<%= f.field :airworthiness_enforcement, as: :checkbox, label: "Enforce airworthiness",
hint: "Block flight logs and hours updates while the aircraft shows Grounded." %>
diff --git a/app/views/aircraft_roles/index.html.erb b/app/views/aircraft_roles/index.html.erb
index 2d40b38..731faa0 100644
--- a/app/views/aircraft_roles/index.html.erb
+++ b/app/views/aircraft_roles/index.html.erb
@@ -67,5 +67,12 @@
<%= link_to "Download .sam.zip", aircraft_export_path(@aircraft), class: "btn-secondary", data: { turbo: false } %>
+
diff --git a/app/views/documents/_doc_row.html.erb b/app/views/documents/_doc_row.html.erb
index 9616d3e..8a4e616 100644
--- a/app/views/documents/_doc_row.html.erb
+++ b/app/views/documents/_doc_row.html.erb
@@ -2,6 +2,7 @@
<%= link_to doc.name, aircraft_document_path(aircraft, doc), class: "link font-medium" %>
<%= doc.type_label %> · <%= pluralize(doc.pages.size, "file") %>
+ <% if doc.legacy_record? %>
Legacy record<% end %>
<% if doc.expires_on %>
<%= doc.expired? ? "Expired" : "Expires" %> <%= doc.expires_on %><% end %>
<% if doc.description.present? %>
<%= doc.description.truncate(120) %>
<% end %>
diff --git a/app/views/documents/_form.html.erb b/app/views/documents/_form.html.erb
index e3a8000..50e6839 100644
--- a/app/views/documents/_form.html.erb
+++ b/app/views/documents/_form.html.erb
@@ -8,6 +8,8 @@
<%= f.field :visibility, as: :select, label: "Share-link visibility",
collection: [["Inherit from collection", nil]] + DocumentCollection::VISIBILITIES.invert.to_a %>
+ <%= f.field :legacy_record, as: :checkbox, label: "Legacy record (a scan of the paper logbooks or records)",
+ hint: "Records from before the electronic records began. Keep the paper originals." %>
<%= f.field :expires_on, as: :date, label: "Expires on", wrapper: { class: "max-w-xs" },
hint: "Optional. Registration (good for 7 years, 14 CFR 47.40), insurance, radio license… You'll be reminded before it expires; an expired registration shows the aircraft grounded." %>
<%= f.field :description, as: :textarea, rows: 2 %>
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb
index 6d01254..bbc5d9f 100644
--- a/app/views/events/index.html.erb
+++ b/app/views/events/index.html.erb
@@ -3,9 +3,12 @@
<%= render "events/list", events: @events, full: true %>
diff --git a/app/views/logbook_entries/show.html.erb b/app/views/logbook_entries/show.html.erb
index f332064..2194886 100644
--- a/app/views/logbook_entries/show.html.erb
+++ b/app/views/logbook_entries/show.html.erb
@@ -58,3 +58,11 @@
<% end %>
+
+<% history = (@entry.versions.to_a + @entry.parts.flat_map { _1.versions.to_a } + (@entry.signature ? @entry.signature.versions.to_a : [])).sort_by(&:id).reverse %>
+<% if history.any? %>
+
+
+ <%= render "record_versions/list", versions: history %>
+
+<% end %>
diff --git a/app/views/maintenance_reports/show.html.erb b/app/views/maintenance_reports/show.html.erb
index 2652dcd..9ca869f 100644
--- a/app/views/maintenance_reports/show.html.erb
+++ b/app/views/maintenance_reports/show.html.erb
@@ -22,6 +22,7 @@
Airframe time in service<%= hours(@report.time_in_service) %> hrs (<%= clock %>)
Tach / Hobbs<%= hours(a.tach_time) %> / <%= hours(a.hobbs_time) %>
Status<%= airworthiness_badge(@report.airworthiness) %>
+ Electronic records since<%= a.electronic_records_since || "—" %>
diff --git a/app/views/record_versions/_list.html.erb b/app/views/record_versions/_list.html.erb
new file mode 100644
index 0000000..2d6882c
--- /dev/null
+++ b/app/views/record_versions/_list.html.erb
@@ -0,0 +1,19 @@
+<%# Locals: versions. %>
+
+ <% versions.each do |v| %>
+ -
+
+ <%= v.item_type.underscore.humanize %> #<%= v.item_id %>
+ <%= { "create" => "created", "update" => "changed", "destroy" => "deleted" }[v.event] %>
+ <%= v.created_at.utc.strftime("%Y-%m-%d %H:%M:%S UTC") %> · <%= v.user&.display_name || "system" %><%= " · #{v.ip_address}" if v.ip_address %>
+
+ <% if v.event == "update" %>
+
+ <% v.changes_hash.each do |field, (before, after)| %>
+ - <%= field.humanize %>
- <%= before.to_s.truncate(120).presence || "—" %> → <%= after.to_s.truncate(120).presence || "—" %>
+ <% end %>
+
+ <% end %>
+
+ <% end %>
+
diff --git a/app/views/record_versions/index.html.erb b/app/views/record_versions/index.html.erb
new file mode 100644
index 0000000..4541cf0
--- /dev/null
+++ b/app/views/record_versions/index.html.erb
@@ -0,0 +1,14 @@
+<% content_for :title, "#{@aircraft.tail_number} Record history" %>
+<%= render "shared/aircraft_header", aircraft: @aircraft %>
+
+
+ <% if @versions.any? %><%= render "record_versions/list", versions: @versions %><% else %><%= empty_state "No changes recorded yet." %><% end %>
+
diff --git a/config/initializers/app_revision.rb b/config/initializers/app_revision.rb
new file mode 100644
index 0000000..fa68977
--- /dev/null
+++ b/config/initializers/app_revision.rb
@@ -0,0 +1,7 @@
+# Record the running software version (Admin → About) once the app is up.
+Rails.application.config.after_initialize do
+ next unless defined?(Rails::Server) || ENV["SOLID_QUEUE_IN_PUMA"]
+ AppRevision.touch_current! if ActiveRecord::Base.connection.data_source_exists?("app_revisions")
+rescue StandardError => e
+ Rails.logger.warn("[app revisions] #{e.class}: #{e.message}")
+end
diff --git a/config/recurring.yml b/config/recurring.yml
index 5ef54b9..30fc1d3 100644
--- a/config/recurring.yml
+++ b/config/recurring.yml
@@ -25,3 +25,6 @@ production:
ad_watch:
class: AdWatchJob
schedule: every sunday at 10am
+ records_integrity:
+ class: RecordsIntegrityJob
+ schedule: every day at 3:30am
diff --git a/config/routes.rb b/config/routes.rb
index 6d1440d..fc03655 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -102,6 +102,8 @@ Rails.application.routes.draw do
resources :share_tokens, only: %i[create destroy]
resource :export, controller: "aircraft_exports", only: :show
resource :report, controller: "maintenance_reports", only: :show
+ resource :records_package, path: "records", only: :show
+ resources :record_versions, path: "history", only: :index
resources :events, only: :index
end
@@ -130,6 +132,7 @@ Rails.application.routes.draw do
end
post "about/test_email", to: "about#test_email", as: :test_email
post "about/test_reminder", to: "about#test_reminder", as: :test_reminder
+ post "about/check_records", to: "about#check_records", as: :check_records
resources :users, except: :show
resources :component_types, except: :show
resources :airports, except: :show do
diff --git a/db/migrate/20261108020000_add_records_integrity.rb b/db/migrate/20261108020000_add_records_integrity.rb
new file mode 100644
index 0000000..fe53007
--- /dev/null
+++ b/db/migrate/20261108020000_add_records_integrity.rb
@@ -0,0 +1,52 @@
+# Electronic recordkeeping (AC 120-78B chapter 3):
+# - record_versions: every change to a maintenance record, chained by hash per
+# aircraft so removing or altering history shows (3.2.2, 3.2.4)
+# - integrity_checks: results of verifying those chains and the signatures
+# - backup_runs: the built-in database backups and their verification (3.2.7)
+# - app_revisions: which software versions ran when (3.2.6)
+# - legacy (paper) records: documents marked as such and the date the
+# electronic records start (3.2.8.10)
+class AddRecordsIntegrity < ActiveRecord::Migration[8.1]
+ def change
+ create_table :record_versions do |t|
+ t.integer :aircraft_id, index: true
+ t.string :item_type, null: false
+ t.integer :item_id, null: false
+ t.string :event, null: false
+ t.integer :user_id
+ t.string :ip_address
+ t.text :payload, null: false
+ t.string :prev_hash
+ t.string :chain_hash, null: false
+ t.datetime :created_at, null: false
+ end
+ add_index :record_versions, %i[item_type item_id]
+
+ create_table :integrity_checks do |t|
+ t.boolean :ok, null: false
+ t.integer :versions_checked, null: false, default: 0
+ t.integer :signatures_checked, null: false, default: 0
+ t.json :problems
+ t.timestamps
+ end
+
+ create_table :backup_runs do |t|
+ t.boolean :ok, null: false
+ t.string :path
+ t.bigint :bytes
+ t.text :message
+ t.timestamps
+ end
+
+ create_table :app_revisions do |t|
+ t.string :revision, null: false
+ t.datetime :built_at
+ t.datetime :first_seen_at, null: false
+ t.datetime :last_seen_at, null: false
+ end
+ add_index :app_revisions, :revision, unique: true
+
+ add_column :documents, :legacy_record, :boolean, null: false, default: false
+ add_column :aircraft, :electronic_records_since, :date
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 16af44e..724bc0b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[8.1].define(version: 2026_11_08_010000) do
+ActiveRecord::Schema[8.1].define(version: 2026_11_08_020000) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@@ -147,6 +147,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_08_010000) do
t.json "cg_envelope"
t.string "ad_watch_terms"
t.datetime "ad_watch_checked_at"
+ t.date "electronic_records_since"
end
create_table "aircraft_airworthiness_directives", id: false, force: :cascade do |t|
@@ -285,6 +286,23 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_08_010000) do
t.index ["component_id", "airworthiness_directive_id"], name: "idx_component_ads", unique: true
end
+ create_table "app_revisions", force: :cascade do |t|
+ t.string "revision", null: false
+ t.datetime "built_at"
+ t.datetime "first_seen_at", null: false
+ t.datetime "last_seen_at", null: false
+ t.index ["revision"], name: "index_app_revisions_on_revision", unique: true
+ end
+
+ create_table "backup_runs", force: :cascade do |t|
+ t.boolean "ok", null: false
+ t.string "path"
+ t.bigint "bytes"
+ t.text "message"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
create_table "component_types", force: :cascade do |t|
t.string "name", null: false
t.boolean "consumable", default: false, null: false
@@ -371,6 +389,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_08_010000) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.date "expires_on"
+ t.boolean "legacy_record", default: false, null: false
t.index ["aircraft_id"], name: "index_documents_on_aircraft_id"
t.index ["document_collection_id"], name: "index_documents_on_document_collection_id"
end
@@ -455,6 +474,15 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_08_010000) do
t.index ["satisfies_id"], name: "index_inspection_types_on_satisfies_id"
end
+ create_table "integrity_checks", force: :cascade do |t|
+ t.boolean "ok", null: false
+ t.integer "versions_checked", default: 0, null: false
+ t.integer "signatures_checked", default: 0, null: false
+ t.json "problems"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
create_table "logbook_entries", force: :cascade do |t|
t.integer "aircraft_id", null: false
t.integer "document_id"
@@ -584,6 +612,21 @@ ActiveRecord::Schema[8.1].define(version: 2026_11_08_010000) do
t.index ["component_id"], name: "index_oil_analyses_on_component_id"
end
+ create_table "record_versions", force: :cascade do |t|
+ t.integer "aircraft_id"
+ t.string "item_type", null: false
+ t.integer "item_id", null: false
+ t.string "event", null: false
+ t.integer "user_id"
+ t.string "ip_address"
+ t.text "payload", null: false
+ t.string "prev_hash"
+ t.string "chain_hash", null: false
+ t.datetime "created_at", null: false
+ t.index ["aircraft_id"], name: "index_record_versions_on_aircraft_id"
+ t.index ["item_type", "item_id"], name: "index_record_versions_on_item_type_and_item_id"
+ end
+
create_table "sessions", force: :cascade do |t|
t.integer "user_id", null: false
t.string "ip_address"
diff --git a/test/integration/database_backup_test.rb b/test/integration/database_backup_test.rb
new file mode 100644
index 0000000..a2d92a2
--- /dev/null
+++ b/test/integration/database_backup_test.rb
@@ -0,0 +1,59 @@
+require "test_helper"
+
+# Backups copy the live database with SQLite's online backup API, which can't
+# run inside the transaction each test normally runs in: these tests commit
+# for real and clean up after themselves.
+class DatabaseBackupTest < ActionDispatch::IntegrationTest
+ include ActionMailer::TestHelper
+ self.use_transactional_tests = false
+
+ setup do
+ @owner = create_user("owner@example.com")
+ @a = create_aircraft(owner: @owner, tail_number: "N12345")
+ @mech = create_user("mech@example.com").tap { _1.update!(name: "Sam Mechanic") }
+ @ap = @mech.certificates.create!(kind: "AP", number: "7654321")
+ end
+
+ teardown do
+ FileUtils.rm_rf(DatabaseBackup::DIR)
+ [ EntrySignature, LogbookEntry ].each { _1.delete_all }
+ [ RecordVersion, IntegrityCheck, BackupRun, AircraftEvent, AircraftRole, UserCertificate, Aircraft, Session, Setting, User ].each(&:delete_all)
+ end
+
+ def entry(**attrs)
+ @a.logbook_entries.create!({ date: Date.new(2026, 10, 1), entry_type: "MAINTENANCE", text: "Changed oil", aircraft_hours_at_entry: 1000 }.merge(attrs))
+ end
+
+ test "the nightly job backs up and verifies the database, prunes old copies, and emails admins on trouble" do
+ admin = create_user("admin@example.com", admin: true)
+ entry
+ Setting.update_integers("backups_kept" => "2")
+ dir = DatabaseBackup::DIR
+ FileUtils.rm_rf(dir)
+ 3.times { |i| travel(i.minutes) { DatabaseBackup.run! } }
+ run = BackupRun.latest
+ assert run.ok, run.message
+ assert_match "Verified: SQLite integrity check ok; 1 logbook entries", run.message
+ assert_equal 2, Dir[dir.join("sam-*.sqlite3")].size
+ db = SQLite3::Database.new(run.path, readonly: true)
+ assert_equal 1, db.get_first_value("SELECT COUNT(*) FROM logbook_entries")
+ db.close
+
+ assert_no_emails { RecordsIntegrityJob.perform_now }
+ assert [ BackupRun.latest.ok, IntegrityCheck.latest.ok ].all?, [ BackupRun.latest.message, IntegrityCheck.latest.problems ].inspect
+ LogbookEntry.update_all(text: "x") # no signatures, so this alone isn't a problem
+ EntrySigner.new(entry(date: Date.new(2026, 10, 2)), user: @mech, certificate: @ap, auth_method: "password").sign!
+ LogbookEntry.where(date: Date.new(2026, 10, 2)).update_all(text: "tampered")
+ assert_emails 1 do
+ RecordsIntegrityJob.perform_now
+ end
+ assert_equal [ admin.email_address ], ActionMailer::Base.deliveries.last.to
+
+ sign_in admin
+ get admin_about_path
+ assert_includes response.body, "Records integrity"
+ assert_includes response.body, "changed after it was signed"
+ post admin_check_records_path
+ assert_redirected_to admin_about_path(anchor: "records")
+ end
+end
diff --git a/test/integration/records_integrity_test.rb b/test/integration/records_integrity_test.rb
new file mode 100644
index 0000000..f309fd8
--- /dev/null
+++ b/test/integration/records_integrity_test.rb
@@ -0,0 +1,114 @@
+require "test_helper"
+
+# Electronic recordkeeping (AC 120-78B chapter 3): history, integrity,
+# backups, software versions, the records package, legacy records.
+class RecordsIntegrityTest < ActionDispatch::IntegrationTest
+ include ActionMailer::TestHelper
+
+ setup do
+ @owner = create_user("owner@example.com")
+ @a = create_aircraft(owner: @owner, tail_number: "N12345")
+ @mech = create_user("mech@example.com").tap { _1.update!(name: "Sam Mechanic") }
+ @ap = @mech.certificates.create!(kind: "AP", number: "7654321")
+ end
+
+ def entry(**attrs)
+ @a.logbook_entries.create!({ date: Date.new(2026, 10, 1), entry_type: "MAINTENANCE", text: "Changed oil", aircraft_hours_at_entry: 1000 }.merge(attrs))
+ end
+
+ test "every change to a record is kept, with who and what changed, and shown" do
+ sign_in @owner
+ post aircraft_logbook_entries_path(@a), params: { logbook_entry: { date: "2026-10-01", log_type: "AC", entry_type: "MAINTENANCE", text: "Changed oil" } }
+ e = @a.logbook_entries.sole
+ patch aircraft_logbook_entry_path(@a, e), params: { logbook_entry: { text: "Changed oil and filter" } }
+ versions = e.versions.to_a
+ assert_equal %w[create update], versions.map(&:event)
+ assert_equal [ "Changed oil", "Changed oil and filter" ], versions.last.changes_hash["text"]
+ assert_equal [ @owner, @owner ], versions.map(&:user)
+ assert versions.all? { _1.ip_address.present? }
+ get aircraft_logbook_entry_path(@a, e)
+ assert_includes response.body, "Change history (2)"
+ delete aircraft_logbook_entry_path(@a, e)
+ assert_equal "destroy", RecordVersion.where(item_type: "LogbookEntry", item_id: e.id).last.event # history outlives the record
+ get aircraft_record_versions_path(@a)
+ assert_select "li", minimum: 3
+ assert_includes response.body, "deleted"
+ assert_raises(ActiveRecord::RecordNotSaved) { RecordVersion.last.update!(event: "x") }
+ end
+
+ test "the integrity check finds broken history chains and altered signed entries" do
+ e = entry
+ EntrySigner.new(e, user: @mech, certificate: @ap, auth_method: "password").sign!
+ other = create_aircraft(owner: @owner)
+ other.squawks.create!(priority: 2, issue_reported: "Chip in paint")
+ check = RecordsIntegrity.check!
+ assert check.ok, check.problems.inspect
+ assert check.versions_checked >= 4
+ assert_equal 1, check.signatures_checked
+
+ LogbookEntry.where(id: e.id).update_all(text: "Changed oil (edited in the database)")
+ victim = RecordVersion.where(aircraft_id: other.id).first
+ RecordVersion.where(id: victim.id).delete_all
+ check = RecordsIntegrity.check!
+ refute check.ok
+ assert(check.problems.any? { _1.include?("the 2026-10-01 logbook entry (signed by Sam Mechanic) changed after it was signed") })
+ assert(check.problems.any? { _1.include?("doesn't follow the one before it") || _1.include?("missing") } || RecordVersion.where(aircraft_id: other.id).count.zero?)
+
+ RecordVersion.where(aircraft_id: @a.id).last.then { RecordVersion.where(id: _1.id).update_all(payload: _1.payload.sub("Changed oil", "Changed gas")) }
+ assert(RecordsIntegrity.check!.problems.any? { _1.include?("was altered") })
+ end
+
+ test "software versions are recorded" do
+ with_revision("abc1234") { AppRevision.touch_current! }
+ with_revision("def5678") { AppRevision.touch_current! }
+ with_revision("def5678") { AppRevision.touch_current! }
+ assert_equal %w[def5678 abc1234], AppRevision.latest_first.pluck(:revision) & %w[def5678 abc1234]
+ assert_equal 1, AppRevision.where(revision: "def5678").count
+ end
+
+ test "the records package has everything for the FAA or a buyer" do
+ @a.update!(electronic_records_since: Date.new(2026, 1, 1))
+ @a.documents.create!(name: "Logbook scans 1975-2025", doc_type: "LOG", legacy_record: true)
+ signed = entry
+ EntrySigner.new(signed, user: @mech, certificate: @ap, auth_method: "password").sign!
+ entry(date: Date.new(2026, 10, 5), text: "Unsigned entry")
+ sign_in @owner
+ get aircraft_records_package_path(@a)
+ assert_response :success
+ assert_match(/filename="n12345-records-\d{4}-\d\d-\d\d\.zip"/, response.headers["Content-Disposition"])
+ path = File.join(Dir.mktmpdir, "pkg.zip")
+ File.binwrite(path, response.body)
+ Zip::File.open(path) do |zip|
+ def zip.text(name) = read(name).force_encoding("UTF-8")
+ assert_equal %w[README.txt logbook-entries.pdf n12345.sam.zip record-history.csv signatures.csv status-report.html], zip.entries.map(&:name).sort
+ readme = zip.text("README.txt")
+ assert_includes readme, "All 2 logbook entries, oldest first. 1 are signed electronically"
+ assert_includes readme, "Electronic records since: 2026-01-01"
+ assert_includes readme, "scans marked \"legacy record\""
+ sigs = CSV.parse(zip.text("signatures.csv"), headers: true)
+ assert_equal [ "Sam Mechanic", "7654321", "Valid", signed.reload.signature.content_digest ], sigs.first.fields.values_at(3, 5, 7, 8)
+ assert_operator CSV.parse(zip.text("record-history.csv"), headers: true).size, :>=, 3
+ html = zip.text("status-report.html")
+ assert_includes html, "Maintenance status · 14 CFR 91.417(a)(2)"
+ refute_includes html, "