Vanity does use the experiment files as the source of truth for things like alternative values, so copying those files would be the most straightforward approach. (Maybe a git submodule could help to keep them in one spot?)
If something a bit hacky is okay, this might work in the read-only app:
# config/initializers/vanity.rb
::Rails.configuration.after_initialize do
Vanity::Adapters::ActiveRecordAdapter::VanityExperiment.all.each do |experiment|
id = experiment.experiment_id
experiment = Vanity::Experiment::AbTest.new(Vanity.playground, id, id.humanize)
experiment.default(Vanity::Adapters::ActiveRecordAdapter::VanityParticipant.where(experiment_id: id).first.seen)
used_alternatives = Vanity::Adapters::ActiveRecordAdapter::VanityParticipant.where(experiment_id: id).pluck(:seen).uniq
if used_alternatives.size >= 2
# If we have at least 2 alternatives, set them, otherwise use the default true/false
experiment.alternatives(*used_alternatives)
end
Vanity.playground.experiments[id] = experiment
end
end
This pulls the available info from the database (so doesn't have the alternatives names, it just has the index numbers of the alternatives in the experiment file), and makes some assumptions, but seems to load the data.