# Release Notes

## v3.13.165 (2026-11-22) - Tina4 on Windows, and a slow host keeps its port

**`tina4nodejs serve` starts on a slow host.** The 3.13.164 notes named this as a known issue. Before binding, Node checked the port by starting a short-lived `node` process with a one-second limit, and it treated any failure as "in use". Where starting `node` takes longer than that (arm64 under emulation, a small board, a CPU-throttled container), the check timed out, and outside dev mode the server refused to start on a free port. Only a real "address in use" counts as held now. When the check cannot tell, the server binds and reports whatever error the bind gives. Python, PHP and Ruby check with an in-process bind, so they never had this fault (nodejs#209).

**Windows: fixes in all four frameworks.** A full run of the Node test suite on Windows found framework bugs that Linux CI could not see, and each fix went into every framework that shared the bug:

- **Broken-import markers.** When a route file fails to import, the framework writes a marker under `data/.broken/` so `/health` can report it. On Windows the marker's name kept the drive letter's colon, `C:`. NTFS treats that colon as the start of an alternate data stream, so the marker never appeared in the directory and the failure never reached `/health`. All four frameworks drop the colon now (python#328, php#372, ruby#183, nodejs#211).
- **Database session handlers.** A handler that opened its own connection had no way to release it: PHP's `close()` did nothing, and Ruby and Node had no `close()`. The connection, and SQLite's `-wal` and `-shm` files with it, stayed open until the process ended. `close()` now releases a connection the handler opened itself and never closes one you passed in. It is safe to call twice, and the next use reopens the connection (php#372, ruby#183, nodejs#211).
- **Project index paths.** The project index used `\` in its keys on Windows. Python and Node now always use `/`, as PHP does (python#328, nodejs#211).
- **Node: loading from file paths.** Node loaded templates, routes, models and seed files through a `file://` URL it built by hand. That broke on a Windows drive letter, and on any platform when a path held `#`, `?` or `%`. Seed files failed without an error, so seeds never ran. Node now converts paths to URLs with the standard library (nodejs#211).
- **Node: `npm`, `npx` and `tina4.cmd`.** On Windows these are batch files, and since Node's 2024 security change (CVE-2024-27980) a batch file will not start without a shell. So `tina4nodejs lint`, delegated CLI commands, dev-admin install and generate, and the MCP syntax check all failed. The syntax check went further: it read the failure as "tsc is missing" and skipped without saying so. Batch files now run through `cmd.exe` with every argument quoted and escaped. An argument such as `a&calc` arrives as text and never runs as a command (nodejs#211).
- **Node: cluster scheduling.** Production cluster mode sets round-robin scheduling before it starts its workers. On Windows, Node's default leaves the choice to the operating system, which can send every request to one worker. Setting `NODE_CLUSTER_SCHED_POLICY` still overrides it (nodejs#211).

**Migration commands that do what they say.** `tina4python migrate:create add things` now writes `<timestamp>_add_things.sql`. Before, it wrote `<timestamp>_add things.sql`, with the description as typed, spaces included. `create_migration()`, the MCP tool and the other three frameworks already turned the description into a safe filename, and the CLI now does the same. A description with no letter or digit is refused (python#329). After `tina4ruby generate migration`, the suggested next steps say `migrate:status` and `migrate:rollback`. They said `migrate status` and `migrate rollback`, which quietly ran a plain `migrate` instead (ruby#184).

**AI skills report when they are out of date.** The four tina4-developer skills changed in 3.13.164, but their version field still said 3.13.147, so an older install compared itself with the server and decided it was current. The field now says 3.13.165, and an install from 3.13.164 or earlier reports that it needs an update.

**The Node test suite runs on Windows.** Tests that assumed Linux paths, process groups or shell scripts now use portable equivalents. On Windows, the suite went from 104 failing files to 24, and each of those 24 needs a service, such as a database or a message broker, that wasn't running on the test machine. `npm ci` now works on Windows too (nodejs#210, nodejs#211).

Every fix is held down by a real, no-mock test, each one seen to fail without the fix.

## v3.13.164 (2026-11-17) - A template global reaches every page, and a free port stays quiet

**A global you register reaches the page `render` produces.** Register a template global, filter or test on the class - `Frond.add_global` in Python, `\Tina4\Frond::addGlobal` in PHP, `Tina4.template_global` in Ruby, `Frond.addGlobal` in Node - and it now reaches every page the response renders, whether you register it before the first render or after. Before, the response engine took a copy once, so a later registration never arrived, and in Ruby and Node even the auto-wired `t()` rendered empty. `t()` also takes a params map now, `{{ t('welcome', {'name': n}) }}`, where Python and Ruby raised on it. A registration on one engine instance still stays on that engine (python#324, python#326, php#368, php#370, ruby#179, ruby#181, nodejs#204, nodejs#207; ADR-0106, ADR-0107).

**`serve` says a port is in use only when something holds it.** With debug off, or with takeover opted out, every start printed "Port N is in use; takeover is disabled outside dev mode" for a port nothing held, so a production operator was told a free port was taken. The check now tries the bind first: a free port says nothing, and a held port is still refused with the same message (python#318, php#362, ruby#173, nodejs#198).

**The PHP worker pool keeps its size.** `runWorkerPool()` replaced a worker for every child it reaped, including orphans re-parented to it - PID 1 in a container is everyone's parent - so a pool of 8 grew to 15 in a day. Only the pool's own workers are replaced now; other children are still reaped (php#360, closes php#358). A SIGTERM that lands while the accept loop builds its read set also exits 0 now, not 255 (php#364).

**The dev dashboard reports the memory the process is using.** Each framework had its own way of getting it wrong: Python showed its peak as current, PHP showed its allocator heap (about 30 MB low), Node showed the V8 heap without Buffers, and Ruby sent no figure at all, so its dashboard said "Memory: ?". All four report current resident memory now, and PHP's `memory_source` says where its figure came from (python#320, php#363, ruby#175, nodejs#197).

**An unreachable database says so.** A configured database that refused the connection was reported as "no database configured" (Python, Node) or "ORM not available" (Node), and Ruby logged "Database connected" after a failed connect. Each now says the configured database could not be reached, and Python and Node give the error (python#319, nodejs#199, ruby#172, ruby#174).

**Security (Python).** The optional extras no longer admit releases with published advisories (`cryptography>=50.0.0`, `mysql-connector-python>=9.1.0`, `pymongo>=4.18.3`; the locked versions were never affected), and dnspython moves to 2.9.2 for GHSA-vvf4-9x63-8xvv. A new dependency-audit workflow checks every `uv.lock` pin against the advisory database; it found the dnspython advisory on its first run (python#314, python#317).

**AI skills.** The skills were audited against the code, and more than 70 contradictions were fixed. Every app-building skill now forbids patching the framework to get past a bug; the agent reports it instead. `tina4-maintainer` loads a short floor and pulls in its references on demand. `tina4-test-plan` joins the installers, and both install scripts now target Hermes Agent and DeepSeek Deep Code as well as Claude, Codex and Cursor. Each repo's `llms.txt` follows the llmstxt.org specification, with a CI check that keeps it that way.

**Known issue (Node.js).** On a host where starting `node` takes more than a second - arm64 under emulation, a small board, a CPU-throttled container - `tina4nodejs serve` can report a free port as in use and refuse to start outside dev mode. The check that decides this spawns a short-lived `node` process and treats a timeout as "in use". The 3.13.163 release has the same fault. The fix, which treats only a real "address in use" as held, ships in the next release.

Every fix is held down by a real, no-mock test.

## v3.13.163 (2026-11-13) - The consumer reads past a tombstone, and an async test answers for itself

**A Kafka tombstone no longer stops the consumer short.** 3.13.162 stopped a tombstone crashing the Python and Ruby consumers, but it still answered one with "nothing", and that cost every framework the records behind it. A single-pass drain read the tombstone as an empty queue and went home, and the built-in clients in PHP, Node and Python never got past it at all - every pop re-read the same offset, with no error to say why. The consumer now steps over a tombstone and keeps reading, still bounded by its one-second deadline, and it stops rather than spins if the offset won't move. Acknowledging the next real record commits past the tombstones it skipped, so a restart walks straight past them too (python#309, php#357, ruby#169, nodejs#194).

**An async test is judged by what it returns.** The inline test runner used to judge the coroutine or Promise an `async` test handed back, not the value inside it, so `expect_true` always passed and a failing async test showed green. Python now awaits the test and gives each one a timeout (python#307), and Node adds `runAllAsync()`, which the `tina4nodejs test` command uses (nodejs#191).

**An async MCP resource or tool returns its value.** A Model Context Protocol (MCP) resource with an `async` handler read back as `{}` in Node and as the text of a coroutine object in Python, where tools had the same fault. Both now await the handler, and one that raises becomes a JSON-RPC error (nodejs#193, python#311).

**Three smaller Python fixes.** A Cross-Origin Resource Sharing (CORS) policy set only in `.env` is now applied instead of quietly ignored (python#305), the dev dashboard reports memory in megabytes rather than a figure 1,024 times too small (python#306), and the route example in the AI context files passes a dict to `response()` instead of a set that raised `TypeError` (python#302).

Every fix is held down by a real, no-mock test, the Kafka ones against a live broker producing real tombstones.

## v3.13.162 (2026-11-10) - A Kafka delete marker no longer takes the consumer down

**A tombstone no longer kills the consumer.** A tombstone is a Kafka record with no value - the marker Debezium writes after a row is deleted, and the one a compacted topic uses to forget a key. When the Python consumer met one on the confluent-kafka client, it tried to decode a value that wasn't there, and the `AttributeError` escaped `consume()` and took the consumer thread with it. The tombstone sat at the committed offset, so every restart walked straight back into it and died again (#303). Ruby's rdkafka consumer fell over the same record with a `TypeError` that slipped past its rescue (#167). Both now step around the empty record, and a long-running worker carries on to the records behind it.

**What 3.13.162 doesn't fix yet.** A tombstone still stops a consumer short in all four frameworks. A single-pass drain (`consume` with a poll interval of 0) reads it as an empty queue and goes home, and the built-in Kafka clients in PHP, Node and Python (the one used when confluent-kafka isn't installed) stall on it for good: every pop re-reads the same offset, nothing behind it is delivered, and no error says why. PHP and Node never crashed on a tombstone, so their 3.13.162 is a version bump that keeps the four on one line. The fix that reads past a tombstone in all four is lined up for the next release.

Both crash fixes are held down by a real, no-mock test against a live broker producing real tombstones.

## v3.13.161 (2026-11-09) - The test client reads your .env, and a header answers to any case

**A test that never boots the app still finds your secret.** `TestClient` sends a request through the real front controller, but it never ran the one line that loads `.env`, so a test that skipped booting the app met an unset `TINA4_SECRET` and a token-signing route fell over - with the error pointing at `.env`, which was fine all along. The client now loads `.env` the way the app does, first-wins: a value you set in the real environment still wins, and `.env.local` then `.env` fill in the rest (#296).

**A redirect header answers whether you ask in capitals or not.** The single-value `headers` view keeps its names in lower case, so a lookup by the header's usual name came back empty, even though the case-insensitive list accessor beside it found the very same header. HTTP header names don't care about case, and now neither does the lookup: ask by any spelling and the header replies, while the view keeps its lower-case keys and its last-value shape for every reader that already leaned on it (#300).

Both fixes land in Python, PHP, Ruby and Node, each held down by a real, no-mock test proven by mutation.

## v3.13.160 (2026-11-07) - The error page shows up even when you're turned away

**A browser turned away at the door gets the page, not the raw JSON.** Post a form to a protected route after your session has quietly expired, and the gate used to answer a bare `401 {"error": "Unauthorized"}`, whatever the browser asked for - a wall of JSON where the sign-in page belongs. The gate now reads what the caller will take: a browser gets `errors/401.twig`, the page it was always meant to see, and an Application Programming Interface (API) client gets the `{error, code, message, status, request_id}` envelope every other framework error already speaks. A role-guarded route that refuses an authenticated user answers its `errors/403.twig` the same way (#342).

**A middleware that throws owns up on the page, not in a JSON blob.** When a `before` or `after` hook raised, the worker caught it, logged it and handed back a bare `500 {"error": "Internal Server Error"}` - again, to whoever happened to be asking. It now renders `errors/500.twig` for a browser and the envelope for an API client, and the exception itself still never leaves the log for the body to carry.

Every framework answer - 401, 403, 404, 405 and 500 - now negotiates on the same `Accept`, so the four frameworks reply alike to the same request. Every change is held down by a real, no-mock test proven by mutation.

## v3.13.159 (2026-11-06) - The handler you wrote is the handler that runs, and a half-finished migration waits its turn

**Return an object and it becomes the response.** A route that handed back a dict, a list or a string instead of calling `response(...)` used to answer an empty 200 - no error, no log line, the value dropped on the floor. The dispatcher now runs that return value through the same `response()` it would have called for you: a dict or list leaves as JSON, a string as HTML or text, an ORM model or query result as JSON. Returning `None` still leaves whatever you wrote onto the response object alone (#289).

**A plain `def` handler works under `@template`.** `@template` always awaited the handler, so a synchronous `def` that returned a dict died with "object dict can't be used in 'await' expression" and every request answered 500 - even though the route decorators have always accepted a `def`. The wrapper now awaits only when the handler really returns something awaitable, so a sync handler renders its template like any other (#287).

**Doing the work the generator asked for no longer turns the suite red.** `generate route` - and service, queue, websocket, listener - wrote a test that asserted the scaffolded handler still raised `NotImplementedError`. Fill the handler in correctly and that test failed: the one test that punished you for finishing. The generated test now asserts the route is wired and callable, and it stays green whether the stub still raises or you have implemented it (#270).

**An unfinished migration waits instead of recording itself as done.** `migrate:create` leaves a `tina4:edit` placeholder where your SQL goes. If the app started before you filled it in, startup auto-migrate applied the empty file, recorded it as passed, and then ignored the real SQL you wrote next - the column never appeared and nothing said why. The runner now keeps a migration pending while it still carries a `tina4:edit` marker and has no statement to run; a scaffolded `CREATE TABLE`, which is real SQL from the start, still applies (#288). And `migrate:create create_open_tickets_view` scaffolds a `CREATE VIEW` to fill in, not a runnable `CREATE TABLE` that built the wrong object behind your back (#297).

Every change is held down by a real, no-mock test proven by mutation.

## v3.13.158 (2026-11-05) - The bearer token stays home, the dev socket asks who is really calling, and the logs keep their secrets

**The front-end helper no longer hands your token to another site.** `frond.js` used to attach the signed-in `Authorization: Bearer` to every request it made, read a replacement token back from any reply, and copy the token into a form's hidden `formToken` field - so a page that called out to another origin, on purpose or not, handed that origin the user's identity token, and a cooperating site could even swap the token out from under the app. Now the managed token rides along only when the request is going to the page's own origin, a `FreshToken` is accepted only from the page's own origin, and `form.collect()` sends the `formToken` field exactly as the server rendered it. A call that really does mean to authenticate elsewhere passes its own `Authorization` header (GHSA-q2gc-fpw5-3v3c).

**The dev-reload socket checks the caller, not just the name it claims.** With debug on and the server bound past loopback, a machine on the network could open the `/__dev_reload` WebSocket by sending `Host: localhost` and then watch the path of every file you edited, even though that same machine was refused at every `/__dev` HTTP endpoint. The socket now applies the same raw-peer check the HTTP gate does, so a remote caller is turned away before the upgrade; the `TINA4_DEV_ALLOWED_PEERS` opt-in still lets a listed address in. Reported and fixed across all four frameworks.

**The request log keeps query-string secrets out.** The built-in request logger wrote the full URL, so an OAuth (Open Authorization) code, a password-reset token or an API key passed as a query parameter landed in the log. It now records the path alone (Python and Node; PHP and Ruby already did).

**A credential never rides a stack trace or a mistyped URL into a log.** PHP marks every database, MQTT, Messenger and Graph credential `#[\SensitiveParameter]`, so a failed connection's stack trace shows `Object(SensitiveParameterValue)` where the password used to sit; Ruby stops a scheme-less `TINA4_DATABASE_URL` (a one-character typo that drops the `:`) from logging its password in clear. Ruby's dev file-save also follows a dangling symlink to where a write would really land before it checks the project boundary, so a planted link can no longer write outside the project.

**A raw TCP service you can actually write to.** Feature 142 adds a user-facing TCP listener that runs in-process, in the same loop the HTTP server already turns, with `on_connect` / `on_data` / `on_close` callbacks and a small registry so the server can push back to a connected device - the shape a GPS or GPRS tracker gateway needs (ADR-0102). A slow reader that cannot keep up is dropped once its unsent write backlog passes `TINA4_TCP_MAX_BACKLOG` bytes (default 1 MiB, `0` for unbounded), so one stuck client never holds the loop.

**Kafka remembers where it was.** The Kafka queue backend commits consumer-group offsets durably, one per record, and now consumes records that another service produced without a Tina4 envelope, so a consumer advances and survives a restart instead of replaying the topic from the beginning (ADR-0105).

**Frond reads dates both ways, and refuses to guess at a missing end.** The `date` filter accepts a strftime format or Twig/PHP `date()` letters and gives the same English output everywhere (ADR-0103); an unclosed `{% block %}` now fails loudly, naming the block, rather than quietly serving an empty page (ADR-0104); and `form.collect()` sends every selected option of a `<select multiple>`.

**The query builder skips and takes.** `skip()`, `offset()` and `take()` chain on the query builder across all four frameworks.

**Security scanning watches the shipped code.** CodeQL static analysis runs on Python, Ruby and Node (JavaScript and TypeScript); PHP, which CodeQL does not analyse, keeps its own syntax and style gates.

Every change is held down by a real, no-mock test proven by mutation. The framework still has no required runtime dependencies, and the full advisory detail for each fix is on the project's security page.

## v3.13.157 (2026-11-02) - A guard so the four stay in lockstep

**Frond's malformed-`{% endblock %}` contract gets a parity regression guard.** PHP's token-bounded template parser is already immune to the hang fixed earlier in Python, and a new test locks that contract in. The version bump keeps all four frameworks on one number.

## v3.13.156 (2026-11-01) - Kafka reads where you tell it, produces what the other side expects, and migrate's hints point at commands that exist

**A new Kafka consumer group can start at the end, not the beginning.** The consumer's `auto.offset.reset` was wired to `earliest` with no way out, so the first time a group ran it replayed every retained message - one report hit roughly 230,000 of them hammering downstream on a cold start. Set `TINA4_KAFKA_AUTO_OFFSET_RESET=latest` (or the bare `KAFKA_AUTO_OFFSET_RESET`) to skip the backlog and read only what arrives next; it still defaults to `earliest`, so nothing changes unless you ask (#263).

**Kafka can produce a bare message for a non-Tina4 reader.** `queue.push(data, raw=True)` (and `produce(..., raw=True)`) now writes the value exactly as given - no `{payload, priority, attempts}` envelope and no injected id - so a service that reads the topic expecting its own top-level schema gets that, not a wrapped job. It is Kafka-only: the file, RabbitMQ and MongoDB backends refuse it by name, because their envelope is the bookkeeping that pop, retries and dead-lettering depend on. The default stays enveloped, and the consume side already unwraps either shape (#264).

**`migrate:create` stops pointing at commands that don't exist.** Its closing hint named `tina4 migrate --rollback` and `tina4 migrate --status`, flags `migrate` rejects - so the first thing a person (or a model following the hint) tried errored. It now names `tina4 migrate:rollback` and `tina4 migrate:status`, the commands that are really there. The same pass closed two quieter gaps: `migrate:status` and the startup auto-migration only looked at `.sql` files while `migrate` applies `.py` migrations too, so a pending `.py` migration was invisible and never ran at boot - all four now share one discovery that sees both (#268).

#263 and #264 landed across all four frameworks; #268 is Python's. Every change is held down by a real, no-mock test proven by mutation. The framework still has no required runtime dependencies.

## v3.13.155 (2026-10-29) - The scaffold's own tests pass, and a high port stops felling the server

**The generated tests pass as written.** Scaffold a fresh app and the tests the generator wrote used to trip on their own secret. It baked an eleven-byte `TINA4_SECRET` into each one, and the framework's auth refuses anything under thirty-two bytes, so the token test failed the moment you ran it. The generator now writes a real `secrets.token_hex(32)` in at generation time, the same way `tina4 init` seeds `.env` (#259).

**Generated handlers stop talking over the event loop.** A `--model` route, the auth routes and the CRUD admin page came out as `async def` yet reached straight for the synchronous ORM, so every request logged the framework's own warning about a blocking call on the loop. They're plain `def` now, and Tina4 runs them in a worker thread, where a blocking query belongs (#261).

**A high port stops felling the dev server.** In debug mode the server opens a second, stable test port at your port plus a thousand, and a main port above 64535 pushed that past the ceiling a port may reach, so the bind threw and the whole server fell over. A harness grabbing a free port hit it constantly. The out-of-range test port is skipped with a word now, and the port you asked for still serves (#260).

All three were Python-only - PHP, Ruby and Node already handled each case - and each is held down by a real, no-mock test proven by mutation. The framework still has no required runtime dependencies.

## v3.13.154 (2026-10-23) - TURN credentials close their doors, and the policy you set is the policy you get

**The TURN relay stops answering strangers.** `GET /api/rtc/config`, which mints short-lived TURN credentials, and the `/ws/rtc/{room}` signalling socket now want a valid token by default (ADR-0101). They used to answer anyone, with no switch to shut them, so the relay sat open to the world. Set `TINA4_RTC_REQUIRE_AUTH=false` for anonymous calling if your app leaned on the open routes - this one is a breaking change.

**A nonce stops silencing the inline content you allowed.** When an app opened inline scripts or styles through `TINA4_CSP`, the per-response nonce still joined the same directive - and a browser ignores `'unsafe-inline'` the moment a nonce lands beside it, so that content had been quietly blocked since 3.13.143. The app's own choice wins now; the strict default policy keeps its nonce (ADR-0100).

**A bare global in a template calls itself.** A zero-argument callable referenced as `{{ g }}`, or tested with `{% if g %}`, is now invoked and its return value used, matching Node - it fires exactly once, and a non-callable global or one that takes parameters is untouched (ADR-0085).

Every change landed across all four frameworks with real, no-mock tests. The framework still has no required runtime dependencies.

## v3.13.153 (2026-10-21) - The AI skills come home

**The dropped skills come back.** Earlier releases shipped a bundle missing some of the AI skills; this one restores tina4-seo and tina4-a11y (#117), and tina4-design's stop-and-wait approval gates (#128). No framework code changed - the release re-tags the restored skills so the install bundle and its CDN mirrors carry them again. The bundle generator now refuses to ship a smaller skill set than the one already published, so a skill cannot silently fall out of the bundle again.

The framework still has no required runtime dependencies.

## v3.13.152 (2026-10-20) - The client reads --help, and Postgres gets back up after a failover

**Postgres recovers even when the first reconnect fails.** A dropped connection whose very next reconnect also failed - a failover caught before the new primary answers - used to wedge the adapter, every statement failing until a restart. It retries past that now and reconnects, at parity across PHP, Ruby and Node too (#242, #244).

**Every command reads `--help`.** `--help` or `-h` on any command prints its usage and changes nothing. The handlers never looked for it before and ran for real: `generate model --help` wrote a model called `--help`, `lint --help` installed ruff, and `migrate --help` created `app.db`.

**An unknown option gets a did-you-mean, not a shrug.** `--feilds` is refused with a nudge toward `--fields` instead of being dropped, a value option given no value is refused instead of crashing, and `--name=value` works beside `--name value`. `generate` refuses a name that starts with `-`, `ai --all` installs every context file as its help promises, and `generate crud --skip-model` finally does what `generate model` always suggested. (`test` still hands its arguments straight to pytest.)

The framework still has no required runtime dependencies.

## v3.13.151 (2026-10-15) - Isolation headers, a hardened S3 client, and an event loop that doesn't stall

**A Cross-Origin-Opener-Policy header, on by default.** The security-header set gains `Cross-Origin-Opener-Policy`, default `same-origin-allow-popups` (`TINA4_COOP`). It keeps OAuth and payment popups working out of the box, and paired with a COEP header it hands a browser app the isolated context that unlocks `SharedArrayBuffer` and WebAssembly threads.

**The S3 storage client fails loud and retries.** The zero-dependency SigV4 client (no boto3) refuses a missing credential with a clear error instead of signing an anonymous request, retries a 429, a 5xx or a dropped connection with capped backoff and honours `Retry-After`, and keeps the endpoint's path prefix so a sub-pathed endpoint still addresses the right bucket (#229).

**The event loop stops blocking.** Session load and save, the WebSocket backplane publish, and realtime chat and upload I/O now run off the asyncio loop, so concurrent requests that touch a blocking session backend no longer queue behind one another.

**CodeQL core findings cleared.** CRUD attributes are de-raw'd, the 302 redirect is guarded, uploaded files are created owner-only, and the CI workflows run least-privilege with SHA-pinned actions.

The README's built-in feature count is corrected to 140, and the release flow itself is now written down at [general/releasing](/general/releasing.md). Every change landed across all four frameworks with real, no-mock tests. The framework still has no required runtime dependencies.

## v3.13.150 (2026-10-11) - The dev dashboard grows up

**The dashboard AI talks to the gateway.** The development dashboard's AI now speaks to the `tina4 ai serve` gateway on port 11435 rather than a model directly - the proxy relays streaming end to end.

**A shared split preview and a data-driven scaffold panel.** `/__dev/split` serves the shared split-preview asset - device frames beside a live preview - and the scaffold panel is driven from the CLI generators, revealing exactly the files a generate call writes.

**Code Landscape finds room.** The metrics bubbles settle on a world sized to the project and spread out; zoom-out works and Fit frames the whole layout instead of cramming it into the viewport.

The framework still has no required runtime dependencies.


## v3.13.149 (2026-10-10) - A CRUD screen out of the box, and the dev-server rough edges come off

**A CRUD screen out of the box.** `Crud.to_crud(request, model=Order)` renders a full admin screen for a model from a single call - a listing, plus create, edit and delete forms, wired to the AutoCrud REST endpoints behind it - so a model earns a working back office without a hand-built page (ADR-0094).

**Startup migrations stop stepping on each other.** With several workers booting at once against a fresh database, the auto-migrate hook could apply the same migration more than once, and a data migration would insert its rows twice. The migration runner now takes one run-wide lock before it reads the pending list and holds it for the whole run: the winner migrates while the rest wait, then re-read the applied set and find nothing pending (#277). PostgreSQL, MySQL and MSSQL hold a native advisory lock; SQLite and Firebird hold an operating-system file lock, which now lives in the system temp directory rather than littering the tracked migrations folder.

**The dev dashboard reaches a Docker box.** The development dashboard and toolbar answer loopback by default, but a browser hitting a published container port arrives from the container-network gateway, so the dashboard refused it (#279). Set `TINA4_DEV_ALLOWED_PEERS` to an IP or CIDR allow-list - matched against the raw socket peer, never a forwarded header - and that box is let in; the static toolbar assets always load, and a viewer the gate refuses gets no toolbar injected, the 500 overlay included.

**A configurable SMTP timeout, reported as a timeout.** The mail client's timeout is configurable now - a constructor argument, else `TINA4_MAIL_TIMEOUT`, else 30 seconds - and a server that accepts the connection then never answers is surfaced as a timeout instead of hanging the request (#278).

**`pgsql://` connects.** `Database.create()` accepts the `pgsql://` scheme as an alias of `postgres`, so a connection string copied from another tool connects instead of being refused (#280).

Every fix landed across all four frameworks with real, no-mock tests proven by mutation. The framework still has no required runtime dependencies.

## v3.13.148 (2026-10-06) - An anonymous request stores no session

A request that never signs in used to be handed a session all the same - a cookie set, a record written, an entry for the store to reap - for state it would never read back. Now a session comes into being only when something is actually put in it: an anonymous visitor who touches no session data gets no cookie and no stored record, so the store stops filling with empty sessions and a cached or crawled page carries no `Set-Cookie`. Sign in, or write a single key, and the session springs up exactly as before. The framework still has no required runtime dependencies.

## v3.13.147 (2026-10-05) - The dev tools answer back instead of falling over

The built-in development Model Context Protocol (MCP) tools used to crash on a bad call. Hand `api_method` a missing or misspelt argument and it fell over with a raw error; ask `database_columns` about a table that isn't there and it handed back an empty list, as if the table were merely empty. Now each tool checks its arguments first and answers in plain words: a missing one reads "missing required argument 'name' (api_method takes class, name)", an unknown one reads the same way, and a table that doesn't exist says "table not found: orders" rather than nothing at all. `route_list` now shows the middleware on each route, so a guarded route reads differently from an open one, and `api_method` fills in its parameters and its return type. The fix landed across all four frameworks at once (tina4-php#271), each with real tests a mutation can still break. The framework still has no required runtime dependencies.

## v3.13.146 (2026-10-04) - The skills get a map

The Tina4 AI skills grew up this release. Each one opens with a contents list and a short legend that says plainly what you may never override, what is a default with a reason behind it, and what is left to your own judgement. The long single files are split by subject into nested references, so a reader fetches only the part they need, and the passages that used to repeat move into one shared home. A new tina4-cli skill covers the client, and the installer now works out for itself which files to fetch and at which version, rather than carrying a frozen list that drifts. The signing story is written down as it really is, the llms.txt pointer is fixed, and one rule sits above the rest: the Tina4 client is installed first, before any Tina4 work begins. It ships whole, across the four package registries and the tina4.com skills bundle.

## v3.13.145 (2026-10-03) - The client keeps its headers, and migrate stops pretending

A few sharp edges came off this release. The Api client will now keep the headers you configured attached to the origin they were set for, so a redirect off to another host no longer carries them along. On the command line, migrate used to shrug and exit clean when it could not reach the database, claiming success for work it never did; it now exits non-zero, so a broken deploy fails loudly instead of quietly. And serve prints its startup banner without marking the response headers as already sent, so the first real request can still set its own. The framework still has no required runtime dependencies.

## v3.13.144 (2026-10-02) - A HEAD request owns up to its length

A HEAD request asks for the headers a GET would send and nothing more, but the server used to answer one with Content-Length: 0, as if there were nothing behind it. Now a routed HEAD runs the very handler a GET would, measures the body it would have returned, and reports exactly that length while sending no body - which is what RFC 7230 asks of it. The readiness guard the test server waits on is unified across all four frameworks on the server's own startup banner, so a boot is trusted only once the right server has announced itself. The framework still has no required runtime dependencies.

## v3.13.143 (2026-10-02) - Inline content runs under the strict policy, and a save stops clobbering

The strict default Content-Security-Policy (CSP) and the framework's own inline content were at odds. The browser refuses any inline style or script unless it carries a nonce the policy header also names, so the dev toolbar and the error overlay went bare. Now a fresh nonce is minted for every response, written into both style-src and script-src, and handed to your templates as csp_nonce(), so the framework's own inline content runs under the strict policy with no 'unsafe-inline' anywhere (ADR-0088). The session grew more careful too: a save will now merge into the stored record rather than overwrite it, so a request that writes one key no longer wipes another's, and a session's deadline slides forward on activity rather than its last change (ADR-0087). The readiness probe the serve tests lean on now waits for the child to announce its own port before it believes /health, which cures a flake at its real cause. The framework still has no required runtime dependencies.

## v3.13.142 (2026-09-30) - The metrics ratchet lands, and a rotated session sticks

**A regenerated session now sticks.** A session that regenerates its id in the middle of a
request re-emits the session cookie, so the browser is handed the new id instead of quietly
holding the old one. That is the behaviour that defeats session fixation: rotate the session
right after a login or a privilege change and the browser follows. This brings Python into
parity with the other three frameworks.

**The complexity comes down.** The last functions scoring a cyclomatic complexity of 40 or
higher are gone, decomposed into named helpers across the ASGI app, the ORM save and
create-table paths, the AI message translator, Frond resolution, and the SQL statement
splitter. Duplicated logic is now shared once - the LIMIT/OFFSET clause on the base adapter,
the has-many paging loop, WebSocket room membership, rate-limit enforcement, and the queue
dead-letter and retry path.

**A gate that ratchets quality.** The canonical `TINA4_TEST_NATS_URL` joins the shared test-env set, so
the NATS URL is named the same way everywhere (ADR-0038). A new `tina4 metrics
--fail-on-regression` gate now stands watch in continuous integration: it compares against a
committed baseline and fails the build the moment a file grows more complex or less
maintainable, so the cleanup above cannot quietly slide back (ADR-0002). The framework still
has no required runtime dependencies.

## v3.13.141 (2026-09-29) - A committed symlink now fails the build

A committed symbolic link now fails the build. Git records a symlink with mode 120000, and
Windows extraction - 7-Zip, and so Composer on Windows - refuses those dangerous link paths,
so a single leaked link breaks every Windows install. A new guard walks the git index,
rejects any such file and names it, and a continuous-integration step runs it on every push
and pull request. Its test is mutation-proof: it stages a real symlink in a real temporary
repository and proves the guard bites. This is a small hardening release, parity with the
tina4-php fix for the same Windows-and-Composer breakage, where a leaked container conf.d
snapshot had shipped 134 absolute symlinks. tina4-python carries none today, and the guard
keeps it that way. The framework still has no required runtime dependencies.

## v3.13.140 (2026-09-28) - crud stops double-pluralising, and two CI gates land

**The crud generator stops double-pluralising.** A `Category` resource now writes
`categories` for its route and template names, not `categoriess`. Alongside it, SQLite path
resolution is hardened: a relative database path that would escape the project root is
refused, and any missing parent directories are created 0775 (ADR-0086). The async database
layer asks for the running event loop through a supported check instead of a private call,
and the connection-pool default is now written down (ADR-0074).

**Two gates land in continuous integration.** A doc-drift audit fails the build when the
packaged CLAUDE.md or the AI skills describe an API the code does not have, and
generator-parity coverage keeps the crud output honest. Alongside them the CLAUDE.md CRUD
example is corrected, the web-push skill mirrors are synced to their canonical source, and
the http-hardening module is un-ignored so its tests actually run. The AI-skill stale-check
resolves correctly and warns on addGlobal closures. The framework still has no required
runtime dependencies.

## v3.13.139 (2026-09-26) - SSRF guards, a protected release, and dev binds loopback

**Outbound requests are guarded against SSRF.** Requests from the Api client and Web Push
refuse private, loopback and link-local targets unless you explicitly allow them (ADR-0084).
Server-Side Request Forgery (SSRF) is tricking the server into calling an address it should
never reach, and this shuts that door. The development admin surface is hardened too: the
health endpoint no longer discloses the framework version outside debug, and development
binds loopback by default (ADR-0078).

**Tokens cannot be forged, and dead-letters report honestly.** Production refuses to boot with
a blank or short HMAC secret, so tokens cannot be forged (ADR-0079). Queue `reject()`
dead-letters immediately and `size("dead")` reports the dead-letter depth (ADR-0022,
ADR-0023). Session-table first use is concurrency-safe across every engine, and mail
encryption follows the configured TLS/STARTTLS contract (ADR-0071). Log output,
driver-install hints and WSDL and mail diagnostics redact credentials and URLs.

**Publishing is gated.** Releases now run behind a protected environment with release actions
pinned by commit SHA, and a medium-severity API token-leak path is closed. The framework
still has no required runtime dependencies.

## v3.13.138 (2026-09-24) - Safer requests, templates, and database operations

**Licensing from this release.** Tina4 is available under MPL-2.0, with separate commercial terms available from Code Infinity. Copyright Code Infinity. Previously published releases retain their original licences.

This release brings together the framework hardening work, database correctness fixes,
measured-time guidance for the AI skills, and verifiable release artifacts.

**Request and template boundaries.** Frond escapes output by default and preserves only
explicitly trusted output. Review templates that intentionally render HTML when upgrading;
never mark untrusted input as safe. Header validation, request-body limits, security headers,
CORS handling, model-field validation, and diagnostic redaction follow the shared contracts.
Explicit Content-Type headers survive response conversion and binary bodies preserve bytes.

**Credentials and development access.** API clients retain credentials only for their configured
origin, including uploads, downloads and streams. Use a separate client when authenticating to
another service. Forwarded host and protocol require a trusted proxy. Development reads and
writes enforce the raw-peer, Host and browser-origin boundary; remote non-MCP development
access requires the dedicated token. The documented MCP transport API-key fallback is unchanged.
File access checks resolved paths so symlinks cannot expose secrets or escape the project.

**Database and service correctness.** Statements that return rows retain those rows, filtered
counts and write results agree across adapters, SQL placeholders preserve literal text, and
ORM fields mapped to database columns read back correctly. Database operations and explicit
transactions reserve their connection; a fully occupied pool fails clearly instead of sharing
an in-use connection. Session transports reuse MongoDB connections and handle replica-set
replies. Mail transports verify certificates and require STARTTLS when configured. Optional
driver errors identify the needed install, and unconfirmed broker writes fail clearly.

**Skills and release evidence.** The maintainer skill estimates work from measured agent
durations. Release packages carry checksums, an SPDX software inventory, and build provenance;
release Actions are pinned to commits. The updated PowerShell skills installer is digitally
signed. The ISO programme remains in progress; this release makes no certification or
conformance claim.

The accompanying CLI 3.8.91 verifies update checksums before replacing an installed binary,
refuses missing checksum manifests, and corrects generated Node.js package imports. It also
includes the browser-opening and CI behavior fixes. Tina4 JS 1.7.2
ships the merged client hardening and verified browser bundle. Refresh the AI skills with
`curl -fsSL https://tina4.com/install-skills.sh | sh` or the documented PowerShell installer.

## v3.13.137 (2026-09-23) - Gemini joins the Ai client, and Web Push needs nothing on Linux

Google Gemini becomes a first-class Ai provider, Web Push drops its last server dependency,
and two smaller fixes tidy the dev toolbar and the v2 upgrade.

**Gemini rides the OpenAI wire.** Set `TINA4_AI_PROVIDER=gemini` with a `TINA4_AI_KEY` and
`Ai.chat` / `Ai.embed` reach Google Gemini through its OpenAI-compatible endpoint. Chat,
streaming, tool use, retries and embeddings all come back in the same normalised shape every
other provider returns, and nothing new is installed: Gemini is a thin alias over the OpenAI
wire family, so the whole provider is a base URL, an endpoint suffix, and a Bearer key.

**Web Push needs nothing installed on Linux.** The RFC 8291 crypto now runs through the
operating system's OpenSSL (libcrypto) by ctypes, so a Linux host signs and sends a push with
no extra package; a development Mac or Windows box falls back to the cryptography package. The
bytes on the wire are identical either way, so a push signed on a laptop and one signed on the
server are the same push.

**The dev toolbar keeps out of an empty response.** A 204 No Content response carries no body,
so injecting the dev toolbar into it produced a response that was no longer empty and no
longer valid. The toolbar is skipped for a 204 now, and the response goes back untouched.

**The v2 to v3 migration upgrade reads an old name correctly.** A v2 migration whose recorded
name still carried its `.sql` extension was matched against the extensionless v3 name and
looked unapplied, so the upgrade could try to replay it. The extension is stripped when the v2
description is resolved, so an upgraded app leaves already-run migrations alone.

## v3.13.136 (2026-09-09) - Build to the journeys, and a new design skill

The headline is not a method you call. It is how the AI skills plan and build a Tina4 app.
Complex apps rarely break inside a feature. They break in the seams between features: a goal
no feature owns, a step with no owner, a flow that crosses three components untraced. This
release teaches the skills to map those seams before they cut a feature, adds a skill that
designs your brand and UI, and ships three framework fixes underneath.

**The architect skill maps goals, journeys, and system flows before it scaffolds a file.**
The stack decisions say what you build on. They say nothing about what a person is trying to
achieve, how they move to achieve it, or how a request travels to make it happen. A new
Phase 2 fills that gap. It names the goals, draws one user journey per goal - numbered end to
end, with the exit at every step: abandon, refresh, no permission, error - and traces the
system flow for each load-bearing action, marking every boundary it crosses (a queue, a
WebSocket, an external call) as a seam that owns a test. Features are derived from journeys
now, never invented.

**A completeness net catches what complex builds forget.** The happy path is the easy fifth.
The net walks the rest for every journey and every feature: each empty and error screen, each
journey edge, authz on every route, the concurrency race, what the user sees when a dependency
is down. Each item becomes a feature, an ADR, or an explicit "not needed, because X". A silent
"we never thought about it" is the exact bug the net exists to catch.

**A visible marker for invisible work.** Mapping or tracing a journey or a flow is
load-bearing and easy to skip, so the skills mark it: the agent opens its reply with a map
marker (`🗺️`) and labels the artifacts it touched. The marker is a promise that the journeys
and flows are being mapped, not assumed. If a build is underway and you have not seen it, the
seams have not been walked.

**The developer skill builds to the journeys.** When `plan/` carries journeys and flows, the
developer skill treats them as the spec: build in journey order, trace every route and model
back to a journey step, walk the completeness net per feature, and prove the journey end to
end against real dependencies before a task is done. It also points you to the right sibling
skill - the new design skill for a brand and UI, tina4-js for a reactive frontend, back to the
architect for a new architectural decision.

**A new tina4-design skill.** Give it a logo or a blank page. It runs the whole chain: client
intake, market research, the design-system decisions, then a brand guidelines document and an
interactive UI component guide. It writes `DESIGN.md`, `brand-guidelines.html`, and
`ui-guide.html` into a `design/` folder, so you build the UI against real tokens instead of
hand-picked CSS. It works for any industry, any Tina4 backend, or no backend at all.

Refresh the skills with `curl -fsSL https://tina4.com/install-skills.sh | sh`.

Underneath the skills, three fixes:

**Swagger stops answering a route miss with a UI that cannot load.** The bundled Swagger UI
pointed at a document that does not exist, so a request that missed every route returned a
docs page that never finished loading. It now points at a document that exists, and a static
gate test holds the behaviour in place.

**Database drivers load only when you use them.** Tina4 registers its database adapters
lazily. Importing the framework no longer loads a driver you never asked for, so an app on
SQLite never pays to import the Postgres or Firebird driver. The unused driver never loads.

**The zero-dependency promise is a test now, not a claim.** Importing the Tina4 feature
surface pulls in nothing outside the standard library. A new guard test imports the surface
and fails if a third-party runtime dependency rides along, so a stray import can never quietly
break the promise that core Tina4 stands alone.

## v3.13.135 (2026-09-08) - An honest version check, and a Web Push key fix

Two fixes you can see, plus a clean-up that puts all four frameworks back in the green.

**The version check no longer claims "up to date" for a check it never made.** The dev
toolbar asks PyPI for the latest version. On any failure - offline, a timeout, a blocked
route - it used to fall back to reporting the running version as the latest, and the
toolbar drew that as a green "You are up to date!". A developer several releases behind,
on a machine with no route out, was told the opposite of the truth. The check now returns
no version and a reason when it cannot reach the registry, and the toolbar says it could
not check. Set `TINA4_VERSION_CHECK_URL` to point it at a mirror.

**Web Push keys are always the right width.** OpenSSL and its kin return raw P-256 key
material with a leading zero byte stripped, so roughly one VAPID key in 140 came out a
byte short - a malformed public key a push service rejects. Every P-256 coordinate,
private scalar, and ECDH secret is now padded to its fixed 32-byte width. Python was
already correct here through its cryptography backend, and now carries a guard test to
keep it that way; the real fix lands in PHP, Ruby, and Node.

The release also clears the test and CI drift that had built up since 3.13.134, so a
clean run is green across Python, PHP, Ruby, and Node.

## v3.13.134 (2026-09-05) - Web Push and skills parity

Feature 140 Web Push is now available through the provider-neutral push API. The
runtime returns native result envelopes, fails closed when push is configured
without a usable provider, and keeps the Python cryptography support in the
documented optional `push` extra. The developer skills for Python, PHP, Ruby,
Node.js, and tina4-js now include the Web Push API and configuration guidance.

## v3.13.133 (2026-09-05) - A maintainability pass: the biggest functions, decomposed

No behavior changes. This release breaks the framework's most complex functions into
small, single-purpose helpers, so the code is easier to read, test, and change - and
the numbers prove nothing moved.

- **Swagger generation, decomposed (Python, PHP, Node).** `Swagger.generate` was one
  giant function (cyclomatic complexity 64 in Python, 83 in PHP, 52 in Node). It is
  now a flat orchestrator over named helpers: build the info block, the paths, the
  component schemas, the per-route security. The emitted OpenAPI document is
  byte-for-byte identical, proven by hashing the full spec before and after across
  dozens of route shapes. Ruby's generator was already lean.
- **The dev-admin dispatcher, split (Ruby).** `handle_request` was a single
  138-branch method routing every dev-admin path. It is now a small dispatcher that
  hands each concern to its own method. Every route, response, and the localhost/auth
  gate are unchanged, verified line by line.

Nothing you call changes. Same routes, same JSON, same OpenAPI. The win is for the
people who read and maintain the code: the complexity that made these functions risky
to touch is gone.

## v3.13.132 (2026-09-04) - ORM reads carry the total, and Firebird holds its connection

The headline is pagination. Every ORM read that returns a page now hands back the
total count with it, so you can render "page 3 of 13" without a second query. The
release also fixes localhost on Windows, settles two Firebird lifecycle bugs, and
trims the dev-admin dashboard.

**ORM reads return a ModelCollection that carries the total (ADR-0064).** `where`,
`select`, `find` (filter form), `all`, and `with_trashed` used to return a bare list
and throw away a total the database had already counted. They now return a
ModelCollection. It IS the page of models - iterate it, index it, count it,
JSON-serialise it, every existing line still works - and it also carries the full
count for the filter, ignoring limit and offset.

```python
rows = User.where("active = ?", [1], limit=20)   # a page of 20 models
rows.get_total_records()   # 250 - the whole matching set, ignores limit/offset
rows.to_paginate()         # {records, total, page, per_page, total_pages, limit, offset}
```

The total is free: it reuses the count the query already ran, so no second query
fires. The accessor is a method, not a `.count` property, because the list type
already owns `count`. Python and Ruby name it `get_total_records()` / `to_paginate()`;
PHP and Node name it `getTotalRecords()` / `toPaginate()`. Same concept, the same
seven-key envelope, the same JSON in all four frameworks. Python's old
`where(..., with_count=True)` tuple is gone: fetch the page, then call
`get_total_records()`. PHP is the one framework whose return type changes, from a
bare `array` to a ModelCollection object; it stays `foreach`-able, `count()`-able,
and `json_encode`-able, and `->toArray()` returns the plain array for native
`array_map` / `array_filter`.

**localhost works on Windows again.** The dev server now binds dual-stack loopback.
Windows resolves `localhost` to IPv6 `::1` first, which used to miss a server bound
only on IPv4; the server now listens on both, so the browser connects either way.

**Firebird stops looking like a hang, and lets go cleanly (Python).** `execute()`
read the cursor row count after every statement, and the modern firebird-driver
keeps no row count for a `CREATE TABLE` or `DROP TABLE` and raised on the read - so
every Firebird migration failed and the run looked frozen. DDL now reports zero
rows. And a Firebird database dropped without `close()` no longer leaves the
driver's finalizer to warn at garbage collection: the adapter settles the
transaction and detaches first.

**A lighter dev-admin.** The in-dashboard agent chat surface is gone, out with the
CLI agent subsystem it talked to, and the dashboard stops reloading itself on every
edit. The editor, MCP tools, and metrics stay.

Under the hood the Valkey session handler subclasses Redis instead of copying it,
and shared fetch, execute, and Frond block loops move into one place - a few hundred
duplicated lines gone, behaviour unchanged. On the test side, the concurrent
`getNextId` check spawns fresh worker processes so it survives fork-hostile
extensions (PHP), and a new `lab-verify.sh` runs all four suites green in minutes
with every trap recorded in `LAB-VERIFY.md`.


## v3.13.131 (2026-09-03) - AI skills: plain English, ask-first, no-MCP grounding

The 3.13.130 discipline pass gets a follow-up for a global team. Most Tina4
engineers do not read English first, so the skills now write for them. Four
additive changes; the personality stays:

- **Plain English for a global team.** Short common words, short sentences, one
  idea each. No idioms, no slang, no metaphors. An acronym is spelled out the
  first time it appears.
- **Keep it short.** The answer or the code comes first, then the reply stops.
  Under about 150 words unless you asked for a document or a report.
- **Match the effort to the task.** A health route is a health route, not a
  health subsystem. A small task gets a small answer and a short thought.
- **Ask before you guess.** When the choice is really yours (which backend,
  which trade-off), the skill asks up to three short pick-one questions before
  it writes, instead of guessing.

The skills also gain a grounding path for tools without the coder server: start
at https://tina4.com/llms.txt, then ask https://rag.tina4.com/v1/ask, and use the
live `/__dev/mcp` tools once `tina4 serve` is running.

Refresh your skills with `curl -fsSL https://tina4.com/install-skills.sh | sh`.

## v3.13.130 (2026-09-02) - Sharper AI skills: objective, verified, terse

The Tina4 AI skills got a discipline pass. An eager model fills silence with
agreement and ceremony; the developer and maintainer skills now push back on it.

Three changes, all additive - the personality stays:

- **Objective on ideas.** The skill assesses a design on its merits and disagrees
  when it is weak, instead of handing back a reflexive "great idea" you cannot
  trust.
- **Claim only what you verified.** A blocker - "we can't deploy", "the server is
  broken", "you're on a weak model" - is checked before it is stated, or marked
  unverified. No guessed failure sends you chasing a non-problem.
- **Chat, do not narrate.** Lead with the result in a few lines. No echoing the
  request back, no filler reassurances, no stacked "I'll..." lines, no per-step
  "Now:" prefix, and internal bookkeeping stays silent.

Refresh your skills with `curl -fsSL https://tina4.com/install-skills.sh | sh`.

## v3.13.129 (2026-09-02) - generate model stops renaming your table in silence

`tina4 generate model Order` has a reserved word to handle: `order` breaks
`CREATE TABLE`, so every framework already pluralised the table to `orders`. The
catch was the silence. An agent that then wrote a route for `/order` or a raw
query against `order` failed downstream with no clue the table had been renamed
under it.

Now the scaffolder says so. It still pluralises the reserved name, the safe
choice, but it prints a one-line note that names the rename and points at the
escape hatch. `--table-name <name>` sets any table name you want. Force a reserved
name on purpose and it warns you, once, that Tina4 interpolates table names
unquoted, so the quoting in your raw SQL is yours to own.

What it will not do is quote the identifier for you. Quoting is a global storage
invariant, not a local fix. It flips per-engine case-folding, and quoting the
write while the schema lookup stays unquoted returns no primary key, so a keyed
update matches every row or none. That is data loss, not a syntax error, and it
breaks every existing unquoted schema on upgrade. So the reserved `--quote` path
the resolution envelope used to advertise is gone. The agent-facing `override`
hint now points at `--table-name`, the one escape hatch that is safe.

The rename was never the bug. The silence was. See ADR-0062 for the full reasoning.

## v3.13.128 (2026-08-29) - tina4 lint: one command, zero shipped linters

Every framework carried a different half-answer to linting. Python and Ruby
declared a linter in their dev manifest. PHP shipped a `composer lint` that
pointed at a tool it never installed, so it failed on a fresh checkout. Node had
no linter at all. And none of them had a `tina4 lint` command.

Now all four do, with one contract. `tina4 lint` lints the app's own source
(`src/` plus the entry file). It runs the project's linter -- ruff on Python,
phpcs on PHP, rubocop on Ruby, eslint on Node -- and installs it as a dev
dependency on demand the first time you run the command. Running the command is
the consent: the linter lands in dev dependencies, never in the app's runtime, so
a Tina4 app stays zero-dependency. `--no-install` skips that step (for CI or an
offline box) and falls back to a zero-dependency syntax baseline -- `compile()`,
`php -l`, `ruby -c`, `tsc --noEmit` -- that never executes your code. `--fix`
applies the linter's safe autofixes. Exit 0 is clean; non-zero means findings.

The framework itself now ships no linter. `ruff` left Python's dev group, `rubocop`
left Ruby's gemspec, and PHP's broken `composer lint` now points at `tina4 lint`.
Each framework lints its own code by dogfooding the command.

Real tests, no mocks: each baseline parses real files, and the install test runs a
real `uv add` / `composer require` / `bundle add` / `npm i` in a throwaway project,
reads the mutated manifest back, and confirms the linter -- not the baseline -- then
runs. On Node, eslint lints TypeScript through typescript-eslint, at parity with
ruff on Python.

This release also fixes a version drift. The PHP boot banner and Python's version
fallback each read a hardcoded constant that the 3.13.126 and 3.13.127 bumps never
updated, so a genuinely up-to-date install could report an older version. Both now
track the release, and a version-consistency test in every framework guards the
drift from returning.

## v3.13.127 (2026-08-29) - Booleans reach SQL Server and Firebird as 1/0

A bare `TRUE` or `FALSE` needs translating for an engine that stores a boolean as
an integer. Python did this on both SQL Server and Firebird. The others did not:
the SQL Server adapters in Node, PHP and Ruby translated `AUTOINCREMENT` and the
column types but skipped the boolean, and Ruby skipped it on Firebird too. So
`WHERE active = TRUE` reached SQL Server (and Firebird) untranslated.

Every adapter now wires the boolean translation into its apply-time path, in the
same order as the Python master: auto-increment, then boolean, then column types.
A bare `TRUE` becomes `1` and `FALSE` becomes `0`. A `TRUE` or `FALSE` inside a
string literal is data, so `label = 'TRUE'` survives untouched.

Ruby gained a `translate_sql` seam on its SQL Server and Firebird drivers, matching
Node's `translateSql` and Python's `_translate_sql`, so the translation is one
named method instead of three inline calls.

Real tests, no mocks: each adapter's translate path turns a bare `TRUE`/`FALSE`
into `1`/`0` and preserves a quoted `'TRUE'`. The Ruby driver refactor was
re-verified against live SQL Server and Firebird on the lab.

## v3.13.126 (2026-08-29) - Product tables get product names

The fake-data seeder gave every text column a person name. Seed a
`products` table and its `name` column filled with "John Smith", never
"Wireless Keyboard". The demo looked wrong the moment anyone opened it.

The seeder now reads the table. A `name` or `title` column on a
product-ish table (products, items, catalog, inventory, sku, listing,
stock, ware) seeds a product name built from an adjective and a noun,
like "Rugged Charger". Every other table still gets a person name, so
nothing else changes. A new `product()` generator backs it, deterministic
under a seed, so one seed produces the same catalogue every run.

The table threads through every seed path: the ORM seeder, the auto
field-map, the dev-admin seed endpoint, and the MCP seed tool all honour
it. With no table in context the seeder falls back to a person name, so
existing callers keep their behaviour.

Real tests, no mocks: each framework seeds a real SQLite Product model
and a real User model and reads the rows back. The product and person
word banks share no first word, so the first token of a value proves
which generator ran.

The generator is `FakeData.product()` in Python, `product()` on the
seeder in Node, `FakeData#product` in Ruby, and `FakeData::product()` in
PHP.

## v3.13.125 (2026-08-29) - Scaffolded migrations apply on every engine

`tina4 generate migration` (and `migrate:create`, and `generate model`)
wrote SQLite-only DDL: `TEXT`, `REAL`, and `CREATE TABLE IF NOT EXISTS`.
The database adapters translated only the `AUTOINCREMENT` keyword on the
way in, so those SQLite types passed straight through. Firebird has no
`TEXT` type (`-607`) and no `REAL`, and neither Firebird nor SQL Server
accepts `CREATE TABLE IF NOT EXISTS`, so a generated migration failed to
apply on those engines.

A new `SQLTranslator.ddl_types(sql, engine)` completes the apply-time
translation. On Firebird it maps `TEXT` to `BLOB SUB_TYPE TEXT` and
`REAL` to `DOUBLE PRECISION`, and strips `IF NOT EXISTS`; on SQL Server
it strips `IF NOT EXISTS` and maps `TIMESTAMP` to `DATETIME2`; on MySQL
it maps `TIMESTAMP` to `DATETIME`. It rewrites `CREATE TABLE` / `ALTER
TABLE` only, so a query or insert is never touched. Because every
statement routes through the adapter, the one fix covers migrations, the
ORM's create-table path, and hand-written DDL.

The generator now emits portable canonical types: `VARCHAR(255)` for
strings and `TIMESTAMP` for datetimes (including `created_at`), instead
of SQLite `TEXT`.

Verified end-to-end against a live Firebird 5: a generated migration
applies and a row round-trips (a text column through `BLOB SUB_TYPE
TEXT`, a float through `DOUBLE PRECISION`), in all four frameworks on the
lab.

## v3.13.124 (2026-08-29) - Database session backend works on Firebird

The database session backend now works on Firebird in all four
frameworks, and every framework's session-engine test exercises it so
the gap cannot reopen.

Python's `DatabaseSessionHandler` created its `tina4_session` table with
a single `data TEXT` statement for every engine. Firebird has no `TEXT`
type, so on Firebird the CREATE failed with `-607 "Specified domain or
source column TEXT does not exist"` and the database session backend
never worked there. Python now overrides only the Firebird statement
(payload column `VARCHAR(8191)`), matching PHP, Ruby and Node, which
already carried a per-engine Firebird branch. The four other engines
keep the portable statement that already worked, so nothing else
changes.

Verified end-to-end against a live Firebird 5.0.4: a nested session
payload written by one handler and read back by a fresh one round-trips
intact through the VARCHAR column, the row is confirmed out of band on
the engine itself, and the table is created with Firebird's UPPER-cased
`SESSION_ID` / `DATA` / `EXPIRES_AT` shape. The read path already worked
because each adapter folds Firebird's UPPER-cased identifiers back to
lower case.

The "session backend works on every engine it claims" test excluded
Firebird in Python, PHP and Node (Ruby already covered it) - which is
exactly how a Firebird-incompatible session DDL stayed hidden. Each now
includes Firebird when a live server is configured
(`TINA4_TEST_FIREBIRD_URL`), and PHP's runs in the CI Firebird job.

Parity: shipped in all four backends at the same tag. No API change.


## v3.13.123 (2026-08-28) - Queue scaffolding speaks the AI-fill envelope

`tina4 generate queue <topic>` now returns the same `generate_v1_1`
envelope the model and route generators do: `edit_hints[]` naming the
exact line to fill (the job handler) and `next[]` naming what to run
after (produce a job, start the worker). Before this, a scaffolded
queue consumer landed with no guidance - a logic-shaped generator that
dropped a file and went silent about what to edit next. The consumer
templates already baked the `tina4:edit` marker; it just was never
lifted into the envelope on two of the four frameworks. Now all four
are at parity, so an AI agent (or a person) scaffolds a consumer and
immediately knows what to fill and where. `service` and `seeder`
follow next.

Also in this release: the secure-route session handoff
(tina4-nodejs#57) is verified and parity-locked. A secure GET
authenticated by the returned session cookie hands the handler the
validated principal, the session, and the cookies - and each framework
now carries a real no-mock regression test (driving the real dispatcher
and reading the real log) so the behaviour cannot silently regress.

## v3.13.122 (2026-08-28) - The default CSP no longer fails silently

`SecurityHeadersMiddleware` ships `Content-Security-Policy: default-src
'self'` by default, and that default is right: it is secure-by-default
hardening every app gets for free. But when an app leaves `TINA4_CSP`
unset and then relies on something the policy blocks - styles injected
from JavaScript at runtime, a font or script from a CDN, a `data:` URI,
or a WebSocket/XHR to a different host (a separate API or a LiveKit
server) - the browser refuses it silently. The deploy goes green, the
health check passes, and the breakage only shows up in the browser
console long after.

This release keeps the secure default and fixes the silence. When the
default CSP is in force because `TINA4_CSP` is unset, the framework now
logs one warning at startup naming the header, what it can block, and
the `TINA4_CSP` escape hatch. It warns, it never fails: logging a
heads-up must never be the reason `tina4 serve` or a production boot
dies, and it never blocks a request. The warning fires once per
process, and only when `TINA4_CSP` is absent - setting it to any value
(an explicit policy, or even empty) is treated as opting in and stays
quiet. The CSP header itself is unchanged.

Parity across Python, PHP, Ruby, and Node.js, each with a real no-mock
test that drives the actual request path and reads the real log.
Reported as tina4-nodejs#61.

## v3.13.121 (2026-08-27) - Every migration surface speaks the envelope + a pre-tag release guard

Every way to create a migration now emits the same ADR-0063
`generate_v1_1` envelope - the one with `edit_hints[]`, `next[]`, and
the surfaced `test_paths[]`. Before this release, `tina4 generate
migration` emitted the envelope but the sibling surfaces did not: the
CLI `tina4 migrate:create`, the MCP `migration_create` tool, and (in
Ruby) the dev-admin scaffold endpoint each wrote a bare file with no
guidance. An AI agent that reached for the shorter command, or drove
the framework over MCP, got nothing to act on next.

Now they converge:

- **`tina4 migrate:create <desc>`** delegates to the same generator
  as `tina4 generate migration`. Same file, same markers, same
  envelope. Neither command is deprecated - `migrate:create` is the
  short form, `generate migration` composes with `--fields`.
- MCP `migration_create` returns `{created, resolution, ok}`.

The edit-hint scanner also widened. It now matches four comment
styles - `//`, `#`, `--`, and Twig `{# ... #}` - so Twig and SQL
templates surface their `tina4:edit` markers in `edit_hints[]` too,
not just the code templates. `tina4 generate form`, `generate view`,
and `generate migration` now all report an `Edit these lines:` block.

### Pre-tag version-consistency precheck

A recurring release miss - a version bump that touches some
version-bearing files but not others - now fails on the release
worker's own machine instead of on the CI publish gate after the tag
is already public. Each backend ships a precheck script that takes
the intended version and asserts every version-bearing file agrees,
naming any file left behind. Run it before `git tag`; the recipe
lives in each repo's `RELEASING.md`.

Parity: shipped in all four backends at the same tag. The
tina4-developer skill references were updated to document every
migration surface.


## v3.13.120 (2026-08-27) - Scaffolding envelope v1.1: edit-hints, next-steps, and the new tina4-architect skill

Every `tina4 generate` verb now tells the caller not just WHERE files
went, but WHAT TO EDIT next and WHAT TO DO after. The resolution
envelope bumps additively to `generate_v1_1`, ratified by ADR-0063 in
`tina4-documentation/plan/v3/decisions/`.

Three additions:

- **`resolution.edit_hints[]`** - every generator template now carries
  `tina4:edit <label>` markers at the spots a first-time user will
  edit. The envelope surfaces each marker's file, line, and short
  actionable label. Example:

  ```
  Edit these lines:
    src/orm/Order.py:14   add fields here
    src/orm/Order.py:16   add relationships here
  ```

- **`resolution.next[]`** - a short list of actionable next steps the
  generator names for the verb it just ran. Example:

  ```
  Next:
    1. Edit src/orm/Order.py to add fields beyond the default 'name'
    2. Apply the migration:  tina4 migrate
    3. Try it:               tina4 serve  ->  curl http://localhost:7146/orders
    4. Add CRUD scaffolding: tina4 generate crud Order --skip-model
  ```

- **`resolution.test_paths[]` surfaced.** The envelope has carried this
  key since v1 but the human stderr block never printed it. Now the
  block includes a `tests` line alongside `class` / `table` / `routes`
  / `migration`.

`commands --json` advertises the new envelope:

```json
{
  "commands": [ /* ... */ ],
  "resolution_contract": {
    "version": "1.1",
    "envelope": "generate_v1_1"
  }
}
```

Every `v1` key is preserved. Existing `--json` consumers stay valid.
Callers that read `next[]` or `edit_hints[]` know they need envelope
`>= 1.1`.

All 15 verbs' templates carry markers (Python files scan uniformly).

Marker syntax is language-native: `# tina4:edit <label>` in
Python/Ruby, `// tina4:edit <label>` in PHP/Node. Comments have zero
runtime effect; users strip them freely when done. A project-wide
`grep -rn 'tina4:edit' src/` doubles as a "what still needs my
attention" tracker.

Test contract: 5 real-subprocess tests per language including a
mutation-gate on the marker parser (strip a marker in a copy of the
generated file; the resolution entry disappears; restore; the entry
returns). No mocks.

### New skill: tina4-architect

Fires at the start of a project - before any file is scaffolded - and
walks nine decisions: backend language, frontend approach, database,
auth, cache and queue, realtime, AI, deployment, and project layout.
Records the choices in a `TINA4.md` at project root and seeds a
`plan/` folder using a sub-project `MASTER.md` hierarchy:

- `plan/MASTER.md` is the top-level index. Every sub-project has its
  own `plan/MASTER.md` that links back.
- Each task lives in `plan/<task>/PLAN.md`. Behaviour lives in
  `plan/<task>/features/<feature>.md`. `PLAN.md` is pointers, not
  descriptions.
- ADRs live under `plan/decisions/` at each level.

Hands off to `tina4-developer-<language>` once `TINA4.md` is locked.
Never runs on an already-scaffolded project unless the user explicitly
asks to re-architect.

The installer now ships seven skills:

```bash
curl -fsSL https://tina4.com/install-skills.sh | TINA4_SKILLS_TARGET=all sh
```

Parity: shipped in all four backends at the same tag.


## v3.13.119 (2026-08-26) - Parity bump

Version-parity bump. No Python framework code changes; the version
aligns with tina4-php 3.13.119 (which ships @MichaelC8E's skill-repair
PR, @cwvermaak-codeinfinity's Messenger AUTH/STARTTLS negotiation fix,
and the ImportHelper autoload non-throw fix), tina4-ruby 3.13.119
(which ships @MichaelC8E's skill-repair PR + a CLAUDE.md footer
consistency bump), and tina4-nodejs 3.13.119 (parity).

Python already carried the 3.13.118 regression fix
(@MichaelC8E's tina4-python#124 fixed the `_import_helper.py`
pre-import defect); no further Python change is required in this
release.


## v3.13.118 (2026-08-26) - Regression fix: `_import_helper` no longer pre-imports the tree

Emergency patch on 3.13.117. @MichaelC8E's tina4-python#124 fixed a
regression in the 3.13.117 import-hint finder that pre-imported every
subpackage on bare `import tina4_python`, breaking lazy loading and
shadowing the `realtime()` callable.

The finder in 3.13.117 used `pkgutil.walk_packages(pkg.__path__,
prefix=...)` to enumerate the suggestion set. That call IMPORTS every
subpackage it descends into (recursion needs each subpackage's
`__path__`, which Python populates only after import). The finder is
installed from `tina4_python/__init__.py` at import time, so on a
bare `import tina4_python` the finder was constructed, which walked,
which imported every optional subsystem. Two visible effects:

- Lazy loading was defeated. Every optional subsystem loaded on a
  bare import.
- `tina4_python.realtime` resolved to the MODULE, shadowing the
  callable `__getattr__` was there to provide.
  `realtime(features=[...])` raised
  `TypeError: 'module' object is not callable`.

Fix:

- `_import_helper.py::_walk()` now uses `pkgutil.iter_modules` (no
  recursion, no import) plus a filesystem walk under `pkg.__path__`
  for depth, keyed on `.py` files. The tree is enumerated without
  being executed.
- New regression test `tests/test_import_helper_does_not_import_the_tree.py`
  runs each check in a fresh interpreter subprocess and asserts both
  that the loaded-module set stays small AND that `tina4_python.realtime`
  is still callable.
- Bonus in the same PR: two holes in the skill-drift gate closed
  (`scripts/sync-tina4-skills.sh` was comparing one tree of three
  and reporting `OK` having compared nothing), plus the stale
  `CLAUDE.md` version footer.

Result on v3: 20 test failures -> 0.

Parity: tina4-nodejs 3.13.118 carries Michael's parallel skill-repair
PR (#60). tina4-php and tina4-ruby ship 3.13.118 as version-only
parity bumps. Michael's parallel skill-repair PRs on tina4-php (#205)
and tina4-ruby (#44), and @cwvermaak-codeinfinity's Messenger fix
(tina4-php#204), are queued behind the tina4stack Actions runner
backlog and will ship in 3.13.119 the moment CI clears.


## v3.13.117 (2026-08-25) - Agent-experience: import-hint + generate resolution

Two paired features that attack the same defect class: a framework
silently transforming input, then failing downstream with a message
that never names the transformation. Shipping across all four
backends in the same version. Contract lives in
[ADR-0062](https://github.com/tina4stack/tina4-documentation/blob/main/plan/v3/decisions/ADR-0062.md).

**Import-hint fallback.** `from tina4_python.route import get` now
raises `ModuleNotFoundError: No module named 'tina4_python.route'.
Did you mean 'tina4_python.core.router'?`. The new
`tina4_python/_import_helper.py` is a last-resort `sys.meta_path`
finder appended after Python's normal resolvers, so it fires only
when normal resolution failed. Suggestions come from a
`pkgutil.walk_packages` walk of the real installed tree, cached at
install. A framework rename updates the hint automatically. No
hand-maintained wrong-guess list. Real errors from inside modules
that DO exist pass through untouched.

**Generate-command resolution transparency.** Every
`tina4python generate model|route|migration|middleware` invocation
now emits its resolution.

- `--json` prints a versioned `generate_v1` envelope on stdout
  (nothing else), advertised in `commands --json` under
  `resolution_contract`.
- `--dry-run` computes resolution without writing files. Composable
  with `--json`.
- Bare invocation prints a human-readable resolution block to
  stderr naming every transformation, path and warning; files are
  written as before.
- `generate model Order` surfaces the auto-pluralize decision
  (`order` is a SQL reserved word) and names the `--table X
  --quote` override flag reserved for the future quoted-identifier
  mode (tina4-python#123).

An agent can now inspect what the framework will do BEFORE
generating (`--dry-run --json`), read the resolution the framework
CHOSE afterwards, and never has to reverse-engineer a rename from
generated file paths.


## v3.13.116 (2026-08-24) - Cooperative Service shutdown parity + test hardening

Version-parity release for Python. The framework code is unchanged in this
version - Python already shipped the cooperative Service instance shutdown
via #118 (`ServiceRunner.stop -> instance.stop`) months ago. PHP, Ruby, and
Node all land the same fix in this version so a class-based `Service`
subclass whose `run()` loops on `should_stop?` (or the language equivalent)
exits cleanly under `ServiceRunner.stop(name)` in every backend.

Test hardening - `tests/test_version_contract.py`:

- `_parse_cli_manifest()` locates the first `{` in child stdout before
  `json.loads`, and raises a diagnostic `RuntimeError` with a 400-char
  stdout slice on parse failure. Replaces the bare `json.loads` that
  surfaced as an unhelpful `KeyError` when a stray import-time print or
  a broken `sitecustomize.py` polluted stdout.
- `_cli_manifest_version()` spawns the child with
  `PYTHONWARNINGS=ignore` and the `-c` snippet calls
  `warnings.simplefilter('ignore')` as belt-and-braces.
- Two named regression tests: positive (polluted stdout still parses),
  negative (no-JSON stdout raises with context).

Parity with the tina4-php / tina4-ruby / tina4-nodejs hardening landing
in this same version.


## v3.13.115 (2026-08-24) - Parity bump + fullstack layout skill

Parity version bump across all four backends and one Node-only bug fix.

**tina4-nodejs #56 - bundler-renamed handler args mapped to the wrong
object.** A route handler declared as `async (req2, res) =>` (or any bundler-
renamed / minified first parameter name) had its first argument silently
bound to the Response, so every POST body read as empty. The Node arg mapper
now falls back to positional binding for any name it does not resolve as a
route param, `req`/`request`, or `res`/`response` - first unmatched name
gets the request, the rest get the response. By-name resolution still wins
over positional. This is a Node-only fix, no Python impact.

**Skill: full-stack project layout.** The bundled `tina4-developer-*` skills
gain a Project layout section that codifies the full-stack paradigm - never
pollute the root with source, split into `backend/` and `frontend/` with
per-side `plan/` folders, and ask the backend framework before scaffolding.
Applies to Python / PHP / Ruby / Node and the tina4-js skill.

No framework code changes in Python for this release.


## v3.13.114 (2026-08-22) - AI tool loop closes

The tool loop that 3.13.113 half-shipped is now round-trip complete. `Ai.chat`
accepts a `tools` argument (a list of `{name, description, parameters}` where
`parameters` is a JSON-Schema object) and a `tool_choice` argument
(`'auto'`, `'none'`, `'required'`, or `{name: '...'}`). The client translates
both to each provider's outbound shape (OpenAI's `tools=[{type:'function',
function:{...}}]`, Anthropic's `tools=[{name, description, input_schema}]`
with its own `tool_choice.type` mapping of `auto`/`any`/`tool`).

Tool results come back the same way, provider-neutral. Both OpenAI-style
(`{role:'tool', tool_call_id, content}`) and Anthropic-style (a user turn
with `{type:'tool_result', tool_use_id, content}` content parts) validate,
and the client normalises to whichever the current provider wants. The
caller's agent loop stays one code path.

End to end: send `tools`, receive a `tool_call` event with the parsed args,
run the tool locally, append a tool_result message, call `Ai.chat` again,
receive `text_delta` and `done`. Proven live against the fixture server in
every framework, no raw SSE anywhere in the caller. Feature 141 / ADR-0061.


## v3.13.113 (2026-08-22) - AI streaming events, multimodal, Api.stream primitives

Streaming AI got typed. `Ai.chat(stream=true)` now yields a discriminated `AiEvent`
union instead of raw strings, so an agent loop can see `text_delta` for live tokens,
`tool_call` for aggregated tool invocations (client buffers argument fragments across
deltas and emits one aggregated event when the JSON parses), `done` for the terminal
finish reason and usage, and `error` for a mid-stream failure that replaces `done`.
Text still arrives per chunk for typewriter UX; tool calls arrive whole so the caller
can dispatch without a parser of its own.

Multimodal input landed. `message.content` accepts a string or a list of parts:
`{type: 'text', text}` and `{type: 'image', source}` where source is a `data:` URI or
an `https://` URL. Providers get their native shape internally (OpenAI `image_url`,
Anthropic content-block with `base64` or `url`). Malformed parts fail with
`AiConfigError` before any request is sent.

`Api.stream_bytes`, `Api.stream_lines`, and `Api.stream_sse` are new, layered
primitives. `Ai.chat` is implemented on top of `Api.stream_sse` per language, so one
SSE reader serves both consumers. Contract tests hit a real fixture server over
real sockets - no mocks.

**Breaking**: `Ai.chat(stream=true)` no longer yields strings. Migrate `for chunk in
stream:` to `for event in stream: if event.type == "text_delta": ...`. Non-streaming
`Ai.chat` and `Ai.complete`/`Ai.embed` are unchanged. ADR-0060.


## v3.13.112 (2026-08-22) - CSP-clean dev toolbar

The dev toolbar renders styled and functional under the framework's own default `default-src 'self'` CSP. Its CSS and JS move out of the injected HTML into two external routes, `/__dev/toolbar.css` and `/__dev/toolbar.js` (served with explicit content-types, never through the HTML renderer, so the toolbar is never injected into its own assets), every event is wired with `addEventListener`, and the live reloader is gated on a `data-reload` attribute that the AI port sets to `0`. Before this the injected toolbar carried inline `style=`, `onclick=`, and `<script>`, which the strict default CSP silently blocked, so the toolbar rendered unstyled and non-functional with the console full of violations. A shared contract invariant, `devadmin-toolbar-csp-clean`, locks the no-inline property in Python, PHP, Ruby, and Node. Issue #115.

## v3.13.111 (2026-08-21) - Graph database layer

A `GraphDatabase` layer shaped exactly like the relational `Database`. `GraphDatabase.create(url)` and `GraphDatabase.from_env()` pick the engine from the URL scheme, and one portable surface (`add_node`, `add_edge`, `get_node`, `update_node`, `delete_node`, `neighbors`, `traverse`) works identically on every engine, while `query` and `execute` pass native GQL, Cypher, or AQL straight through. Results come back as neutral `GraphNode`, `GraphEdge`, and `GraphResult` objects. Proven live against Ultipa (GQL), Neo4j and Memgraph (one Bolt/Cypher adapter), and ArangoDB (AQL). The engine driver is an optional, lazy-loaded dependency (the `neo4j`, `ultipa`, `arango`, or `graph` extra), so the core stays zero-dependency. Configure with `TINA4_GRAPH_URL` and `TINA4_GRAPH_CONNECT_TIMEOUT`. Feature 139 / ADR-0059. See [Graph databases](/python/graph-databases).

## v3.13.110 (2026-08-21) - Skills pinned to the release

The Tina4 skills that teach an AI assistant the framework are pinned to the release tag, so an assistant fetches the skill version that matches the framework you run instead of drifting against `main`.

## v3.13.109 (2026-08-20) - Response-cache isolation across the other frameworks

The response cache never serves one session's authenticated response to another caller. Python shipped the isolation fix in 3.13.108; this release lands the same fix for PHP, Ruby, and Node, so all four are at parity.

## v3.13.108 (2026-08-20) - Cache isolation, connect-timeout clock, service stop

Three fixes. The response cache keys on the session, so it cannot replay one caller's response to another (#117). The database connect timeout measures against the driver's own monotonic clock, so a slow connect times out cleanly instead of hanging or firing early (#119). A class-based service's `stop` hook runs on shutdown (#118).

## v3.13.107 (2026-08-20) - RBAC: role and permission guards

Authorization arrives as two decorators. `@role("admin")` and `@can("posts.delete")`
read the cryptographically verified `roles` and `permissions` claims from the signed
token, so there is no per-rule middleware to hand-roll. Several names in one guard are
OR (`@role("admin", "editor")` admits either); stack two decorators for AND. Granted
permissions may carry a wildcard on the dot boundary, so a token holding `posts.*` (or
a bare `*`) satisfies a required `posts.delete`, while the required side stays concrete.
A guarded route implies auth: no or invalid token returns 401, an authenticated caller
missing the role or permission returns 403, and the handler never runs on a miss. Roles
and permissions are independent signed claims - the core never expands a role into
permissions, and a legacy singular `role` claim is coerced to a list. Feature 138 /
ADR-0058. See [Authentication](/python/08-authentication).

## v3.13.106 (2026-08-20) - @websocket callable from the package name

Bug release. `from tina4_python import websocket` is now callable. The
`tina4_python.websocket` subpackage forwards to `core.router.websocket`, so the
documented landing-page form no longer raises `TypeError: 'module' object is not
callable` and auto-discovery no longer drops the rest of that route file.
`from tina4_python.websocket import WebSocketServer` is unchanged. Python-only - the
import-machinery collision has no equivalent in PHP, Ruby, or Node.

## v3.13.105 (2026-08-19) - Cross-API invariants, honest logs, portable tests

A bug release with teeth. Five audit bugs closed in the queue and ORM cache
seams - the places where two spellings of the same intent quietly disagreed.
Route inspection stops booting the app. The startup log stops lying about
`@noauth`. Hot reload reaches the modules that captured the changed one.
Firebird's migration ledger tolerates any case the driver hands back. And every
framework developer skill gained a spine: it announces every step before taking
it, and it warns with 💩 when it is out of date.

### Queue and ORM audit bugs - five fixed

- **`Model.clear_cache()` invalidates the DB layer too.** When both
  `TINA4_AUTO_CACHING` and `TINA4_DB_CACHE` are enabled, a manual
  `clear_cache()` used to leave the DB-layer cache holding stale rows. It now
  cascades to `db.cache_clear()` on this model's bound connection.
- **`Queue.retry()` revives every dead letter.** The no-arg form used a
  generator inside `any(...)`, which short-circuits after the first success.
  Now it materialises the loop so all N dead letters revive, not just one.
- **`Job.retry()` removes the dead-letter file.** Iterating `dead_letters()`
  and calling `.retry()` on each used to leave the failed directory carrying
  every revived job. The next `dead_letters()` call re-reported them and
  consumers processed each job twice.
- **MongoDB `retry_job(id)` finds the dead letter.** The old filter looked
  for `{_id: job_id, topic: self._topic, status: "failed"}` - three reasons
  that combination could never match a real dead-letter doc (fresh `_id`,
  `.dead_letter` topic namespace, `dead` status). The new filter reads the
  dead-letter namespace by `data.id`, deletes the record, and upserts the
  original back to pending.
- **MongoDB `purge(status)` returns a count.** Used to return `None` and
  honour only the `pending` status. Now returns `deleted_count`, honours every
  status, and scopes the delete so `purge("pending")` no longer nukes
  completed or reserved docs under the same topic.

### Route inspection scans, never boots

`tina4 routes` walks canonical route files without executing `app.py` or
starting the server. The prior implementation booted the app on the same port
and terminated whichever process was holding it - a nasty surprise for anyone
running `tina4 routes` in a live shell. Closes tina4-python #104.

### Startup log tells the truth about @noauth / @secured

Python decorators apply bottom-up, so `@post()` logged the route as
`auth=required` a microsecond before the outer `@noauth()` flipped the flag.
`@noauth()` and `@secured()` now emit a corrective `Route auth updated:` line
whenever they change the auth default on a route another decorator already
logged. Closes tina4-python #103, where a public login endpoint appeared to
log its own security bug. Python-only - PHP, Ruby and Node do not log an auth
field at registration time.

### Hot reload reaches every module that imports the changed one

A route file that did `from src.orm.Todo import Todo` kept its stale `Todo`
reference after the model changed - the API then lied about the schema on the
next request. `_auto_discover` now cascades a re-import to every module that
captured a binding from the changed one, recursive with a visited set, bounded
to the discovery scope, fail-loud. Closes tina4-python #102.

### Firebird migration ledger is case-agnostic

`tina4_migration` reads and writes work regardless of the case the Firebird
driver returns for the `migration_name` column. Uses the atomic sequence
pattern the other engines already have.

### Test-harness fixes

- **SIGTERM port probe checks both interfaces.** The graceful-shutdown test
  probed only `0.0.0.0` with `SO_REUSEADDR`, which succeeds on macOS while
  the framework's default `127.0.0.1` listener holds the port - a silent
  false negative on every Mac dev machine. Now probes both interfaces and
  refuses to conclude the port is free until both agree.
- **MySQL connect-timeout assertion tolerates driver cleanup time.** The
  assertion compared the outer clock to the wrapper's rendered message.
  mysql-connector adds around 0.7 seconds of cleanup after aborting, so the
  two stopwatches legitimately differed. The assertion now parses the reported
  elapsed via regex and checks it against the configured bound, not against
  the outer clock.

### Skills grow a spine

- **Announce before you act.** Every framework developer skill now instructs
  itself to say what it is about to do - one line before each file write,
  migration, or dependency install - so the developer can stop the work
  before it spends their afternoon. Same rhythm across Python, PHP, Ruby and
  Node.
- **💩 stale-skill detection.** Every framework developer skill also checks
  whether a newer skill is available (compared against the latest published
  skill version at `https://tina4.com/skills/<name>/version`, never against
  the project's framework version) and prepends 💩 to every reply if it is
  behind. Your framework version stays your call; the skill just refuses to
  pretend its advice is current.

### Upgrade notes

- No API changes. All fixes preserve existing signatures.
- Consumers iterating `dead_letters()` and calling `job.retry()` on each - now
  safe. Previously it produced duplicates on the next `dead_letters()` call.
- `Model.clear_cache()` under `TINA4_DB_CACHE=true` now also flushes the
  DB-layer cache. This is the expected behaviour.
- Lab full-suite verified: 25,263 tests across all four frameworks, zero
  failures, zero skips.

## v3.13.104 (2026-08-17) - GIS and configuration-first SSO

- `Point` and `PointField` add PostGIS-first point storage, metre-based distance queries, GiST indexes, and GeoJSON output. Tina4 uses longitude-first coordinates and fails clearly on unsupported engines.
- `Sso` adds provider-neutral OpenID Connect discovery, Authorization Code with PKCE, introspection, Session handoff, refresh, logout, and automatic `/auth/*` routes.
- Existing secured routes accept the normalized SSO identity through `request.user`; provider tokens remain reserved Session data.
- Swagger publishes the configured OpenID Connect discovery scheme.
- No runtime package dependency was added. Database and cryptography language extensions remain capabilities, not framework dependencies.

## v3.13.103 (2026-08-16) - Metrics you can trust, releases that cannot lie

Version 3.13.102 was a skills-only release, so framework runtime packages
correctly remained at 3.13.101. Version 3.13.103 is the next framework release
and carries the metrics and release-hardening changes below.

### What changed

- Dev-admin hands metrics work to the signed Tina4 client 3.8.76. Frameworks do
  not keep a second metrics analyser or silently fall back to one.
- `has_referencing_test` means that test source refers to the file. It does not
  claim that the test ran, passed, or covered the file.
- Frond expression parsing and evaluation are split into smaller internal steps,
  while public APIs and the shared 84-case expression corpus remain unchanged.
- Tina4 skills lead with `tina4 init` and `tina4 serve`, and keep scaffolding
  prominent in every language.
- Release workflows now reject a tag that differs from the source package
  version before publishing.

No runtime packages were added. Language extensions remain extensions, not
framework dependencies.

## v3.13.101 (2026-08-14) - One AI client, four languages

One class. Three methods. No provider SDK.
Tina4 applications can now call local models, OpenAI, and Anthropic through the
same small API: `Ai.chat`, `Ai.complete`, and `Ai.embed`.

### What ships

- The native `tina4 metrics` CLI now owns every code-health calculation. Framework-level metrics commands and quick census implementations are gone.
- Dev-admin keeps its metrics tab through two thin native-JSON adapters: full analysis and file detail.

- `Ai.chat` returns one `ChatResponse` with text, model, token usage, finish reason, and the raw provider response.
- `Ai.complete` sends one user message and returns its text.
- `Ai.embed` accepts one string or a list and preserves that input shape in its output.
- `stream=True` yields ordered text deltas from OpenAI-compatible and Anthropic streams.

### Failure is data

Hosted providers refuse to send a request without `TINA4_AI_KEY`. Connection and
total-request deadlines stay separate. Retries cover connection failures, HTTP 429,
and HTTP 5xx responses, but stop after the first streamed delta. Errors never include
the key, prompt, or provider response body.

### Upgrade notes

This release adds a new API. It does not add the unimplemented `Llm.ask` or
`Llm.ask_json` proposal. Vision, image generation, tools, agents, and conversation
state remain outside this release. The client uses Python's standard library; your
dependency tree does not grow.

## v3.13.100 (2026-08-14) - Frond keeps the whole page

This fast-follow release fixes template inheritance and puts a ceiling on
<div v-pre>

Frond's caches. The template engine now rejects a second `{% extends %}` tag,
preserves nested root blocks, and evicts stale compiled state instead of
letting a long-running process grow without limit.

</div>

### Template inheritance

<div v-pre>

- A template may declare one parent. A second `{% extends %}` now raises a clear error instead of changing the parent without warning (`9bb7279`)
- The final block-substitution pass now tracks nesting depth. A block nested inside another root block no longer causes the outer content to disappear (`91828ce`)

</div>

### Bounded caches

- Template, fragment, and expression caches now have size bounds and TTL sweeps. Long-running workers release stale entries while rendered output stays unchanged (`82e02de`)

### Frond extension scope

- Class calls to `add_filter`, `add_global`, and `add_test` remain process-global. Instance calls now affect that renderer only, so one request or test cannot seed every Frond instance created later (`ecf66e6`)

### AI skill installer

- Skill downloads retry transient network and HTTP failures. A short GitHub raw-content outage no longer drops the whole install (`09dd6b8`)

### Release consistency

- `pyproject.toml`, `uv.lock`, the packaged fallback version, and the AI-facing guide now agree on `3.13.100`. New version guards stop a partial bump before release (`1aec8c7`, `44188a6`)

### Upgrade notes

No valid template syntax changes. Code that relied on an instance extension
<div v-pre>

leaking globally must register on `Frond` itself. A template with two `{% extends %}` tags was
already contradictory; it now fails at the line that needs fixing. Cache
eviction may trigger a reparse, but it does not change the rendered bytes.

</div>

The Frond AOT compiler is not part of this release. Parser and compiler parity
for Ruby and Node.js remains planned for `3.13.101`.

## v3.13.99 (2026-08-13) - Stability, parity, and secure by default

The biggest step yet on the road to **3.14 stable**. This release closes out
Phases 1 through 5 of the v3 parity audit: roughly thirty breaking changes,
and every one of them is a security fix, a parity fix, or a correctness fix,
never a change made for its own sake. Two conformance grids, logging and
database adapters, are now fully proven against real services in all four
frameworks, and a small batch of genuinely new bugs gets fixed alongside
them. Read "Possible breaking" before you upgrade: several of these changes
correct a footgun that was silently doing the wrong thing.

### Security

Security now defaults on instead of requiring opt-in.

- Security headers emit by default, including `Content-Security-Policy: default-src 'self'`, which blocks inline scripts and third-party CDNs. Relax the policy with `TINA4_CSP`; HSTS emits only on HTTPS, when `TINA4_HSTS` is set (`bfc1597`)
- `TINA4_CSRF=true` now actually attaches the CSRF middleware, where it used to be inert. A blank `TINA4_SECRET` fails closed now instead of minting a forgeable public-default token (`3249495`)
- The dev server binds `127.0.0.1` by default; set `TINA4_HOST=0.0.0.0` to expose it. A cross-origin `/__dev` mutation is refused, and `.env` is never served through the file endpoints (`41b3aeb`)
- A symlink whose real path escapes the public directory is refused, and dotfiles (`.env`, `.git`) 404 instead of serving (`c51c686`)
<div v-pre>

- `{% include %}`, `{% extends %}`, and `{% import %}` in a Frond template are confined to the templates directory. A path that escapes it, with `..`, an absolute path, or a symlink, now raises (`f858c11`)
- `tina4 serve` on a busy port no longer kills whatever holds it. It reclaims only a port held by an identifiable Tina4 dev server, refuses a foreign holder, and honours `TINA4_NO_TAKEOVER` / `--no-kill` (`fdd7d86`)
- A hostile inbound `X-Request-ID` (CRLF, illegal characters, an over-long value) is sanitized to a fresh id instead of echoed back raw, closing a response-header and log-injection path (`1d324d5`)
- The dead `render_production_error` function is removed; nothing called it. The dev error overlay now redacts `Authorization`, `Cookie`, and `Set-Cookie` headers plus secret-looking body fields, and caps the rendered stack at 50 frames (`7b460ea`)
- A repeated multipart file field now yields a list instead of silently dropping every upload but the last. The new safe-save helper rejects `..` and absolute filenames (`9fd483c`)

</div>

### Data integrity

Four footguns that used to fail silently now fail loud, or stop failing at all.

- An unparseable or unsupported MongoDB WHERE clause now raises instead of silently matching every document. A DELETE or UPDATE with no WHERE is rejected outright. Write an explicit WHERE, or call `truncate()` for the whole collection (`3315d1c`)
- `truncate()` on a Mongo collection now actually empties it. It used to report success while leaving every document in place (`079873e`)
- Firebird write results are correct now: `db.insert().last_id` and `db.update()` / `db.delete()` `.affected_rows` return real values instead of `None` or `0` (`de441c5`)
- MSSQL pagination converges on `OFFSET`/`FETCH` in all four frameworks (`4491cf8`)

### ORM and validation

Eight fixes bring the ORM's write path, validation, and generated schema into
agreement across all four frameworks.

- `create_table()` now injects the soft-delete column (`is_deleted INTEGER DEFAULT 0`) for a `soft_delete = True` model that does not declare it itself (`6c190c2`)
- A soft-deleted child is no longer returned through relationship traversal, lazy or eager. The phantom `on_delete=` foreign-key parameter is removed and now raises a clear "read-side-only" error instead of silently doing nothing (`2e9a69a`)
- The imperative `has_many` default row cap changes from a silent 100 to the whole result set. A caller relying on the old truncation now gets every row (`558a000`)
- A REST list `?page` below 1 clamps to page 1 instead of handing a negative offset to the driver; an oversized `?limit` or `?per_page` is capped at 100 (`761873a`)
- Loading a row from the database no longer re-enforces write-path business constraints (required, length, range, choices). A stored row that violates a constraint tightened after it was written now loads instead of aborting the whole page; the write path is unchanged and still rejects a bad save (`6095243`)
- AutoCrud returns `422` with field errors for an invalid create or update, where it used to return `400`. The write body is now allow-listed: `is_deleted` is never client-writable, and a client-supplied primary key is stripped on both create and update, closing a mass-assignment hole and an IDOR-shaped redirect (`9941536`)
- `seed_table`'s `seed` parameter is removed and now raises if you pass a non-default value. Seed your own `FakeData` instance for determinism (`80e897b`)
- The validation message vocabulary is unified across all four frameworks; `in_list` now renders a compact JSON list (`must be one of ["a","b","c"]`) (`b9fbd7e`)

### Request model - the big one

`request.params` is route-params-only now, in all four frameworks. Python
used to merge the query string and the route params into `params`, so
`request.params["id"]` could silently return a client-supplied `?id=` value
that shadowed the real route parameter, a param-pollution surface. Client
input lives only in `request.query` and `request.body` now; `request.params`
holds route params and nothing else. A handler or middleware reading the old
merged `params` must read `query` or `body` explicitly.

Three related fixes ship with it: a malformed JSON body returns the raw
string it failed to parse, the empty-body sentinel is Python's native
`None`, `Request` gains a mutable `user` field, and `header()` lookup is
case-fold only now (it no longer also converts `-` to `_`) (`7df99c8`).

### Migrations

- PHP, Ruby, and Node's `rollback` is fail-safe now too, matching Python's already-correct behaviour: a missing `.down.sql` file or a failed down script raises and leaves the `tina4_migration` ledger row in place, instead of deleting the tracking row and leaving the schema applied but untracked (`9289017`)

### HTTP

- Responses gzip-compress when eligible in PHP, Ruby, and Node (body over 1024 bytes, `Accept-Encoding: gzip`, a compressible content type); a cacheable 200 gets a strong ETag and a matching `If-None-Match` gets a 304. The static-file ETag format is unified to `W/"<size>-<mtime>"` on all four, so a cache revalidates once instead of on every deploy. Python's 304 now carries `ETag` and `Last-Modified`, and `If-None-Match` follows RFC 7232 (weak, list, or `*`) instead of an exact-string match (`4a389f9`)
- A `403` now negotiates HTML versus JSON the same way `404` and `500` already do (`7af21c6`)
- The OpenAPI spec converges on one shape across languages: a secured operation documents a `401`, and `summary`/`tags` always populate (`47fbcf2`)
- A route group's prefix join is normalized, so a route no longer mis-registers on a bare concatenation or an uncollapsed double slash (`14df0ed`)

### Dev tooling

- The inline `@tests` descriptor builders are renamed: `assert_equal`/`assert_raises`/`assert_true`/`assert_false` become `expect_equal`, `expect_raises`, `expect_true`, `expect_false`. `tina4 python test` now discovers and runs the inline surface with a real exit code, so a previously-green run that executed none of your inline tests may now actually run, and fail, them (`d854b9d`)
- `TestResponse` preserves duplicate headers; a new multi-value accessor sits alongside the unchanged single-value `headers[name]` (`21bc198`)
- MCP `serverInfo.version` and outbound HTTP requests now report the real framework version instead of a placeholder; the framework client sends `User-Agent: Tina4/<version>` unless the caller already supplies one (`4275713`)

### Proven in all four

Two conformance grids close out fully proven, tested against real services in
every framework, no mocks:

- **Logging.** A real per-language runner now exercises the shared logger contract end to end. Closing it surfaced and fixed real bugs: bootstrap `configure()` no longer invents defaults, and a request id is now cleared in a `finally` block so it can never bleed into the next request (`f809b38`)
- **Database adapters** (ADR-0044). A real runner against SQLite, PostgreSQL, MySQL, MSSQL, and Firebird proved every adapter implements the same interface. It found a real bug on the way: `MySQLAdapter` ran with `autocommit=False` under InnoDB's REPEATABLE-READ, so a plain `fetch()` / `fetch_one()` opened an implicit transaction that a later `start_transaction()` then collided with (`f29579a`, `543d8c1`)

### Bug fixes

- A route path containing a literal parenthesis, like `/products/(sale)`, now matches correctly everywhere. Python and Ruby were already correct; PHP and Node compiled the literal characters as regex syntax (`8534b27`)

### Possible breaking

Read these before you upgrade. Every entry here is a security, parity, or
correctness fix, none is a change made for its own sake.

- **`request.params` is route-params-only.** Read query-string values from `request.query` and body values from `request.body`. This is the single largest behaviour change in the release.
- **Security headers, including CSP, emit by default.** An app depending on inline scripts or a third-party CDN needs `TINA4_CSP` to relax the policy.
- **`TINA4_CSRF=true` now actually attaches the CSRF middleware.** If you set it and never noticed CSRF enforcement, it enforces now.
- **A blank `TINA4_SECRET` fails closed.** Set a real secret; the framework no longer falls back to a guessable public default.
- **The dev server binds `127.0.0.1` by default.** Set `TINA4_HOST=0.0.0.0` to expose it on your network.
- **An unparseable Mongo WHERE now raises instead of matching everything.** Add an explicit WHERE, or call `truncate()`.
- **`create_table()` adds `is_deleted` for a soft-delete model automatically.** A model that already declares the column is unaffected.
- **The `on_delete=` foreign-key parameter is removed and raises.** Relationships are read-side only; enforce integrity in your migrations.
- **The imperative `has_many` no longer caps at 100 rows.** A caller relying on the old truncation now gets every row.
- **`?page=0` clamps to page 1, and `?limit` caps at 100.** A client can no longer request the whole table in one page.
- **AutoCrud returns `422`, not `400`, on invalid input**, and never accepts `is_deleted` or a client-supplied primary key in the write body.
- **`seed_table`'s `seed` parameter is removed and raises.** Seed your own `FakeData` instance instead.
- **Validation messages changed wording**, including `in_list`'s compact JSON rendering.
- **A malformed JSON body returns the raw string**, not an empty dict.
- **The static-file `ETag` format changed**, so every cache revalidates once on upgrade.
- **A route group's prefix join is normalized.** A route depending on the old mis-registered, doubled-slash path must use the corrected one.
- **The inline testing descriptors are renamed** `assert_*` to `expect_*`, and `tina4 python test` now actually runs them.

### Coming in 3.13.100

Frond's compiler, extensibility, auto-escaping, sandboxing, and caching work
(features 48 through 60) is deferred to the 3.13.100 fast-follow, alongside a
refreshed Carbonah benchmark harness and a configurable database column-name
casing option.

## v3.13.98 (2026-08-11) - Skills discipline

A maintenance release. No API changed, and no behaviour changed in your app.

The bundled AI coding skills - the ones that install with
`curl -fsSL https://tina4.com/install-skills.sh | sh` - moved onto one shared
plan discipline. A plan file has one format (Scope, Tests, Bugs, Commits), and a
checkbox is ticked only when the work is verified green at HEAD, never on a
claim. That keeps an agent's plan file honest, so it always reflects what
actually shipped.

The framework package also shed internal dead weight: duplicate design-system
source files that were never compiled or served at runtime. Nothing your code
imports or renders changed.

Nothing to upgrade. If you use the Tina4 AI skills, re-run the installer.

## v3.13.97 (2026-08-07) - Behaviour corrections

A small bug-fix release on the road to **3.14 stable**. No new surface, no
renames. Two behaviours come back into line with the contract. A broker queue
refuses an operation it cannot honour instead of losing your data, and a parity
test locks DocStore's date handling so it stays correct. Read "Possible
breaking" if your app calls `clear()` or `purge()` on a Kafka or RabbitMQ queue.

### Queues

- `clear()` and `purge()` on a broker backend raise a named refusal. A broker delivers messages to consumers and cannot address them by status, so neither call can be honoured. Kafka's `clear()` returned `0` and `purge()` did nothing; RabbitMQ drained the live queue and destroyed its messages. Both raise now, rather than return a meaningless count or throw away data you meant to keep (`2a0cb8c`)

### DocStore

- `distinct()` dedups values by equality, so two equal dates collapse to one row. Python was already correct; a parity test now locks it across all four frameworks (`8de6025`)

### Possible breaking

- **`clear()` and `purge()` raise on a broker queue (Kafka, RabbitMQ).** The result never matched the call: Kafka returned `0`, RabbitMQ destroyed the live queue. Catch the refusal, or guard the call. A database-backed queue still clears and purges as before.

## v3.13.96 (2026-08-07) - One paginate envelope, one message shape

Another step toward **3.14 stable**, and the theme is still parity: the same
call means the same thing in Python, PHP, Ruby and Node. This release settles
two subsystems that had drifted into four shapes. Pagination returns one
envelope of seven keys with a true total. The Messenger IMAP path returns one
message shape, addresses mail by a real IMAP UID, and hands back attachments
you can write straight to disk. Some of these are behaviour changes, so read
"Possible breaking" at the end before you upgrade.

### Pagination

- `to_paginate()` takes no arguments and reads every field from the query that ran; pass one and it raises (`790f6bc`)
- The envelope is exactly seven snake_case keys: `records`, `total`, `page`, `per_page`, `total_pages`, `limit`, `offset` (`790f6bc`)
- `total` is a true `COUNT(*)` for the filter, never the row count the page returned (`790f6bc`)
- The AutoCrud REST list endpoint returns the same seven keys (`891e9a2`)

```python
# Fetch the page you want, then describe it. No arguments.
result = db.fetch("SELECT * FROM orders", [], 20, 40)   # 20 per page, page 3
return response(result.to_paginate())
# {"records": [...], "total": 250, "page": 3, "per_page": 20,
#  "total_pages": 13, "limit": 20, "offset": 40}
```

### Messenger

- `send()` returns `{success, message, id}` on both the real-send and dev-capture paths. `error` became `message`, `message_id` became `id`, and the capture-only `dev` key is gone (`5e912ca`)
- `id` carries a real `Message-ID` header the message actually sets, so it is populated instead of always empty (`5e912ca`)
- `inbox()` and `search()` return `snippet` as decoded, tag-stripped plain text truncated to 200 characters, not raw base64 (`5e912ca`)
- `read()` of a UID that does not exist returns `None`, not `{}` (`5e912ca`)
- IMAP credentials are their own now: `TINA4_MAIL_IMAP_USERNAME` and `TINA4_MAIL_IMAP_PASSWORD`, falling back to the SMTP pair, plus `imap_username` / `imap_password` and an `imap_encryption` constructor argument (`5e912ca`)
- The `uid` from an IMAP read is a real IMAP UID, so it still addresses the right message after another client expunges the mailbox (`3237383`)
- `read()` folds each attachment's decoded bytes into `attachments[i]["content"]`, so you write an attachment straight to disk (`dabd87d`)

### Api client

- `Api.send()` is renamed `Api.send_request()`, the one name PHP, Ruby and Node already use (Ruby's `send` is `Object#send` and cannot be an HTTP verb). There is no alias, the primary is renamed. The verb methods `get` / `post` / `put` / `patch` / `delete`, `upload` and `download` are unchanged (`e54ae00`)

### Swagger

- `servers[0].url` defaults to `/`, which resolves under any port, host or proxy, instead of a hard-coded `http://localhost:7145` (`d19fcac`)
- `info.version` defaults to `1.0.0` and `info.description` to an empty string (`d19fcac`)
- `components.schemas` is keyed by the model class name, with a `required` array derived from column nullability (`d19fcac`)
- `operationId` keeps a path's leading underscores, so `/__health` and `/health` stay distinct (`d19fcac`)
- An operation documents only the response codes the framework really returns (`d19fcac`)

### Migrations

- `code` is the canonical kind for a code migration, the same word in all four frameworks. An unknown kind raises and names the valid ones instead of being quietly accepted (`7ce89dd`)

### Server

- An oversized request body answers `413`, not `500` (`d448027`)
- `TINA4_PORT` is the port variable and wins; bare `PORT` still works but is deprecated and goes in 3.14 (`a0b0dab`)
- A public `asgi()` bootstrap exposes the app to any ASGI server (`a653908`)
- A synchronous route handler runs in a worker thread, so a slow handler no longer blocks the event loop (`867b8d9`)

### Build and skills

- The framework SCSS compilers are gone; the `tina4` Rust CLI owns SCSS now (`9773bcc`)
- tina4-css is pinned to one artefact and one URL (`546448f`)
- The skills point at the ADRs and make `tina4 metrics`, Carbonah and mcp.tina4.com the lean, green, grounded workflow (`5cca039`)

### Proven in all four

The Messenger, Swagger and pagination behaviours are locked by machine-checked
contract suites that run against real services in every framework: a live
GreenMail server for the mailbox, a real 250-row SQLite table for pagination.
No mocks.

### Possible breaking

Read these before you upgrade. Each affects an app that relied on the old shape:

- **`Api.send()` is now `Api.send_request()`** with no alias. Replace `api.send(method, ...)` with `api.send_request(method, ...)`.
- **`to_paginate()` takes no arguments.** The old `to_paginate(page, per_page)` form raises. Fetch the page you want, then call `to_paginate()`.
- **`total` is the true count.** It was the page's row count in some frameworks; it is now a `COUNT(*)` for the filter. Read `len(records)` for the page size.
- **The paginate envelope is seven keys.** A reader of the dropped alias keys must move to `records`, `total`, `page`, `per_page`, `total_pages`, `limit` and `offset`.
- **A Messenger `uid` is a real IMAP UID.** Discard any `uid` stored by an older version and re-read it; the old values were never stable across an expunge.
- **`send()` and `read()` changed keys.** `send()` returns `{success, message, id}`; `read()` of a missing UID returns `None`; dates are ISO-8601.
- **Swagger defaults moved.** `servers[0].url` is `/`, `info.version` is `1.0.0`, `info.description` is empty. Set `TINA4_SWAGGER_SERVERS`, `TINA4_SWAGGER_VERSION` or `TINA4_SWAGGER_DESCRIPTION` to restore the old values.
- **An unknown migration kind raises** instead of being ignored.
- **The framework no longer compiles SCSS.** Use the `tina4` Rust CLI.


## v3.13.95 (2026-08-06) - Preparing for the 3.14 stable release

One of several releases still to come before **3.14 stable**. The theme is
parity: the same call now means the same thing in Python, PHP, Ruby and Node.
Method shapes and inputs are unchanged - this is bug fixes, optimizations, and
a much harder test suite behind them. See "Possible breaking" at the end for
the handful of behaviour corrections that could affect an app relying on the
old, wrong result.

### Queues

- The dev dashboard queue panel lists the store it counts (`f539be2`)
- The AMQP vhost is read as the path segment (`6f4ab2a`)

### Logging

- An explicit argument beats the environment, which beats the default (`c56d3a1`)

### Databases

- Every connect that can block is bounded, so a wedged server fails instead of hanging (`7c51d3d`)
- `count()` returns the true total, not the last page's row count (`f9b8280`)
- `to_paginate` reports the page it is on (`6f85c3f`)
- `update()` matches the primary key in data case-insensitively (`c122e6d`)
- Firebird: a column name is folded back only when Firebird folded it (`ef6139d`)
- Firebird: `table_exists` matches either spelling Firebird may have stored (`1c4dc34`)
- Firebird: `commit`/`rollback` with no open transaction are no-ops, not crashes (`4b2e38d`)

### Sessions

- A backend failure is loud, then degrades, on the request path too (`59bee59`)
- No network I/O in a handler constructor (`f423ec5`)
- Every backend has a zero-dependency transport (`7e8416f`)
- `TINA4_SESSION_REDIS_PREFIX` and `_VALKEY_PREFIX` are honoured (`f7a5ba2`)
- The database backend's DDL is portable to MySQL (`c0886f5`)

### Document store and cache

- `find()` is deferred, and there is one sort contract (`cae5484`, `0b2dfc1`)
- A missing MongoDB driver raises instead of falling through (`219fa36`)
- memcached TTL beyond 30 days no longer vanishes instantly (`f1abf81`)
- redis `stats()` size was a constant on the raw transport (`8c0cd5b`)
- `boto3` is declared, so a sync cannot silently delete live-S3 coverage (`fbd7dd2`)

### Local by default, production by environment variable

The document store runs on a local SQLite file with no configuration and no
services, and becomes a real MongoDB collection when you set one environment
variable. The call sites are identical either way. The same shape holds across
the framework: SQLite is the default database, the queue is file-backed until
you point it at a broker, and the cache is in-memory until you give it a URL.

### Bulk insert

Pass a list of rows to `insert()` and the framework builds one prepared
statement and runs it inside a single transaction on a single connection,
instead of a round trip per row. Same call in all four languages.

```php
$db->insert("orders", [
    ["customer_id" => 1, "total" => 9.99],
    ["customer_id" => 2, "total" => 14.50],
    ["customer_id" => 3, "total" => 22.00],
]);
```

### Tooling

The `tina4` CLI reached 3.8.67 over this cycle:

- `tina4 init` now wires the project up rather than printing instructions for it
- `tina4 deploy docker` gained `--runtime cli|fpm|swoole` for PHP
- The skills installer worked on macOS but installed nothing on Debian/Ubuntu. Fixed
- Skills install for Codex as well as Claude
- `tina4 metrics` gained cross-file duplication detection, Rust support, and now refuses a file it cannot parse instead of scoring it
- `tina4 serve` no longer opens a duplicate browser tab

The documentation site you are reading runs on **tina4press**, our own
zero-Vue static site generator built on tina4-js. 271 pages, no framework
runtime on the page.

### Possible breaking

Method shapes and inputs did not change. These are behaviour corrections, so
they only affect an application that depended on the previous, incorrect
result:

- **`count()` in Ruby and Node** returned the number of rows the last page
  produced. It now returns the true total. Code that treated it as a page size
  will see a different number.
- **The AMQP vhost** was read as `"/"` plus the path segment, so
  `amqp://host/production` looked for `//production`. If you worked around this
  by naming your vhost with a leading slash, remove it.
- **Configuration precedence.** An explicit argument now beats the environment.
  If you both set `TINA4_LOG_DIR` and passed a directory to `configure()`, the
  code now wins. Setting only one is unaffected. Ruby deployments that read
  `tina4.log` from the project root should read `logs/tina4.log`.
- **The Mongo session database default in Node** is now `tina4`, matching the
  other three. Set it explicitly if you relied on the old default.
- **An unknown connection scheme, or an unknown `TINA4_SESSION_BACKEND`,**
  raises instead of silently falling back to SQLite or to file sessions.
- **A missing MongoDB driver** raises rather than falling through.

## v3.13.94 (2026-07-29) - A write with no filter is an error

`update()` and `delete()` with no WHERE clause used to be accepted. Two of the
four frameworks then wrote every row in the table. The other two changed nothing
and said they had succeeded. Neither answer is a write, and neither told you
which one you got.

An unfiltered write now refuses to run and names what is missing. `truncate()` is
the explicit spelling for the case where you really did mean every row.

**Breaking.** Read the migration note below before upgrading.

### The write path (BREAKING)

A write needs a target. `update(table, data)` with no filter now takes the primary
key out of `data` and uses it as the WHERE clause. With neither a filter nor the
complete primary key, it raises and names the columns it wanted. `delete(table)`
with no filter raises too. `truncate(table)` is the whole-table spelling, and it
always was.

A failed write raises rather than returning a falsy result the caller never
inspected.

Primary keys are read as a LIST, because a key can span several columns and every
one of them belongs in the WHERE. Match a composite key on its first column alone
and you hit every row that shares that value: the same data-loss shape the fix
exists to prevent. Two of the four SQLite drivers had a second bug underneath that
one. `PRAGMA table_info` returns `pk` as the 1-BASED POSITION within the key, not
a boolean, so a composite key reports `pk=1, pk=2`. Code that tested `pk == 1` saw
a key one column wide and truncated the rest.

**Migration.** Two changes to make, both mechanical:

1. An `update()` that relied on the primary key travelling inside `data` still
   works, and now works on composite keys. An `update()` with neither a filter nor
   a full primary key was already broken. Add the filter.
2. Replace a deliberate delete-everything with `truncate(table)`.

Nothing else in the write path moved. A filtered write behaves as it did before.

### The Frond sandbox revokes capability, it does not skip a step

`sandbox()` filtered the tag and filter lists but let a denied name fall through
to the default path, so a template could still reach an escape filter it was never
granted. A denied filter cannot confer safety now, and the tag gate collapsed to
one check at dispatch instead of several that could disagree.

The shared render corpus grew from 72 cases to 84, covering `|safe` and `|escape`.
It is one committed fixture with one answer key, byte-identical across all four
frameworks, so a divergence is a failing test rather than a discovery six months
later.

### Messenger: one name, one signature

The dev branch and the send branch had drifted into two shapes of the same method,
and capture keyed off debug mode rather than whether a transport was available.
One signature behind one name now, and capture follows availability.

### Base images that boot

No CI had ever built or run a base image. Two of the four had therefore never
served a request at all, and the two that did boot were each wrong in their own
way. `docker run` is a supported entry point, so all four are now gated in CI on
Docker Hub, on `/health`, and on the version they actually serve.

The `FROM` to `COPY` recipe for adding your own database driver is documented in
all four image headers, and in one case that documented line did not work until
this release. An install instruction nobody runs is a claim, not a feature.

### Frond, measured against the engines it replaces

The benchmark page carried seven categories and none of them timed a template.
That absence flattered us, because template rendering is the one axis where Frond
competes head-on with the engine it replaced. It is a headline category now, and
the numbers are not kind.

Every engine renders the same page: a 20-row product list with a loop, an index,
an even/odd class, an uppercase filter, two-decimal money, and a conditional
footer. Output is compared byte for byte and proven identical before any timing
counts, so nothing here is a strawman.

Frond loses in all four languages, on its own compiled path rather than the
interpreter fallback. The competition compiles a template to code the host runtime
optimises. Frond walks a tree and calls back into engine primitives per hole. What
Frond buys is the zero in the dependency column, and one template language that
renders the same across four runtimes.

The per-language multiples are in each framework's own note below. Publishing them
costs us the comparison and buys the reader a real number.

### Also in this release

MQTT test infrastructure locks its password file to `0600` and the broker's own
user, so a run cannot leave a world-readable credential behind.

### Python specifics

`primary_key()` took `next(c for c in columns if c.primary_key)`, the FIRST key
column. On a composite key that reintroduced the exact bug the change existed to
prevent. Verified against real SQLite on `order_items (order_id, product_id)`: the
update popped `order_id`, built `WHERE order_id = 1`, and tried to set
`product_id = 5` on both rows in that group. A UNIQUE constraint caught it. Without
one it would have corrupted both rows in silence.

The Kafka raw path only runs when `confluent-kafka` is absent, and CI installs it,
so that code had never executed under test. It does now: a test forces the raw path
against a real broker. CRC32C is built in-process, because the standard library has
none and the framework carries no third-party runtime dependency.

The published 3.13.92 image served `"version": "3.13.56"` on `/health`, 36 releases
stale. `_resolve_version()` falls back from `pyproject.toml` to
`importlib.metadata`, then to a floor literal. The Dockerfile pruned `dist-info`,
which removed the only metadata path, so the literal won. The literal had never
been bumped, because in a source checkout the first path always wins and no test
ever reached it. The prune bought 20 KB of a 41 MB image. It is gone, and a test
now reads the literal out of the source and checks it against `pyproject.toml`.

**Frond:** 14.5x slower than Jinja2 and 37x slower than Mako on identical output.
The harness confirms the AOT compiler engaged, so this is Frond's fastest path.


## v3.13.92 (2026-07-27) - A token header that tells the truth about its signature

Configure `Auth` for HS512 and Tina4 minted a token whose header said HS512 over
a signature computed with HMAC-SHA256. The signer reached for `hashlib.sha256`
and never asked the header what it had promised.

Tina4 accepted its own tokens, because it made the identical mistake on the way
back in. Anything else that reads the header and computes the digest it names got
different bytes and threw the token out. Three reported issues, one contract,
shipped in all four frameworks.

### The header names the algorithm that signed (python#105)

`_sign()` hardcoded the digest while the header carried `self.algorithm`. HS512
produced a 32-byte signature under a header promising 64.

The digest now comes from `_HMAC_ALGORITHMS[self.algorithm]`, so the `alg` in the
header is always the one that produced the bytes. HS256, HS384 and HS512 all
sign and verify, and the whole family lives in `hashlib`, so nothing new was
installed to get it.

The assertion that catches this measures the signature's byte length: 32, 48, 64.
Comparing one algorithm's token against another's proves nothing, because the
header is part of the signing input, so two tokens differ either way.

### TINA4_JWT_ALGORITHM is read for real (python#106)

The variable sat in the CLI's list of known variables and was never read. Set
HS512, see it acknowledged as a setting Tina4 knows about, and get HS256 tokens
anyway.

`_resolve_algorithm()` reads it now. An explicit argument wins, then the
environment, then HS256. An algorithm Tina4 cannot sign raises and names the
supported set, because the silent downgrade was the whole defect: a weaker token
than the one you asked for, and nothing said a word.

RS256 is not in the Python set, and it is not coming. PHP has OpenSSL and Node
has `node:crypto`, so RSA signing costs those two nothing and stays available
there. Python and Ruby would need a third-party package, and the core takes no
dependencies. RS256 is a documented PHP and Node extra, permanently.

### nbf is enforced, with 60 seconds of leeway (python#107)

A token stamped not-valid-until-noon was accepted at nine. `valid_token()`
checked `exp` and walked straight past `nbf`.

It now refuses a post-dated token until its `nbf` arrives, and accepts one up to
60 seconds early. RFC 7519 allows a small leeway, and without one a token minted
on a host a second ahead is rejected for nothing at all.

A token carrying no `nbf` is unconstrained, which is what keeps this
non-breaking for every token already in circulation. `get_token()` does not stamp
one. Ruby used to, and no longer does, so all four now issue the same claims.

### The header cannot choose the verifier

`valid_token()` now rejects a token whose header names any algorithm other than
the configured one, `alg: "none"` included, before it spends a single HMAC.

This closed no live hole. Every framework already verified with its own
configured algorithm and never read the header to pick one, so a forged header
changed the signing input and broke the signature anyway. What the check buys is
parity with Ruby, which always had it, an exit before the wasted work, and a test
that fails the day someone refactors `valid_token()` into trusting `header.alg`.
That mistake has its own CVE list. Now it has a test here.

### Overrides on authenticate_request are honoured

`authenticate_request(headers, secret=..., algorithm=...)` accepted both
overrides and dropped them. The body called `self.valid_token()`, so a caller
asking for a particular secret or algorithm quietly got the instance's own.

Both are honoured now. Their defaults moved to `None`, because the override
branch tests for `is not None` and a real default recursed until the stack ran
out.

### A misconfigured algorithm raises (Breaking)

While the variable was ignored, `TINA4_JWT_ALGORITHM=HS-256` did nothing at all
and you signed HS256 without being told. Now that the setting is honoured, a
value Tina4 cannot sign has to go somewhere, and it raises a `ValueError` naming
the variable and the values it accepts. A typo surfaces at the first token
operation, which is where a deployment mistake belongs.

A malformed or forged token still returns `None`, exactly as before. Only the
configuration error escapes.

**Migration:** set `TINA4_JWT_ALGORITHM` to `HS256`, `HS384` or `HS512`, or leave
it unset for the HS256 default. A value that used to be swallowed now stops the
first token operation and tells you why.

### The tests that hold it

Twenty-seven named regression tests, a positive and a negative case per issue, no
doubles anywhere. Each ran against the old code first and was watched to fail:
restoring the hardcoded digest fails four of them. Full suite on macOS with
Python 3.13: 3,967 passing, 114 skipped.

## v3.13.91 (2026-07-27) - The offenders list finally points at code worth fixing

`tina4 metrics` ranked `public/js/frond.js` as the worst code in the framework,
at cyclomatic complexity 191. Second place went to `register_dev_tools` at 139.
Neither number was real. The first belongs to a file wrapped in one anonymous
function. The second belongs to a registrar that declares twenty small handlers
inside itself.

Both scores were the same arithmetic mistake, and it had been in every framework
since the metrics module shipped.

### A function is no longer charged for the functions inside it

Complexity was measured across a function's whole span. A branch inside a nested
function landed on that function and on every function wrapping it. Count the
same branch twice, three times, four, once per level of nesting.

The deeper the nesting, the worse the lie:

```python
def outer(a):
    def inner1(x):
        if x: return 1
        if x > 2: return 2
        return 3
    def inner2(y):
        if y: return 1
        if y > 2: return 2
        return 3
    return inner1(a) + inner2(a)
```

`outer` branches on nothing. It scored 5. It now scores 1, and each inner keeps
its own 3. The branches moved to where they belong. None went missing.

Python and the Rust engine walk a real syntax tree, so they stop descending at a
nested function or class. PHP, Ruby and Node scan text, where that surgery would
be three risky rewrites. They apply an identity instead:

```
own(F) = raw(F) - sum over direct children C of (raw(C) - 1)
```

A raw score is 1 plus every decision in the span, so `raw - 1` is the total
decision count of a whole subtree. Subtract that for each direct child and what
remains is the function's own work. It needs only the line and LOC each extractor
already reports.

Closures, blocks, lambdas and arrow functions stay exactly where they are. None
of them appear in the function list, so nothing subtracts them, and their
decisions remain with the function that contains them.

**Breaking:** every complexity number drops, and so does every file total. A
`tina4 metrics --fail-on` gate that failed on an inflated score may now pass. Run
the gate once before you trust the old threshold, and lower it if the inflation
was holding your ceiling up.

### Ruby complexity was double what it should have been

In the tree-sitter Ruby grammar, `if`, `unless`, `while`, `when` and `rescue`
name two things: the construct, and the keyword token inside it. The engine
matched on the name alone, so it counted both.

`return 1 if y` scored 3. It has one branch.

Every Ruby number the engine produced came out at roughly double. The fix ignores
anonymous nodes, which is what a bare keyword token is. The engine and
`metrics.rb` now agree on the same file, method for method.

### LOC means one thing again

Every framework counted file LOC as code lines, skipping blanks and comments.
Every framework counted function LOC as a raw line span. One word, two units,
sitting side by side in the same payload.

The dashboard sized its bubbles in one unit and printed its function table in the
other. A function documented with care looked bigger than a function with no
comments at all.

Each language now has one definition of a code line, shared by both levels, so
they cannot drift apart again. `Swagger.generate` reports 167 lines in Python and
167 in the Rust engine, which is the first time two implementations have been
asked the same question and given the same answer.

Fixing it in PHP surfaced a third bug. A bare `}` is a token with no line number,
so the scan for a function's last line landed on the whitespace before it. Every
PHP function was one line short. That line is back.

Nothing but the dashboard reads function LOC. Violations and the maintainability
index both use file LOC, which was right all along, so no threshold moves.

### The dev dashboard reads the coupling it is given

The bubble chart now uses the numbers the engine resolves. Files that everything
depends on drift to the centre. A ring around each bubble runs blue for stable
and amber for unstable. Hovering prints the real figures behind them.

The chart draws none of this unless the coupling actually resolved. The older
metrics modules never mapped an import to a file, so they reported zero
dependents for everything and an instability of exactly 1.0. Drawing that would
paint every ring at maximum instability, which is a confident lie, so the chart
leaves those channels dark instead.

Thirty-three regression tests hold all of it in place across the four frameworks,
and seven more in the engine. Each was run against the old code first and watched
to fail. A test that has never failed has never proved anything.

## v3.13.90 (2026-07-27) - A scaffolded model and its migration finally agree

`tina4 generate crud Todo` wrote a model that declared a `name` column and a
migration that never created it. The first write died:

```
table todo has no column named name
```

This sits on the path https://tina4.com/llms.txt hands to AI assistants, so the
documented way to stand up a REST API returned a 500 on its first POST.

### One default, defined once (php#186, ruby#33, nodejs#38)

The default field set lived inside the model template. Other generators each
carried their own copy, and the migration builder had none, so it built the
table from an empty field list: `id` and `created_at`, nothing else. The default
now lives in a single constant that flows into the model, the migration, the
form, the view and the co-emitted test alike.

Ruby hid a second trap. An empty array is truthy in Ruby, so
`fields_override || parse_fields(...)` short-circuited to the empty array and
the fallback never fired. That check now tests for content, not truthiness.

Python shipped this fix in 3.13.89 and missed one generator: the form kept its
own inline copy of the default. The output matches while the default happens to
be `name`, and diverges the moment it changes, at which point the form renders
an input for a column the table does not have. Fixed, with a source invariant
that fails if any generator restates the literal again.

### A failed write no longer reports success

The generated create and update routes serialised their result without checking
it. `create()` and `save()` report failure by return value; they do not raise.
In Node a failed insert therefore returned HTTP 201 carrying unsaved data. In
Ruby it surfaced as a NoMethodError on `false` and buried the real cause. Both
now check the result and return 400 with a clear message. PHP already checked,
and a test pins that behaviour in place.

Every generator test in all four frameworks passed `--fields` explicitly, which
is why one bug survived in four languages. Each framework now exercises the
no-fields path and asserts that every field the model declares reaches the
migration, ending with a real write against a real database.

## v3.13.89 (2026-07-27) - A typo'd tag no longer renders what it was hiding

Two Frond bugs, both present identically in all four frameworks since v3, both
compatibility gaps against Twig and Jinja2. One of them was quietly showing
people content that was supposed to be gated.

### An unknown tag raises instead of leaking its body (Breaking, Security)

Look at this template and decide what a visitor sees:

```html
{% iff user.is_admin %}
    <a href="/admin">Admin console</a>
{% endiff %}
```

Everyone. `iff` is a typo, and Frond did not recognise it, so the tag rendered
nothing and its body rendered as ordinary content. The admin link went to every
visitor. Worse than a broken page: the template reads as guarded, so a reviewer
scrolling past sees a check that is not there.

<div v-pre>

The same shape hid behind any misspelling. `{% ifff %}`, `{% unles %}`,
`{% i %}`, a tag copied from another engine. Each one silently removed its own
condition.

</div>

An unrecognised tag now raises, naming it and listing what Frond does know:

```
Frond: unknown tag "iff" -- known tags are: autoescape, block, cache, extends,
for, from, if, import, include, live, macro, raw, set, spaceless
```

Frond has no plugin system for tags, so an unrecognised name is always a typo,
never an extension. Twig and Jinja2 both raise on one. Frond now does too.

Two things deliberately still render nothing. A stray terminator, an
<div v-pre>

`{% endif %}` with no `{% if %}`, and an empty `{%  %}`. Neither has a body, so
neither can expose anything, and both have always been silent.

</div>

**What to do:** run your templates once. A typo'd tag now fails on the page that
contains it, which is where you want to find it.

### set works as a block (Fixed)

```html
{% set badge %}
    <span class="badge">{{ order.status|upper }}</span>
{% endset %}

<td>{{ badge }}</td>
<td class="mobile-only">{{ badge }}</td>
```

That is core syntax in both Twig and Jinja2, and until now it did the wrong
thing in all four frameworks: the body printed inline where the block stood, and
<div v-pre>

the variable was never bound. `{% set g %}Hello{% endset %}[{{ g }}]` rendered
`Hello[]` instead of `[Hello]`.

</div>

It captures now. The captured value is marked safe, so markup you wrote in the
body renders as markup rather than as escaped angle brackets, matching both
reference engines. A value interpolated into the body is still escaped on the way
in, which is the right place for it: the escaping happens once, where the
untrusted value enters.

Blocks nest, and a loop inside the body renders into the capture rather than to
the page:

```html
{% set rows %}{% for i in items %}<li>{{ i }}</li>{% endfor %}{% endset %}
<ul>{{ rows }}</ul>
```

One rule decides which form you get: an `=` anywhere in the tag means
<div v-pre>

assignment. So `{% set label = "a = b" %}` stays an assignment and is never read
as a block. The inline form is untouched.

</div>

### The expression corpus grew to 82

Three entries cover the block form: a plain capture, a capture that must not be
double-escaped, and an inline `set` whose value contains an `=`. The unknown-tag
rule is locked by named tests in each framework rather than the corpus, because
the corpus compares rendered output and this one raises.

## v3.13.88 (2026-07-27) - json_encode gives you JSON again

3.13.87 HTML-escaped the `json_encode` filter in all four frameworks. That was
wrong, and this release reverts it.

Entity-encoded JSON is not JSON. `{&quot;a&quot;:1}` inside a `<script>` block
is a SyntaxError, and a script block is most of what the filter is for. One
change broke all four languages at once.

The same pass fixed a bug that had been there far longer: a value JSON cannot
represent used to escape as itself, or as nothing at all.

### json_encode emits JSON, not entities (Breaking, reverts 3.13.87)

<div v-pre>

`{{ product | json_encode }}` renders `{"id":1,"name":"Widget"}` again. Put it
straight into a script block:

</div>

```html
<script>
    const product = {{ product | json_encode }};
</script>
```

The output is still safe on the page. Frond escapes the four characters that can
break out of HTML, as JSON unicode escapes rather than entities. A `</script>`
inside a string arrives as `\u003c/script\u003e` and cannot close the block
early. A single quote becomes `\u0027`, so the value also drops into a
single-quoted attribute untouched:

```html
<div data-product='{{ product | json_encode }}'>
```

Use single quotes there. JSON carries its own double quotes, so a double-quoted
attribute needs `| e` on top. This is the model Jinja2 uses for `tojson`, and it
is why the result is marked safe.

`| raw` after `json_encode` is now a no-op. If you added one for 3.13.87 you can
delete it, and nothing breaks if you leave it.

### A value JSON cannot represent becomes null (Fixed)

Reported as tina4-php#184 by justin-k-bruce, who hit it in production: two
infinite sort keys in a 657-row grid blanked the whole screen.

JSON has no Infinity and no NaN. All four frameworks handled that differently
and all four were wrong. Python wrote a bare `Infinity`, which no parser reads.
PHP's `json_encode` returned false, which arrived as an empty string, so the
payload vanished with no error anywhere. Ruby fell back to Ruby inspect output.
Only Node.js already did the right thing.

Every framework now writes `null`, which is what `JSON.stringify` has always
produced and the only answer the grammar allows:

```html
{{ readings | json_encode }}
```

```html
{"low":1.5,"high":null}
```

The rule behind it is wider than one value type. This filter never returns an
empty string and never returns a token that would fail to parse. A payload
always arrives, in the worst case as `null`. An empty script assignment is at
least a loud error; a silently wrong one is not.

Two smaller differences went with it. Forward slashes stay unescaped, so `a/b`
no longer comes back as `a\/b` from PHP. Non-ASCII text stays raw, so `cafe`
with an accent is itself rather than a `\u00e9` escape from Python.

### to_json and tojson are the same filter

All three names now share one serializer. They cannot drift apart again.

The `to_json` indent argument is gone. PHP's pretty printer has a fixed
four-space indent and cannot honour an arbitrary width, so supporting the
argument in three frameworks and not the fourth broke byte parity on the one
filter whose entire job is a wire format.

### The expression corpus grew to 79

The cross-framework expression fixture added seven entries: the json_encode
escape shape, a non-finite value, a NaN nested in an object, the `to_json`
alias, a filter pipe feeding a `~` concatenation, that same expression inside a
ternary, and `number_format` with locale separators.

The last three close tina4-php#170 and tina4-php#171. Both were reported against
3.13.68 and both were already fixed by the 3.13.87 expression work; they are
locked in now so they cannot come back.

### What to change in your templates

Grep for `json_encode`. Three cases:

- Inside a `<script>` block: nothing to do. It works again.
- Inside a single-quoted attribute: nothing to do.
- Inside a double-quoted attribute: add `| e`.

## v3.13.87 (2026-07-27) - Frond expressions agree in all four frameworks

Frond has always been described as one template language with four
implementations. That was an assumption. Nobody had ever measured it.

So we measured it. Seventy-two expressions covering filters, operators,
ternaries, null coalescing, concatenation, comparisons, math precedence, missing
values, dotted paths, arrays, hashes, escaping and filter chains, rendered
through Python, PHP, Ruby and Node.js against one identical dataset. Eleven of
the seventy-two disagreed.

All eleven are fixed. Every framework now renders all seventy-two identically.

The corpus is no longer a one-off script. It ships as a test fixture in all four
repositories, byte for byte identical, with a single shared answer key. If one
framework drifts, its own suite turns red while the other three stay green, and
the failure names the expression. Changing the contract on purpose now means
changing the answer key in four repositories in the same change, which is the
point.

### Booleans print as true or false (Breaking)

<div v-pre>

`{{ flag }}` used to print Python's `True` and `False`. It now prints `true` and
`false`, lowercase.

</div>

Lowercase is the only form a template can use directly. `data-active="true"`
reads back from JavaScript as `el.dataset.active === "true"`. `True` needs
translating at every site that touches it, and it is a Python artifact leaking
into a template language.

This was a deliberate break with the reference implementation. The four
frameworks had drifted to four different answers, so one of them had to change,
and the master was the one that was wrong for a template.

Search your templates and tests for comparisons against the rendered `True` or
`False`.

### Both macro import forms now agree (Fixed)

<div v-pre>

`{% import "macros.twig" as forms %}` shifted every macro argument by one
position. `{{ forms.greet("Andre") }}` arrived at the macro with the alias as the
first argument and `"Andre"` as the second.

</div>

The macros were installed as class attributes, so Python bound them as methods
and passed the namespace object in as `self`. They are now installed on a plain
namespace object, which binds nothing.

<div v-pre>

`{% from "macros.twig" import greet %}` was never affected. Both forms now behave
identically, which is what the two forms were always supposed to mean.

</div>

### The not operator works in output (Fixed)

<div v-pre>

`{{ not user.active }}` rendered as nothing.

</div>

Every logical operator was matched with spaces on both sides, so a leading `not`
with nothing to its left matched none of them, fell through to variable lookup,
and was resolved as a variable literally named "not user.active". Finding no such
variable, it rendered empty.

<div v-pre>

`{% if not x %}` and `{{ x and not y }}` always worked, so the operator itself was
never broken. Only the standalone output expression was lost, and before booleans
printed lowercase a dropped expression and a false value looked identical.

</div>

<div v-pre>

A leading `not` now routes to the same evaluator `{% if %}` uses, so a condition
means the same thing in a condition and in an output expression.

</div>

### json_encode escaping

<div v-pre>

Python has always escaped `{{ data | json_encode }}`, and still does. Use
`{{ data | json_encode | raw }}` inside a `<script>` block.

</div>

The note records that PHP returned raw JSON from this filter and was brought in
line.

### The gate that keeps this true

Every one of these bugs survived because each implementation looked correct on
its own. Reading the code four times would not have found them. Rendering the
same expression through all four and diffing the bytes found eleven in an
afternoon.

That diff is now a test. `frond_expression_corpus.txt` and
`frond_expression_expected.txt` live in every framework's test directory as
identical bytes, and every suite renders the corpus and compares against the
shared answer key. Alongside it sit named regression tests for each bug above,
each carrying the negative case that was failing before the fix.

One more thing worth naming, because it is a pattern rather than an incident.
Every boolean bug was a falsy guard: `|| ""`, `a[k] || a[k.to_sym]`,
`true ? '1' : ''`. In a template engine, "absent" and "false" are different
things, and code that conflates them prints nothing where it should print
something.


## v3.13.86 (2026-07-25) - The write-result contract is now consistent across the family

Nothing changed in Python. `db.insert`, `db.update`, and `db.delete` already returned
a `DatabaseResult` carrying `.last_id` and `.affected_rows`, and they still do. This
note records that the other Tina4 frameworks were brought in line: PHP (which used to
return a bool) and Ruby (which used to return a Hash) now return a result object from
these writes too, so a write returns a result in every language.


## v3.13.85 (2026-07-24) - The dev-admin bundle ships once
Every install carried the dev-admin dashboard twice. `tina4-dev-admin.js` and
`tina4-dev-admin.min.js` sat side by side in the framework's public assets,
byte-for-byte identical, and nothing referenced the first one. The route that
serves the dashboard, the SPA shell that loads it, and the asset resolver that
finds it all name the `.min.js`.

The unminified copy is gone. That is 0.92MB removed from every install, in
Python, Ruby and Node.js. PHP had already dropped its copy and is unchanged.

Nothing about the dashboard changes. The file that ships is the same file that
was always being served, and the two were identical anyway, so the only
difference is what you download.

### Why the surviving file is still called `.min.js`

It is not minified, and it never was. The two files had the same SHA-256, so the
`.min` suffix described an intention rather than a fact.

Renaming it would break every project that references the asset by path, for no
benefit, so the name stays. If the bundle is ever genuinely minified the name
will finally be honest; until then it is simply the name of the bundle.

### A gate, so the duplicate cannot come back

Nothing compared the two files, which is how 0.92MB per package went unnoticed.
All four frameworks now test the shipped assets directly: the `.min.js` is
present, the unminified duplicate is absent, exactly one `tina4-dev-admin*.js`
exists (so a differently-named copy cannot slip through), and the surviving file
is the real bundle rather than a stub.

The Ruby half of this was quietly broken in a way worth naming. Two specs read
the unminified file behind a `skip ... unless File.exist?` guard. Deleting the
file would have turned both into silent skips: a green suite with two dead
assertions, and no signal that the asset had vanished. They now read the shipped
bundle with no skip guard, so a missing asset fails loudly. A skip that hides a
missing file is not a passing test.


## v3.13.84 (2026-07-24) - Every generated Dockerfile actually starts
`tina4 deploy docker` wrote Dockerfiles that could not run. Building each one for real found that of the eight Dockerfile generators in the stack (four templates in the `tina4` CLI, plus one inside each framework's own CLI), exactly one was correct.

The Python image is the clearest case. Its `CMD` was:

```
CMD ["python", "-m", "tina4_python.cli", "serve", "--production"]
```

`tina4_python/cli.py` used to be a module, and `python -m` is valid for a module. The v3 restructure replaced it with the package `tina4_python/cli/`, which has no `__main__.py`, so `-m` cannot execute it. Containers died on startup with "'tina4_python.cli' is a package and cannot be directly executed". The code moved; the hard-coded string in a different repo did not, and nothing tested the generated file.

Every generator now names an entry point that exists, and asks for production mode:

| language | CMD |
|---|---|
| Python | `tina4python serve --production` |
| PHP | `php vendor/bin/tina4php serve --host 0.0.0.0 --port 7145 --production` |
| Ruby | `bundle exec tina4ruby serve --production` |
| Node.js | `npx tina4nodejs serve --production` |

All four were verified by scaffolding a project, running `tina4 deploy docker`, building the image, and starting a container.

### `serve` no longer kills PID 1 (all four frameworks)

Before starting, the CLI reclaims the port from a stale dev server by reading `lsof -ti` and signalling what it finds. It never validated that output. Where `lsof` exists but prints a different shape, a non-numeric field coerced to 0 or 1, and signalling PID 0 sends the signal to every process in the caller's own process group.

In a container the server is PID 1, so it killed itself. The Node image logged `Killed existing process on port 7148 (PID: 1 ...)` and exited 143. The PHP image logged the same attempt and survived by luck.

Port reclaiming is now skipped entirely inside a container, where there is no stale sibling to reclaim from. Outside one, only all-digit PIDs are accepted, and PID 0, PID 1 and the current process are never signalled. The message reports only what was really killed.

### A gate, so this cannot rot again

Nothing tested a generated artifact. The CLI's deploy tests covered argument parsing and nothing else, and the docs truth-check inspects prose, not template payloads.

The CLI now carries five contract tests over the Dockerfile templates that fail on exactly the mistakes above: no `python -m` on a package, no dev-only runner such as tsx in a production CMD, every CMD names a published entry point, every CMD requests production, and every template sets `TINA4_OVERRIDE_CLIENT`.

The port-reclaim rule is pinned down too, in all four frameworks. Deciding which
PIDs to signal now lives in one pure function per language (`selectable_pids`,
`tina4SelectablePids`, `selectablePids`), so the safety rule is testable without
touching a real process: 43 tests assert that a junk token, PID 0, PID 1, the
current process and the current process group are each refused, and that a
genuine stale sibling is still reclaimed. One of them feeds in the exact line
from the container log that started this.

### Also in the CLI (tina4 v3.8.58)

The four bundled Dockerfile templates carry the corrected commands, and the Ruby template gains its build toolchain. Each framework's own `docker` generator was corrected to match, so the two paths agree. The PHP generator now detects whether a project has `bin/tina4php` or `vendor/bin/tina4php` and writes whichever exists, because composer does not link a root package's own bin into `vendor/bin`.


## v3.13.83 (2026-07-24) - Swagger UI stops serving itself in production
**Security.** With swagger disabled, `/swagger/openapi.json` returned 404 and `/swagger` returned 200. The gate was real. The static files walked around it.

The framework ships the Swagger UI as files inside its own public directory. Static serving runs before route matching, and it resolves a directory to its index, so `/swagger` became `swagger/index.html` and never reached the gated route. A production server kept serving the whole UI on four paths:

```
/swagger                       200
/swagger/                      200
/swagger/index.html            200
/swagger/oauth2-redirect.html  200
```

The tell was the mismatch. The spec route obeyed `TINA4_SWAGGER_ENABLED`; the UI ignored it. Static serving now checks the swagger gate before it resolves an index, so all four paths return 404 when swagger is off and serve as before when it is on. Fixed in all four frameworks, each with a lock-in test that fails against the old code. (python#97)

### The banner advertises only what answers (python#99)

Every boot printed both dev links, whatever the environment:

```
Swagger:   http://localhost:7146/swagger
Dashboard: http://localhost:7146/__dev
```

In production both URLs 404. That misled two readers at once. An operator scanning a production log believed a dev surface was exposed. A developer clicking the link landed on a dead page.

The banner now prints a row only when that surface answers. Each framework builds those rows through one pure function of the port and two booleans, so the contract is unit tested instead of inferred from stdout: `banner_surface_lines` in Python, `App::bannerSurfaceLines` in PHP, `Tina4.banner_surface_lines` in Ruby, `bannerSurfaceLines` in Node.

### The CLI runs no watcher in production (tina4 v3.8.57)

`tina4 serve --production` started the file watcher and the SCSS watcher anyway. Both burn CPU, both contend with the single server process, and neither has anything to do: production compiles SCSS once at boot and never re-imports code. `--production` now starts neither. The CLI stays to supervise the server process and shut its tree down cleanly on Ctrl-C.

### A stale CA no longer turns a missing certificate into six failures (python#98)

The MQTT TLS tests trusted whatever CA file happened to sit in the shared temp directory. Once that file went stale, the tests did not skip. They failed, six of them, in all four frameworks, pointing at TLS code that was correct. Each suite now verifies that the CA actually validates the broker certificate before it treats the TLS environment as present, and skips when it does not.


## v3.13.82 (2026-07-23) - MQTT 3.1.1: talk to any broker, no dependency

Tina4 now speaks MQTT. The new `Mqtt` client publishes and subscribes to any MQTT 3.1.1 broker - Mosquitto, EMQX, HiveMQ, AWS IoT - and adds nothing to your dependency tree. It is built on the standard library alone (`socket`, `struct`, `ssl`), and it is the same client in all four frameworks.

```python
from tina4_python.mqtt import Mqtt

mqtt = Mqtt()   # reads TINA4_MQTT_URL, default mqtt://127.0.0.1:1883
mqtt.publish("fleet/meter-42/telemetry", '{"kwh":12.5}', qos=1)

for message in mqtt.consume("fleet/+/telemetry", qos=1):
    if message.duplicate:
        continue
    store(message.topic, message.payload)
```

- **QoS 0 and QoS 1, retained messages, and a Last Will.** `publish`, `subscribe`, and `consume` mirror the Queue you already know. `consume` acknowledges a message only after your handler has processed it, so a handler that fails leaves the message for redelivery - at-least-once, which is what QoS 1 is for.
- **QoS 2 is refused, loudly.** Asking for exactly-once raises an error that names the limit and the fix - a QoS 1 consumer keyed on device id and timestamp - rather than silently downgrading to at-least-once and double-processing forever.
- **TLS with a per-client trust store.** An `mqtts://` connection verifies the broker against the CA you supply and no other. A self-signed certificate is rejected unless you provide its CA, and a CA loaded for one client never leaks into the next.
- **Username and password auth**, over plain or TLS connections, from the URL or from explicit arguments.
- **No mocks.** Every test runs against a real Mosquitto broker - the anonymous, authenticated, and TLS listeners - so the wire protocol is verified for real, not simulated.

This release also:

- **Counts 98 built-in features.** MQTT is the newest. 97 features are identical across all four languages; Ruby adds ERB as a native second template engine for 98.
- **Stops and deregisters a single background task.** `background()` returns a handle whose `stop()` ends just that task and removes it from the registry.
- **Dispatches the in-process test client through the real front controller**, so a test sees the same routing, middleware, and 404 path a real request does.
- **Ships the compiled Tina4 CSS assets** and honours SCSS `!default` instead of leaking it into the output.
- **Reaches `doctor`, `setup`, and `deploy`** from the framework CLI by delegating to the shared Rust CLI.

## v3.13.81 (2026-07-21) - `tina4 test` fails the build when tests fail

A green build could hide a red suite. `tina4 test` ran pytest, then threw pytest's exit code away and always returned 0. A `tina4 test || exit 1` gate in CI or a pre-push hook passed while tests failed underneath it. This release makes the command exit with pytest's own return code, so a failing suite fails the gate.

- **The exit code now propagates.** `tina4 test` returns whatever pytest returns. A red suite exits non-zero and stops the pipeline; a green suite exits 0. Nothing else about the command changes.
- **A real lock-in test pins it.** The test spawns the actual CLI against a temp project with a failing test and asserts a non-zero exit, then repeats with a passing test and asserts 0. No mocks - the CLI runs for real.

This release re-aligns all four frameworks on one version. Python, Ruby, and Node skip 3.13.80, a PHP-only patch that shipped the `\Tina4\Test` base class; PHP moves from 3.13.80 to 3.13.81. Everyone is back on 3.13.81.

Reported as python#96.

## v3.13.79 (2026-07-19) - Session cookies get Secure behind a proxy, and a renamed cookie is read back

If you run Python behind nginx, an ALB, or any TLS-terminating proxy, your session cookie shipped without `Secure` on the very deployments that were encrypted. This release fixes that and reads a renamed cookie back.

- **Security: `Secure` now follows the scheme the client actually used.** The response emit path in `server.py` hand-wrote the session `Set-Cookie` header and never called the cookie builder, so the documented `TINA4_SESSION_SECURE` did nothing and there was no proxy detection at all. The emit path now routes through the one cookie builder (`cookie_header`). `Secure` is set when `TINA4_SESSION_SECURE` is truthy, when `SameSite` is `None` (browsers reject `None` without `Secure`), or when the request is HTTPS - detected proxy-aware through `x-forwarded-proto`, whose first hop is the client-facing one, resolved by `Request.is_secure_scheme()`, else the native scheme.
- **Plain HTTP is unchanged.** Without a proxy header and without TLS, the cookie stays non-Secure, so the browser keeps returning it and local sessions never break silently.
- **`TINA4_SESSION_NAME` is now read back.** The write side honoured `TINA4_SESSION_NAME`, but the incoming-cookie read used a hardcoded `tina4_session` literal, so an operator who renamed the cookie wrote one name and read another, and the session silently never resumed. Both sides now resolve the name through one function (`session_cookie_name()`); the default is byte-identical to before.

Reported by justin-k-bruce (python#95). Real-server tests read the actual `Set-Cookie` off a live server driven with a real `X-Forwarded-Proto` header; the name test resumes a renamed cookie across two requests and proves the default is unchanged.

## v3.13.77 (2026-07-16) - A slow background task no longer runs on top of itself

- **`background()` never overlaps a task with itself.** A sync callback that took longer than the loop's timeout used to have a second copy started alongside it, and every later tick piled on another. A callable already running in a thread pool cannot be cancelled, so the timeout abandoned the wrapper while the thread kept working. Each run is now awaited to completion before the next tick, and an overrun only logs a warning. The old warning claimed the task "was interrupted" when it was still running, which pointed away from the cause; it now says the task is still running and the next run is deferred.
- **Why it matters.** This is silent double-execution of any slow periodic sweep, in a single process, with no clustering involved. A queue drainer that reads rows and marks them one by one would process every row twice.

Reported by justin-k-bruce, who traced it to the exact lines and supplied a repro. Real-thread regression tests now pin the no-overlap invariant.

## v3.13.76 (2026-07-16) - Migrations apply again on a database created before 3.13.55

If your database was created by Tina4 v3 3.13.54 or earlier, every new migration failed and none could ever be applied. This release fixes that. It is the framework that created the legacy column, so Python is where it bit.

- **The bookkeeping insert now writes the columns your table actually has.** The 3.13.55 rename added `migration_name` and left the old `migration_id` column in place, calling it harmless. It was harmless on reads and anything but harmless on writes: that column is `NOT NULL`, the insert never filled it, so recording a migration raised a not-null violation, the migration rolled back, and the database was stuck. The runner now builds its insert from the table's real columns and fills any legacy one it finds. No schema change, no `ALTER`, every engine.
- **Fresh databases are untouched.** A table with no legacy column still gets exactly the six canonical columns. That is the case CI and every new project exercised, which is why this only ever bit long-lived staging and production databases.

Thanks to justin-k-bruce, who reported it against 3.13.75 with a full compatibility matrix and a working patch. Real-database regression tests now cover a pending migration on a legacy table in all four frameworks.

## v3.13.75 (2026-07-14) - Static assets revalidate, so a deploy reaches users without a hard refresh

The built-in static file handler (everything under public/) now lets a browser cache an asset but forces it to revalidate on every use. A redeployed CSS or JS file reaches the browser on the next page load, with no manual hard refresh - and an unchanged file costs a cheap 304 Not Modified, not a full re-download.

- **Cache-Control and validators on every static response.** Each asset carries `Cache-Control: no-cache, must-revalidate`, an `ETag`, and a `Last-Modified`. Before, the static path set no Cache-Control and no Last-Modified.
- **Conditional requests get a 304.** The handler answers `If-None-Match` and `If-Modified-Since` with a `304 Not Modified` and no body, so a revalidation is a small round trip rather than a re-download. Real-file, real-request tests lock the behaviour in.

This lands identically across Python, PHP, Ruby, and Node.js. It closes the class of "I already reported this" where a browser kept serving a fixed-but-cached front-end asset.

## v3.13.74 (2026-07-13) - The dev dashboard connection tester works again

The dev dashboard has a "Test connection" panel that opens a database URL and reports the server version and the table count. On Python it failed on every call: the handler imported `tina4_python.Database` (capital D), a module that does not exist, so it always returned `{"success": false}` and never reached `db.get_tables()`. This release imports the real `tina4_python.database` module, so the panel connects, lists the tables, and shows the version.

- **The connection tester reports the real table count.** A real-SQLite test (no mocks) now drives the endpoint end to end against a live database with two tables and asserts the count and version come back. The endpoint had no end-to-end coverage before, which is exactly how the broken import shipped unnoticed.

The same panel was broken in different ways in PHP and Node.js and is fixed there too; Ruby was already correct and gained the same lock-in test.

## v3.13.73 (2026-07-13) - A failed migration re-applies cleanly

This release makes a previously-failed migration run again on the next migrate, at full parity across the four frameworks.

- **A leftover `passed = 0` row no longer wedges the next run.** When a migration succeeds, the runner deletes any existing bookkeeping row for that migration name before it writes the fresh `passed = 1` row. A migration that failed earlier - whether you recorded it with `record_migration(name, batch, passed=0)` or carried it over from a v2 table - re-applies cleanly instead of colliding on the unique `migration_name`. The `tina4_migration` table holds at most one row per migration, and the latest run wins. The delete-then-insert path is identical on every engine, so there is no dialect-specific behaviour to reason about.
- **The v2 upgrade tells you what happens next.** When the v2 to v3 upgrade finds `passed = 0` rows, it logs that those migrations re-apply on the next migrate, instead of asking you to clear them by hand.

## v3.13.72 (2026-07-12) - Frond number_format, filter precedence, and a sandbox fix

This release sharpens the Frond template engine, locks in a database error contract, and brings the dev dashboard to parity across the four frameworks.

- **`number_format` reads all three arguments.** The filter now honours the full Twig signature, `number_format(decimals, decimalPoint, thousandsSep)`:

  ```twig
  {{ 1234.5 | number_format(2, ',', '.') }}   {# renders 1.234,50 #}
  ```

  The one-argument form is unchanged, so every existing template behaves as before. (php#170)
- **The filter pipe binds tighter than concat.** `|` now groups before `~`:

  ```twig
  {{ amount|number_format(2) ~ ' EUR' }}   {# (amount|number_format(2)) ~ ' EUR' -> 1,234.50 EUR #}
  ```

  The rule holds at any nesting depth, including both branches of a ternary. On Python it also clears a latent case where a pipe inside parentheses rendered empty. (php#171)
<div v-pre>

- **The sandbox allow-list covers every filter path (Security).** A filter applied inside a `~` concatenation or a ternary condition now respects the `{% sandbox %}` filter allow-list. A filter you did not allow-list no longer runs its code in sandbox mode.
- **A malformed request path was already safe here.** The Node worker gained a guard this release for a path like `//` (or `///`, `/\`); Python never crashed on it and returns a normal 404.
- **Database errors still fail loud (#57).** `execute()` and `fetch()` raise on failure and record the message on `get_error()` rather than returning `False` or an empty result. This shipped in 3.13.38; this release adds a real-PostgreSQL regression test across all four frameworks so it can never slip back to a silent failure.
- **Dev dashboard parity (`TINA4_DEBUG`).** The dev-admin dependency installer (`deps/install`), the grounding-token proxy, and the Migrate, Test, and Seed run-chips now match across all four frameworks. This is development-only; nothing changes in production.

</div>

## v3.13.71 (2026-07-11) - AI skills: sharper tina4_code guidance

A skills-and-docs release; no change to the Python package. The bundled Tina4 AI skills now state WHY `tina4_code` is deprecated: in a boot-and-verify gate (scaffold the output, boot it, run it) `tina4_code` failed where a strong model grounded with `tina4_context` passed, so the tools point to grounding plus a strong model over the self-hosted coder. The recommendation is unchanged - ground with `tina4_context` and write the code yourself; only the rationale is sharper. Running `curl -fsSL https://tina4.com/install-skills.sh | sh` now installs these updated skills by default.

## v3.13.70 (2026-07-11) - Column defaults on INSERT, a Firebird charset override, and stacked Swagger metadata

### ORM honours column defaults on INSERT (#165)

An INSERT now omits any column you never set on the model, so the database applies that column's own DEFAULT. Previously `save()` serialised every declared column, sending an explicit NULL for the ones you left alone; a `NOT NULL DEFAULT <x>` column then failed the insert, because a DB default applies only when the column is omitted, not when NULL is passed. The rule is now precise: a column you never touch is omitted and the database fills it in; a column you explicitly set to `None` is written as NULL; a column with a non-None ORM default is still written. When every insertable column is unset, the row inserts with the engine's all-defaults form. UPDATE is unchanged. Shipped across all four frameworks, verified with real-SQLite positive and negative tests.

### Firebird connection charset override (#160)

The Firebird adapter no longer hardcodes the connection charset to UTF8. You can override it, in precedence order, with a `?charset=` query on the connection URL (`firebird://host:port/path?charset=NONE`), an explicit `charset=` argument on `connect()`, or the `TINA4_DATABASE_CHARSET` environment variable. The default stays UTF8, so nothing changes unless you ask for it. This fixes double-encoded UTF-8 bytes read from a legacy NONE database. Shipped across all four frameworks.

### Stacked Swagger metadata all survives (#59)

Stacking `@summary`, `@description`, and `@tags` on one route now keeps every decorator's value in the generated OpenAPI spec, whatever the order. Python and Ruby were already correct; the fix landed in PHP and Node, and all four now carry a lock-in test so the behaviour cannot drift again.

## v3.13.69 (2026-07-10) - The Api client grows up: uploads, downloads, and safe redirects

The built-in HTTP `Api` client gained four zero-dependency capabilities, shipped across all four frameworks. All are opt-in and non-breaking in Python.

- **Multipart upload.** `Api.upload()` POSTs a `multipart/form-data` body from a file on disk (`file_path`) OR from in-memory bytes (`file_bytes` plus `filename`), with optional extra text fields, so you never need a temp file. The part Content-Type is guessed from the filename. A missing file or no source returns a clean error dict and never raises.
- **Streaming download.** `Api.download()` streams a GET body straight to disk in 64KB chunks, so a multi-megabyte file never lands in memory whole. It returns the status, headers, and the on-disk `path` (there is no `body` key), and writes nothing on an error status.
- **Transport seam.** An injectable `transport` lets application developers unit-test code that calls an `Api` without a live server. Tina4's own suite never injects a fake (the no-mock rule stands); every framework test hits a real local server.
- **Opt-in cookie jar.** Pass `cookies=True` for a per-client in-memory jar: the client parses `Set-Cookie` (leading `name=value`, last write wins) and replays the accumulated `Cookie` header on later requests.

The cross-origin redirect protection now also covers the cookie jar: on a redirect to a different scheme, host, or port the client strips BOTH the `Authorization` and the `Cookie` header, so neither a bearer token nor a session cookie can leak to a host you did not authenticate to. Same-origin redirects keep them.

### Also shipping

- **REPL database env fix.** The interactive console now connects using the project database URL, credentials, and bind, matching the running application, instead of a hand-rolled connection that ignored them.
- **AI coder rule-path skill.** The AI coding-assistant scaffolder writes each tool's rule and context files to the correct path, across all four frameworks.

## v3.13.68 (2026-07-10) - Parity release

A version bump to keep all four frameworks on the same number. No functional changes to the Python package since 3.13.67; the accompanying change is a fix to the Tina4 maintainer AI skill so it links plan and source files by a path that resolves when clicked.

## v3.13.67 (2026-07-10) - The MCP table browser, locked down

**The `database_tables` dev-tool now has a real behavioural test.** A sibling bug in the PHP framework (#164) fataled the same tool: it called a method that does not exist instead of listing tables, and the test never caught it because it only checked the tool was registered, never that it ran. This framework already listed tables correctly, but carried the same blind spot in its own tests. The new test invokes the real handler against a real SQLite database and asserts a table list comes back, so this class of drift is caught here too. Shipped across all four frameworks.

## v3.13.66 (2026-07-10) - A self-describing CLI, and generators that ship their tests

The command line grew up. The `tina4` client no longer keeps its own copy of what
each framework can do. It asks the framework, then forwards the request. A command
you add to the framework shows up in the client automatically; one you remove simply
stops being offered. The whole class of client-versus-framework drift is gone.

### The self-describing CLI

- **`commands` / `commands --json`.** Every framework CLI now prints its own command
  table from a single source. The `tina4` client reads that manifest to render an
  accurate `tina4 --help`, caches it by a cheap fingerprint of the resolved CLI, and
  refreshes with `--refresh`. Dispatch never depends on the manifest, so a discovery
  miss shortens the help listing and never breaks a command.
- **Pass-through dispatch.** The client keeps its own conductor commands (serve, scss,
  setup, init, deploy, agent, doctor, install, update, build) and forwards everything
  else to the framework verbatim. It carries no per-command flag knowledge, so it can
  never fall out of parity.
- **`queue` is now a top-level command** in all four frameworks: `queue work`,
  `queue stats`, `queue retry`, `queue clear`, wired to the real queue. Run a worker
  straight from the CLI instead of only scaffolding one.
- **`build` builds the deployable Docker image** (`docker build`), replacing the old
  library-packaging behaviour. `build` produces the image; `deploy` ships it.
- **Ruby gains `migrate:create`**, matching the other three.

### Generators now ship a test with the code

Every code-producing `generate` subcommand writes a real, passing test next to the
code it scaffolds. `generate model Product` also gives you a `Product` test that talks
to a real database. The tests use real collaborators (real SQLite, a real test client,
a real queue), never mocks, and pass the moment they are generated.

Writing those tests exposed real bugs in the scaffolds that no string-matching test
would have caught: the generated `auth` current-user endpoint rejected valid tokens in
Python and PHP, and the generated migration created then immediately dropped its table
in Ruby and PHP. All four are fixed and locked in by the new tests.

### Databases

- **PHP silent PDO fallback.** SQLite and PostgreSQL adapters prefer the native
  extension and fall back to the matching PDO driver when it is missing. The developer
  gets a working database either way, with identical behaviour (native types, raw-byte
  BLOBs, last insert id, transactions, fail-loud errors).
- **ORM `where()` takes an order.** `Model.where(...)` now accepts `order_by` /
  `orderBy` (and Ruby also gains `limit`/`offset`), matching `find()`, `all()`, and the
  query builder.

### Fixes

- The Frond browser helper now applies a 30 second request timeout by default.
- SQLite datetime adapters no longer emit a deprecation warning on Python 3.12+.
- Node route handlers accept a `void` return in TypeScript without a type error.

### Breaking

- **Frond `request()` now times out after 30 seconds by default.** A request that
  used to hang forever now fails after 30 seconds and calls `onError`. Pass
  `timeout: 0` to restore the old unbounded behaviour, or a millisecond value to set
  your own.
- **`build` changed target.** It now builds a Docker image rather than packaging the
  framework as a library. Projects that relied on the old behaviour should call their
  packaging tool directly.
- **`generate` writes an extra test file per scaffold.** If you script generation and
  assert on the exact set of created files, expect one more file (the co-emitted test).

## v3.13.56 (2026-07-08) - Skills that own up when they drift

**Every AI skill now tells the assistant how to report itself when it is wrong.** A skill is documentation, and documentation drifts. When a skill still describes a method, default, or column the framework no longer has, an assistant writes confident code against an API that is gone. This release closes that loop.

Every skill, and every project context file the AI installer writes (CLAUDE.md, .cursorules, .github/copilot-instructions.md, .windsurfrules, CONVENTIONS.md, .clinerules, AGENTS.md), now carries one instruction: if Tina4 behaves differently from what the skill describes, that is a bug in the skill. Tell the developer, then report it at https://tina4.com/report-a-skill. The report lands as an issue on the documentation repository, gets fixed at the source, and ships to everyone.

**The skills themselves are corrected too.** The ORM soft-delete guidance now names the real `is_deleted` column (it wrongly said `deleted_at`), the tina4-js signal-persistence reference ships alongside the skill, and the per-framework skill copies are back in sync with the canonical set.

The web framework runtime does not change in this release. Update your installed skills with `curl -fsSL https://tina4.com/install-skills.sh | sh` (re-run to refresh in place).

## v3.13.55 (2026-07-07) - One migration tracking schema on every engine

**The `tina4_migration` bookkeeping table now has the same shape on every framework and every engine.** Before this release the four frameworks each named and typed the tracking table a little differently. A project that moved between them, or a tool that read the table directly, met a different schema each time.

The canonical table is six columns: an auto-increment `id`, a `migration_name` (unique, the migration file stem), a `description`, a `batch`, an `executed_at` timestamp, and a `passed` flag. The auto-increment and the column types follow the engine: `AUTOINCREMENT` on SQLite, `SERIAL` on PostgreSQL, `AUTO_INCREMENT` on MySQL, `IDENTITY(1,1)` on SQL Server, and a generator on Firebird.

**Existing installs upgrade in place, and no applied migration re-runs.** The runner detects the old name column (`migration_id` in Python, `migration` in PHP, `name` in Node; Ruby already used `migration_name`), adds `migration_name`, copies the values across, and backfills the new columns. The old column stays where it is, ignored. A migration already marked applied stays applied.

No new third-party dependencies. Shipped across all four frameworks.

## v3.13.54 (2026-07-07) - Migrations honour the SET TERM directive

**A Firebird trigger or stored procedure now survives the migration splitter.** Those bodies end their inner statements with a semicolon, the same character the runner uses to separate one statement from the next. Run under the default terminator, a trigger body split apart on its own punctuation and the migration failed.

A `SET TERM` line fixes it. Wrap the block in the universal isql idiom and the runner switches its active terminator, so the whole body travels as one statement:

```sql
SET TERM ^ ;
CREATE OR ALTER TRIGGER t_bi FOR t ACTIVE BEFORE INSERT AS
BEGIN
  IF (NEW.id IS NULL) THEN NEW.id = GEN_ID(GEN_T, 1);
END^
SET TERM ; ^
```

The runner consumes each `SET TERM` line instead of sending it to the engine, restores the previous terminator when the block ends, and handles a multi-character terminator such as `!!`. A migration with no `SET TERM` splits on the semicolon exactly as before. Shipped across all four frameworks.

**PHP and Ruby also repair the Firebird v2 to v3 upgrade.** Firebird returns column names in upper case, so the migration tracker read a null migration name and treated every applied migration as pending, re-running the lot. The tracking-table reads now normalise to one key shape. PHP additionally records a row on an upgraded table with its original 14-character id and detects the Firebird dialect through the Database facade.

Thanks to justin-k-bruce for the contribution.

## v3.13.53 (2026-07-06) - JSONField: JSON document columns

**Store a JSON document in a column.** A model field can now hold a whole object or array. The framework encodes it to JSON when it writes and decodes it back to a native dict when it reads, so the attribute is always live data, never a raw string.

```python
class Event(ORM):
    payload = JSONField()          # dict or list
```

The column type follows the engine. PostgreSQL gets native `JSONB`, MySQL native `JSON`, SQL Server `NVARCHAR(MAX)`, Firebird a text `BLOB`, and SQLite `TEXT` (queryable through JSON1). One field declaration, the right column on every database.

A value that cannot be encoded to JSON does not slip through. `save()` fails loud: it rolls back, returns `False`, and records the cause, so a half-written row never reaches the table. A mutable default is copied per instance, so two records never share and mutate the same object.

No new third-party dependencies.

## v3.13.52 (2026-07-04) - Frond live blocks, pgsql:// URL scheme, SCSS colour functions

<div v-pre>

**Frond live blocks.** A page can now carry a region that keeps itself current. Wrap the region in `{% live %}` and Frond paints it on the server with the first request, then refreshes it over the transport you name.

</div>

```twig
{% live "prices" poll 5 %}
  <ul>{% for row in rows %}<li>{{ row.name }}: {{ row.price }}</li>{% endfor %}</ul>
{% endlive %}
```

The block renders server-side on first paint, so a crawler and a client with no JavaScript both see real content. After that it refreshes on its own. `poll N` re-fetches every N seconds. `sse` streams updates over Server-Sent Events. `ws "/path"` rides a WebSocket route you already own. A data provider feeds every refresh: `@live_source` in Python, `Frond::liveSource` in PHP, `Frond.live_source` in Ruby, `Frond.liveSource` in Node. The provider re-runs with the live request, so a block that reads the signed-in user reads it again on every refresh, and an authenticated block cannot serve one user another user's data. For poll and SSE, Tina4 mounts one always-on endpoint, `GET /__frond/live/{name}`. For a WebSocket block, `push_live(name, data)` re-renders the block and broadcasts the fresh HTML to every client on that path. Nested live blocks are rejected, and a block's optional `src` attribute is same-origin only.

One client script drives it, `frond.js`, byte-identical across Python, PHP, Ruby, and Node. No build step. No framework on the page.

**pgsql:// is a Postgres URL scheme again (#58).** A connection string like `pgsql://user:pass@host/db` was rejected. v3 registered only `postgresql://` and `postgres://` and dropped the older spelling, but `pgsql` is the scheme PDO, Laravel, and Doctrine all use, so real config files carried it and Tina4 refused to start. `pgsql://` now resolves to the PostgreSQL driver in all four frameworks, next to the two existing spellings. Same driver, three accepted names.

**SCSS colour functions evaluate at compile time.** `rgba(#3498db, 0.5)` used to pass through to the stylesheet as literal text, and the browser dropped the whole rule because `rgba()` cannot take a hex string. The built-in SCSS compiler now evaluates the colour functions: `rgba(#hex, a)` and `rgb(#hex)` expand to real channel values, `mix(c1, c2, weight)` blends two colours, and `lighten()` and `darken()` shift a colour through HSL. The output is byte-identical across all four compilers, down to the same integer rounding, so a shared stylesheet renders the same colour whichever framework served it.

No new third-party dependencies.

## v3.13.51 (2026-07-03) - MCP Streamable HTTP transport, Firebird fixes

The built-in dev MCP server now speaks the current MCP Streamable HTTP transport, the one Claude Code and today's MCP clients expect. It still answers the older 2024-11-05 HTTP+SSE transport, so nothing that already worked stops working.

One endpoint carries the whole session. A client POSTs JSON-RPC to `/__dev/mcp` and reads the response inline. `initialize` mints a session and returns it in an `Mcp-Session-Id` header; the client sends that header back on every later call. A request with an unknown session gets a `404`, its cue to initialize again. A notification returns `202`. `GET` on the endpoint returns `405` with `Allow: POST, DELETE`, and `DELETE` ends the session. The server negotiates the protocol version: it echoes the version a client asks for when it can speak it, otherwise it picks the newest one it knows.

Tina4 writes the connection details to `.claude/settings.json` for you, now with `"type": "http"` and the bare `/__dev/mcp` URL. Prefer the command line? Run `claude mcp add --transport http tina4-dev http://localhost:7146/__dev/mcp`. The change lands uniformly across Python, PHP, Ruby, and Node. Python and Node keep a full persistent legacy SSE stream; PHP and Ruby serve the current transport plus a one-shot legacy handshake, with no long-lived connection required.

**Why the transport slipped past us.** Our MCP tests spoke our own JSON-RPC shape over the endpoints we built, never the wire a real client speaks. They stayed green while a real Claude Code client could not connect. Every framework now ships a no-mock transport test that drives the real session lifecycle, and each was verified end to end against a live server booted through the tina4 CLI.

**Firebird (PHP).** Three reported issues are fixed. The migration runner and the ORM now call `execute()` rather than the old `exec()` (#120). Parameterized DML no longer throws a type error when it fetches the last insert id (#121). NULL parameters bind correctly again, rewritten to a literal `NULL` because the ibase driver cannot bind a PHP null (#123). The `exec()` method stays as a deprecated alias for `execute()`.

**Migration recording on upgraded schemas (PHP).** The fail-loud `execute()` surfaced a quiet bug. On a database whose `tina4_migration` table had been upgraded in place from the old v2 layout, a new migration never recorded itself, so it re-ran on every boot. The old `exec()` had swallowed the constraint error. The runner now supplies the legacy `migration_id` column when it is present, so a migration records once and stays recorded.

No new third-party dependencies.

## v3.13.50 (2026-07-02) - Path route params match INTEGER primary keys on SQLite (Ruby fix)

A route path parameter like `{id}`, matched against a real HTTP request, must find an INTEGER primary-key row. On Ruby it did not. Rack delivers the request path as ASCII-8BIT, so an untyped `{id}` capture reached the SQL bind as a binary string, and the sqlite3 gem bound it as a BLOB. SQLite gives a BLOB no numeric affinity, so `WHERE id = ?` never matched an INTEGER column - `GET /api/users/{id}` returned 404 for a row that plainly existed (and `GET /api/users` listed it). The router now relabels path captures as UTF-8 so they bind as TEXT, which SQLite coerces to the column's integer affinity, and the row matches. Typed `{id:int}` params were never affected - they cast to an Integer. The SQLite driver is left alone on purpose: coercing every binary string there would corrupt genuine BLOB writes, so the encoding is fixed at the source (the router).

Python, PHP, and Node were confirmed unaffected - their string path params already bind as TEXT - and each gains a real regression test: real router extraction feeding a real SQLite integer-primary-key lookup, no mocks, so the contract cannot silently drift. No new third-party dependencies.

## v3.13.47 (2026-06-25) - Open-issue batch: migration comment splitting, global middleware, SCSS interpolation

Four reported bugs, fixed and locked in with tests against the real thing.

**Migration statement splitter (#54).** A migration whose SQL carried a `;` inside a `-- ...` line comment fragmented into broken pieces, because the runner split on the `;` delimiter before it stripped comments. A `CREATE TABLE` with a trailing `-- drop then re-add; old way` comment raised "incomplete input" on SQLite. The splitter is now a single-pass, quote- and comment-aware scanner: it strips `--` line and `/* */` block comments, copies single- and double-quoted string literals verbatim (honouring the `''`/`""` escape), keeps `$$`/`//` stored-procedure blocks intact, and splits on the delimiter only outside all of that. A `;` or `--` inside a comment or a string literal can no longer split or corrupt a statement. Named regression tests plus an end-to-end migrate against a real temp SQLite database lock it in, with no mocks.

**Global middleware now runs (#55).** Middleware registered globally with `Middleware.use(...)` or `Router.use(...)` never executed - the request dispatcher only iterated each route's own middleware list and never read the global registry, and `Router.use` wrote to a private list nothing consulted. Global middleware now folds into every route's before and after run, in registration order, deduped against route-level middleware. PHP, Ruby, and Node already dispatched globals; each gains a lock-in test so the contract never regresses.

**Hot-reload no longer duplicates modules (#53).** The dev-reload auto-discover re-imported a `src` module that another file had already pulled in transitively, minting a fresh module object while the earlier importer kept the old one - module-level singletons silently diverged. Discovery now records a baseline for a transitively-loaded module instead of re-importing it, and only ever reloads a module it loaded itself. A genuine edit still hot-reloads on the next pass; a regression test covers both paths.

**SCSS `#{}` interpolation (#116).** The SCSS compiler did not support interpolation, so `calc(100% - #{$gap})` left the `#{...}` in the output and corrupted the CSS around it. The compiler now resolves `#{ ... }` before variable substitution and nesting: a `$variable` inside the braces resolves to its value and anything else inlines verbatim, so `calc(100% - #{$gap})` becomes `calc(100% - 20px)` and `.icon-#{$name}` becomes `.icon-home`. Shipped across all four frameworks for parity.

No new third-party dependencies. Full suite: 3,183 passing.

## v3.13.46 (2026-06-24) - Atomic batch insert on SQLite + full batch-contract tests

A batch insert that hits a bad row must leave the table untouched, not half-written. SQLite's execute_many ran the batch with no transaction wrapper, so a row that violated a constraint mid-batch raised but left the rows before it applied in an open, uncommitted transaction - a partial write. It now wraps a standalone batch in one transaction and rolls the whole batch back on any error, all-or-nothing, matching PostgreSQL, MySQL and MSSQL (which already committed the batch as a unit). The batch-insert tests now assert the full contract against every live engine - all rows read back, the affected-row count, a single-row insert, an empty-array no-op, and the atomic rollback - with no mocks. No new third-party dependencies.

## v3.13.45 (2026-06-24) - MSSQL insert row-count fix + real-service test hardening

Running the batch-insert tests against a live SQL Server for the first time exposed a real adapter bug. `execute()` read the affected-row count at the end of the call, but for an INSERT it had already run `SELECT SCOPE_IDENTITY()` on the same cursor, so the count it returned reflected the identity probe rather than the insert. Every MSSQL INSERT reported an `affected_rows` of zero. The rows landed and `last_id` was correct, but a batch insert summed those zeros and looked like it had done nothing. The adapter now captures the count straight after the main statement, before the identity probe overwrites it. The fix is INSERT-only - UPDATE and DELETE never run that probe and were already correct. The live MySQL and MSSQL batch tests now build their connection from the standard `TINA4_TEST_*` host and port variables, so they run for real against the provisioned engines instead of skipping on an absent URL. No new third-party dependencies.

## v3.13.44 (2026-06-24) - Real-service bug-fix sweep (no mocks)

Standing up live infrastructure - PostgreSQL, MongoDB, Redis, Valkey, Memcached, RabbitMQ, Kafka - and running the suites against the real services surfaced a batch of bugs that mock-based and skipped tests had hidden. This release fixes them across the family and makes the no-mock rule absolute: a test that touches a dependency exercises the real service, never a stand-in. **Migrations on PostgreSQL/MySQL/MSSQL:** the migration runner built its bookkeeping table (`tina4_migration`) with SQLite-only DDL (`id INTEGER PRIMARY KEY AUTOINCREMENT`) for every non-Firebird engine, so `migrate()` failed on PostgreSQL with a syntax error and never applied a single file. The tracking-table id is now engine-aware - `SERIAL` on PostgreSQL, `AUTO_INCREMENT` on MySQL, `IDENTITY` on MSSQL, `AUTOINCREMENT` on SQLite. The existing migration tests only covered SQLite, which is why this shipped; a gated live-PostgreSQL migration test now guards the engine-aware path. **Kafka:** dequeue waits for the consumer-group partition assignment on first subscribe, so a single short poll right after produce no longer returns nothing. **RabbitMQ:** the raw-socket fallback negotiates `Connection.TuneOk` from the broker's proposal - the hardcoded `channel-max=0` made a standard broker abort the handshake. The pika path was already correct. No new third-party runtime dependencies. All four suites pass against live services.

A parity sweep shipped in the same release. The live Redis, MongoDB, and Valkey session round-trips run by default. They gate on the service being reachable rather than on an opt-in environment variable, so the real write, read, and destroy path runs on every test pass with the infrastructure up. Under `TINA4_REQUIRE_SERVICES` a provisioned backend that is unreachable becomes a hard failure rather than a silent skip.

**MySQL and MSSQL join the provisioned test services (#262).** Both engines now run live round-trip tests by default, gated on reachability the same way the other services are. The non-skippable real-service gate fails on a MySQL or MSSQL skip under `TINA4_REQUIRE_SERVICES`, so a missing engine in CI breaks the build instead of passing quiet. CI gained a MySQL 8 container and a SQL Server 2022 container. Running the suites against these two engines for the first time surfaced adapter bugs that no prior test could reach.

One of those bugs lived in the master itself. The MSSQL row-count probe wrapped the user query in `SELECT COUNT(*) FROM (...)`, and a query ending in `ORDER BY` put that clause inside a derived-table subquery. SQL Server rejects an `ORDER BY` in a subquery without `TOP`, so the probe reported a count of zero. The probe now strips a trailing top-level `ORDER BY` before it wraps the query. This was a genuine Python bug, not a mirror artefact - the master carried it too. Two adapter behaviours were already correct here and earned regression tests to lock them in: a raw boolean binds as `1`/`0` at the parameter boundary, and `last_id` after an insert returns the new auto-increment or `IDENTITY` value and survives a later `SELECT`.

The no-mock rule reached further this release (#250). The messenger SMTP and IMAP tests now talk to a real GreenMail mail server, the WebSocket backplane tests run against a real Redis backplane, and the HTTP-client tests hit a real loopback HTTP server. Every in-test double in those paths is gone. The dev mailbox gained a non-ASCII round-trip regression test for parity with the family: write a message with an accented name, read it back, confirm the bytes survive. Python escapes non-ASCII to ASCII in its message JSON, so it never carried the decode bug that bit Ruby, but the test now guards the contract on every engine.

## v3.13.43 (2026-06-22) - Queue lifecycle correctness + cross-framework unification

A live MongoDB producer/consumer test exposed four queue bugs, and fixing them across the family surfaced a deeper split: the four frameworks ran three different queue-lifecycle architectures. This release unifies them on one model - the active backend (whatever `TINA4_QUEUE_BACKEND` selects) owns the whole lifecycle - and fixes the bugs. **`consume(topic)`/`process(topic)` now honour the topic argument** - they previously read the construction-time topic, so consuming a topic the queue was not built with silently drained the wrong queue (every backend). **MongoDB retry timing:** a failed job is retryable on the next poll instead of being stranded for the full visibility window - `reject`/requeue now resets `available_at` (or `now + retry_backoff`) and clears `reserved_at`. **MongoDB attempts:** `dequeue` surfaces the live document attempt count, not the push-time snapshot, so `fail()` dead-letters at `max_retries` instead of retrying forever. **`dead_letters()`/`retry_failed()` signatures:** the MongoDB, RabbitMQ, and Kafka adapters now accept the `max_retries` keyword the queue passes - calling `queue.dead_letters()`/`retry_failed()` on those backends previously raised `TypeError`. A cross-backend contract test locks the signatures in. Regression tests cover topic targeting (engine-agnostic) and the MongoDB retry/attempts/dead-letter paths; verified end-to-end against a live MongoDB. Full suite: 3,280 passing.

## v3.13.42 (2026-06-22) - Swagger configurability for external and public APIs

Closes four gaps that pushed teams to hand-roll their own OpenAPI spec instead of using the built-in generator. **Configurable security schemes:** the built-in `bearerAuth` scheme honours `TINA4_SWAGGER_BEARER_FORMAT` (default `JWT`; set `opaque` for `sk_live_`-style keys), and setting `TINA4_SWAGGER_API_KEY_NAME` emits an `apiKeyAuth` scheme (`TINA4_SWAGGER_API_KEY_IN` is `header`/`query`/`cookie`). Register any scheme - including an `oauth2` flow with scopes - programmatically with `Swagger.add_security_scheme(name, definition)` (`Swagger.reset_registry()` clears it). **Per-route security:** a route declares its own requirement with `@security("oauth2", scopes=["read:users"])`, a `{name: [scopes]}` map, a list of maps for an OR requirement, or `@security("public")` to mark a write route open (emits `security: []`). A secured route with no explicit declaration falls back to `TINA4_SWAGGER_DEFAULT_SCHEME` (default `bearerAuth`). Scopes stay spec-valid: only `oauth2`/`openIdConnect` schemes carry them, every other type gets `[]`, so the output validates against 3.0 and 3.1. **Path filtering:** `TINA4_SWAGGER_INCLUDE` documents only routes whose path starts with one of its comma-separated prefixes; `TINA4_SWAGGER_EXCLUDE` drops matching prefixes; framework internals (`/swagger`, `/__dev`) are always excluded. **OpenAPI 3.1 opt-in:** `TINA4_SWAGGER_OPENAPI` (default `3.0.3`) emits `3.1.0` when set to `3.1`/`3.1.0`. **Reusable component schemas:** register a shared shape with `Swagger.add_schema(name, schema)` and reference it from a route with `@request_schema(name)` / `@response_schema(name, status, is_list)`, extending the ORM-model `$ref` mechanism to arbitrary schemas. Identical behaviour and tests across all four frameworks. Zero new third-party dependencies. Full suite: 3,266 passing.

## v3.13.41 (2026-06-22) - Queue reservation/visibility timeout (at-least-once delivery)

A targeted fix for silent job loss in multi-replica / rolling-deploy setups. When a consumer reserved a queue message and then died before acknowledging - a crash, an OOM kill, a Kubernetes pod eviction - the message was stranded forever: never re-delivered, never retried, never dead-lettered. The file backend deleted the job on pop (lost outright); the MongoDB backend flipped the document to `reserved` without advancing `available_at` and never re-evaluated it. Now a popped job is held as a reservation with `available_at = now + visibility_timeout` (plus a `reserved_at` stamp). If the consumer does not acknowledge in time, the next pop reclaims the abandoned reservation: it increments `attempts` and re-enqueues the job, or dead-letters it once it has hit `max_retries`. A dead consumer can no longer strand a job - standard at-least-once delivery, the contract SQS and RabbitMQ already provide. The window is configurable via `TINA4_QUEUE_VISIBILITY_TIMEOUT` (default 300 seconds; `<= 0` disables the reclaim) or the per-queue `visibility_timeout` option; `complete()`/`fail()`/`retry()` clear the reservation. RabbitMQ and Kafka are unchanged - the broker already owns redelivery there. Regression tests lock the behaviour in across all four frameworks (file backend: reclaim after the timeout, no reclaim before it, dead-letter past max_retries, complete/fail clear the reservation, env override, disable-at-zero; MongoDB: dequeue advances `available_at` and the reclaim requeues or dead-letters). Zero new third-party dependencies. Full suite: 3,250 passing.

## v3.13.40 (2026-06-22) - MCP security hardening + Swagger/OpenAPI overhaul

A coordinated cross-framework release with two themes: MCP transport security and a full Swagger/OpenAPI sweep. **MCP security:** the built-in dev MCP server now authorises every request on the raw socket peer rather than a configured host name, closing a remote-reach surface where a debug box bound to `0.0.0.0` exposed the file and database tools to unauthenticated callers. The gate is two layers - a host-independent capability check (`TINA4_MCP`, else `TINA4_DEBUG`) and a per-request authorisation: loopback always passes, while a remote caller needs `TINA4_MCP_REMOTE=true` AND a token matching `TINA4_MCP_TOKEN` (fallback `TINA4_API_KEY`), sent as `Authorization: Bearer`, `X-MCP-Token`, or `X-Api-Key`. Every MCP surface returns 404 to a disallowed caller, the SQL tool is read-only (SELECT/WITH, no stacked statements), and the file tools are sandboxed to the project root. **Swagger:** the production on/off switch is wired for real - set `TINA4_SWAGGER_ENABLED=false` to disable `/swagger` and `/swagger/openapi.json` in any environment, or `true` to expose them in production (it falls back to `TINA4_DEBUG` when unset). Secured routes now carry a `bearerAuth` security requirement, so the documentation no longer presents protected endpoints as public. ORM models become reusable `components.schemas` referenced by `$ref` across all four frameworks. The spec is valid where it was not: wildcard and splat routes emit proper `{name}` path parameters, `operationId` values are de-duplicated, and WebSocket routes no longer leak an invalid method. **Swagger configuration:** `TINA4_SWAGGER_SERVERS` (comma-separated) drives a multi-server block, `TINA4_SWAGGER_UI_CDN` points the UI assets at a self-hosted mirror for air-gapped use, and the generator adds typed-parameter formats, enums, top-level tags, and multipart request bodies. **SqliteDocStore (new):** a pymongo-style document store with a zero-config SQLite fallback. `get_collection(name)` returns a real Mongo collection when a Mongo URI is set (`TINA4_MONGO_URI`, then `TINA4_SESSION_MONGO_URI`, then the legacy `TINA4_SESSION_MONGO_URL`), otherwise a SQLite-backed collection over a local file (`TINA4_DOC_STORE_PATH`, default `data/tina4_docstore.db`) - the call sites are identical, only the backend differs. It pushes filters down to JSON1 `json_extract` (equality, `$in`, `$nin`, `$gt`/`$gte`/`$lt`/`$lte`, `$ne`, `$exists`, `$regex`, `$or`, `$and`, dotted nested keys), supports `$set`/`$unset`/`$inc`/replace/upsert with lazy `sort`/`limit`/`skip`/projection cursors, ships a zero-dependency 12-byte ObjectId, and round-trips datetimes and ObjectIds so values stay queryable. Develop against the local store and switch to MongoDB in production by setting one env var. **Developer experience:** the blank-`TINA4_SECRET` warning now explains why it fired - the run was not detected as development - and gives both fixes (set `TINA4_SECRET`, or set `TINA4_DEBUG=true` to auto-generate one into `.env.local`); the legacy-env strict check now hints the names may come from a `.env` baked into a Docker image and points at `tina4 env --migrate`. **Session Mongo env parity:** the session and DocStore Mongo URI is canonical as `TINA4_SESSION_MONGO_URI` across all four frameworks, with `TINA4_SESSION_MONGO_URL` kept as a back-compat legacy alias (Python and PHP historically read `_URL`). **Tests:** new DB contract tests (execute raises on a bad statement, read-after-write, generator monotonicity, transaction bracketing) and a queue isolation contract (a job in one topic never leaks into another, and a queue on a fresh storage path starts empty). **Breaking:** the Swagger and MCP production gates are now enforced - if you relied on `/swagger` being reachable in production, set `TINA4_SWAGGER_ENABLED=true`, and a remote MCP caller now needs `TINA4_MCP_REMOTE=true` and a token. Zero new third-party dependencies. Full suite: 3,238 passing.

## v3.13.39 (2026-06-21) - Auto-migration, unified critical log level, fail-loud ORM, per-route WebSocket auth

A cross-framework parity sweep that hardens the data layer and tightens a few safe-by-default behaviours. **Migrations:** pending migrations can now run on startup, gated by `TINA4_AUTO_MIGRATE` and off by default so existing apps are untouched. A footgun pass adds numeric-aware ordering (so `10_` sorts after `2_`, not after `1_`), `CREATE TABLE` idempotency, a URL-safe `//` delimiter, and smart/curly-quote normalization in migration SQL before it runs. **ORM:** `save()`, `create()`, `QueryBuilder`, and the Mongo path now fail loud instead of swallowing errors - `save()` validates first and returns `False` with the reason on `get_error()`, `create()` returns `False` when the write fails, and the silent fallbacks are gone. **Logging:** `critical` is now a first-class top-level severity, a new `Log.is_enabled(level)` lets callers skip building an expensive log payload, and logs default to stdout-only in production and container environments to avoid file bloat. **WebSockets:** a route can require authentication on the upgrade itself, before the socket is established. **Security:** the `/__dev/mcp` endpoint enforces its localhost guard and honors `TINA4_MCP_REMOTE`, and the built-in `Api` client strips the `Authorization` header on a cross-origin redirect and gains opt-in retry with backoff. **Env:** defaults align to the canonical `TINA4_` manifest with a uniform `.env.example` - CORS credentials are opt-in and AI hosts default to localhost. **Tooling:** the `tina4 metrics` coverage detection now counts full-package-path imports and short (3-character) class names, ending a class of false "untested" flags. Breaking: `critical` is now a top-level severity and the previous toggle is removed - update any logging configuration that relied on it. Full suite: 3,149 passing.

## v3.13.38 (2026-06-19) - Coordinated security & robustness release

A large bundled release closing a cross-framework hardening sweep. **WebSockets:** the Redis/NATS backplane is now wired for real - local-first delivery, then a published envelope on the shared `tina4:ws` channel, relayed by sibling instances with an origin guard (no own-echo, no cluster loop) - plus an origin allow-list (`TINA4_WS_ALLOWED_ORIGINS`), an idle reaper (`TINA4_WS_IDLE_TIMEOUT`), resilient broadcast (a dead/slow client is pruned, never aborts the loop), and SSE hardening (client-disconnect + generator-error). **Sessions:** a log-loud-and-degrade backend-failure policy (set `TINA4_SESSION_STRICT=true` to re-raise). **GraphQL/WSDL:** a SOAP `<!DOCTYPE>` is rejected before parsing (SOAP 1.1 forbids DTDs - this closes the XML entity-expansion / billion-laughs and external-entity surface), a recursion-depth guard (`TINA4_GRAPHQL_MAX_DEPTH`, default 50) catches deep queries **and** circular fragments, and resolver/SOAP faults are masked in production with the real cause logged (full detail only under `TINA4_DEBUG`). **Tooling:** a new `tina4 metrics` command reports the top-N code-health offenders (complexity, large files, low maintainability, untested) with `--top/--json/--fail-on/--path`, and the coverage test-detection is now precise - a real import / defined symbol, not a name-substring scan. **Queue:** Kafka TLS/SASL on the confluent producer **and** consumer (`TINA4_KAFKA_SECURITY_PROTOCOL` / `_SSL_CA_LOCATION` / `_SASL_MECHANISM|USERNAME|PASSWORD`, with bare `KAFKA_*` as a fallback - community PR #52). Zero new third-party dependencies. Full suite: 3,080 passing.

## v3.13.37 (2026-06-18) - Dev-admin editor: Ruby + more syntax highlighting

The dev-admin dashboard's code editor (CodeMirror) gained the grammars it was missing: `.rb` files - plus `.rs`/`.go`/`.java`/`.scss` - now highlight in the file viewer instead of falling through to plain text (the editor bundle had no Ruby/Rust/Go/Java case). Python's file-read endpoint already reported the correct `language` per extension, so this ships the rebuilt editor bundle that can render them. Dev-mode tooling only; no framework runtime change. Full suite: 2,952 passing.

## v3.13.36 (2026-06-18) - Instant WebSocket dev-reload

Dev-reload is now a WebSocket push instead of a poll. On a file change `tina4 serve` POSTs `/__dev/api/reload`; the server re-imports just the changed route module in-process - mtime-tracked, same PID, **no respawn** - then broadcasts `{type, file, mtime}` to every browser on the `/__dev_reload` WebSocket, and the injected toolbar client reloads instantly (CSS changes hot-swap the `<link>` href without a full reload). The `/__dev/api/mtime` poll is now a fallback only, used when the socket is down. `Router.add` replaces a re-registered `(method, path)` in place so the fresh handler wins instead of being shadowed by a stale duplicate. Debug-mode only - production is untouched. Full suite: 2,952 passing.

## v3.13.35 (2026-06-17) - Live MCP endpoint for AI agents

The built-in MCP server is now actually reachable. It was fully built - 50+ dev tools (live DB queries, file I/O sandboxed to the project, route list, project overview, framework docs search) - but never mounted, so no MCP client could connect. `tina4 serve` now exposes it at `/__dev/mcp` (JSON-RPC) + `/__dev/mcp/sse`, gated on debug mode, giving an AI agent (Claude Desktop/Code) live access scoped to the running project. Also fixed the `route_list` dev tool, which referenced a non-existent `Router._routes` (now `Router.get_routes()`) and errored for every caller - caught by new tool-coverage tests. Full suite: 2,943 passing.

## v3.13.34 (2026-06-17) - Demo + onboarding fixes

The example store crashed on boot: `app.py` imported `orm_bind`, which was renamed to `bind_database` in 3.13 (no alias). Switched it, so the demo boots, migrates, seeds, and serves real data again. Corrected stale env-var names in the README and `example/.env` to the names the framework actually reads (`TINA4_SECRET`, `TINA4_LOG_LEVEL`, `TINA4_LOCALE`, `TINA4_SESSION_BACKEND`, `TINA4_SWAGGER_*`) - the demo had been signing JWTs with a blank secret - and unified project creation on the `tina4` CLI. Examples/docs only; framework unchanged.

## v3.13.33 (2026-06-17) - Queues: priority pop + automatic dead-lettering (Warning: behavioural change)

**Behavioural change.** `job.fail()` now **re-enqueues** the job (incrementing `attempts`) until `attempts >= max_retries`, then moves it to the dead-letter store - so a `for job in queue.consume(topic): ... job.fail(e)` loop retries `max_retries` times and dead-letters automatically (no manual `retry_failed()`). Previously `fail()` only marked the job failed. Also: `pop`/`consume` now return the **highest-priority** available job first (ties oldest-first) instead of FIFO; new additive `Queue(..., retry_backoff=0)` delays the auto re-enqueue. Only the file/lite backend changed (brokers delegate retry/dead-lettering). The queue chapter was rewritten to match (the documented retry->dead-letter flow is now real). Full suite: 2,933 passing.

## v3.13.32 (2026-06-17) - Caching: per-query bypass + X-Cache headers (chapter rewritten to match code)

Added a per-query cache bypass - `db.fetch(... , no_cache=True)` (also `fetch_one`/`fetch_all`) skips both the lookup and the store for that one call. The HTTP `ResponseCache` now stamps `X-Cache: HIT|MISS` and `X-Cache-TTL: <seconds>` on cached responses (no `Cache-Control`). The caching chapter was substantially rewritten to match the code: the real `cache_stats()` shapes, all seven backends + file-backend fallback, the three cache layers (request-scoped auto, persistent DB, response), and accurate env/defaults - removing earlier aspirational claims (a fictional stats shape, stale-while-revalidate, a `/__dev` per-key panel, auto `Cache-Control`). Full suite: 2,924 passing.

## v3.13.31 (2026-06-17) - Documentation fixes (no functional change)

Corrected the developer guide: `Response.add_header` is an instance method - the class-level `Response.add_header(...)` shown previously raises `TypeError`, so it's now `response.add_header(...)` (including six middleware examples in Chapter 10). Removed a stale `fieldName` key from the `request.files` upload example (the dict has `filename`, `type`, `content`, `size`). Code is unchanged. Full suite: 2,914 passing.

## v3.13.30 (2026-06-16) - Typed route params now arrive coerced (Warning: behavioural change)

**Behavioural change.** A typed path param now arrives **coerced to its type** instead of as a raw string: `{id:int}` / `{id:integer}` -> `int`, `{price:float}` / `{x:number}` -> `float`. Every other type (`string`, `alpha`, `alnum`, `slug`, `uuid`, `path`) and an untyped `{id}` stay strings; URL matching is unchanged (`{id:int}` still 404s on non-digits). Previously `{id:int}` matched only digits but still handed the handler the string `"42"` - code that did string operations on a typed param must adjust. This brings Python in line with Ruby (which already coerced) and the documented "auto-converted" behaviour, now matched by PHP and Node too. Also fixed a reversed `check_password` argument-order line in the dev guide. Full suite: 2,914 passing.

## v3.13.29 (2026-06-16) - Live API search (`api_search`/`api_class`/`api_method`) now finds what you ask for

The live reflection index behind the `api_*` MCP tools - what AI assistants query for real method signatures instead of guessing - had three gaps, now fixed:

- **Metaprogrammed methods were invisible.** `Frond.add_filter` / `add_global` / `add_test` are defined through a custom class/instance descriptor, and the reflector's `__qualname__` owner check skipped them - they never entered the index. Reflection now walks `obj.__dict__`, unwraps staticmethod/classmethod/property/descriptor wrappers, and strips receiver params, so `api_method("Frond", "add_test")` returns `add_test(name, fn)`.
- **Class-qualified queries weren't steered.** `api_search("Frond.add_test")` returned unrelated `add_*`/`*test*` methods because only the bare name was scored. Ranking now weights the owning class, fqn segments, and an exact `Class.method` match, so the right method ranks first.
- **Lookups only matched the deep fqn.** `api_class`/`api_method` now resolve the documented public import path and a bare class name (`Database`), not just `tina4_python.database.connection.Database`.

The bundled AI skills (developer/maintainer/js) now instruct assistants to query `api_*` before guessing a signature. Full suite: 2,905 passing.

## v3.13.28 (2026-06-16) - Frond: custom `add_test` now honoured by `is`

<div v-pre>

**Python only.** A test registered with `Frond.add_test("positive", fn)` was ignored by `{% if x is positive %}` - the `is` evaluator checked a hardcoded built-in table (`even`, `odd`, `defined`, ...) and never consulted the instance's custom-test registry, so every custom test silently returned false. It now merges the registered tests (reachable via the bound evaluator) over the built-ins, so custom registrations work and can override built-ins - matching PHP, Ruby, and Node. Built-in tests are unchanged. Surfaced by a cross-engine host-API check (`add_filter`/`add_global`/`add_test`/`form_token`) while building the verified cheatsheet. Full suite: 2,901 passing.

</div>

## v3.13.27 (2026-06-16) - Frond template-engine parity fixes

A 50-case cross-engine audit (every Frond tag, filter, and test rendered through all four frameworks with identical templates) surfaced six places where Python's output diverged from the Twig/Jinja standard. All are now fixed to match:

<div v-pre>

- **`{{ x | e }}` / `escape`** no longer double-escapes - the filter returns a `SafeString`, so the auto-escaper leaves it alone (`<b>` -> `&lt;b&gt;`, not `&amp;lt;b&amp;gt;`).
- **`{{ "%.2f" | format(value) }}`** now resolves a *variable* argument to its value (it previously errored). Unquoted filter arguments are treated as variable references; quoted literals stay literal.
- **`{%- ... -%}` whitespace control** now actually trims - a single up-front pass applies every trim marker, including on closing tags (`endif`/`endfor`) and block-body boundaries.
- **`json_encode`** emits compact `[1,2,3]` (no spaces); **`round`** at precision 0 renders the integer `4` (not `4.0`); **`nl2br`** escapes its input, inserts `<br />`, and is marked safe - all matching PHP.

</div>

Behavioural note: these change rendered output for the affected filters - they are correctness fixes toward the documented Twig/Jinja behaviour. Full suite: 2,900 passing.

## v3.13.26 (2026-06-16) - pooling fix: standalone writes auto-commit; explicit transactions stay atomic

**Behavioural default change.** A standalone write - `execute`/`insert`/`update`/`delete` made **outside** an explicit transaction - now **auto-commits on its own connection before returning**. Previously the default was autocommit *off*, which broke connection pooling: a standalone `INSERT` landed uncommitted on one pooled connection, then the next read round-robined to a different connection and saw nothing. Standalone writes are now durable and visible across the pool.

Explicit transactions are unchanged and stay atomic - inside `start_transaction()` ... `commit()`/`rollback()` the per-statement commit is suppressed (the commit branches are gated on `not self._in_transaction`), so a `rollback()` still discards everything. The psycopg2 connection still runs with `connection.autocommit = False`, so the framework owns commit boundaries and the v3.13.15 idle-in-transaction read-rollback still applies.

Set `TINA4_AUTOCOMMIT=false` in `.env` for strict manual-commit mode (every write needs an explicit `commit()`).

Verified live on PostgreSQL: standalone write visible from a separate connection, explicit rollback discards, explicit commit persists, and pooled standalone writes visible across every round-robin connection. Full suite: 2,894 passing.

## v3.13.24 (2026-06-15) - unified cache backends across response, KV, and persistent DB cache

The response/KV cache now supports **seven backends**, selected by `TINA4_CACHE_BACKEND`: `memory` (default), `file`, `redis`, `valkey`, `memcached`, `mongodb`, and `database`. `TINA4_CACHE_URL` carries the connection string for `redis`/`valkey`/`memcached`/`mongodb`, or a SQL URL for the `database` backend (which falls back to `TINA4_DATABASE_URL`). Credentials can be embedded in the URL (`redis://user:pass@host`, `redis://:pass@host`, `mongodb://user:pass@host`) or supplied via `TINA4_CACHE_USERNAME` / `TINA4_CACHE_PASSWORD` (mirroring `TINA4_DATABASE_USERNAME`/`_PASSWORD`); memcached is unauthenticated. The usual `TINA4_CACHE_TTL` (60), `TINA4_CACHE_MAX_ENTRIES` (1000), and `TINA4_CACHE_DIR` (`data/cache`) still apply.

**Graceful fallback:** if a configured backend's driver is missing or the service/credentials are unreachable or wrong, the cache logs a warning and falls back to the **file** backend - a real persistent cache, never a silent no-op.

The **persistent DB query cache** (`TINA4_DB_CACHE=true`) now routes through the same backend set via `TINA4_DB_CACHE_BACKEND` + `TINA4_DB_CACHE_URL`, so multiple instances share one cache with global write-invalidation. `cache_stats()` now reports a `backend` field alongside `mode`.

Full suite: 2,899 passing.

## v3.13.23 (2026-06-15) - request-scoped DB query cache, on by default

A new **request-scoped query cache** protects your database from rapid repeat reads. Within a single request, identical `SELECT`s and ORM reads are deduped automatically - the DB is hit once and subsequent identical reads are served from memory. The cache is **cleared at the start of every request** (so it never serves stale rows across requests) and **flushed on any write** (insert/update/delete/execute). For non-request contexts (scripts, workers) a short safety TTL applies.

It is **on by default** via `TINA4_AUTO_CACHING=true` (off-switch `TINA4_AUTO_CACHING=false`); the in-request TTL is `TINA4_AUTO_CACHING_TTL` (default 5 seconds). The existing `TINA4_DB_CACHE` (default `false`) remains the separate *persistent* cross-request cache (TTL `TINA4_DB_CACHE_TTL`, default 30s) and is not cleared per request. `cache_stats()` now reports a `mode` field: `"request"` (default), `"persistent"`, or `"off"`.

Full suite: 2,866 passing.

## v3.13.22 (2026-06-15) - session default TTL standardised to 1 hour

The default session lifetime now matches across all four frameworks: **3600 seconds (1 hour)**. Python previously defaulted to 1800s (30 min). The session cookie `Max-Age` and the file-handler garbage-collection window both follow `TINA4_SESSION_TTL` (default now 3600) - override it in your `.env`. PHP and Node already used 3600 and are unchanged.

## v3.13.21 (2026-06-15) - security: never sign JWTs with a guessable default secret

**Security fix.** When `TINA4_SECRET` was unset, Tina4 silently signed JWTs **and** CSRF form tokens with a hardcoded built-in default secret - so anyone who knew that default could forge valid tokens, and the developer got no warning. It affected `Auth`, the Frond `form_token()` filter, and the CSRF middleware (four copies of the same fallback).

Token signing now reads `TINA4_SECRET` and, when it is unset, **warns loudly and uses a blank secret** - matching what the PHP and Node frameworks already did. There is no longer a guessable built-in secret. **Always set `TINA4_SECRET` in production.**

Also corrected stale docs: the JWT secret env var is **`TINA4_SECRET`** (some docs still said `SECRET`), and `$response->template()` references are fixed to `response.render()`.

Full suite: 2,857 passing.

## v3.13.19 (2026-06-15) - return domain objects, construct from JSON, and one database binder

Three ergonomic improvements surfaced by the live side-by-side review of the book's own examples across all four frameworks.

### `response(...)` serializes domain objects

Return an ORM model, a list of models, or a query result straight from a route - Tina4 serializes it to JSON. No more hand-rolled `to_dict()` / `to_json()`:

```python
@get("/api/users")
async def users(request, response):
    return response(User.all())        # list of models -> JSON array
```

A single model becomes a JSON object; a list of models or a `DatabaseResult` becomes a JSON array. Plain dicts, lists and strings behave exactly as before - this is purely additive.

### Construct a model from a JSON object string

The model constructor now accepts a JSON object string, alongside a dict or keyword args:

```python
User('{"name": "Alice", "email": "alice@example.com"}')   # parsed into one record
User({"name": "Alice"})                                    # still works
User(name="Alice")                                         # still works
```

Passing a **list/array** to a single-record constructor now raises a clear `TypeError` instead of a cryptic `'list' object has no attribute 'items'`. To build many records, map over the list.

### Warning: Breaking - one database binder: `bind_database`

The ORM-to-database binder is now **`bind_database`** across all four frameworks (was `orm_bind` in Python). The default is unchanged - models still auto-bind to `TINA4_DATABASE_URL`, so apps that rely on the `.env` default need **no change at all**.

```python
# Most apps: nothing to do - the .env default is auto-bound.

# Override the default explicitly:
bind_database(Database("sqlite:///app.db"))

# Register a NAMED connection and point a model at it:
bind_database(Database("postgres://.../analytics", "u", "p"), name="analytics")

class Visit(ORM):
    _db = "analytics"        # this model uses the analytics connection
```

A model can live on a different database from the default - `bind_database(db, name="...")` registers it and `_db = "..."` selects it. A missing named connection raises a clear error.

**Migration:** rename `orm_bind(...)` -> `bind_database(...)`. That is the only change; the `name=` argument, per-model `_db`, and `.env` resolution are new or unchanged.

Full suite: 2,852 passing. Shipped with parity across all four frameworks.

## v3.13.16 (2026-06-15) - `create_table()` works on PostgreSQL + `DatabaseResult` index access

Found by the live documentation-verification pass - running the book's own samples against a real PostgreSQL database. The documented code-first schema path, `ORM.create_table()`, was silently broken on PostgreSQL: it emitted SQLite-only DDL, PG rejected it, the error was swallowed, and the method returned `True` while creating **no table**.

### `create_table()` is now engine-aware

- **`DateTimeField` -> `TIMESTAMP`** on PostgreSQL (and Firebird) - they have no `DATETIME` type (`type "datetime" does not exist`); `DATETIME` stays on SQLite/MySQL/MSSQL.
- **`BooleanField` -> native `BOOLEAN`** on PostgreSQL/MySQL, `BIT` on MSSQL, `INTEGER` on SQLite/Firebird. The engine check previously compared against `"postgres"` but `get_database_type()` returns `"postgresql"`, so bool columns silently got `INTEGER` on PG - fixed. Boolean column `DEFAULT`s are engine-aware too (`TRUE`/`FALSE` vs `1`/`0`).
- **A failed `CREATE` now returns `False` (and logs)** instead of masquerading as success.
- The PostgreSQL adapter no longer rewrites `TRUE`/`FALSE` -> `1`/`0` (`boolean_to_int`) - PG has a native boolean, and that rewrite had broken `DEFAULT FALSE` and `WHERE active = TRUE` on `BOOLEAN` columns.

### `DatabaseResult` is subscriptable

`result[0]` (documented in chapter 5, "Index Access") raised `TypeError: 'DatabaseResult' object is not subscriptable`. Added `__getitem__` - index and slice access now delegate to `.records`. The bundled guide's wrong "no `len()` support" note is corrected too.

Verified against PostgreSQL 16: a model with `id` (auto-increment) + `StringField` + `BooleanField` + `DateTimeField` creates, inserts, and round-trips natively (real `bool`, `TIMESTAMP`). New PG-backed test suite (skip-if-no-PG) + always-run subscript suite. Full suite: 2,840 passing. Shipped with parity across all four frameworks.

## v3.13.15 (2026-06-15) - Python only: PostgreSQL idle-in-transaction leak (#51)

**Python only.** psycopg2 follows the DB-API contract - a connection starts with `autocommit = False`, so even a bare `SELECT` opens a transaction. Tina4's `fetch()` / `fetch_one()` never closed it, so every read left the connection `idle in transaction` for its lifetime, pinning a pool slot and any locks it touched. PHP (`pg_query`), Ruby (`pg`), and Node (`node-postgres`) run on libpq autocommit - each statement is its own transaction - so the leak can't happen there. They stay at v3.13.14.

### The slow-motion outage

The migration runner's batch lookup runs at boot:

```python
row = db.fetch_one("SELECT MAX(batch) as max_batch FROM tina4_migration")
```

That read opened a transaction and left it open. Each short-lived pod/process leaked one `idle in transaction` connection holding locks on `tina4_migration`. Over enough restarts the pool filled - `FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute` - and then module autodiscovery failed mid-boot, so `/health-check` still passed (pod marked Ready) while every real route 404'd. A silent "ready but broken" state; #51 reported sessions sitting idle for 2+ days.

### The fix

After a successful read **outside** an explicit transaction, the PostgreSQL adapter now rolls back the implicit transaction - a `SELECT` has nothing to persist, so a rollback is the clean close that returns the connection to plain `idle`. Inside `start_transaction()` the caller owns the transaction, so it's left alone. `execute()` (writes) is deliberately untouched: with autocommit off a write must still be committed explicitly, and auto-closing it would silently drop data.

This is distinct from the v3.13.8 fix, which healed *aborted* transactions - a clean idle read-transaction never hit that path.

### Tests

- Python: 2,836 passed (+7 - `_end_read_txn` unit, `fetch`/`fetch_one` wiring, in-transaction deferral). No live PostgreSQL required: a fake connection records the rollback, and psycopg2 is stubbed when the optional driver is absent (so the guard runs in CI).

## v3.13.14 (2026-06-13) - Logs reach stdout in containers + per-request logging + schema-qualified tables (#48)

**Cross-framework release (all four).** Deployed Docker containers were getting no application logs. The cause was the same architectural decision in every framework: in production/container mode Tina4 either **suppressed stdout** or wrote logs **only to a file inside the container** - but `docker logs` (and Kubernetes) read PID 1's stdout, so operators saw nothing. A follow-on report - "logs stop after `Development server: asyncio`" - surfaced a second gap: the dev server logged its startup banner but **never logged requests**, so it looked dead under traffic.

This is a 12-factor correction: a container's stdout *is* the log sink.

### Per-request logging - on by default in dev

Every request now logs one line through the Tina4 `Log` (-> stdout), on by default in development and opt-in for production via `TINA4_LOG_REQUESTS`:

```
2026-06-12T10:15:03.221Z [INFO   ] GET /api/users -> 200 (12.3ms)
```

- Format is identical across all four frameworks: `METHOD /path -> STATUS (Nms)`.
- **Default**: on when `TINA4_DEBUG` is truthy (dev), off in production - so prod doesn't pay the per-request cost unless you opt in.
- `TINA4_LOG_REQUESTS=true` forces it on (production debugging); `=false` forces it off.
- Routed through `Log`, so it's coloured human-readable in dev and structured JSON in production, like every other line.

Two bugs fixed here: Python's `RequestLoggerMiddleware` emitted via an **unconfigured stdlib `logging` logger** (silently dropped - never reached stdout), and the dev server only fed request data to the `/__dev` dashboard inspector, never to a log. Both now go through `Log`.

### What changed (stdout)

1. **stdout is no longer suppressed in production.** Logs are written to stdout regardless of `TINA4_ENV`/`TINA4_DEBUG`. Production emits clean JSON (no ANSI colour) so aggregators can parse it; dev keeps the human-readable coloured format. `TINA4_LOG_OUTPUT=file` still opts out of stdout entirely.
2. **stdout is flushed per line.** `print(..., flush=True)` - logs appear immediately on a non-TTY pipe (every container) instead of sitting in Python's block buffer until the process exits (or vanishing on an abrupt stop).
3. **Default log level is now `INFO`** (was `ERROR`). An app that logged at info/debug previously looked silent in production. INFO surfaces request/startup/warning/error without debug noise. Override with `TINA4_LOG_LEVEL`.

```python
# In a container (TINA4_ENV=production), with the default config:
Log.info("worker started")
# pre-v3.13.14: written only to logs/tina4.log inside the container -> docker logs empty
# v3.13.14:    {"timestamp":"...","level":"INFO","message":"worker started"}  -> on stdout
```

### Why it spanned all four

The bug was the *same* decision in each framework, so the fix is too:

| Framework | Pre-v3.13.14 cause | Fix |
|---|---|---|
| Python | `not _is_production` gate suppressed stdout; default ERROR | stdout always on (flushed); default INFO |
| PHP | `$stdout = $development` (file-only in prod); no `TINA4_LOG_LEVEL` read | stdout default on + `fflush`; reads `TINA4_LOG_LEVEL`; default INFO |
| Ruby | stdout written but **never flushed** (block-buffered on non-TTY); default ALL | `$stdout.sync = true`; default INFO; accepts plain + bracket level names |
| Node | `!isProduction()` gate suppressed console; default DEBUG | console always on; production emits JSON; default INFO |

The Rust `tina4` CLI was already correct - it inherits child stdio, so child logs flow to the container.

### Request logging parity

| Framework | Pre-v3.13.14 | Fix |
|---|---|---|
| Python | no request log; `RequestLoggerMiddleware` used a dead stdlib logger | log in dispatch via `Log`; middleware routed through `Log` |
| PHP | `RequestLogger` not default-on, line lacked status | log in `Router::dispatch` via `Log`; status added to the line |
| Ruby | dev inspector only; `RequestLoggerMiddleware` not wired; `[RequestLogger]` prefix | log in `rack_app` via `Log`; prefix dropped for parity |
| Node | `requestLogger` always-on via bare `console.log`, status-first format | gated (dev-default + env), routed through `Log`, standard format |

### Schema-qualified tables (#48) + a PostgreSQL `fetch()` regression

Issue #48 - *"Database Table Does Not Exist"* on PostgreSQL. A model whose table lives in a non-default schema (`gift_cards.gift_card`, MSSQL `dbo.widget`, MySQL `otherdb.table`, SQLite ATTACH `extra.widget`) was invisible to the framework's introspection. `table_exists`, `get_tables`, and `get_columns` hardcoded the default namespace (`public`) and matched the whole dotted string as one flat name - so plain reads worked, but `create_table`, migrations, and auto-CRUD were blind to the table and reported it missing.

All introspection is now schema-aware on every affected engine:

- **PostgreSQL** - `table_exists` uses `to_regclass()` (honours schema + `search_path`); `get_columns` filters by `table_schema`; `get_tables` lists every non-system schema and returns non-`public` tables schema-qualified.
- **MySQL** - schema = database; a qualified name checks that catalog, a bare name defaults to `DATABASE()`.
- **MSSQL** - honours `dbo.table`; a bare name matches in any schema.
- **SQLite** - honours an ATTACH alias (`extra.widget`) for both `table_exists` and `get_columns`.
- **Firebird** - N/A (no schemas).

Verified against a live PostgreSQL 16 container: `table_exists('gift_cards.gift_card') -> True`, `get_tables -> ['gift_cards.gift_card', 'gift_cards.transaction']`, `get_columns -> 12 columns` - identical results across all four frameworks.

> **PHP also fixed a v3.13.12 regression found while cross-checking #48.** `PostgresAdapter` referenced `stripTrailingSemicolons()` (added in v3.13.12) and the new `splitSchema()` but never mixed in `SqlNormalizerTrait` - so **every PostgreSQL `fetch()` / `fetchOne()` / `getColumns()` fatalled** with *"Call to undefined method"*. It shipped silently because the PHP PostgreSQL test suite skips without a live server. Fixed with a one-line trait mix-in and pinned by server-free reflection guards that assert all five SQL adapters expose the normalizer helpers.

### Tests

- Python: 2,829 passed (+18 new - stdout-in-prod, JSON shape, level filter, file opt-out; request-log gate + middleware; #48 schema split + SQLite ATTACH introspection)
- PHP: 2,394 passed (+63 new - stdout/level/file gating; request-log format + gate; #119 cli-server crash fix + LegacyEnvGuard suite now CI-gated; #48 schema-qualified + PG trait regression guards)
- Ruby: 2,999 passed (+23 new - level resolution + `$stdout.sync`; request-log gate + dispatch; #48 schema split + SQLite ATTACH introspection)
- Node: 3,628 passed (+16 net - production JSON stdout; request-log gating + format; #48 schema split + SQLite ATTACH introspection)

**11,850 tests across the family, zero regressions.**

> PHP also fixed #119 in this release - `App::checkLegacyEnvVars()` crashed with `Undefined constant Tina4\STDERR` under the built-in `cli-server` (bare `STDERR` is only auto-defined for the `cli` SAPI). Now uses the `php://stderr` stream. PHP-specific; the other three don't reference that constant.

---

## v3.13.12 (2026-06-11) - SQL safety + implicit ORM binding + `fetch_all` correctness

Three high-impact fixes that close out long-standing footguns. All three ship with full parity across all four frameworks.

### `fetch_all` actually fetches ALL rows now (no silent 100-row truncation)

Pre-v3.13.12 the convenience method defaulted to `limit=100` and silently truncated. The name says `fetch_all` - it should fetch them all:

```python
# 150 rows in the table
db.fetch_all("SELECT * FROM rows")
# pre-v3.13.12: returns 100 rows, silently drops the other 50
# v3.13.12:    returns all 150 rows
```

The new default is `limit=0`, which the adapter interprets as "no pagination injection" - your SQL runs verbatim. To opt back into a cap, pass `limit=N` explicitly:

```python
db.fetch_all("SELECT * FROM events", limit=500)   # capped
db.fetch_all("SELECT * FROM users")               # all rows
```

`db.fetch()` (the paginated sibling that returns a `DatabaseResult` with count metadata) keeps its 100-row default - pagination is its job. Only the `fetch_all` convenience changed.

**Breaking change**: callers who relied on the silent 100-row cap now get every row. For very large tables, switch to `fetch()` (which paginates with metadata) or pass an explicit `limit`. Per the v3 parity rule, breaking changes are OK when correctness is the win.

### Trailing `;` is now stripped from user SQL in `fetch()` / `fetch_one()`

The framework appends `LIMIT n OFFSET m` to the user-supplied query (and wraps it in `SELECT COUNT(*) FROM (...) AS subq` for the count probe). When the user's query already ended with a `;`, both rewrites broke:

```python
db.fetch("SELECT * FROM users;")
# pre-v3.13.12: syntax error near "LIMIT" - the appended LIMIT followed a ;
# v3.13.12:    works - trailing ; is stripped before LIMIT is appended
```

The strip is conservative: only trailing whitespace + semicolons are removed (any number of them, including `;;`), nothing inside the statement is touched. Parameters and quoting are unchanged - the existing parameter-binding defense against injection still does all the heavy lifting.

Applied at the top of `fetch()` and `fetch_one()` on all five adapters: PostgreSQL, MySQL, SQLite, MSSQL, Firebird.

### Ruby ORM now auto-discovers `TINA4_DATABASE_URL` like the other three

When `TINA4_DATABASE_URL` was set in `.env` but `Tina4.bind!` had never been called, Ruby ORM operations returned `nil` from the model's `db` accessor - every save / find / where silently no-op'd. Python, PHP, and Node all already discovered the env var on first use; Ruby had the helper (`auto_discover_db`) defined but never called.

```ruby
# .env has TINA4_DATABASE_URL=sqlite://./app.db, no explicit Tina4.bind! anywhere
User.find(1)
# pre-v3.13.12: nil  (db accessor returned nil, query never ran)
# v3.13.12:     <User id: 1, ...>  (auto-discovered on first model access)
```

Explicit `Tina4.bind!(db)` still takes precedence - use it to bind a second database or override the env-driven default. The behaviour now matches Python's `database_url_auto_discover()`, PHP's adapter auto-init, and Node's `initDatabase()` env fallback.

### Cross-framework parity

| Fix | Python | PHP | Ruby | Node |
|---|---|---|---|---|
| `fetch_all` returns ALL rows by default | [x] `limit=0` default | [x] `$limit = 0` default | [x] `limit: nil` default | [x] already correct (`limit?` undefined) |
| Strip trailing `;` from fetch SQL | [x] shared helper on `DatabaseAdapter` | [x] `SqlNormalizerTrait` on 5 adapters | [x] `Tina4::Database.strip_trailing_semicolons` | [x] exported `stripTrailingSemicolons` |
| Implicit ORM binding from env | [x] already worked | [x] already worked | [x] **fixed** (wired `auto_discover_db`) | [x] already worked |

### Tests

- Python: 2,811 passed (+24 new)
- PHP: 2,316 passed (+13 new)
- Ruby: 2,980 passed (+18 new)
- Node: 3,612 passed across 95 files (+16 new)

**11,719 tests across the family, +71 new for v3.13.12, zero regressions.**

---

## v3.13.11 (2026-06-11) - ORM correctness pass

Five fixes bundled into one release. Two are Andre's own ORM bugs (#50), two close out follow-on gaps from Michael's error-visibility report (#49), and one fixes a PostgreSQL-level mismatch that BooleanField columns were creating.

### #50.1 - Callable field defaults are now resolved per-instance

```python
class GiftCard(ORM):
    created_at = DateTimeField(default=lambda: datetime.now())
```

Pre-v3.13.11 this stored the lambda object verbatim and crashed on save:

```
psycopg2.ProgrammingError: can't adapt type 'function'
```

Now the framework invokes the callable **per instance** at construction time, so every row gets a fresh value. Types are excluded (`default=int` is preserved verbatim - that's almost never intended as "call `int()`").

### #50.2 - `save()` correctly INSERTs natural (non-auto-increment) PKs

For models with a user-supplied PK (e.g. `gift_card_number = "GC-100"` set before the first save), pre-v3.13.11 `save()` always chose UPDATE - matched zero rows - and silently returned success without inserting anything. The framework now checks `cls.exists(pk_value)` for non-auto-increment PKs:

```python
gc = GiftCard()
gc.gift_card_number = "GC-100"
gc.save()                          # -> INSERT (pre-v3.13.11 was a silent UPDATE no-op)
GiftCard.find_by_id("GC-100")      # -> returns the row
```

Auto-increment behaviour is unchanged: `PK is None -> INSERT`, `PK set -> UPDATE`. Saving an existing natural-key row still UPDATEs (and doesn't duplicate).

### #49.1 - Original cause logged when failure is inside an explicit transaction

When a query fails inside `db.start_transaction()`, the auto-rollback correctly defers to the user. But the visibility half no longer goes with it - the framework now emits a Log.warning marker so operators can spot the upstream cause that's about to be buried by the cascade. The `fetch()` COUNT probe also now logs original-cause failures via `Log.warning` before swallowing.

### #49.2 - `Database.fetch()` populates `last_error` (mirror of `execute()`)

```python
try:
    db.fetch("SELECT * FROM does_not_exist")
except Exception:
    pass

db.get_error()   # pre-v3.13.11: None  (adapter had the cause, wrapper never read it)
                 # v3.13.11:     "relation \"does_not_exist\" does not exist"
```

### BooleanField - engine-aware DDL on PG / MySQL / MSSQL

Pre-v3.13.11 `BooleanField` mapped to `INTEGER` on every engine. That caused PostgreSQL to throw `operator does not exist: boolean = integer` when Python `bool` values bound via psycopg2 met the `INTEGER` column - because psycopg2 adapts `True`/`False` to PG `boolean`, not to integer.

v3.13.11 makes `BooleanField -> create_table()` engine-aware:

| Engine | DDL type |
|---|---|
| PostgreSQL | `BOOLEAN` |
| MySQL | `BOOLEAN` (alias for `TINYINT(1)`) |
| MSSQL | `BIT` |
| SQLite | `INTEGER` (no native bool) |
| Firebird | `INTEGER` (driver round-trip uneven for native BOOLEAN) |

**Breaking change**: callers writing literal `= 0` / `= 1` against tables created by `create_table()` on PG / MySQL / MSSQL will need to update to `= false` / `= true` (or the engine's native bool literal). Tables created via migration with explicit DDL aren't affected - the framework only sets the type when it creates the table itself.

### Cross-framework parity

| Fix | Python | PHP | Ruby | Node |
|---|---|---|---|---|
| #50.1 callable defaults | [x] fixed | N/A (PHP property defaults are constants) | [x] fixed (Procs) | N/A (no auto-default at construction) |
| #50.2 natural-key INSERT | [x] fixed | [x] already correct (`recordExists`) | [x] already correct (`@persisted` flag) | [x] fixed |
| #49.1 + #49.2 PG visibility | [x] fixed (Python-only - libpq autocommit means cascade never happens on PHP/Ruby/Node) |  |  |  |
| BooleanField DDL | [x] fixed | N/A (PHP createTable is migration-driven) | [x] fixed | [x] already engine-aware |

### Tests

- Python: 2,807 passed, 31 skipped (+34 new)
- PHP: 2,888 passed (no changes)
- Ruby: 2,962 passed, 7 pending (+10 new)
- Node: 3,596 passed across 94 files (+10 new)

**12,253 tests across the family, +54 new for v3.13.11, zero regressions.**

---

## v3.13.10 (2026-06-11) - Python only

Three Python-only housekeeping items.

### 1. Google Antigravity removed from `AI_TOOLS` - it reads `AGENTS.md`, not `.antigravity/context.md`

Per Google's official Antigravity docs ([rules-workflows](https://antigravity.google/docs/rules-workflows)), as of Antigravity **v1.20.3 (March 2026)** the IDE reads `AGENTS.md` from the repo root - the same cross-tool standard Codex pioneered, Cursor adopted, and Claude Code reads as a fallback. Our pre-v3.13.10 installer wrote to `.antigravity/context.md`, **a path nothing actually reads.** Antigravity has been silently producing dead files in users' projects since the entry was added in commit `04fba18`.

The fix in v3.13.10 is simply to **remove the antigravity entry from `AI_TOOLS`**. The existing `codex` entry (`AGENTS.md`) already writes the Tina4 skill block to the file Antigravity actually consumes - one file, four tools (Codex + Cursor + Claude Code + Antigravity all read it).

If you want Antigravity-specific tuning beyond the shared `AGENTS.md`, write it to `.agents/rules/tina4.md` by hand - that's the documented per-workspace rules folder.

### 2. `uv.lock` drift caught

The lockfile had quietly fallen out of sync - it tracked `tina4-python` at `3.13.8` while `pyproject.toml` was at `3.13.9`. The mistake was on my side: I didn't re-stage `uv.lock` on the v3.13.7 / v3.13.8 / v3.13.9 commits, and `uv` only regenerates it lazily. **Cosmetic only** (the PyPI artefact was always built from `pyproject.toml`, so the published packages were correct), but the lockfile would have drifted further every release. Now refreshed to `3.13.10` and committed.

### 3. `.gitignore` for runtime broken-route artefacts

`Tina4::BrokenTracker` writes import-time and route-time failure dumps to `data/.broken/` and `data/broken/` at the project root. The pre-v3.13.10 `.gitignore` only covered `/broken` (older convention) and the `example/store/` paths. The newer `data/`-rooted paths weren't ignored, so test runs that intentionally threw (the `tina4.request.error` tests in v3.13.7) were leaving untracked `.broken` files lying around in the framework's own repo.

Now ignored:
```gitignore
/data/broken/
/data/.broken/
```

### Why Python-only

All three items are Python-specific. PHP/Ruby/Node never had the Antigravity entry, don't use uv, and have their own gitignore conventions covered separately.

### Tests

- `tests/test_ai.py::TestAITools::test_antigravity_is_handled_via_codex_entry` - new test that asserts (a) Antigravity is NOT a separate `AI_TOOLS` entry, (b) the Codex entry's `context_file` remains `AGENTS.md`. Keeps the design intent visible so nobody reintroduces a dedicated Antigravity entry without checking the docs.
- Existing `test_tools_count_matches_known_set` updated from 8 -> 7.

2,773 passed, 47 skipped - no regressions.

---

## v3.13.9 (2026-06-10)

Non-destructive AI installer across all four frameworks.

### The bug

Pre-v3.13.9 the installer wrote a full developer guide to `CLAUDE.md` (and the equivalent context files for Cursor / Copilot / Windsurf / Aider / Cline / Codex / Antigravity) on every run, clobbering whatever the user had put there. If a user kept project-specific notes in `CLAUDE.md` - branch naming, deploy URLs, "don't touch this", reminders about a flaky service - re-running `install_context()` wiped all of that.

### The fix

The installer now uses a **marker-bracketed skill block**:

```markdown
<!-- tina4-skills:start -->
## Tina4 Skills

When working on this Tina4 project, these skills give the assistant project-aware behaviour:

- **tina4-developer** - Read `.claude/skills/tina4-developer/SKILL.md` before building features.
- **tina4-js** - Read `.claude/skills/tina4-js/SKILL.md` for frontend work.
- **tina4-maintainer** - Read `.claude/skills/tina4-maintainer/SKILL.md` for framework-level changes.

See https://tina4.com for full docs.
<!-- tina4-skills:end -->
```

Four behaviours:

1. **Fresh install** - file doesn't exist -> write the framework guide plus the skill block.
2. **Marker refresh** - file exists with our markers -> replace just the bracketed block. **Idempotent**: re-running the installer keeps the skill references current as new skills are added.
3. **One-time migration** - file starts with the pre-v3.13.9 framework header (`# Tina4 Python - Developer Guidelines`, `# Tina4 PHP`, `# Tina4 Ruby`, `# CLAUDE.md - AI Developer Guide for tina4-nodejs`) -> replace the old dump with the new framework guide + skill block.
4. **Preserve user content** - file exists with the user's own content (no markers, no old header) -> append the skill block to the end. Everything else is preserved verbatim.

Markdown files (`CLAUDE.md`, `.github/copilot-instructions.md`, `CONVENTIONS.md`, `AGENTS.md`, `.antigravity/context.md`) get HTML-comment markers (`<!-- ... -->`). Rule files (`.cursorules`, `.windsurfrules`, `.clinerules`) get `#`-prefixed markers so rule loaders treat them as comments.

The actual skill content lives in `.claude/skills/tina4-*/SKILL.md` - those are framework-owned and still get cleanly overwritten so re-runs upgrade the skill content. `CLAUDE.md` itself becomes a thin pointer, not a re-rendered guide.

### Cross-framework parity

Same algorithm, same marker syntax, same four branches in Python, PHP, Ruby, and Node. Same canonical action verbs in the log output (`Installed` / `Refreshed skill block in` / `Migrated (replaced old framework dump in)` / `Appended skill block to`).

### Tests

99 new tests across the family covering all four branches plus marker detection, block replacement, idempotency, old-header detection, encoding edge cases, and rule-file vs markdown-file behaviour.

- Python: 2,772 passed, 47 skipped (24 new)
- PHP: 2,888 passed (11 new - verified via reflection so private helpers stay private)
- Ruby: 2,952 passed, 7 pending (18 new)
- Node: 3,586 passed across 93 files (46 assertions new)

### What you'll see when you re-install

Existing users running the installer for the first time after upgrading will hit branch 3 - they'll see this in the output:

```
[OK] Migrated (replaced old framework dump in) CLAUDE.md
```

On any subsequent run, branch 2 kicks in:

```
[OK] Refreshed skill block in CLAUDE.md
```

Users who curated their own `CLAUDE.md` and never ran the old installer will see branch 4:

```
[OK] Appended skill block to CLAUDE.md
```

---

## v3.13.8 (2026-06-10) - Python only

Follow-on for issue [#46](https://github.com/tina4stack/tina4-python/issues/46). Schalk on the 24rent team upgraded to v3.13.7 and still hit the cascade message on the FIRST query of a function - meaning the PostgreSQL connection had been poisoned **before** the wrapper saw any failure.

### The gap in v3.13.6 / v3.13.7

v3.13.6 added auto-rollback **inside** `_on_query_error` - that clears the abort *on* a failure the framework's wrapper catches. But the connection can still arrive poisoned from sources the wrapper never observed:

- A boot-time query that failed before request handling started (migration probe, ORM `information_schema` lookup, etc.)
- A failure inside an explicit transaction where the user owned the rollback but never issued one
- A direct `cursor.execute` call in another adapter method (the `SELECT lastval()` SAVEPOINT probe in `execute`) that managed to leave the txn dirty

In all three cases, the *next* `db.fetch` / `db.execute` - even one routed through the wrapper - hits `InFailedSqlTransaction` immediately, and the cascade message buries whatever the original cause was. Exactly what Schalk reported:

```
[ERROR] PostgreSQL query failed: InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
{"sql": "SELECT * FROM gift_cards.gift_card WHERE created_by_email = %s AND is_deleted = 0 LIMIT %s OFFSET %s"}
```

### The fix: pre-flight heal

`_exec_with_handling` and `fetch` now call `_heal_aborted_txn()` before executing. That checks the psycopg2 connection's `transaction_status` against `TRANSACTION_STATUS_INERROR` and rolls back if poisoned:

```python
def _heal_aborted_txn(self):
    if self._in_transaction or self._conn is None:
        return
    import psycopg2.extensions as _ext
    if self._conn.info.transaction_status != _ext.TRANSACTION_STATUS_INERROR:
        return
    self._conn.rollback()
    Log.warning(
        "PostgreSQL connection arrived in aborted-transaction state - "
        "issued pre-flight ROLLBACK so the next query starts clean. "
        "Look back in the log for the original PostgreSQL query failed entry."
    )
```

- **Only fires outside an explicit transaction** - same rule as the failure-time auto-rollback. Callers running SAVEPOINT/retry stay in charge.
- **Logs a warning when it triggers** so the operator can correlate against the upstream failure.
- **Defensive**: even if a code path bypasses the wrapper entirely, the next path that does *use* the wrapper heals the connection on the way in.

### Cross-framework

Python only. PHP `pg_query`, Ruby `pg`, and Node `node-postgres` use libpq autocommit by default - each statement is its own transaction, so the cascade never happens there.

### Tests

3 new tests in `tests/test_postgres_error_visibility.py::TestPoisonedConnectionIsHealed`:
- `test_fetch_heals_poisoned_connection` - manually poison the connection with a raw `cursor.execute`, then verify `db.fetch` succeeds
- `test_execute_heals_poisoned_connection` - same for `db.execute`
- `test_explicit_transaction_skips_heal` - confirms the heal defers when the user owns the txn

2,764 passing, 31 skipped (skipped tests require PG container; verified against `postgres:16-alpine` on `localhost:55432`).

---

## v3.13.7 (2026-06-10)

Two changes from an external app-platform team (24rent, PLATFORM-2159) - one observability hook, one production-safety fix. Both ship across **all four frameworks** with identical event payload shape.

### NEW: `tina4.request.error` event

When the router catches a thrown exception, it now emits `tina4.request.error` **before** rendering the 500 page. Listeners receive `{exception, request}` and can ship the failure to CloudWatch / Sentry / Slack - even though the framework caught the throwable.

```python
from tina4_python.core.events import on
from tina4_python.debug import Log

@on("tina4.request.error")
def report_to_observability(payload):
    exc = payload["exception"]
    req = payload["request"]
    Log.error(f"Route error: {type(exc).__name__}: {exc}", path=req.path)
    # ...or POST to your centralised logging pipeline
```

- **Fires for caught route exceptions** (and warnings escalated to exceptions). Does NOT fire for 404s - those aren't server errors.
- **Listener errors are swallowed + logged via `Log.warning`** so a broken listener can never break the 500 render.
- **Listeners fire in priority order** (higher priority first, matching the existing `@on(event, priority=N)` contract).
- **Same payload shape in every framework** - only the calling syntax differs:

```php
// PHP
Events::on('tina4.request.error', function ($payload) {
    Log::error('Route error: ' . $payload['exception']->getMessage());
});
```

```ruby
# Ruby
Tina4::Events.on("tina4.request.error") do |payload|
  Tina4::Log.error("Route error: #{payload[:exception].message}")
end
```

```typescript
// Node.js
import { Events, Log } from "@tina4/core";
Events.on("tina4.request.error", (payload) => {
  Log.error(`Route error: ${(payload as any).exception.message}`);
});
```

### FIX: Stack trace removed from production 500 body (CWE-209)

Before v3.13.7, an unhandled route exception would render the **full stack trace** into the HTTP 500 response body - file paths, function chain, the exception message - **regardless of `TINA4_DEBUG`**. That's [CWE-209 / OWASP A05](https://cwe.mitre.org/data/definitions/209.html): information disclosure.

<div v-pre>

The framework's own `500.twig` now guards the trace block with `{% if error_message %}`. When `TINA4_DEBUG=false`, callers pass an empty `error_message` and the trace block doesn't render. The trace stays in `Log.error` (server-side) and reaches observability via the new event.

</div>

When `TINA4_DEBUG=true`, the rich `ErrorOverlay` page is unchanged.

### Tests

Each framework added 6-14 regression tests covering: event payload shape, dev/prod symmetry, listener priority ordering, listener-error safety, and CWE-209 (no trace markers in the prod body).

- Python: 2,748 passed, 44 skipped
- PHP: 2,877 passed
- Ruby: 2,934 passed, 7 pending (PG container)
- Node: 3,540 passed across 92 files

### Background

Reported by DevProx on the 24rent platform - they centralise observability by scraping structured JSON lines from stderr -> CloudWatch -> a Slack notifier. Route-level exceptions weren't surfacing because the framework caught them silently. The event hook fixes that without forcing any team's logging convention; the trace-leak fix is independently a security concern.

---

## v3.13.6 (2026-06-09)

Two small reliability fixes - both tracked across all four frameworks.

### PostgreSQL transaction errors no longer cascade (#46)

A failed PostgreSQL query outside an explicit transaction used to leave the connection in an aborted state. Every subsequent query then failed with `current transaction is aborted, commands ignored until end of transaction block`, masking the original cause and making the bug effectively invisible to operators.

The fix wraps every PostgreSQL `cursor.execute` in error-aware machinery:

```python
# Bad query
try:
    db.execute("SELECT * FROM table_that_does_not_exist")
except Exception:
    pass

# Before v3.13.6: this raised InFailedSqlTransaction
# v3.13.6 onward: succeeds - the framework auto-rolled back
result = db.fetch("SELECT 1 AS one")
assert result.records[0]["one"] == 1

# The original error is still visible:
db.last_error  # -> 'relation "table_that_does_not_exist" does not exist'
```

The framework now:
1. Logs the original failure via `Log.error` with the SQL and params.
2. Stores the message on `db.last_error` so observability tools can read it.
3. Auto-rollbacks **only** when the caller is not inside an explicit transaction - explicit transactions are left to the user (so SAVEPOINT / retry patterns still work).

Cross-framework note: this cascade behaviour is psycopg2-specific (DB-API 2.0 mandates an implicit transaction on first statement). PHP `pg_query`, Ruby `pg` gem, and Node `node-postgres` all run in libpq autocommit by default - no cascade, no fix needed.

### Better driver install hints (#47)

Missing-driver `ImportError` messages now suggest a `uv add` command alongside `pip install`:

```
psycopg2 is required for PostgreSQL connections. Install one of:
    uv add tina4-python[postgres]   # extra for projects using uv
    pip install psycopg2-binary    # bare driver
    uv add tina4-python[all-db]    # all five database drivers
```

Applies to the PostgreSQL, MySQL, MSSQL, Firebird, ODBC, and MongoDB drivers, plus the MongoDB queue backend.

### Tests

2,741 passing, 44 skipped (Postgres / MySQL / MongoDB containers).

---

## v3.13.5 (2026-06-05)

Frond static-facade parity across PHP, Ruby, Node.js. Closes the last documented v3 parity gap (tina4-python task #32). Python's `Frond.add_filter` / `add_global` / `add_test` have worked as classmethods since v3.13.0 - now PHP / Ruby / Node match.

### What changes

Filters, globals, and tests registered at app-startup persist across `new Frond()` instances. Every framework now supports the same pattern:

```php
// PHP
\Tina4\Frond::addFilter("money", fn($v) => number_format((float)$v, 2));
\Tina4\Frond::addGlobal("APP_NAME", "My App");
\Tina4\Frond::addTest("positive", fn($v) => $v > 0);
```

```ruby
# Ruby
Tina4::Frond.add_filter("money") { |v| "%.2f" % v.to_f }
Tina4::Frond.add_global("APP_NAME", "My App")
Tina4::Frond.add_test("positive") { |v| v > 0 }
```

```typescript
// Node.js
Frond.addFilter("money", (v) => Number(v).toFixed(2));
Frond.addGlobal("APP_NAME", "My App");
Frond.addTest("positive", (v) => Number(v) > 0);
```

```python
# Python - already shipped in v3.13.0
Frond.add_filter("money", lambda v: f"{float(v):.2f}")
Frond.add_global("APP_NAME", "My App")
Frond.add_test("positive", lambda v: v > 0)
```

In every framework, registering at the class level updates a static registry. The next `new Frond()` drains that registry into its own filter/global/test maps automatically. No need to thread a single `Frond` instance through the application - register at startup, render everywhere.

### Instance form still works

Existing per-instance registration continues to work, and now propagates to the class registry too - so the lifecycle is symmetric:

```php
$frond = new \Tina4\Frond();
$frond->addFilter("currency", $fn);
// Future `new Frond()` instances also see "currency"
```

### `clearRegistry()` for test fixtures

Every framework exposes a class-level method to wipe user-registered filters/globals/tests without touching the built-ins (upper, lower, length, defined, even, ...). Useful in test setup/teardown to prevent state leaks between specs.

```php
\Tina4\Frond::clearRegistry();
```

```ruby
Tina4::Frond.clear_registry
```

```typescript
Frond.clearRegistry();
```

```python
Frond.clear_registry()
```

### Implementation notes per framework

| Framework | Mechanism |
|---|---|
| **Python** | `_ClassOrInstanceMethod` descriptor - one method, dual-callable via `__get__` |
| **PHP** | `__call` + `__callStatic` magic-method pair - PHP can't have same-name static and instance methods |
| **Ruby** | Same-name class method and instance method - Ruby naturally allows this |
| **Node.js** | TypeScript class supports same-name `static foo()` and `foo()` instance methods - distinct lookup spaces |

### Test count

| Framework | Before | After | New |
|---|---|---|---|
| Python | 2,741 | 2,741 | 0 (already covered) |
| PHP | 2,858 | 2,871 | +13 |
| Ruby | 2,907 | 2,928 | +21 |
| Node.js | 3,508 | 3,526 | +18 |
| **Total** | **12,014** | **12,066** | **+52** |

### Upgrade

Drop-in patch. No breaking changes. Existing instance-form code (`$frond->addFilter(...)` / `frond.add_filter` / `frond.addFilter`) keeps working unchanged. The new static form is purely additive.

## v3.13.4 (2026-06-04)

Three middleware/header bug fixes across all four frameworks, plus Python chapter 10 + 18 docs rewrites. Reported in tina4-book#140 and tina4-book#141 by MichaelC8E.

### PY-10-02 - `@middleware()` no longer silently disables auth (SECURITY)

**Before**: Applying `@middleware(...)` to a POST/PUT/PATCH/DELETE route silently flipped `auth_required = false`, removing the framework's built-in Bearer-token gate. A developer adding custom logging or rate-limiting middleware to an admin endpoint would, with no warning, open it to unauthenticated callers.

**After**: Middleware is purely additive. Write routes stay Bearer-token-gated by default. Use `@noauth()` to open a write route, `@secured()` to lock a read route. Same rule across all four frameworks.

This is a **behaviour change** - if your code relied on the old auto-disable to handle auth in custom middleware, add `@noauth()` (and have your middleware enforce auth on its own).

### PY-10-03 - `request.headers` is now case-insensitive

**Before**: `request.headers["Content-Type"]` returned `None`/`undefined`/`nil`. The dict was lowercase-only; mixed-case lookups silently failed. Six chapter 10 examples (`Content-Type`, `X-API-Key`, `Authorization`, `User-Agent`) were broken.

**After**: HTTP headers are case-insensitive per RFC 7230 Section 3.2. Same is true in every framework:

| Framework | Implementation |
|---|---|
| Python | `CaseInsensitiveDict` (dict subclass, normalises string keys to lowercase on read/write) |
| PHP | `Tina4\CaseInsensitiveArray` (ArrayAccess + IteratorAggregate + Countable) |
| Ruby | `Tina4::CaseInsensitiveHash < Hash` (overrides `[]`, `[]=`, `key?`, `delete`, etc.) |
| Node | Proxy wrapper around `http.IncomingHttpHeaders` |

`request.headers.get("Content-Type")`, `request.headers.get("content-type")`, and `request.headers.get("CONTENT-TYPE")` all return the same value. Existing lowercase code keeps working unchanged.

### PY-10-01 - Function-based middleware now runs

**Before**: Chapter 10 taught Express-style `async def mw(req, resp, next_handler)` in 8+ examples, but the Python framework's dispatcher only looked for class-based `before_*`/`after_*` methods. Function-style middleware was silently inert - body never executed. PHP and Ruby had similar gaps (closures ran but no `next` continuation).

**After**: Express-style continuation chain is implemented across the family. Python adds `_is_function_middleware()` + `_invoke_handler_with_middleware()`. PHP wraps closures with `array_reverse` continuation. Ruby uses lambdas + `reverse_each`. Node already had `next()` continuation - added a regression test to keep it green.

```python
@middleware(my_mw)
@post("/api/orders")
async def create_order(req, resp):
    ...

async def my_mw(req, resp, next_handler):
    if not authorised(req):
        return resp.json({"error": "forbidden"}, 403)
    result = await next_handler(req, resp)   # continue the chain
    return result
```

First-declared middleware is the outermost layer; calling `next_handler` descends to the next layer (or the route handler if last). Omitting the `next_handler` call short-circuits the chain.

### Python chapter rewrites - book + docs

- **Chapter 18 (Testing)** - Fixed PY-18-04 (test runner output now shows real pytest output, not the fictional `[PASS] test_addition` format), PY-18-07a (added missing `from src.orm.Product import Product` import), PY-18-08 (`resp.status_code` -> `resp.status` across 14+ call sites, positional body `self.post(path, dict)` -> keyword `self.post(path, json=dict)`).
- **Chapter 10 (Middleware)** - Added two callouts: headers are case-insensitive in v3.13.4+; `@middleware()` is purely additive (does not change auth_required). Existing mixed-case header examples now work against v3.13.4.

### Test count

| Framework | Before | After | New |
|---|---|---|---|
| Python | 2,725 | 2,741 | +16 |
| PHP | 2,844 | 2,858 | +14 |
| Ruby | 2,887 | 2,906 | +19 |
| Node.js | 3,477 | 3,508 | +31 |
| **Total** | **11,933** | **12,013** | **+80** |

### Upgrade

PY-10-02 is a behaviour change with a security implication. Audit routes that use `@middleware()` on POST/PUT/PATCH/DELETE: if you rely on custom middleware to handle auth, add `@noauth()` above `@middleware()` (and make sure your middleware enforces auth). Otherwise, no action - your write routes were always supposed to require Bearer tokens.

PY-10-01 and PY-10-03 are purely additive - no breaking changes.

## v3.13.3 (2026-06-03)

Two reporter-driven ergonomic additions, shipped across all four frameworks with full parity per `feedback_parity`.

### `Env` typed env-var helpers (tina4-python#43)

Reading env vars by hand gets old fast: every boolean flag becomes a `os.getenv("TINA4_DEBUG", "false").lower() in ("1", "true", "on", "yes")` incantation. Every numeric tuning knob needs a try/except around `int()`. `Env` centralises it:

```python
from tina4_python import Env

debug   = Env.bool("TINA4_DEBUG", default=False)
workers = Env.int("WORKERS", default=4)
rate    = Env.float("RATE_LIMIT", default=10.0)
region  = Env.str("AWS_REGION", default="us-east-1")
```

Same API across all four frameworks:

- **Python** - `from tina4_python import Env`
- **PHP** - `Tina4\Env::bool / int / float / str`
- **Ruby** - `Tina4::Env.bool / int / float / str`
- **Node.js** - `import { Env } from "@tina4/core"`

Truthy tokens (case-insensitive after `strip`/`trim`): `1`, `true`, `on`, `yes`, `y`, `t`. Falsy: `0`, `false`, `off`, `no`, `n`, `f`, empty string. Anything else returns the `default` - never raises. `int`/`float` parse failures log a warning via `Log` and fall back to default.

### Function-name in log lines (tina4-python#41)

Opt-in via `TINA4_LOG_FUNC=true`. When enabled, the calling function name is injected into every log line so a `tail -f` gives you free context:

```
2026-06-03T14:22:18.341Z [INFO   ] [super_trooper] Hello from inside the function
```

Or in JSON mode:

```json
{"timestamp":"...","level":"INFO","function":"super_trooper","message":"Hello..."}
```

Default off - zero overhead unless opted in. When on, ~5% per-call cost from the stack walk.

Per-framework implementation:

- **Python** - `inspect.currentframe()` walk past Log's own frames
- **PHP** - `debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)` + `{closure}` filter
- **Ruby** - `caller_locations(2, 16)` + block-noise regex
- **Node.js** - `new Error().stack` regex parse + anonymous filter

Anonymous frames (`<lambda>`, `<module>`, `{closure}`, anonymous IIFEs) are filtered as noise - showing `[<lambda>]` would be uglier than nothing.

### Test count

| Framework | Before | After | New |
|---|---|---|---|
| Python | 2,675 | 2,725 | +50 |
| PHP | 2,780 | 2,844 | +64 |
| Ruby | 2,839 | 2,887 | +49 (+1 pre-existing rack_app fail unchanged) |
| Node.js | 3,420 | 3,477 | +57 |
| **Total** | **11,714** | **11,933** | **+220** |

### Upgrade

Drop-in patch. No breaking changes. Two new exports (`Env`, plus one new env var `TINA4_LOG_FUNC`). Existing logs and existing code keep working unchanged.

## v3.13.2 (2026-06-03)

Bug-fix patch - three field reports, fixed with full cross-framework parity audit per `feedback_crosscheck_bugs`.

### SCSS calc() with mixed units (tina4-python#42, tina4-php#116, tina4-nodejs#1)

The SCSS math evaluator silently folded mixed-unit arithmetic by keeping operand 1's unit and dropping operand 2's, producing wrong CSS:

- `max-height: calc(100vh - 170px)` -> `calc(-70vh)` (negative, layout-breaking)
- `width: 100% - 20px` -> `80%` (pixel term silently lost)
- `padding: 1rem + 4px` -> `5rem`

Fixed in Python, PHP, and Node - the evaluator now captures both operand units, only folds when units match (or one side is unitless for `*`/`/`), and masks `calc(...)` ranges so the browser computes them as intended. Ruby unaffected (delegates to libsass).

### Router.group docs taught a crashing pattern (tina4-python#44)

The Python book and docs site showed `Router.group("/api/v1", lambda: [...])` with a zero-arg lambda. Source intentionally passes a `RouteGroup` instance to the callback, so users hit `TypeError: <lambda>() takes 0 positional arguments but 1 was given`. Docs rewritten to `lambda group: [group.get(...), group.post(...)]` matching the real contract (Node has always taught this correctly; PHP and Ruby use ambient state, no group arg needed).

### DATABASE_URL -> TINA4_DATABASE_URL drift (tina4-python#45)

Three real bugs:

- **Python ORM error message** told users to "set DATABASE_URL in .env" - but the v3.12 boot guard rejects that bare name. Users following the error message hit a hard stop.
- **Python dev-admin `.env` writer** stripped the `TINA4_` prefix when updating existing rows, actively corrupting the config every time the user saved a new connection through the dashboard.
- **Node `Database.fromEnv()`** defaulted to `"DATABASE_URL"` as the env-var key, missing the project's actual connection. The ORM error message had the same drift.

All fixed. PHP and Ruby audited - already correct in both.

### Test count

| Framework | Before | After | New |
|---|---|---|---|
| Python | 2,665 | 2,675 | +10 |
| PHP | 2,774 | 2,780 | +6 |
| Ruby | 2,839 | 2,839 | 0 (parity bump only) |
| Node.js | 3,406 | 3,420 | +14 |
| **Total** | **11,684** | **11,714** | **+30** |

### Upgrade

Drop-in patch. No breaking changes. No new public API.

## v3.13.1 (2026-06-02)

Cross-framework parity patch. Closes the remaining audit-flagged docs-vs-code gaps that didn't make 3.13.0 - the documentation claimed APIs across PHP / Ruby / Node that only Python had. This release ships those APIs everywhere and rewrites the PHP chapters that referenced fictional symbols.

### Convenience parity additions (Groups A / B)

Three highest-impact cross-framework methods every documentation set already claimed existed. PHP / Ruby / Node now match Python:

- **`db.fetchAll(sql, params)` / `db.fetch_all` / `$db->fetchAll`** - returns the records list directly. Symmetric with `fetch_one`. For the 80% case where you don't need the `DatabaseResult` metadata.
- **`Database.getConnection(url)` / `.get_connection` / `::getConnection`** - classmethod factory matching SQLAlchemy's `engine.connect()`. Falls back to in-memory SQLite when no URL or env resolves.
- **`Api(bearerToken=, username=, password=, headers=, verifySsl=)` ergonomic kwargs** - three setter calls collapse to one constructor. Bearer wins over basic-auth when both are passed. `verifySsl=False` is the positive form of `ignoreSsl=true`.

### Decorator-style GraphQL resolvers across the family

Python `@GraphQL.resolve` shipped in 3.13.0. This release adds:

- **PHP** - `GraphQL::resolve("Type", "field", $callable)` static method + class-level resolver registry that `new GraphQL()` drains into its schema.
- **Ruby** - `Tina4::GraphQL.resolve("Type", "field") { |root, args, ctx| ... }` with block-based registration.
- **Node.js** - `GraphQL.resolve(typeName, fieldName, resolver)` matching the cross-framework shape.

All four frameworks now support the FastAPI / Strawberry / Ariadne pattern where resolvers register at module-import time before any `GraphQL` instance is constructed, and where post-startup registrations land in the active default singleton via `setDefault(gql)` / `Tina4::GraphQL.default_instance = gql`.

### Class-based service pattern across the family

`class FooWorker extends Service { run() { ... } }` - chapter 27 / equivalent docs have long taught this pattern. Until 3.13.1, only the runner was real:

- **PHP** - new `Tina4\Service` abstract base class + `ServiceRunner::registerService($name, $service)` static helper.
- **Ruby** - new `Tina4::Service` class + `Tina4::ServiceRunner.register_service(name, service)`.
- **Node.js** - new `Tina4Service` abstract class + `ServiceRunner.registerService(name, service)`.
- **Python** - new `tina4_python.service.Service` base + `ServiceRunner.register_service(name, service)` (this release closes the gap; Python had only the function-style runner before).

All four ship `run()` (abstract), `stop()`, and `should_stop()` / `shouldStop()` helpers backed by an internal flag. Function-style services using bare callables continue to work alongside the new class-based pattern.

### PHP chapter rewrites (`docs/php/` and `book-2-php/`)

The 3.13.0 audit found that the PHP testing-chapter disaster was the tip of a larger pattern - multiple PHP chapters taught APIs that didn't exist. 3.13.1 rewrites all seven of them:

- **Chapter 15 - Logging** - primary surface now `Tina4\Log::info()/warning()/error()` instead of the legacy `Tina4\Debug::message()` shim (still works).
- **Chapter 18 - Testing** - `$response->statusCode` -> `$response->status` across 23 occurrences; CLI section updated (`tina4 test` runs the suite; `vendor/bin/phpunit` for targeted runs).
- **Chapter 19 - Scaffolding** - v2 `Tina4\Get::add()` / `Post::add()` / `Put::add()` / `Delete::add()` syntax replaced with `Tina4\Router::get/post/put/delete`; fictional `->description()` chain replaced with real `->swagger([...])`.
- **Chapter 22 - GraphQL** - chapter's decorator pattern (`GraphQL::resolve("Type", "field", $fn)`) now matches real source (built this release).
- **Chapter 25 - WSDL** - `@wsdl_operation` docblock replaced with `#[WSDLOperation([...])]` PHP attribute; methods now return associative arrays matching the response-shape spec; `Router::soap()` -> `Router::any()` + manual `(new Service($request))->handle()`.
- **Chapter 27 - ServiceRunner** - `new ServiceRunner()` + `->add()` instance API replaced with `ServiceRunner::registerService()` + `ServiceRunner::start()` static API. The `Tina4\Service` base class the chapter teaches now exists.
- **Chapter 34 - Deployment** - un-prefixed env vars (`SECRET`, `CORS_ORIGINS`, `SMTP_USER`, `JWT_SECRET`, `API_KEY`, `SWAGGER_TITLE`) replaced with `TINA4_`-prefixed forms. The v3.12 boot guard rejects the legacy names with `exit(2)`.

### Test count

Net new across the family this release:

| Framework | Before | After | New |
|---|---|---|---|
| Python | 2,654 | 2,665 | +11 |
| PHP | 2,749 | 2,774 | +25 |
| Ruby | 2,827 | 2,839 | +12 |
| Node.js | 3,384 | 3,406 | +22 |
| **Total** | **11,614** | **11,684** | **+70** |

### Upgrade

Drop-in patch - no breaking changes. Existing source-code patterns from 3.13.0 continue to work; the new methods are additive. Documentation rewrites in chapters 15 / 18 / 19 / 22 / 25 / 27 / 34 redirect copy-paste examples to the real APIs the framework actually ships.

## v3.13.0 (2026-06-01)

The docs-vs-code parity release. A cross-framework audit of 381 markdown files surfaced 146 hallucinations, signature drifts, and stale references across Python, PHP, Ruby, Node, and tina4-js. 3.13.0 closes the chapter-18 disaster pattern - where documentation taught a class-based API that didn't exist - by shipping the missing pieces, renaming the misnamed pieces, and rewriting the aspirational chapters.

### The headline fire: `Test` class with HTTP helpers

Every framework's chapter 18 has long shown integration tests like:

```python
class UserApiTest(Test):           # tina4_python.test.Test
    def test_health(self):
        resp = self.get("/health")
        assert_equal(resp.status, 200)
```

Until 3.13.0, only `Test` (the bare assertion base) existed - calling `self.get(...)` crashed with `AttributeError`. The HTTP test client lived in a separate `TestClient` class that the docs never mentioned.

This release mixes `TestClient.get / post / put / patch / delete` into the `Test` base across every framework:

- **Python** - `tina4_python.test.Test` (extends `unittest.TestCase`, pytest auto-discovers)
- **PHP** - `Tina4\Test` (extends `PHPUnit\Framework\TestCase`)
- **Ruby** - `Tina4::Test` (zero-dep; built-in `run_all` runner)
- **Node.js** - `Tina4Test` (zero-dep; built-in `Tina4Test.runAll()` runner)

Plus positional assertions on every framework - `assertEqual(actual, expected, message)`, `assertNotEqual`, `assertTrue`, `assertFalse`, `assertNull`/`assertNullValue`, `assertNotNull`/`assertNotNullValue`, `assertRaises` - matching the documented `(actual, expected, message)` shape.

### `Auth.valid_token` now returns the payload, not a bare bool - **BREAKING**

The most common silent-fail pattern caught by the audit. Every framework's docs claimed `valid_token` returned the decoded JWT payload; every framework's source returned `bool` and forced a second `get_payload` call.

| Framework | Before | After |
|---|---|---|
| Python | `Auth.valid_token(token) -> bool` | `Auth.valid_token(token) -> dict \| None` |
| PHP | `Auth::validToken(token) -> bool` | `Auth::validToken(token) -> array \| null` |
| Ruby | `Auth.valid_token(token) -> Boolean` | `Auth.valid_token(token) -> Hash \| nil` |
| Node | `validToken(token) -> boolean` | `validToken(token) -> Record<string, unknown> \| null` |

Matches PyJWT / firebase-jwt-ruby / firebase/php-jwt / jsonwebtoken conventions. Truthy/falsy contract preserved - existing `if (validToken(t))` callers keep working because a non-null object is truthy and null is falsy.

### Python-specific groups (mirrored to PHP/Ruby/Node in follow-up patches)

The Python framework is the reference per `feedback_python_master`. Six groups landed in tina4-python:

- **Group A - ergonomic additions**: `Database.get_connection()`, `db.fetch_all()`, `db.pool`, `DatabaseResult.columns`, `Job.error`, `Queue.produce(delay_until=datetime)`, module-level `migrate(db)`/`rollback(db)`/`status(db)`, module-level `i18n.t()`, dict-style `session[key]`, `WebSocketConnection.connection_count`. All zero-risk additions - no signatures changed.
- **Group B - signature expansions**: `Api(bearer_token=, username=, password=, headers=, verify_ssl=)` kwargs, `Model.find(pk)` int overload (Active Record convention), `@description(summary, detail=, params=, query=)`, `@tags(str | list)`, `@example_response(status_code, data)`, `response.render(template, data, status_code)`, `response.cookie(name, value, options_dict)`, `response(data, headers={})`, `@get(path, description=, middleware=["ResponseCache:300"])` with string-form middleware parser.
- **Group C - mixins + decorators**: the Test HTTP mixin (covered above), `Frond.add_filter / add_global / add_test` callable as classmethod OR instance method via a `_ClassOrInstanceMethod` descriptor, `@GraphQL.resolve("Type", "field")` decorator with class-level registry - chapter 22's pattern now works as documented.
- **Group D - return-type changes (BREAKING)**: `Container.reset()` now clears singleton cache only (factories survive); new `Container.reset_all()` for the old wipe-everything behaviour. `queue.dead_letters()` returns `list[Job]` with `.error` populated, not `list[dict]`. `Model.where(..., with_count=True)` returns `(list, int)` tuple for pagination UIs.
- **Group E - renames (BREAKING)**: `ai.install_all()` -> `ai.install_context()`; new `ai.detect_ai()`, `ai.detect_ai_names()`, `ai.status_report()`. `queue.consume(id=)` -> `queue.consume(job_id=)`. `Api.send_request()` -> `Api.send()`. `I18n(locale=, path=)` preferred over `I18n(locale_dir=, default_locale=)` (legacy kept). `TINA4_TOKEN_EXPIRES_IN` preferred over `TINA4_TOKEN_LIMIT` for JWT expiry (both honoured; new wins; constructor arg overrides both).
- **Group F - top-level re-exports + scaffolder**: `from tina4_python import Api, WSDL, wsdl_operation, GraphQL, AutoCrud, Messenger, on, emit, once, off, tests` now resolve. `Model.select()` with no args defaults to `SELECT * FROM <table>` so the CRUD-list scaffolder template's emitted code actually runs.

### PHP-specific: `Tina4\Debug` shim

Chapter 15 of the PHP logging docs taught `Tina4\Debug::message($msg, TINA4_LOG_INFO, [...])`. Neither the class nor the constants existed. Real logger is `Tina4\Log`.

This release ships a `Tina4\Debug` compatibility shim that forwards to `Tina4\Log`, plus defines the `TINA4_LOG_*` level constants - so the chapter's code samples run as-written. For new code, prefer `\Tina4\Log::info()` etc.

### Documentation sweep

Aside from the source-side changes, the audit caught hundreds of stale references in docs site + book + AI skills + CLAUDE.md files. All fixed in this release:

- ~80 occurrences of `from tina4 import` -> `from tina4_python import` (the Python package is `tina4_python`, not `tina4`)
- `from tina4_python.router` -> `from tina4_python.core.router`
- `TINA4_SESSION_HANDLER` -> `TINA4_SESSION_BACKEND` (matches the env var the framework actually reads)
- `DATABASE_NAME=` -> `TINA4_DATABASE_URL=` (legacy un-prefixed names get rejected by the v3.12 boot guard)
- `@cached(True, max_age=N)` -> `@cached(max_age=N)` (bogus first arg)
- `Template.render()` -> `response.render()` (Template class doesn't exist; renamed to Frond)
- `Debug.error()` -> `Log.error()` in Python (Debug class doesn't exist)
- `Producer` / `Consumer` (removed in v3.2.0) -> `Queue.push / consume`
- `Email` -> `Messenger`, `event.fire / @listener` -> `emit / @on`, `gql` singleton -> `GraphQL()` + `@GraphQL.resolve`
- **Security fix**: `Auth.check_password(hash, password)` -> `(password, hash)` in skill ref - the bcrypt comparison was returning False every time due to reversed args (silent-failure auth)
- `request.files['content']` is **raw bytes** - drop `base64.b64decode()` from upload examples
- Deployment chapter env vars all `TINA4_`-prefixed (un-prefixed names brick boot under v3.12 guard)

### Aspirational chapters rewritten

Two Python chapters were built on APIs that didn't exist:

- **Chapter 22 (GraphQL)**: rewritten around the new `@GraphQL.resolve("Type", "field")` decorator (the FastAPI/Strawberry pattern). The previous `gql.schema.add_query("name", {dict})` form still works but is no longer the primary documented path.
- **Chapter 25 (WSDL)**: rewritten around the real subclass pattern (`class Calculator(WSDL): @wsdl_operation({"Result": int}) def Add(self, ...): ...; Calculator(request).handle()`). The previous `WSDL(service_name=, namespace=, endpoint=)` constructor + `handle_wsdl` / `handle_request` API was entirely fictional.

### tina4-js doc drift caught

The cross-framework audit's synthesis pass dropped tina4-js findings; the raw agent transcripts had 23 real findings:

- Every import in CLAUDE.md and `docs/js/09-graphql.md` used `"tina4-js"` (with hyphen). The npm package is named `tina4js`. Fixed.
- `pwa({...})` was treated as callable; real API is `pwa.register({...})`. `PWAConfig.icon` is a single string, not an `icons: [...]` array.
- `static props = { label: { type: String, default: "..." } }` - the `{ type, default }` wrapper is fictional. Real shape is `static props = { label: String }`.
- `router.navigate('/users/42')` - `navigate` is a top-level export, not a method on `router`.
- Chapter 14's `<slot>` inside a `static shadow = false` component - slots are a Shadow DOM feature. Chapter 14 contradicted chapter 4. Switched to `shadow = true`.

### Test counts

Net new across the family:

| Framework | Before | After | New |
|---|---|---|---|
| Python | 2,537 | 2,654 | +117 |
| PHP | 2,742 | 2,749 | +20 |
| Ruby | 2,800 | 2,816 | +16 (1 pre-existing unrelated rack_app failure) |
| Node.js | 3,366 | 3,384 | +18 |
| **Total** | **11,445** | **11,603** | **+171** |

### Upgrade

`Auth.validToken` is the breakage to know about - your `if Auth::validToken($t)` style code keeps working unchanged because non-null arrays are truthy and null is falsy. If you do `=== true` / `=== false` strict comparisons, switch to `!== null` / `=== null`.

Python: `ai.install_all()` -> `ai.install_context()`, `queue.consume(id=)` -> `consume(job_id=)`, `Api.send_request()` -> `Api.send()`, `Container.reset()` semantic change (use `reset_all()` for old behaviour).

Everything else is additive - new properties, new kwargs, new convenience methods that match what the docs have promised for years.

## v3.12.14 (2026-06-01)

Two independent fixes ship together as 3.12.14. **Python** - the `tina4_python.test` class-based xUnit testing surface that the chapter 18 documentation has always promised but never actually existed. Reports came in of developers copy-pasting `from tina4_python.test import Test, assert_equal, assert_true` straight out of the book and getting `ModuleNotFoundError`. The fix was to build the module to match the documentation, not the other way around. **PHP** - `:named` placeholder translation for the four non-PDO adapters where `ORM::save()` was silently failing.

### Python - `tina4_python.test` xUnit testing surface

The testing chapter taught a `Test` base class with positional assertions:

```python
from tina4_python.test import Test, assert_equal, assert_true

class BasicTest(Test):
    def test_addition(self):
        assert_equal(2 + 2, 4, "Basic addition should work")

    def test_string_contains(self):
        greeting = "Hello, World!"
        assert_true("World" in greeting, "Greeting should contain 'World'")
```

The module did not exist. Every developer who followed the chapter hit an immediate import error. The other surface, `tina4_python.Testing` with the inline `@tests` decorator, has always existed - but the two are for different purposes and the docs only documented one of them.

The fix ships the missing module - `tina4_python/test/__init__.py` - with the `Test` base class (inherits `unittest.TestCase`, so pytest discovers any subclass regardless of class-name convention) and 13 positional assertions. The signatures are uniform: `(actual, expected, message)`. The 2-arg legacy `(value, message)` form keeps working - a type-based dispatch detects which shape the caller used. `assert_raises` accepts three forms: docs form (`callable, exception, message`), context-manager form (`with assert_raises(X):`), and unittest order (`exception, callable`). Lifecycle hooks come in both flavours - snake_case `set_up`/`tear_down` (the Tina4 idiom) and camelCase `setUp`/`tearDown` (for users coming from unittest) - without double-calling when a subclass uses either one.

```python
# 13 assertions, all uniform (actual, expected, message)
assert_equal(actual, expected, message="")
assert_not_equal(actual, expected, message="")
assert_true(actual, expected=True, message="")
assert_false(actual, expected=False, message="")
assert_none(actual, expected=None, message="")
assert_not_none(actual, expected="not None", message="")
assert_in(item, container, message="")
assert_not_in(item, container, message="")
assert_is_instance(value, expected_type, message="")
assert_greater(actual, expected, message="")
assert_less(actual, expected, message="")
assert_almost_equal(actual, expected, places=7, message="")
assert_raises(callable, exception_class, message="")
```

51 new tests in `tests/test_test_module.py` pin the contract: BasicTest from the chapter runs verbatim, every assertion fails when it should and passes when it should, both 2-arg and 3-arg shapes work, snake_case and camelCase lifecycle hooks fire once each (never both). Full Python suite: 2,537 passing.

`tina4 test` continues to run pytest (`subprocess.run([sys.executable, "-m", "pytest", "tests/"] + args)`).

### Cross-framework parity check (testing)

PHP / Ruby / Node testing chapters already teach native conventions correctly - PHPUnit, RSpec, and `node:test` respectively. No fake API to fix. The Python-specific gap was that Tina4 had two testing surfaces (`tina4_python.Testing` for inline `@tests` decorator, `tina4_python.test` for class-based suites) and only one of the two existed. The other three frameworks defer to a single native runner each, so the same trap doesn't apply.

### PHP - :named placeholder translation across non-PDO adapters

The ORM's `save()` emits `:named` placeholders because PDO would accept them. Four of the five PHP database adapters do not use PDO. `MySQLAdapter` (mysqli), `MSSQLAdapter` (sqlsrv), `FirebirdAdapter` (ibase/fbird), and `PostgresAdapter` (pgsql) all bind positionally. Every INSERT/UPDATE through `save()` against those four engines failed silently. Reads worked because read paths typically use `?` or no params.

A single helper, `SqlTranslation::namedToPositional($sql, $params)`, translates `:name` to `?` and reorders `$params` to match the SQL order. Wired into the four affected adapters at the top of their prepare/execute paths. The helper skips string literals and SQL comments, so a literal `:colon` inside a value stays as a value. Duplicate names bind once per occurrence, so `WHERE id = :id AND parent_id = :id` works as expected.

`SQLite3Adapter` is untouched. ext-sqlite3 natively accepts `:name` via `SQLite3Stmt::bindValue`. The other four did not, and now do.

15 unit tests pin the helper in `tests/SqlTranslationNamedToPositionalTest.php`: order preservation, duplicate names, quoted strings, line and block comments, unknown placeholders, null values, and the `0`-as-value case. Full PHP suite: 2,290 passing.

### Cross-framework parity check (`:named` placeholders)

Python (`mysql-connector-python` uses `%s`), Ruby (`mysql2` uses `?`), and Node (`mysql2` uses `?`) build their INSERT/UPDATE SQL with positional placeholders from the ORM down. No `:named` ever emitted. Audited the MySQL adapter and `save()` path in each before shipping; confirmed clean. PHP-only fix.

### Upgrade

Drop in for both Python and PHP. No `.env` changes, no API changes.

**Python users** who followed chapter 18 and hit `ModuleNotFoundError` - bump to `3.12.14`, the `from tina4_python.test import Test, assert_equal, ...` import now resolves. Existing tests written against `tina4_python.Testing` (the inline `@tests` decorator) continue to work - that surface was not touched.

**PHP users** - `:named` and `?` both work, and the framework picks the right form for whichever driver is underneath. Existing ORM `save()` calls start succeeding on MariaDB/MySQL, PostgreSQL, MSSQL, and Firebird.

## v3.12.13 (2026-05-29)

Consolidated parity release. PHP ran ahead through two independent patch releases (3.12.11-3.12.12) while Python / Ruby / Node stayed at 3.12.10. This release realigns all four frameworks on **3.12.13** and ships the cross-framework dev-admin parity sweep - five tiers of work that bring PHP, Ruby and Node up to Python's AI-assisted development surface.

### Cross-framework dev-admin parity sweep (Tier 1-5)

The Python framework had pulled ahead on a series of dev-admin features driven by real frustration with the AI coder loop ("Applying a small patch went and messed up my whole file", "Says it is creating files but then doesn't", repeated import-error spirals). This release ports the full set to PHP, Ruby, and Node - same intent, language-idiomatic implementations.

**Tier 1 - MCP defensive write layer.** `file_write` and `file_patch` now refuse prose-as-filenames (the LLM occasionally emits `## FILE: I'll implement Step 1 by creating the database migration` and the parser used to write a zero-byte file with that sentence as its filename), normalise bare top-level `routes/` / `orm/` / `templates/` / `seeds/` / `controllers/` / `middleware/` paths to their canonical `src/<dir>/` form (auto-discovery only scans `src/`, so a file at `templates/foo.twig` was dead weight), back up existing files to `.tina4/backups/<flat-path>.<ISO-ts>.bak` before overwrite, and refuse suspicious truncations (>200B file -> <30% size = almost always a truncated LLM response). Every attempt logs to `.tina4/agent.log` with a structured category (`write.ok` / `write.refused` / `write.path_normalized` / `write.import_failed`) - the supervisor reads that file on every turn so it sees what broke last time and can self-correct without asking the developer "what's the error?".

**Tier 2 - Post-write syntax verification.** PHP shells out to `php -l`, Ruby to `ruby -c`, Node to `node --check` (and single-file `tsc --noEmit --allowJs --skipLibCheck` for `.ts`). On parse error the tool result gets an `import_error` field AND a `write.import_failed` log entry surfaces in the next supervisor turn's failure context. Catches hallucinated framework APIs (`CharField` doesn't exist in `tina4_python.orm.fields` - should be `StrField`; `auto_now_add` keyword on `Field.__init__()`) at write time instead of letting them propagate to a runtime 500 the user only discovers by hitting the URL.

**Tier 3 - `/__dev/api/threads` + `/__dev/api/chat` proxy.** The SPA now talks to the Rust supervisor agent the same way regardless of framework. `_supervisor_base_url()` matches Python's 4-step ladder (`TINA4_SUPERVISOR_URL` -> `TINA4_AGENT_PORT` -> `PORT+2000` -> `9145`). `active_file` rides through `/chat` POST verbatim so deictic phrases ("fix this", "explain this") bind to the editor's open file without the supervisor asking. The Node port forwards SSE chunks as they arrive; PHP and Ruby buffer (functional - EventSource parses fine - but feels less snappy until a future round of Rack/PHP-FPM streaming work).

**Tier 4 - Customer feedback widget.** A floating bubble for end-users of a shipped Tina4 app, gated by `TINA4_ENABLE_FEEDBACK=true` AND a non-empty `TINA4_FEEDBACK_WHITELIST`. The framework's response middleware injects `<script src="/__feedback/widget.js" data-tina4-feedback></script>` immediately before the LAST `</body>` tag on text/html responses, ONLY for whitelisted users, NEVER on `/__dev` or `/__feedback` paths (no double-bubble UX on the developer dashboard). One conversational turn at a time POSTs to `/__feedback/api/turn` -> server-side identity stamp from the verified JWT (clients cannot fake `sender`) -> forward to the Rust agent's intake-only agent (zero tools, JSON-only output). Finalised tickets land in the dev admin sidebar with `kind:"feedback"`. Rate-limited at 5 turns/hour per user.

**Tier 5 - Stale-source overlay badge + `list_plans()` merge.** The error overlay now stamps `captured_at` on render and tags each stack frame whose source file has been modified since: "FILE MODIFIED @ HH:MM:SS UTC - source may not match what failed". Stops the user from chasing ghosts when the AI coder rewrote the file between the error and the page reload. `list_plans()` reads from BOTH `plan/` (user-curated canonical) AND `.tina4/plans/` (AI-planner output), dedupes by filename with `plan/` winning on collision, sorts newest-first, and returns a `path` field so the SPA can open the right file regardless of source dir.

**Test counts.** Per-framework deltas across the sweep:

| Framework | Before -> After (full suite) |
|---|---|
| Python | 2453 -> 2453 (canonical - no new tests, just released) |
| PHP | 2235 -> 2714 (+479) |
| Ruby | 2747 -> 2800 (+53) |
| Node | 3263 -> 3368 (+105) |

PHP's larger delta reflects new tests + the 3.12.11 + 3.12.12 lineage rolling forward.

**Why all four frameworks at once.** Per the cross-framework parity rule: a feature that exists in only one framework is technical debt. The Python-only Tier 1-5 surface had been accumulating for two weeks while the UX was settling. With it settled, this release closes the gap in one coordinated sweep.

### Folded-in from PHP 3.12.11 - file upload regression (`tina4-book#139`)

`WebSocket::parseHttpHeaders()` previously split the entire raw HTTP request on `\r\n` and iterated every line for a `:` to fill the headers map. Multipart body parts have their own `Content-Type`, `Content-Disposition`, and `Content-Transfer-Encoding` headers - those lines matched the parser and overwrote the real request `Content-Type: multipart/form-data; boundary=...` with whatever the last body part's content type was (typically `application/pdf`, `image/png`). Downstream `str_contains($contentType, 'multipart/form-data')` then failed, the multipart branch was skipped, `$parsedFiles` was never set, and `$request->files` came out empty. Every file upload through the stream-socket server was silently lost - the body landed in `$request->body` as a raw multipart string with no way to parse it.

**Fix.** Stop the parser at the first `\r\n\r\n` (RFC 9112 Section 2.2 boundary between headers and body) before splitting into lines. One logical change in `Tina4/WebSocket.php`. 9 regression tests in `tests/BookIssue139Test.php` cover single-part, multi-part, and mixed-header cases.

**Cross-framework parity check.** Python (`http.server`), Ruby (`webrick`/`puma`), and Node (built-in `http` module) all delegate header parsing to upstream stdlib HTTP parsers that already split headers from body correctly. PHP was the only framework with a hand-rolled HTTP parser in this code path. No port needed.

### Folded-in from PHP 3.12.12 + Python 3.12.13 - v2 `tina4_migration` auto-upgrade (#115)

Projects upgrading from tina4 ^2.x to ^3.x carried a v2-shaped `tina4_migration` table that v3's `ensureMigrationsTable()` left untouched (the `CREATE TABLE IF NOT EXISTS` short-circuited). The v3 reader then selected columns that didn't exist, fell into the "never seen this migration, run it" branch, and re-applied already-applied migrations - typically failing on duplicate-column / table-already-exists errors when the SQL was non-idempotent. The AirOffices ~190-migration codebase tripped on this in March 2026 and needed a manual SQL backfill at the time.

| Framework | v2 schema | v3 schema |
|---|---|---|
| PHP | `migration_id VARCHAR(14)`, `description`, `content BLOB`, `passed` | `id INT PK`, `migration`, `batch`, `applied_at` |
| Python | `description` as identifier, `content`, `passed` | `migration_id`, `migration_name`, `executed_at` |

**Fix.** `ensureMigrationsTable()` (PHP) and `_ensure_tracking_table()` (Python) now detect a v2-shaped table (v2 columns present, v3 columns absent) and call an in-place upgrade that ALTERs in the v3 columns alongside the v2 ones, then backfills v3 fields from the v2 data. v2 columns are kept in place so a manual rollback path stays open - they're simply ignored by v3 readers. The match is by file stem: a v2 row's identifier is matched against `migrations/` files by basename (Python uses `000001_create_users.sql` -> stem `000001_create_users` -> v2 description `create_users`).

**Cross-framework parity check.** Ruby and Node never shipped a v2 migration table with the trapping shape - their v2 lineages used a different column layout that v3's tracker tolerated. Nothing to port.

### Folded-in from PHP 3.12.11 - request URL parity

`$request->url` now returns the full absolute URL (`https://host:port/path?query`) instead of just the path. `$request->queryString` (raw query bytes) added for parity with `request.query_string` on the other frameworks. Drop-in - old code that read `$request->path` (untouched) keeps working.

### Upgrade

Drop in. No `.env` changes, no API changes.

**For projects upgrading from v2.x:** the v2 `tina4_migration` auto-upgrade runs once on first boot against v3 - back up your migrations table beforehand if you're paranoid. The upgrade is non-destructive (v2 columns are kept alongside the new v3 ones).

**For projects using the dev admin AI coder loop:** the new MCP defensive layer will silently rewrite `## FILE: routes/foo.py` to `src/routes/foo.py` and log a `write.path_normalized` entry. If you were relying on the old behaviour (writes landing wherever the LLM emitted them), this will move some files. Run `tail -n 50 .tina4/agent.log | grep path_normalized` after upgrading to see what got rewritten.

**For shipping apps that want the customer feedback widget:** set `TINA4_ENABLE_FEEDBACK=true` AND `TINA4_FEEDBACK_WHITELIST=alice@example.com,bob@example.com` in `.env`. The widget appears only for those users on non-`/__dev` pages.

## v3.12.10 (2026-05-14)

Version-alignment release. PHP ran ahead through three independent patch releases (3.12.7-3.12.9) while Python / Ruby / Node stayed at 3.12.6. This release realigns all four frameworks on **3.12.10** and ships the ORM `save()` fix.

### PHP - `ORM->save()` no longer swallows write failures (#114)

`ORM->save()` called `update()`/`insert()` but ignored their `bool` return - it only caught exceptions. The PHP adapter's `exec()` returns `false` on a bad statement instead of throwing, so a failed `UPDATE` (commonly: one referencing a public model property with no matching DB column, since `getDbData()` includes every public property) slipped through. The empty transaction got committed and `save()` returned `$this` - the documented success signal. Callers relying on the `save(): static|false` contract believed the row persisted when nothing changed. **Silent data loss** - no exception, no log.

**Fix.** `save()` now captures the `bool` return of `update()`/`insert()`, rolls back, and returns `false` on a falsy result.

```php
$ok = $this->_exists || ... ? $this->update() : $this->insert();
if ($ok === false) { $this->_db->rollback(); return false; }
$this->_db->commit();
```

**Cross-framework parity check.** Python, Ruby and Node don't have this exact failure mode - they build the write payload from declared fields only (not all public properties), and their DB adapters raise on bad SQL, which the existing `try/except` already catches. PHP was the outlier on both counts. 3 regression tests in `tests/Issue114Test.php`; PHP suite 2235 -> 2238 passing.

### Also in the PHP 3.12.7-3.12.9 patch line

These shipped to PHP between 3.12.6 and this release; folded into the consolidated 3.12.10 line:

- **3.12.7** - `Request` now normalises caller-provided header keys to lowercase. Some upstream entry points (Apache+PHP-FPM custom mappings, certain proxies, hand-written test fixtures) hand headers in with original case. The constructor only looks them up by lowercase key, so without normalisation `multipart/form-data` content-type detection silently missed and the body fell through as raw bytes - a follow-up to the #135 fix.
- **3.12.8 / 3.12.9** - Router gained RFC 9110 HTTP method conformance: proper `HEAD` and `OPTIONS` handling, `405 Method Not Allowed` with an `Allow` header listing the methods a route does support.

### Python / Ruby / Node

Version-only bump 3.12.6 -> 3.12.10 to realign with PHP. No behavioural changes in these three since 3.12.6.

### Upgrade

Drop in. No `.env` changes, no API changes. PHP users on 3.12.9 get the `save()` fix; everyone else gets a version-number realignment.

## v3.12.6 (2026-05-06)

Python-only fix release. PHP / Ruby / Node ship the same version stamp for parity but carry no behavioural changes.

### Python - psycopg2 `%` substitution no longer trips PL/pgSQL function bodies (#40)

A migration containing a PL/pgSQL function with literal `%` characters in a `RAISE EXCEPTION` (or `format()`) call used to fail with the misleading:

> RuntimeError: Migration failed: list index out of range

The error message gave no hint that the `%` chars were the problem. The user-facing failure looked like a tina4 internal bug - actually psycopg2's argument-substitution system tripping on the literal percent signs.

**Root cause.** `PostgreSQLAdapter.execute(sql, params)` always called `cursor.execute(sql, params or [])`. psycopg2 interprets `%` as parameter placeholders WHENEVER the `params` arg is supplied - even an empty list `[]`. So a function body containing `RAISE EXCEPTION 'thing % conflicts with %', a, b` (perfectly valid PL/pgSQL) blew up because psycopg2 thought `%` was a placeholder and there were no values to substitute.

**Fix.** New `PostgreSQLAdapter._safe_execute(cursor, sql, params)` helper routes empty/None params through `cursor.execute(sql)` (no second arg), which makes psycopg2 skip the substitution pass entirely. Literal `%` chars flow through untouched. Applied at every `cursor.execute(...)` call site in the adapter (5 spots across `execute`, `fetch`, `fetch_one`).

**Tests.** 5 new unit tests in `tests/test_postgres_percent_substitution.py` pin the helper's branching. 3 live-Postgres regression tests in `tests/test_postgres_plpgsql_percent.py` exercise a real CREATE FUNCTION + trigger flow with literal `%` in the body - skipped automatically when no Postgres is reachable. Full suite: 2453 passing (was 2448).

**Cross-framework parity check.** PHP (`pg_query` vs `pg_query_params`) and Ruby (`exec` vs `exec_params`) already branch on params presence so they don't have this bug. Node uses `$1` placeholders not `%`, so the same class of bug doesn't apply.

### Long-standing tina4-js #37 confirmed fixed

`frond.form.submit` not following 3xx redirects - fixed in frond v2.1.2 back on April 11, 2026 (`xhr.responseURL` comparison + `window.location.href` navigation). All four framework `public/js/frond.min.js` copies carry the fix. The original issue stayed open because the reporter never confirmed against the patched build.

### Upgrade

Drop in. No `.env` changes, no API changes.

## v3.12.5 (2026-05-06)

PHP-only bug fix release. Python / Ruby / Node ship the same version stamp for parity but carry no behavioural changes.

### PHP - multipart bodies with file uploads now parse correctly (#135)

Two stacked bugs in `Tina4\Request::__construct` made `$request->body` come through as the raw multipart bytes (~11 KB blobs starting with `------WebKitFormBoundary...`) whenever the request included a file upload:

1. The constructor called `$this->parseBody()` BEFORE initialising `$this->files`. Inside parseBody's multipart branch, the line `$this->files = array_merge($this->files, $parsed['files'])` read an uninitialised typed property - fatal `Error`.
2. After fixing the init order, that same line tried to mutate the `readonly` `$files` property - another fatal `Error`.

Both errors got swallowed by the upstream error handler and the route handler received the raw multipart payload instead of the parsed associative array. Routes that worked fine for ordinary form posts broke the moment a file field came along.

**Fix.** Move `$this->files` initialisation AFTER `parseBody()` runs. parseBody stashes extracted multipart files on a new private mutable `$multipartFiles`; the constructor merges them into the readonly `$files` in a single assignment that respects the readonly contract.

4 new regression tests in `tests/Issue135Test.php` pin the constructor's contract. Full PHP suite: 2235 passing (was 2231).

### Upgrade

Drop in. No `.env` changes, no API changes, no other framework changes.

## v3.12.4 (2026-05-06)

Documentation-truth release. The `audit-truth.py` CI gate (introduced post-3.12.3) flagged 39 env vars referenced in docs that no framework actually read. This release closes that gap: 25 of them now exist in code, the other 14 are deleted from docs (11 hallucinations + 6 clustering vars deferred to [tina4#2](https://github.com/tina4stack/tina4/issues/2)). Both audit gates (CLI drift + env-var drift) are now strict in CI.

### 25 new env vars across all 4 frameworks

Server: `TINA4_HOST`, `TINA4_SUPPRESS`, `TINA4_ENV_FILE`. Health: `TINA4_HEALTH_PATH` (default `/__health`, with `/health` kept as a legacy alias), `TINA4_TRAILING_SLASH_REDIRECT`. Sessions: `TINA4_SESSION_HTTPONLY`, `TINA4_SESSION_NAME`, `TINA4_SESSION_SECURE`. Templates: `TINA4_TEMPLATE_CACHE_TTL` (`0` = permanent). GraphQL: `TINA4_GRAPHQL_AUTO_SCHEMA`, `TINA4_GRAPHQL_ENDPOINT`. Mail: `TINA4_MAIL_IMAP_ENCRYPTION` (`tls`/`starttls`/`none`). MCP: `TINA4_MCP`, `TINA4_MCP_PORT`. Swagger: `TINA4_SWAGGER_ENABLED`, `TINA4_SWAGGER_CONTACT_EMAIL`, `TINA4_SWAGGER_LICENSE`. Database: `TINA4_DB_POOL` (env override on the existing `Database(url, pool=N)` constructor argument).

### Logging - env-driven file output + rotation

Six new vars give you full control over logging without touching code:

| Var | Default | What it does |
|---|---|---|
| `TINA4_LOG_FILE` | _(empty - stdout only)_ | Path to a log file. Empty leaves you on stdout. |
| `TINA4_LOG_DIR` | `logs` | Directory for log files (joined with `_LOG_FILE` if relative). |
| `TINA4_LOG_FORMAT` | `text` | `text` or `json`. JSON mode emits one structured record per line. |
| `TINA4_LOG_OUTPUT` | `stdout` | `stdout`, `file`, or `both`. Strict - `stdout` means stdout only. |
| `TINA4_LOG_CRITICAL` | `false` | Enables a `Log.critical()` level above `error`. Off = no-op. |
| `TINA4_LOG_ROTATE_SIZE` | `10485760` (10 MB) | Rotate when the file exceeds this many bytes. `0` disables rotation. |
| `TINA4_LOG_ROTATE_KEEP` | `5` | Number of rotated files to retain (`app.log.1` ... `app.log.N`). Older ones are deleted. |

Implementation uses each language's stdlib - Python's `logging.handlers.RotatingFileHandler`, Ruby's `Logger.new(path, shift_age, shift_size)`, and a roll-your-own atomic-rename pattern in PHP and Node. Zero new dependencies in any framework.

### Documentation-truth CI gate now strict on both axes

The `audit-truth.py` script now blocks merges to `main` of `tina4-documentation` whenever a doc references a `tina4 <command>` or `TINA4_*` env var that doesn't exist in source. Previously CLI drift was strict; env drift was warn-only. Today both are strict.

### Tests added

- Python: +53 tests in `tests/test_env_vars.py` (2395 -> 2448)
- PHP: +59 tests in `tests/EnvVarTest.php` (2172 -> 2231)
- Ruby: +51 examples in `spec/env_vars_spec.rb` (2696 -> 2747)
- Node: +59 tests in `test/envVars.test.ts` (3204 -> 3263)

**Cross-framework total: 10,689 tests passing, +222 from 3.12.3.**

### Upgrade path

Drop in. No breaking changes - every new env var is opt-in with a sensible default. If you were setting any of the 17 deleted vars in your `.env`, the boot guard will warn (then ignore) - clean them out at your leisure.

## v3.12.3 (2026-05-05)

Cross-framework parity sweep. Two minor breaking changes in the Ruby and PHP public API that bring all four frameworks onto the same shape.

### Breaking changes (Ruby + PHP only)

**Ruby Container - predicate now uses `?` suffix.**

```ruby
# before (3.12.2 and earlier)
Tina4::Container.has(:mailer)        # outdated

# after (3.12.3)
Tina4::Container.has?(:mailer)       # idiomatic Ruby predicate
```

This brings Ruby in line with Python (`has()`), PHP (`has()`), and Node (`has()`) while still respecting Ruby's `?`-suffix idiom for predicates returning bool. The pre-existing `resolve` -> `get` rename happened earlier; only the predicate was lagging.

**ResponseCache public surface - middleware-only across all four frameworks.**

The cache has always been middleware. Two of the four frameworks (PHP, Ruby) historically exposed lookup/store as public methods, which let users couple to internals. The public API is now consistent across all four: use the middleware on a route, and read stats with module-level helpers.

```ruby
# Ruby - module-level helpers (parity with Python)
Tina4.cache_stats   # -> { hits:, misses:, size:, backend:, keys: }
Tina4.clear_cache   # flush all entries

# PHP - static methods on the class
\Tina4\Middleware\ResponseCache::cacheStats();
\Tina4\Middleware\ResponseCache::clearCache();
```

Internal methods that used to be public (`get`, `lookup`, `store`, `cache_response`) are now private. Tests that needed them retain access via `_internal*` test seams marked `@internal`.

### Doc parity - CLAUDE.md and book chapter 33

- **CLAUDE.md**: every framework's "Key Method Stubs" section now covers the same surface area Python documents - Queue, QueryBuilder, Frond, Api, Background Tasks, ResponseCache, etc. PHP added 4 sections; Ruby added 5; Node added 13.
- **Book chapter 33**: env var tables are now grounded in source. Each framework's chapter 33 lists every `TINA4_*` var its source actually reads. Found and fixed several gaps - Ruby was missing `TINA4_CACHE_*`, `TINA4_QUEUE_*`, `TINA4_KAFKA_*`, `TINA4_RABBITMQ_*`, `TINA4_MONGO_*`, `TINA4_WS_BACKPLANE`, and the entire `TINA4_SESSION_VALKEY_*` block.

### Other fixes

- **Ruby `lib/tina4/ai.rb`** - subprocess output is now force-encoded to UTF-8 before `String#strip`, fixing `Encoding::CompatibilityError` that crashed 4 ai specs on systems with non-ASCII pip output.
- **Node `test/serverParity.test.ts`** - sets `TINA4_OVERRIDE_CLIENT=true` so `start()` actually runs, plus emits the `N passed, M failed` summary line the runner expects. The test was effectively a no-op before; now it's recorded properly.

### Genuine gaps surfaced by the parity audit (follow-up, not blocking 3.12.3)

The chapter 33 audit flagged env vars Python documents that no other framework actually reads - Ruby/PHP/Node lack `TINA4_OPEN_BROWSER`, `TINA4_DEV_POLL_INTERVAL`, `TINA4_PUBLIC_DIR`, `TINA4_TOKEN_EXPIRES_IN` alias, plus a few framework-specific gaps (Ruby has no Mongo session backend; Node `TINA4_CSRF` defaults to `false` vs Python's `true`). Tracked for a future patch.

### Upgrade path

| Symptom | Fix |
|---|---|
| Ruby: `NoMethodError: undefined method 'has' for Tina4::Container` | Replace `has(:key)` with `has?(:key)` |
| PHP: `BadMethodCallException` calling `$cache->lookup(...)` | Use the middleware: `[ResponseCache::class, 'beforeCache']` / `[..., 'afterCache']`. Or call `_internalLookup` if you really need direct access (test code only - `@internal`). |
| Ruby: `NoMethodError: undefined method 'get' for ResponseCache instance` | Use `Tina4.cache_stats` / `Tina4.clear_cache` for stats. Lookup goes through the middleware. |

No `.env` changes from 3.12.2.

## v3.12.2 (2026-05-05)

Quality-of-life patch. Two related portability fixes - no breaking changes from 3.12.1.

### Firebird URL auto-detect

Firebird is the awkward one in the stack. Every other engine has a server-side database name (`postgres://host:port/dbname`), but Firebird wants either an absolute file path on the server, a Windows drive-letter path, or an alias. The classic URI form needs a double slash to keep the leading `/` of an absolute path through the URL parser - unintuitive to anyone used to the way postgres / mysql / mssql encode the database name.

The framework now accepts five equivalent forms and normalises all of them transparently:

| URL path you write | Resolved Firebird identifier |
|---|---|
| `//abs/path/db.fdb`   (classic double-slash) | `/abs/path/db.fdb` |
| `/abs/path/db.fdb`    (single-slash, intuitive) | `/abs/path/db.fdb` |
| `/C:/Data/db.fdb`     (Windows drive letter) | `C:/Data/db.fdb` |
| `/C%3A/Data/db.fdb`   (URL-encoded colon) | `C:/Data/db.fdb` |
| `/employee`           (Firebird alias) | `employee` |

For ops setups that keep server URL and DB location in separate config layers - or for Windows backslash paths that fight URL encoding - set `TINA4_DATABASE_FIREBIRD_PATH`. The env override wins over whatever path is in the URL.

```bash
TINA4_DATABASE_FIREBIRD_PATH=C:\firebird\data\app.fdb
TINA4_DATABASE_URL=firebird://SYSDBA:masterkey@localhost:3050/ignored
```

Shipped to all 4 frameworks. 11 regression tests per framework (8 unit + 3 live).

### Bug fix specific to PHP - `mysqli` localhost+port quirk

PHP's `mysqli` has a long-standing quirk where `host == "localhost"` triggers a Unix socket lookup and IGNORES the port argument entirely. Connecting to `mysql://...:53306` against a Docker container fails with "No such file or directory" - `mysqli` is hunting for `/tmp/mysql.sock` instead of opening a TCP connection. `MySQLAdapter::rewriteHostForTcp()` now rewrites `localhost` to `127.0.0.1` when a non-zero port is specified, forcing the TCP code path. Bare `mysql:///db` (no port) is preserved so existing socket-based setups keep working.

### Other fixes

- **chore(python):** `pyproject.toml` had drifted to `3.10.41` while `__init__.py` read `3.12.1`. Synced both to 3.12.2 so `uv build` and runtime introspection now agree.
- **chore(claude.md, all 4):** stale framework version banners in `CLAUDE.md` headers updated.

No `.env` changes from 3.12.1, no migration needed. Existing 3.12.1 installs upgrade by changing one version number.

## v3.12.1 (2026-05-04)

CI-only patch - no framework code changes from 3.12.0.

- **fix(ci, all 4):** every `publish.yml` workflow now declares `permissions: contents: write` on the publish job. Without this, `softprops/action-gh-release` 403'd against the default `GITHUB_TOKEN` on repos whose default Workflow permissions setting was read-only (Ruby and Node hit this every release; PHP and Python worked by luck of repo settings). The explicit declaration makes the workflow self-sufficient.
- **chore(ci):** bumped `softprops/action-gh-release` from `@v1` (unmaintained) to `@v2`.

No `.env` changes, no API changes, no migration needed. Existing 3.12.0 installs can upgrade without touching anything else.

The version-bump itself is the test: a successful 3.12.1 release proves the workflow fix works on Ruby and Node where 3.12.0 needed manual `gh release create`.

## v3.12.0 (2026-05-04)

> **Warning: Breaking change - read before upgrading.** Every framework env var now uses the `TINA4_` prefix. Existing `.env` files set with `DATABASE_URL`, `SECRET`, `SMTP_HOST`, `HOST_NAME`, etc. will cause the framework to refuse to boot. Run `tina4 env --migrate` to rewrite, or follow the rename table below.

### Why this release

Tina4's env vars had grown inconsistent. Some had the `TINA4_` prefix (`TINA4_DEBUG`, `TINA4_LOCALE`, `TINA4_CACHE_BACKEND`), others didn't (`DATABASE_URL`, `SECRET`, `SMTP_HOST`). Newcomers had to guess which convention applied to which feature. Existing tools and PaaS dashboards collided with un-prefixed names like `SECRET` and `API_KEY` that other libraries also read. Documentation drifted - 91 env-var names appeared in the docs that didn't exist in any framework, and 22 framework-specific env vars in the code didn't match the names users were told to set.

This release closes all three gaps with a single hard rename. No deprecation period, no fallback chain. The framework refuses to boot if it detects a legacy name in the environment, prints a list of every var to rename, and tells you which command to run.

### What changed

- **22 env vars renamed** to `TINA4_*` form. See the migration table below.
- **`tina4 env --migrate` CLI** added to all four frameworks. Reads your `.env`, rewrites it in place, leaves a `.env.bak` backup, prints a diff. Idempotent.
- **Boot-time guard** scans `os.environ` (or the language equivalent) for the 22 legacy names. If any are present, prints the rename map and exits with code 2. Bypass with `TINA4_ALLOW_LEGACY_ENV=true` for migration scripts that need both names set during transition.
- **All 4 framework books rewritten.** Chapter 33 (Environment Variables) is now a clean canonical list - every var prefixed, descriptions current, legacy names removed.
- **Doc-vs-code drift closed.** Of the 91 stale env vars previously documented, 61 were renames (corrected), 32 were never implemented (removed). The `audit-links.py` CI gate stays at 0 broken links / 0 broken anchors.
- **Frond bundle** rebuilt at v2.1.3 - `frond.min.js` footer now shows the version explicitly so users can verify what they have.

### Bug fixes shipped alongside the rename

- **#38 PostgreSQL UUID-PK transaction abort** - the post-INSERT `lastval()` probe is now wrapped in a SAVEPOINT, so UUID-PK INSERTs no longer poison the outer transaction with `InFailedSqlTransaction`. Live regression test against PostgreSQL 16. (Affects all 4 frameworks where the PG adapter does this probe.)
- **#39 Landing page + template auto-routing** -
  - Auto-routing now scans `src/templates/pages/` only. Partials, layouts, base.twig, errors/, components/, and `_*` files never auto-serve from a URL.
  - `TINA4_TEMPLATE_ROUTING=off` kills the feature entirely.
  - `src/public/index.html` auto-serves at `/` (and `/foo/` serves `src/public/foo/index.html`) - SPA hosting Just Works.
  - The framework landing page only renders when `TINA4_DEBUG=true`. Production never shows it; framework version, dev-admin link, and gallery don't leak to real users.
  - The malformed `HTTP/1.1 404 OK` status line is fixed - every status code now uses its canonical RFC 7231/9110 reason phrase.
- **#37 frond.form.submit redirect handling** - verified shipped at v2.1.x; `xhr.responseURL` change triggers `window.location` navigation correctly.
- **#36 Session file handler** - re-verified safeguards (lazy save, WebSocket skip, probabilistic GC, new-and-empty skip) all still in place.

### Migration - every renamed var

| Legacy name | New name |
|---|---|
| `DATABASE_URL` | `TINA4_DATABASE_URL` |
| `DATABASE_USERNAME` | `TINA4_DATABASE_USERNAME` |
| `DATABASE_PASSWORD` | `TINA4_DATABASE_PASSWORD` |
| `DB_URL` | `TINA4_DATABASE_URL` (alias dropped) |
| `SECRET` | `TINA4_SECRET` |
| `API_KEY` | `TINA4_API_KEY` |
| `JWT_ALGORITHM` | `TINA4_JWT_ALGORITHM` |
| `SMTP_HOST` | `TINA4_MAIL_HOST` |
| `SMTP_PORT` | `TINA4_MAIL_PORT` |
| `SMTP_USERNAME` | `TINA4_MAIL_USERNAME` |
| `SMTP_PASSWORD` | `TINA4_MAIL_PASSWORD` |
| `SMTP_FROM` | `TINA4_MAIL_FROM` |
| `SMTP_FROM_NAME` | `TINA4_MAIL_FROM_NAME` |
| `IMAP_HOST` | `TINA4_MAIL_IMAP_HOST` |
| `IMAP_PORT` | `TINA4_MAIL_IMAP_PORT` |
| `IMAP_USER` | `TINA4_MAIL_IMAP_USERNAME` |
| `IMAP_PASS` | `TINA4_MAIL_IMAP_PASSWORD` |
| `HOST_NAME` | `TINA4_HOST_NAME` |
| `SWAGGER_TITLE` | `TINA4_SWAGGER_TITLE` |
| `SWAGGER_DESCRIPTION` | `TINA4_SWAGGER_DESCRIPTION` |
| `SWAGGER_VERSION` | `TINA4_SWAGGER_VERSION` |
| `ORM_PLURAL_TABLE_NAMES` | `TINA4_ORM_PLURAL_TABLE_NAMES` |

### Names that stay un-prefixed (not framework config)

`PORT`, `HOST`, `NODE_ENV`, `RACK_ENV`, `RUBY_ENV`, `ENVIRONMENT` - these are runtime / PaaS conventions, not framework config. Heroku, Railway, Vercel, and friends set them; we keep reading them.

### How to upgrade

1. **Backup your `.env`:** `cp .env .env.bak.pre-v3.12`
2. **Run the migration:** `tina4 env --migrate` - rewrites your `.env` in place.
3. **Update PaaS dashboards:** Heroku, Railway, Vercel, Render, Fly.io etc - rename the same vars in your provider's env-var UI.
4. **Restart your app.** The boot guard verifies nothing legacy remains.

If your app uses `SECRET`, `DATABASE_URL`, or any other listed name in places besides `.env` (e.g. your CI pipeline's `env:` blocks), update those too - the boot guard checks `os.environ`, not just `.env`.

### Parity

All 4 frameworks aligned at **3.12.0**:
- tina4-python 3.11.32 -> 3.12.0
- tina4-php 3.11.32 -> 3.12.0
- tina4-ruby 3.11.32 -> 3.12.0
- tina4-nodejs 3.11.32 -> 3.12.0

Coordinated release across PyPI, Packagist, RubyGems, npm.

## v3.11.32 (2026-04-25)

**Critical fix - pool + transactions are now actually atomic.** Plus a coordinated parity release that aligns all four frameworks at the same version after months of drift.

Before this release, creating a `Database` with `pool > 0` silently broke transactions. The pool's round-robin checkout rotated to a different adapter on every call - so `start_transaction()` pinned its flag on adapter A, the executes autocommitted on adapters B and C, and the final `commit()` / `rollback()` landed on adapter D, which had nothing to commit. Result: `rollback()` was a no-op, writes leaked through, and no error or log surfaced the problem.

The fix pins one adapter to the calling context for the lifetime of a transaction. Each language uses its own primitive:

- **Python** - `threading.local()` on the `Database` instance
- **Ruby** - `Thread.current[:tina4_pinned_adapter_<obj_id>]`
- **Node.js** - `AsyncLocalStorage` from `node:async_hooks` (async-safe across overlapping awaits)
- **PHP** - per-instance property (PHP-FPM is one process per request; threading.local is unnecessary)

While pinned, every database call routes to the same adapter. `commit()` and `rollback()` release the pin so subsequent calls round-robin again.

- **fix (database / all 4):** adapter pinning across transaction scope in `Database._get_adapter()` (and language equivalents). Every backend is affected - SQLite, PostgreSQL, MySQL, MSSQL, Firebird. Firebird exposed it loudest because of its honest "commit-empty-txn is a real no-op" semantics; the others mostly hid the bug behind eager autocommits but still lost rollback atomicity.
- **tests (all 4):** new regression suite - three INSERTs followed by `rollback()` under `pool=4` now leaves zero rows (was leaking three). Three INSERTs followed by `commit()` persists exactly three. Pin-release after commit/rollback verified. `pool=0` regression test added so single-connection mode stays unaffected.
- **parity / version alignment:** all 4 frameworks bumped to 3.11.32 - closes the cross-framework version drift that had built up (PHP at 3.11.31, Python at 3.11.24, Ruby and Node at 3.11.19). A single coordinated release across all four registries: PyPI, Packagist, RubyGems, npm.

**No migration needed.** Code using `pool=0` (the default for every adapter except where explicitly raised) is unaffected. Code using `pool>0` will now actually honour transactions instead of silently dropping them.

**If you've been seeing intermittent "writes vanished" or "rollback didn't help" reports on a pooled `Database`, this release is the cause and the cure.**


## v3.11.13 (2026-04-16)

Issue-driven release. Everything reported in the open tina4-book issues either was fixed in this version or is already fixed in 3.11.12; this release consolidates the remaining bits and corrects documentation drift.

- **feat (router / all 4):** Explicit typed-parameter system shared across Python, PHP, Ruby, Node. Adds `alpha`, `alnum`, `slug`, `uuid`, and explicit `string` types in addition to the existing `int`/`integer`, `float`/`number`, `path`/`.*`. **Unknown type names now throw at registration** - `{name:str}`, `{id:inetger}`, etc. raise with a clear message listing the valid types instead of silently falling through to the default matcher. Fixes tina4-book#125. +45 new tests across the four suites.
- **fix (gallery / python+php+ruby):** Gallery Try-It / View buttons now open the deployed example in a new tab (`window.open(url, '_blank')`) instead of navigating away from the gallery home. Fixes tina4-book#115.
- **fix (ruby gemspec):** `sqlite3` promoted from `add_development_dependency` to `add_dependency`. Matches the "zero-config SQLite on first run" promise. Fixes tina4-book#100.
- **docs (tina4-book):** PHP Chapter 2 updated - correct port (7145), `->noAuth()` on write-method examples, and an explicit callout explaining the secure-by-default policy for POST/PUT/PATCH/DELETE. Addresses tina4-book#87, #94, #123.
- **docs (tina4-book):** Python `@template` decorator ordering corrected (must sit BELOW the route decorator) in book chapters 04 and 10; Python `request->query` vs `request->params` distinction in PHP chapter 1.
- **tests (python):** Session-handler tests updated to reflect the real default TTL of 3600s (were stale at 1800s).
- **verified already fixed in earlier 3.11.x releases** - closed comments posted on all of these:
<div v-pre>

  - #79 dotted numeric index (`{{ items.0.name }}`)
  - #80 `truncate` filter
  - #82 `{{ parent() }}` / `{{ super() }}` across all 4 frameworks
  - #83 Ruby dashboard - WEBrick is runtime dep
  - #89 `load_dotenv` rename, `DatabaseResult` methods, SQLite WAL locking
  - #91 Ruby `request.params` symbol + string keys via `IndifferentHash`
  - #93 Ruby `/docs/*` and bare `/*` wildcard routes
  - #97 Frond ternary operator
- **parity:** All 4 frameworks bumped to 3.11.13.

</div>


## v3.11.12 (2026-04-16)

**Breaking:** `sqlite:///X` URLs are now relative to the project root (cwd), matching the documented convention. For absolute paths use four slashes (`sqlite:////abs/path.db`) or a Windows drive letter (`sqlite:///C:/Users/app.db`).

Before this release, `TINA4_DATABASE_URL=sqlite:///data/app.db` was interpreted differently by every framework. Python/Node/Ruby tried to open `/data/app.db` (absolute) which crashed on macOS with `OSError: [Errno 30] Read-only file system: '/data'`. PHP did the same under the hood. All four frameworks now agree: three slashes = relative, four slashes = absolute.

- **fix (all 4):** `sqlite:///X` resolves under cwd; parent directory auto-created only when inside cwd. Absolute paths are trusted and never mkdir'd at root.
- **fix (python):** `_ensure_folders` no longer creates a bogus `src/migrations/` directory. The migration runner always looks at `migrations/` at the project root - there is only one correct location.
- **parity (php, ruby, node):** Same `sqlite:///X` parsing as Python. Dedicated `resolve_path` / `resolveSqlitePath` helpers in each framework so adapters consistently handle `:memory:`, `./` forms, Windows drive letters.
- **tests:** 9 new Python tests in `TestSQLiteConnectionPath` + `TestProjectFolders`. 4 new PHP tests in `DatabaseUrlTest` covering relative/absolute/Windows/bruce-regression. 6 new Ruby specs in `database_drivers_spec.rb :: SqliteDriver.resolve_path`. Node URL tests expanded in `database.test.ts` with the full relative/absolute/Windows/:memory: matrix.
- **parity:** All 4 frameworks bumped to 3.11.12.

**Migration note:** If your `.env` has `TINA4_DATABASE_URL=sqlite:///data/app.db`, it will now create `./data/app.db` in the project root (which is what most users actually want). If you genuinely want an absolute path, change to `sqlite:////data/app.db` (four slashes).


## v3.11.11 (2026-04-16)

- **fix (python ORM):** `Field.validate` no longer re-coerces values that are already the correct type. Previously, any PostgreSQL/MSSQL read of a row containing a `DateTimeField` crashed because `datetime(datetime_instance)` raises `TypeError`. The fix accepts native driver types (`datetime`, `bytes`, `int`, `bool`, `float`, `str`) without re-wrapping, and parses ISO-8601 strings into `datetime` for SQLite. See `tina4-python/plan/orm-field-validate-native-types.md`.
- **fix (python ORM):** `BooleanField` vs `IntegerField` ordering handled explicitly. `BooleanField(1)` still coerces to `True`, `IntegerField(True)` still coerces to `1`; no regression for either direction (bool is a subclass of int in Python).
- **tests (python):** 10 new `TestFieldsNativeTypes` cases covering datetime/int/bool/float/bytes/string/ForeignKey round-trips.
- **tests (parity):** Regression-guard "datetime round-trip on read path" tests added to PHP (`ORMV3Test`), Ruby (`orm_spec`) and Node.js (`orm.test.ts`) so an equivalent bug can't creep in there later.
- **parity:** All 4 frameworks bumped to 3.11.11.


## v3.11.10 (2026-04-15)

- **fix (php):** Hot-reload loop - DevAdmin's polling fallback used `mt=0` as the baseline, so the first poll after every page load triggered `location.reload()`, which reset `mt=0` again. Loop now initialises the baseline on the first poll.
- **fix (php):** Reload sentinel removed - PHP was the only framework recursively walking `src/` and touching `src/.reload_sentinel` on every reload POST. The sentinel lived inside the Rust CLI's watched tree and fed back into the watcher, triggering a second loop. Replaced with the same in-memory counter used by Python/Ruby/Node.
- **fix (php):** Polling no longer starts more than once when the WebSocket reconnect retry budget is exhausted (added a `pollStarted` guard).
- **feat (parity):** `GET /__dev/api/queue/topics` and `GET /__dev/api/queue/dead-letters` added to PHP, Ruby and Node (previously only in Python). PHP queue endpoints now read from the real `Tina4\Queue` backend instead of returning stubs.
- **feat (devadmin):** Refreshed `tina4-dev-admin.js` bundle (87.8 KB) across all 4 frameworks - adds the topic selector dropdown, inline payload expand/copy, and corrected version display.
- **tests:** 4-way parity tests for hot-reload: mtime starts at 0, POST /__dev/api/reload bumps the counter, no sentinel file is written to disk, mtime is monotonic across successive reloads. Mirrored in `tina4-php/tests/DevAdminTest.php`, `tina4-python/tests/test_dev_admin.py`, `tina4-ruby/spec/dev_admin_spec.rb`, `tina4-nodejs/test/devAdmin.test.ts`.
- **parity:** All 4 frameworks bumped to 3.11.10.


## v3.11.9 (2026-04-15)

Catch-up release covering v3.11.0 -> v3.11.9 across all 4 frameworks.

- **feat (websocket):** Full WebSocket parity across Python/PHP/Node/Ruby - `get_client_rooms()` / `getClientRooms()`, `route()` usable as decorator or direct handler registration, matching room/broadcast semantics, plus new parity tests on all 4.
- **feat (graphql):** Input validation and field-level `@auth` directives with context threading.
- **feat (graphql):** Auto-discovery of schemas; removed legacy DevAdmin HTML/JS in favour of the new UI.
- **feat (devadmin - Python):** Queue tab with topic selector, dead-letter listing and replay endpoints, inline payload expand/copy, version display.
- **feat (cli):** Rust CLI now owns file watching - frameworks receive `POST /__dev/api/reload` and internal watchers are disabled when launched by the Rust CLI (`--managed`).
- **fix (cli):** `parseFlags` / `parse_flags` / `parseCliArgs` no longer swallow `host:port` or positional args after boolean flags.
- **fix (scss):** SCSS recompilation loop fixed; output path corrected to `src/public/css/` to match CLI and static serving.
- **fix (frond - Python):** Numeric dotted index for lists (`items.0.name`) now resolves correctly.
- **fix (router - Ruby):** Bare `/*` wildcard capture exposed under `"*"` key for parity.
- **fix (orm - PHP):** Three data-sync bugs fixed: `load()` double-fill, `getPrimaryKeyValue`, `save()` ID sync.
- **fix (graphql):** `from_orm` / `fromOrm` list resolver used `select(skip=)` instead of `all(offset=)`.
- **fix (metrics):** Windows backslash paths normalised to forward slashes.
- **fix (app - PHP):** No longer crashes on notices/deprecations in loaded files; `run()` now prints the banner when starting the server directly.
- **chore:** Example demo store ships with the repo; Windows-friendly setup; `.env.example` and setup scripts added.
- **parity:** All 4 frameworks bumped to 3.11.9. PHP aligned to the 3.x tag scheme on `v3`.

## v3.10.99 (2026-04-12)

- **breaking:** `auto_map` now defaults to `True` - ORM models automatically map between camelCase properties and snake_case DB columns. Set `auto_map = False` on your model to restore the old behaviour.
- **feat:** `to_dict(case=)` parameter - pass `case='camel'` to get camelCase keys (for JSON APIs) or `case='snake'` (default) for snake_case keys matching DB columns.
<div v-pre>

- **feat:** Frond `replace` filter now accepts dict args - `{{ v|replace({"T": " ", "-": "/"}) }}` for multiple substitutions in one call.
- **feat:** `background(callback, interval)` - register periodic tasks that run cooperatively in the asyncio event loop. Replaces `threading.Thread` for background work.
- **feat:** Background task protection - sync callbacks run in a `ThreadPoolExecutor` via `run_in_executor()` with `asyncio.wait_for()` timeout, preventing blocking functions from freezing the server.
- **feat:** Docker image now bundles the example store demo - `docker run tina4stack/tina4-python:v3` starts a working app out of the box.
- **fix:** Cart nav badge now updates reactively on quantity change and item removal (tina4-js `signal`/`computed`/`effect`).
- **fix:** Non-blocking queue consumer - `process_orders()` uses `queue.pop()` (single job per tick) instead of blocking `queue.consume()`.
- **tests:** 6 new parity tests covering `to_dict(case=)`, `auto_map` default, `replace` filter (dict + positional), and `background()` registration.
- **parity:** All features shipped identically across Python, PHP, Ruby, Node.js. 2,304 tests passing.

</div>

## v3.10.97 (2026-04-11)

- **fix:** frond.form.submit redirect handling - XHR transparently follows 3xx redirects, so the callback received redirected HTML instead of navigating. Fixed by comparing `xhr.responseURL` with the original URL and calling `window.location.href` when a redirect is detected.
- **fix:** Currency placeholder - locale files now default to `$` for the currency symbol.
- **fix:** Admin sidebar alignment - widened sidebar to 220px with `min-width` to prevent label truncation.
- **fix:** Admin table overflow - added `min-width: 0` and `overflow-x: auto` on `.admin-main` to prevent content clipping.
- **fix:** Order detail template - corrected variable names (`items` instead of `order.items`, `item.name` instead of `item.product_name`) and used `.records` from `DatabaseResult`.
- **fix:** Status badges - dashboard recent orders and order list now show colored badge pills with translated status labels (pending, processing, shipped, delivered, cancelled).
- **fix:** Date formatting - admin order/dashboard dates trimmed to `YYYY-MM-DD HH:MM:SS` instead of raw ISO with microseconds.
- **feat:** Cart quantity spinner - reactive qty controls using tina4-js signals, computed values, and effects.
- **feat:** Multi-currency pricing - forex conversion via Api client (frankfurter.app), `|currency` template filter, currency selector in navbar.
- **feat:** MCP server tools - `check_stock`, `low_stock_report`, `search_products` tools and `store://categories`, `store://inventory-summary` resources for AI assistant integration.
- **feat:** Contact form - built with `HtmlElement` and `add_html_helpers()` to demonstrate programmatic HTML generation.
- **feat:** ORM named scopes - `Product.scope("active")`, `Product.scope("low_stock")`, `Product.scope("expensive")`.
- **feat:** Database connection pooling - `Database("sqlite:data/store.db", pool=4)`.
- **feat:** Inline tests - `@tests` decorators on `cart_service.py` and `forex_service.py`.
- **feat:** Language toggle - flag button (FR/GB) in navbar to switch locale.
- **feat:** Helpdesk chat persistence - chat messages stored in DB, history API (`GET /api/chat/history`).
- **dep:** Updated frond.min.js to v2.1.2 across all 4 frameworks (Python, PHP, Ruby, Node.js).
- **parity:** All 4 frameworks bumped to 3.10.97.

## v3.10.93 (2026-04-11)

<div v-pre>

- **fix:** Frond array/dict literal support - `{% set items = ["a", "b"] %}` and `{% set obj = {"k": "v"} %}` now parse correctly.
- **fix:** Frond bracket depth tracking in `_find_outside_quotes()` and `_split_outside_quotes()` - expressions like `arr[i % 2]` no longer treated as top-level arithmetic.
- **fix:** Frond subscript expression evaluation - bracket content uses `_eval_expr()` instead of `_resolve()`, enabling `arr[loop.index0 % 2]`.
- **fix:** Frond slice with variable bounds - `items[start:end]` evaluates bounds through `_eval_expr()`.
- **fix:** Frond multiline `{% set %}` - `_SET_RE` regex now uses `re.DOTALL` flag.
- **docs:** Developer skills updated - Metrics Dashboard guidance, Frond Template Parity rules, `@noauth` security warnings.
- **demo:** Complete e-commerce store example (`example/store/`) with GraphQL search, SSE, WebSocket, Queue, Events, 13 test files.
- **parity:** All Frond fixes applied identically across Python, PHP, Ruby, Node.js. 2,304 tests passing.

</div>

## v3.10.92 (2026-04-10)

- **refactor:** Extract `RateLimiter` from `core/middleware.py` into its own file `core/rate_limiter.py`. The old import path still works via re-export.
- **feat:** Add `RateLimiterMiddleware` wrapper class with `before_rate_limit()` and `check()` static methods.
- **breaking:** Rename `ErrorOverlay` methods - `render()` -> `render_error_overlay()`, `render_production()` -> `render_production_error()`, `debug_mode()` -> `is_debug_mode()`.
- **feat:** Add `Server.start()` and `Server.stop()` for cross-framework parity.
- **feat:** Add `DatabaseResult.size()`, `to_array()`, `to_json()`, `to_csv()` methods.
- **feat:** Add `ScssCompiler` class with `compile()`, `compile_file()`, `add_import_path()`, `set_variable()`.
- **feat:** Add `DevAdmin.unresolved_count()`, `clear_all()`, `reset()`, `capture()` (5-param), `register()`.
- **fix:** GraphQL test API - update `add_query()` calls to use positional args (args, return_type, resolver).
- **parity:** 44/44 cross-framework features green. 2,263 tests passing.

## v3.10.91 (2026-04-10)

- **feat:** Add parity methods - `GraphQLType.parse()`, `Response.send()` params, `QueryBuilder.from_()`, `Debug.configure()`.
- **breaking:** Remove alias methods `from_`, `configure`, `template` - use canonical names only (`from_table`, etc.).

## v3.10.90 (2026-04-09)

<div v-pre>

- **docs:** Chapter 4 (Templates) - new "Dumping Values for Debugging" section covering both `{{ x|dump }}` and `{{ dump(x) }}` forms, their shared `<pre>`-wrapped output, and the `TINA4_DEBUG=true` production gate. Filter table entry updated to reference the new section.
- **docs:** `plan/parity/parity-template.md` updated with a cross-framework dump helper comparison table and marks dump parity as confirmed across all 4 frameworks at v3.10.89.
- **chore:** Version sync release - brings all 4 frameworks to the same patch version (3.10.90) so downstream users can upgrade PHP/Python/Ruby/Node.js in lockstep without hunting version mismatches.

</div>

## v3.10.89 (2026-04-09)

<div v-pre>

- **feat:** `{{ dump(value) }}` global function form added to Frond alongside the existing `{{ value|dump }}` filter. Both call a single `_render_dump()` helper and produce identical output.
- **security:** Dump is now **gated on `TINA4_DEBUG=true`**. In production (env var unset or `false`) both the filter and function silently return an empty string. This prevents accidental leaks of internal state, object shapes, and sensitive values into rendered HTML when a developer leaves a `{{ dump(x) }}` call in a template.
- **refactor:** Dump output is wrapped in `<pre>` and HTML-escaped via a single shared code path.
- **test:** 6 new tests in `test_frond.py` (`TestDump`) covering debug-mode output, production silencing, unset-env default-to-production, function/filter parity, and circular references.

</div>

## v3.10.86 (2026-04-09)

- **feat:** `ForeignKeyField` is now a proper `Field` subclass that auto-wires both sides of the relationship. Declaring `author_id = ForeignKeyField(to=Author)` injects `belongs_to` on the declaring model and `has_many` on the referenced model via `ORMMeta` - no manual descriptor calls required. Override the has-many name with `related_name=`.
- **feat:** Cross-framework parity - same FK auto-wiring semantics now available in PHP (`$foreignKeys`), Ruby (`foreign_key_field`), and Node.js (`type: "foreignKey"`)
- **fix:** `@orm_bind(db)` no longer nulls the decorated class - returns a pass-through decorator
- **fix:** `Auth.get_token`/`valid_token`/`get_payload`/`refresh_token`/`authenticate_request` can now be called on the class (e.g. `Auth.get_token(payload)`) or on an instance via the `_DualMethod` descriptor
- **fix:** `SQLiteAdapter` uses a class-level `threading.Lock` + `PRAGMA busy_timeout = 30000` + `timeout=30` on connect to eliminate `SQLITE_BUSY` deadlocks in the dev server under concurrent writes
- **docs:** Chapter 6 (ORM) updated with a new "ForeignKeyField - Auto-Wired Relationships" section

## v3.10.85 (2026-04-09)

- **refactor:** Split queue adapters into separate files - `queue/rabbitmq_backend.py`, `queue/kafka_backend.py`, `queue/mongo_backend.py` (one class per file, aligning with PHP/Node/Ruby architecture)
- **fix:** Updated remaining tests to use bool `valid_token()` + `get_payload()` pattern

## v3.10.84 (2026-04-09)

- **fix:** Router/middleware was setting `request.user` / `request.auth` / auth payload to `true` (boolean) instead of the actual JWT payload dict after `validToken()` was changed to return bool - any code reading `request.user["sub"]` etc. would have failed silently or crashed
- **fix:** CSRF middleware was not correctly rejecting invalid tokens (nil check on bool result always passed)
- **fix:** `AuthMiddleware.before_request` called `get_payload` incorrectly - would TypeError at runtime on valid token
- **add:** Headless routing auth payload integration tests to prevent regression

## v3.10.83 (2026-04-08)

- **fix:** prevent orphaned session files on WebSocket and anonymous requests (#36)
- **feat:** WebSocket rooms - `join_room`, `leave_room`, `broadcast_to_room`, `room_count`, `get_room_connections`
- **feat:** queue signature parity - instance-scoped `push`/`pop`/`retry`, no topic params on public methods

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js


## Version History

Tina4 Python follows semantic versioning. The major version (3) marks the ground-up rewrite from v2. Minor versions (3.1, 3.2, ...) introduce features. Patch versions fix bugs and polish edges.

Every release ships through PyPI. Upgrade with:

```bash
uv add tina4-python@latest

# or with pip

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

pip install --upgrade tina4-python
```

Check your current version:

```python
import tina4_python
print(tina4_python.__version__)
```

---

## v3.10.68 (2026-04-03) - Full Parity Release
- **100% API parity** across Python, PHP, Ruby, Node.js - 30+ issues fixed
- **ORM:** save() returns self/false, all/select/where return arrays, toDict/toAssoc standardized, scope() registers reusable method, where()/all() on Node, count() on PHP
- **Auth:** expires_in in minutes, PBKDF2 260k iterations, env TINA4_SECRET fallback, API key fallback in authenticateRequest
- **Session:** dual-mode flash(), get_flash/getFlash, cookieHeader on all, getSessionId on Node, save() public on Node
- **Database:** execute() returns bool/DatabaseResult for RETURNING, get_last_id/get_error on all, getColumns on PHP, cacheStats on Node
- **Request/Response:** Node files as dict, Python query property, cookies on PHP/Node, contentType on Node, xml() on PHP/Node, Ruby callable response
- **Queue:** consume() poll_interval (long-running generator with built-in sleep)
- **WebSocket:** event naming standardized (open/message/close/error), connection ip/headers/params, Python on() string API
- **GraphQL:** schema_sdl()/schemaSdl() and introspect() on all 4
- **WSDL:** Node.js zero-dep DOM parser (replaced regex)
- **Events:** emitAsync()/emit_async() on all 4
- **i18n:** zero-dep YAML locale file support on Python/PHP/Node (Ruby already had it)

## v3.10.67 (2026-04-03)
- **BREAKING: request.files content is now raw bytes** - previously base64-encoded; remove any `base64.b64decode()` calls when saving uploaded files. Write `file["content"]` directly to disk
- **load() is now an instance method** - `model.load(sql, params)` calls selectOne internally, populates the instance, returns `True`/`False`. Use `Model.find(id)` for PK lookups
- **api.upload()** added to tina4-js - sends FormData with Bearer token auth for multipart file uploads
- **ORM CLAUDE.md rewrite** - all method stubs now match actual API signatures
- **tina4-js skill** - critical input binding warning, routing docs (`{param}` not `:param`), file upload pattern

## v3.10.66 (2026-04-03)
- **Metrics file detail fix** - clicking bubbles in framework scanning mode now resolves paths correctly via scan root tracking

## v3.10.65 (2026-04-03)
- **Metrics 3-stage test detection** - filename, path, and content matching
- **Metrics framework mode** - scans framework source with correct relative paths
- **tina4 console** - interactive REPL with framework loaded
- **tina4 env** - interactive environment configuration
- **Brand** - "TINA4 - The Intelligent Native Application 4ramework"
- **Quick references** - 36 sections, DotEnv API documented
- **37 chapters** - 7 new (Events, Localization, Logging, API Client, WSDL/SOAP, DI Container, Service Runner)
- **MongoDB + ODBC adapters** across all 4 frameworks
- **Pagination standardized** - limit/offset primary, merged dual-key response
- **Port kill-and-take-over** on startup

---

## v3.10.60 (2026-04-03)
- **tina4 console** - interactive Python REPL with framework loaded (db, Router, ORM, Auth, Api, Log)
- **tina4 env** - interactive environment configuration (database, cache, session, queue, mail)
- **Brand update** - "TINA4 - The Intelligent Native Application 4ramework"
- **Quick reference** - 36 sections covering every framework feature
- **Chapter reshuffle** - 37 chapters, 7 new (Events, Localization, Logging, API Client, WSDL/SOAP, DI Container, Service Runner)
- **RouteGroup fix** - double prefix bug resolved
- **Port kill-and-take-over** - default port always reclaimed on startup
- **Metrics test detection** - expanded to check spec/, tests/, test/ directories
- **MongoDB adapter** (pymongo), **ODBC adapter** (pyodbc)
- **Pagination standardized** - limit/offset primary, merged dual-key response
- **9,138 tests** across all 4 frameworks

---

## v3.10.57 (2026-04-02)
- **MongoDB adapter** - `Database("mongodb://host:port/db")`, requires `pip install pymongo`
- **ODBC adapter** - parity with PHP/Ruby/Node
- **RouteGroup class** - `group.get()`/`group.post()` syntax matching PHP/Ruby/Node
- **Pagination standardized** - limit/offset primary, merged dual-key toPaginate() response
- **Test port at +1000** - user testing port (e.g. 8145) stable, no hot-reload
- **Dynamic version** - `__version__` read at runtime, no hardcoded constants
- **ORM TINA4_DATABASE_URL discovery** - auto-connect from env
- **Firebird path parsing** - preserves absolute paths
- **108 features at 100% parity**, 2,112 tests

---

## v3.10.54 (2026-04-02)
- **Auto AI dev port** - second listener on port+1 with no-reload when TINA4_DEBUG=true
- **TINA4_NO_RELOAD** env var + --no-reload CLI flag
- **Firebird path parsing** - preserve absolute paths
- **ORM TINA4_DATABASE_URL discovery** - auto-connect from env
- **SQLite transaction safety** - commit() no-op without transaction
- **QueryBuilder docs** - added to ORM chapter

---

## v3.10.48 - April 2, 2026

### Bug Fixes

**Production server explicit opt-in** - All frameworks now require an explicit `--production` flag to use production servers (Puma for Ruby, FrankenPHP for PHP, cluster mode for Node.js). Previously, production servers activated automatically when `TINA4_DEBUG=false`, which was surprising behaviour. Now `tina4 serve` always uses the dev server unless `--production` is passed.

**Python `--no-browser`** - The `run()` function now accepts `no_browser=True` and respects the `TINA4_NO_BROWSER` env var to prevent browser auto-opening on server start.

### Test Coverage

Python: 2,132. PHP: 1,992. Ruby: 2,387. Node.js: 2,546. Total: 9,057 tests, 0 failures.

---

## v3.10.46 - April 1, 2026

### Test Coverage

Massive test parity push across all 4 frameworks. CSRF middleware tests expanded to 29+ per framework. Dedicated test suites added for FakeData, Cache, DevMailbox, Static files, Metrics, CLI scaffolding, and all remaining gap areas. Python: 2,132 tests. PHP: 1,937. Ruby: 2,274. Node.js: 2,546. Total: 8,889 tests, 0 failures, 49 core areas with full parity.

---

## v3.10.45 - April 1, 2026

### Bug Fixes

**PHP CLI serve hijack** - When `index.php` calls `App::run()`, the CLI `serve` command now sets a `TINA4_CLI_SERVE` constant so `run()` returns early, letting the CLI manage the server lifecycle (port, debug mode, browser open). Previously, `index.php`'s `run()` would start its own server and block the CLI's serve logic.

---

## v3.10.44 - April 1, 2026

### New Features

**Database tab redesign** - The dev admin Database panel now uses a split-screen layout. Tables are listed on the left as a navigation sidebar with click-to-select highlighting. The query editor, toolbar, and results occupy the right panel. Results render immediately below the query box with no gap.

**Copy CSV / Copy JSON** - Two new buttons in the database toolbar copy query results to the clipboard. CSV uses proper comma-separated format with quoting; JSON copies a formatted array of objects.

**Paste data** - A new Paste button opens a modal where you can paste JSON arrays or CSV/tab-separated data. The tool auto-detects the format and generates INSERT statements. If a table is selected on the left, it targets that table. If no table is selected, it prompts for a name and generates a CREATE TABLE statement for new tables. If you paste SQL directly, it passes through to the query box unchanged.

**Multi-statement execution** - The query runner now handles multiple SQL statements separated by semicolons. CREATE TABLE + INSERT batches run in a single transaction with automatic rollback on error.

**Database badge on load** - The Database tab count badge now shows the table count immediately when the dev admin opens, without needing to click the tab first.

**Star wiggle animation** - The GitHub star button on the landing page uses an empty star (*) with a playful wiggle animation: 3-second delay on page load, then wiggles at random 3-18 second intervals.

### Bug Fixes

**Default port** - Python default port changed from 7145 to 7146 to avoid clashes when running multiple Tina4 frameworks (PHP=7145, Python=7146, Ruby=7147, Node=7148).

**SQLite LIMIT fix** - The SQLite adapter now checks if a query already contains a LIMIT clause before appending one, preventing double-LIMIT errors in the database browser.

**browseTable quote escaping** - Fixed broken onclick handlers for table names in the database panel. Now uses `addEventListener` instead of inline onclick with escaped quotes.

**Migration UP/DOWN separation** - Migration generator no longer puts DOWN SQL in the .sql file. UP SQL stays in the .sql file; DOWN SQL goes in the separate .down.sql file.

### Test Coverage

Major test expansion across all 4 frameworks - 8,107 total tests (up from ~5,200), with full parity across 49 core feature areas. New dedicated test suites added for FakeData, Cache, DevMailbox, Static files, Metrics, and CLI scaffolding.

Python: 2,132 tests passing (12 skipped).

---

## v3.10.40 - April 1, 2026

### Bug Fixes

**Dev overlay version check** - Fixed misleading "You are up to date" message when running a version ahead of what's published on PyPI (e.g. running v3.10.39 locally while PyPI still has v3.10.24). The overlay now shows a purple "ahead of PyPI" message. Also added a breaking changes warning (red banner with changelog link) when a major or minor version update is available, so developers know to check for breaking changes before upgrading.

---

## v3.10.39 - April 1, 2026

### Breaking Changes

This release aligns the Python framework with the other three Tina4 implementations. Two breaking changes affect existing code:

**`Auth.check_password()` parameter order reversed**

```python
# BEFORE (v3.10.38 and earlier)

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

Auth.check_password(hashed, password)

# AFTER (v3.10.39+)

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

Auth.check_password(password, hashed)  # password first - matches PHP, Ruby, Node.js
```

**`Router.all()` removed - use `get_routes()` or `list_routes()`**

```python
# BEFORE

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

routes = Router.all()

# AFTER

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

routes = Router.get_routes()   # or Router.list_routes()
```

### New Features

**`Auth.validate_api_key(provided, expected=None)`**

Compare API keys with constant-time comparison. Optionally pass `expected`; if omitted, reads `TINA4_API_KEY` (or `TINA4_API_KEY`) from environment.

```python
Auth.validate_api_key("sk-abc123")              # check against env
Auth.validate_api_key("sk-abc123", "sk-abc123") # check against explicit value
```

**`Auth.authenticate_request(headers)`**

One-call header authentication: checks Bearer JWT, Bearer API key, and Basic auth in order.

```python
payload = Auth.authenticate_request(request.headers)
# Returns: dict on success, None on failure

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

```

**`ORM.find_by_id(pk)` with `find()` and `load()` as aliases**

`find_by_id()` is now the explicit primary method. Both `find()` and `load()` continue to work as aliases, ensuring backward compatibility.

### Test Coverage

2,054 tests passing (up from 2,051 in v3.10.38).

---

## v3.10.38 - April 1, 2026

### Code Metrics & Bubble Chart

The dev dashboard (`/__dev`) now includes a **Code Metrics** tab with a PHPMetrics-style bubble chart visualization. Files are represented as animated bubbles - sized by lines of code, colored by maintainability index (green = healthy, red = needs attention). Click any bubble to drill down into per-function cyclomatic complexity.

The metrics engine uses Python's `ast` module for zero-dependency static analysis:
- Cyclomatic complexity per function
- Halstead volume and maintainability index
- Afferent/efferent coupling and instability
- Violation detection (CC > 20, LOC > 500, MI < 20)

File analysis is sorted worst-first so problem areas surface immediately. Results are cached for 60 seconds with mtime-based invalidation.

### AI Context Installer

The `tina4python ai` command now presents a simple numbered menu instead of unreliable auto-detection:

```
  1. Claude Code        CLAUDE.md              [installed]
  2. Cursor             .cursorules
  3. GitHub Copilot     copilot-instructions.md
  ...
  8. Install tina4-ai tools (requires Python)
```

Select by number (comma-separated or `all`). Already-installed tools show green. The generated context now includes the full skills table across all frameworks.

### Dashboard Improvements

- Full-width layout (removed 1400px max-width constraint)
- Sticky header and tab bar when scrolling
- Dashboard overlay fills the screen (was constrained to 1200px)

### Cleanup

- Removed `demo/` directories from all framework repos (demos live in documentation)
- Removed old `plan/` spec documents, replaced with `PARITY.md` and `TESTS.md`
- Removed junk sample files (broken migrations, test templates)
- Central parity matrix added to tina4-book

---

## v3.10.x - Previous Releases (March 28-31, 2026)

The v3.10 line carries the most patches of any minor release. It refined the Frond template engine, hardened the ORM, and completed cross-framework parity.

### Highlights

- **Singleton Frond engine** (v3.10.0). The template engine creates one instance and reuses it. Previous versions spawned a new engine per render call. This cut template rendering overhead across the board.

- **ORM `auto_map` flag** (v3.10.1). Models translate between `snake_case` and `camelCase` column names without manual mapping.

```python
from tina4_python import ORM

class UserProfile(ORM):
    auto_map = True  # created_at <-> createdAt handled for you
    table_name = "user_profiles"
```

- **Frond method calls and slice syntax** (v3.10.2). Templates gained the ability to call methods on objects and use Python slice syntax.

```html
<!-- Method calls on template variables -->
{{ user.get_display_name() }}

<!-- Slice syntax -->
{{ long_text[:100] }}...
```

- **Frond quote-aware operator matching** (v3.10.5). Operators inside quoted strings no longer break the parser. Before this fix, a string containing `>=` or `==` could confuse the template engine.

- **ORM auto-commit on write operations** (v3.10.13). Save, delete, and update operations commit their transactions without an explicit call.

- **`to_json` and `js_escape` filters** (v3.10.16). Templates gained filters for safe JSON embedding and JavaScript string escaping.

```html
<script>
  const config = {{ settings|to_json }};
  const message = "{{ user_input|js_escape }}";
</script>
```

- **`formTokenValue()` helper** (v3.10.23). CSRF tokens gained a dedicated template function for cleaner form markup.

```html
<form method="post">
  <input type="hidden" name="form_token" value="{{ formTokenValue() }}">
  <!-- form fields -->
</form>
```

- **MCP server and TestClient parity** (v3.10.32). The built-in MCP server and integration test client reached feature parity with the PHP and Ruby implementations.

<div v-pre>

- **Arithmetic in `{% set %}` and expressions** (v3.10.31). The template engine handles math operations inside assignment blocks.

</div>

```html
{% set total = price * quantity + shipping %}
```

### Bug Fixes

**Middleware not applied to routes (fixed in v3.10.1).** Middleware functions registered with `@middleware` were silently skipped during route dispatch. Routes ran without their middleware.

```python
# Before (broken) - middleware was silently skipped

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.middleware
def log_request(request, response):
    print(f"Request: {request.method} {request.url}")
    return request, response

@app.get("/users")
def get_users(request, response):
    # middleware never ran
    return response("OK")
```

```python
# After (fixed in v3.10.1) - middleware runs on every matching route

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.middleware
def log_request(request, response):
    print(f"Request: {request.method} {request.url}")
    return request, response

@app.get("/users")
def get_users(request, response):
    # log_request fires before this handler
    return response("OK")
```

**Wildcard route matching (fixed in v3.10.1).** Routes with wildcard segments failed to match incoming requests. The router now handles wildcards as expected.

**`Auth.valid_token` reference error (fixed in v3.10.9).** The internal server module referenced the wrong attribute name when calling token validation, which caused a `TypeError` on every secured request. The fix resolved the reference so `Auth.valid_token` works as expected.

**Frond `dict[variable_key]` access (fixed in v3.10.11).** Accessing a dictionary with a variable key inside templates raised a `KeyError`. The engine now resolves the variable before the lookup.

```html
<!-- Before (broken) - raised KeyError -->
{% set key = "name" %}
{{ user[key] }}

<!-- After (fixed in v3.10.11) - resolves variable, then looks up the key -->
{% set key = "name" %}
{{ user[key] }}  <!-- now outputs user["name"] -->
```

**ORM transaction errors on SQLite (fixed in v3.10.25).** Calling `save()` or `delete()` on an ORM model raised `"cannot commit -- no transaction is active"` on SQLite. The ORM now wraps every write operation in a proper `start_transaction` / `commit` / `rollback` cycle.

```python
# Before (broken on SQLite)

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

user = User()
user.name = "Alice"
user.save()  # raised "cannot commit -- no transaction is active"

# After (fixed in v3.10.25) - save() wraps in a transaction automatically

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

user = User()
user.name = "Alice"
user.save()  # works on all database engines including SQLite
```

**Stale templates in dev mode (fixed in v3.10.24).** The dev server cached rendered templates and did not pick up file changes until restart. Templates now reload on every request in debug mode.

**Macro output HTML escaping (fixed in v3.10.27).** Frond macros returned raw strings that the auto-escaper then double-escaped. Macro output now wraps in `SafeString` to preserve the intended HTML.

**DevReload performance (fixed in v3.10.28).** The live-reload watcher polled too fast and triggered duplicate reloads. It now uses a 3-second default interval with debouncing.

### Breaking Changes

**`@noauth` and `@secured` decorator behavior (v3.10.1).** Before this fix, these decorators did not update the route's auth flags. If you relied on the broken behavior (routes ignoring auth decorators), your routes will now enforce authentication as intended.

```python
# Before (broken) - decorator had no effect

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/public")
@noauth
def public_page(response):
    return response("Open to all")  # still required auth

# After (fixed in v3.10.1) - decorator works as expected

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/public")
@noauth
def public_page(response):
    return response("Open to all")  # accessible without token
```

---

## v3.9.x - QueryBuilder and Sessions (March 26-27, 2026)

### Features

**QueryBuilder with fluent API (v3.9.0).** SQL construction through method chaining, integrated with the ORM.

```python
from tina4_python import ORM

class User(ORM):
    table_name = "users"

# Fluent query through the ORM

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

admins = User.query() \
    .where("role = ?", ["admin"]) \
    .order_by("name") \
    .limit(10) \
    .get()

# Standalone query

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

from tina4_python import QueryBuilder

results = QueryBuilder.table("orders") \
    .select("customer_id", "SUM(total) as revenue") \
    .where("status = ?", ["completed"]) \
    .group_by("customer_id") \
    .having("revenue > ?", [1000]) \
    .get()
```

**Path parameter injection (v3.9.0).** Route handlers receive path parameters as named function arguments. No more digging through `request.params`.

```python
# Before v3.9.0

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/users/{id}")
def get_user(request, response):
    user_id = request.params["id"]
    return response(f"User {user_id}")

# v3.9.0 and later

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/users/{id:int}")
def get_user(id, request, response):
    return response(f"User {id}")  # id is already an int
```

**Auto-start sessions (v3.9.0).** Every route handler receives `request.session` with zero configuration. The session API covers `get`, `set`, `delete`, `has`, `clear`, `destroy`, `regenerate`, `flash`, and `get_flash`.

```python
@app.get("/dashboard")
def dashboard(request, response):
    visits = request.session.get("visits", 0)
    request.session.set("visits", visits + 1)
    return response(f"Visit #{visits + 1}")
```

**CSRF middleware and form tokens (v3.9.1).** Session-bound CSRF tokens protect forms by default. Toggle with the `TINA4_CSRF` environment variable.

```python
# CSRF is on by default in v3.9.1+

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

# Disable for API-only apps:

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

# TINA4_CSRF=false

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

```

**File-based queue backend (v3.9.1).** Replaced the SQLite queue with a JSON file-based backend. Zero dependencies. Full cross-platform parity with the PHP and Ruby implementations.

**NoSQL QueryBuilder (v3.9.2).** The fluent API gained `to_mongo()` to generate MongoDB queries from the same builder syntax.

```python
query = QueryBuilder.table("users") \
    .where("age > ?", [21]) \
    .order_by("name") \
    .limit(10) \
    .to_mongo()
# Returns a MongoDB-compatible query dict

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

```

**WebSocket backplane (v3.9.2).** Redis pub/sub for scaling WebSocket broadcast across multiple server instances.

**SameSite cookie default (v3.9.2).** Session cookies default to `SameSite=Lax`. Override with the `TINA4_SESSION_SAMESITE` environment variable.

### Breaking Changes

**Session API rename (v3.9.0).** The `unset()` method became `delete()` for cross-framework parity. `unset()` still works as an alias but will show a deprecation warning in future releases.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

request.session.unset("cart")

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

request.session.delete("cart")
```

**Environment variable standardization (v3.9.1).** All framework environment variables now follow the `TINA4_*` naming convention. `TOKEN_LIMIT` became `TINA4_TOKEN_LIMIT`. Check your `.env` file and rename any bare variables.

**Queue backend change (v3.9.1).** The SQLite queue backend no longer exists. If you used it, the file-based backend is a drop-in replacement. Queue data from the old SQLite store must be migrated manually.

---

## v3.8.x - Pooling, Validation, and Security (March 25-26, 2026)

### Features

**Connection pooling (v3.8.1).** Pass `pool=N` to the `Database` constructor for round-robin, thread-safe connection pooling.

```python
from tina4_python import Database

db = Database("sqlite:///app.db", pool=4)
# Four connections rotate across requests

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

```

**Validator class (v3.8.1).** Input validation with an error response envelope.

```python
from tina4_python import Validator

errors = Validator.validate(request.body, {
    "email": "required|email",
    "age": "required|integer|min:18"
})

if errors:
    return response({"errors": errors}, 422)
```

**Upload size limit (v3.8.1).** The `TINA4_MAX_UPLOAD_SIZE` environment variable caps file uploads. Set it in bytes.

**TestClient for integration tests (v3.8.1).** Test your routes without starting the server.

```python
from tina4_python import TestClient

client = TestClient(app)
result = client.get("/api/users")
assert result.status_code == 200
```

**SecurityHeadersMiddleware (v3.8.1).** One import adds `X-Frame-Options`, `Strict-Transport-Security`, `Content-Security-Policy`, and `X-Content-Type-Options` to every response.

```python
from tina4_python import SecurityHeadersMiddleware

app.use(SecurityHeadersMiddleware())
```

**Zero core dependencies (v3.8.x).** Database drivers, queue backends, and session handlers became optional installs. The core framework runs on Python's standard library alone.

---

## v3.7.x - Template Auto-Serve and Firebird Fixes (March 25, 2026)

### Features

**Template auto-serve at `/` (v3.7.0).** Place an `index.html` or `index.twig` in `src/templates/` and the framework serves it at the root path. User-registered `GET /` routes take priority.

```
src/
  templates/
    index.html   <- served at / with no route needed
```

**Firebird idempotent migrations (v3.7.0).** `ALTER TABLE ADD` statements on Firebird check `RDB$RELATION_FIELDS` before executing. Columns that already exist are skipped. Other databases and statement types are not affected.

---

## v3.6.x - API Parity (March 24, 2026)

### Breaking Changes

**Auth method renames (v3.6.0).** The authentication API aligned with the PHP, Ruby, and Node.js implementations.

```python
# Before v3.6.0

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

from tina4_python import Auth

token = Auth.create_token(payload)       # old name
valid = Auth.validate_token(token)       # old name
```

```python
# v3.6.0 and later

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

from tina4_python import Auth

token = Auth.get_token(payload)          # new primary name
valid = Auth.valid_token(token)          # new primary name
# create_token and validate_token still work as aliases

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

```

**Pagination parameter rename (v3.6.0).** `skip` became `offset` across all query methods.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

users = User.find(skip=10, limit=5)

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

users = User.find(offset=10, limit=5)
```

**Token expiry parameter rename (v3.6.0).** `token_expiry` became `expires_in` and now accepts minutes instead of seconds.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

token = Auth.create_token(payload, token_expiry=3600)  # seconds

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

token = Auth.get_token(payload, expires_in=60)          # minutes
```

**Locale environment variable (v3.6.0).** `LOCALE` became `TINA4_LOCALE`. Update your `.env` file.

---

## v3.5.x - Bundled Frontend (March 24, 2026)

### Features

**tina4js bundled (v3.5.0).** The reactive frontend library (13.6 KB minified) ships with the framework. No CDN link needed. Import it from your templates and build reactive UIs with signals, components, and declarative routing.

**AutoCrud Swagger metadata (v3.5.0).** Routes generated by `AutoCrud` now include Swagger annotations. They appear in the auto-generated API docs without extra configuration.

---

## v3.3.x - WebSockets, File Uploads, and Frond Improvements (March 24, 2026)

### Features

**Route-based WebSocket handlers (v3.3.0).** Define WebSocket endpoints with the same decorator pattern as HTTP routes.

```python
@app.websocket("/ws/chat")
def chat_handler(message, client):
    # message is the incoming data
    # client.send() to reply
    client.send(f"Echo: {message}")
```

**File upload improvements (v3.3.0).** Uploaded files include raw bytes, a `data_uri` template filter, and consistent property names across all frameworks.

```python
@app.post("/upload")
def handle_upload(request, response):
    file = request.files[0]
    print(file.filename)    # standardized from file_name
    print(file.type)        # new in v3.3.0
    raw = file.content      # raw bytes
    return response("Uploaded")
```

**Lazy `column_info()` on DatabaseResult (v3.3.0).** Query results expose schema metadata on demand. Call `result.column_info()` to inspect column names, types, and sizes without a separate query.

**`@any` decorator alias (v3.3.0).** `@any` works as shorthand for `@any_method`, matching the PHP, Ruby, and Node.js API.

**Ternary-with-filter support in Frond (v3.3.0).** Templates handle inline conditionals that pipe their result through a filter.

```html
{{ user.name if user else "Anonymous"|upper }}
```

### Breaking Changes

**`job.data` renamed to `job.payload` (v3.3.0).** Queue jobs use `payload` as the primary attribute. `job.data` remains as a read-only property alias but will be removed in a future release.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.consume("emails")
def send_email(job):
    to = job.data["to"]

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.consume("emails")
def send_email(job):
    to = job.payload["to"]
```

**File upload property rename (v3.3.0).** `file_name` became `filename` (no underscore). The old name is no longer available.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

name = request.files[0].file_name

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

name = request.files[0].filename
```

**Route params merged into `request.params` (v3.3.0).** Path parameters now merge into `request.params` alongside query parameters. If a query parameter shares a name with a path parameter, the path parameter wins.

---

## v3.2.x - Flexible Route Handlers and DevReload (March 24, 2026)

### Features

**Flexible handler signatures (v3.2.0).** Route handlers accept any combination of parameters. The framework inspects the signature and injects what you ask for.

```python
# No parameters - fire and forget

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/ping")
def ping():
    return "pong"

# Response only

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/hello")
def hello(response):
    return response("Hello")

# Request only (type-hinted)

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.post("/echo")
def echo(request: Request):
    return request.body

# Both

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

@app.get("/users")
def users(request, response):
    return response({"users": []})
```

**DevReload with SCSS compilation (v3.2.0).** The development server watches for file changes and reloads the browser. SCSS files compile on change.

**Route groups (v3.2.0).** Group routes under a shared prefix with shared middleware.

**MongoDB queue backend (v3.2.0).** Use MongoDB as a queue backend alongside the existing file-based, RabbitMQ, and Kafka options.

**Migration naming convention (v3.2.0).** Migration files follow the `YYYYMMDDHHMMSS` timestamp format. The `tina4 migrate --status` command shows which migrations have run.

**Auto-increment port (v3.2.0).** If the default port is in use, the framework picks the next available port and opens your browser.

### Breaking Changes

**Queue constructor simplified (v3.2.0).** The `db` parameter was removed from the Queue constructor. The queue reads its backend from the environment.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

from tina4_python import Queue, Database
db = Database("sqlite:///queue.db")
queue = Queue("emails", db=db)

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

from tina4_python import Queue
queue = Queue("emails")
# Backend set via TINA4_QUEUE_BACKEND env var

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

```

**Producer/Consumer classes removed (v3.2.0).** Use `queue.produce()` and `queue.consume()` directly.

```python
# Before

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

from tina4_python import Producer, Consumer
producer = Producer(queue)
producer.send({"to": "user@example.com"})

# After

## v3.10.70 (2026-04-06)

- **New:** SSE (Server-Sent Events) support via `response.stream()` - pass a generator, framework handles chunked transfer encoding, keep-alive, and `text/event-stream` content type
- **New:** Chapter 24 added to documentation: Server-Sent Events
- Feature count: 45 (was 44)
- Full parity across Python, PHP, Ruby, Node.js

queue.produce({"to": "user@example.com"})
```

---

## v3.1.x - Benchmarks and Internal Improvements (March 22, 2026)

### Features

**Automated benchmark suite (v3.1.0).** A reproducible benchmark compares Tina4 Python against 17 frameworks across four languages. Run it yourself with `python benchmarks/run.py`.

No user-facing API changes in this release. Internal improvements to test infrastructure and benchmark tooling.

---

## v3.0.0 - The Rewrite (March 22, 2026)

The v3.0.0 release replaced the entire v2 codebase. Zero external dependencies. Pure Python standard library. 38 features. Over 6,000 tests.

### What Changed

- **New module structure.** `tina4_python.core` replaces the old flat namespace.
- **Frond template engine.** Built-in Twig-compatible templates replace the Jinja2 dependency. Pre-compilation caches tokens for a 2.8x speedup on file renders.
- **Decorator-based routing.** `@app.get`, `@app.post`, `@app.put`, `@app.delete`, `@app.patch` replace the old `Route` class.
- **Built-in Dev Admin.** A browser-based dashboard shows routes, database tables, and queue status.
- **Error overlay in debug mode.** Stack traces render in the browser with source context, request details, and suggested fixes.
- **Swagger auto-registration.** Decorated routes appear in the Swagger UI without manual annotation.
- **Unified queue system.** Switch between file-based, RabbitMQ, and Kafka backends through environment variables. No code changes.
- **Database query caching.** Set `TINA4_DB_CACHE=true` for transparent caching with a 4x speedup on repeated queries.
- **`tina4 generate` scaffolding.** Generate models, routes, migrations, and middleware from the command line.
- **Custom error pages.** Self-contained 404, 403, and 500 pages with clean, framework-neutral design.

For the full migration guide, see Chapter 37: Upgrading from v2 to v3.

---

## Release Candidate History

Five release candidates preceded the v3.0.0 stable release between March 21-22, 2026. They resolved test failures, polished the Dev Admin UI, added the benchmark suite, and stabilized the Frond template engine. If you tested a release candidate, upgrade to v3.0.0 or later. The RC builds are not supported.
