rake dev: serve the fixture book, not data/
The dev server was serving data/, whose book was empty, so a client
syncing against it saw nothing and there was no way to see fixture
cards rendered. tmp/dev-data is rebuilt from test/fixtures/cards on
every start; only rackup reloads under entr, so a client edits survive
a restart and a fresh rake dev resets to the fixtures.
Assisted-by: GLM-5.3 via pi
diff --git a/AGENTS.md b/AGENTS.md
index a95c125..926140d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -15,7 +15,9 @@ rake # Tests (the default task)
rake steep # Type check lib against the RBS comments in it
rake fixtures # Re-record response fixtures from current behavior
rake index:rebuild # Derive the parsed index again from the stored cards
-rake dev # Dev server, reloading on change (needs fd and entr)
+rake dev # Dev server, seeded from test/fixtures/cards into
+ # tmp/dev-data on every start, reloading on change
+ # (needs fd and entr)
rake profile:install # Render and stage carddav.mobileconfig for approval
```
diff --git a/Rakefile b/Rakefile
index 71ce95d..77c3cf7 100644
--- a/Rakefile
+++ b/Rakefile
@@ -12,6 +12,15 @@ end
desc "Start development server, reloading on changes"
task :dev do
+ # The dev server serves the fixture book, rebuilt from
+ # test/fixtures/cards on every start, so a client always sees known
+ # state and the real data/ directory stays out of the dev loop. Only
+ # rackup reloads under entr, so a client's edits survive a restart and
+ # a fresh `rake dev` is what resets to the fixtures.
+ data_dir = Pathname.new(__dir__) / "tmp" / "dev-data"
+ ENV["PRO_TACTS_DATA_DIR"] = data_dir.to_s
+ require_relative "test/fixture_data"
+ FixtureData.install(data_dir).close
sh "fd -e rb . lib | entr -r rackup -o localhost"
end