.offrails/CHANGELOG.md
Changelog
Each entry lists convention changes and what an existing app must do about them. /offrails:upgrade reads this file, so write the App migration notes as instructions for an agent.
Every release section has the same shape, in this order, because tools/release/release.sh copies it verbatim into the GitHub Release: What's new (4–6 plain bullets: what you can do now and why it matters), Breaking changes (what an existing app must act on, or "None."), Upgrading (a pointer to the ordered steps and upgrade), then Full list of changes (the detailed entries with their App migration notes). Subsections are ###, so the release script's ## <version> ( heading match still finds the section's end.
0.7.3 (2026-10-19)
What's new
- Snippets beside generators.
cargo offrails snippetslists small, tested recipes (an Atom feed, slugs, Markdown, pagination, a theme toggle, backdated seeds, a public page by slug, a CRUD resource);snippet showprints one to read or copy,snippet addcopies and wires it,snippet removetakes it back. Both snippets and generators are optional starting points. - Generated code is small files with clear insert and remove points. A resource is a folder per layer (controllers per action pair, the model's entity, params and queries, a routes file, tests by concern), and every line it adds to a shared file is marked with the feature's name, so
destroyor a person can find and remove it. Path parameters work ing controllerandg page. - Polish from one file and a component kit.
brand.tomlwithcargo offrails brandsets the colors (contrast-checked), fonts, radius, logo, favicon set and social card; five layouts (top nav, sidebar, marketing, auth, docs); a kit of Askama components (forms with errors, tables, pagination, cards, modals, a confirm dialog, toasts) shown in every state at/dev/components. Generated and snippet pages are built from the kit, in a layout you pick with--layout. cargo offrails prove. With the app running, it screenshots every page at desktop and phone width in light and dark, checks console errors, CSP, accessibility (axe), links and sideways scrolling, and writesdocs/proof/PROOF.md, which ties each acceptance criterion to its passing tests and the pages they touch.- Invite-only sign-up is a setting.
DEFAULT_SIGNUPinsrc/config.rs(orAPP_AUTH_SIGNUP=open|invite) closes sign-up for every sign-in method, andapp task auth_invite <email>lets people in;cargo offrails new … --invitestarts an app that way. - Security review fixes (template, tooling and guides): an unset
APP_ENVnow refuses to boot instead of defaulting to development;APP_TRUSTED_PROXY_HOPSpicks whichX-Forwarded-Forhop is the client behind several proxies;/staticmarks a URL immutable only when its?v=is the file's current digest;Cache::delete_prefixis one escapedLIKEdelete;cargo offrails verifynames every skipped step in its verdict and never probes a local Postgres;--pitchis validated like the title; the Claude Code hook guards canonicalize paths and matchpkillbehind paths, quotes and subshells, and fail closed without jq. Guides corrected: sea-orm-migration takes no lock, so exactly one process migrates per deploy; every proxy needsAPP_TRUSTED_PROXY=true; blob downloads areno-store; API tokens die with a password reset and expire by default; webhook routes verify signatures; search escapesLIKEwildcards; the realtime guide says plainly that its signals/streams design is a spec the parts do not implement yet. - Fixes from real builds and upgrades: a huge
?page=no longer crashes generated lists, an upgraded app no longer runs the previous release'scargo offrails,verify --fullaccepts a separate coverage toolchain, the browser smokes find any password sign-in form, the Dockerfile stops compiling dependencies twice, andoffrails-checkwarns abouthx-triggerfilters that the CSP setup silently disables.
Breaking changes
- Generators and
snippet addneed two 0.7.3 template changes first, and refuse (naming what's missing) without them: the feature routes anchors insrc/routes.rs(ROUTESbecomesAPP_ROUTES+TABLES; steps 3–4 below), and the component kit (templates/components/ui.htmland its helpers; step 6). - The generated file layout changed. New generations write small files per feature;
destroyof aresource,model,controller,pageorapigenerated before 0.7.3 refuses and lists its files (delete them by hand, thendestroy … --forget). - The
ACCOUNTSheader has new words: sign-in methods joined by+, theninvite(signup→password,invite→password invite,magic-link-invite→magic-link invite).add-partreads the old ones; rewrite the line (step 8). - Build the new release's offrails-gen in its own target directory (
target/offrails-gen-<version>) when upgrading, nottarget/offrails-gen. APP_ENVis required.app …fails withAPP_ENV is not setwhen neither the environment nor.envsets it. Every server already setsAPP_ENV=production(the Dockerfile does); locallybin/setupwritesAPP_ENV=developmentto.env. CI scripts that ran the binary without it must set it.Configgainstrusted_proxy_hops: u8(default 1);Config::boot_warningsno longer warns about an unsetAPP_ENV, andenv_defaultedis alwaysfalse.- No MSRV or toolchain change.
Upgrading
Follow the numbered steps below in order (each names the entry whose App migration has the details), and upgrade for the whole procedure (/offrails:upgrade runs it).
Upgrading an app to 0.7.3, in order (each step's Detect/Converge/Prove is in the entry it names below; upgrade is the whole procedure). $FW is the new framework. Build the new release's offrails-gen in its own target directory, --target-dir "target/offrails-gen-$(cat "$FW/VERSION")", never target/offrails-gen (From a real app's upgrade, below).
- Parts first, before re-vendoring, as in 0.7.2:
cargo offrails update-part <each installed part> --framework "$FW" --dry-run, then without it. The parts are synced from samples2bc93ad(Parts below: invite-only as a switch,paths::after_sign_in()/account()in their tests, the mailbox, phone widths). An app on 0.7.1 or older runs the new release'soffrails-genfor this one step (upgrade step 6). - Re-vendor:
cargo run -q --manifest-path "$FW/tools/offrails-gen/Cargo.toml" --target-dir "target/offrails-gen-$(cat "$FW/VERSION")" -- vendor --framework "$FW".cargo offrails snippets,snippet …, path params,--layoutandnew --invitenow work. - Feature routes files (Generators → App migration):
src/routes.rsgetsroute modsandroute tablesanchors andROUTESbecomesAPP_ROUTES+TABLES. Required before the firstgenerate resource|controller|page|apiorsnippet add(they refuse and name the anchor without it). - The route sweeps fill any
{param}, and the mounted-route check readssrc/routes/(same entry): required with the step above. samples: app jsat the end ofstatic/app.js(Snippets → App migration): required beforesnippet add theme-toggle.- The component kit (Polish and proof → App migration, Layouts and components, and Generators and snippets on the kit → App migration): required before
generate resource|controller|page(they refuse without it, naming the files) and beforesnippet add resource|pagination|public-show-by-slug.brand.toml, the other layouts andprovestay optional. - Template fixes (Template → App migration, and From a real app's upgrade → App migration): the
?page=clamp (do this one: every generated index answers a huge page with a 500 otherwise), the pending-migration and seed tests, the AGENTS.md placeholder,COPY .cargo .cargoin the Dockerfile's dependency layer, the.scrollbox instatic/kernel/admin.css. Each is independent. - The
ACCOUNTSheader (Accounts → App migration): rewrite it in the new grammar (signup→password,invite→password invite,magic-link-invite→magic-link invite); an invite-only app setsDEFAULT_SIGNUP = Signup::Invite(after step 1 brought auth-core's switch). - Generations recorded before 0.7.3 keep working as code;
destroyof aresource/model/controller/page/apifrom before refuses and lists its files (Generators → App migration). - Optional polish (Polish and proof → App migration):
brand.toml(cargo offrails brand --init), the layouts, andcargo offrails prove, whichverify --fullruns whenBASEis set. - Security review (Security review fixes, above): Add
trusted_proxy_hops: 1to any hand-builtConfigliteral (Config::test()has it). SetAPP_TRUSTED_PROXY_HOPSwhere more than one proxy appends toX-Forwarded-For. Replace thean_unset_app_env_warns_at_bootunit test withan_unset_app_env_refuses_to_bootintests/app/kernel_test.rs(config.md shows it). - Prove it:
cargo offrails verify --fullis green on SQLite and Postgres,sh .offrails/tools/offrails-checkreports 0 errors,BASE=… cargo offrails provesays proven, anddocs/decisions.mdhasYYYY-MM-DD: upgraded to framework 0.7.3.
Full list of changes
-
Snippets: small, tested code to copy (snippets). The human, after a timed blog build on 0.7.2 (43 min, most of it friction, ~2,240 hand-written lines): "make generators kinda optional, i guess i still prefer snippets to generators... or generators that have good insertion or removal points. ideally multiple smaller files." The blog had hand-written (or fought) a feed, slugs, Markdown, the pager, a theme button, backdated seeds and a public page by slug. Each is now a snippet in
template/snippets/<name>/: a README (what, when, the files, the anchors it wires into, how to remove it), asnippet.tomlin a part'ssample.tomlformat (plusas, the model--asrenames, andsnippets, the snippets it builds on) andfiles/at app paths.- The eight:
resource(htmx CRUD fornotes, public: exactly the filesg resource notes title:string body:text --publicwrites; a test in offrails-gen keeps the two identical),atom-feed(GET /feed.xml, escaped by Askama, RFC 3339 dates, newest 20,<link rel="alternate">on every page),slug(slugify, accents folded, 80 chars;unique(base, query):-2,-3…, per owner or global),markdown(pulldown-cmark + ammonia; tests for<script>,on*=,javascript:, iframes, styles),pagination(Pagerandshared/_pager.html,perkept, the?pageclamp),theme-toggle(an app-side partial and one delegated handler instatic/app.js; no-JS POST to/theme; a test that the script and the server agree on the cookie),seed-backdated(backdate::<E>(db, id, days_ago(30))after the model'screate; it needs no resource: its test makes a table of a generated table's shape, so it adds to an app whose resources are generated and owner-scoped, which refused before because it required the resource snippet, found by the 0.7.3 blog build),public-show-by-slug(GET /read/notes/{slug}: a route with a path param end to end, a nullable uniqueslugcolumn, slugs that never move; it builds on the resource snippet's public notes, and its README says how to do the same for a generated owner-scoped resource, which it doesn't take). - The CLI:
cargo offrails snippets(list, with what each needs and whether it's in),snippet show <name>(the README, every file, every wire: to read or copy by hand),snippet add <name> [--as <model>] [--dry-run],snippet remove <name>.addis a recorded generation (kindsnippetindocs/generated.toml): checked first (anchors, files in the way, the parts and snippets it needs), re-adding is a no-op,removedeletes the unchanged files and the marked lines.--as articlerenames on word boundaries (note/notes/Note/Notes:NoteParams,/notes/{id}, "Note was saved"), one-word names. - CI:
tools/ci/test-template.sh snippetsadds every snippet (resource twice: as notes and--as article) into a bare app and into an app with every part, runs fmt, clippy, the suite on SQLite and Postgres and offrails-check, re-adds each (no-op), removes them all in reverse and checks the app is byte-for-byte the baseline; it refuses a shipped snippet missing from its list. - App migration: Detect:
grep -c "samples: app js" static/app.jsis 0. Converge: add// samples: app jsas the last line ofstatic/app.js(its comment words must passpublic_scripts_have_no_comment_words_zap_flags: the template's line above it reads "More behaviors (snippets, your own) go above this line, each one delegated listener."). The other snippets need only the 0.7.3 routes anchors (Generators below). Prove it:cargo offrails snippet add theme-toggle --dry-runlists its wires and refuses nothing.
- The eight:
-
Generators: optional, small files per feature, clean insertion and removal points (generators). AGENTS.md prime directive 2 was "Generate before you hand-write"; it is now "Start app code from a snippet or a generator (both tested, both yours once copied); hand-write the rest." Neither is mandatory. The same message in CHEATSHEET, workflow (the loop's PLAN and START steps), new step 8, the app AGENTS.md blueprint, the
feature,generate,scaffoldandnewskills, RAILS_MAP, template, cli; no doc says "generate before you hand-write" any more.- The split, and why this one. A resource used to be one 400–900-line controller, a 300–500-line model, one 250-line request test, and rows inserted into the big
src/routes.rs. Now (g resource posts …):src/controllers/posts/{mod,index,show,new,edit,destroy}.rs(one file per action pair:new.rsis new + create andedit.rsis edit + update, because each pair shares its form, its 422 re-render and its imports, and splitting them would duplicate both);src/models/post/{mod,params,queries}.rs(the entity and its relations; the untrusted input and its validation with its unit tests; the queries, which are what a reviewer audits for scoping);src/routes/posts.rs(its router,paths::helpers andROUTESrows);src/views/posts.rs(one file: the page structs are small);templates/posts/*;tests/app/posts/{mod,read_test,write_test,access_test}.rs(read, write, and who-may: the access tests are the security review's);tests/app/factories/post.rs. Each file is under ~150 lines for a typical model (a 12-field model'sparams.rsis longer: validation is per field). Rejected: one file per action (seven files for one form, imports repeated seven times), and per-feature crates (one crate is one compile unit; a workspace per feature would multiply link times). Callers see one module either way (post::find_for,post::PostParams,factories::post). - Routes per feature.
ROUTESis nowAPP_ROUTES(the kernel's and the parts' rows, as before) followed by each feature's table, listed inTABLESand concatenated at compile time by twoconst fns, so it stays one&[Route]that every test,app routes, docs/routes.md and the parts' own tests iterate unchanged. Generators (and snippets) wire a feature with one line at each ofsamples: route mods,routes,pathsandroute tables.g controller,g pageandg api(the API kernel's routes in a sharedsrc/routes/api.rs, each resource insrc/routes/api_v1_<p>.rs) do the same.g pageis one set of files per page (src/controllers/pages/<page>.rs,src/views/pages/<page>.rs,tests/app/pages/<page>_test.rs) instead of functions appended to shared files. - Every wiring line names its owner. A one-line statement or declaration ends with
// posts({# posts #}in HTML); a list element, field, match arm or block gets a// postsline above it (rustfmt aligns a comment that follows a trailing one in a list, and drags it onto the anchor). Declarations (pub mod x;,pub use …;) are inserted in sorted position, because rustfmt reordering a marked last line moves its comment onto another line (found by the CI:pub mod recurring; // notify_post_published).destroy, and a human, find a feature's lines by name; adding touches a shared file only through these one-line inserts (two for a factory, a few in the tenancy suite and the parent model'shas_many). Golden files and the byte-identical-after-destroy CI keep both guarantees. - Path params for
g controllerandg page:g controller blog index show:/blog/{slug}(or--path /blog/{slug}for one action),g page profile --path /people/{handle}. The handler takesPath(slug): Path<String>({id}and{…_id}arei64; several: a tuple), the page struct gets the field (escaped by Askama), the helper ispaths::blog_show(slug: &str), the test requestspaths::blog_show("example")and finds it on the page. A page with a parameter gets no sitemap entry; a signed-in page with one is listed in the tenancy suite'sNOT_TENANT_IDS.--navrefuses a first action with parameters. - The generated HTML is in two files,
tools/offrails-gen/src/generate/files/html/resource.htmlandpages.html(one section per piece: the index, its header and cells, show and its rows, new, edit, the form, each control, the nav link, the controller and page templates), with__NAME__tokens, instead of format strings inside the generators. Swapping the markup is editing those two files; the golden files show the result. The split itself was byte-identical (the goldens didn't move); the kit came next (Generators and snippets on the kit, below). - Other generator fixes: a generated boolean checkbox has its
dark:partner (accent-indigo-600 dark:accent-indigo-400); every generated index has a test that a huge?page=answers 200; the next steps say to commit right after the run. - App migration:
- Feature routes files. Detect:
grep -c "samples: route mods" src/routes.rsis 0. Converge: from.offrails/template/app/src/routes.rs, copy the// samples: route modsblock (after theuselines),pub type Route,pub const ROUTES(theconcatline),TABLESwith// samples: route tables, and the twoconst fns at the end; rename the app's existing tablepub const ROUTES: &[(&str, &str, &str, Access)] = &[toconst APP_ROUTES: &[Route] = &[(its rows and its// samples: routes tablestay). Prove it:cargo run -q -- routeslists the same rows as before, andcargo nextest run security_test smoke_testpasses. - Route sweeps. Detect:
grep -c "src/routes" tests/app/security_test.rsis 0. Converge: takeconcrete()(any other{param}becomesexample, or1for an id) andevery_mounted_route_is_in_the_routes_table(it also reads everysrc/routes/*.rs) from the template'stests/app/security_test.rs, and makesmoke_test.rs'severy_listed_route_is_routable_in_developmentcallcrate::security_test::concrete(path). Prove it: the two tests pass; after ag controller x show:/x/{slug}, both still pass. - Generations recorded before 0.7.3. Detect: entries in
docs/generated.tomlof kindresource,model,controller,pageorapiwithoutlayout = "2". Converge: nothing, if you keep them (the code is yours; it compiles as it is). To remove one,destroyrefuses with its file list: delete those files and its lines in the shared files by hand, thencargo offrails destroy <kind> <name> --forgetdrops the record. Migrations, jobs, mailers, channels and tests from before destroy as they did. Prove it:cargo offrails g resource …of a new feature writes the split layout, anddestroyof it leavesgit statusclean. - Agents. Log in
docs/decisions.md:YYYY-MM-DD: snippets and generators are optional starting points (framework 0.7.3); features are small files per feature with owner-marked wiring.
- Feature routes files. Detect:
- Changed code:
tools/offrails-gen(generate/feature.rsroutes files and path params,generate/snippet.rs,plan.rsmarkers and sorted inserts,model.rs/resource.rs/controller.rs/page.rs/api.rsthe split,routes_md.rsreading every routes file, golden files for path params and a test that the resource snippet is the generator's output).
- The split, and why this one. A resource used to be one 400–900-line controller, a 300–500-line model, one 250-line request test, and rows inserted into the big
-
The blog build's friction, fixed in the framework (the list from the 0.7.2 rebuild; the samples-repo items, invite-only auth, the parts' hard-coded
/account, the dev mailbox's "CODE 2026" and the AI briefing card, came with the parts sync below):- Template:
Pageclamps?page=to 1..=Page::MAX_PAGE(100 000):?page=18446744073709551615overflowed(page − 1) × per, a panic and a 500 on every generated index (unit testa_huge_page_is_clamped_not_overflowed; generateda_page_past_the_end_is_empty). The production pending-migration test requests/robots.txt, not/(an app's home that reads a generated table broke it).tasks_run_by_name_and_refuse_unknown_onesrunsseedunder a development config (seeds may refuse outside development).static/app.jsends with thesamples: app jsanchor. new: the generated AGENTS.md no longer shows the raw{{TS modes only…}}placeholder;--pitchalso replaces the home page's sentence, the sentence forms (description, home) are capitalized with their period, and the tagline is one value, brand.toml'stagline(the pitch capitalized, without its period), whichconfig::APP_TAGLINEnow is (pub const APP_TAGLINE: &str = crate::brand::TAGLINE;), so the home page title, the social card and a nav that shows the tagline agree (--pitchwrote the pitch as typed, often lowercase, intoAPP_TAGLINEbeside brand.toml's capitalized sentence, which nothing but the social card read; found by the 0.7.3 blog build; unit tests check the template still has every token andAPP_TAGLINEis the brand's); a pitch with quotes, braces or angle brackets is refused; on macOS it writestarget/.metadata_never_indexso Spotlight doesn't index build output.- Browser smokes:
smoke-dev-tools.mjsaccepts the dev mailbox's test button landing on the message it sent (dev-mailbox 0.7.2+) as well as on the list;smoke-dev-tools.mjsjudges Clear all, Back and Forward by the cleared messages' ids, not by an empty list (inverify --fullwith an auth part, the other smokes' sign-ins send "New sign-in" emails at the same moment, and Back/Forward failed on them; found verifying a 0.7.3 app with every auth part);run.shcopies each run's scripts into its own directory (parallel smokes overwrote a sharedlib.mjswhile another read it) and exits 77 (skip) when Node is older than 22.12;verifyreports the kernel-page smoke and the a11y smoke as skipped on 77, never failed or passed. The a11y smoke finds axe-core the way Node findspuppeteer-core, from the nearestnode_modulesup (the cache):lib.mjsread./node_modules/axe-corenext to itself, which the per-run copy doesn't have, soverify --full's "browser a11y" failed with ENOENT on every app (found by the 0.7.3 blog build);test-template.sh provenow runsrun.sh a11ywith a scenario, asverifydoes. The puppeteer smokes (run.sh dev-tools | live-tabs | login | a11y) find Chrome the same way as the CDP smokes (cdp.mjs:CHROME_PATH/CHROME, else the usual places on macOS, Linux and Windows) instead of defaulting to the macOS path, and skip (exit 77) when there is none. - Coverage with Homebrew's rust:
verify --fullpoints cargo-llvm-cov at Homebrew'sllvm(LLVM_COV,LLVM_PROFDATA) when the activerustc's sysroot has nollvm-tools(rustc --print sysroot, thenlib/rustlib/<host>/bin/llvm-cov) and they aren't set (testing). Deciding by whether rustup exists, as first written, missed the common case found by the 0.7.3 blog build: rustup installed but Homebrew'srustcfirst on PATH, where llvm-cov failed until both were set by hand (unit testllvm_tools_are_looked_for_in_the_active_sysroot). - Flaky tests show why:
verifyruns nextest at--status-level retry, so a test that fails and then passes on retry keeps its failed attempt's output intarget/verify/tests-*.log(before, only theFLAKYline), and the template CI prints that output when a flaky test is not a known one. - Docs:
SMOKE_EMAIL/SMOKE_PASSWORD(andSMOKE_PATHS) in the Definition of Done table; theassert_textapostrophe gotcha (it escapes like Askama, so literal template text needsassert_contains; testing, CHEATSHEET 26); one span rule everywhere (skip_allon actions and public model fns,level = "debug", skip_allon per-row helpers; errors-and-logging, CHEATSHEET 27); commit after each generator or snippet run (workflow, generators); how a sub-agent hands a running dev server back (detached withnohup, its PID file and log, cli); upgrade step 6's 0.7.1 caveat forupdate-part; authentication rewritten around the auth parts (what they do, what's left: invite-only, roles, teams), and new (steps 2–3 and Tests) and auth point at the parts too: they still saidauthentication.mdbuilds the guard and tenancy suites (the first owner-scopedg resourcewrites them) and "generates" accounts (found by the 0.7.3 blog build); routing, structure, models, testing and controller for the new layout. - A framework checkout is vendored from HEAD, and says so. new §1 told agents to export "the tag matching
VERSION", which on a release branch before tagging is the previous release (the 0.7.3 blog build vendoredgit archive 044d7ebby hand and logged why).new,vendorandupdate-partnow handle a--framework/OFFRAILS_FW(or the generator's own root) that is a git checkout themselves: they use HEAD's committed files (git archive HEAD | tar -x, astools/release/release.shbuilds the tarball), never the working tree (uncommitted changes are named and left out), andnew/vendorwrite the commit as.offrails/VERSION's third line and in thenewlog line:from git v0.7.3 (<sha>)at the tag,from git <sha> (unreleased: HEAD is not the v0.7.3 tag; VERSION names the last release)past it.VERSION's first line (and theFRAMEWORKheader) stay the version, sooffrails-checkandupgrade --checkread it as before; release installs (the plugin,~/.offrails/current, a tag export: no.git) are copied as before, with nothing added.--worktreeuses the working tree as it is, recorded as such:test-template.shpasses it, since CI tests uncommitted changes (unit testa_framework_checkout_is_vendored_from_head_with_its_commit; upgrade). - CI:
test-template.shtakesOFFRAILS_CI_TAG(a suffix for the apps' crate names, so two checkouts' runs on one Postgres server never share test databases) andOFFRAILS_CI_PORT(the smokes' first port). - App migration:
- The
?pageclamp. Detect:grep -c MAX_PAGE src/models/mod.rsis 0. Converge: inPage, addpub const MAX_PAGE: u64 = 100_000;and makenumber()self.page.unwrap_or(1).clamp(1, Self::MAX_PAGE); copy the template'sa_huge_page_is_clamped_not_overflowedtest. Prove it:curl -s -o /dev/null -w '%{http_code}' "$URL/<a list>?page=18446744073709551615"prints 200. - Tests that assume the home page and the seed. Detect:
grep -n 'app.get("/").await.assert_ok()' tests/app/kernel_web_test.rsinsideproduction_with_a_pending_migration_is_unhealthy_but_serves, andTestApp::new()intasks_run_by_name_and_refuse_unknown_ones. Converge:/robots.txtthere;TestApp::with_config(Config { env: AppEnv::Development, ..Config::test() })here. Prove it: both pass. - AGENTS.md. Detect:
grep -c "TS modes only" AGENTS.md. Converge: delete{{TS modes only: ", or :5173 via Vite"; htmx: nothing}}(htmx), or replace it with, or :5173 via Vite(inertia, spa). Prove it:grep -c "{{" AGENTS.mdis 0. - The smokes,
verifyand the docs arrive with re-vendoring; nothing to converge.
- The
- Template:
-
Polish and proof: one file rebrands the app, five layouts, a component kit, and
cargo offrails prove(views, testing). The human: "make it quick and easy to polish an app ... layout, branding ... components ... FOR AI. how to make agents move fast and precisely, and test, take screenshots, build a guide proving what they build works."brand.toml+cargo offrails brand(std-only, inoffrails-gen;newruns it). Name, tagline,primary/accent/neutralcolors, optionalon_primary, font stacks, radius, and the logo (a 1–2 character mark or a square SVG). It rendersassets/brand.css(Tailwind@theme:primary-*andaccent-*scales built in OKLCH with 600 exactly the brand color,gray-*= the neutral,indigo-*= primary so parts and older templates follow,on-primary,primary-hover, fonts, radius; semantic--brand-*tokens for light and dark),src/brand.rs(NAMEis nowconfig::APP_NAME;THEME_COLORfeeds the theme-color meta;brand::email::*colors, and the mailer part's header is pointed at them),static/favicon.svg, and the social cardassets/brand/og.svg. Before writing anything it checks 16 text/surface pairs the components use (body, muted, links, badges, button text and its hover; light and dark) against WCAG AA 4.5:1 and refuses with the pair, its ratio and a color that passes; the scales are built so that the shades holding text pass for any base color (a yellow brand gets near-black button text). PNGs (favicon.ico,apple-touch-icon.png,icon-512.png,og.png) are rasterized by the installed Chrome/Chromium/Edge (headless) orrsvg-convert; with neither the SVGs are current and it says the PNGs aren't (no image crate: a text mark needs a font rasterizer).--checkfails when a generated file is stale (verify --fullruns it).tools/brand/render.shis superseded (kept for apps without abrand.toml;assets/brand/og.htmlleft the template). 24 unit tests (color math against WCAG reference values, scales, contrast refusals and fixes, the TOML subset, outputs, the ICO container, rustfmt-stablebrand.rs).- Layouts (
templates/layouts/):application.htmlis now the shell (head, skip link, icon sprite, overlay slots, dev footer) whosebodyblock is the top-nav layout;sidebar.html(folds behind Menu on a phone),marketing.html(hero, nav, CTA, footer),auth.html(centered card),docs.html(table of contents beside the article). One<head>for all of them (boosted links), a skip link to<main id="main">, landmarks, dark mode, no sideways scroll at 360–390 px. Pages pick one with{% extends %}. - Component kit (
templates/components/ui.html, one import): button (variants, sizes, icon, disabled), link_button, icon_button, confirm_button, icon; field (text/email/password/…), textarea, select, checkbox, radios (labels, hints, errors witharia-invalid/aria-describedby, values kept on a 422, passwords never echoed), form_actions; alert, flash, toast/toast_oob; card, badge, stat, table (caption, sortable header links witharia-sort, empty state), pagination (helpers::Pager), empty_state, avatar; breadcrumbs, page_header, nav_tabs, tabs/tab_panel, dropdown/menu_item; modal (native<dialog>: inert page, focus kept inside, Esc, focus returned), modal_button, modal_link (htmx-loaded, opens itself, leaves when closed), modal_close, and the layout-wide confirm dialog for everydata-confirmandhx-confirm. Styles are component classes inassets/app.css(brand tokens, light + dark); behaviors arestatic/components.js(delegated; thedata-confirmhandler moved there fromapp.js, which now keepsaria-expandedin step fordata-toggle). Every component in every state at/dev/components(?theme=light|dark), each layout at/dev/layouts/<name>(development only,Access::Dev); guides/views.md has the signatures as one table. - Tests:
theme_testrenders the gallery and the layout demos and checks every class list for itsdark:partner and its rule in the built CSS;components_test(skip link, landmarks and one<head>in every layout, the 422 keeps values, sort and pagination, development only);tools/browser-smoke/smoke-components.mjsdrives the modal (Tab, Esc, focus return), the htmx modal, the confirm dialog (Cancel and Confirm) and the 422 on a full load and after a boosted link; the boosted smoke covers the gallery's dropdowns, tabs, toggles and dismiss buttons. offrails-check [classes](a warning, never an error): a<button>,<input>,<select>,<textarea>or button-like<a>with more than eight utilities (CLASS_LIST_MAX) in an app template outsidetemplates/components,kernel,mailers;{# offrails-check: classes ok #}on the line silences it. A line an installed part ships as it is (in its copy of the same file in.offrails/template/parts/<part>/files/, crate names aside: the baseupdate-partmerges from, or in a part's wiring insample.toml, since parts wire into each other's templates, e.g.shared/_auth_nav.html) is skipped and counted (skipped N line(s) the installed parts ship): the auth parts' ownpassword_sessions/_confirm.html,_form.html,passwords/_new_password.html,registrations/verify.htmlandsecurity/not_me.htmlwarned in every app that installed them (found by the 0.7.3 blog build); moving them onto the kit is a samples change. A line the app wrote or edited is checked. Intools/ci/test-offrails-check.sh(a part's unmodified line, an edited one, and a wired one).cargo offrails prove(offrails-genlaunchestools/browser-smoke/prove.mjs: Node ≥ 18 and the installed Chrome over the DevTools Protocol, the driver and browser discovery every smoke shares (tools/browser-smoke/cdp.mjs, below), no npm install; exit 77 without them). It starts nothing: withBASEset it visits every GET page ofdocs/routes.md(plusSMOKE_PATHS, minusSMOKE_SKIP) as the visitor who can see it (signed in as the demo account when a page sends you to sign in), takes full-page screenshots at desktop 1280 and mobile 390 in light and dark, and fails on console errors, uncaught exceptions, CSP violations, axe-core violations (WCAG 2.2 AA, light and dark; the a11y smoke's pinned axe from the smokes' cache, installed there once if missing), broken same-site links and#anchors, and sideways scroll at 390 px (naming the elements that stick out; on kernel pages, which apps don't own, a warning unless--strict: its first run on the all-parts app found the dev dashboard's requests and lab pages and/admin/jobs,/admin/jobs/cronscrolling sideways on a phone, a samples fix to make upstream). Each screenshot is diffed against the previous run's (PNG decode/encode withnode:zlib, a per-pixel threshold): reported with a diff image, failing only with--strict. It writesdocs/proof/PROOF.md(result, checks, pages with their four screenshots and changes, and every acceptance criterion → the tests citing it with their result from the lastverify→ the pages they request with screenshots) andproof.json; PNGs are git-ignored unless--commit-screenshots.verify --fullrunsbrand --check, the component smoke andprovewhenBASEis set (a separatepolish_stepsblock); workflow.md's Definition of Done has the proof row and the final message links PROOF.md.- Measured (M2, 8 cores, other agents building on the machine): the bare app, 9 pages, 36 screenshots, axe on 18 loads: 13 s at load ~15, 20 s (first run) and 24 s (second run, with the diffs) at load ~50; the app with every part, 63 pages (57 signed out, 6 signed in as the demo account), 252 screenshots: 165 s and 216 s at load 50–70. Its second run reported 82 changed screenshots out of 252 (the dev dashboard's live charts, timestamps, uptime): reported, not failed, as designed.
- CI:
tools/ci/test-template.sh prove(its apps' crate names takeOFFRAILS_CI_TAGand its two servers the ports after the smokes',OFFRAILS_CI_PORT+ 2 and + 3, like the other targets) generates the bare app and the app with every part, adds a fixture feature whose two criteria cite request tests, runsverify(SQLite + Postgres) and offrails-check, serves each in development, runs the component smoke andprovetwice, and checks that PROOF.md says PROVEN, has four screenshots per page, tracesAC-home-1to its passing test and to/, that the second run compared screenshots, and that the PNGs are git-ignored. Its fixture also has a helper whose doc comment citesAC-home-2, which PROOF.md must not list:provecounted the firstfnafter any AC id as a citing test, so handlers and helpers whose comments name a criterion (session_deleteinsrc/routes.rs, queries, module docs, string literals in the dev dashboard's tests) showed up as its tests (found by the 0.7.3 blog build). In Rust it now counts only test functions: a test attribute (#[test],#[tokio::test],#[sqlx::test],#[rstest], …) among the citation's attributes and comments, only those between it and thefn, and insrc/a#[cfg(test)]module (testing). Its apps use a sticky-footer layout (<body>a flex column,<main>w-full flex-1, as apps often make it), and/dev/componentsand every/dev/layouts/*page must be ok in PROOF.md (no sideways scroll at 390 px):/dev/components' own<main>hadmx-autowithoutw-full, so in such a layout it shrank to its content and the table's min-content made it 396 px wide at 390 px, whichprovecounts as a failure (a boosted page; found by the 0.7.3 blog build). It hasw-fullnow.
App migration (an app on 0.7.2; optional, but
verify --fullruns the new steps once re-vendored):- Brand. Detect: no
brand.tomlat the app root. Converge: re-vendor, thencargo offrails brand --init(writesbrand.tomlwith the name fromsrc/config.rsand the description fromsrc/views/mod.rs, without its period, as the tagline); put the app's tagline in brand.toml'stagline(the one inAPP_TAGLINE, capitalized); set the colors you use (the template default primary is#4f46e5); copy@import "./brand.css";(after@import "tailwindcss";) and@source "../static/components.js";intoassets/app.css; addpub mod brand;tosrc/lib.rs; setpub const APP_NAME: &str = crate::brand::NAME;andpub const APP_TAGLINE: &str = crate::brand::TAGLINE;insrc/config.rs(a smoke test that asserts the home page title then sees the capitalized tagline); replace the layout's<meta name="theme-color" content="#…">with{{ crate::brand::THEME_COLOR }}; runcargo offrails brand. Prove:cargo offrails brand --checkprints "is current" andcargo nextest run theme_testpasses. - Layouts and components. Detect: no
templates/components/ui.html. Converge: copy from.offrails/template/app/:templates/components/,templates/layouts/{sidebar,marketing,auth,docs}.html,templates/shared/{_brand,_notices,_sidebar}.html,static/components.js, the component layer ofassets/app.css(keep your own classes),src/views/helpers.rs's component helpers (same,tone_icon,initials,PageNumber,Pager), thecomponents_jsasset (src/kernel/assets.rs: the field and the"components.js"key in the same position), and the gallery (src/controllers/gallery.rs,src/views/gallery.rs,templates/dev/, its routes incontrollers/dev.rs,ROUTESandpaths); then maketemplates/layouts/application.htmlthe shell: wrap its nav-and-main in{% block body %}…{% endblock %}, give<main>id="main", and add the skip link,{% include "components/_icons.html" %},{% include "components/_overlays.html" %}and thecomponents.jsscript as the template's does (keep thesamples:anchors). Delete thedata-confirmlistener fromstatic/app.js(components.js has it). Copytests/app/components_test.rsand the gallery test intests/app/theme_test.rs. Prove:cargo offrails verify, then withbin/devrunningBASE=… node .offrails/tools/browser-smoke/smoke-components.mjs. - Proof. Detect:
cargo offrails prove --helpis unknown. Converge: re-vendor. Prove:BASE=<bin/dev's URL> cargo offrails proveprintsprovenand writesdocs/proof/PROOF.md; link it in your final message from now on. LogYYYY-MM-DD: upgraded to framework 0.7.3 (brand.toml, layouts, component kit, prove)indocs/decisions.md.
-
Generators and snippets build their pages from the component kit, in a layout you pick (generators, views). The two branches met here: the generators' markup had just moved into
files/html/{resource,pages}.html, and the kit had just landed. Every generated page now calls the kit, so it followsbrand.toml, both themes and the kit's accessibility, andoffrails-check [classes]finds nothing in it (0 warnings on an app with a resource of every field type, a references chain, pages and controllers; was 0 before too, but only because the old markup was hand-checked).- Index:
ui::page_headerwith aui::link_button("New post",plusicon);ui::table(caption, the list's columns; the actions column is gone: Edit is on the show page) or, empty,ui::empty_statewith its call to action;ui::paginationwithpages()= this page + 1 when the query found more (the generatedallreturnsmore, no COUNT) andpage_base(). Before → after (templates/posts/index.html, abridged):<div class="flex flex-wrap items-end justify-between gap-4"> <h1 class="text-3xl font-semibold tracking-tight">Posts</h1> <a href="{{ paths::new_post() }}" class="btn">New post</a> </div> {% if posts.is_empty() %}<p class="mt-10 rounded-xl border border-dashed … p-10 text-center …">No posts yet. …</p>{% else %} <div class="mt-8 overflow-x-auto rounded-xl border …"><table class="min-w-full divide-y …">…</table></div>{% endif %} {% if newer().is_some() || older().is_some() %}<nav …>← Newer … Older →</nav>{% endif %}{% import "components/ui.html" as ui %} {% call ui::page_header("Posts") %}{% call ui::link_button("New post", paths::new_post(), icon = "plus") %}{% endcall %}{% endcall %} {% if posts.is_empty() %}{% call ui::empty_state("No posts yet", "Create the first one.", "New post", paths::new_post()) %}{% endcall %} {% else %}{% call ui::table("Posts, newest first", [("", "Name"), ("", "Title")]) %}<tr id="post_{{ post.id }}"><td>…</td></tr>{% endcall %}{% endif %} {% call ui::pagination(page, pages(), page_base()) %}{% endcall %} - Show:
ui::page_headerwith Edit (link_button) and Delete (ui::confirm_button, the layout's confirm dialog); the fields in aui::card. New/edit:ui::page_headerand the form in aui::card. Form:ui::field(text, number withstep/inputmode, decimal, money with a0.00placeholder,datetime-local, date, a monospace uuid),ui::textarea(text; json monospace),ui::checkbox(boolean),ui::select(an optional boolean: Not set/Yes/No; a reference: its choices), each with its label, the required mark,aria-invalid/aria-describedbyand its errors;ui::form_actions(Save, Cancel).g controller/g page:ui::page_headerand the placeholder paragraph. The flash is the layout's:shared/_flash.htmlis now the kit'sui::flash(dismissible). --layout application|sidebar|marketing|auth|docsong resource,g controllerandg page(defaultapplication, the top nav; recorded aspage_layoutindocs/generated.toml, so a re-run anddestroysee the same pages). A layout the app doesn't have is refused.- The kit, for generated forms:
fieldtakesmaxlength,inputmode,step,mono(monospace, no autocorrect) andkey(the errors' key when it isn't the input's name: abook_idselect reports onbook);textareatakesmonoandkey;selecttakeskey, and its option values may be ids (helpers::samecompares anyDisplay, soVec<(i64, String)>choices work as they are);page_header's title wraps (break-words).helpers::error_keyis new, with unit tests. - Snippets:
resourceis re-exported from the generator (the unit test that it equalsg resource notes title:string body:text --publicstill passes);paginationisviews::pager::PageLinks { number, pages, base }(renamed fromPager, which is the kit's helper) andshared/_pager.htmlis oneui::paginationcall (?per=kept inbase, tests for the links,per, the clamp and the partial);public-show-by-slug's page usesui::page_header;theme-toggle's button is the kit'sbtn-ghost btn-sm(the kit has no theme switch of its own; it had 11 utilities, anoffrails-check [classes]warning). - Proof: the goldens (
resource_items,page_about,page_profile_param,controller_reports,controller_blog_params) show every page; an app with a resource of every field type, a references chain, a docs-layout page and a sidebar-layout controller: 194 tests green,theme_testincluded, 0[classes]warnings, the boosted smoke and the component smoke green,proveproven (24 pages, 96 screenshots, show and edit pages throughSMOKE_PATHS);test-template.sh generatorsandsnippetskeep the byte-identical-after-destroy/removechecks. - App migration: Detect:
grep -c error_key templates/components/ui.html src/views/helpers.rsis 0 (or no kit). Converge: copytemplates/components/ui.htmlandsrc/views/helpers.rs'ssameanderror_key(and their test lines) from.offrails/template/app/, andtemplates/shared/_flash.html. Pages generated before keep their markup (they're yours);g resourceof a new feature writes the kit's. Prove it:cargo offrails g resource probes name:string --public --dry-runrefuses nothing, and after a real run andcargo offrails verify,destroy resource probesleavesgit statusclean.
- Index:
-
One browser driver for the zero-dependency smokes (
tools/browser-smoke/cdp.mjs).smoke-boosted.mjsandprove.mjseach carried their own copy of the Chrome discovery, the DevTools Protocol pipe and the tab (console errors, CSP,eval,goto, settle), andsmoke-components.mjsimported prove's. Now all three importfindChrome,requireChrome(skip: no Chrome, exit 77),launch(a throwaway profile, headless, Linux CI's--no-sandbox, closed and deleted afterwards),Cdp,Tab(viewport,screenshot, anignorepattern, the boosted smoke'sphaseprefix) andsignInPostfrom it.selftest-boosted.mjs(4/4) andselftest-prove.mjspass; the three smokes andproveare green against a bare app and one with every part. -
From a real app's 0.7.1 → 0.7.2 upgrade (1,530 tests, green after it; six things it tripped on):
- Release fixes: a stale
cargo offrailsafter an upgrade. Every file in the release tarball had mtime 2000-01-01, older than an app's cached offrails-gen binary, so Cargo reused the previous release's (update-part: "unknown command" untiltarget/offrails-genwas deleted).tools/release/release.shnow stamps the files with the release commit's time (still deterministic),install.shunpacks withtar -m(the files get the time they were unpacked), offrails-gen'sCargo.tomlversion followsVERSION(it's in Cargo's fingerprint;release.shrefuses a mismatch; the README's release steps say so), and upgrade builds the new release's offrails-gen intarget/offrails-gen-<version>. verify --fulland a coverage toolchain. WithRUSTUP_TOOLCHAINset for cargo-llvm-cov (a toolchain withllvm-tools, often without rustfmt or clippy), fmt and clippy failed. That toolchain (orOFFRAILS_COVERAGE_TOOLCHAIN) now goes to the coverage step only; every other step runs without it, andverifysays so (unit testthe_coverage_toolchain_is_for_the_coverage_step_only; testing).- The smokes find the sign-in form.
smoke-boosted.mjsandprovesigned in only whendocs/routes.mdhadPOST /session/password; that app signs in atPOST /session. They now try when it has/session/password,/session,/sessions,/login,/sign_inor/users/sign_in, orSMOKE_SIGNIN_PATHnames the route, and submit the password form found onSMOKE_LOGIN, whatever its action (testing). run.sh dev-toolsneeded a visible/devlink on/. It opens/devdirectly, in a desktop window; each "Send test email" must land on/dev/mailbox/<id>with the flash "Sent a test email to your mailbox." and the list must show at least 3 rows (the mailbox's current markup,#mbx-list); the jobs steps run only when/devhas a test-job button (no part has one now: it says skip) (dev-tools).- The template Dockerfile compiled every dependency twice: its dependency layer had no
.cargo/, so it and the final build used different rustflags. It now copies.cargobefore building the dependencies. hx-triggerfilters never fire.keyup[key=='Enter']needs eval, which the template'shtmx-configturns off for the CSP (allowEval:false), so the trigger silently does nothing. A gotcha in frontend-htmx and CHEATSHEET 28, andoffrails-check [htmx]warns on a filter intemplates/(a fixture case intest-offrails-check.sh).- App migration: Dockerfile. Detect:
grep -c 'COPY .cargo .cargo' Dockerfileis 0. Converge: addCOPY .cargo .cargoafterCOPY Cargo.toml Cargo.lock ./(before the dependencycargo build). Prove it:docker build .twice after a code change: the second build's dependency layer is cached and its final step compiles only the app. The others arrive with re-vendoring; nothing to converge (an upgrade from 0.7.2 builds the new offrails-gen intarget/offrails-gen-0.7.3once).
- Release fixes: a stale
-
Accounts: invite-only is a switch; the
ACCOUNTSgrammar (auth, authentication). With the parts synced below, auth-core has one switch for every sign-in method:DEFAULT_SIGNUPinsrc/config.rs(Signup::OpenorSignup::Invite), overridden per deploy byAPP_AUTH_SIGNUP=open|invite; invite-only, the sign-up pages answer 404 and their links hide (ctx.signup_open), magic links go only to existing accounts, andapp task auth_invite <email>lets people in. The framework side:- The header names methods, then
invite:ACCOUNTS: password,magic-link,password+magic-link,magic-link invite,password+totp invite. The old words map:signup=password,invite=password invite,magic-link-invite=magic-link invite. The blueprint, the interview, the auth variants table (old anchors kept for the parts' links), authentication (invite-only is a switch now, not a list of edits), template and api use it.add-part auth-password/auth-magic-linkwrites it, adding a method to the ones there and normalizing old words (unit testthe_accounts_header_grammar_and_its_old_words). new --invite: setsDEFAULT_SIGNUP = Signup::InviteandACCOUNTS: … invite; refused withoutauth-passwordorauth-magic-linkamong the parts.- App migration: Detect:
grep -E '^ACCOUNTS: +(signup|invite|magic-link-invite)\b' AGENTS.md. Converge: rewrite the words as above; an invite-only app also setsDEFAULT_SIGNUP = Signup::Inviteinsrc/config.rsand drops any hand-made invite-only edits the old authentication told it to make (restored/registration*routes and links are hidden by the switch). Prove it:sh .offrails/tools/offrails-checkpasses[header]; invite-only:curl -s -o /dev/null -w '%{http_code}' $URL/registration/newprints 404.
- The header names methods, then
-
Parts synced from samples
2bc93ad(tools/sync-parts.sh): two auth-magic-link tests create their account first, so they pass in invite-only apps too (samples CI now reruns the auth suites withDEFAULT_SIGNUP = Signup::Invite); dev-dashboard'sjobs_are_traced_with_their_sqlpicks its trace by request id and prints every trace it held if it fails (reported flaky once in CI, not reproduced); invite-only as the switch above (auth_invitetask,Signup,SignupOpen,ctx.signup_open); part tests that usepaths::after_sign_in()/paths::account()instead of a hard-coded/account; the dev mailbox's code detection (no more "CODE 2026"); the dev dashboard's AI briefing summarized on load; phone widths: a.scrollbox contains its table's visually-hidden labels indashboard.cssandjobs.css, and every dashboard tab, the jobs pages,/devand the mailbox fit 390 px. The same containment for the template's ownstatic/kernel/admin.css(.scroll { position: relative; max-width: 100% }):proveon the app with every part reports 0 kernel pages with warnings (it listed/admin/jobs,/admin/jobs/cronand the dashboard's requests and lab pages before). App migration (admin.css): Detect:grep -n '^\.scroll' static/kernel/admin.cssshows noposition: relative. Converge:.scroll { position: relative; max-width: 100%; overflow-x: auto; }. Prove it:provereports no sideways scroll at 390 px. -
Dev-dashboard flakes fixed at their cause; parts synced from samples
393408b. Three dev-dashboard tests failed once and passed on retry in this CI (a_trace_expands_inline_with_repeats_folded,jobs_are_traced_with_their_sql,the_checkout_fan_out_traces_four_upstreams; reproduced locally under parallel load, about 1 run in 300), and a fourth under the same load locally (every_tool_answers_within_its_cap:cap()kept 60 characters for its 61-character cut note, so a trace that filled the room came out one over; fixed, with a test at the boundary). Not shared on-disk state: other threads hold clones of a span, and a span closes at its last clone's drop. The SQLite driver's worker thread keeps the span each query ran in until its next command; with the tests' thread-local subscriber (set_default), a span dropped last there closed its parent through that thread's (empty) default, so the handler and the methods above the last query never closed and the waterfall had no handler row. hyper spawns the connection a request opens with the current span and pools it, so an outbound call that opened a connection lasted as long as the connection and overlapped the next calls; and the sequential-calls check wanted under 5 ms of wall clock between two calls, which a loaded machine exceeds with nothing in between. Fixed in the part: the tests'traced()installs the subscriber as the process's global default (asmaindoes); a request trace records the spans still open when its response is done (trace::flush_open; a counter per span says whether to look);kernel::outboundsends from a task of its own (aborted with the call), so the pooled connection holds no span; calls are sequential when nothing of the handler's (a query, a method, a template) ran between them (SEQUENTIAL_GAP_USis gone); the job test pings the database (the SQLite worker answers only after it let go of the job span) before it looks.test-template.sh'sKNOWN_FLAKYis empty: its two entries (run_history_is_capped_redacted_and_reopened,bench_drives_a_running_server) sharedstorage/dashboard/, which the part already keeps per test process, and neither has flaked in CI since; the gate (one retry, any flaky test not listed fails the run) stays. App migration (apps with the dev-dashboard part): Detect:grep -c flush_open src/kernel/dashboard/trace.rsis 0. Converge:cargo offrails update-part dev-dashboard. Prove it:cargo offrails verify --fast. -
Docs, one story across both branches: start from a snippet or a generator (both optional), build pages from the component kit in a layout, prove with
cargo offrails prove. AGENTS.md (prime directive 2 and the load table), CHEATSHEET (the kit, the layouts,brand), workflow (BUILD and VERIFY), template, README, generators, scaffold, controller, views (Layout & partials and Forms rewritten on the kit; the stale layout listing, its per-page head scripts and_pagination.htmlare gone), testing, models.tools/ci/check-links.pycounts<a id="…"></a>anchors (kept for renamed headings): 0 broken links; every shellcheck line in CI is clean.
0.7.2 (2026-10-18)
What's new
cargo offrails verifyruns the Definition of Done in parallel in one command.--fast(after every change) runs fmt, clippy and the SQLite and Postgres suites at the same time;--full(once, at the end) adds coverage,cargo deny, gitleaks and the other checks. A bare app's loop after a one-line change went from 140 s to about 6 s.- Generators:
cargo offrails generate <kind>(g) writes migrations, models, CRUD resources, controllers, pages, APIs, jobs, mailers, channels and tests that follow the guides and come with their tests.cargo offrails destroy(d) removes exactly what was generated and is still unchanged. cargo offrails update-partbrings a newer version of an installed part into the app with a three-way merge: clean changes apply, overlapping edits get conflict markers, and the app's own changes are never silently overwritten.- Faster Postgres tests: the suite migrates once into a template database and reuses locked slot databases reset before each test, instead of creating and migrating a database per test.
- A browser smoke for boosted navigation catches page JavaScript that works on a fresh load but is dead after a boosted link. Page scripts now load from the layout and bind by delegation.
- Template speed-ups: one CI test job instead of two, a cached Docker dependency layer, and a cached development CSS check.
Breaking changes
Nothing is required to keep an existing app working. Before using the new tools:
- Generators need the
// samples:anchors in the shared files; a generator that lacks one refuses and names it. - The route-sweep tests (
smoke_test.rs,security_test.rs) must send each route's own method before the firstcargo offrails g api. - Parts updated to this release load their page scripts at a new
samples: app headanchor in the layout. split-debuginfoleft[profile.dev]in the template; an app built on Windows must remove it too.
Upgrading
Follow the ordered list below; each step's Detect/Converge/Prove is in the entry it names under Full list of changes, and upgrade is the whole procedure. $FW is the new framework.
- Parts first, before re-vendoring:
update-partmerges against the part as installed in.offrails/, so run it while.offrails/is still the old release:cargo offrails update-part <each installed part> --framework "$FW" --dry-run, then without--dry-run. Resolve any<<<<<<<markers, thencargo fmt --allandcargo run -q -- db migrate. (An app on 0.7.1 or older has noupdate-partyet: run the new release's,cargo run -q --manifest-path "$FW/tools/offrails-gen/Cargo.toml" -- update-part <part>… --framework "$FW" --app ..) - Re-vendor:
offrails-gen vendor --framework "$FW".cargo offrails verify,generate,destroyandupdate-partnow work. - Generator anchors (Generators → App migration): add every missing
// samples:anchor. A generator that needs a missing one refuses and names it, so this can wait until the firstgenerate. - Route sweeps send each route's own method (same entry): required before the first
cargo offrails g api. - Optional speed-ups (Fast loop → App migration): Postgres test slots, the CSS check cache, the
split-debuginfomove (needed for Windows builds), and the one-job CI. - Prove it:
cargo offrails verify --fullis green on SQLite and Postgres,sh .offrails/tools/offrails-checkreports 0 errors, anddocs/decisions.mdhasYYYY-MM-DD: upgraded to framework 0.7.2plus the generators line.
Full list of changes
-
A fast loop:
cargo offrails verify(workflow). A human, after a 41-minute agent build and 4+ minute CI runs: "we need CI to run in 10 seconds or less, can't we parallelize or something". The Definition of Done ran sequentially (fmt, clippy, SQLite suite, Postgres suite, coverage, deny, gitleaks, browser smokes), and the docs had agents run all of it after every change. Now one cross-platform command (inoffrails-gen, socargo offrails verifyworks in every template app) runs it in parallel:-
--fast(default; after every slice):cargo fmt --check, the CSS build (htmx), clippy-D warningsin its own target dir (target/clippy, so it compiles while the tests build), the test binaries once, then the SQLite and Postgres suites at the same time (nextest; Postgres runs the integration tests, since unit tests never readTEST_DATABASE_URL). One line per step with its time and test counts, the tail of each failure, logs intarget/verify/, non-zero exit on any failure. Postgres comes fromTEST_DATABASE_URL(environment or.env) or the compose URL whenlocalhost:${DB_PORT:-5432}answers; otherwise it says skipped. -
--full(once, at the end): alsooffrails-check, coverage (it is the SQLite run, instrumented withcargo llvm-cov nextest --fail-under-lines 80),cargo deny, gitleaks, the no-unwrap/expectreview,routesvsdocs/routes.md, the TS checks when there is aweb/, and the browser smoke whenBASEnames the running app. Missing tools are reported asskipwith the install command, never as passed. -
The guidance changed with it: workflow (the loop's VERIFY step, the Definition of Done, "iterate fast, verify fully once": one test with
cargo nextest run <name>while red,verifyafter each slice, coverage/deny/gitleaks/full browser smokes only in--full), CHEATSHEET,/offrails:check, the appAGENTS.mdblueprint, new step 5,offrails-gen new's next steps,tools/ci/test-template.sh(now runsverify, still failing on any flaky test outside its known list). -
Measured on generated apps (Apple M2, 8 cores, macOS; other agents were compiling on the same machine the whole time, so each row gives the load average, and old and new were run back to back under the same load). "Old" is 0.7.1's template and its sequential Definition of Done; "new" is this release.
Step Bare, old Bare, new Every part, old Every part, new Cold build ( cargo build, then the test targets)217 s + 38 s (load 22–45) same dependencies, same 180 s + 59 s (load 31–53) same Cold build, a second app on the machine 293 s (load 121) 128 s with sccache (opt-in; load 127) n/m n/m No-op rebuild of the tests 0.5–0.7 s same 0.65 s same One-line change, test build 3.7–5.4 s (load 40–65) 3.2–3.8 s inside verify (load 11) 12.3 s (load 36) 12.2–15.9 s inside verify (load 9–11) Clippy after a one-line change 1.9 s 1.1–2.3 s, beside the build 8.1 s 7.7–9.5 s, beside the build SQLite suite 1.3 s (121 tests) 1.4 s 8.0–10.4 s (652 tests) 8.5–9.5 s Postgres suite 8.0 / 11.9 s (load 15–18) 1.7 / 1.8 s 149 / 46 s (load 12–37) 21 / 14 s (load 17–20) The fast loop: fmt, clippy, test build, SQLite, Postgres after a one-line change 140 s, sequential (load 19–33) 5.5–6.7 s ( verify, load 11)76–179 s, sequential (sum of the rows above) 33.5–36.5 s ( verify, load 9–11)The whole Definition of Done after a one-line change (+ offrails-check, coverage, deny, gitleaks) 157.7 s (load 19–33) 20.1 s ( verify --full, load 14–18)not run (the instrumented build needs another ~5 GB; the disk was full) — Where an all-parts app's 34 s go: the test build (~12 s, the app crate compiled as lib and as lib-test in parallel, then the test binary), then the Postgres suite (~20 s beside SQLite, ~14 s alone; 461 integration tests, the longest single tests 4–5 s of real timeouts in the parts' own tests). The 10 s target holds for the bare app, not for one with every part.
-
-
Postgres tests: no
CREATE DATABASEand no migrations per test (testing). Each test used to createtest_<crate>_<uuid>, migrate it and drop it.CREATE DATABASEcopies and fsyncs a template (measured on this machine under load: 1.2–3.8 s for one empty database), so the Postgres run degraded badly when the machine was busy (a 541-test blog: 42.5 s quiet, 335 s at load ~68). Nowsupport.rsmigrates once intotest_<crate>_<tag>_tpl(<tag>: a hash of the migration names and files, so an edited migration builds a new one; built under an advisory lock and renamed into place, so concurrent first tests wait and a killed build leaves nothing half-migrated), each concurrent test locks a slottest_<crate>_<tag>_<n>(pg_try_advisory_lock), cloned from the template once and reused across tests and runs, withsynchronous_commit = off, andoffrails_test.reset()puts the slot back to the just-migrated state before every test: tables with rows truncated, the migrations' seed rows and every sequence restored. A schema fingerprint makes the reset refuse a slot a test changed (rolled a migration back, created a table), and the harness re-clones it. Still every test on both databases, isolated. Also evaluated: a rollback transaction per test (rejected: the app's own transactions, the job worker and realtime use other connections) andCREATE DATABASE … TEMPLATEper test (keeps the fsync cost). SQLite stays in-memory and migrated per test: the migrations are ~5 ms of a ~40 ms median test. The new SQL is inkernel::db(database_exists,create_database_from,rename_database,advisory_lock/try_advisory_lock/advisory_unlock,skip_commit_flush,install_test_reset/reset_test_database,drop_idle_stale_test_databases), with a kernel test (the_postgres_test_reset_empties_tables_and_refuses_a_changed_schema). -
The development CSS check is cached (views).
kernel::css::css_warningread every template and the built CSS on every development page (~85 ms in a grown app; 97% of the CPU under load). It now recomputes only when a template,assets/app.cssorstatic/app.csschanges (size and mtime), with a unit test. -
Template CI: one test job (testing). The
sqliteandpostgresjobs each compiled the tests; the newtestjob runscargo offrails verify --fastagainst a Postgres service on tmpfs, with rust-cache keepingtargetandtarget/clippy, after the migration guard,offrails-checkand acargo metadata --lockedcheck. The Docker job'sDockerfilebuilds the dependencies in a layer of their own (a placeholdersrc/), which theghalayer cache keeps; the old--mount=type=cachetarget was never in that cache, so every run compiled every dependency in release mode. Locally (Docker on the M2, bare app, load 18→77): the first image build 352 s, a rebuild after a one-line code change 156 s with the dependency layer reused (the app crate's release compile and the CSS), and the image boots (/up200). Not measured on GitHub (no runner available to this change): expected, from the local split, that a code-only push skips the release dependency build (most of the Docker job) and compiles the tests once instead of twice. -
A dev-dashboard test failed for good after ~50 runs in one working copy (
run_history_is_capped_redacted_and_reopened). It saved a run dated 2027 into the realstorage/dashboard/ai-runs/and never removed it; onceMAX_HISTORYof them piled up they outranked and pruned the run the test makes. It now deletes its file. A local change totemplate/parts/dev-dashboard(the samples repo needs the same one-line fix;tools/sync-parts.shwould undo it). Its other flake (another test process pruning the shared history) remains intest-template.sh's known list. -
Build settings (testing).
split-debuginfo = "unpacked"left[profile.dev]: Windows MSVC refuses it, and it is macOS's default anyway; Linux gets it from.cargo/config.toml([target.'cfg(target_os = "linux")']). Faster linkers stay opt-in per machine (~/.cargo/config.toml; x86_64 Linux already uses rust-lld since Rust 1.90). sccache is documented as an optional shared cache for a second app on one machine; a sharedCARGO_TARGET_DIRis not recommended (one build lock for every app and agent).App migration (optional; every item makes an existing app faster, none is required):
- The verify command. Detect:
cargo offrails help | grep -c verifyis 0, or.offrails/tools/offrails-gen/src/verify.rsis missing. Converge: re-vendor (offrails-gen vendor --framework "$FW", the upgrade does this); the alias in.cargo/config.tomlalready runs the vendoredoffrails-gen. Apps without the alias add it from.offrails/template/app/.cargo/config.toml. Prove it:cargo offrails verifyprints a line per step andgreen. - Postgres test slots. Detect:
grep -c offrails_test src/kernel/db.rsis 0, ortests/app/support.rsstill callscreate_databaseper test. Converge: copy from.offrails/template/app/src/kernel/db.rsthe functions fromdrop_idle_stale_test_databasesthroughTEST_RESET_SQL(keep the app's own changes to the rest of the file), and replace intests/app/support.rseverything frompub struct DbGuardtoimpl TestApp {with the template's (DbGuard,PgSlot,test_database,checkout_postgres_slot,test_db_prefix,fnv1a,migration_tag,database_url,lock_slot,ensure_template).TestAppkeeps itsdb_guardfield andon_sqlite(). If the app'ssupport.rscreates databases elsewhere (a second pool, a fixture), route it throughtest_database(). Copy the kernel test from the template'stests/app/kernel_test.rs. Thenapp task test_db_cleanup <admin url>once to drop the oldtest_<crate>_<hex>leftovers. Prove it: the suite on Postgres twice (the second run creates no database:psql -Atc "select count(*) from pg_database where datname like 'test_%'"is unchanged), a test that runsMigrator::downstill passes, and the kernel test passes on both databases. - CSS check cache. Detect:
grep -c inputs_key src/kernel/css.rsis 0. Converge: portcss_warning,cached_warning,inputs_key,html_files_underand the test from the template'ssrc/kernel/css.rs. Prove it:cargo nextest run the_css_warning_is_recomputed_only_when. - Profiles. Detect:
grep -n split-debuginfo Cargo.toml. Converge: remove that line from[profile.dev]and add the Linux[target.'cfg(target_os = "linux")']block from the template's.cargo/config.toml. Prove it:cargo build(and on Windows, a build that no longer stops at-Csplit-debuginfo). - CI. Detect:
.github/workflows/ci.ymlhas separatesqliteandpostgresjobs. Converge: replace them with the template'stestjob (keep the app's own extra steps, such as the TS steps, afterverify), and take theDockerfile's dependency layer (renameoffrails_appto the crate). Prove it: the workflow is green on the next push and itstestjob shows one compile.
- The verify command. Detect:
-
Generators you run, not recipes you copy:
cargo offrails generate <kind> …(g) andcargo offrails destroy <kind> <name>(d) (generators). The human: "can we add actual code generators similar to rails? so the agent can invoke those instead of just copying? like db migrations, new controller, new api route, new page, and especially the parts… i hope this would make things even faster." Kinds:migration(create_x/add_y_to_x/remove_y_from_x/ blank, each with a workingdown),model(migration + entity +Params→validate()→New+ scoped queries + factory + model tests),resource(aliasscaffold: the model plus htmx CRUD with the seven actions, forms that re-render with errors and the input, flash, nav link, request tests),controller,page,api(/api/v1with bearer tokens and scopes,ApiJson,{"data": …}+ page info, OpenAPI via utoipa with a drift test, and the API kernel on first use),job,mailer(HTML + text, previews),channel(a realtime topic with authorization) andtest. Field types:string text integer bigint boolean decimal{p.s} money datetime date uuid json references{model}with?/:optional,:unique,:index, each mapped to its column, Rust type, form control, validation and factory value. Generated code follows the guides exactly: 64-bit ids and FKs (offrails-check [ids]), per-user scoping when the app has accounts (find_for, rawfindmodel-private, another user's id is 404, unique-per-owner indexes, references checked against the actor),Accessrows,paths::helpers, docs/routes.md,#[instrument(skip_all)]on every action and model fn, nounwrap/expectoutside tests, templates in the design tokens with everydark:partner, and request tests for happy paths, 422s, sign-in, tenancy (guard_test.rs+ an anchoredtenancy_test.rs), escaping and the N+1 guard, on SQLite and Postgres. Without accounts,model/resourcerefuse until you add them or pass--public.- Safe to run: everything is rendered in memory first (a missing anchor is a refusal naming the file and spot; nothing written),
--dry-runprints the plan, re-running is a no-op,--forceregenerates only over files nobody changed, anddocs/generated.tomlrecords each generation (arguments, choices, formatted-file hashes) sodestroyremoves exactly the unchanged files and wiring and reports what it kept.rustfmtruns afterwards; next steps are printed (migrate, Tailwind,cargo offrails verify --fast, what to customize: the// APP:lines). - Parts are first-class in the same CLI:
cargo offrails parts(alias oflist-parts),cargo offrails add <part>(alias ofadd-part), and newcargo offrails update-part <part>… --framework <newer>: a three-way merge per file (the part as installed in.offrails/, the newer part, the app's copy): clean hunks apply, overlapping edits get<<<<<<</|||||||/=======/>>>>>>>markers and exit 1, changed wiring is swapped where the old text stands; an app change is never silently overwritten.add-partandnewnow refresh docs/routes.md (the firstoffrails-checkno longer warns[routes]). - Measured (macOS, Apple silicon, 8 cores, load average ~20 from other agents, cold target dir, warm crates.io cache): a blog-equivalent built only with generators (
new --parts auth-core,auth-magic-link,jobs, theng resource posts title:string slug:string:unique body:text 'published_at:datetime?',g page about,g mailer post_mailer published,g job notify_post_published post_id:bigint --queue mailers):new8 s, the four generators 4 s, then green on SQLite after 200 s (the first compile; 357 tests in 4.8 s) and on Postgres 9 s later (7.7 s),offrails-check0 errors: 221 s from nothing to green on both databases. The generators wrote 1,865 lines in 38 files (migration, model with validation and scoped queries, controller, views, 5 templates, routes, factory, model/request/tenancy/guard tests, page, mailer with previews, job), with 24// APP:decisions marked. The 0.7.1 blog's hand-written equivalent of those files was ~2,100 lines; what an agent still writes for that blog is the domain on top (public reading by slug, publish/unpublish, slug from the title, excerpt and reading time, Markdown, the feed, the mail's words, enqueueing the job in the publish transaction, the spec's own tests): roughly 700–900 lines, by the blog's own counts. - App migration: existing apps get the generators by re-vendoring (
.offrails/tools/offrails-gen);cargo offrails g --helpworks at once. Then:- Detect the anchors generators need:
grep -n "samples: \(model mods\|model aliases\|controller mods\|view mods\|routes\|paths\|routes table\|test mods\|factories\|migration mods\|migrations\)" src/models/mod.rs src/controllers/mod.rs src/views/mod.rs src/routes.rs tests/app/main.rs tests/app/factories.rs migration/src/lib.rs(andnav linksintemplates/shared/_nav.html,sitemap pathsinsrc/controllers/meta.rs,test supportintests/app/support.rs). Converge: add each missing one on a line of its own where new.md#anchors says; a generator that lacks one refuses and names it.migration/src/lib.rsrewritten bysea-orm-cliis healed automatically; from now on generate migrations withcargo offrails g migration, neversea-orm-cli migrate generate. - Detect
tests/app/smoke_test.rs/security_test.rssweepingROUTESwithapp.post_formfor every non-GET row. Converge (needed beforegenerate api, whose routes usePATCH/DELETE): copyTestApp::request_methodandsend_jsonfrom.offrails/template/app/tests/app/support.rsintosupport.rs, and send each row's own method (other => app.request_method(other, &path).await) as the template's two tests now do. (generate apiinsertssend_jsonitself when it's missing.) - Detect a hand-written
tests/app/tenancy_test.rswithout// samples: tenant fill. Converge: nothing required;generate resourcethen prints theTenant/filllines to add for each new resource (or replace the file with the generated one, keeping yourEXPECTEDrows). - Agents: build features with generators from now on (AGENTS.md prime directive 2; workflow loop step 3). Log in
docs/decisions.md:YYYY-MM-DD: generators adopted (framework 0.7.2): new features start from cargo offrails generate.
- Detect the anchors generators need:
- Changed docs: generators/README (the command table, field types, what generators decide), new migration, controller (and pages), api recipes; scaffold, job, mailer (sends from a job with
state.mailer.deliver, no nonexistentdeliver_later), channel start with the command; new (build features with generators after the parts; generator anchors), upgrade (step 6:update-partbefore re-vendoring), AGENTS.md (prime directive 2: generate before hand-writing), CHEATSHEET, workflow (PLAN/GENERATE), RAILS_MAP (rails generate↔cargo offrails g,rails destroy), cli, structure, template, thegenerateandscaffoldskills. - Template:
TestApp::request_method(the route sweeps send each row's own method) andTestApp::send_json(JSON with headers, no cookies). - CI:
tools/ci/test-template.sh generatorsgenerates every kind into a bare app (a--publicreferences chain, a resource with every field type, page, controller, migrations) and into an app with every part (scoped resources, api, job, mailer, channel, model, test), runs fmt, clippy, the suite on SQLite and Postgres and offrails-check, re-runs every generator (no-op), destroys everything in reverse and checks the app is byte-for-byte the baseline;update-partmerges a synthetic newer part cleanly and then reports a conflict with markers.offrails-genhas golden files for every generator (tools/offrails-gen/testdata/golden/,UPDATE_GOLDEN=1 cargo test golden).
- Safe to run: everything is rendered in memory first (a missing anchor is a refusal naming the file and spot; nothing written),
-
A browser smoke for boosted navigation: every page must work after a boosted link, not only on a fresh load (frontend-htmx, testing). The layout boosts every link, and a boosted click swaps
<body>and runs nothing from the next page's<head>;DOMContentLoadednever fires again. The sign-in page's password Show button worked on a direct load and was dead after clicking through to the page:auth.jsloaded in the page's{% block head %}. Request tests and screenshots can't see it..offrails/tools/browser-smoke/smoke-boosted.mjs: for each GET route indocs/routes.mdwithout a parameter that is a boosted HTML page (kernel pages, JSON and streams are skipped and listed; a route that redirects smokes the page it lands on), it clicks the page's live elements after a full load and records which react (DOM or attribute change, print, copy, dialog), then loads/, follows a boosted link to the page and clicks them again. It fails on an element that is dead after the boosted link, on a script or stylesheet the page loads in its own<head>, and on any console error, uncaught exception or CSP violation on either path. With password sign-in it runs signed out, then signed in as the demo account. Zero dependencies: Node ≥ 18 and the installed Chrome, Chromium or Edge (CHROME_PATH, else the usual places on macOS, Linux and Windows), driven over the DevTools Protocol on a pipe; it never downloads a browser. Without one it printsskip: no Chromeand exits 77.- The live-element convention: every element page JS reacts to on click is a
<button type="button">or carriesdata-js(ordata-toggle,role="button"), and the JS binds by delegation ondocument. cargo offrails verify --fullwithBASEset runs it asbrowser smoke (boosted)beside the kernel-page smoke; exit 77 is reported asskip, never passed (Step::skip_on, with a test).run.shis POSIX sh now and hasrun.sh boosted.- Template: the layout has a
samples: app headanchor (a part's scripts load on every page),static/app.jsstates the rule, andtests/app/smoke_test.rshas two static guards:app_pages_load_no_scripts_or_stylesheets_in_their_head_blockandpage_scripts_never_bind_only_on_dom_content_loaded. - Parts: the parts synced from samples ee71024 load their page scripts at
samples: app head(auth-core'sauth.js, realtime'schannels.jsandlive_room.js, the dev-dashboard's browser beacon) instead of page head blocks; that wiring needs the anchor above. - CI:
tools/ci/test-template.shserves the bare and the all-parts apps (development, their own SQLite file, the demo account seeded) and runs the smoke against them; without Chrome or Node the summary saysbrowser smoke SKIPPED. The framework's CI runstools/browser-smoke/selftest-boosted.mjs, which serves a tiny htmx site and proves the smoke passes a delegated Show button and fails a head-block script binding onDOMContentLoaded, a layout script binding onDOMContentLoaded, and a console error. - Measured (M2, load 13–25): the all-parts app, 18 page visits signed out and in, every Show and Copy button on the auth pages clicked on both paths, 25–28 s; the bare app (one page,
/) 4.7 s; the selftest's four cases 25 s. Reintroducing the bug in an all-parts app (auth.js back insessions/new.html's head block) fails it with/session/new (signed out): loads /static/auth.js in its <head>…andbutton[data-reveal="signin_password"] "Show password" reacts on a full load and is DEAD after a boosted link; putting it back passes. - App migration:
- Page scripts. Detect:
grep -rln "{% block head %}" templates | xargs grep -l "<script\|stylesheet", andgrep -rln DOMContentLoaded static --exclude-dir=vendor. Converge: move each page's head-block<script>/stylesheet intotemplates/layouts/application.html(afterapp.js; add{# samples: app head #}on a line of its own there if missing), digested throughctxlikeapp_js; rewrite a script that binds elements onDOMContentLoadedas delegated listeners ondocument(e.target.closest("[data-…]")), or also start it onhtmx:load. For the auth and realtime parts,cargo offrails update-part auth-core(andauth-password,auth-totp,realtime) brings the samples' fix. Prove it: copy the two tests from the end of.offrails/template/app/tests/app/smoke_test.rs(withfiles_with_extension) intotests/app/smoke_test.rs; both pass. - The smoke. Re-vendor (the upgrade does). Prove it: with
bin/devrunning,BASE=<its URL> node .offrails/tools/browser-smoke/smoke-boosted.mjsends with0 failure(s)(seed the demo account first withcargo run -- task auth_demowhen the app has password sign-in). LogYYYY-MM-DD: page JS loads from the layout and binds by delegation (framework 0.7.2, boosted navigation)indocs/decisions.md.
- Page scripts. Detect:
0.7.1 (2026-10-17)
What's new
- New apps start from a tested template.
offrails-gen newcopies a complete, compiling htmx app (the whole kernel, tests, CI, Dockerfile and compose) instead of an agent retyping it from Markdown. A fresh app is green on SQLite and Postgres in 2 min 53 s, most of it the first compile. - Parts: the mailer, dev mailbox, jobs, jobs dashboard, sign-in methods, realtime and dev dashboard ship as installable parts. The agent proposes the ones the product needs, and
cargo offrails add-part <name>adds one later (it changes nothing if an anchor is missing).cargo offrails list-partsshows what is installed. - Cross-platform tooling:
offrails-genis a standard-library-only Rust tool, sonew,add-part,list-partsandvendorrun the same on Linux, macOS and Windows. - Lean memory defaults: 2 worker threads, 16 blocking threads and a smaller SQLite pool and cache. A bare release build uses 15 MiB after 1000 requests, and CI fails a build over its memory budget.
- Tracing spans by default on template actions, so the dev dashboard's traces work out of the box.
- Upgrades can diff the old template against the new one to see every kernel change in a release.
Breaking changes
None. Existing apps keep working; the template alias, the memory settings and the parts are optional to adopt.
Upgrading
Optional: the App migration note at the end of the first entry below (compare with the template, add the cargo offrails alias, the memory settings). The whole procedure is in upgrade.
Full list of changes
-
New apps start from a tested template, not from Markdown retyped token by token (template, new). The framework now ships its app skeleton as real files:
template/app/is a complete, compiling app (htmx) with the whole kernel (config, errors, the security header matrix and CSP, CSRF, cookies and flash, the development Host allowlist and 127.0.0.1 bind, rate limiting, log and error-text redaction, SQLite + Postgres pools with per-test Postgres databases, introspection,/devwith the pending-migrations guard, the theme switch, direct TLS), the layout, error pages, Tailwind,bin/, the migration crate,tests/app/with every kernel suite,deny.toml, CI, Dockerfile and compose, and everysamples:anchor. It was the samples repo'shost/, proven on both databases, and the framework's from now on. Building the skeleton from 0.7.0's Markdown cost an agent 50+ minutes; generating it takes seconds, and a fresh app is green on SQLite and Postgres in 2 min 53 s from the generator's start (5 min 46 s with every part; macOS, Apple silicon, 8 cores, cold target dir, warm crates.io cache), most of it the first compile. The human's decision: "add the full skeleton as templates… we are not a codeless framework anymore but it's fine." The guides stay the spec for why; doctrine §7 is rewritten to match: agents copy the template, adapt it and own it; humans still write no code.- How: after the interview,
cargo run -q --manifest-path "$FW/tools/offrails-gen/Cargo.toml" --target-dir <dir>/target/offrails-gen -- new <dir> <crate_name> "<Display Name>" --pitch "<line>" --parts <a,b>(orsh "$FW/tools/new-app.sh" …). It copies the template, renames its tokens (offrails_app,offrails-app,Offrails App), vendors.offrails/, writesAGENTS.mdandproduct/README.mdfrom the blueprints, adds the parts, runscargo fmtandgit inits. - Parts, proposed by default. The base is lean: no job queue, mailer, accounts or realtime. Those are parts, the samples from rust-off-rails/samples vendored into the release (
template/parts/). The agent proposes the ones the product implies, using a decision table (template → choosing parts:dev-dashboardfor every app,mailer+dev-mailboxfor email,jobs+jobs-dashboardfor slow or scheduled work,auth-core+ a method for sign-in,realtimefor pushed updates), shows the human the samples link (screenshots of every screen), and the human confirms or opts out. This flips 0.7.0's head start, whose recommended answer was "build from the guides": a real run of a blog skipped every sample because of it. - Easy to add later:
cargo offrails add-part <name>in any template app (the alias in.cargo/config.toml), with dependencies first, checks before changes (a missing anchor or a conflicting file refuses and changes nothing), thedocs/decisions.mdline, theAGENTS.mdheader (EMAIL,ACCOUNTS),cargo fmt, and the exact next steps. Re-running is a no-op.cargo offrails list-partsshows installed vs available. It is the samples'tools/install.shmechanism in Rust (same format, same record line), andnew --partsuses the same code path. workflow and every guide with a part (mailers, jobs, jobs-dashboard, auth, channels, realtime, dev-tools, errors-and-logging) now say: when the product grows the need, add the part; checklist-partsbefore hand-writing kernel code. - Cross-platform generators.
tools/offrails-genis a standard-library-only Rust tool (new,add-part,list-parts,vendor), so it runs the same on Linux, macOS and Windows: nosed -i, paths throughstd::path, CRLF kept where a file has it. The template and the framework carry.gitattributes(* text=auto eol=lf). The app'sbin/scripts andoffrails-checkremain POSIX shell; Windows steps and the known gaps are in template → Windows. - Lean memory defaults, measured.
mainbuilds the Tokio runtime fromConfig:APP_WORKER_THREADS(default 2) andAPP_BLOCKING_THREADS(default 16) instead of one worker per core and 512 blocking threads; SQLite getscache_size1 MiB per connection, a default pool of 4 (DATABASE_POOL; Postgres keeps 10) and a 60 s idle timeout (database, config).tools/ci/memory-budget.shboots a release build in production mode, serves 1000 requests and fails over budget. Measured on macOS (Apple silicon, 8 cores): bare, release, 14 MiB RSS after boot and 15 MiB after 1000 requests (debug 16 / 17); every part, release, 18 / 20 MiB (debug 24 / 26). With the old thread and pool settings the same runs were 16 and 21 MiB after load: the saving is small on an 8-core laptop and grows with the core count. Budgets: 24 MiB bare, 32 MiB with every part. - Spans by default. Template actions carry
#[tracing::instrument(skip_all)], and the guides make it the convention for actions and model fns, with the rule "never put secrets or personal data in span fields" (errors-and-logging), so the dev dashboard's traces work out of the box. - Upgrades: an app can diff
.offrails/template/app(old) against$FW/template/app(new) to see every kernel change of a release, as a reference to port, never an overwrite (upgrade); step 7b now offers parts and adopts them withadd-part(upgrade).offrails-gen vendor --framework "$FW"re-vendors on any OS. - CI:
tools/ci/test-template.shgenerates the bare app, the app with every part (every sample installed into a fresh template app), and a bare app with each part added afterwards and then added again (which must change nothing), then runs fmt, clippy (with the no-unwrap/expectgate), the suite on SQLite and Postgres,offrails-checkand the memory budget. The framework workflow runs it (template), plustemplate-os: Linux, macOS and Windows generate, build, lint and run the SQLite suite, bare and with every part.test-install.shchecks the release carries the template, the parts andoffrails-genwithout build output; shellcheck covers the new scripts.tools/sync-parts.shrefreshestemplate/parts/from a samples commit (recorded intemplate/parts/SOURCE). - Changed docs: new (generate, then fill the header, parts, verify; a reference of what the template contains, including the anchors table), interview (parts in the plan), samples, upgrade, workflow, doctrine, database (points at the template's
db.rsinstead of a copy), config, README, AGENTS.md (prime directive 8), CHEATSHEET, cli, CONTRIBUTING,blueprints/AGENTS.md,/offrails:newand/offrails:feature. - Not yet: a
scaffoldtemplate (resources are still built from scaffold); full templates forinertia,spaandapi(new --modegenerates the htmx template and logs the conversion, per template → other modes); the guides other thandatabase.mdstill carry long excerpts of files the template ships (the template wins where they differ).
App migration (optional; no app needs to change):
- Existing apps keep working as they are. After re-vendoring,
.offrails/template/holds this release's template and parts. - Optional, compare:
diff -ru -x target -x .git -x .offrails -x storage .offrails/template/app .shows where the app's kernel differs from the tested template; port what you want as ordinary, tested changes (never copy a template file over an app file). - Optional, the alias: copy the
[alias]from.offrails/template/app/.cargo/config.tomlinto the app's.cargo/config.toml(and.gitattributesbeside it), thencargo offrails list-parts. An app generated from 0.7.0's guides may lack anchors or shapes the parts wire into;add-partnames each and changes nothing (samples → using one). - Optional, memory: add
worker_threads/blocking_threadstoConfigand build the runtime from them as the template'smain.rsdoes; set the SQLitecache_sizepragma and idle timeout inkernel/db.rs. Prove it withsh .offrails/tools/ci/memory-budget.sh . <budget>(Linux, macOS).
- How: after the interview,
0.7.0 (2026-10-16)
What's new
- Security fix: development is reachable only from this machine.
servebinds127.0.0.1in development (APP_BIND) and answers only local and configured host names (APP_ALLOWED_HOSTS), so another device on the network or a DNS-rebinding page can no longer open/dev(where the mailbox shows sign-in links). A newoffrails-check [bind]rule enforces it. - Signing in replaces the previous session: the old session in that browser is destroyed and its sockets and streams are closed.
- Emailed links are limited per address, with a cap of 20 emails per address per day for login and reset links.
- Unverified accounts can't be pre-hijacked:
users.email_verified_atstays empty until a link sent to the address is used, and that first use drops every session, API token and pending link set up before it. - Less leakage: job errors are stored redacted,
Config'sDebugprints only settings that can never hold a secret, and presence labels never come from an email address. - Samples: optional, tested reference code for the mailer, jobs, sign-in, realtime and a dev dashboard in rust-off-rails/samples. Upgrading offers them per area.
Breaking changes
- Every app: the development server must bind
APP_BIND(default127.0.0.1in development) and checkHost;offrails-checkfails with[bind]until it does. A dev container, tunnel or LAN workflow now needsAPP_BIND=0.0.0.0plusAPP_ALLOWED_HOSTS. - Apps with accounts: sign-in destroys the old session; reset and login links get per-address and daily limits; apps with signup (or both passwords and login links) add a nullable
email_verified_atcolumn, and a user's first reset after the upgrade also revokes their API tokens. - Apps with a manual theme toggle: the cookie is renamed from
themetooffrails_theme(read the old one for one release). - Every app also ports the security fixes: job errors stored redacted,
Config'sDebugas an allowlist, and (apps with channels) presence labels that don't come from the email.
Upgrading
Do the first entry's App migration (the development bind and Host check) first, then each entry's own App migration below. The procedure, including step 7b that offers the samples, is in upgrade.
Full list of changes
-
Security fix (P0): development was reachable from the LAN and through DNS rebinding. An independent review of generated apps found that
servebound0.0.0.0in every environment (cli said so) and nothing checkedHost./devhas no login: the mailbox shows every magic link and reset link, introspection shows the app's state, and/admin/jobsis open in development. So anyone on the same Wi-Fi could openhttp://<your-ip>:3000/dev/mailboxand sign in as you. A page onevil.examplethat re-points its own name at127.0.0.1(DNS rebinding) reached it too: the browser sendsHost: evil.examplesame-origin, so CORS doesn't apply, and Fetch Metadata sayssame-origin, so theCsrfLayerlets its POSTs through. Now, in development only (security, new non-negotiable 13):servebindsconfig.bind:APP_BIND, default127.0.0.1in development and0.0.0.0in production. A dev container setsAPP_BIND=0.0.0.0(config, deployment).kernel/hosts.rs(whole file in the guide, like Rails'HostAuthorization) answers onlylocalhost,127.0.0.1,[::1],*.localhost,APP_URL's host andAPP_ALLOWED_HOSTS(a leading.allows subdomains). Any otherHostgets a 403 page that says how to allow it. It's mounted right inside the security middleware (routing).- An unset
APP_ENVstill means development, butConfig::boot_warningsnow logs that at every boot. On a server it's a missing setting that mounts/dev. - New
offrails-checkrule[bind], with fixtures. It fails a literal0.0.0.0bind insrc/([0, 0, 0, 0],"0.0.0.0:…",Ipv4Addr::UNSPECIFIEDoutsideconfig.rs), aconfig.rsthat never readsAPP_BIND, and an app with no Host check. A0.0.0.0that isn't the server's bind ends its line with// not the server bind.
Also updated: new (steps 4 and 7 and the verify step), cli, dev-tools, the CHEATSHEET, the app
AGENTS.mdNEVER list,/offrails:security, andTestAppgainsget_with_headers/post_form_with_headers. Changed: the macOS port-collision note in cli. A127.0.0.1:$PORTbind succeeds while another process holds*:$PORT, because tokio setsSO_REUSEADDR; thenlocalhostover IPv6 may reach the other app. Verified on macOS 2026-10-16, solsofbefore starting still matters. The code is from an app generated from these docs, where the five new tests pass:development_refuses_a_rebound_host_name,development_answers_local_and_configured_hosts,production_and_test_answer_any_host,development_binds_loopback_unless_told_otherwiseandan_unset_app_env_warns_at_boot, plushosts.rs's two unit tests. The running server listened on127.0.0.1only, refused its LAN IP, answeredHost: evil.testwith 403 and printed the boot warning.App migration (every app; security, do it first):
- Detect:
sh .offrails/tools/offrails-checkprints[bind], orgrep -rnE '\[0, *0, *0, *0\]|"0\.0\.0\.0' srcmatches, orgrep -c APP_BIND src/config.rsis 0. - Converge:
- Add
bind,allowed_hostsandenv_defaultedtoConfig, withbind_address,parse_allowed_hosts,boot_warningsand their two tests, copied from config. Add theAPP_BINDandAPP_ALLOWED_HOSTSlines to.env.example. - In
main.rs, logboot_warnings()afterinit_tracing. Every listener bindsSocketAddr::new(config.bind, port): the main port,APP_DEV_HTTP_PORT, andkernel::server::runif the app has one. - Copy
src/kernel/hosts.rswhole from security, addpub mod hosts;, and mount it just insidesecurity::middlewareinroutes.rs. - Add the three request tests to
security_test.rs, andget_with_headers/post_form_with_headerstoTestAppif they're missing. - Anything that runs development in a container (a dev container, a compose override with
APP_ENV: development) setsAPP_BIND: 0.0.0.0, publishes on127.0.0.1:only, and lists any non-localhost name inAPP_ALLOWED_HOSTS. Production compose and the Dockerfile need no change: they setAPP_ENV=production, which binds0.0.0.0. - A
docs/decisions.mdline, a tunnel or a LAN workflow that relied on0.0.0.0becomesAPP_BIND=0.0.0.0+APP_ALLOWED_HOSTS=<name>in.env. Say so to the human: that network can then read the mailbox.
- Add
- Prove it: the suite on both databases, then with the app running in development:
lsof -nP -iTCP:$PORT -sTCP:LISTENshows127.0.0.1:$PORT(not*:$PORT);curl -s -o /dev/null -w '%{http_code}\n' -H 'Host: evil.test' $URL/devprints403;curl -m 3 http://$(ipconfig getifaddr en0 || hostname -I | cut -d' ' -f1):$PORT/upis refused; starting withAPP_ENVunset logsAPP_ENV is not set;sh .offrails/tools/offrails-checkshowsok [bind].
-
Security: signing in over a session now ends that session and closes its connections (auth, item 5). This came from the same review, applied to the samples' auth. On a shared computer, Ann signs in (password, magic link or reset) while Bob's session is still in the browser. The guide said "replace that session", and an app that only overwrote the cookie left Bob's session row alive, along with any copy of its token and his open sockets and streams, until the next revalidation. Now the sign-in transaction calls
session::destroyon the old session, which writes the session-ended signal. App migration (apps with accounts): Detect: the sign-in handlers (sessions::create,login_links::consume, the reset'supdate) don't takeOption<CurrentSession>, or set the new cookie without destroying the old session. Converge: destroy it in the sign-in transaction, beforesession::start. Prove it: a test signs in as A, opens a stream or socket as A, then signs in as B in the sameTestApp: A's connection getsbyerevoked, and A's old cookie, set back withset_cookie, is logged out. -
Security: emailed links are limited per address, with a daily cap (auth). Password reset requests were limited per IP only, so a flood from many IPs could fill one inbox without limit. Login links allowed 10 per 3 minutes per address, which is still 4,800 emails a day. Reset requests now get the per-address limit too (10 per 3 minutes), and both share a cap of 20 emails per address per day (
emails/day:{email}, a one-day window on the existing rate limiter). Over the cap it sends nothing and answers 429 like the other limits, which says nothing about whether the address exists. App migration (apps with accounts): Detect:grep -rn 'emails/day' srcfinds nothing. Converge: add the per-address key topasswords::createand the daily key to both handlers. Prove it:link_requests_are_capped_per_address_per_day: 21 requests for one address from different IPs (APP_TRUSTED_PROXY=true, variedX-Forwarded-For); the 21st sends nothing (drain_jobs, thensent_emails) and gets the 429 form, for a registered and an unregistered address alike. -
Security: claiming an unverified account (pre-hijacking) (auth). In
signup, anyone could register a victim's address with a password they know and set things up on the account, such as an API token. When the owner later got in by a reset link, the reset ended the sessions but not the token, so the attacker kept access. The same goes for an app that offers both a password and a magic link. Nowusers.email_verified_atstaysNULLuntil something sent to the address is used. The first proof (consuming a reset or a login link, accepting an invite) runsuser::claim_unverifiedin its transaction, and when that claims the account it drops every session, API token, pending link and mail redirect set up before. A link sign-in also clears the password. Magic-link-only and invite-only apps have nothing to claim. The rule comes from the samples'auth-core(claim_unverified_account), where cross-method tests prove it; it is new here as a spec. App migration (ACCOUNTS: signup, or an app with both passwords and login links): Detect:grep -rn email_verified_at migration/src src/models/user.rsfinds nothing. Converge: a migration adds the nullable column, backfilledNULL: never mark existing accounts verified, because that would bless an attacker's pre-registered one. A real user's first reset after the upgrade then also revokes their API tokens; tell the human. Addclaim_unverified, call it inpassword_reset::consumeandlogin_link::consume, and drop the pre-claim credentials ontrue. Magic-link first logins create users verified. Prove it:an_api_token_made_before_the_first_reset_is_revoked(apps with an API) ora_password_set_before_verification_dies_when_the_owner_signs_in_by_link(both methods), plus a second reset that keeps the tokens, on both databases. -
Security: job errors are stored redacted (jobs, errors-and-logging). From the samples' review: a failure message often quotes the URL that failed, credentials and tokens included (
https://deploy:hunter2@api…?token=…). The executor stored it injobs.errors, which/admin/jobsshows and searches andapp jobs showprints. Errors now go through the newkernel::redact::textbefore they're stored or logged. It redacts URL userinfo, random-looking path segments, secret-named query values andkey=valuepairs, and long random words. The whole file is in the guide, trimmed from the samples' host and tested on its own. App migration: Detect:grep -rn 'redact::text' src/kernel/jobsfinds nothing. Converge: addsrc/kernel/redact.rsfrom the guide, and callredact::texton the message in the executor's error push and itsjob.exceptionlog; existing rows stay as they are (offer the human a one-off task that rewriteserrorsthrough it, or let the Pruner age them out). Prove it:job_errors_are_stored_redactedon both databases. Not ported: the samples' search over redacted args. The framework's dashboard shows args unredacted, because secrets never go in args (rule 7), so searching raw args reveals nothing the page doesn't. -
Security:
Config'sDebugis an allowlist (config). From the samples' review of their dev dashboard's config page. The guide said to print[redacted]for three named fields, a denylist. The next secret someone adds (a Stripe key, a webhook signing secret) then went out in full on/dev/introspect.jsonandapp introspect. NowDebugprints values only for settings that can never hold a secret, andset/not setfor the rest. App migration: Detect:src/config.rs'simpl fmt::Debug for Configprints aStringorOption<String>field outside the allowlist with&self.<field>. Converge: printset/not setfor those. Prove it:debug_shows_no_secret_values(a sentinel in every non-allowlisted string field, none informat!("{c:?}")), thencurl -s $URL/dev/introspect.json | grep -c sentinelis 0 with a sentinel in.env. -
Presence never derives a label from the email (channels). Also from the samples' review. The guide's
member_forbuilt presence initials fromu.email, andann.lee@…→ "AL" tells a room who's there. Presence now uses a display name the person chose (or its initials), else a neutralMember <n>. App migration (apps with channels): Detect:grep -rn 'initials(&u.email\|initials(&user.email' src. Converge: derive it from the user's own name field, orMember <id>when there is none. Prove it: the presence test asserts no@and, for a user without a name,Member. -
Samples: optional, tested reference code (samples). The parts most apps need now exist as code that was built, tested on SQLite and Postgres, given a STRIDE threat model and reviewed adversarially, in a separate public repo, rust-off-rails/samples, tagged per framework release:
mailer,dev-mailbox,jobs,jobs-dashboard,auth-core,auth-password,auth-magic-link,auth-totp,realtimeanddev-dashboard. Each has a README (Adapting it, Do not change), a CHECKS.md whose every row cites a test, a PROMPT.md and asample.toml;tools/install.shthere installs one by its// samples: <anchor>comments. The framework stays Markdown and the guides stay the spec. A sample is never required and never vendored automatically, and an agent offers it and never imposes it. New: guides/samples.md (rules, how to adopt one, the anchors, what each sample adds); a Reference implementation (optional) note in mailers, jobs, jobs-dashboard, auth, channels, realtime, dev-tools and errors-and-logging; a head start question with the plan in the interview (default: build from the guides), and in new, the head-start path that takes the mailer, mailbox, jobs and dashboard from the samples (same profile, same rules). Sample anchors in new apps (new, step 13): one-linesamples: <anchor>comments in the shared files, each on a line of its own. rustfmt (1.99, checked) leaves a standalone comment in place, but carries a trailing one with its line:pub mod z; // samples: kernel modsmoves when themodlines are sorted. So anchors never trail code, and the step ends with a grep that proves it. The logging init is now a registry with thesamples: tracing layerslist, added throughsample_layers()as anOption: an emptyVeclayer silences every log line (found in the samples' host;an_app_without_sample_layers_still_logs, compiled with tracing-subscriber 0.3.23). One caveat, stated in the guide: samples are proven in the samples repo'shost/, which isnewwithout the mailer, mailbox and jobs kernel, plus a few pieces they build on (the theme switch,kernel/cookie.rs,kernel/redact.rs,Chrome::stylesheet), so adopting one may mean porting those first. App migration: nothing is required. Detect: every app. Converge: run upgrade step 7b (next entry). Add the anchors from new step 13 only if the human adopts a sample and you install it withinstall.sh. An app that keeps its owninit_tracingkeeps it; switch to the registry form only together with a sample that adds a layer. -
Upgrading to 0.7.0 offers the samples (upgrade, step 7b). This is optional, and the human decides each area. App migration (every app):
- Detect: the areas the app has: mailer (
ls src/kernel/mailer.rs src/mailers/mod.rs), dev mailbox (grep -rln '"/dev/mailbox' src), jobs (ls -d src/kernel/jobs), jobs dashboard (grep -rln '"/admin/jobs' src), accounts (theACCOUNTS:header line;password_digest,src/models/login_link.rs,totp), realtime (ls -d src/channels src/kernel/channels.rs), and a dev dashboard (grep -rn '"/dev/dashboard' src; usually none). - Converge: for each area found, read the sample's README and compare it with what the app has. Then, in the same message as the upgrade plan, tell the human in a sentence or two per area what the sample would add to this app, and what adopting costs. A mailbox with HTML, text and source views and a 320 px phone lint; jobs on the database with a dashboard that groups errors by root cause; accounts with TOTP, recovery codes, magic link + code and an account security page; channels with presence and authorization on every join; a LiveDashboard-style dev dashboard with traces, SQL with N+1 detection, a log tail and a routes explorer. Be enthusiastic where it's genuinely better and plain about the cost (files replaced, tables to reconcile, more code to own). Leave out what the app already does as well. Ask per area: adopt, borrow ideas or skip. Never replace working code without that yes, and in a non-interactive run install nothing: put the offer in the report.
- If adopting: one slice per sample, after the convergence slices. Use the samples tag that matches
.offrails/VERSION, install its dependencies first, and never copy a migration for a table the app already has (reconcile it). Port the sample's tests and its CHECKS.md rows into the feature spec's## Securitytable, keep its// SECURITY:markers, and delete the replaced code only once the sample's and the app's tests are green. Then the Definition of Done on SQLite and Postgres. - Prove it:
docs/decisions.mdhasYYYY-MM-DD: samples offered on upgrade to 0.7.0: <sample> adopted|borrowed|skipped, …. For each adopted sample, its tests run green in the app's suite on both databases, andsh .offrails/tools/offrails-checkpasses with its Security rows.
- Detect: the areas the app has: mailer (
-
Route sweeps skip reading SSE bodies (test-standards §3, new). Agents reported that the "every
ROUTESentry is routable" sweep and the access matrix hang forever on streaming routes (/streams/{stream},/socket/sse, a mailboxeventsstream):TestApp::getwaits for a body that never ends. Streaming routes now go throughTestApp::request_head, which is in theTestAppspec now with the reference signature(path, headers) -> (StatusCode, HeaderMap), chosen by aSTREAMINGlist next to the test, plus a check that everySse<…>handler is on that list. App migration (apps with SSE): Detect:cargo nextest run security_testhangs, orgrep -rn 'Sse<' srcfinds handlers that aren't in aSTREAMINGlist intests/app/security_test.rs. Converge: add the list and userequest_headfor those routes. Prove it: the security suite finishes on both databases. -
The theme cookie is
offrails_theme(views). The manual-toggle recipe saidtheme(light|dark, absent = system), and the samples' kernel pages useoffrails_theme=system|light|dark, so an app and its kernel pages could disagree. Now there's one cookie and one switch:offrails_theme, valuessystem|light|dark(anything else means system), notHttpOnly(the script writes it), exempted by exact name from the productionHttpOnlybackstop, with the server renderingdata-themeandcolor-scheme, andPOST /themewithout JS taking only a same-sitereturn_to. App migration (apps with a manual theme toggle): Detect:grep -rn '"theme"' src static/app.jsfinds the cookie name. Converge: rename it tooffrails_theme. For one release, also read the oldthemecookie when the new one is absent, so nobody's choice resets. Add the exemption and its production test. Prove it: the production cookie test, thenrun.sh a11yin both schemes with the switch forcing each. -
Doc gaps from agents, checked: (1)
newbuilds the mailer and jobs into every app. That's deliberate ("one profile", new) and stays, because the second feature of most apps needs one of them. What's new is the head start, which takes that kernel from the samples instead of from prose. (2) The mailers guide assumes jobs. True, and correct for every appnewmakes. mailers now says so, and says what to do without a queue (themailersample alone). (3) rustfmt moves anchor comments. Only trailing ones, and only with their line; anchors stand alone now (samples). (4) Node 22.12 vs 20.19.20.19is Vite 8's ownengines(^20.19.0 || >=22.12.0, checked in 8.2.2), not the stack's floor. stack and new now say that TS apps need ≥ 22.22, the smokes ≥ 22.12, and Node 24 LTS for both. App migration: none.
0.6.2 (2026-10-13)
What's new
offrails-checkcatches 32-bit ids ([ids]), which pass on SQLite and break every Postgres write, and test suites that never run on Postgres ([postgres]).bin/devmanages its own process: it writes a PID file per server, refuses to start twice on one port, and on exit stops only its own process tree. Agents stop a server withkill "$(cat storage/pids/…)".- Seeds can be re-run after a half-failed run: one transaction, each record found or created by a natural key.
- WebSockets sized for many sockets: smaller per-socket buffers took 10,000 sockets from 1.37 GB to 160–225 MB.
- Whole files in the guides for
kernel/tls.rsandkernel/introspect.rs, and a pattern for live boards over a channel (snapshot, patches, reducer). - Parallel helpers only after the skeleton compiles, each with its own files.
Breaking changes
offrails-checkfails on the new[ids]and[postgres]rules: an app with 32-bit ids adds a widening migration (never edits the applied ones), andtests/app/support.rsmust readTEST_DATABASE_URL.bin/devno longer usestrap 'kill 0'(it could kill the caller's shell); copy the new top of the script.
Upgrading
Each entry's App migration note below, then upgrade. This release also corrects the 0.6.1 steps in place.
Full list of changes
- Parallel helpers only after the skeleton compiles (workflow). A real migration (Fizzy → Rust off Rails, run in opencode) had three helpers writing the jobs executor, the jobs dashboard and the dev mailbox into one uncompiled crate at once. Each tripped over the others' half-written files, and two built stub crates in
/tmpjust to type-check their own part. Now: the coordinator builds the skeleton alone, up to the first greencargo checkand the baseline commit. After that it runs at most one helper per vertical slice, with each helper's files listed. Shared registries (routes.rs,mod.rsfiles,migration/src/lib.rs,Cargo.toml) stay with the coordinator, and a helper blocked by another's file stops and reports. App migration: docs only. Detect: the app'sAGENTS.mdor any decision line telling agents to fan out helpers on code before the tree compiles. Converge: drop it and follow the workflow rule. - Fixed (P0): 32-bit ids passed on SQLite and broke every Postgres write. A peer's Kanban (0.3.0 → 0.6.1) used
.integer()for ids and foreign keys. SQLite'sINTEGERis 64-bit, so the suite was green; on Postgres the columns wereINT4and every write that returned an id was a 500. Its tests had never run on Postgres:support.rshard-codedsqlite::memory:. Two newoffrails-checkrules, with fixtures:[ids]fails anid/*_idcolumn defined withinteger/small_integer/tiny_integer(helper orColumnDefchain, across lines,Alias::new("x_id")too) orpk_auto, and ani32/i16id field insrc/;[postgres]fails atests/app/support.rsthat never readsTEST_DATABASE_URL. A migration repaired by a later one carries// offrails-check: ids widened in m<…>(migrations, with thewiden_idstemplate, its SQL verified on Postgres 18). App migration: Detect:sh .offrails/tools/offrails-checkprints[ids]or[postgres]. Converge:[postgres]:TestApp::newper testing first, then run the suite on Postgres and fix what it finds.[ids]: never edit the applied migrations; addwiden_ids(Postgres only;ALTER SEQUENCE … AS bigintforpk_autotables), put the waiver comment in each repaired file, change entity fields toi64, thendb rollback --steps 1 && db migrateand the suite on both databases. - Seeds retry after a half-failed run. The same app's
seed_if_emptyreturned early when any team existed, so a seed that failed after the first team never ran again.tasks/seed.rsnow runs in onekernel::db::begintransaction and finds-or-creates each record by a natural key (cli; scaffold and new updated). App migration: Detect:grep -nE 'count|is_empty|exists' src/tasks/seed.rsgating the whole seed with an early return. Converge: one transaction, find-or-create per record; prove it by runningapp db seedtwice (no change) and after deleting one seeded row (it comes back). - One PID file per server; cli.md and the NEVER list now agree on how to stop one. cli.md said to stop
bin/devby its own process; the NEVER list and the hook saidlsof … | xargs killon the listener, which leaves cargo watch and Tailwind running. A peer's agent (dev-92, opencode) also broke the name rule withpkill -fand killed the human's demo: the hook that blockspkillexists only in Claude Code. Nowbin/devwritesstorage/pids/dev-<port>.pid, refuses to start when that PID is alive or the port is taken, and on exit stops only its own process tree (leaves first) and removes the file. A plainserveis started assh -c 'echo $$ > storage/pids/serve-<port>.pid; exec cargo run -q -- serve'(cargo runexecs the app, so the PID is the server's; verified). Stop either withkill "$(cat storage/pids/…)"(cli; the NEVER line, CHEATSHEET 14 and the hook message match). Also fixed: 0.6.1'strap 'kill 0' EXITsignals the whole process group, and abin/devstarted from an agent's shell isn't a group leader, so stopping it also killed the caller's shell (reproduced with a mock tree). App migration: Detect:grep -n "kill 0" bin/dev, orgrep -c 'storage/pids' bin/devis 0. Converge: copy the top ofbin/devfrom dev-tools (PID file, port check,cleanuptrap) and the app'sAGENTS.mdNEVER line fromblueprints/AGENTS.md. Prove it from a non-interactive shell: startbin/devin the background,kill "$(cat storage/pids/dev-$PORT.pid)", thenlsof -nP -iTCP:$PORT -sTCP:LISTENprints nothing, nocargo watch/tailwindcssof this app is left, and the shell that ran it is still alive. - Fixed:
bin/dev's Tailwind watcher overwrote the minified CSS with an unminified build. The watcher now runs with--minify, like the production build (verified with Tailwind 4.3.3: rebuilds after a template edit stay minified) (dev-tools). App migration: Detect:grep -n 'tailwindcss.*--watch' bin/dev | grep -v -- --minify. Converge: add--minifyto that line. kernel/tls.rsandkernel/introspect.rsare whole files in the guides, not sketches pointing at "the reference app's file", which an upgrading agent can't see. deployment has the fullHttpToHttpsacceptor with its four tests; dev-tools has the fullintrospect.rs(with// APP:marking the realtime part), the two handlers, theapp introspectarm andkernel::css::css_warning()for the banner. Both come from an app that implemented them from the 0.6.1 spec (axum-server 0.8.0, sea-orm 2.0.4), generalized.PubSubgainsstreams()for the introspection's realtime part. App migration: Detect: an app that wrote either file from the 0.6.1 sketch. Converge: diff it against the guide's file; adopt the guide's tests if yours has fewer. Nothing to do if they match.- Upgrade notes that fit apps without every feature (from the website's 0.6.0 → 0.6.1 upgrade: no accounts, no live pages, no pending-migrations page, no CSS banner). The 0.6.1 App migration steps below are corrected in place: step 11 is split into 11 (every app: 503 +
Retry-After, the pool'sacquire_timeout,AppError::Unavailable) and 11b (only apps with live regions:X-Live-Refreshand the gate), since its old detect matched every app; step 5 also detects an app with no CSS banner and says how to add one; step 6 exempts the dev routes from the pending-migrations guard only if the app has one; step 2's proof for apps without accounts isrun.sh a11y. upgrade gains the rule behind these (a step applies only where its Detect matches; otherwise it's n/a, with the reason, in the plan) and a preconditions paragraph. App migration: none; upgrades from 0.6.0 follow the corrected steps. - The browser smokes need Node ≥ 22.12, and now say so everywhere they're a proof (upgrade, the 0.6.1 steps, dev-tools). Fixed:
run.shonly checked the major version, so Node 22.0–22.11 passed the gate and failed inside puppeteer; it now compares major and minor. App migration: none (.offrails/is re-vendored). - The stale-CSS guard says to delete dead classes. It lists template classes with no CSS rule, and the guide only offered the
HOOK_CLASSESallowlist, so dead classes got allowlisted. Now, per class: delete it if nothing uses it, rebuild the CSS for a real utility, allowlist only JS/test hooks with a reason (test-standards §11; the template's failure message says the same). App migration: Detect: eachHOOK_CLASSESentry. Converge:grep -rn '<class>' static/*.js web/src testsfinds no use → remove the entry and the class from the template; updatetheme_test.rs's failure message. - WebSocket buffers sized for many sockets (from a peer's 10,000-socket run on 0.6.1).
kernel::channels::upgradesets.read_buffer_size(4 * 1024).write_buffer_size(0).max_write_buffer_size(256 * 1024)(plus message and frame size =max_frame); axum's defaults are 128 KiB each way per socket. Measured at 10,000 sockets: 1.37 GB → 160–225 MB, failed handshakes 17 → 0, fan-out p50 320–590 → 58–88 ms (channels; the methods checked against axum 0.8.9). App migration (apps with channels): Detect:grep -n 'read_buffer_size' src/kernel/channels.rsfinds nothing. Converge: add the five calls beforeon_upgrade; the wire tests must stay green (an oversized frame still closes the socket). - Fixed: forwarders replayed history after a restart. A row forwarder with a look-back window (outboxes, board events, chat rows written over HTTP) deduped with an in-memory set that starts empty, so its first poll after boot re-sent the whole window. Seed the set from the window at start (channels, with the test: 3 events of history, a restart, a 4th event → exactly the 4th is delivered). The pub/sub poller was never affected (it seeks to the end). App migration: Detect: a task that reads rows newer than
now - <window>(or the last K ids) and keeps aHashSetof sent ids, built empty. Converge: fill the set from the window in its constructor, before the first poll; add the restart test. - Live boards over a channel: snapshot, patches, reducer (channels). The pattern a peer measured at 10,000 watchers (p50 58–88 ms, zero re-fetches): the join's
ok.datais the snapshot and itsseqwithoutsince, orseq+ replayed patches with it; patches carry the final list order and go through one pure, idempotent reducer; actions stay HTTP POSTs, optimistic and confirmed by the channel; a JSON snapshot is polled while the socket is down. App migration: none (a pattern for new live boards); an existing board that re-fetches HTML per signal keeps working. - Load testing: the per-user cap explains "closed" counts. At 128 connections per user, N connections need ⌈N/128⌉ users; the
tools/loadgenspec now says so and requires the generator to print the cap as the reason for refused or closed connections (realtime, channels). App migration: none. - README: "~50 Markdown files", not ~30 (27 guides, 15 root docs, 8 generators, 4 blueprints). App migration: none.
0.6.1 (2026-10-13)
What's new
- Sign-in over dev HTTPS works again: development serves HTTPS only with a locally trusted (mkcert) certificate, and otherwise plain HTTP with a message saying why.
APP_DEV_HTTP_PORTserves plain HTTP beside TLS. - Dark mode that stays readable: a palette, layout skeletons and components checked with axe in both color schemes, plus guard tests for unpaired colors and for stale compiled CSS (also shown as a development banner).
- Hot reload and introspection: open tabs reload after an edit, and
/dev/introspect.jsonandapp introspecttell an agent the app's routes, config, migrations, jobs and realtime state. - The
offrailscommand is safe to script: every subcommand answers--helpwithout side effects, unknown flags exit 2, andnewandupgradenever start an agent from a non-interactive shell without--yes. - Realtime at scale (5,000 watchers on one box): pub/sub per stream, live regions rendered once per version, a gate so re-fetches can't starve user requests, and overload answered with 503 and
Retry-After. - Rate limits never extend a lockout, and
offrails-checkgains an[env]rule for variables missing from.env.example.
Breaking changes
offrails newandoffrails upgradein scripts or CI exit 3 without--yes(orOFFRAILS_YES=1).bin/dev-certno longer falls back to a self-signed certificate; without mkcert, development serves plain HTTP (or setDEV_CERT_SELF_SIGNED=1). Delete old certificates instorage/dev-certs.- A request timeout or an exhausted database pool answers 503 with
Retry-After, not 408. offrails-checkfails on a missing.env.examplevariable ([env]) and on a baren/aSTRIDE row.- New settings
APP_SHUTDOWN_DRAIN_SECSandAPP_DEV_HTTP_PORT; development allows 1000 attempts per rate-limit window.
Upgrading
The numbered App migration list (steps 1–16) at the end of this section, for 0.6.0 apps; older apps apply 0.6.0's steps first. The procedure is in upgrade.
Full list of changes
Fixes from a peer's Kanban on 0.6.0 (and its 5,000-watcher load test), from the website's upgrade to 0.6.0, and two agent-experience requests. Every app-facing fix is proven in the reference app (bookshelf) unless marked otherwise.
- Fixed (P0): login silently failed over dev HTTPS. 0.6.0's
bin/dev-certfell back to an openssl self-signed certificate when mkcert was missing. After "Proceed to localhost (unsafe)", Chrome dropsSet-Cookie: the magic link returned 303, the account was created, and the user bounced back to login. Our smoke missed it because it ran Chrome with--ignore-certificate-errors. Now dev serves HTTPS only with a locally trusted certificate:bin/dev-certuses mkcert and refuses (exit 3) when mkcert is missing or its CA isn't installed, unlessDEV_CERT_SELF_SIGNED=1;bin/devruns it on every start and otherwise serves plain HTTP/1.1, saying why, how to install mkcert, and that HTTP/1.1 limits live pages to ~6 tabs. It prints the exact URL with its scheme, again as✓ ready: …once the port answers (dev-tools). - Dev HTTP beside TLS (from a peer, verified in a stock Chrome profile and here):
APP_DEV_HTTP_PORT(development only) serves the same router andAppStateon plain HTTP next to the TLS port.bin/devsets it withDEV_CERT_SELF_SIGNED=1and tells the user to open the http URL; scripts keep h2 on the TLS port. - A bare
localhost:PORTon the TLS port no longer showsERR_INVALID_HTTP_RESPONSE:kernel/tls.rssniffs the first byte and answers plain HTTP with a 307 tohttps://(deployment). - Fixed:
new.mdstep 4.12 bound the port twice (bind_rustls(addr)after binding a listener). Bind once; the TLS branch usesaxum_server::from_tcp(listener.into_std()?)with the sniffing acceptor (verified with axum-server 0.8.0). - Browser smokes never ignore certificate errors. Every smoke in
tools/browser-smoke/launches Chrome with no certificate overrides and fails at a preflight on an untrusted certificate. New smokes:run.sh login(logs in through the real form, then proves a fresh page load is still logged in) andrun.sh a11y(axe-core 4.13.0, WCAG 2.2 AA, every path in light and dark). Verified: against a forced self-signed certificateloginandlive-tabsfail; over the http fallback and a trusted certificate both pass, andlive-tabsreaches 12/12 tabs over h2. The trusted-certificate run emulated trust with Chrome's SPKI pin, since installing a CA on the verification machine wasn't authorized (dev-tools, test-standards §9). - Fixed: dark mode shipped unreadable (
bg-whitewith nodark:partner under a body that turned dark: 1.09:1). views now has the palette (light/dark pairs per role), the skeletons (body, nav, flash, error summary, mailbox hint, lists, auth footers) and the component layer (.label,.input,.btn*,.link, which is now underlined because axe flags color-only links), all verified with axe in both schemes. The inertia and svelte snippets are fixed too. New guard-test templatetests/app/theme_test.rs(test-standards §11): (a) a light surface needs adark:bg-*; (b) dark text needs adark:text-*; (c) faint tones need adark:text-*. It reads the templates and@applylists. In the reference app it listed 75 unpaired tones, and with one partner removed axe failed dark at 1.07:1 while light passed. - Fixed: stale compiled CSS failed silently. A second guard in
theme_test.rschecks that every template class has its escaped selector instatic/app.css(skipped when unbuilt). The same check (kernel/css.rs) drives a development banner and/dev/introspect.json'scss.stale. In the reference app it listed the 67 newdark:classes until Tailwind ran.bin/devkeeps Tailwind in--watch. - Hot reload in development:
cargo watchrebuilds and restarts on Rust and template edits, Tailwind watches CSS, andstatic/dev-reload.jsreloads open tabs whenGET /dev/reloadchanges (boot id + newest mtime understatic/). It's a 1 s poll, not a held stream, because a stream per tab would eat the HTTP/1.1 connection budget. Measured: a CSS edit reached an open tab in 0.6 s, a template edit in ~17 s. The skeletonCargo.tomlgets[profile.dev] debug = "line-tables-only"andsplit-debuginfo = "unpacked": a peer measured template edits going from 16–23 s to 3.6–5.9 s; not reproduced in the smaller reference app (~5 s incremental builds either way). lldb loses locals; useCARGO_PROFILE_DEV_DEBUG=true(dev-tools). - Introspection for agents:
GET /dev/introspect.json(development only, absent in production and test, tested) andapp introspectreport routes, redacted config, migrations, jobs, realtime (signal subscribers, connections per member and transport, topics), assets, the browser protocol and CSS staleness. The workflow loop, the Definition of Done,cli.mdand the app'sAGENTS.mdtell agents to ask it before guessing (dev-tools). - Fixed:
offrails upgrade --helplaunched the upgrade agent (0.5.0 ignored upgrade's arguments; in 0.6.0,update --helpstill ran the installer andcheck --helpran the checker). Every subcommand now answers-h/--help(andoffrails help <command>) with its own help, exits 0 and does nothing else. Unknown commands and flags exit 2 with usage, andupdatevalidates installer flags before downloading.newandupgradenever start an agent from a non-interactive shell without--yes(orOFFRAILS_YES=1): they print the command they would run and exit 3. Exit codes: 0 ok, 1 error, 2 usage, 3 needs--yes, 10 upgrade due (INSTALL).tools/ci/test-install.shruns-hand--helpon every subcommand with fake agents on PATH and asserts none starts. --fwon an old CLI: an installedoffrailsolder than 0.6.0 silently ignores--fwand compares against~/.offrails/current. upgrade now says to run the target release's own script (sh "$FW/tools/offrails" upgrade --check --fw "$FW") oroffrails updatefirst.- Realtime at scale (measured by a peer: 5,000 SSE watchers on one box, 154 MB, fan-out p50 ≈ 40 ms; the database and rendering were the bottleneck, not streams). Pub/sub keeps one sender per stream (
pubsub.subscribe(&stream), swept when its last receiver goes), so a signal wakes only that stream's watchers. Hub revocations are keyed per member the same way. Shutdown ends every stream at once (SSE with nobye, so browsers reconnect and resume; socketsbye restart1012), then drains for at mostAPP_SHUTDOWN_DRAIN_SECS(5); on 0.6.0 it took 10–35 s with 5,000 streams. The drain is proven here: 2.1 s with a stuck connection and a 2 s bound (realtime). - Fixed: the thundering herd on live pages. Every watcher re-fetched and re-rendered the same fragment after a signal. With 5,000 watchers on one board, one card move cost ~5,000 renders, page loads took 12–25 s and requests timed out. Live regions many people watch now render once per stream version. Pub/sub keeps a per-stream version, bumped in
poll_oncewhere the committed row is observed, before the signal is sent (never at write time). The fragment handler caches the HTML in moka keyed(stream, version)withtry_get_with(single-flight), authorizes every request first, and filtered views bypass the cache. Measured after: GET 10–107 ms, move 10–264 ms, 0 pool-acquire warnings (realtime). - Live re-fetches can't starve user requests, and overload is 503, not 408. Live regions send
X-Live-Refresh, andkernel::live::gatecaps those requests to a third of the pool. The pool'sacquire_timeoutis 5 s, mapped toAppError::Unavailable. The request timeout answers 503, and any 503 getsRetry-After(realtime, errors). - Presence over SSE, for pages that already stream signals and only show a count. Each stream holds a join guard whose
Dropis the leave; people and tabs are counted; joins and leaves only mark a room dirty; one task publishes one label per dirty room every 250 ms. A connecting tab gets the current label at once. Without coalescing, 5,000 arrivals woke 5,000 receivers 5,000 times. Per process; multi-node needs the pub/sub table (channels). - No full reload after a mutation: move the DOM optimistically, then re-fetch the live region in place with
htmx.ajax(frontend-htmx). - Load testing spec (
tools/loadgen): N watchers, M mutations, per-event delivery latency, a presence assertion, and server RSS/fd sampling, with client CPU reported separately. Lessons: pick the target explicitly, cache sessions between runs, about 5,000 TLS+h2 streams per Node process, and never ignore certificate errors on login checks (realtime). Measured capacity is reported as reached, not guaranteed, with the open unknowns: 10–49 of 5,000 connections failed client-side on some restarts. - Rate limits never extend a lockout. The window is fixed from the first counted attempt and refused attempts aren't counted, so retrying while locked out doesn't push the unlock back. Development allows 1000 per window (test and production unchanged), decided once in
RateLimiter::new(config.env)and pinned by a test (security). n/athreats in the STRIDE table are written| <Category> | n/a: <why> | — | — |.offrails-checkaccepts that form, counts the rows, and fails a baren/a/none/—row or a named threat whose test is—(feature-spec).- Fixed: the Definition of Done's
.env.examplecheck never found a missing variable in configs that read through a helper (parse("PORT", "3000")); it only greppedvar("…"). It's nowoffrails-check's[env]rule: every"SCREAMING_SNAKE"literal insrc/config.rsmust be in.env.example, with fixture tests. In the reference app it sees 27 variables where the old grep saw 23.
App migration (0.6.0 apps; earlier apps first apply 0.6.0's notes; reconcile: detect → final shape → converge, one slice each, green between them):
- Run the check.
sh "$FW/tools/offrails-check"(new:[env], the n/a rule). After re-vendoring it'ssh .offrails/tools/offrails-check, and it must exit 0 at the end. Upgrading with an installedoffrailsolder than 0.6.0: detectoffrails versionbelow 0.6.0; convergeoffrails update, or runsh "$FW/tools/offrails" upgrade --check --fw "$FW". - Dev TLS: trusted or nothing. Detect:
grep -n 'openssl req' bin/dev-certfinds the unconditional fallback, orgrep -n 'DEV_CERT_SELF_SIGNED' bin/dev-certfinds nothing, orbin/devtests[ -f storage/dev-certs/cert.pem ] || bin/dev-cert. Final shape:bin/dev-certfrom realtime andbin/devfrom dev-tools. Converge: copy both, thenrm -rf storage/dev-certsso a 0.6.0 self-signed pair can't be reused. Prove it: without mkcert,bin/devprints the http fallback message;SCENARIO=tests/e2e/smoke.scenario.mjs BASE=<printed URL> bash .offrails/tools/browser-smoke/run.sh loginpasses. Apps without accounts (ACCOUNTS: none) have no login to prove: runrun.sh a11yagainst the printed URL instead (its preflight fails on an untrusted certificate, so a pass proves the browser trusts it). The smokes need Node ≥ 22.12 (Node 24 LTS recommended);run.shrefuses older. Never tell a human to click through a certificate warning. serve: one bind, drain, sniffing acceptor, dev http port. Detect:grep -n 'bind_rustls' src/main.rs, orgrep -n 'from_secs(30)' src/main.rs, or nosrc/kernel/tls.rs. Final shape: new step 4.12,kernel/tls.rs(deployment),Config.shutdown_drain(APP_SHUTDOWN_DRAIN_SECS) andConfig.dev_http_port(APP_DEV_HTTP_PORT, refused outside development) inConfigand.env.example; the CSRF layer trustshttp://localhost:<port>when it's set. Converge: writekernel/tls.rswith its tests, replace the branch, and add a config test for both variables. Prove it:curl -si http://localhost:$PORT/on the TLS port answers307.- Dark mode. (UI apps.) Detect:
grep -rLn 'dark:' templates/layouts templates/sharedlists files, orgrep -c 'color-scheme' templates/layouts/application.htmlis 0, or notests/app/theme_test.rs. Final shape: the palette, skeletons and component layer in views;kernel/css.rsandtheme_test.rsfrom test-standards §11. Converge: add the guards first and let them list the work (rule a/b/c with file:line), fix every template and@applylist, rebuild the CSS, then runrun.sh a11y(or the app's Playwright a11y suite) in light and dark. When the stale-CSS guard lists a class no rule exists for, first ask whether anything uses it: delete a dead class from the template (most are leftovers); rebuild the CSS for a real one; only a JS/test hook class goes inHOOK_CLASSES, with its reason. TS modes: apply the palette toweb/srccomponents and extend the guard toclassName=. - Stale-CSS banner (UI apps). Detect:
grep -rn css_warning srcfinds nothing (the app has no banner at all), orCtx.css_warningis onlyapp_css_problem(). Converge: addkernel::css::css_warning()and theCtx.css_warningfield, set only in development and rendered first in<main>, per dev-tools. - Hot reload and introspection (development only). Detect: no
/dev/introspect.jsoninROUTES, or nostatic/dev-reload.js. Final shape:kernel/introspect.rs, the twodev.rshandlers withROUTESrows (Access::Dev), both paths exempt from the pending-migrations guard if the app has one (grep -n 'fn guard' src/controllers/migrations.rs; an app without the development pending-migrations page has nothing to exempt, and gets the page only when it adopts dev-tools), the layout's{% if ctx.dev %}script tag,app introspectinmain.rs, and[profile.dev]inCargo.toml. Converge: copykernel/introspect.rsand the handlers from dev-tools (whole files since 0.6.2) and #hot-reload; add bothkernel_web_test.rstests: present in development without secrets, 404 in production and test. - Smoke scenario (Node ≥ 22.12 to run it). Detect: no
tests/e2e/smoke.scenario.mjs, or a scenario whoseloginposts withfetchinstead of the real form. Converge: exportlogin(page, base)(fill and submit the form),loggedIn(page),a11yPaths,a11yAuthPaths; runrun.sh loginandrun.sh a11yagainst the URLbin/devprinted. Without accounts: onlya11yPaths, and onlyrun.sh a11y. - Per-stream pub/sub (apps with signals). Detect:
grep -n 'tx: broadcast::Sender<Signal>' src/kernel/pubsub.rs, orgrep -rn 'pubsub.subscribe()' src. Converge: replacetxwith thetopics/prefixesmaps;subscribe(&stream)at every stream endpoint;hub.watch_revocations(pubsub.subscribe_prefix("member:"))inAppState::new;poll_oncedispatches per stream and sweeps; addtopic_count()and the per-stream and sweep tests (realtime). - Keyed revocations (apps with channels). Detect:
grep -n 'revocations: broadcast::Sender<String>' src/kernel/hub.rs. Converge: a per-key sender map, swept on unregister, plus the keyed wake-up test (channels). - Render once per version (apps with live regions). Detect:
grep -rn 'hx-trigger="sse:' templatesfinds regions whilegrep -n 'fn version' src/kernel/pubsub.rsandgrep -rn 'try_get_with' src/controllersfind nothing. Converge: addobservedandTopic.versionto pubsub, bumped inpoll_oncebefore the send;AppState.fragments; in each live region's GET, authorize first, thentry_get_with((stream, version), render), with?q=bypassing the cache; add the two test templates. - Overload is 503, not 408 (every app). Detect:
grep -n 'REQUEST_TIMEOUT' src/routes.rsfinds the timeout status, orgrep -n acquire_timeout src/kernel/db.rsfinds nothing, orgrep -n Unavailable src/error.rsfinds nothing. Converge:TimeoutLayer::with_status_code(StatusCode::SERVICE_UNAVAILABLE, …)plusmap_response(error::retry_after)outside it;opts.acquire_timeout(5s);AppError::Unavailableand itsFrom<DbErr>arm (pool timeout → 503 +Retry-After) (errors). 11b. The live re-fetch gate (only apps with live regions). Detect:grep -rlE 'sse-connect|hx-trigger="sse:' templateslists files andgrep -rn X-Live-Refresh templatesfinds nothing. No live regions: skip this step. Converge:hx-headers='{"X-Live-Refresh": "1"}'on live regions;kernel::live::gatewithrefresh_permitsandConfig.refresh_wait(realtime). - SSE presence (if the app counts viewers over SSE). Detect: a per-stream presence count that sends on every join or leave, with no flush ticker. Converge:
kernel/presence.rsper channels, with its tests. - Reload after a mutation. Detect:
grep -n 'location.reload' static/app.jsoutside thepageshowguard (anddev-reload.js). Converge: an optimistic DOM move, thenhtmx.ajaxinto the live region. - Rate limits. Detect:
grep -n 'fetch_add' src/kernel/rate_limit.rswith noloadcheck before it, anyexpire_after_update/time_to_idlein that file, orgrep -n 'RateLimiter::default()' src/state.rs. Converge: refuse before incrementing; keep expiry on create only; addRateLimiter::new(env),DEV_LIMIT = 1000andlimit()used bycheckandexhausted; add thekernel_test.rscases (development 1000 vs test/production 10; a short window that unlocks on time while hammered). - Specs and env. Detect:
grep -nE '^\|[^|]*\|[[:space:]]*(n/a|N/A|none|—)[[:space:]]*\|' product/features/*.md, or offrails-check's[security] … says "n/a" with no reasonor[env] .env.example is missing variable(s). Converge:| <Category> | n/a: <why it can't happen here> | — | — |(a real threat gets its test, never—); add each missing variable to.env.example(NAME=valueor# NAME=value); a non-env"SCREAMING_SNAKE"literal inconfig.rsgets// not an env var. - Scripts and CI calling
offrailsnon-interactively. Detect:offrails upgrade/offrails newin scripts or CI without--yes. Converge: add--yes(orOFFRAILS_YES=1); without it they now exit 3 and start no agent.
0.6.0 (2026-10-13)
What's new
- Live pages no longer stall past about 6 tabs:
servespeaks HTTP/2 over direct TLS, andbin/devserves HTTPS by default. tools/offrails-check(offrails check): a script that fails on an inconsistentAGENTS.mdheader, uncited acceptance criteria, feature specs without a STRIDE table, missing tenancy suites and unscoped lookups. It is the first step of the Definition of Done and of CI.- Tenancy enforced by the compiler and tests: with accounts, model lookups take the actor (
find_for,all_for,destroy_for), and every app with accounts getstenancy_test.rsandguard_test.rs. - Fixes from apps that shipped "green": a user locked out at about 5 tabs (connection cap 8, now 128), pages loading without htmx, a fresh database crashing
serve, and a logged-out stream redirecting instead of answering 401. offrails upgrade --check --fw <dir>checks or upgrades against any release and exits 10 when an upgrade is due.- Rules for weaker models: a
NEVERlist in the app'sAGENTS.md, a command for every Definition of Done item, and evidence before any retry, sleep or raised limit.
Breaking changes
- Direct TLS: new
APP_TLS_CERT/APP_TLS_KEYsettings,bin/dev-cert, andbin/devserving HTTPS unlessAPP_TLS=off. - Apps with accounts: raw model
find/destroybecomepub(in crate::models), so handlers must move to the scoped functions (the compiler lists every caller), and the two tenancy suites are required. offrails-checkruns first in the Definition of Done and in CI, and fails until the app passes it.- A logged-out request to
/streams/…answers 401, not 303 to the login page.
Upgrading
The numbered App migration list (steps 1–14) after the entries, for 0.3.x, 0.4.x and 0.5.0 apps, plus the instant-navigation note at the end. The procedure is in upgrade.
Full list of changes
Hardening from a 0.3.0 Kanban built by another agent that shipped "green" with three P0 defects. The rule this release follows: mechanical over prose. Each fix is a command that proves it, a template, a compile error or a failing check.
- Fixed: live pages stalled past ~6 tabs. Browsers allow about 6 HTTP/1.1 connections per origin across all tabs, and each live page holds one or two open (signals + socket). The 7th tab's stream, then its page loads, queued forever. Browsers only speak HTTP/2 over TLS, so
servenow does direct TLS with HTTP/2 (axum-server+ rustls, ALPNh2,APP_TLS_CERT/APP_TLS_KEY),bin/devserves HTTPS by default (bin/dev-certmakes a local certificate with mkcert or openssl;APP_TLS=offfor http), andAPP_URL's scheme follows. Measured in the reference app: HTTP/1.1 5 of 12 tabs updated; HTTP/2 12/12 and 40/40 (realtime). A multi-tab smoke ships with it (tools/browser-smoke/run.sh live-tabs). - Fixed: the per-user connection cap (8) locked a user out at ~5 tabs (429 on
/streams). It's 128 now: sized for tabs, still bounded. - Fixed: pages randomly had no htmx and the live badge stayed on "connecting…" (0.3.x apps).
assets()picked"vendor/htmx-"by prefix from aHashMap, which also matchesvendor/htmx-ext-sse-…; depending on iteration order a page got the sse extension twice and no htmx. Assets now use exact keys (vendor/htmx-2.), a test asserts each key matches exactly one file, and the catalog is built once at boot (frontend-htmx; CHEATSHEET gotcha 17). - Scoped lookups: with accounts, the public model lookups take the actor (
find_for(db, &user, id),all_for,destroy_for); rawfind/destroyarepub(in crate::models), so a handler can't compile an unscoped call (models). - Tenancy suites for every app with accounts (not just teams):
tests/app/tenancy_test.rsrequests every id route inROUTESwith another tenant's ids (404, or the status an AC specs), andtests/app/guard_test.rsfails on unscoped lookups in handlers. Both are templates in test-standards §4, generated byauthentication, extended byscaffold. tools/offrails-check(alsooffrails check): a POSIX script that fails on an inconsistent header (ISLANDS: yeswithoutUI_LIBRARY/web/,FRAMEWORKbehind.offrails/VERSION), any uncitedAC-…, a feature without the STRIDE Security table or naming a test that doesn't exist, missing tenancy suites, and unscoped lookups; it warns on a staledocs/routes.md. First step of the Definition of Done, in generated CI,/offrails:checkand/offrails:doctor. The framework's CI tests it against a passing tree and a failing fixture per rule.- Weak-model rails: a
NEVERlist atop the app'sAGENTS.md; a command for every Definition of Done item; evidence first (a retry, watchdog, reload cap,sleepor raised limit needs the captured failure and a decision line citing it);docs/decisions.mdlines are superseded, never edited; upgrades reconcile stale decisions.
From Railboard, a Kanban built by headless Claude on 0.5.0:
- Fixed: a fresh database crashed
serveat boot (no such table: broadcasts): realtime's pub/sub read its table before the pending-migrations page could render, andbin/devhid it by migrating first. Realtime now starts only once migrations are current (otherwise it waits like the worker and starts after the page's button runs them), and new apps get a fresh-database smoke (dev-tools, realtime). Reproduced and fixed in the reference app. - Fixed: a logged-out stream answered 303 to the login page.
EventSourcecan't follow it, so it retried forever, and the stream path became the after-login page./streams/andAccept: text/event-streamnow get the API flavor: 401, no redirect, noreturn_to(errors-and-logging). Fixed in the reference app. - Presence: every (re)join gets a snapshot that includes the joiner before any diff; the client buffers diffs until it arrives; reconnects jitter; after a restart, both clients must see each other within backoff + 1 s (channels).
/dev/sockets' frame log is specified (types, limits, where frames are recorded, tests) instead of only being promised.- Islands develop with
vite build --watch, never the Vite dev server: the dev CSP stays the production CSP, one origin over HTTPS (frontend-htmx).spadev serves the Rust app over http behind Vite's proxy. - Non-interactive agent runs (
claude -p,opencode run) stop every server they started before finishing, or the run never exits (cli). tools/brand/render.shworks without Chrome:rsvg-convertrasterizes the SVGs, else a neutral set fromtools/brand/default/is copied.- ts-rs without
.cargo/config.toml: per-type#[ts(export, export_to = …)]and#[ts(type = "number")]on everyi64(frontend-inertia). - Models rule 8: inserts that can hit a unique index use
on_conflict_do_nothing_on(..)(SeaORM 2.0.4TryInsertResult), never insert-then-catch (models).
From the website's upgrade to 0.5.0:
offrails upgrade [--check] --fw <dir>checks or upgrades against any release (a tag export, the plugin root), not only~/.offrails/current;--checkexits 0 when current, 10 when an upgrade is due (upgrade).- The Definition of Done and testing.md say what to do when localhost:5432 is taken: run the compose
dbon another port (DB_PORT=54329 docker compose up -d db) and pointTEST_DATABASE_URLat it; never stop someone else's Postgres.
App migration (0.3.x, 0.4.x and 0.5.0 apps; reconcile: detect → final shape → converge, one slice each, green between them):
- Run the check.
sh "$FW/tools/offrails-check"(before re-vendoring) lists most of the work below. After re-vendoring it'ssh .offrails/tools/offrails-check, and it must exit 0 at the end. - HTTP/2 + TLS. Detect:
grep -n bind_rustls src/main.rsfinds nothing, orbin/devhas noAPP_TLS. Final shape:Config.tls: Option<TlsFiles>fromAPP_TLS_CERT/APP_TLS_KEY(both or neither);servebranches toaxum_server::bind_rustls(crypto provider installed first, graceful shutdown through aHandle);bin/dev-cert;bin/devexports the pair unlessAPP_TLS=off; devAPP_URLishttps://with TLS; both vars commented in.env.example(new step 4.12, deployment). Converge:cargo add axum-server --features tls-rustlsandcargo add rustls --no-default-features --features aws_lc_rs,std, then the code. Prove:curl -sk -o /dev/null -w '%{http_version}\n' https://localhost:<port>/upprints2, andrun.sh live-tabspasses with 12 tabs. - Connection cap. Detect:
max_conns_per_user: 8. Converge: 128, and the cap test reads the configured value instead of a literal. - Assets (0.3.x). Detect:
grep -n 'vendor/htmx-"' src/kernel/assets.rs, or a catalog built per request (AssetCatalog::loadin an extractor). Final shape:ASSET_KEYSwith exact prefixes (vendor/htmx-2.,vendor/htmx-ext-sse-), the uniqueness test, the catalog inAppState(rebuilt per request only in development). Converge: per frontend-htmx. - Live-region workarounds. Detect: stall watchdogs, reload caps or reconnect retries in
static/app.jsadded for tabs that stopped updating. Converge: after step 2, reproduce withrun.sh live-tabs; if it passes without them, remove them and supersede their decision lines. Keep the 0.5.0pingwatchdog (it covers dead proxies, not tabs). - Scoped lookups (
TENANCYisn'tnone). Detect:offrails-check's[guard]lines. Final shape: the table in models. Converge: per model, addfind_for/all_for/destroy_for, makefind/destroypub(in crate::models), let the compiler list every caller, and move each to the scoped fn (tests read throughEntity::find_by_id, areload_<model>factory helper). Mark lines that are public by spec// unscoped: <AC id>. - Tenancy suites. Detect: no
tests/app/tenancy_test.rsorguard_test.rs. Converge: copy both from §4, fillTenant,EXPECTED(from the ACs),NOT_TENANT_IDS,fillandcall, register them intests/app/main.rs, then prove the suite bites (remove one policy check, watch it fail, restore). A failure here is a real cross-tenant bug: fix the handler, never the expectation, unless an AC says the route is shared. - Specs ↔ tests. Detect:
[ac]and[security]lines. Converge: write the missing tests; turn prose Security sections into the STRIDE table (feature-spec) with a real test name per threat; tick ACs whose tests pass on both databases. - Header. Detect:
[header]lines. Converge: makeISLANDS,UI_LIBRARYandFRONTEND_MODEdescribe the code that exists (record a decision if you change a mode), and setFRAMEWORKto.offrails/VERSIONafter re-vendoring. - Agent rails. Add the
NEVERlist fromblueprints/AGENTS.mdto the app'sAGENTS.md, addsh .offrails/tools/offrails-checkas the first step of the SQLite CI job (testing), and reconciledocs/decisions.md(upgrade step 8). - Boot on a fresh database (apps with channels or signals). Detect:
serveawaitspubsub.start()(orcluster::start) unconditionally. Converge: the gated start in realtime sharing the worker'swait_for_migrations; run the fresh-database smoke. - Logged-out streams. Detect: a logged-out
GET /streams/<x>answers 303. Converge:/streams/andAccept: text/event-streamtake theApiflavor inResponseFlavor::of; the stream auth test expects 401 with noLocationand no_return_tocookie. - Presence. Detect:
presence_here_framecomputed beforehub.track, or a clientPresencethat applies diffs beforehere. Converge: per channels; add the restart convergence test. - Islands (
ISLANDS: yes). Detect:localhost:5173in the dev CSP orbin/dev. Converge:vite build --watchinbin/dev, the manifest path in development, and the production CSP everywhere.
- Instant navigation recipe (
guides/frontend-htmx.md), gotcha from CI: wrapdocument.startViewTransitionso a transition skipped by a quick second click doesn't leave unhandledAbortErrorrejections (htmx drops the transition object); make the last boosted click win. App migration: apps that adopted the recipe: detectglobalViewTransitionswithout astartViewTransitionwrapper instatic/app.js; converge per step 6 of the recipe.
0.5.0 (2026-10-13)
What's new
- An accessibility gate: axe-core (WCAG 2.2 AA) on every route, in light and dark, on desktop and mobile, with a required
a11yCI job. - Less for agents to read: a two-page
CHEATSHEET.mdis the first thing to load, and every guide and generator opens with a TL;DR. - Robust live regions: no leaking
EventSources, apingheartbeat with a watchdog,hx-sync, a connection badge and one stream per page. - Instant navigation for content sites (optional): View Transitions, a CSS-only progress bar, a service worker and prefetch on intent.
- Repairing a migration: the repair's
downrestores the earlier schema, so a full rollback still works. - rustoffrails.org runs on the framework, with a hosted read-only MCP server at https://rustoffrails.org/mcp.
Breaking changes
None required. The docs now call the compose Postgres service db, so scripts that run docker compose up -d postgres should use db.
Upgrading
The App migration notes at the end of this section: nothing required; apps with a UI add the accessibility suite, and apps with live regions apply the live-region fixes. The procedure is in upgrade.
Full list of changes
Learned from real apps built by other agents and from a real upgrade: an accessibility gate in both themes, robust live regions (from a Kanban built with opencode), a context diet for agents (CHEATSHEET.md + a TL;DR on every guide), instant navigation for content sites, and a migration repair convention. rustoffrails.org runs it, with a hosted read-only MCP server at https://rustoffrails.org/mcp.
-
Docs: the Postgres compose service is
dbeverywhere (docker compose up -d db);fingerprint.shignores a.gitfile (worktrees, submodules); the Copilot pointer file has an exact body;generators/upgrade.mddefines a non-interactive path; the pre-deploy checklist requires green CI on the exact commit. -
Fixes from a real 0.3.0 → 0.4.0 upgrade (bookshelf, via
/offrails:upgrade):fingerprint.shand vendoring ignore the plugin cache's.in_use/marker; the error-pageapp.jssnippet is now shown in errors-and-logging; ZAP's "Suspicious Comments" gotcha; the 0.4.0 migration notes' detect lines for #2, #3 and #6 are greppable (andHX-Push-Urllives at the end oferror::shape_errors); the test-harness DB helpers are named (create_database,drop_database); a macOS ZAP variant; a deterministic first-login transaction test; the upgrade recipe adds a missing "Post-upgrade checks" section. -
Robust live regions (
guides/realtime.md), from a Kanban built with opencode + Muse Spark on 0.3.0: never reconnect by editingsse-connect(it leaksEventSources), the ~6-per-origin connection budget (one stream per page),hx-syncon live regions, a namedpingheartbeat event (+ a hiddensse-swap="ping" hx-swap="none"observer and a 60s watchdog), a connection-state badge, and thepageshowguard in the app layout. -
Context diet: a two-page
CHEATSHEET.md(stack, layout, naming, DoD, security non-negotiables, the 15 costliest gotchas, commands) is now step 0 of the load order, and every guide and generator opens with a TL;DR (what to do, what never to do, when to read the rest). Agents read a full guide only when the task touches it. No app migration. -
Accessibility gate (
guides/test-standards.md§10): axe-core (WCAG 2.2 AA) on every route, in light and dark, desktop and mobile; keyboard, motion and form rules; a requireda11yCI job. Lighthouse checks one color scheme only, which let a light-theme contrast bug through on rustoffrails.org. -
Instant navigation for content sites (
guides/frontend-htmx.md, optional recipe, from rustoffrails.org): View Transitions (cross-document + htmxglobalViewTransitions) with a fixed header, a CSS-only progress bar viahx-indicator, focus to the newh1after boosted navigations, a per-deploy versioned stale-while-revalidate service worker (precache, theme-cookie rewrite, offline page, never cachingno-store/cookie responses), and prefetch on intent. Optional; not for apps with per-user pages. -
Migrations: repairing an earlier migration: the repair's
downrestores the predecessor's exact schema, so full rollback works (guides/migrations.mdrule 2).
App migration: none required. If your app's docs or scripts say docker compose up -d postgres, use db.
Apps with a UI: detect no axe suite, or one that runs a single color scheme. Converge: add the §10 suite and the a11y CI job, then fix what it finds.
Apps with live regions: detect sse-connect attributes changed from JS, live regions without hx-sync, or a stream with no named ping event. Converge per "Robust live regions"; add the ping merge to the stream endpoint and the badge + watchdog to static/app.js; add the pageshow guard to the layout's script. Apps upgraded from 0.3.0 should double-check 0.4.0 note #5 (the first-login race: a caught unique violation aborts a Postgres transaction).
0.4.0 (2026-10-13)
What's new
- Realtime has its own wire protocol, offrails.v1: typed channels, self-describing JSON frames and stable error codes, replacing the Phoenix v2 format.
- Nothing is lost while a tab is disconnected: signals carry ids, pages render a cursor, and reconnects replay what was missed. Live regions also keep working after a boosted navigation.
- Automatic transport fallback: WebSocket, then SSE + POST, then long-polling.
- Connection security: logout, a password change or a revocation closes that session's sockets and streams at once; pushes are re-authorized, and each user has connection and join caps.
- Upgrade from any agent:
offrails upgradelaunches Claude Code, opencode or Codex with the agent-neutral upgrade recipe, and vendoring uses anchored excludes from a release tag. - Magic-link sign-in verified by a fresh agent's build, with its doc findings fixed.
Breaking changes
- Apps with channels: client and server must switch to offrails.v1 together; old clients get
byeprotocoland close 1002. Rooms become typedIn/Outenums. - Apps with SSE:
Signalgains anid, pages withsse-connectrender a?since=cursor, and the sse extension moves from a page's head block into the layout. - New settings
APP_REALTIME_REVALIDATE_SECSandAPP_REALTIME_TRANSPORTS. - Smaller fixes to adopt: raw SQL in controllers and tasks moves into
kernel::db, panics render the 500 page, the pending-migrations guard goes after the fallback, and/dev/mailersanswers 301.
Upgrading
The two numbered App migration lists below (realtime, steps 1–7; the Linkdrop fixes, steps 1–7) and the vendoring note. The procedure is in upgrade.
Full list of changes
Realtime gets its own wire protocol, offrails.v1: typed channels, sequence-based resume after downtime (WebSocket since, SSE Last-Event-ID), automatic fallback to SSE + POST and then long-polling, and connection security (logout or a password change closes that session's sockets and streams; per-user caps; re-authorized pushes). The security hardening was merged with it and re-verified end to end in the reference app (233 tests on Postgres, ZAP 0 warnings, cargo-deny, gitleaks, browser smoke). Apps can be upgraded from any agent with offrails upgrade (Claude Code, opencode, Codex) and the agent-neutral generators/upgrade.md; vendoring now uses anchored excludes from a release tag. The magic-link accounts variant is verified by a fresh agent's build (Linkdrop), and its 24 doc findings are fixed below.
Realtime: the Off Rails Wire protocol (offrails.v1), resume after downtime, transport fallback, connection security
Spec: guides/channels.md (protocol, transports, security), guides/realtime.md (resume). Verified in the reference app: 223 tests on SQLite and Postgres 18 (39 realtime: conformance, security, all three transports, a 3-node failover), two Playwright specs (a server restart with changes made while it was down; WebSocket → SSE → long-polling), and a two-context Chrome session.
- Fixed: signals sent while a tab was disconnected were lost (a deploy, a restart, a blip): live regions silently went stale. Every signal now carries its id; pages render a cursor (
?since=); reconnects replay what was missed (orrefresh);app.jscarries the cursor across htmx-ext-sse's reconnects. - Fixed: live regions were dead after a boosted navigation. The sse extension was loaded in a page's own
<head>, which a boosted swap never runs. It's in the layout now. - Our own protocol, offrails.v1 (replaces the Phoenix v2 array format): negotiated subprotocol, self-describing JSON object frames (
join/leave/push/pingup;ok/err/event/presence/pong/slow/byedown), stable error codes,byebefore every close,seqresume, WebSocket ping control frames instead of app heartbeats. - Typed channels: rooms declare
In/Outserde enums (#[derive(TS)]in TS modes); undeclared events are refused before the room runs. - Transport fallback: WebSocket → SSE + POST → long-polling, chosen automatically, remembered per tab, upgraded back when possible.
APP_REALTIME_TRANSPORTSlists what the server offers. - Connection security: logout, password change and revocation close that session's sockets and streams at once (4401), across processes and nodes; periodic revalidation closes expired sessions (
APP_REALTIME_REVALIDATE_SECS); pushes re-authorized against current state; per-user caps (connections, topics, joins/min); presence never carries emails; cross-site refused on every transport. /dev/socketsshows each connection's transport and a live decoded frame log (development only).
App migration (reconcile, don't re-create; apps without channels do steps 1–3 only):
- SSE resume. Detect
pub struct Signal { pub stream, pub event }insrc/kernel/pubsub.rs. Final shape:Signal { id, stream, event }(row id), pluspubsub::high_waterandpubsub::missed(realtime.md#kernel-spec). Converge: add the field (set it inpoll_once), add the two functions; inchannels::streamtakeQuery<StreamQuery>+HeaderMap, subscribe first, replaymissedwith ids (orrefresh), sendreadywith the cursor, add.id(sig.id)to live events, skip only exact replayed ids. No migration (thebroadcasts.idcolumn already exists). - Pages render a cursor. For every page with
sse-connect: readpubsub::high_water(&db)before the page's data and rendersse-connect="…?since={cursor}". Add thecreateEventSourceoverride and thebyelistener tostatic/app.js(realtime.md#client-side). Inertia/SPA: pass the cursor as a prop and use it in?since=. - The sse extension in the layout. Detect
htmx_sseinside a template's{% block head %}: move the script tag intotemplates/layouts/application.html(after htmx) and delete the block. Add the "every page loads the live-update extension" test. - Channels: switch client and server together (the formats are incompatible, and old clients now get
byeprotocol"subprotocol offrails.v1 required" + close 1002). Replacekernel/hub.rs,kernel/channels.rsandstatic/channels.js(orweb/src/lib/socket.ts) per channels.md; convert each room to typedIn/Outenums,joined(.., since)returningJoined,handle_in(.., msg: Self::In, out: &mut Outbox<Self::Out>)returningResult<Payload, Rejection>,out.emit(seq, …); rename events on the page (ch.channel(topic, { since }),ch.on("<out event>"),ch.push("<in event>"), errors are{code, message}).cluster.rsonly changesStringerrors toRejection. - Connection security.
Membergains#[serde(skip)] session: Option<i64>; addSessionAndUser;session::destroy/destroy_all_for_userwrite themember:<id>/session-endedsignal;AppState::newcallshub.watch_revocations(pubsub.subscribe())andhub.log_frames(is_development);Channelsgainssession_valid; the SSE stream ends withbyeonsession_ended. Config:APP_REALTIME_REVALIDATE_SECS(60),APP_REALTIME_TRANSPORTS(all), inConfigand.env.example. - Fallback transports. Add the four routes (
/socket/sse,/socket/sse/{conn},/socket/poll,/socket/poll/{conn}GET+POST) withROUTESrows, and the handlers callingkchannels::sse_open/relay_post/poll_open/poll_get. - Tests: port
support::Wsto offrails.v1, addwire_test.rsand the resume/session cases inkernel_pubsub_test.rs, andtests/e2e/realtime.spec.ts(channels.md#testing).
Upgrading apps from any agent
generators/upgrade.md: the upgrade recipe, agent-neutral (Claude Code, Codex, opencode, Cursor)./offrails:upgradenow runs it.offrails upgrade [--check]in an app: compares content fingerprints with the installed framework, then launches Claude Code (/offrails:upgrade), opencode or Codex with the recipe, or prints the prompt.offrails newsupports opencode too.- Vendoring: the
rsyncexcludes are anchored (/skills,/hooks,/evals,/brand…), sotools/brand/is kept, and--deleteremoves files dropped upstream. Vendor a release tag, never a moving working tree..github/is vendored on purpose, so fingerprints match the release.
App migration: none required. Next time you upgrade, vendor with the anchored excludes (generators/new.md step 1); tools/brand/ reappears in .offrails/.
Fixes from the Linkdrop build (a fresh agent, magic-link accounts)
kernel::db::ping(for/up) andkernel::db::drop_idle_test_databases(fortest_db_cleanup): no raw SQL outside the kernel.- Panics render the standalone 500 page via
CatchPanicLayer::custom(error::panic_response). - Pending-migrations guard is layered after the fallback, so unknown paths show the page too.
/dev/mailersanswers 301 explicitly (Redirect::permanentis 308).- Magic links:
consumeis one transaction returning user, session and token; first-login user creation usesON CONFLICT DO NOTHING(a unique violation aborts a Postgres transaction; a general rule in models.md);Option<CurrentSession>needsOptionalFromRequestPartsin axum 0.8; token pages sendCache-Control: no-storeandReferrer-Policy: no-referrer. The variant is now verified (168 tests, both databases, real browser). - htmx: a 422 re-render sends
HX-Push-Url: false, so the address bar keeps the form's URL. - Error pages load
app.js, so Forward from a 404 works; test-standards §9 checks it. - Tests:
wait_until(what, f: impl AsyncFn() -> bool);enqueuedreturns(job::Model, W); per-email rate limits are tested across IPs withAPP_TRUSTED_PROXY+X-Forwarded-For. - Docs:
#[rustfmt::skip]onROUTES; kernel pages use noconfirm()dialogs (data-confirmpattern for app pages); the e2e package arrives with the first critical flow; port checks withlsof -sTCP:LISTEN; direct TLS is added on first use; dates are UTC; guidance for interview answers relayed by another agent.
App migration (reconcile, don't re-create):
- Detect:
grep -rn "execute_unprepared" src/controllers src/tasks. Converge: move each intokernel::db(ping,drop_idle_test_databases) and call those. - Detect:
CatchPanicLayer::new()insrc/routes.rs, or aCatchPanicLayer::custom(|_| …)closure that ignores the panic payload or doesn't rendererrors/500.html. Converge:CatchPanicLayer::custom(error::panic_response), renderingerrors/500.html; add a test that a panicking handler returns the 500 page. - Detect:
migrations::guardis layered before.fallback(...)insrc/routes.rs(structural), or, with the app running and a pending migration,GET /no-such-pathreturns 404 instead of the pending page. Converge: applymigrations::guardafter.fallback(...). - Detect:
GET /dev/mailersreturns 308. Converge: return 301 explicitly. - Magic-link apps: detect a sign-up path that catches a unique violation inside a transaction. Converge:
on_conflict_do_nothing_on([Column::Email])+ select. Addno-storeandReferrer-Policy: no-referrerto the token pages, with a test. - htmx apps: detect a 422 re-render without
HX-Push-Url: false. Converge: set it once, at the end oferror::shape_errors(it sees every 422, whether a handler rendered it orAppError::Invaliddid, and covers future forms); add a request test asserting the header on a 422 from an htmx request. - Detect:
templates/errors/*.htmlwithout/static/app.js. Converge: add<script src="/static/app.js" defer></script>; extend the browser smoke with Forward from a 404.
0.3.0 (2026-10-13)
What's new
- Open source (MIT OR Apache-2.0), with a one-line install (
curl -fsSL https://rustoffrails.org/install.sh | sh) and theoffrailscommand (new,doctor,version,update,uninstall). - Security headers in one middleware (
kernel/security.rs), a__Host-session cookie in production, a STRIDE section in every feature spec, and CI that runs cargo-deny, gitleaks and a ZAP scan. - API-only apps and a public API:
FRONTEND_MODE: apiand anAPI: none | rest | graphql | bothheader line; REST under/api/v1with bearer tokens and OpenAPI, or GraphQL. - Svelte as a UI library, chosen with a new
UI_LIBRARYheader line. - Realtime channels: one WebSocket per tab, rooms with presence, an opt-in Postgres cluster layer, and faster signals (
NOTIFYon Postgres: 238 ms to 2.1 ms). compose.yamlruns the whole app, and every app with pages gets favicons, social cards,robots.txtand a sitemap from day one.
Breaking changes
FRONTEND_MODE: reactis renamedspa, and the app'sAGENTS.mdheader gainsUI_LIBRARYandAPIlines.- The production session cookie is renamed
__Host-session_token: deploying logs everyone out once. - The frontend type-check is
pnpm --dir web typecheck;web/package.jsonneeds atypecheckscript. - Every mounted route must have a
ROUTESrow (a new test fails otherwise).
Upgrading
Each subsection's App migration list below. The procedure is in upgrade.
Full list of changes
The open-source release. Rust off Rails is public at https://github.com/rust-off-rails/rustoffrails and installs with one line: curl -fsSL https://rustoffrails.org/install.sh | sh.
One-line install and the offrails command
install.sh(POSIX sh): shows its plan first,--dry-run,--yes; Rust via rustup (no sudo); sea-orm-cli, cargo-nextest and cargo-watch as prebuilt binaries via cargo-binstall; a SHA-256-verified framework release in~/.offrails/<version>with acurrentsymlink; installs the Claude Code plugin whenclaudeis present; prints the AGENTS.md prompt for Codex and Cursor. Idempotent, no telemetry. See INSTALL.md.offrails:new <name> "<pitch>",doctor,version,update,uninstall.- New apps also get
.cursor/rules/offrails.mdcand.github/copilot-instructions.md, pointing toAGENTS.md.
App migration: optional. Add the two agent pointer files above.
Open source
- Dual licensed MIT OR Apache-2.0;
SECURITY.md(GitHub private vulnerability reporting),CONTRIBUTING.md(contributions are intent plus evidence), Code of Conduct, issue forms ("Agent got stuck" first), and CI: links, hook tests, plugin validation, gitleaks, installer tests, OpenSSF Scorecard. - Brand: the
\R/derailing mark and the hopping "off" wordmark, drawn as code (brand/). - Doctrine §0, "All code is written by AI", is now the founding rule.
- Plugin:
/offrails:securityskill; hooks for security tripwires, banned crates inCargo.toml, append-only committed migrations, raw.begin(), and nopkill; content-fingerprint drift detection;/offrails:upgradereconciles instead of re-creating.
Security as the gold standard: Non-negotiables, the header matrix, automated enforcement
Spec: guides/security.md (Non-negotiables, the header matrix, Automated enforcement, Gotchas), plus blueprints/feature-spec.md (a ## Security STRIDE section), workflow.md, guides/test-standards.md §3, guides/testing.md CI, generators/new.md, stack.md, structure.md, guides/routing.md and guides/auth.md. Plugin: the /offrails:security skill and security tripwires in the hooks. Verified on the reference app (branch security): 207 tests on SQLite and Postgres 18; cargo-deny advisories/bans/licenses/sources ok; gitleaks clean over the history; ZAP baseline 0 FAIL, 0 WARN, 61 PASS; checked in Chrome.
kernel/security.rs, one middleware outside the panic and timeout layers:- the full header matrix, adding
object-src 'none', COOP and CORP to what was there; upgrade-insecure-requestsand HSTS only with an httpsAPP_URL;no-storeon every authenticated response;- production cookies forced to
Secure; HttpOnly; SameSite=Lax.
- the full header matrix, adding
- Session cookie:
__Host-session_tokenin production, and production ignores the plain name. - CI:
- a
securityjob (cargo-deny + gitleaks over the full history); - the Docker job boots the production image and runs the ZAP baseline;
- Dependabot.
- a
- Findings fixed:
- the flash cookie had no
Securein production; - authenticated pages were cacheable;
- panic 500s and timeout 408s had no security headers.
- the flash cookie had no
App migration (reconcile, don't re-create):
- Header middleware. Detect:
src/kernel/security.rs.- Missing: generate it per
guides/security.md#the-header-matrix. Inroutes.rs, replace the per-headerSetResponseHeaderLayers and theCSPconst with one.layer(from_fn_with_state(security::Hardening::new(&config), security::middleware))placed after (outside)CatchPanicLayer. - If a route sets its own CSP (the mailbox viewer), keep it. The middleware only fills in missing headers.
- Missing: generate it per
- Session cookie. Detect
PROD_COOKIEinkernel/session.rs. Missing: addname(secure)and makeread(headers, secure)accept onlyname(secure). Updatecookie/clear_cookie, theload_sessioncaller and any WebSocket upgrade that reads the cookie. Tests useksession::name(config.is_production()). Deploying logs everyone out once, because the cookie name changes. Say so to the human. tests/app/headers_test.rs. Add it (one row per response class the app has), plusTestApp::request_head. Production rows use anhttps://APP_URL. Make it fail first if the middleware is off.- Scanner configs. Add
deny.toml(copy the reference insecurity.md; keep any[bans]the app already has), withpublish = falsein both crates. Add.gitleaks.toml,.zap/rules.tsv(+.zap/.gitignore) and.github/dependabot.yml. Run each scanner locally. Fix findings, or triage them with a reason in the config. - CI. Add the
securityjob and the Docker job's boot + ZAP steps fromguides/testing.md#ci. Lint with actionlint. - Feature specs. Add a
## Securitysection to everyproduct/features/*.md(blueprints/feature-spec.md). Each threat gets a control and a test. A threat without a test is a finding.
API-only apps, the API axis (REST + OpenAPI, GraphQL), Docker compose, day-one meta and favicons
Spec: guides/api.md and guides/graphql.md (new), tools/brand/render.sh (new), plus interview.md, blueprints/AGENTS.md, generators/new.md, generators/scaffold.md, guides/views.md, guides/deployment.md, guides/auth.md, guides/controllers.md, guides/config.md, guides/test-standards.md, stack.md, structure.md, cli.md, RAILS_MAP.md. Verified with the offrails-api-demo app (FRONTEND_MODE: api, API: both): 151 tests green on SQLite and Postgres 18, clippy clean, GraphiQL and the Scalar reference checked in Chrome, docker compose up --build from scratch plus the mail and worker profiles, and direct TLS (h2 via ALPN).
FRONTEND_MODE: api(rails new --api): no UI, JSON errors everywhere except/devand/admin,GET /as a JSON index,/robots.txtdisallowing all.API: none | rest | graphql | both, a separate header line, chosen in the interview. REST lives under/api/v1:- bearer API tokens (
api_tokens, SHA-256 digests, scopes, expiry); ApiJson(JSON error shape for bad bodies) and{"data": …}envelopes;- an OpenAPI document via utoipa, committed as
docs/openapi.jsonwith a drift test, plus Scalar at/dev/api-docs.
- bearer API tokens (
- GraphQL lives at
POST /graphql: async-graphql, DataLoaders, depth (≥ 13, or introspection breaks) and complexity limits, payloadUserErrors,docs/schema.graphqlwith a drift test, GraphiQL at/dev/graphiql. - CORS comes from
APP_CORS_ORIGINS: exact origins, also trusted by CSRF, no credentials. Per-token rate limits. compose.yamlruns the whole app: the production image plus Postgres with healthchecks, and profilesworkerandmail. Newapp healthsubcommand for container healthchecks.- Day-one brand and meta for every mode with pages:
tools/brand/render.shwritesfavicon.svg,favicon.ico,apple-touch-icon.png,icon-512.pngandog.png;Ctxcarries the title, description and canonical URL;- the layout has Open Graph and Twitter tags;
/robots.txtand/sitemap.xml;- smoke tests assert all of it.
- Web server: documented as axum on hyper (HTTP/1.1 + h2c); optional direct TLS via
APP_TLS_CERT/APP_TLS_KEY(axum-server + rustls). - Fixed:
serde_html_formis a kernel dependency (the jobs dashboard's filter links).newadds it again, which corrects the earlier doc-fix pass.
App migration (reconcile, don't re-create):
- Header. If
AGENTS.mdhas noAPI:line, addAPI: noneunderISLANDS:. An app that already serves a public API (tokens,/api/v1) recordsrest, and followsguides/api.mdfor anything it lacks. - compose.yaml. Detect:
grep -q '^ app:' compose.yaml.- If it has only
postgres/db, replace it with the shape inguides/deployment.md#docker-compose-the-whole-app-locally. Keep the existing Postgres major and volume name (renaming the volume loses local data; say so). - Add
app healthtosrc/main.rsif missing. - Verify with
docker compose up --build, thendown -v.
- If it has only
- Brand and meta (modes with pages).
- Detect:
static/og.png,static/apple-touch-icon.png, andog:imagein the layout or shell. - Missing: run
bash .offrails/tools/brand/render.sh "<APP_NAME>" "<accent from the layout>" "<pitch from product/README.md>" static, add the<head>tags and theCtxmeta fields fromguides/views.md#meta-favicon-and-social-cards-every-app-with-pages, route/favicon.ico,/robots.txt,/sitemap.xml, and add the smoke-test assertions. - An existing hand-made favicon or OG image wins. Don't overwrite it; only fill in what's missing.
- Detect:
- serde_html_form. Ensure it's in
Cargo.toml(cargo add serde_html_form). It's harmless if already present. - Adding
API: rest | graphqlto an existing app is a feature, never part of an upgrade. Spec it, then followguides/api.md/guides/graphql.mdandgenerators/scaffold.mdstep 9b per resource.
Svelte as a UI library; the react mode is renamed spa
Spec: guides/frontend-svelte.md (new); stack.md, interview.md, blueprints/AGENTS.md, structure.md, generators/new.md and generators/scaffold.md updated. Verified in Chrome:
-
Inertia + Svelte 5 on the reference app: every protocol check, 409 redeploy reload, HMR, Playwright, 75 Rust tests on SQLite and Postgres;
-
a SvelteKit SPA served by Rust under a strict hashed CSP;
-
a Svelte island.
-
The app header gains
UI_LIBRARY: react | svelte | none.FRONTEND_MODEvalues are nowhtmx | inertia | spa | api(apiis specified by the API-only work). -
FRONTEND_MODE: reactis nowspa. Same architecture; the name no longer implies the library. -
The DoD's frontend type-check is
pnpm --dir web typecheck. React keeps"typecheck": "tsc -b"; Svelte usessvelte-check --fail-on-warnings.
App migration (existing apps; reconcile, don't regenerate):
- Detect
FRONTEND_MODE:inAGENTS.md.- If it says
react, change it tospaand addUI_LIBRARY: reactunder it. - If it says
inertia, orISLANDS: yes, addUI_LIBRARY: react. - Otherwise add
UI_LIBRARY: none. No code changes. Log the header change indocs/decisions.md.
- If it says
- If
web/package.jsonhas notypecheckscript, add"typecheck": "tsc -b". CI and the DoD now callpnpm --dir web typecheck; update.github/workflows/ci.ymlif it runsexec tsc -bdirectly. - Switching an existing app to Svelte is a human decision, never part of an upgrade. If asked, follow
guides/frontend-svelte.md: the Rust side changes onlyVITE_ENTRYand drops the React refresh preamble route.
Realtime: channels, presence, the hub, the cluster layer
Spec: guides/channels.md (new), plus changes to guides/realtime.md. Verified in the reference app (book page: "reading now" avatars and a live discussion), with 21 tests on SQLite and Postgres 18 including a 3-node failover, a Playwright smoke, and a manual server-restart check in Chrome.
- Signals got fast.
pubsub::broadcastnow wakes the poller:NOTIFYat commit on Postgres (238 ms → 2.1 ms) and an in-processNotifyon SQLite (→ 0.24 ms). The 250ms poll remains as a backstop. NewPubSub::start_with(poll_every). - Channels:
GET /socket: one WebSocket per tab, Phoenix v2 wire format, topics joined with authorization;kernel/hub.rs: a room actor per topic, supervised; serialize-once fan-out; slow consumers dropped; presence by person;kernel/channels.rs: Origin check, auth at upgrade, frame and rate limits;static/channels.js, and/dev/sockets.
- Cluster (opt-in, Postgres):
kernel/cluster.rs, withcluster_nodesheartbeats, aNOTIFYbus, rendezvous ownership, forwarded calls, presence cleanup and failover. Settings:APP_CLUSTER,APP_NODE. - Fixed: the reference app's
ROUTEStable had no rows for books, reviews, blobs or streams, so the access matrix never tested them. New testevery_mounted_route_is_in_the_routes_tableparsessrc/routes.rsand fails on any mounted path missing fromROUTES.
App migration (an agent upgrading an existing app; reconcile, don't re-create):
- Every app: route table drift.
- Detect: any
.route("…")path insrc/routes.rswithout aROUTESrow. - Converge: add the rows with their real
Access(check each handler's extractor). Then add theevery_mounted_route_is_in_the_routes_tabletest fromguides/test-standards.md§3 (tests/app/security_test.rs), and run the security suite, which may now fail on routes it never covered. Fix those routes, not the test.
- Detect: any
- Apps with SSE channels: faster signals.
- Detect:
kernel/pubsub.rswithoutpg_notify/WAKE. - Converge: add the
NOTIFY(Postgres) andWAKE(SQLite) calls inbroadcast,start_with, and the dedicated listener task, per realtime.md's kernel spec. - Tests: the wake-up test (
start_with(60s)) and the rollback test. - No schema change.
- Detect:
- Apps that need rooms or presence: only when a spec asks for them. Run
generators/channel.md→ room recipe.- Detect: an existing hand-rolled
axum::extract::wshandler. - Converge: move its topics into
Roomimpls behind/socket. Keep the old route as long as clients depend on it, and log the deviation.
- Detect: an existing hand-rolled
0.2.0 (2026-10-12)
What's new
- A full persistent job queue (Oban-style: queues, timeouts, cancellation, cron, unique jobs, graceful shutdown) and the
/admin/jobsdashboard to inspect and act on it. - A dev mailbox at
/dev/mailbox: every email sent in development, as HTML, text or raw, on desktop or mobile, with previews and JSON for agents. /devand a pending-migrations page: in development, pending migrations show a page with a Run button instead of a broken app.- Magic-link sign-in as a first-class accounts variant, and a
TENANCYheader line. - Safer data changes: every transaction starts with
kernel::db::begin(BEGIN IMMEDIATEon SQLite, so the job worker can't cause "database is locked"), and committed migrations are append-only. - Test standards: acceptance-criteria ids, an access matrix over every route, tenant isolation, coverage gates and a real-browser smoke.
Breaking changes
DeliverEmailJobbecomes a struct (rows already queued still decode), mailer selection moves tostate::select_mailer, and development always uses the local mailbox./dev/mailersbecomes a 301 to/dev/mailbox/previews.- A plain
db.begin()outside the kernel is flagged; usekernel::db::begin. Edits to committed migrations fail CI and are blocked by the plugin. - The migration crate drops its
clifeature andmigration/src/main.rs. - Postgres test databases are named
test_<crate>_<hex>. - New settings
MAILERandAPP_REVISION;APP_URLdefaults to localhost in development; production refuses to boot withoutstatic/app.css.
Upgrading
The numbered App migration list (steps 1–20) at the end of this section. The procedure is in upgrade.
Full list of changes
The kernel UIs, verified end to end in a real app (bookshelf, htmx, SQLite + Postgres 18, Chrome): the full Oban-style queue and /admin/jobs, a Swoosh-grade dev mailbox, /dev, and a pending-migrations page. Specs: guides/jobs.md, guides/jobs-dashboard.md, guides/mailers.md, guides/dev-tools.md.
- Jobs: producers per queue with semaphores, an optimistic claim, timeouts, panic capture, cancellation of executing jobs (Heartbeat aborts), snooze/cancel/discard, the Stager/Lifeline/Pruner/Cron plugins as plain functions, uniqueness via
on_conflict_do_nothing_on→TryInsertResult::Conflicted(sea-orm 2), and graceful shutdown.JobBuilderis non-generic (JobDefaults+ serialized args).Recurring { key, cron, job: fn() -> JobBuilder }; cron jobs are taggedcronwithmeta.cron = key. /admin/jobs: overview (counters, throughput SVG, queues, nodes), filtered list with bulk actions and an "all matching" confirmation page, job timeline + error history, cron page, live polling, flashes,no-store.- Dev mailbox: two panes (Inbox/Previews), Cc/Bcc/Reply-To, attachments, HTML/Text/Raw, Desktop/Mobile, links,
.emlat/dev/mailbox/{id}/message.eml, new-mail banner, test-email button, JSON for agents./dev/mailers→ Previews tab. - Mailer selection: development is always
Mailer::Local(MAILER=smtp|local|logoverrides);Logis only the production fallback. Selection moved from the kernel intostate::select_mailer. - Email:
Emailgainscc,bcc,reply_to,attachments(all#[serde(default)]).DeliverEmailJobbecomes{ #[serde(flatten)] email, expires_at }withMAX_ATTEMPTS = 10;mailers::deliver_later_untilfor time-limited mail without secrets. Token emails use dedicated ids-only jobs (no secrets in job args). The one mail layout istemplates/mailers/layout.html. - Back/Forward and hx-boost: kernel routers are
no-store, the kernel layout hashistoryCacheSize: 0andstatic/kernel/admin.js(pageshow reload), gone records redirect with a flash, and app links into kernel pages carryhx-boost="false". - Pending migrations: a dev-only page with a Run button,
/up503 while pending, the worker waits, andbin/devmigrates. - Config: in development
APP_URLdefaults tohttp://localhost:{PORT}. NewMAILER,APP_REVISION. - Migration crate:
sea-orm-migrationwithout itsclifeature; nomigration/src/main.rs. - Tooling:
.offrails/tools/browser-smoke/(optional; puppeteer-core cached outside the app). - SQLite transactions: every transaction starts with
kernel::db::begin(&db)(BEGIN IMMEDIATEon SQLite). A plaindb.begin()is deferred and fails with "database is locked" when the job worker writes between your read and your write. Tests missed it because the in-memory test database has one connection; a regression test now uses a real file. The plugin flags.begin().awaitoutside the kernel. - Migrations are append-only once committed. Edited applied migrations never reach existing databases. CI fails a change that modifies a committed migration, and the plugin blocks such edits.
- Errors on boosted pages are visible.
static/app.jsshows the server's error page for 5xx on boosted requests, and the layout'sresponseHandlingswaps 422 and 429. - Auth:
- magic-link login is a first-class variant (
ACCOUNTS: magic-link | magic-link-invite), recommended in the interview. It's fully specified in auth.md: POST to consume, single use, 15 minutes, enumeration-safe, rate-limited per IP and per email; - the dev "check your mailbox" hint on every auth screen that sends email;
- every auth email has a mailer preview;
- failed admin Basic-auth passwords are rate-limited (10 per 3 minutes per IP);
TENANCY: per-user | teams | shared | none.
- magic-link login is a first-class variant (
- Live updates (SSE): events carry non-empty
data(browsers drop empty ones); one/streams/{stream}route; streams end on shutdown; the app layout useshistoryCacheSize: 0andrefreshOnHistoryMiss: true. - CSS check: development warns and shows a banner when
static/app.cssis missing or empty; production refuses to boot without it. - Errors: the 422 fallback renders
templates/errors/_invalid.html(never HTML fromformat!). The router fallback marks its 404 withx-route-fallback: 1, so the routability test is exact for parameterized routes. - Tests:
test-standards.md(AC IDs, archetype suites, the access matrix overROUTESwith anAccesscolumn, tenant isolation, coverage and mutation gates with a per-pathjqcheck, query-count guard, real-browser smoke).TestAppgainsassert_text,without_fetch_metadata,post_multipart,get_htmxand SSE helpers. Postgres test databases aretest_<crate>_<hex>, andtest_db_cleanupdrops only this app's idle ones. - New guidance: dark mode (OS-following by default; a no-flash cookie toggle with a verified Tailwind 4 variant); public pages (meta, OG image, canonical, robots, sitemap, self-hosted fonts, Lighthouse ≥ 95); trusted vs user Markdown (heading ids, ammonia builder); runtime-read directories in the Dockerfile; how an agent runs, checks and stops the app (never
pkillby name). - Plugin: drift is detected by content fingerprint, not just the version line. Hooks block
pkill/killallby name and edits to committed migrations, and flag.begin()outside the kernel andsleepin tests./offrails:upgradereconciles instead of recreating. - Docs fixes: sea-orm 2 pitfalls (
ActiveModel::default()ambiguity, OFFSET without LIMIT on SQLite, jsonb text search), axum's whole-segment params, the CSP ⇄ htmx-config pairing (verified in Chrome), lettre quoted-printable links.
App migration (reconcile, don't recreate). For each item: detect what the app already has, compare with the final shape, then converge. Classify each as new, present-conforming, present-divergent or conflicting. Never edit or re-run an applied migration; add a new one. Commit per item, green on both databases.
mailbox_messagestable. Detect: the table exists (anym…_create_mailbox_messages, applied). Final columns:id, to_addr, from_addr, cc json [] , bcc json [], reply_to string null, subject, html text, text text, headers json, eml text, attachments json [], read_at timestamptz null, created_at. Converge: generatem<ts>_alter_mailbox_messagesthat adds only the missing columns (SQLite-safe: oneALTER TABLE … ADD COLUMNper column, with defaults; nullableread_at). If the app named the raw message something else (e.g.raw_eml), keep the column and map the entity field with#[sea_orm(column_name = "raw_eml")] pub eml: Stringrather than renaming. Missing table: new, so generatecreate_mailbox_messages.Emailand delivery. Detect:src/kernel/mailer.rs::Emailfields,Mailervariants, whether selection lives in the kernel (Mailer::from_config). Converge: add the four#[serde(default)]fields andAttachment; extendbuild()(Cc/Bcc/Reply-To, multipart/mixed); add constructorsMailer::smtp/local/memory; move selection tostate::select_mailerwith the table in mailers.md. Delete any file-writing/"logged locally" dev mailer: development must beLocal. Update theEMAILheader line todev: local mailbox (/dev/mailbox); prod: ….DeliverEmailJob. Detect: tuple structDeliverEmailJob(Email). Converge:struct DeliverEmailJob { #[serde(flatten)] email: Email, #[serde(default)] expires_at }(rows already queued as a bareEmailstill decode; add the decode test),MAX_ATTEMPTS = 10, expiry discard; addmailers::deliver_later_untilfor time-limited mail without secrets. Any email carrying a token (password reset, login link, confirmation, invitation) must not be enqueued rendered: detectdeliver_later(…)calls whose email embeds a token, and replace each with a dedicated ids-only job (5 attempts, discard when stale) that mints the token, stores its digest and delivers (guides/auth.md).- Dev mailbox UI. Detect:
kernel/mailbox.rsroutes (/dev/mailbox,/dev/mailbox/{id}, any/{id}.emlor/{id}/raw), templates undertemplates/kernel/mailbox/or elsewhere, a separate/dev/mailerspage. Final: the route table in mailers.md (/dev/mailbox,/{id},/{id}/message.eml,/{id}/html,/{id}/attachments/{n},/{id}/delete,/clear,/test,/previews,/previews/{*name},.json,/latest.json),kernel::mailbox::router(PREVIEWS)with.layer(ui::no_store()), the templates andkernel/ui.rschrome. Converge: replace the module and templates with the spec (the table is the only state). Keep any existing.eml/raw URL as a redirect to/message.emlif anything links to it. Move previews: createsrc/mailers/previews.rswithPREVIEWS(port each existing preview fn), makeGET /dev/mailersa 301 to/dev/mailbox/previews, and delete the old previews page and templates. - Links into kernel pages. Detect:
grep -rn 'href="/dev\|href="/admin' templates/ web/src/(the footer "Dev tools" link, mailbox hints on/session/new,/login-links/sent, nav to/admin/jobs). Converge: addhx-boost="false"(htmx) or use a plain<a>(TS modes); usepaths::dev_mailbox(); addapp_links_into_kernel_pages_are_not_boosted. - Jobs kernel. Detect:
src/kernel/jobs/files, thejobscolumns (compare with jobs.md, Tables),job_queues/job_nodes/recurring_executions. Converge: missing tables or columns via a new migration; then replacekernel/jobs/withmod.rs/executor.rs/plugins.rs/admin.rs/web.rsper the spec. Adaptsrc/jobs/mod.rs(into_job→JobBuilder::new(JobDefaults{…}, serde_json::to_value(&self)),fn unique(),worker_config→WorkerConfig::default()fallback),recurring.rsto&[Recurring], andmain.rs'sWorkerOptionsandapp jobs …CLI. Keep every existingWorker::NAME. /admin/jobs,/dev, pending migrations. Detect:kernel/jobs/web.rs,controllers/dev.rsroutes,controllers/migrations.rs. Converge to jobs-dashboard.md and dev-tools.md:route_layer(AdminAccess),no_store()on each kernel router, the test buttons,/dev/systemviaget_*_migrations_read_only, themigrations::guardlayer (development only),/up503 while pending, the worker waiting for migrations,bin/devmigrating first. Add every new route toROUTES(Access::Admin/Access::Dev).- Assets and layout. Add
admin_jstoAssets,static/kernel/admin.js,historyCacheSize: 0intemplates/kernel/layout.html's htmx-config,templates/mailers/layout.html(move an existingtemplates/layouts/mailer.htmlthere and update{% extends %}). - Config.
APP_URLdefaults todev_app_url(PORT)in development (parsePORTfirst); addmailer(MAILER) andrevision(APP_REVISION) toConfig,.env.exampleand the deploy config. - Migration crate. If
migration/Cargo.tomluses default features: setdefault-features = falseand deletemigration/src/main.rs(check nothing runscargo run -p migration). - Transactions. Detect:
grep -rn '\.begin()\.await' src/ | grep -v src/kernel/. Converge: addkernel::db::begin(database.md:begin_with_optionswithSqliteTransactionMode::Immediate; Postgres ignores the mode) and replace every call site. Add the file-backed SQLite regression test (a write racing a read-then-write transaction). - Append-only migrations. Detect:
git log --diff-filter=M -- migration/src/m*.rs(edits to migrations after their first commit). Any hit is present-divergent: restore the committed original and move the change into a newaltermigration. Then add the CI guard step from testing.md (fails when a committed migration file is modified). - Boosted errors. Detect:
static/app.jslacks anhtmx:responseError/htmx:beforeSwaphandler for 5xx; the layout'shtmx-configlacksresponseHandlingfor 422/429. Converge to frontend-htmx.md (both pieces), and check in a browser that a forced 500 on a boosted form shows the error page. - Auth (only if
ACCOUNTSisn'tnone). Detect the variant actually built (password tables,login_links/login_tokens). Record it inACCOUNTS(an improvised passwordless flow =magic-link). Converge to auth.md's variant: token digest only, single use, the TTL, GET → confirm page → POST consumes, the same response for known and unknown emails, rate limits per IP and per email, and the token minted inside its job. Add a mailer preview for every auth email, and the dev mailbox hint (templates/shared/_dev_mailbox_hint.html, development +Mailer::Localonly) with its present-in-dev/absent-in-prod test. Admin Basic auth: add the failed-attempt limiter (security.md). - SSE. Detect:
Event::default().event(…)without.data(…), or per-resource stream routes. Converge to realtime.md: non-empty data, one/streams/{stream}route,take_until(pubsub.closed()), and the app layout'shistoryCacheSize: 0+refreshOnHistoryMiss: true. - Errors and routing. Converge
controllers::errors::not_foundto return thex-route-fallbackmarker, haveshape_errorskeep it, and tightenevery_route_is_routable_in_developmentto use it. Render the 422 fallback withtemplates/errors/_invalid.html. Delete anyformat!-built HTML. - Postgres test databases. Detect:
test_<hex>names intests/app/support.rs. Converge totest_<crate>_<hex>, the joined-threadDrop, and the scoped, idle-onlytest_db_cleanup(testing.md#database-per-test). - Env files. In
.env.example(and the human's.env, if present and if they agree), comment outAPP_URLfor development; keep it required in production. - CSS check. Converge
kernel/assets.rsto warn and show a banner only whenstatic/app.cssis missing or empty (never by timestamp: Tailwind 4 doesn't rewrite unchanged output), and to fail boot in production. - Tests. Bring
tests/app/kernel_jobs_test.rsandkernel_web_test.rsto the lists in new.md step 7 (both backends), andsupport.rsto the job helpers +wait_until. Then the Definition of Done, and, if Node ≥ 22.12 and Chrome are present,bash .offrails/tools/browser-smoke/run.sh.
0.1.0 (2026-10-12)
What's new
- The framework docs: the conventions, guides and recipes an agent follows to build a Rust web app.
- The Claude Code plugin: the
new,feature,scaffold,generate,check,doctor,deployandupgradeskills, and the convention hooks. - Ideas borrowed from Phoenix/Elixir: Oban-style persistent jobs with the
/admin/jobsdashboard, a Swoosh-style/dev/mailbox, and a/devtoolbox.
Breaking changes
None (first release).
Upgrading
Nothing to upgrade: this is the baseline.
Full list of changes
First release:
- The framework docs.
- The Claude Code plugin:
- skills:
new,feature,scaffold,generate,check,doctor,deploy,upgrade; - the convention hooks.
- skills:
- Borrowed from Phoenix/Elixir:
- Oban-style persistent jobs: a state machine, history, queues with pause/resume, unique jobs, snooze/cancel/discard, the Stager/Lifeline/Pruner/Cron helpers, and
Oban.Testing-style helpers; - the
/admin/jobsdashboard (Oban Web); - the Swoosh-style
/dev/mailbox; - a
/devtoolbox.
- Oban-style persistent jobs: a state machine, history, queues with pause/resume, unique jobs, snooze/cancel/discard, the Stager/Lifeline/Pruner/Cron helpers, and
App migration: none (baseline).