@nifrajs/cli 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +3211 -0
  2. package/README.md +3 -0
  3. package/dist/agent-files.d.ts +19 -11
  4. package/dist/agent-files.d.ts.map +1 -1
  5. package/dist/agent-files.js +26 -18
  6. package/dist/agent-files.js.map +1 -1
  7. package/dist/assure-hydration.d.ts.map +1 -1
  8. package/dist/assure-hydration.js +1 -0
  9. package/dist/assure-hydration.js.map +1 -1
  10. package/dist/assure.d.ts.map +1 -1
  11. package/dist/assure.js +14 -1
  12. package/dist/assure.js.map +1 -1
  13. package/dist/capabilities-tool.d.ts.map +1 -1
  14. package/dist/capabilities-tool.js +131 -45
  15. package/dist/capabilities-tool.js.map +1 -1
  16. package/dist/check-diagnostics.d.ts +5 -0
  17. package/dist/check-diagnostics.d.ts.map +1 -1
  18. package/dist/check-diagnostics.js +3 -0
  19. package/dist/check-diagnostics.js.map +1 -1
  20. package/dist/check-scan.d.ts.map +1 -1
  21. package/dist/check-scan.js +6 -3
  22. package/dist/check-scan.js.map +1 -1
  23. package/dist/check.d.ts.map +1 -1
  24. package/dist/check.js +52 -12
  25. package/dist/check.js.map +1 -1
  26. package/dist/cli.d.ts.map +1 -1
  27. package/dist/cli.js +23 -12
  28. package/dist/cli.js.map +1 -1
  29. package/dist/command-catalog.d.ts.map +1 -1
  30. package/dist/command-catalog.js +9 -5
  31. package/dist/command-catalog.js.map +1 -1
  32. package/dist/dev-bun-config.d.ts +6 -3
  33. package/dist/dev-bun-config.d.ts.map +1 -1
  34. package/dist/dev-bun-config.js +13 -10
  35. package/dist/dev-bun-config.js.map +1 -1
  36. package/dist/dev-feed-tool.d.ts +3 -2
  37. package/dist/dev-feed-tool.d.ts.map +1 -1
  38. package/dist/dev-feed-tool.js +26 -5
  39. package/dist/dev-feed-tool.js.map +1 -1
  40. package/dist/doctor.d.ts +15 -1
  41. package/dist/doctor.d.ts.map +1 -1
  42. package/dist/doctor.js +79 -61
  43. package/dist/doctor.js.map +1 -1
  44. package/dist/i18n-check.d.ts +11 -1
  45. package/dist/i18n-check.d.ts.map +1 -1
  46. package/dist/i18n-check.js +170 -17
  47. package/dist/i18n-check.js.map +1 -1
  48. package/dist/init-agents.d.ts +46 -6
  49. package/dist/init-agents.d.ts.map +1 -1
  50. package/dist/init-agents.js +193 -31
  51. package/dist/init-agents.js.map +1 -1
  52. package/dist/internal/project-specifiers.d.ts.map +1 -1
  53. package/dist/internal/project-specifiers.js +9 -1
  54. package/dist/internal/project-specifiers.js.map +1 -1
  55. package/dist/internal/source-facts.d.ts +6 -0
  56. package/dist/internal/source-facts.d.ts.map +1 -1
  57. package/dist/internal/source-facts.js +106 -0
  58. package/dist/internal/source-facts.js.map +1 -1
  59. package/dist/internal/workspace-packages.d.ts +22 -0
  60. package/dist/internal/workspace-packages.d.ts.map +1 -0
  61. package/dist/internal/workspace-packages.js +215 -0
  62. package/dist/internal/workspace-packages.js.map +1 -0
  63. package/dist/load.d.ts +7 -2
  64. package/dist/load.d.ts.map +1 -1
  65. package/dist/load.js +11 -2
  66. package/dist/load.js.map +1 -1
  67. package/dist/lock-links.d.ts +42 -0
  68. package/dist/lock-links.d.ts.map +1 -0
  69. package/dist/lock-links.js +144 -0
  70. package/dist/lock-links.js.map +1 -0
  71. package/dist/mcp-exec.d.ts.map +1 -1
  72. package/dist/mcp-exec.js +5 -2
  73. package/dist/mcp-exec.js.map +1 -1
  74. package/dist/mcp-http.js +1 -1
  75. package/dist/mcp-root.d.ts +6 -4
  76. package/dist/mcp-root.d.ts.map +1 -1
  77. package/dist/mcp-root.js +12 -8
  78. package/dist/mcp-root.js.map +1 -1
  79. package/dist/migrate-layout.d.ts +2 -1
  80. package/dist/migrate-layout.d.ts.map +1 -1
  81. package/dist/migrate-layout.js +434 -29
  82. package/dist/migrate-layout.js.map +1 -1
  83. package/dist/project-site.d.ts +7 -0
  84. package/dist/project-site.d.ts.map +1 -0
  85. package/dist/project-site.js +19 -0
  86. package/dist/project-site.js.map +1 -0
  87. package/dist/recipes/4.0.0.d.ts.map +1 -1
  88. package/dist/recipes/4.0.0.js +2 -0
  89. package/dist/recipes/4.0.0.js.map +1 -1
  90. package/dist/recipes/5.1.0.d.ts +9 -0
  91. package/dist/recipes/5.1.0.d.ts.map +1 -0
  92. package/dist/recipes/5.1.0.js +22 -0
  93. package/dist/recipes/5.1.0.js.map +1 -0
  94. package/dist/recipes/5.2.0.d.ts +10 -0
  95. package/dist/recipes/5.2.0.d.ts.map +1 -0
  96. package/dist/recipes/5.2.0.js +32 -0
  97. package/dist/recipes/5.2.0.js.map +1 -0
  98. package/dist/recipes/index.d.ts +3 -0
  99. package/dist/recipes/index.d.ts.map +1 -1
  100. package/dist/recipes/index.js +7 -0
  101. package/dist/recipes/index.js.map +1 -1
  102. package/dist/review.d.ts.map +1 -1
  103. package/dist/review.js +2 -0
  104. package/dist/review.js.map +1 -1
  105. package/dist/rule-explain.d.ts +26 -0
  106. package/dist/rule-explain.d.ts.map +1 -0
  107. package/dist/rule-explain.js +49 -0
  108. package/dist/rule-explain.js.map +1 -0
  109. package/dist/rules/codes.d.ts +2 -0
  110. package/dist/rules/codes.d.ts.map +1 -1
  111. package/dist/rules/codes.js +2 -0
  112. package/dist/rules/codes.js.map +1 -1
  113. package/dist/rules/contract-visibility.d.ts.map +1 -1
  114. package/dist/rules/contract-visibility.js +93 -21
  115. package/dist/rules/contract-visibility.js.map +1 -1
  116. package/dist/rules/explanations.d.ts +14 -0
  117. package/dist/rules/explanations.d.ts.map +1 -0
  118. package/dist/rules/explanations.js +316 -0
  119. package/dist/rules/explanations.js.map +1 -0
  120. package/dist/rules/legacy.d.ts.map +1 -1
  121. package/dist/rules/legacy.js +24 -1
  122. package/dist/rules/legacy.js.map +1 -1
  123. package/dist/rules/merge-auth.d.ts +12 -0
  124. package/dist/rules/merge-auth.d.ts.map +1 -0
  125. package/dist/rules/merge-auth.js +52 -0
  126. package/dist/rules/merge-auth.js.map +1 -0
  127. package/dist/rules/pages.d.ts +27 -0
  128. package/dist/rules/pages.d.ts.map +1 -1
  129. package/dist/rules/pages.js +177 -2
  130. package/dist/rules/pages.js.map +1 -1
  131. package/dist/rules/routes.d.ts +3 -2
  132. package/dist/rules/routes.d.ts.map +1 -1
  133. package/dist/rules/routes.js +4 -3
  134. package/dist/rules/routes.js.map +1 -1
  135. package/dist/rules/zones.d.ts.map +1 -1
  136. package/dist/rules/zones.js +3 -2
  137. package/dist/rules/zones.js.map +1 -1
  138. package/dist/typecheck-coverage.d.ts +11 -0
  139. package/dist/typecheck-coverage.d.ts.map +1 -1
  140. package/dist/typecheck-coverage.js +50 -7
  141. package/dist/typecheck-coverage.js.map +1 -1
  142. package/dist/upgrade.d.ts +37 -1
  143. package/dist/upgrade.d.ts.map +1 -1
  144. package/dist/upgrade.js +171 -20
  145. package/dist/upgrade.js.map +1 -1
  146. package/dist/verification-plan.d.ts.map +1 -1
  147. package/dist/verification-plan.js +2 -0
  148. package/dist/verification-plan.js.map +1 -1
  149. package/dist/version-drift.d.ts.map +1 -1
  150. package/dist/version-drift.js +12 -1
  151. package/dist/version-drift.js.map +1 -1
  152. package/dist/web-app-options.d.ts +1 -1
  153. package/dist/web-app-options.d.ts.map +1 -1
  154. package/dist/web-app-options.js.map +1 -1
  155. package/docs/examples.json +19 -1
  156. package/docs/llms-full.txt +625 -130
  157. package/docs/types.json +396 -50
  158. package/package.json +13 -12
  159. package/src/agent-files.ts +27 -17
  160. package/src/assure-hydration.ts +1 -0
  161. package/src/assure.ts +11 -1
  162. package/src/capabilities-tool.ts +159 -50
  163. package/src/check-diagnostics.ts +8 -0
  164. package/src/check-scan.ts +9 -3
  165. package/src/check.ts +67 -12
  166. package/src/cli.ts +24 -11
  167. package/src/command-catalog.ts +16 -8
  168. package/src/dev-bun-config.ts +13 -9
  169. package/src/dev-feed-tool.ts +40 -6
  170. package/src/doctor.ts +102 -66
  171. package/src/i18n-check.ts +254 -18
  172. package/src/init-agents.ts +221 -41
  173. package/src/internal/project-specifiers.ts +9 -1
  174. package/src/internal/source-facts.ts +124 -0
  175. package/src/internal/workspace-packages.ts +218 -0
  176. package/src/load.ts +19 -3
  177. package/src/lock-links.ts +173 -0
  178. package/src/mcp-exec.ts +5 -2
  179. package/src/mcp-http.ts +1 -1
  180. package/src/mcp-root.ts +14 -8
  181. package/src/migrate-layout.ts +495 -31
  182. package/src/project-site.ts +18 -0
  183. package/src/recipes/4.0.0.ts +2 -0
  184. package/src/recipes/5.1.0.ts +23 -0
  185. package/src/recipes/5.2.0.ts +33 -0
  186. package/src/recipes/index.ts +7 -0
  187. package/src/review.ts +2 -0
  188. package/src/rule-explain.ts +75 -0
  189. package/src/rules/codes.ts +2 -0
  190. package/src/rules/contract-visibility.ts +118 -20
  191. package/src/rules/explanations.ts +329 -0
  192. package/src/rules/legacy.ts +24 -1
  193. package/src/rules/merge-auth.ts +55 -0
  194. package/src/rules/pages.ts +221 -2
  195. package/src/rules/routes.ts +4 -3
  196. package/src/rules/zones.ts +3 -2
  197. package/src/typecheck-coverage.ts +51 -6
  198. package/src/upgrade.ts +227 -22
  199. package/src/verification-plan.ts +6 -0
  200. package/src/version-drift.ts +15 -0
  201. package/src/web-app-options.ts +9 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,3211 @@
1
+ # @nifrajs/cli
2
+
3
+ ## 5.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3860e98: `nifra check` (NF-C039) reads a contract imported from a workspace package, such as `@team/contracts/contract`, through that package's `exports`: subpaths, `*` patterns, and the `bun`, `import` and `default` conditions, plus `types` when it names a TypeScript source. A package linked from outside every `node_modules` counts as the workspace's; one installed from a registry is never read. The scan also follows `export * from` and `export { x } from` re-exports on the way to the contract, and reads a `...operations` spread of another operations object where that object is written. When the contract still cannot be read, the warning names the package and why.
8
+ - 0082cc0: `nifra explain NF-C007` (and `nifra_explain` given a code as its `error`) answers a `nifra check` rule code from the catalog: its title, the review check it reports under, what it reports and why it matters, the fix, the command that applies or starts it when there is one, and its docs page. An unknown or retired code is refused with exit 1 instead of being explained as an unhandled error.
9
+ - 744d3ba: `nifra migrate layout` lists a moved path that a JS or TS module names only in comments as a follow-up, not an issue, so it no longer fails the run. A mention in code or a string, or in a non-JS tooling file, is still an issue. `followUps[].command` is now optional: a comment to update has no command.
10
+ - a040478: `nifra doctor` and `nifra check` (NF-D003) report a `file:` dependency whose recorded dependencies in `bun.lock` differ from what its `package.json` declares now. Bun records them once and never reads that `package.json` again, even under `bun install --force`, so it keeps installing the recorded versions beside the declared ones. The fix is `bun update <package>`. `nifra upgrade` reads the lock against the manifests it is about to write: a dry run lists the entries it would leave stale, and `--write` drops them so the next `bun install` records them again. A lock not laid out one entry per line is left alone and the `bun update` is named instead. The mixed-versions advisory (NF-D002) also counts an exact nifra pin such an entry records.
11
+ - d66ba12: `nifra init-agents --sync-mcp` and `nifra upgrade --write`, run in a workspace member, also re-pin the MCP launch in the directories above it, up to the repository root: a root `.mcp.json` that launches `mcp app` is the member's to re-pin. A file is rewritten only when every nifra launch in it serves that member, resolved the way `nifra mcp` resolves it; a file that also launches another project, holds a pin no launch accounts for, or is a symlink is reported and left alone. Outside a repository nothing above the project is read.
12
+ - 5edd0ba: `nifra upgrade` stops before writing anything when a `link:` or `file:` dependency outside the project installs its own `@nifrajs/*` at a version other than the target. Its imports resolve from its own `node_modules`, so after the upgrade a `server()` it builds could no longer be merged into the app, and that only failed at the first `merge()`. The refusal names each linked repository, its versions and the commands that upgrade it; `--allow-linked-skew` upgrades the project anyway. A dry run prints the plan with the same blocker and exits non-zero. A linked copy that resolves back into the project follows its install and does not count.
13
+
14
+ `merge()` given a server from another loaded copy of `@nifrajs/core` names every copy in its error, this one first, with the version of each copy that has built a `server()`, and says how to collapse them. With one copy loaded the message is unchanged. Copies older than this release are named by path alone, and a production build keeps the short message.
15
+ - df0fbb3: A project that declares `@nifrajs/cli` now launches its MCP server as `bunx @nifrajs/cli mcp`, with no version pin. `bunx` runs the CLI the project installs, so the server moves with every upgrade and the launch never goes stale. New scaffolds and `nifra init-agents` write this form. `nifra init-agents --sync-mcp` and `nifra upgrade --write` drop an existing pin in such a project, and `nifra doctor` points out a pin that is left. A project that does not declare the CLI keeps the exact-version pin, since an unpinned `bunx` there would run a cached `latest`. A launch in a workspace root's files stays pinned too, because the root need not hold the CLI's bin. `create-nifra/agent-files`: `mcpConfig(pin?)`, `mcpJson(pin?)` and `agentsMcpSection(pin?)` take an optional pin. `MCP_CONFIG` is now the unpinned config a scaffold writes.
16
+ - 000b4cb: `nifra check` reports NF-C043, a warning, for a `merge()` whose server authenticates none of its routes while the server it is merged into authenticates its own with `authenticate()` or an auth plugin that records `authenticated` for the routes after it. A merged route keeps the hooks of the server that declared it, so that authentication never runs for it. A merged server that authenticates any route of its own is not reported. `// nifra-expect NF-C043: <reason>` on the merge line accepts a module that is public on purpose. The rule reads the app `nifra.assurance.ts` loads.
17
+
18
+ `@nifrajs/core/reflection` exports `reflectMergeAuthGaps(app)`, the record behind the rule, collected by a development load.
19
+ - 6082ba5: Capability provenance now also starts from the module that registered each route. While the CLI loads `nifra.assurance.ts`, a development load records the `file:line:col` of each route registration through every `group()` and `merge()`, and `reflectRouteSites()` from `@nifrajs/core/reflection` returns it. The walk adds that module to the ones the static text scan finds, so a route with a computed path, or on a server a helper builds, is covered without `provenance.routeModules`. Recording happens only with `NIFRA_ROUTE_SITES=1` outside production, and a production build carries none of it. The sites stay out of `reflectRoutes()`, so no absolute path reaches a written artifact.
20
+ - ed13e36: `nifra upgrade` carries a 5.1.0 recipe, so an upgrade across 5.1.0 prints what can change for an app: merged routes recompiled under the parent's response contract and effect ledger, cross-site form posts refused with `403`, and `clientIp.trustedHops` with no socket peer. `nifra upgrade --list` prints the notes of every release after the version the project declares, and `--json` carries `installed` and every version's `notes`.
21
+
22
+ `reflectHooks` (and so `nifra routes --hooks`, and the hook-scope diff `nifra upgrade` saves) lists the runtimes a route resolved at registration beside its hooks: `responseContract` named by its mode, `effectLedger` and `idempotency`, each with the site `route`. A merged route that gains a parent's contract on upgrade now shows up in `nifra routes --hooks --since`.
23
+
24
+ The release gate fails a minor or major release that has no upgrade recipe of its own.
25
+ - 7ad66f5: NF-C035 also reads app modules that call `createWebApp` from `@nifrajs/web` themselves. A call that mounts a backend (`api`) with no `apiPrefix`, or with a string different from the `apiPrefix` `nifra dev` reads from the framework config, is reported at the call with both values: production then serves the backend somewhere `nifra dev`, end-to-end runs under it and the rest of `nifra check` never exercised. An `apiPrefix` imported from `backend/framework.ts` or `nifra.config.ts` matches by construction; options built from a spread or a variable, or a value the scan cannot read, are not reported.
26
+ - 281a48e: `nifra i18n check` checks copy tables: when the entry exports a `copy` from `defineCopy()` (with or without `catalogs`), it finds that definition's tables across the project's source, turns them into a catalog per locale and runs every catalog check on them, reporting each table at its `file:line`. Two tables with one id, an id that nests under another, and a table key that a catalog also uses are errors; a table or registry it cannot read statically is a warning that says why.
27
+ - 1d20d1f: `checkCatalogs()` catches partly translated text. In a locale that does not write in Latin, `latin-share` reports a message of at least `minWords` (6) words whose share of Latin-script words is above `maxLatinShare` (0.6), with words split by `Intl.Segmenter` so Japanese and Thai count too; `latinWords` lists the brands and units a translation keeps. Each such locale's coverage row carries its `latinShare`, with a warning above `maxLocaleLatinShare` (0.1). `volume` reports a default message of at least `minVolumeGraphemes` (80) graphemes translated to under `minVolumeRatio` (0.32) of its length, a summary rather than a translation; Han scripts are left out of it. `rules` adds an app's own checks, run on every message of every locale and reported as `custom:<code>`, which `ignore` takes. `nifra i18n check` reads these options from the entry's `check` export and shows each locale's Latin share.
28
+ - 1d20d1f: An app registers its locale routing once: `export const i18n = urls` (the router `defineI18nRouting()` returns) from `backend/framework.ts`, which `nifra dev`, `nifra build` and the generated server entry pass to `createWebApp({ i18n })`. Every document then takes `<html lang dir>` from the registry's `documentMeta(localeOf(path))` unless the route's meta sets `lang`, on a hard load and after each client navigation, and carries `Content-Language`. Each adapter's new `useLocale()` returns the page's locale key, and `<I18nProvider>` formats in the page's locale when no `locale` is passed, with no loader handing either over. A route under a `[lang]` or `[[lang]]` directory runs `matchSegment()` before any middleware: an unserved locale, or a page missing from it, is a 404 through the app's `_404`, and a non-canonical prefix such as `/en/x` with an unprefixed default is a 308 to `/x`.
29
+ - 1ebc48a: `nifra check` typechecks every project `tsconfig.json` references, each as its own program, so a solution-style tsconfig (`"files": []` plus `references`) no longer passes having read nothing. A project whose code is split across sibling configs names them in `nifra.check.json` as `"tsconfigs": ["tsconfig.json", "tsconfig.server.json"]`; the list replaces the default, is echoed in the human, JSON and MCP results, and a listed config that does not exist fails the typecheck. The zone coverage check reads the union of the programs, and an error two programs both report is shown once.
30
+
31
+ ### Patch Changes
32
+
33
+ - 9498cf8: The package ships its `CHANGELOG.md`, so the installed package has the notes for every version, as the GitHub release does. Before, the tarball held only the code, `README.md`, `LICENSE` and `package.json`.
34
+ - ac65b5c: `nifra doctor` prints its full report again: the bundler, the dependency scan scope, production readiness, each undeclared import and duplicate install with its fix, and the advisories (a CLI that differs from the project's nifra, mixed nifra versions, stale `file:` entries in `bun.lock`, stale MCP pins). It had printed only whether it passed, while `--json` and the MCP tool carried the detail.
35
+ - 426cbcd: `nifra check` reports a raw `Response` return (NF-C007) only inside a route handler: a function passed to `.get("/path", …)` and the other method registrations, a function value of an `implement(contract, {...})` map, a local function either one names, and a local function a handler returns a call to. A helper that returns a `Response` for an auth stage's `rejected`, or any other function no route registers, is no longer flagged. A handler registered from data, such as a loop over route objects, is not followed.
36
+ - 3edee08: `nifra verify --release` runs a `site` gate, `bun run check:site`, after `sitemap`. A project without that script reports the gate as undeclared, as it does for the other repository gates.
37
+ - a3e6c9f: `nifra upgrade 5.2.0` prints what changes for a 5.1 app: closed header schemas read only declared names, `extra: "strip"` projects tagged unions, the development hook audit reports more ordering mistakes (and throws on them under `unusedScopedHooks: "error"`), NF-C043, the wider capability walk, the unpinned MCP launch and the linked-repository refusal.
38
+ - b9e7c6b: The Bun production build (`buildClient`, `buildServer`, `nifra build`) and the `nifra dev --bun` client expand `import.meta.glob` the way Vite does, through the new `importGlobPlugin` in `@nifrajs/web/build`. A literal pattern, or an array of them, starting with `./`, `../` or `/` (the app root) with `!` exclusions becomes an object keyed as Vite keys it, of lazy `() => import(...)` loaders or, with `eager: true`, the modules themselves; `import: "default"` (or a name) picks one export, and `typeof import.meta.glob` reads `"function"`. A mention in a comment, a string or JSX text is left as written. A computed pattern, an alias or another option fails the build naming the file and line, and a client bundle that still calls `import.meta.glob` (a module another plugin loaded first) is refused instead of shipping a glob that loads nothing.
39
+ - 9b7a0b4: Capability provenance (`nifra check` NF-C014, `nifra assure`) walks each installed package's import closure once per run, under its own 5000-module budget, instead of once per route inside the route's 500-module budget. A dependency with hundreds of data modules, such as a validation library's locale tables, no longer truncates every route that imports it, and its imports are still read: a forbidden effect import anywhere in the package is reported for each route that reaches it. A package past its own budget still fails closed, naming the package entry.
40
+ - ddca15d: `nifra migrate layout` reads `import.meta.glob`: the files a literal pattern loads count as imports of the module that loads them, so they move with it, and each pattern is checked after the moves. One whose files moved together into another folder is re-pointed there (`!` exclusions included); one whose files no longer sit under one folder, or a computed pattern, is reported instead of silently matching nothing.
41
+ - 0afa2b4: `nifra migrate layout` follows a top-level `const dir = import.meta.dir` (or `import.meta.dirname`, `__dirname`) the way it follows the expression itself: `resolve(dir, "src/x.tsx")`, `join(dir, ...)`, `dir + "/x"` and `` `${dir}/x` `` are re-pointed when the file they name moves, in a module that moves and in one that stays, such as a root build script. A name the file also declares elsewhere is left alone and reported.
42
+ - 46ffd25: `nifra migrate layout` rewrites the moved files the app's own `package.json` names by exact path in `main`, `module`, `types`, `browser`, `source`, `bin`, `exports`, `imports`, `files` and `scripts`, keeping a written `./`, and lists the change under `tooling`. A value with a `*` outside `scripts` is a pattern over a folder and stays, as do `"//"` note keys; the path scan still reports what stays.
43
+ - a56a67d: `nifra migrate layout` re-points the paths a moved shell script builds from its own folder: `$(dirname "$0")/..`, `$(dirname "${BASH_SOURCE[0]}")/../..` and `${0%/*}/x.sh` name the same place from the script's new folder. A script that uses its folder with no literal path after it, such as `$(cd "$(dirname "$0")" && pwd)`, is reported as an issue to check by hand.
44
+ - 288d68f: `nifra migrate layout` lists every line where a workspace sibling names a moved app file, not only the first. A sibling that names the path in code is an issue whose message gives each code line and any comment lines beside them; a sibling that names it only in comments is a follow-up, as a comment inside the app already is.
45
+ - 8f125db: With both `nifra.config.ts` and `backend/framework.ts`, `nifra dev` (Vite and Bun pipelines) and `nifra build` take `publicEnvPrefix` from `backend/framework.ts` when `nifra.config.ts` leaves it unset, as they already did for the server options. `nifra check` reads `nifra.config.ts` first, so every command draws the browser environment line from the same value. A `publicEnvPrefix` that is not a string is refused at load, naming the file.
46
+ - 2aa2fb0: `nifra upgrade` from 3.x names two 4.0 changes that show up in tests and tooling rather than in pages: page data arrives in one `<script type="application/json" id="__nifra-handover">` (read it through `HANDOVER_ID`) instead of a script assigning `window.__NIFRA_DATA__`, and `x-nifra-isr-revalidate` / `x-nifra-isr-tags` are set only under a cache wrapper such as `withISR`. The 5.0 migration guide lists both, and covers an app that strips `/api` in its own `Proxy` or `fetch` wrapper: replace it with `apiStrip`, and serve any other prefix it handled through `mounts`.
47
+ - 5479750: `tablesToCatalogs()` builds every catalog and nested block with a null prototype, so a copy table id segment or a locale key named `__proto__` is an ordinary entry and never reaches `Object.prototype`. The copy scanner substitutes a tsconfig `paths` match into its target as written, so a `$&` in an import path stays literal. `nifra upgrade` prints a linked repository's path with forward slashes on every platform, in the blocker line and in the `cd` command it suggests.
48
+ - Updated dependencies [9498cf8]
49
+ - Updated dependencies [1f3ff32]
50
+ - Updated dependencies [4bb8e52]
51
+ - Updated dependencies [cdff19d]
52
+ - Updated dependencies [5edd0ba]
53
+ - Updated dependencies [000b4cb]
54
+ - Updated dependencies [c5455fb]
55
+ - Updated dependencies [6082ba5]
56
+ - Updated dependencies [fd58beb]
57
+ - Updated dependencies [ea25a61]
58
+ - Updated dependencies [ed13e36]
59
+ - Updated dependencies [281a48e]
60
+ - Updated dependencies [281a48e]
61
+ - Updated dependencies [1d20d1f]
62
+ - Updated dependencies [1d20d1f]
63
+ - Updated dependencies [746ada9]
64
+ - Updated dependencies [1d20d1f]
65
+ - Updated dependencies [b9e7c6b]
66
+ - @nifrajs/agent-review@5.2.0
67
+ - @nifrajs/client@5.2.0
68
+ - @nifrajs/core@5.2.0
69
+ - @nifrajs/i18n@5.2.0
70
+ - @nifrajs/mcp@5.2.0
71
+ - @nifrajs/mcp-db@5.2.0
72
+ - @nifrajs/runner@5.2.0
73
+ - @nifrajs/schema@5.2.0
74
+ - @nifrajs/testing@5.2.0
75
+ - @nifrajs/web@5.2.0
76
+
77
+ ## 5.1.0
78
+
79
+ ### Minor Changes
80
+
81
+ - 2a0a5d3: `nifra explain` brings the `nifra_explain` MCP tool to the command line: `nifra explain "<message>" --stack "<stack>"` prints the diagnostic code, the frame in the app's source with its codeframe, and the cause and fix when nifra recognises the error; with no message it explains the running dev server's latest error. `--json` prints the diagnostic, and the command exits `2` when there is nothing to explain.
82
+ - b276c67: `nifra assure --bundle` (and `--strict`) carries an `assurance` gate. Route-assurance findings fail it; before, the bundle never evaluated the route policy, so a failing policy could still come back green. A declared response or error schema that no `responseContract()` enforces is a warning there, so `--strict` refuses a green verdict while any route is typed-only or warn-only.
83
+
84
+ `nifra levels` names the typed-only routes and says where the plugin has to go: on the server that registers them, before them. When `responseContract()` already covers other routes, the reason says so, instead of advising an install that has already happened. It also prints the baseline rule that makes L1 require enforcement.
85
+
86
+ The static route scan follows one import hop: a module that builds its server with a local helper (`newServer().get(...)`, where `newServer` comes from a project file that calls `server()`) is read as a backend. A route that still has no static provenance coverage now says why: which file appears to register it on a server the scan cannot identify, or that no file registers it with a readable path. Either way the reason points at `capabilities.provenance.routeModules`.
87
+ - 513ec28: `nifra migrate layout --zones` keeps every module the layout would move into `frontend/`, `backend/` or `shared/` where it is and lists it in the app's `"nifra": { "zones": ... }` instead: the widest folder whose files all belong to one side, or the file itself where its folder holds both. A data file a zone imports is listed the same way instead of being reported. Route files are still split, the root `backend.ts` and `framework.ts` still move, and a second run lists nothing new.
88
+ - 2a0a5d3: `nifra schemas --check` exits `1` when a loader or action has no output schema, a generated one is stale, or a draft admits any value, for CI. A value typed `any` or `unknown` still drafts as `t.json()`; `nifra schemas` and `nifra migrate layout` now list each such path, and NF-C030 warns on the line in a generated schema. A drafted union no longer adds `t.optional(t.null())` for the keys only other branches declare.
89
+ - e8c482a: `nifra check` reports NF-C042, a warning, for a layout loader that refuses access in its own body (`redirect()`, `statusPage(401)` or `statusPage(403)`, or `new Response(...)`) when the layout does not export `gate = true` and has no `middleware`. A client navigation that keeps the layout skips that loader, and an action below it runs without it, so the check does not protect the pages under it. A refusal inside a helper the loader calls is not seen; the development warning in `@nifrajs/web` catches that case when it runs.
90
+
91
+ ### Patch Changes
92
+
93
+ - 30c2a6e: With both `nifra.config.ts` and `backend/framework.ts`, every command takes `apiPrefix`, `apiStrip`, `mounts`, `csp`, `nonce`, `serverComponents` and `use` from `backend/framework.ts` when `nifra.config.ts` leaves them unset, and validates them there. Before, `nifra dev` loaded only `nifra.config.ts` and the server entry `nifra build` generates imported only the options it set, so an `apiPrefix` set in `backend/framework.ts` alone served the backend nowhere over HTTP. NF-C035 reads the same merged value, reports a missing `apiPrefix` as a warning instead of information, and `nifra fix --code NF-C035` adds the mount to `backend/framework.ts`. A new site scaffold states `export const apiPrefix = ""` in `backend/framework.ts`, so it starts without the warning.
94
+ - 2a0a5d3: `nifra check` reports a route, layout, error, not-found, status or loading `.tsx`/`.jsx` that exports `loader`, `action`, `middleware` or another server-only name as NF-C041, an error, matching the build and the server, which already refuse it. `nifra fix --code NF-C041` moves the export and the code only it uses into the route's `.backend.ts`, merging with the one that exists. `nifra fix --code NF-C038` now runs the layout migration it names; its recipe was missing, so the fix did nothing.
95
+ - bab2b2e: NF-S001 (a gate whose catch block fails open) is a warning, not an error, in browser code proven to belong to a nifra web app (a route's page, `frontend/`), the same proof NF-S002 already uses: a check that fails open in the browser grants nothing the server does not check again. Backend, shared, API-only and unclassified files still fail the check, a `// nifra-expect NF-S001: <reason>` comment still makes the finding information, and the retired `@nifra-gate-reviewed` marker still silences nothing.
96
+ - 2a0a5d3: NF-S001 accepts more ways a gate's `catch` denies. A returned object whose `ok`, `allowed`, `authorized`, `authenticated`, `valid`, `success` or `granted` field is `false` is a denial, and so is an `authenticate…` function returning `null`, `undefined` or nothing. A `check…`/`verify…`/`ensure…`/`validate…` name is a gate only when the security word ends the name or a word in it, so `validateTokenizer`, `checkAccessibility` and `validateOriginalUrl` are no longer gates while `checkPermissions` and `verifySignatures` still are.
97
+ - 13d64c1: `nifra migrate layout` rewrites an alias import of a moved module as a relative path when no target of that alias covers the new location (`"@/*": ["./src/*"]` cannot name `frontend/src/`), instead of leaving it as written. Every rewritten specifier, aliased or relative, is checked to resolve to its module in the layout the migration leaves, and one that does not is reported. An alias with a `?query` suffix resolves and keeps its suffix, a package.json `#import` keeps its leading `#`, and an import of a moved route export through an alias that cannot name the backend half is pointed at it by a relative path.
98
+ - 83ab40c: `nifra migrate layout` reads a config module path built with `resolve`/`join` from `node:path` on the config's own folder (`import.meta.dir`, `import.meta.dirname`, `__dirname`), or with `fileURLToPath(new URL(..., import.meta.url))`, as an entry, and re-points it when its module moves; `nifra check` reads `clientModule` the same way for NF-C028. A moved file's own-folder path is re-pointed even when the file itself stays. A test moves with the subject beside it (`x.test.ts` next to `x.ts`, or in `__tests__/`), with its `__snapshots__` file, instead of zoning on its own imports; one whose subjects land in different folders stays and is reported. Every `tsconfig*.json` at the app root keeps each file in, or out of, its program as before: an entry naming a moved file follows it, a folder or glob gains its twin under the zone folder (`src` -> `frontend/src`) where adding the whole zone folder would take in files it left out, and an excluded folder gains its twin in `exclude`. A sibling package in the same workspace that names a moved file, by a relative import or a path string, is reported; the migration never edits files outside the app.
99
+ - 2a0a5d3: `nifra migrate layout` keeps the `/api` mount 3.x and 4.x made by default: moving a root `backend.ts` adds `export const apiPrefix = "/api"` to the framework config unless one is set. A folder whose imported files all go to one zone now moves whole, so files nothing imports yet stay beside their folder instead of being left behind; a file using `node:` or `bun:` never follows its folder into `frontend/` or `shared/`, and a nested package stops the move. A missing output schema on a backend half the run did not write is listed under `next` (`followUps` with `--json`) with the `nifra schemas --write` command and no longer makes the command exit `1`.
100
+ - 2846361: `nifra migrate layout` drafts the missing `loaderOutput`/`actionOutput` of each backend half it writes from the function's return type, read from the layout as planned, so the dry run lists the drafts (`schemas` in the result) and `--write` writes them with the `nifra:generated` line. A half where no draft can be written (an unreadable type, `t` or the schema name already bound) is reported with the reason. NF-C030 now carries a fix: `nifra fix --code NF-C030` drafts only the declaration the finding names, the same draft `nifra schemas --write` writes, and leaves every other schema in the file as it is. A draft's marker line asks the author to review what the browser may see, and `nifra schemas` lists the returned fields a draft leaves out (credential-like names, values that are not JSON). TypeScript 7 reads a file that is not on disk yet under the root as the caller spells it.
101
+ - bb9e858: `nifra migrate layout` splits a route more cleanly. A local `export { X }` or `export { X as Y }` counts as a read of `X` by the half that keeps that export, so the page keeps the import it re-exports and an export list shared with `loader` gives each half only its own names. An import a half reads only in types becomes `import type` (always in the backend half, and in the page where the split narrowed the import), so neither bundler loads the module for it and `nifra check` sees no zone edge. Constant data both halves read (literals, arrays and objects of them, `Object.keys`-style reads, and the types they need) moves once to a `x.shared.ts` beside the route, which both halves import and the page re-exports from; data that changes, runs code or reads an import is still copied into each half, and the report says why. An `import()` of a split route read only for moved exports (`(await import(x)).loader`, a destructuring, or a variable used only as `mod.loader`) loads the backend half instead.
102
+ - 5372e3a: A package's own `"nifra": { "environment": ... }` may give each export entry its own side: `{ ".": "backend", "./react": "frontend", "./schema": "library" }`. An import is judged by the entry it names, the exact subpath first and then the most specific `*` pattern, so two entries backed by one file keep their own sides; importing an entry the map leaves out is an error, as is a key or side the map cannot use. A file reached by path alone, through a relative or aliased deep import, takes the side of every mapped entry that reaches it through the package's own imports under any export condition, and a file no mapped entry reaches is an error. An import that binds only types (`import type`, `export type`, or a `{ }` list of `type` specifiers) grants no ownership, so a backend file a frontend entry only types against stays backend. The Bun and Vite client and server builds, both dev servers, `nifra check` (NF-C028 and NF-C004) and the editor plugin apply the same rules. The Vite builds record the specifier behind each such import, since Rollup keeps only the resolved file. `classify(file, specifier)` on a zone classifier takes the import as written, and `declaredSide(environment, specifier)` reads one declaration. A package-wide string and the app's `"zones": { "packages": ... }` defaults behave as before, and a package's own declaration outranks them. A third-party package's side is read from its root manifest, past a nested `package.json` such as `dist/esm/package.json`.
103
+ - 2a0a5d3: With `apiPrefix` set and `apiStrip` off, the backend sees each request's full path, so a route registered outside the prefix is reachable only in-process through `ctx.api`. `nifra routes` marks such a route `in-process only` (`inProcessOnly` with `--json`), and `nifra dev` and `nifra build` warn about them.
104
+ - c1beda1: `nifra check` decides which imports load a module the way the compiler emits them. An import whose named specifiers are all `type` (`import { type X } from "./x"`) is no zone edge (NF-C028), as it already was no server-only edge (NF-C004), unless the file's tsconfig sets `verbatimModuleSyntax`, under which it is emitted as `import {} from "./x"` and both rules check it. An import with a default binding (`import x, { type Y } from "./x"`) and an explicit `import {} from "./x"` or `export {} from "./x"` load their module and are checked by both rules.
105
+ - 0950139: `nifra upgrade --write` moves the MCP launch pin in `.mcp.json`, `.cursor/mcp.json`, `CLAUDE.md` and the `## MCP server` section of `AGENTS.md` to the target version, the same edit `nifra init-agents --sync-mcp` makes, and the dry run lists each one. A symlinked file or folder is left alone. Other versions pinned in `CLAUDE.md` and `AGENTS.md` are listed with their line, alongside the Dockerfiles, CI workflows and other lockfiles the upgrade already lists.
106
+ - 2a0a5d3: NF-D002 ignores an installed nifra package that neither the workspace nor an installed nifra package declares, such as a leftover `create-nifra`, and groups the installs it reports by version and location (`5 packages at 4.0.2 under <dir> (@nifrajs/cli, @nifrajs/client, @nifrajs/core and 2 more)`) instead of listing every package on one line.
107
+ - 40df00d: `nifra check` (and MCP `nifra_check`) reports contract drift when every route schema the contract lock recorded has been removed. It used to see that no route declares a schema now, answer with only the "trust manifest is vacuous" note, and pass while `nifra contracts check` failed. The note now appears only when the lock and the routes agree.
108
+ - 347a882: `nifra fix` with no `--code` no longer rewrites `contracts.lock.json` or migrates the project layout. Both accept a change a person should review first, so a bare `nifra fix` lists them under `skipped` with the command that applies each; `nifra fix --code NF-K001` still re-snapshots the lock.
109
+ - badfd1e: `nifra review --diff` run from an app inside a larger repository (`apps/web` in a monorepo) now reviews the app's changed files. Git listed changed tracked files relative to the repository root while findings are relative to the app, so a new error in a changed file was counted out of scope and the review passed.
110
+ - 02ba421: `nifra check` (and `nifra_check`) now fails when the directory has TypeScript sources but no `tsconfig.json`, with a `typecheck` error that says the gate did not run and how to add one, as it already did for a `tsconfig.json` with no `typescript` install. Before, the typecheck was reported as skipped and the check passed, so a project with type errors and no tsconfig got a green check. A project with only JavaScript (and declaration files) still skips the typecheck and passes.
111
+ - 5a5dbaf: `nifra dev`, `nifra build` and `nifra start` now read `--flag=value` as well as `--flag value` (`nifra build --target=vercel` builds for Vercel), and refuse an unknown flag, a stray argument or a flag missing its value with exit code 1 instead of ignoring it. Before, `nifra build --target=vercel` or a mistyped `--targt vercel` built the default target and exited 0. `--help` after one of these commands now prints the usage instead of starting the command.
112
+ - 6db673f: `nifra build`, `nifra sdk` and `nifra upgrade --write` now exit once they finish, even when the app they imported keeps the process alive (a database or Redis client, an interval). nifra waits two seconds, says on stderr what is holding the process, and exits with the command's own exit code, as the read-only commands such as `nifra routes` already did. Before, these commands finished their work and then never exited, so a CI step or script running them hung.
113
+ - 346fddb: A command run with `--json` that stops on an error (`nifra routes --json` outside a project, an unknown option, an exception the command throws) now prints `{ "ok": false, "error": "<message>" }` on stdout, beside the message on stderr and the same nonzero exit code. Before, stdout stayed empty, so a script or agent parsing it got a JSON parse error instead of the reason.
114
+ - 1a4a7a3: A cancelled or timed-out `nifra_run`, `nifra_render` or `nifra_ws` call, a replaced warm worker, and a cancelled or timed-out `nifra_hydrate` run now end even when the app catches SIGTERM. The child gets SIGTERM, then SIGKILL two seconds later, as `nifra_test` already did. Before, an app with a SIGTERM handler and a request that never answered kept the tool call waiting forever and left the process running after the MCP server moved on.
115
+ - 9176f43: The MCP tools, `nifra fix` and `nifra review` now refuse a project path that is a dangling symlink pointing outside the project, such as an `api-snapshot.json` linked to a file that does not exist yet elsewhere. Before, the containment check walked up to the link's existing parent, found it inside the project and allowed the path, so a write through the link created the file outside the project. A dangling link whose target is inside the project still works and resolves to that target.
116
+ - 7dae126: When `nifra mcp` hands the session to the project's own `@nifrajs/cli` (the project installs another release), that CLI now runs with no `.env` files loaded, the same as the server itself. Before, the hand-off started the project's `node_modules/.bin/nifra` shim, whose Bun loaded the project's `.env`, and the inherited marker then told that CLI the values were already gone, so the project's secrets stayed inside the MCP process. The hand-off now runs the script the package's `bin` names with `bun --no-env-file`.
117
+ - 1747473: `nifra mcp` now answers `initialize` (and `ping`) straight away while the app loads in the background, and a monorepo's apps load side by side. Before, the server read the app's declared tools before it answered anything, one app after another, so a backend whose import awaited a database connection held up the handshake for as long as the import took (up to 30 seconds per app), and an MCP client could give up on the server. Tool, resource and prompt calls still wait for the app as before.
118
+ - 4ff8188: `nifra migrate --from tailwind --to stylex --write` now places its StyleX import and `create()` block after the file's directives and imports even when comments sit around them. Before, a comment above `"use client"` put the block above the directive, so the file lost its client boundary, and a trailing `// comment` on the last import pushed the block to the end of the file, so the module threw a ReferenceError when it loaded.
119
+ - fc0eba0: The release verification runner, started as a script (`bun packages/cli/src/release-verification.ts`, which the nifra repository's `bun run verify` and `bun run check:release` use), now fails a gate whose `package.json` script is missing and skips the gates after it, with the missing script named in the fix. Before, the gate was reported as `undeclared` and the run still passed, so renaming a script silently dropped its gate from the release check. `nifra verify` and the `nifra_verify` MCP tool keep reporting such a gate as `undeclared` for a project that does not declare the nifra repository's scripts.
120
+ - 62bce1c: On Windows, `nifra fix`, `nifra review --sarif` and the other project path checks accept a project whose directory path has an 8.3 short name in it (such as `C:\Users\RUNNER~1`). The dangling-symlink check in this release (9176f43) compared the project root and the path through two canonicalizers, one that expands short names and one that keeps them, so every path in such a project read as outside it. Both sides now go through the same one.
121
+ - 03e8ebe: `nifra verify --release` runs the library test suites once. Its `coverage` gate already fails on any failing test, so the release plan no longer has a separate `tests` gate. A new `rest-tests` gate runs `bun run test:rest`, the suites the coverage run leaves out. The default plan (`nifra verify`) still runs `tests`.
122
+ - Updated dependencies [78b2a04]
123
+ - Updated dependencies [638efe5]
124
+ - Updated dependencies [2a0a5d3]
125
+ - Updated dependencies [abb4354]
126
+ - Updated dependencies [5372e3a]
127
+ - Updated dependencies [b276c67]
128
+ - Updated dependencies [50d510f]
129
+ - Updated dependencies [29d6649]
130
+ - Updated dependencies [2a0a5d3]
131
+ - Updated dependencies [72e1b4b]
132
+ - Updated dependencies [7bb8a67]
133
+ - Updated dependencies [513ec28]
134
+ - @nifrajs/web@5.1.0
135
+ - @nifrajs/agent-review@5.1.0
136
+ - @nifrajs/mcp@5.1.0
137
+ - @nifrajs/mcp-db@5.1.0
138
+ - @nifrajs/testing@5.1.0
139
+ - @nifrajs/core@5.1.0
140
+ - @nifrajs/runner@5.1.0
141
+ - @nifrajs/client@5.1.0
142
+ - @nifrajs/i18n@5.1.0
143
+ - @nifrajs/schema@5.1.0
144
+
145
+ ## 5.0.0
146
+
147
+ ### Major Changes
148
+
149
+ - 3db36b3: `createWebApp` serves `api` over HTTP only at the `apiPrefix` it is given; without one the backend is loader-only (`ctx.api`) and a request under `/api` reaches page routing. 4.x mounted it at `/api` by default. `nifra dev`, `nifra build`, `nifra routes` and the page-under-mount check (NF-C027) follow the same rule for `backend/framework.ts`.
150
+
151
+ `nifra check` reports a `backend/framework.ts` that sets no `apiPrefix` while `backend/app.ts` exports a backend (NF-C035, info), and `nifra fix --code NF-C035` adds `export const apiPrefix = "/api"` to keep the 4.x mount. Set `apiPrefix = ""` to state that the backend is loader-only.
152
+
153
+ - e7a275b: `nifra check` findings are silenced with one comment form: `// nifra-expect <code>: <reason>`, on the flagged line or anywhere in the comment block directly above it. It answers only the code it names. Every security finding (NF-S001 to NF-S006) and every error needs the reason; an advisory accepts the comment without one. The names `sql-dynamic` (NF-C006), `raw-response` (NF-C007), `reserved-segment` (NF-C018), `route-overlap` (NF-C024, NF-C025) and `param-modifier` (NF-C026) still work in place of the code, so `// nifra-expect route-overlap` now needs a reason too. A silenced security finding stays in the report as information, with the comment and its reason as evidence.
154
+
155
+ `@nifra-gate-reviewed` silences nothing: the finding under it fails as any other and names the comment to write instead. `nifra upgrade 5.0.0` lists every such comment with the line it covered and never writes a reason.
156
+
157
+ - 58e27a5: `nifra check` fails with NF-C038 on an app still on the retired root layout: a root `backend.ts` or `framework.ts` in an app with `routes/` or a config, or, elsewhere, one that exports `backend` or `adapter`. No contract gate reads those files there, so the check no longer passes without running them. The finding names `nifra migrate layout`. A `backend.ts` module in a project that is not a routed app, and exports no `backend`, is no longer read as the retired layout by any command. NF-C035 no longer reports an API-only app, which has no page routing for `/api` to fall into.
158
+ - eeee88b: `nifra check` reports a non-constant-time secret comparison (NF-S002) as advisory only for browser code inside a nifra web app: a directory with `nifra.config.ts` or `backend/framework.ts`, or whose nearest package.json depends on `@nifrajs/web` or a `@nifrajs/web-*` adapter. A `routes/` or `frontend/` file anywhere else, such as in an API-only project or a package without a web dependency, is server code, so the comparison fails the check. `nifra fix --code NF-S002` rewrites exactly the comparisons the check reports.
159
+ - 15a3a66: Root status pages (`_404.tsx`, `_<status>.tsx`) and `_error.tsx` render inside the layouts above them with their loader data, and the server puts a status page's `meta` in the head. For an unmatched URL the root middleware and layout loaders run first; otherwise the page reuses the layout data the request already loaded. When those layouts cannot render it (a loader throws, a gate or the middleware refuses) a root status page renders alone and is not hydrated, and an `_error` renders inside its layouts without their data, with the same status. A page rendered with layout data is `private, no-store`, and a client navigation that lands on one loads the URL as a document. `export const inLayouts = false` renders a page the 4.x way and runs no layout loader for it.
160
+
161
+ `createClientRouter` takes `layoutStatusRoutes`: status route ids whose page renders inside layouts, which a soft navigation loads as a document.
162
+
163
+ `nifra check` reports a root status page that imports the root layout to wrap itself, since it now renders that layout twice (NF-C034, warning). The site templates' `_404` pages no longer wrap the layout.
164
+
165
+ - 3976f19: `nifra check` follows the imports the bundler follows when it checks zones (NF-C028) and server-only imports (NF-C004): relative paths, tsconfig `paths` and `baseUrl` (through `extends`, from the nearest `tsconfig.json` or `jsconfig.json`), and package.json `imports`. A route that reaches backend code or a file in no zone through `~/lib/x` or `#db` is reported as it is through `../lib/x`. The app's `clientModule` counts as browser code wherever it lives: a `clientModule` in no zone or in backend code is an NF-C028 error at the config line, and what it imports is checked like a route's imports. A file in no zone is followed into what it imports, so every file the build would refuse is reported, each at its own import.
166
+
167
+ ### Minor Changes
168
+
169
+ - 78a639a: `"nifra": { "kind": "api" }` in package.json declares a project that serves no pages. `nifra check` reads it from the nearest package.json, statically, and there skips the checks that read zones (NF-C028 to NF-C033) and the server-only import check (NF-C004), and treats every file as server code for NF-S002. A directory with web config (`nifra.config.ts` exporting `adapter`, or `backend/framework.ts`) keeps its zone checks under the setting, and NF-C037 reports the clash as an error. A value other than `"api"` or `"web"` is an NF-C028 error naming the file. An NF-C028 or NF-C004 finding outside any web app now names the setting. Builds and dev servers do not read it.
170
+ - 503682a: A directory with `backend/app.ts` and no web config is read as an API-only app by `nifra routes`, `nifra context`, `nifra openapi` and `nifra mcp`. They load `backend/app.ts` alone, without an adapter. `nifra context` names the app API-only and lists no pages. `nifra routes --modes` says it has no page routes to read. The tools, resources and prompts the backend declares are listed by `nifra mcp`, and the `nifra://routes` and `nifra://openapi` resources answer. `nifra dev` and `nifra build` still need a web config; their error names the API-only reading when `backend/app.ts` exists.
171
+ - 0aed425: Required `basicAuth`, `bearer`, `apiKey` and `jwt` refuse in the `authenticate()` stage: before the body is read or validated and before any `derive` or `beforeHandle`. An unauthenticated request gets the 401 and its challenge, never a 413 or a 422, on every route shape, lane and WebSocket handshake. With valid credentials an invalid body is still a 422. `optional: true` never refuses and keeps validation first. A `verify` that throws in required mode is a 503. A rate limiter written as a `beforeHandle` behind these guards no longer sees refused requests; `rateLimit()` runs in `onRequest` and still counts them.
172
+
173
+ The `authenticate()` input adds `params`, the raw `search`, the parsed and frozen `query` (the parser `c.query` uses; a repeated key is an array) and the `request` (its body must not be read). The query is for short-lived, single-use tickets, such as one for a WebSocket handshake.
174
+
175
+ Project evidence and reflection keep a route's chosen `validationOrder`.
176
+
177
+ `nifra check` reports a route that claims runtime authentication, declares an input schema and authenticates in a hook that runs after validation (NF-S008, warning). It reads the backend the contract-lock check loads, so it runs when `contracts.lock.json` exists. Fix it with `authenticate()`, or with `validationOrder: "auth-before-validation"` on the route.
178
+
179
+ The dev feed (`nifra_logs`, `nifra_errors`, request traces and the persisted log) records a query's keys and never its values.
180
+
181
+ - 448817b: `nifra check` treats the mounts its assurance source declares `opaque` (a better-auth handler mounted with `mounts: [{ path, app, opaque }]`) as external mounts, so a `fetch` into one is no longer reported as a hand-rolled API call. A mount without that declaration, and a path that escapes the prefix with `..`, are still checked. The prefixes are listed with the `nifra.check.json` `externalMounts` in the report.
182
+ - 200a590: `nifra check` accepts `// nifra-expect NF-C002: <reason>` on a hand-rolled `fetch`, `EventSource` or `WebSocket` call to the app's own API, for a call no typed client covers, such as a static file or a foreign handler's endpoint. The finding stays in the report as `info`, with the comment as evidence. A comment with no reason after the colon silences nothing, and the error says so.
183
+ - 3b325d0: `nifra schemas` drafts `loaderOutput` and `actionOutput` from each loader's and action's TypeScript return type. A dry run reports what every route needs; `--write` puts a schema, marked `nifra:generated`, above each loader or action that has none, leaving out credential-like field names and values that are not JSON. Marked schemas are kept in step with the return type on later runs, and `nifra check` reports NF-C033 when one has drifted. Hand-written schemas are never rewritten: the report lists the returned fields each one drops, by path. Works with TypeScript 5, 6 and 7.
184
+ - b89f48b: The static route scan reads a path given as a module-level string `const`, with or without `as const`, in the same file or exported from a project file it imports, and a template with no substitution. Capability provenance and the route lints now see those routes. A route whose path is another expression, such as an interpolated template, gets an NF-C036 finding (info) that names the expression; `// nifra-expect NF-C036: <reason>` above the registration accepts it.
185
+ - 357c390: `nifra check` reports contract operations the source implements but `backend/app.ts` does not serve (NF-C039, a warning). It finds each `implement(contract, ...)` call from `@nifrajs/core/contract` in the checked package (a nested package with its own package.json is left to its own check) (also through a project module that re-exports it), reads the contract's `defineContract({...})` in the same file or in a module imported through a relative path or an alias, and compares each operation's method and path with the routes the backend serves, a group or mount prefix included. The served routes come from the backend the contract-lock check loads, so the comparison runs when `contracts.lock.json` exists. With no `backend/app.ts`, one finding counts the implemented operations no gate can see. An operation whose method or path is not a string literal, or a contract the scan cannot read, is reported instead of skipped.
186
+ - c87bf7c: `nifra check` reports NF-C030 (a loader or action without its output schema) as an error when the
187
+ function's own body returns a data literal: an object, array, string, template, number or boolean,
188
+ as an expression body or a `return` of the function itself, including one inside `if`, `else`,
189
+ `for`, `while`, `try` or a `switch` case. The runtime refuses every request that reaches such a
190
+ return. A `return` inside a nested function, method, class or braced `case` block, and any
191
+ expression whose value the source does not show (a call, a variable, a ternary), keep the warning.
192
+ - 412a9ee: The Bun dev server answers only loopback host names (`localhost`, `*.localhost`, `127.0.0.1`, `[::1]`) and refuses any other `Host` with 403. It already listened on 127.0.0.1 only, but answered any `Host`, so a page on another site whose name a DNS rebind pointed at 127.0.0.1 could read SSR pages, loader data and the error overlay. A name the server should answer under (a hosts-file entry, a tunnel) goes in the new `allowedHosts` option of `createDevServer`, or in `export const dev = { allowedHosts: [...] }` in `nifra.config.ts`.
193
+ - b9cc68c: `nifra doctor` flags a `buildManifest(...)` call whose file list, an array literal or
194
+ `import.meta.glob` patterns, reaches a page under `routes/` but not the `.backend.*` half beside it.
195
+ `buildManifest` pairs the halves only from the list it is given, so such a manifest serves that page
196
+ without its loader, action and guards, which a test then passes against. The advisory names the
197
+ missing halves and points to `discoverRoutes(dir)` from `@nifrajs/web/fs` or the generated
198
+ `server-manifest`. It never fails the run. The testing guide documents both as the way to give a test
199
+ the routes the app serves.
200
+ - 1a6616f: `reflectHooks(server)` from `@nifrajs/core/reflection` reports, for every route and for each prefix's unmatched paths, the hooks that run in order: their kind, the plugin or function name, and the site that registered them (`app`, `group <prefix>`, `merge #n`, `mount <path>`). Static `responseHeaders()` declarations appear with their header names. Origins are recorded only outside production builds; a production report sets `complete: false`.
201
+
202
+ `nifra routes --hooks [--json]` prints that report, and `--since <file>` prints only what runs differently from a saved one. `nifra upgrade --write` saves the report to `.nifra/hooks-before-upgrade.json` before it edits anything and prints the hook-scope diff (`--no-hooks` skips it). `nifra check --json` includes the report as `hooks` when `nifra.assurance.ts` names a `source`.
203
+
204
+ - 846e2f6: `invariants` in `nifra.assurance.ts` accepts the L4 runner's fixture options - `witnesses`, `prepareRequest`, `isRejected`, `include` and `maxMutationsPerInput` - and `nifra levels` and the `nifra_levels` MCP tool pass them to every L4 run. `invariants.setup` provisions a throwaway target only when L4 runs: it is called once, before the first L4 request and never when the config is imported, and the `teardown` it returns runs after the run, a failing one included. A config needs an `executor`, a `setup`, or both. The contract witness and case-context types now live in `@nifrajs/core/assurance`; `@nifrajs/testing` re-exports them unchanged.
205
+ - d3e79c4: A layout's `meta` receives its own loader data as `data`, the value its component renders, or `null` when the layout has no loader, and the page's data as `pageData`. A layout that loads the locale sets `<html lang>` from its data, and a client navigation keeps it, since the soft-navigation head resolves each layout's `meta` with the same data the server used. A page's `meta` is unchanged and also receives `pageData`. `resolveChainMeta` from `@nifrajs/web/client` resolves a route's `meta` chain this way. Generated route types add `Route.MetaArgs`, typed with the module's own loader data.
206
+
207
+ Upgrading: a layout `meta` that read the page's data as `data` reads `pageData` now. `nifra check` reports a layout with no loader whose `meta` reads `data` (NF-C040), and the 5.0.0 upgrade notes name the change.
208
+
209
+ - 66554bd: `nifra migrate layout` migrates an API-only app: one that declares `"nifra": { "kind": "api" }`, or has no web config, no `routes/` and a `backend.ts` that exports `backend`. Only `backend.ts` moves, to `backend/app.ts`, with its own relative imports and the imports that name it. Nothing is split or zoned. The migration adds `backend` to tsconfig `include` and `.nifra/` to `.gitignore`, and adds `"nifra": { "kind": "api" }` to package.json when the app declares no kind: the dry run lists it, `--write` writes it. Web config without `routes/` stops the migration with the choice to make, and so does a declared API kind beside web config. The JSON result carries `mode: "web" | "api"`.
210
+ - 47d1723: `nifra migrate layout` follows imports through tsconfig `paths` and `baseUrl` and package.json `imports`, so a module reached only through an alias is zoned and moved like any other. An alias import of a moved module is rewritten through the same alias, keeping its style (extension, index), when one of that alias's targets covers the new location; otherwise it is left as written and reported. The config's `clientModule` and `componentPipeline.entries` paths are entries too: `clientModule` and `entries.client` are browser code, `entries.ssr` and `entries.rsc` server code, and each path is rewritten when its module moves. A specifier that names no installed package, built-in or app file is reported instead of skipped.
211
+ - fc0284a: Add opt-in server components across React, Vue, Svelte, Solid and Preact. Closed schemas project public props, owner GET admission and read capabilities govern every refresh, and private responses bypass shared caches. React uses native Flight; Vue, Svelte, Solid and Preact preserve native island state and owned ranges.
212
+
213
+ Add coordinated Vite builds and development generations, guarded component references, generated Bun/Node/Deno/Workers/Pages/Vercel outputs, typed outlets, router and server-function refresh integration, and release certification for browsers, packaged consumers, resource limits and performance. Existing applications retain their default rendering pipeline.
214
+
215
+ Reuse registered Web middleware continuations across requests while retaining request-local state.
216
+
217
+ - 9f58295: An opaque mount can declare the routes it serves: `opaque: { reason, routes: [{ method, path, capabilities }] }` on `mount()`, `mountFetch()` and a `createWebApp` `mounts` entry. Capability assurance reports those routes with `analysis: "declared"` beside the known gap, checks their capabilities against the policy (an unknown id, or a domain write on a safe method, fails), and records them in the lockfile. `reflectMounts` returns them, project evidence carries them, the `nifra context` index lists them, and an adversarial contract run notes them as having no contract to test. A malformed declaration or a path outside the mount stops the analysis with an error that names it. A mount without a reason fails as before.
218
+ - fe75b54: CLI commands that import the app only to read its declarations (`check`, `routes`, `context`, `openapi`, `contracts`, `capabilities`, `manifest`, `doctor`, `diff`, `sync-routes`, `sync-manifest`, and `assure` without its bundle flags) set `NIFRA_REFLECT` to the command name first, so app code can skip connecting to its services. A catalog command whose app keeps the process open after the command has answered (a client that reconnects, an interval) now exits 2 seconds later with its own exit code and a note, instead of running until it is killed.
219
+ - b70b18a: The generated `./+types/<name>` module declares `Route.Loader` and `Route.Action`. Annotate a
220
+ route's loader, `export const loader: Route.Loader = async ({ params, api }) => ...`, and what it
221
+ returns is checked against `loaderOutput` at compile time. A field of the wrong type, a `defer(...)`
222
+ whose value does not match its `t.deferred(...)` field, or any data from a loader with no
223
+ `loaderOutput` is a type error. A redirect, a `Response` and returning nothing stay allowed.
224
+ `Route.Action` does the same against `actionOutput`, `revalidate(paths, data)` included. A field the
225
+ schema does not declare is not a type error, because the output guard drops it.
226
+
227
+ `@nifrajs/client` exports the types behind them: `InputOf<Module, Name>` (what a route module's
228
+ output schema accepts), `RouteLoaderReturn<Module>` and `RouteActionReturn<Module>`.
229
+
230
+ `nifra scaffold` and the `create-nifra` starters write the annotation. `nifra schemas` reports a
231
+ generated schema over an annotated loader or action as unchecked (NF-C033 warns), because the
232
+ annotation, not the body, is then the function's return type.
233
+
234
+ - b5607a3: `nifra check` and `nifra capabilities` read a WebSocket route's path given as a module-level string `const`, in the same file or imported from a project file, as they do for HTTP routes. A socket path built at runtime gets the same NF-C036 finding, listed as `WS`.
235
+ - 8d55d0b: The interpolated-SQL check (NF-C006) reads a function-local `const` as static text when its initializer is, so `const dir = desc ? "DESC" : "ASC"` or `const cols = "id, email"` inside a handler no longer flags. It also reads `.join(sep?)` with a literal or absent separator over an array that still holds its literal elements: an inline array, `Object.freeze([...])`, or a `const` array in the same file that is not exported and is only ever read with `.join()`, `.includes()`, `.indexOf()` or `.length`. An imported array counts only when frozen; `as const` does not count. A `let`, a parameter, an array that is pushed to, passed to a call or exported unfrozen, a shadowed name, and a template with a call inside still flag.
236
+ - a18cef3: `nifra upgrade 5.0.0` pins the fixed group to 5.0.0 and prints each changed default with the `nifra check` finding or the one-line setting that keeps the 4.x behavior: the backend's `apiPrefix` (NF-C035), status pages inside their layouts (NF-C034, `inLayouts = false`), the WebSocket handshake's route chain, per-request Response ownership, and the optional `invariants.executor`.
237
+ - b782d6c: `nifra doctor` and `nifra check` report mixed nifra versions in one workspace. They read the
238
+ versions pinned in `package.json` files, the versions installed in `node_modules` (followed to their
239
+ real location, so a linked repository reports its own) and the running CLI. When more than one
240
+ version appears, doctor prints an advisory naming each version and its source, and check reports
241
+ `NF-D002` (info) with the fix `nifra upgrade <highest>`, which runs each release's migration steps
242
+ before re-pinning. Neither fails the run, and both only read files.
243
+
244
+ The `nifra upgrade` plan now lists group packages linked from outside the workspace root under
245
+ "Left alone" (`UpgradePlan.linkedOutside`). The upgrade edits only files under the root and never
246
+ follows a symlinked package directory or `package.json`.
247
+
248
+ - e0a25fe: `app.ws(path, { capabilities })` declares the capability ids a socket's code may reach, as an HTTP route's `capabilities` does. Reflection lists them on the `"WS"` route, and `nifra capabilities check` covers sockets: it finds each `.ws("/path", ...)` registration, compares the declaration with the effects reachable from that module, and reports an undeclared reach. A write whose definition needs request idempotency fails on a socket, which has no request idempotency. The handshake context carries the guard, so a runtime capability beacon in `upgrade()` fails closed on an undeclared capability.
249
+ - 3630b6e: `reflectRoutes()` lists each WebSocket route under the pseudo-method `"WS"`, after the HTTP routes, with the evidence its handshake enforces: `nifra.authenticated` from the auth guards registered before it and `nifra.rate-limited` from the app's request hooks. A socket never claims evidence whose enforcement its message handlers bypass. Route assurance therefore classifies every socket, and an assurance rule selects sockets with `methods: ["WS"]`; a policy whose rules name only HTTP methods reports each socket as `unclassified-route`.
250
+
251
+ ### Patch Changes
252
+
253
+ - Preserve the complete compiler file list when Bun exits with buffered output, so fresh scaffolds and large projects receive accurate TypeScript program coverage checks.
254
+ - Normalize upgrade and version-drift report paths across Windows and Unix, and reject invalid TypeScript path substitutions with multiple wildcards.
255
+
256
+ - 22e3df7: feat(web): the app's package.json can set zones with `"nifra": { "zones": { ... } }`. `packages` gives a side to packages that do not declare one, by exact name or a trailing-`*` prefix (`"@shop/*": "library"`); a package's own declaration still wins. `backend`, `frontend` and `shared` list extra app folders that count as that zone folder (`"backend": ["migrations"]`). Every build, dev server, `nifra check` and the TypeScript plugin read the setting; an invalid one fails with the exact key. An undeclared package is now reported once for the whole package, in the build and in `nifra check`, instead of once per file.
257
+ - 4ce36d6: `nifra check` treats a module as backend-only only when it imports `@nifrajs/web/backend-only` in code. A mention of that import in a comment or a string, such as a note on how to opt in, no longer makes every route that imports the module fail with a server-only import error.
258
+ - 8325581: Capability provenance follows an installed package hoisted above the app (a monorepo's root `node_modules`) the way it already followed one in the app's own `node_modules`. A route reaching a forbidden import through a hoisted package reported clean.
259
+ - ad489d5: Capability provenance now follows imports into a workspace package that lives beside the app, as in an `apps/web` + `packages/*` monorepo. Before, a route reaching a forbidden import through such a package reported clean, because the walk stopped at any module outside the app directory. Installed packages under `node_modules` outside the app are still not entered.
260
+ - b2fe060: `nifra check`'s server-only import walk (NF-C004) no longer stops at 8 hops or 200 modules. A sink past either limit, such as one module in a barrel of 250, was dropped without a word and the check passed. The walk now reads, parses and resolves each module once per check and searches each module's chain once, however many routes share it: 400 routes over 250 shared modules went from about 101,000 module reads and 1.3 s to 251 reads and 49 ms. `createServerOnlyChains` is the per-check entry point; `resolveServerOnlyChains` still answers for one module.
261
+ - f2f037e: The `nifra check` help and the CLI README now say that with a `contracts.lock.json`, `nifra check` imports `backend/app.ts`, running its top-level code, in `--lints-only` mode too, to compare the routes it serves against the lock. They described the gate as static only.
262
+ - d8315d2: `nifra check` keeps an interpolated-SQL site that a `// nifra-expect NF-C006: <reason>` comment silences in the report, as information carrying the comment's reason, as it already did for silenced security findings. A silenced finding from a rule outside the named sections is now reported with severity `info` instead of `warning`, and a report section that holds only information is marked `•` and `(info)` instead of the warning sign.
263
+ - eb37e45: The `nifra check` report counts info findings as info, not as advisory: a section reads `⚠ <rule>: 1 (advisory) (+1 info)` or `✗ <rule>: 1 (+1 info)`, and the closing line reads `✓ check passed (1 advisory, 2 info)`. Before, a silenced finding (info) was counted as advisory.
264
+ - 21adacc: `nifra check` reads an output schema given by name. `export const loaderOutput = userOutput` (or `output: userOutput` on a server function) passed NF-C031 even when `userOutput` named a credential field, because only the text after the `=` was read. The check now follows a bare name to its top-level declaration in the same file, through aliases, and reports each sensitive field once.
265
+ - 83dccf3: NF-C031 reads the schemas an output schema names inside it (`t.object({ user: userSchema })`, `t.array(member)`) and schemas imported from another project file, each where it is declared. A sensitive field in such a schema passed `nifra check` and failed only when the route loaded. A schema under `t.declassified(...)` is not followed, and a schema shared by several routes is reported once, at its declaration.
266
+ - 0d5c101: `nifra check` reads every file a build loads, not only TypeScript. `.jsx`, `.svelte` and `.vue` files, and `.js`/`.mjs`/`.cjs` files under `routes/`, `frontend/`, `shared/` or `backend/` (or with a zone suffix), now get the source rules: a `.jsx` or `.svelte` route importing `pg`, reading `process.env.DATABASE_URL` or carrying a secret key passed before. Svelte and Vue files are scanned as their `<script>` blocks, with the whole file read where markup can hold code, and this works on a TypeScript 7 install too. JavaScript files outside a zone (bundler configs, scripts) stay out of the scan.
267
+ - 9e041e6: `nifra check` no longer compares every pair of routes in a file for overlaps (NF-C024): only routes whose leading literal segments agree are compared, so a file with 2,000 routes under distinct prefixes is checked in milliseconds instead of seconds. The verification work graph de-duplicates edges and walks impact through an edge index, so building and querying it grow linearly with the number of routes.
268
+ - 4d894b0: `nifra check`'s server-only import rule (NF-C004) names server code the way the browser build does. It knew eight drivers; it now takes the build's list of server packages and driver entries (`stripe`, `@prisma/client`, `jsonwebtoken`, `bcrypt`, `nodemailer` and the rest), bare Node builtins with no browser counterpart (`fs`, `child_process`, `crypto`, ...), `require("x")` and `import x = require("x")`, and an installed workspace package that declares `"nifra": { "environment": "backend" }`. Bare `events`, `buffer`, `path` and `util` still pass, since each also names a browser polyfill. `@nifrajs/web/zones` exports the check as `isServerPackageSpecifier`.
269
+ - a9a7317: `nifra check`'s interpolated-SQL rule (NF-C006) now reads the ways a statement reaches a driver that it used to miss:
270
+
271
+ - A statement held in a `var` or a reassigned `let`, or built up in steps (`let q = "SELECT …"; q += \` AND name = '${name}'\``). The rule checks every value assigned to the variable.
272
+ - A pg or mysql2 config object (`{ text }` or `{ sql }`).
273
+ - node-sqlite3's `all`/`get`/`each` and pg-promise's `any`/`one`/`none`/`many` and related calls. These names are common outside SQL, so these calls, and bare calls such as a destructured `query(…)`, only flag text that starts like a statement.
274
+ - A statement passed through `String(…)`, `.trim()`, `.toString()`, `.concat(…)` or `[…].join(…)`.
275
+ - A template that only joins values (`` `${where}` ``).
276
+ - A template-literal method key (`` db[`query`](…) ``).
277
+ - A same-file function that passes one of its parameters to a query. Its callers are now checked.
278
+
279
+ A `sql` tag that the same file defines as a function is no longer trusted as a driver's binding tag. A `nifra-expect NF-C006` marker now has to sit in a comment; inside a string the call passes, it no longer silences the finding.
280
+
281
+ - b2e1ad2: A cancelled `nifra check` (an MCP cancel, or Ctrl+C) now stops every process its typecheck started, not only the `tsc` entry, so it ends at once instead of waiting for a compiler process still holding its output. Ctrl+C in a terminal still stops the check.
282
+ - 19eb11d: feat(check): `nifra check` fails the typecheck when TypeScript files under `routes/`, `frontend/`, `backend/` or `shared/` sit outside the tsc program, so a stale tsconfig `include` can no longer pass a typecheck that never read them. One finding per folder lists the files. A file the tsconfig's `exclude` names (inherited through `extends`) is out on purpose and not reported; others kept out on purpose go under `"typecheck": { "ignore": [...] }` in `nifra.check.json`.
283
+ - 1bf6625: `nifra check`'s zone rules (NF-C028, NF-C029, NF-C032 and the data guards) see every file the build zones. A file outside `routes/`, `frontend/`, `backend/` and `shared/` was skipped, so a folder declared in `"nifra": { "zones": { "frontend": [...] } }` and a `lib/x.frontend.ts` file could read private environment variables or carry a secret key without a finding. Such a file now belongs to the nearest app around it. A relative project root passed to `collectCheckResult` is resolved first; before, it left every file unzoned.
284
+ - ea2e861: `nifra check` and `nifra doctor` read a regex literal that contains a quote or backtick as a regex, so the code after it is no longer misread as a string or a template.
285
+ - 0feb6f4: Flags typed before the command (`nifra --json check`, `nifra --env-file .env dev`) now reach the command instead of being silently ignored.
286
+ - de63922: `nifra mcp` exits when its client closes stdin, also after a `warm: true` call to `nifra_run` or `nifra_render`. The warm worker those calls start used to keep the server process alive after the session ended. The server now stops every warm worker and starts no new ones once stdin closes.
287
+ - e57f36c: `nifra migrate layout` keeps the import a page's classic JSX compiles to. A route written with a `/** @jsx h */` pragma lost `import { h } from "preact"` when its loader moved to the backend half, because no identifier in the page names `h`. JSX now counts as a use of the `@jsx` and `@jsxFrag` pragma bindings, or of `React` when the file sets neither and no `@jsxImportSource`.
288
+ - 817492d: fix(cli): `@nifrajs/cli` no longer depends on `create-nifra`. It ships its own copy of the agent-file generators, so installing the CLI pulls in only `@nifrajs/*` packages and a scoped release-age exclusion covers the whole tree.
289
+ - fcbbfa8: `nifra scaffold` and the `nifra_scaffold` tool write a vanilla page as `routes/<name>.tsx`. They wrote `routes/<name>.ts`, which route discovery does not read as a page, so the app failed to load with `"<name>.backend.ts" has no frontend half`. The page needs no JSX to use the `.tsx` extension.
290
+ - 232df6f: `nifra sdk --language python` writes a model's required fields before its optional ones. A model that listed an optional property before a required one produced a dataclass that Python refused to import (`non-default argument follows default argument`). Each group keeps the schema's order.
291
+ - 917f942: The MCP tools that run project code in a subprocess (`nifra_test`, `nifra_run`, `nifra_render`, `nifra_ws`, the database tools and the app's own tools) end on time when their timeout or a cancel fires. A process the project started could hold the output pipes open after its parent was killed, so a 2 second `nifra_test` timeout took as long as that process lived. On macOS and Linux these subprocesses now lead their own process group, and stopping one stops everything it started. `nifra_test` follows a SIGTERM with SIGKILL after two seconds.
292
+ - 4330e40: Server components and `nifra check` no longer crash on a project that installs TypeScript 7. TypeScript 7's package exports only `version`, with no in-process compiler API, so loading the component pipeline used to fail with a TypeError on first use. The pipeline now raises `NIFRA_TS_UNSUPPORTED` with the fix: pin the project to TypeScript 6. `nifra check` reports the same code. It gives no component module a receipt, so each one is checked as an ordinary backend import. The pipeline reads `componentPipeline` from a config file through `staticComponentPipeline` in `@nifrajs/web/server-components/source`.
293
+ - 82b511f: NF-C039 counts a contract's operations as served only where one mount prefix serves them together. Each operation was matched on its own by path suffix, so a `/` operation matched any route of its method and `/:id` matched any route ending in `/:id`: an implementation `backend/app.ts` never mounted could pass when unrelated routes happened to end the same way.
294
+ - 8c2c76a: feat(contracts): `contracts.lock.json` records the digest format it was hashed with. A lock from another format fails `nifra contracts check` (NF-K001) with one "re-snapshot" diagnostic instead of reporting every route as changed, and a lock without a format notes that it may predate the 4.0.1 rehash when it reports drift.
295
+ - 77621c5: `nifra dev --bun` now carries a bunfig string holding a newline, tab or other control character into the dev server's config intact; such a value used to make the generated config unparseable.
296
+ - 4db7481: `nifra dev` on Bun applies the `package.json` single-copy declaration (`"nifra": { "singleCopy": [...] }`) to the browser bundle, as `buildClient` does, so a linked package with its own copy of a declared package loads the app's copy without a `clientPlugins` entry. An app that also lists `singleCopyPlugin()` gets that instance in the resolver's place, once.
297
+ - 39e2346: `nifra diff` with a missing baseline says where it looked and to create it with `nifra snapshot`, instead of a raw file error. Its text output lists each change with its severity, breaking first, and a summary line; the `--json` shape is unchanged. `nifra snapshot` and `nifra diff` on an app still on the retired root layout name `nifra migrate layout`. The contract proof reports a baseline outside the project as `the baseline <path> is outside the project directory`, a symlink that leaves it included.
298
+ - 26c584e: `nifra doctor` (and the undeclared-dependency rule in `nifra check`) now read `tsconfig.json` the way TypeScript does. It used strict `JSON.parse` and ignored `extends`. A tsconfig with a comment or a trailing comma, or one that takes its `paths` from a shared base, made every alias import look like an undeclared package and failed the check. Doctor now uses the nearest tsconfig at or above each package, follows its `extends` chain, and accepts comments and trailing commas.
299
+ - 714ba4b: `nifra check` reports packages duplicated with the same cause and install topology as one `duplicate-install` finding: the message names every package, and the fix and suggested config carry one `singleCopy` list covering all of them. `identityPreflight` in `--json` output still lists each package.
300
+ - 96f440d: `nifra check` reads a `nifra-expect` marker on a finding's own line only from that line's comment. A marker inside a string literal on the flagged line, such as `token === expected ? "nifra-expect NF-S002: ..." : ""`, no longer silences or downgrades the finding.
301
+ - cc81d85: `nifra check`'s fail-open gate rule (NF-S001) now reads a gate's catch block as code. Before, the words "throw" or "return false" anywhere in the block counted as failing closed, even inside a comment, a string, or a callback the catch never runs. The rule also recognises more gate names:
302
+
303
+ - `authenticate…`, `authorise…` and names ending in `Guard`.
304
+ - `ensure`, `verify`, `check` or `validate` followed by what a gate decides on, such as `verifyToken`, `ensureLoggedIn` or `checkPermission`. `ensureDir` and `checkHealth` are still not treated as gates.
305
+
306
+ - 7c32c99: A `nifra:generated` output schema that was edited by hand is no longer reported as current. Before, `nifra schemas` and `nifra check` (NF-C033) compared only the hash in the marker line with a fresh render. The marker still matched after an edit, so a schema widened to `t.json()` passed. Both now also compare the schema's text with what `nifra schemas --write` would write. Reformatting, comments, quote style, quoted keys, trailing commas and semicolons do not count as edits. An edited schema is reported as stale with `edited: true`, and `--write` restores the generated version.
307
+ - 077657f: `server({ gracefulSignals: { drainMs } })`, and `serve(app, { signals: { drainMs } })` on Node and Deno, set how long in-flight requests get to finish when SIGTERM or SIGINT stops the server before the stop forces them closed. `true` keeps the 10 second default. `nifra doctor` counts the object form as a graceful lifecycle.
308
+ - 9a71e97: A hydration run (`nifra assure --hydration`, `nifra replay`) that times out or is cancelled now stops every process the project's code started, not only its own child, so it ends at its timeout instead of waiting on a process still holding its output. Ctrl+C in a terminal still stops the run.
309
+ - 6d92f92: `nifra init-agents` now reports a symlinked agent file (a `CLAUDE.md` aliased to `AGENTS.md`, say) as left alone and writes the rest, instead of stopping the whole run. It still never writes through a symlink.
310
+ - 437d3cd: `postgresRoleSql` and `nifra db-role` grant the role `SELECT` on each allowed schema only. On Postgres 14 and later, with nothing excluded, the role used to get `pg_read_all_data`, which reads every schema in the database whatever `schemas` named.
311
+ - 3caaa91: On Windows, the `nifra_explain` MCP tool no longer shows a source codeframe for a file on another drive than the project; only files inside the project are shown.
312
+ - 4877175: The `nifra_routes` MCP tool now holds `since` to the project directory, like every other path argument, instead of reading a hook report from any path.
313
+ - 177915f: fix(mcp): `nifra mcp` re-reads the nifra version the project installs on every tool call, not only at startup. After an upgrade during a session, the version-sensitive tools (`nifra_check`, `nifra_types`, `nifra_docs`, `nifra_example`, `nifra_assure`, `nifra_contracts`) refuse with the restart fix instead of answering for the release the server started with.
314
+ - ca54a23: `nifra mcp` started at a workspace root no longer walks every `node_modules` below a `**` workspace pattern to find the nifra app. The probe reads only the directories a pattern can match, within a fixed budget, and an unreadable `node_modules` no longer makes it fail.
315
+ - 4893381: The `nifra_ws` MCP tool starts the project's backend on 127.0.0.1 for its WebSocket check. It listened on every interface, so the app, with its environment loaded, was reachable from the network while the check ran.
316
+ - 347d7f4: `nifra migrate layout` keeps the `;` a file was written with on every import and export it rebuilds. A module that imports a moved export (`loader`, `action`, ...) from a route, a test included, now imports it from the route's backend half, and a statement that also names what stayed is split in two; a namespace or dynamic import that reads a moved name, and `export *`, are reported. When the app is one folder down in a package (`--dir src`), imports in the code beside it that the migration moves or splits out from under them are reported with the new path, and run from the package folder it names the `--dir` to use. A loader or action without an output schema is reported with `nifra schemas --write` as the way to draft one.
317
+ - 20016a1: `nifra migrate layout --write` runs on a machine without git, falling back to the app's own `.gitignore` to decide whether `.nifra/` is ignored. It now removes only the folders its moves emptied, leaving folders that were already empty in place.
318
+ - d96c958: feat(cli): `nifra migrate layout` updates the tooling around moved code. It rewrites `mock.module()`, `vi.mock()` and `jest.mock()` paths with the imports, adds the zone folders moved TypeScript lands in to tsconfig `include` (editing only that array, comments kept), adds `.nifra/` to `.gitignore` when nothing ignores it, and reports Tailwind `content` globs that no longer match moved files. Data files (JSON, YAML, CSV and similar) are reported instead of moved, since other tools may read them by path, and folders listed under `"nifra": { "zones" }` in package.json stay where they are.
319
+ - 838187b: `nifra port` now scans a source file whose name only starts with "build" (such as `buildings.ts`). It still skips build scripts: `build.ts`, `build-<target>.ts` and `build.<name>.ts`.
320
+ - 3fc5246: The generated Python SDK imports when a named array or union schema refers to a model declared after it: model aliases are now lazy `type` statements. Responses and error bodies typed by an alias now decode into their models instead of staying plain dicts.
321
+ - e6cfcd7: `nifra verify --release` runs the sitemap gate (`check:sitemap`), which the default plan already ran. The full release plan skipped it, so a docs page added or removed without regenerating the sitemap passed release verification.
322
+ - 7396253: `nifra replay` and the `nifra_replay` MCP tool now work in a project reached through a symlinked directory, and refuse a replay file that is itself a link out of the project.
323
+ - 0d439a5: `nifra review` files every built-in check code under its own check. Codes added after NF-C023 fell through to `configuration`, so a private environment read or a credential in browser code (NF-C029, NF-C032) and the output-schema data guard (NF-C030, NF-C031, NF-C033) were reported as configuration rather than security. Route-table codes now report under `route-boundary`, zone imports under `server-boundary`, and contract visibility (NF-C039) under `contract-witness`.
324
+ - aed07a2: `nifra review --diff` no longer drops a server-only import finding (NF-C004) whose route did not change. When a changed module adds the import that pulls server code into the browser bundle, the finding is reported on the route's import line. Review now keeps the finding in scope when any project file on the chain changed. Each NF-C004 finding records the files its chain runs through, and the diagnostic's compatibility view carries them as `modules`.
325
+ - 7f12784: `nifra check` no longer reports these as non-constant-time secret comparisons (NF-S002): a comparison against `true` or `false`; a name whose last word states a fact about the secret rather than holding it (`type`, `kind`, `name`, `id`, `ids`, `length`, `len`, `count`, `size`, `mode`, `policy`, `version`, `sqlstate`, `status`, `enabled`, `required`, `ttl`, `expiry`, `expires`), such as `tokenType` or `SECRET_CAP_SQLSTATE`; and a comparison of two configuration reads (`process.env.X`, `Bun.env.X`, `import.meta.env.X`, `Deno.env.get("X")`, and `env.X` or `c.env.UPPER_SNAKE` where `env` or `c` is a parameter of the enclosing function). The secret word anywhere else in a name still matches, so `tokenValue`, `passwordHash`, `secretCode` and `tokenPrefix` are still reported, as is a configuration read compared with anything else.
326
+ - cda6392: `nifra check`'s interpolated SQL rule (NF-C006) reads a `$${...}` span as a Postgres placeholder number when the expression provably evaluates to a number: arithmetic other than `+` (which always yields one), a `+` of two numbers, the index parameter of an array callback (`map`, `forEach`, `Array.from` and the like) that is never reassigned, a `const` or `for` counter that only ever holds numbers, `params.push(...)`, `Number`/`parseInt`/`parseFloat`/`Math.*`, and the `.length` of an array a local binding builds from a literal. `xs.map(fn).join(...)` and `Array.from(n, fn).join(...)` resolve when the callback's text does, so batch `VALUES ($1, $2), ...` and `IN ($1, $2, ...)` lists no longer need a `nifra-expect` comment, and a local array built with `.push(...)` of such text (a `WHERE` builder) resolves as well. A type annotation proves nothing, so a parameter typed `number` still flags.
327
+ - 25d3d2b: `nifra migrate --from tailwind --to stylex` now rewrites only real JSX `className` attributes. A `className=` inside a template literal, string, comment, regex or JSX text is left as written, and a `.ts` module (which cannot hold JSX) is not rewritten.
328
+ - f4e6ce5: `nifra upgrade --write --json` now prints one JSON document: the post-upgrade check result is included as `check` instead of being printed as a text report after the JSON.
329
+ - 2b8aa01: `nifra upgrade` moves the fixed group's pins in `overrides` (npm and Bun, nested ones included), `resolutions` (Yarn and Bun) and `pnpm.overrides` along with the dependency fields, refusing a rollback there the same way, and rewrites each pin only inside the field it was read from. An override also counts toward the installed version that picks the recipes to run and toward the mixed-versions report in `nifra doctor` and `nifra check`. Another version pinned outside package.json is listed with its line and never edited: MCP configs such as `.mcp.json`, Dockerfiles and compose files, CI workflows, and lockfiles other than the workspace's own, with a note to regenerate them. The JSON plan carries them as `strayPins`.
330
+ - 47ed9a9: `nifra check` runs the checks that read zones (NF-C028 to NF-C033) and the server-only import check (NF-C004) only on nifra code. The directory the check runs in always counts. Below it, a package whose package.json names neither `nifra` nor a `@nifrajs/` package and has no `nifra` setting, with no `nifra.config.ts` or `backend/framework.ts` on the way up, is another project, such as another framework's app kept in the same repository, so its `routes/` folder is not read as nifra routes.
331
+ - Updated dependencies [7169820]
332
+ - Updated dependencies [42153fb]
333
+ - Updated dependencies [22e3df7]
334
+ - Updated dependencies [a0a02f4]
335
+ - Updated dependencies [0aed425]
336
+ - Updated dependencies [eaf030b]
337
+ - Updated dependencies [7de0397]
338
+ - Updated dependencies [1af7543]
339
+ - Updated dependencies [674c658]
340
+ - Updated dependencies [de27557]
341
+ - Updated dependencies [dd0e530]
342
+ - Updated dependencies [2173644]
343
+ - Updated dependencies [c333ca7]
344
+ - Updated dependencies [4d894b0]
345
+ - Updated dependencies [4edee67]
346
+ - Updated dependencies [281f5de]
347
+ - Updated dependencies [6a95376]
348
+ - Updated dependencies [6426107]
349
+ - Updated dependencies [23b3672]
350
+ - Updated dependencies [61901cd]
351
+ - Updated dependencies [5e366e2]
352
+ - Updated dependencies [2938a0d]
353
+ - Updated dependencies [dc8439c]
354
+ - Updated dependencies [b19cb37]
355
+ - Updated dependencies [4330e40]
356
+ - Updated dependencies [4199ff3]
357
+ - Updated dependencies [90d9ee6]
358
+ - Updated dependencies [364a234]
359
+ - Updated dependencies [c06cba5]
360
+ - Updated dependencies [f4d3852]
361
+ - Updated dependencies [4a82ae0]
362
+ - Updated dependencies [0ff867a]
363
+ - Updated dependencies [e7391bf]
364
+ - Updated dependencies [0b80a59]
365
+ - Updated dependencies [c64db12]
366
+ - Updated dependencies [3753104]
367
+ - Updated dependencies [4b3b1fa]
368
+ - Updated dependencies [3562557]
369
+ - Updated dependencies [53087f3]
370
+ - Updated dependencies [2def6c7]
371
+ - Updated dependencies [b5b5bc3]
372
+ - Updated dependencies [22e1777]
373
+ - Updated dependencies [3a483cd]
374
+ - Updated dependencies [35f52c7]
375
+ - Updated dependencies [343cb81]
376
+ - Updated dependencies [8860117]
377
+ - Updated dependencies [412a9ee]
378
+ - Updated dependencies [65883e5]
379
+ - Updated dependencies [0e20529]
380
+ - Updated dependencies [d91fd44]
381
+ - Updated dependencies [f7e36ec]
382
+ - Updated dependencies [262e46d]
383
+ - Updated dependencies [b13e071]
384
+ - Updated dependencies [944623d]
385
+ - Updated dependencies [6d9869d]
386
+ - Updated dependencies [077657f]
387
+ - Updated dependencies [b9cc68c]
388
+ - Updated dependencies [de2cc1d]
389
+ - Updated dependencies [a5963cb]
390
+ - Updated dependencies [05aac0e]
391
+ - Updated dependencies [1a6616f]
392
+ - Updated dependencies [ecd738e]
393
+ - Updated dependencies [7775c2b]
394
+ - Updated dependencies [3db36b3]
395
+ - Updated dependencies [7544cc0]
396
+ - Updated dependencies [dab880c]
397
+ - Updated dependencies [7775c2b]
398
+ - Updated dependencies [09c47c5]
399
+ - Updated dependencies [326caee]
400
+ - Updated dependencies [f8e0ed5]
401
+ - Updated dependencies [a588c18]
402
+ - Updated dependencies [1cdcfe5]
403
+ - Updated dependencies [e195fe8]
404
+ - Updated dependencies [846e2f6]
405
+ - Updated dependencies [55f4fdb]
406
+ - Updated dependencies [7775c2b]
407
+ - Updated dependencies [d3e79c4]
408
+ - Updated dependencies [d922f65]
409
+ - Updated dependencies [5b17850]
410
+ - Updated dependencies [e58690c]
411
+ - Updated dependencies [5377b66]
412
+ - Updated dependencies [437d3cd]
413
+ - Updated dependencies [cd07938]
414
+ - Updated dependencies [aadd9fc]
415
+ - Updated dependencies [ea16748]
416
+ - Updated dependencies [a1eda0a]
417
+ - Updated dependencies [fc0284a]
418
+ - Updated dependencies [5b22f4d]
419
+ - Updated dependencies [1b94593]
420
+ - Updated dependencies [9f58295]
421
+ - Updated dependencies [62d73a7]
422
+ - Updated dependencies [2f7299a]
423
+ - Updated dependencies [29e62a0]
424
+ - Updated dependencies [c613e7d]
425
+ - Updated dependencies [5975163]
426
+ - Updated dependencies [b9608ac]
427
+ - Updated dependencies [7a165de]
428
+ - Updated dependencies [4064f36]
429
+ - Updated dependencies [d8f11a5]
430
+ - Updated dependencies [e9e02cf]
431
+ - Updated dependencies [b70b18a]
432
+ - Updated dependencies [6f42b38]
433
+ - Updated dependencies [870227d]
434
+ - Updated dependencies [b77ae4c]
435
+ - Updated dependencies [6ad9582]
436
+ - Updated dependencies [48aad8c]
437
+ - Updated dependencies [c669308]
438
+ - Updated dependencies [2fbb4f0]
439
+ - Updated dependencies [1d66252]
440
+ - Updated dependencies [a6a6834]
441
+ - Updated dependencies [166a6ff]
442
+ - Updated dependencies [79be5af]
443
+ - Updated dependencies [41050ed]
444
+ - Updated dependencies [fc837cb]
445
+ - Updated dependencies [c92f85f]
446
+ - Updated dependencies [bf6eeb0]
447
+ - Updated dependencies [5a3c27a]
448
+ - Updated dependencies [15a3a66]
449
+ - Updated dependencies [b7eff12]
450
+ - Updated dependencies [c669c6a]
451
+ - Updated dependencies [b40e83e]
452
+ - Updated dependencies [067ea67]
453
+ - Updated dependencies [b80ce77]
454
+ - Updated dependencies [6e88552]
455
+ - Updated dependencies [9b971fc]
456
+ - Updated dependencies [2577fc7]
457
+ - Updated dependencies [9b1acc9]
458
+ - Updated dependencies [391ab3c]
459
+ - Updated dependencies [3bf7d6b]
460
+ - Updated dependencies [7775c2b]
461
+ - Updated dependencies [ab1935b]
462
+ - Updated dependencies [740109f]
463
+ - Updated dependencies [e0a25fe]
464
+ - Updated dependencies [3630b6e]
465
+ - Updated dependencies [1290c6d]
466
+ - Updated dependencies [d0a7d58]
467
+ - @nifrajs/web@5.0.0
468
+ - @nifrajs/agent-review@5.0.0
469
+ - @nifrajs/core@5.0.0
470
+ - @nifrajs/mcp@5.0.0
471
+ - @nifrajs/testing@5.0.0
472
+ - @nifrajs/client@5.0.0
473
+ - @nifrajs/i18n@5.0.0
474
+ - @nifrajs/mcp-db@5.0.0
475
+ - @nifrajs/schema@5.0.0
476
+ - @nifrajs/runner@5.0.0
477
+
478
+ ## 4.0.2
479
+
480
+ ### Patch Changes
481
+
482
+ - Updated dependencies [fcd6a5b]
483
+ - @nifrajs/web@4.0.2
484
+ - @nifrajs/agent-review@4.0.2
485
+ - @nifrajs/client@4.0.2
486
+ - @nifrajs/core@4.0.2
487
+ - @nifrajs/i18n@4.0.2
488
+ - @nifrajs/mcp@4.0.2
489
+ - @nifrajs/mcp-db@4.0.2
490
+ - @nifrajs/runner@4.0.2
491
+ - @nifrajs/schema@4.0.2
492
+ - @nifrajs/testing@4.0.2
493
+ - create-nifra@4.0.2
494
+
495
+ ## 4.0.1
496
+
497
+ ### Patch Changes
498
+
499
+ - 3fffcd1: `nifra migrate layout` puts a module only route pages use in `frontend/` even when a generated
500
+ `server-manifest.ts` imports every page. The server renders a page it imports rather than running it,
501
+ so the server's reach stops at route pages.
502
+ - fb8e364: `nifra migrate layout` re-points a moved module's paths from its own location so each still reaches
503
+ what it did: `join(import.meta.dir, "..", "x")`, `import.meta.dir + "/../x"`, `` `${__dirname}/../x` ``
504
+ and `new URL("../x", import.meta.url)` with literal segments; any other use of its location is
505
+ reported. It also reports a folder that some files leave while others stay (a runner that lists
506
+ `migrations/` misses what moved), and scripts or config beside the code (`package.json`, shell scripts,
507
+ YAML, TOML) that name a moved file by path. An import that still reads like an old path but resolves
508
+ after the moves is no longer reported.
509
+ - 12e420e: `nifra sync-manifest` fails when `routes/` does not build a route table, such as a duplicate route or
510
+ two routes of one shape that share a path. It prints the error under the manifest's file name, leaves
511
+ the manifest untouched, and exits with status 1, where it used to report that no generated
512
+ server-manifest.ts was found and exit 0. The `nifra_sync_manifest` MCP tool answers `ok: false` with
513
+ the error on that manifest's result, and the `manifest.sync` fix recipe refuses with the same error.
514
+ The command also prints one line per manifest: synced (with added and removed routes), already in
515
+ sync, or refused.
516
+ - be27a41: `nifra upgrade` to 4.0 notes two more changes an app may hit. Page routes of one shape that share a
517
+ path fail with "overlapping routes", and same-method backend registrations that accept a shared path
518
+ are reported (NF-C024). `contracts.lock.json` also needs one `nifra contracts snapshot`: a route whose
519
+ schema has a property named `description`, `title`, `default`, `example` or `examples` gets a new
520
+ digest, because earlier digests skipped those properties.
521
+ - Updated dependencies [bbb2b27]
522
+ - Updated dependencies [2957acd]
523
+ - Updated dependencies [4bd292a]
524
+ - Updated dependencies [55e813b]
525
+ - @nifrajs/web@4.0.1
526
+ - @nifrajs/agent-review@4.0.1
527
+ - @nifrajs/client@4.0.1
528
+ - @nifrajs/core@4.0.1
529
+ - @nifrajs/i18n@4.0.1
530
+ - @nifrajs/mcp@4.0.1
531
+ - @nifrajs/mcp-db@4.0.1
532
+ - @nifrajs/runner@4.0.1
533
+ - @nifrajs/schema@4.0.1
534
+ - @nifrajs/testing@4.0.1
535
+ - create-nifra@4.0.1
536
+
537
+ ## 4.0.0
538
+
539
+ ### Major Changes
540
+
541
+ - 214d674: feat(cli)!: `backend/app.ts` and `backend/framework.ts`, and `nifra migrate layout`
542
+
543
+ The CLI reads the backend from `backend/app.ts` and the render adapter from `backend/framework.ts`.
544
+ An app that still has a root `backend.ts` or `framework.ts` is refused with the command that moves it.
545
+
546
+ `nifra migrate layout` moves an app onto the zoned layout: it splits each route into `x.tsx` and
547
+ `x.backend.ts`, folds `_middleware.ts` into `_layout.backend.ts`, moves the root files under
548
+ `backend/`, places every other module in `frontend/`, `backend/` or `shared/` by who imports it, and
549
+ rewrites the imports. It is a dry run until `--write`, and it lists what it could not decide - a
550
+ helper both halves need, a page that reads a server export at runtime, a path named in a string.
551
+
552
+ `nifra check` holds source to the same zones the builds enforce, with the same classifier
553
+ (`@nifrajs/web/zones`). NF-C004 follows browser code - a route's frontend half, `frontend/` and
554
+ `shared/` - to Node and Bun built-ins, server packages, backend modules and the `backend-only` marker,
555
+ naming the chain; a `*.fn.ts` module counts as its stub. NF-C028 reports a zoned file importing one in
556
+ no zone, backend code importing frontend code, and shared code importing anything but shared code.
557
+ NF-C029 reports browser code reading a private environment variable, honouring a literal
558
+ `publicEnvPrefix` in `backend/framework.ts`. NF-C005 names the retired `@nifrajs/web/server-only` and
559
+ `@nifrajs/web/plugins/vite-server-only` imports with their replacements. A route's `x.backend.ts` half
560
+ counts as a route file for manifest drift (NF-C012), and NF-S002 grades severity by zone.
561
+
562
+ - 6c978a1: feat(cli)!: the deploy target lives in `nifra.config.ts`
563
+
564
+ - `export const target = "node"` in `nifra.config.ts` is what `nifra build` emits without
565
+ `--target` (still `bun` when neither is given). `nifra port` and `nifra doctor` read it before any
566
+ script heuristic.
567
+ - `nifra target` shows it; `nifra target <t>` switches it, rewriting only that line.
568
+ - The Cloudflare Pages target is `cloudflare` in `nifra build --target`, `nifra port --target` and the
569
+ config; `cf-pages` is refused with the new name.
570
+
571
+ ### Minor Changes
572
+
573
+ - c3057ee: feat: AGENTS.md is the one copy of an app's agent guidance
574
+
575
+ A scaffold and `nifra init-agents` write `AGENTS.md` plus a pointer to it for each agent:
576
+ `CLAUDE.md` and `GEMINI.md` import it, `.cursor/rules/nifra.mdc` is an always-applied Cursor rule
577
+ that attaches it, and `.github/copilot-instructions.md` names it. None of them carries guidance of its
578
+ own, so they cannot drift apart. A web app's `AGENTS.md` gains a "Project structure" section on the
579
+ frontend/backend zones the build enforces, and `nifra init-agents` appends it to an app with `routes/`.
580
+
581
+ - 4e31e3f: `nifra cdn-check <url>` checks a deployed page behind a CDN. It requests the page twice and once as a soft navigation, names the CDN (Cloudflare, Vercel or Fastly) from its status header, and reports whether the second request was served from cache. It fails, exiting 1, when `x-nifra-isr-*` headers reach the visitor or when a soft navigation is answered with the cached document, which is what a Cloudflare zone does without a Cache Rule bypassing requests that carry `x-nifra-data`. It also warns when CDN-only headers are visible or when browsers may keep the HTML. CLI only.
582
+ - 6902bac: fix(cli): `nifra check` follows a literal dynamic `import()` from browser code
583
+
584
+ The backend-code check (NF-C004) treats `import("../lib/x")` with a string-literal specifier like a
585
+ static import: from a page and through its local imports, down to backend code, a Node built-in, a
586
+ known server package or a module marked `@nifrajs/web/backend-only`. The client build bundles a
587
+ dynamic import's target as a lazy chunk, so these were build failures `nifra check` passed. Type
588
+ positions (`typeof import("x")`, `import("x").Pool`) and computed specifiers are not followed. A
589
+ removed package imported dynamically is reported too.
590
+
591
+ - d680264: feat(cli): `nifra check` reports route data without an output schema
592
+
593
+ NF-C030 warns about a route backend half whose loader or action may return data without its
594
+ `loaderOutput` or `actionOutput`. NF-C031 is an error for an output schema that names a sensitive
595
+ field (`password`, `token`, `apiKey`, ...) without `t.declassified`.
596
+
597
+ - a4428b2: `nifra db` and the `nifra_db_schema`, `nifra_db_query` and `nifra_db_role` MCP tools read the development database an app declares as `devDatabase` in `nifra.config.ts`, SQLite or Postgres. `DATABASE_URL` is never read on its own.
598
+
599
+ - `nifra db schema [<table>]` lists tables, row estimates, columns, keys and indexes. `nifra db query "<sql>"` runs one read-only SELECT, and `--explain [--analyze]` returns its plan. Queries are on for a declared database unless `query: false`; a Postgres host other than loopback, `*.localhost` or a unix socket needs `allowHosts`.
600
+ - Each call runs in a fresh process that is killed at `timeoutMs` plus one second, so a runaway query or a crash comes back as a refusal with a stable `NIFRA_DB_*` code, a fix and a docs link.
601
+ - A Postgres superuser, or a role that can reach server files, server programs or another database, is refused queries. `nifra db role` prints the SQL for a read-only role and runs none of it.
602
+ - A query that reads a credential column (or one in `redactColumns`) in any form is refused with `NIFRA_DB_COLUMN_REFUSED`, unless `revealColumns` names it. Rows are capped by `maxRows` and `maxResultBytes`, values pass through the dev feed's redactor, and every answer is marked untrusted.
603
+ - Each call is appended to `.nifra/db-audit.jsonl` (owner-only, rotated at 1 MB) with its redacted SQL, fingerprint, row count, duration and refusal code, never its rows. `nifra db audit` shows it.
604
+
605
+ - 8b99424: feat: `nifra errors`, `nifra logs` and their MCP tools read the running dev server
606
+
607
+ `nifra errors` / `nifra_errors` and `nifra logs` / `nifra_logs` find the project's running
608
+ `nifra dev` server without being given a port (its record, else the one live server among a
609
+ workspace's apps), check that it answers as itself, and read what it recorded: errors as structured
610
+ diagnostics with filters by category, request and staleness, and console output by level, source,
611
+ request and text. Pass the returned `cursor` as `since` to see only what is new. When the server is
612
+ gone they read the log it left behind, so a crash still leaves a record. `nifra errors` exits 1 while
613
+ the current code has open errors. Every answer says that entry text is application output, to be
614
+ read as data.
615
+
616
+ `nifra_explain` no longer needs a port: with no pasted error it returns the latest error of any
617
+ kind. `nifra_inspect` reads the dev server's own request traces (with a `requestId` filter), so it
618
+ no longer needs the `@nifrajs/devtools` plugin, and falls back to it only for a port no record names.
619
+ `nifra_run` results carry the console output and the structured errors each request produced.
620
+
621
+ - 20c05b2: `nifra i18n check` looks for its entry module at `shared/i18n.ts` first, where an app keeps the locales and catalogs both sides import.
622
+ - 595a4e3: feat(cli): `nifra init-agents` at a workspace root names its nifra member in the MCP launch. When the
623
+ root is not itself a nifra project and exactly one workspace member is, the `.mcp.json` and
624
+ `.cursor/mcp.json` it writes launch `mcp <member>`, and `--sync-mcp` adds the member to an existing
625
+ launch that names no directory. A launch that already names one keeps it, the markdown launch commands
626
+ keep their wording, and with several nifra members nothing is named. `--sync-mcp` also pins to the
627
+ member's installed nifra when the root has none, as in an isolated install.
628
+ - 4acb99f: feat(cli): `nifra mcp` started at a package-manager workspace root serves its nifra app.
629
+ When neither the spawn directory nor any ancestor is a nifra project, the server reads the spawn
630
+ directory's `package.json` `workspaces` (the array form or `{ packages }`), and adopts the one member
631
+ that depends on `@nifrajs/*` or has a `nifra.config.ts`. The root's source reads `workspace`. With
632
+ several nifra members it adopts none, and project tools refuse with a message naming each member to
633
+ pass to `nifra mcp <dir>`. A client workspace folder that is a workspace root offers its nifra member
634
+ the same way. An explicit `nifra mcp <dir>` is never redirected, and `node_modules` is never a member.
635
+ - 505a5f4: `nifra migrate layout` also moves an app off the retired names and reports what the data guard needs:
636
+
637
+ - each `x.server.ts` module moves under `backend/` without the suffix (`lib/db.server.ts` becomes
638
+ `backend/lib/db.ts`), and every import of it is rewritten; one a route frontend still imports at
639
+ runtime, or whose new path is taken, is reported instead;
640
+ - `@nifrajs/web/server-only` imports become `@nifrajs/web/backend-only`, and `ServerOnly` imported from
641
+ `@nifrajs/web` becomes `BackendOnly`;
642
+ - an import of `@nifrajs/web/plugins/vite-server-only` is reported for removal;
643
+ - a loader or action that returns data without `loaderOutput` / `actionOutput` is reported, since the
644
+ server refuses that data.
645
+
646
+ - a8b33bc: `nifra check` reports an import of a name that moved to a package subpath under NF-C005, naming the module that exports it now, and `nifra fix --code NF-C005` rewrites the import - re-exports and aliases included. It covers `solidBunPlugin` (`@nifrajs/web-solid/plugin`) and `svelteBunPlugin` (`@nifrajs/web-svelte/plugin`).
647
+ - df9352a: `nifra_scaffold` returns a route pair: the page, typed through its generated `./+types` module, and
648
+ its `.backend.ts` half with the loader and its `loaderOutput` schema. With `write`, it creates both
649
+ files (refusing when either exists) and generates the route's types. Vanilla pages declare
650
+ `hydrate = false` and their `islandScripts` in the backend half.
651
+ - 22e2af8: feat(cli): `nifra check` reports credentials in browser code
652
+
653
+ NF-C032 is an error for what looks like a credential in a route's frontend half, `frontend/`,
654
+ `shared/` or `public/`, with the scanner `nifra build` runs. `nifra build` reads `secretExemptions`
655
+ from `nifra.config.ts`, and `nifra check` honors the same entries when they are written as literals.
656
+
657
+ - 046a1e1: feat(cli): `nifra upgrade` runs every release recipe between the installed version and the target
658
+
659
+ The installed version is the lowest `@nifrajs/*`, `nifra` or `create-nifra` version the workspace
660
+ declares. `nifra upgrade <version>` applies each release recipe after it, up to the target, oldest
661
+ first - dependency moves, import moves and notes labeled by release - then pins the fixed group to the
662
+ target, so a 1.x or 2.x app reaches the target in one run. Any version up to the CLI's own is a target.
663
+ `--exact` pins exact versions instead of keeping `^`/`~`.
664
+
665
+ A target newer than the CLI prints the command for that release's CLI
666
+ (`bunx @nifrajs/cli@<version> upgrade <version>`, with the same flags) and changes nothing; a target
667
+ that is not a bare release version is refused. The 4.0.0 recipe moves `@nifrajs/web/server-only`
668
+ imports to `@nifrajs/web/backend-only`, leads with `nifra migrate layout`, and notes the changes an
669
+ existing app may observe: the zoned layout, required output schemas, the credential scan, the
670
+ `cloudflare` target name, `withISR` query bypass, pages under a mount failing at startup, exact method matching,
671
+ resolved dot segments, JSON media-type matching, required endpoint secrets, the empty `clientEntry`
672
+ error, typed-client dot-segment refusal, canonical base64url signatures and locale-formatted plural `#`.
673
+
674
+ - a0cfffa: `export const clientIp = "platform"` in `nifra.config.ts` makes a `cloudflare` or `vercel` build read `c.clientIp` from the header that platform's edge overwrites (`cf-connecting-ip`, `x-real-ip`), so per-caller middleware such as `rateLimit` works there. Without it an edge build still has no caller address; Bun, Node and Deno builds use the socket peer either way. `buildTarget` and `generateServerEntry` take the same `clientIp` option. Site scaffolds declare it.
675
+ - 93e5e7f: Errors come with a prompt to paste into a coding agent: the error, where it is, the recognised cause, one fix, and steps that end in a check the agent runs itself (`nifra_errors` with a `since` cursor, then `nifra check`). App-supplied text is fenced and labeled as data, paths are project-relative, the home directory never appears, and the prompt is capped at 8000 characters.
676
+
677
+ - Codes with more than one right fix (`NIFRA_BACKEND_IN_CLIENT`, `NIFRA_BACKEND_ONLY_IN_CLIENT`, `NIFRA_OUTPUT_SENSITIVE_FIELD`, `NIFRA_OUTPUT_UNDECLARED_DEFERRED`, `NIFRA_OUTPUT_RAW_RESPONSE`, `NIFRA_OUTPUT_SCHEMA_MISMATCH`) list each as a labeled `fixOptions` entry on the `Diagnostic`, with one prompt per option.
678
+ - The dev overlay has a Copy prompt button per fix. A page load whose render throws gets the overlay on both dev pipelines; data requests and API calls keep the app's JSON 500.
679
+ - A dev page that reports a browser error shows a badge listing that page's errors with their code, message, codeframe, fix and Copy prompt buttons. It renders in a closed shadow root, loads under the page's CSP (nonce, exact URL, or `'strict-dynamic'`), is only fetched once a page errors, and turns off with `nifra dev --no-indicator`, `export const dev = { indicator: false }` in `nifra.config.ts`, or `indicator: false` on `createDevServer`/`createViteDevServer`.
680
+ - `nifra errors --prompt` (and `nifra_errors` with `prompt: true`) prints the prompt for the newest entry; `--id` picks an entry and `--option` picks a fix by its label.
681
+ - `@nifrajs/web/diagnostic-prompt` exports `buildFixPrompt`, `fixPrompts` and `catalogFixPrompts` without Node APIs, for use in a browser bundle.
682
+
683
+ - 772249a: feat(i18n): catalog checks - `checkCatalogs()` and `nifra i18n check`
684
+
685
+ `checkCatalogs({ locales, catalogs, ignore })` from the new `@nifrajs/i18n/check` entry checks every
686
+ catalog in a locale registry the way `t()` reads it: coverage per locale (counting messages inherited
687
+ through `chain()`), missing keys and keys the default catalog does not have, ICU syntax,
688
+ placeholder and rich-tag parity with the default message, a missing `other` case, plural categories
689
+ the locale's grammar uses that a message never states, script purity (letters outside
690
+ `Intl.Locale(tag).maximize().script`, and, as a warning, words mixing Latin with it), and messages identical to the
691
+ default in another language. It returns findings with a severity (`error`, `warning`, `info`) and a
692
+ per-locale coverage table; `ignore` skips keys per check.
693
+
694
+ `nifra i18n check [entry]` imports the module exporting `locales` and `catalogs` (the first
695
+ `i18n.ts` in the project root, `lib/`, `src/`, `src/lib/` or `app/` by default; catalogs may be
696
+ lazy loaders such as `() => import("./fr.json")`) and prints the report. It exits 1 on an error, and
697
+ with `--strict` on a warning; `--json` prints the result.
698
+
699
+ - ff4a062: feat(core): one handler can be registered under several methods, and under a method outside the
700
+ standard seven, with `all()` and `method()` from `@nifrajs/core/methods`:
701
+
702
+ ```ts
703
+ import { server } from "@nifrajs/core/server";
704
+ import { all, method } from "@nifrajs/core/methods";
705
+
706
+ const app = server()
707
+ // GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS /echo
708
+ .use(all("/echo", (c) => ({ method: c.req.method })))
709
+ .use(method("PURGE", "/cache/:key", (c) => ({ purged: c.params.key })))
710
+ .use(method(["GET", "POST"], "/search", (c) => ({ q: c.query.get("q") })));
711
+ ```
712
+
713
+ - Each method is an ordinary route: it is listed by `app.routes()`, takes a schema and hooks, works
714
+ inside `group()`, and throws `DUPLICATE_ROUTE` against a route already registered for the same
715
+ method and path. One call is one registration: if any of its routes is refused, none is added.
716
+ - `all()` is the seven standard methods, not a catch-all. A request with any other method is still a
717
+ `405` with an `Allow` header. `mount()` remains the way to pass every method through.
718
+ - A method name is case-insensitive and registered uppercase. It is a token of letters, digits and
719
+ hyphens that starts with a letter, at most 32 characters. `TRACE`, `CONNECT` and `TRACK` cannot be
720
+ registered; those and any other value throw `INVALID_METHOD`.
721
+ - The standard methods in a call join the typed registry and the typed client. A custom method has
722
+ no typed-client call.
723
+ - An assurance policy's `methods` selector takes standard methods only, so it never matches a
724
+ custom-method route. Classify such a route with a path rule; unmatched, it is reported as
725
+ `unclassified-route`.
726
+ - Whether a custom method reaches the app is up to the runtime's HTTP parser: `PROPFIND`, `REPORT`,
727
+ `PURGE` and `QUERY` arrive on Bun, Node, Deno and workerd, and a token the parser does not know
728
+ can be answered by the runtime itself.
729
+ - `Router.add` from `@nifrajs/core/router` accepts the same method tokens, and
730
+ `isRegistrableMethod(name)` from that subpath reports whether a name is one.
731
+ `RouteDescriptor.method` is typed `RouteMethod`: a standard `Method` or another such token.
732
+
733
+ feat(schema): `toOpenAPI` leaves a custom-method route out of the document. A path item has a field
734
+ for each standard method and none for any other.
735
+
736
+ feat(cli): `nifra check` reads the routes `all()` and `method()` register, so the duplicate,
737
+ overlap, reserved-segment and param-modifier rules cover them, reported once per call. The route
738
+ brief and `--json` output list a custom-method route with a `fetch` call. The capability report
739
+ attributes a module to every path an optional-param route serves, and to `all()` and `method()`
740
+ routes.
741
+
742
+ - 8e30090: feat: a mount nifra cannot analyze is a declared known gap, not a silent hole. Routes behind
743
+ `mount()` and `mountFetch()` are invisible to route reflection, so capability assurance could not
744
+ see them and said nothing. Both now take `opaque: "<reason>"`, and so does a `createWebApp`
745
+ `mounts` entry. Capability assurance lists a mount with a reason as a known gap
746
+ (`report.gaps`, `{ kind: "opaque-mount", path, reason }`): `nifra check` and
747
+ `nifra capabilities check` print it on every run, and it fails nothing and lowers no level. A mount
748
+ on the analyzed app without a reason fails with the new `opaque-mount-undeclared` finding, which
749
+ suggests `merge()` for a nifra `server()` and `opaque` for anything else. A mount whose app publishes
750
+ composed evidence (the API `createWebApp` mounts) is not reported. `webProjectEvidence` accepts a
751
+ `mounts` entry without an evidence provider when it declares `opaque`. New exports:
752
+ `reflectMounts` and `ReflectedMount` from `@nifrajs/core/reflection`, `CapabilityGap` from
753
+ `@nifrajs/core/capabilities`; project evidence snapshots gain an optional `mounts` list, absent for
754
+ an app with no mounts.
755
+ - 28f3aaf: feat(core): a path can end in optional params, written `:name?`. The route serves the path with the
756
+ param and without it:
757
+
758
+ ```ts
759
+ app
760
+ // GET /users and GET /users/42
761
+ .get("/users/:id?", (c) =>
762
+ c.params.id === undefined ? { all: true } : { id: c.params.id }
763
+ )
764
+ // GET /archive, GET /archive/2026 and GET /archive/2026/09
765
+ .get("/archive/:year?/:month?", (c) => ({
766
+ year: c.params.year,
767
+ month: c.params.month,
768
+ }));
769
+ ```
770
+
771
+ - Optional params are whole segments at the end of the path. Several in a row are filled left to
772
+ right: a later one is present only when every earlier one is. A `?` anywhere else (`/a/:id?/b`,
773
+ `/v-:id?`) is literal text, as before.
774
+ - An optional param is typed `string | undefined`. When the path omits it, it is absent from
775
+ `c.params`, not an empty string. A `params` schema that requires it answers `422` on the shorter
776
+ path.
777
+ - The route is registered once per path it serves, with the same handler, schema and hooks.
778
+ `app.routes()`, `group()`, `merge()`, `implement()`, `ws()` and the typed registry all see those
779
+ paths, so `GET /users` registered next to `GET /users/:id?` throws `DUPLICATE_ROUTE`. A route that
780
+ is rejected leaves none of its HTTP paths registered.
781
+ - The typed client calls each path: `api.users.get()` and `api.users({ id }).get()`.
782
+ - `defineContract` accepts the same paths; two operations that serve the same method and path are
783
+ refused.
784
+ - `expandOptionalParams(pattern)` from `@nifrajs/core/pattern` returns the paths a pattern serves,
785
+ shortest first. `Router.add` from `@nifrajs/core/router` registers exactly the pattern it is given;
786
+ a caller that wants the optional form adds each expanded pattern.
787
+ - `routePatternOverlap` compares every path each side serves, under one work budget for the call.
788
+
789
+ feat(edge): the compact server accepts the same optional params.
790
+
791
+ feat(schema): `toOpenAPI` emits one operation per path an optional-param route serves. A shorter
792
+ path declares only the parameters it has. For a contract, the operation name is the `operationId` of
793
+ the full path, and the shorter paths carry none.
794
+
795
+ feat(cli): `nifra check` reports `NF-C026` (warning) for a param followed by `?`, `*`, `+`, `{`, `(`
796
+ or `<` that the path grammar reads as literal text, and names a `?` route that no request can reach.
797
+ `// nifra-expect param-modifier` above the registration marks a deliberate literal. Overlap and
798
+ duplicate checks read an optional-param route as every path it serves.
799
+
800
+ - 6d20355: feat(core): a path param can say which values it accepts, written in braces after the name. A
801
+ request whose value does not fit is not served by that route:
802
+
803
+ ```ts
804
+ app
805
+ // /users/me is its own route; /users/42 is this one; /users/ada is a 404
806
+ .get("/users/me", () => ({ me: true }))
807
+ .get("/users/:id{[0-9]+}", (c) => ({ id: Number(c.params.id) }))
808
+ // a list of values, and a count
809
+ .get("/img/:size{thumb|full}/:file", (c) => ({
810
+ size: c.params.size,
811
+ file: c.params.file,
812
+ }))
813
+ .get("/countries/:code{[A-Z]{2}}", (c) => ({ code: c.params.code }))
814
+ // inside a segment, and optional at the end of a path
815
+ .get("/files/:name.:ext{png|jpg}", (c) => ({
816
+ name: c.params.name,
817
+ ext: c.params.ext,
818
+ }))
819
+ .get("/posts/:page{[0-9]+}?", (c) => ({ page: c.params.page ?? "1" }));
820
+ ```
821
+
822
+ - A constraint is one character class with an optional count (`[0-9]`, `[a-z0-9_-]+`, `\d{4}`,
823
+ `\w{2,8}`), or a list of two or more values (`png|jpg|webp`). A class holds letters, digits, ranges
824
+ of them, `\d`, `\w` and `. _ ~ ! $ & ' ( ) + , ; = @ -`; there is no negated class and a count
825
+ starts at one. Anything else in braces (`:id{int}`, `:id{.+}`, `:id{[0-9]+|[a-z]+}`) is literal
826
+ text, as before.
827
+ - The param stays a `string`, keyed by its bare name: `Params<"/users/:id{[0-9]+}">` is
828
+ `{ id: string }`.
829
+ - The value is checked as it was sent, before percent-decoding. `/users/4%32` does not fit
830
+ `:id{[0-9]+}`; a broader route beside it serves that request.
831
+ - The narrowest route answers, whatever the order of registration: literal text, then a list, then a
832
+ class, then a bare `:param`, then a wildcard. Between two constraints of a kind, the one that
833
+ accepts fewer values is tried first. A method the narrowest matching route does not have answers
834
+ `405`, as it does for a literal route beside a param route.
835
+ - Two spellings of one constraint (`[0-9]+`, `\d+`, `[0-9]{1,}`) are one route: the same method
836
+ registered on both throws `DUPLICATE_ROUTE`.
837
+ - Inside a segment the text around the params is placed first and each value is then checked; the
838
+ router does not look for another split.
839
+ - `routePatternOverlap` takes constraints into account: `/users/me` and `/users/:id{[0-9]+}` do not
840
+ overlap.
841
+ - `@nifrajs/core/pattern` exports `paramConstraint(text)`, which reads a constraint at the start of
842
+ `text`, and the `ParamConstraint` type. A param part of a compiled mixed segment carries its
843
+ constraint as `c`.
844
+
845
+ feat(edge): the compact server accepts the same constraints.
846
+
847
+ feat(schema): `toOpenAPI` writes a constrained param into the path template by its bare name
848
+ (`/users/{id}`). Its schema is `{ type: "string", pattern }` for a character class and
849
+ `{ type: "string", enum }` for a list of values; a declared `params` schema still takes precedence.
850
+
851
+ feat(client): a constrained param is passed by its bare name, `api.users({ id: "42" }).get()`. Two
852
+ param routes at one position (`/users/:id{[0-9]+}` beside `/users/:slug`, or a param beside a
853
+ wildcard) are each callable, picked by the name of the key. The client does not check a value
854
+ against its constraint.
855
+
856
+ feat(cli): `nifra check` accepts a supported constraint and keeps reporting other text in braces
857
+ (`NF-C026`); `NF-C024` and `NF-C025` follow the router's reading of a constraint. `nifra routes` and
858
+ the generated client calls print the bare name. `nifra scaffold` refuses a page path that carries a
859
+ constraint.
860
+
861
+ feat(testing): `runAdversarialContract` builds a request path whose values satisfy each param's
862
+ constraint, and fills a part-literal segment (`/files/:name.json`) param by param.
863
+
864
+ feat(web): a route file name that would read as a param constraint (`[id]{a|b}.tsx`) is refused at
865
+ build time with a message that names the file. `llms.txt` prints client calls with the bare name.
866
+
867
+ - d50f73e: feat: generated route types
868
+
869
+ Every route file gets a generated `Route` namespace, imported from `./+types/<name>` by both halves
870
+ of the route:
871
+
872
+ ```ts
873
+ // routes/blog/[slug].backend.ts
874
+ import type { Route } from "./+types/[slug]"
875
+ export const loaderOutput = t.object({ title: t.string() })
876
+ export async function loader({ api, params }: Route.LoaderArgs) { ... }
877
+
878
+ // routes/blog/[slug].tsx
879
+ import type { Route } from "./+types/[slug]"
880
+ export default function Post({ data, params }: Route.ComponentProps) { ... }
881
+ ```
882
+
883
+ `Route.Params` comes from the path (`[id]`, optional `[[lang]]`, catch-all `[...path]`).
884
+ `Route.LoaderData` and `Route.ActionData` are the output types of `loaderOutput` and `actionOutput`,
885
+ so a component is typed with exactly what reaches it. `Route.LoaderArgs` types `api` from the app's
886
+ `backend/app.ts`, which `.nifra/types/register.d.ts` registers once with `@nifrajs/client`'s new
887
+ `Register` interface; no route imports the backend for its types.
888
+
889
+ `nifra types` writes the files to `.nifra/types` (and `--check` fails when one is stale); `nifra dev`,
890
+ `nifra build` and `nifra check` refresh them, and `nifra dev` keeps them current as routes are added
891
+ or removed. A route resolves `./+types/<name>` through `"rootDirs": [".", "./.nifra/types"]` in
892
+ tsconfig, which the scaffolded site and ISR apps now carry; `nifra types` says so when it is missing.
893
+ `@nifrajs/web/route-types` exports the generator.
894
+
895
+ - 52bb49e: Support TypeScript 5, 6, and 7 in Nifra's syntax and response-reflection scanners. TypeScript 7 projects use its unstable AST and asynchronous project APIs through a shared compatibility session, with unsupported compiler majors failing closed.
896
+ - a158b74: feat(web): a page file under a mount fails at startup, at build and in `nifra check`, instead of
897
+ answering with the mount's 404. A mount in front of the page router - the backend at `apiPrefix`, a
898
+ `mounts` entry, or an `app.mount()` inside `use` - answers every request under its path, and its 404
899
+ is final (`fallbackOn: 404` only tries the next mount), so a page there could never render.
900
+ `createWebApp` now throws at startup, naming each file, the URL it serves and the mount; `nifra build`
901
+ refuses to build; and `nifra check` reports `NF-C027` for a page under the backend's prefix, reading
902
+ `apiPrefix` when `backend/framework.ts` exports it as a string literal (an `info` finding says so when it does
903
+ not).
904
+
905
+ `backend/framework.ts` can export `apiPrefix`, `apiStrip`, `mounts`, `csp` and `nonce`. `nifra dev`,
906
+ `nifra build` (the generated server entry and the static prerender), `nifra mcp`'s render tool and the
907
+ hydration gate pass the same set to `createWebApp`, and the render tool and the hydration gate now
908
+ apply `use` as well. A field of the wrong type fails at load, naming it, and a value
909
+ `nifra.config.ts` exports must be the one `backend/framework.ts` exports, or the build stops. `nifra routes`
910
+ lists the backend under the configured prefix, at the served path when `apiStrip` is set.
911
+
912
+ New exports: `preRouteMountPaths` from `@nifrajs/core/mount`; `shadowedPages`,
913
+ `formatShadowedPages`, `normalizeMountPath` and `ShadowedPage` from `@nifrajs/web/route-manifest`;
914
+ `SERVER_ENTRY_OPTIONS` and the `optionImports` option of `generateServerEntry` and `buildTarget` from
915
+ `@nifrajs/web/build`.
916
+
917
+ Upgrading: an app with a page file under its backend prefix (`routes/api/*` with a backend)
918
+ started before and answered that page with a 404; it now fails to start until the file moves out of
919
+ the prefix or the prefix changes.
920
+
921
+ ### Patch Changes
922
+
923
+ - f96196f: `nifra dev` on the Bun pipeline applies the `define` from `nifra.config.ts` to the browser bundle and to server rendering, as `nifra build` does. Vue's feature flags reach the dev client, so the "Feature flags ... are not explicitly defined" warning no longer appears. A config `define` entry wins over the same name in the app's own `bunfig.toml`, and a value that is not a string is refused by name.
924
+ - 20c05b2: `nifra check` reports its import finding as "backend code in browser code", and `nifra_frontend` and `nifra_learn` point at the route's `.backend.ts` half for loaders, actions and their output schemas.
925
+ - 736fae8: `nifra check` treats a value re-export (`export { x } from "y"`, `export * from "y"`, `export * as ns from "y"`) as an import edge, the way a bundler does. The server-only import scan, its transitive chain through barrel files, and the zone import check (NF-C028) now follow re-exports. `export type …` re-exports, and with a TypeScript install an all-type named re-export, are skipped as before.
926
+ - a5cf1c3: `nifra check` on a project using TypeScript 7 completes when it follows an import into a module outside the scanned set, such as a `.js` helper with its own imports. Previously the whole check stopped with "TypeScript 7 source file was not preloaded". The import scan reads such a module with its lexical rule. For the SQL scan, such a module proves no constant, the same as a module that does not parse.
927
+ - 2ed4c59: `nifra_run`, `nifra_render`, `nifra_ws`, `nifra_test`, the `nifra check` typecheck and the `nifra fix` rebuild and codemod start their child processes with the Bun that runs nifra, not the first `bun` on `PATH`. An MCP client that starts `nifra mcp` with a minimal `PATH` no longer breaks them, and a `bun` shim earlier on `PATH` is never picked up.
928
+ - 8b8dde2: `nifra contracts snapshot` writes `contracts.lock.json` routes, and `nifra sdk` emits operations, in code-unit order instead of `localeCompare` order, so the files a project commits come out the same on every machine. A lock or SDK whose routes the two orders rank differently (mixed case, `-` beside `_`) is reordered once when it is next written; `nifra contracts check` compares routes by key and is unaffected.
929
+ - 8739624: The contracts lock digest covers schema properties named `title`, `description`, `default`, `example` or `examples`, and the instance data inside `enum` and `const`. Those annotation keywords on a schema itself still do not count as a contract change. A lock written by an earlier release reports each route with such a property as changed once; review it and run `nifra contracts snapshot`.
930
+ - cc3e0fa: The contracts lock digest covers a schema property named `__proto__`, so `nifra contracts check` reports a change to that property's schema.
931
+ - 20c05b2: `nifra_docs`, `nifra_example` and `nifra_types` match a camelCase heading by its whole word as well as its parts, so a `websocket` query finds the WebSockets section by name.
932
+ - f23d036: `nifra doctor --fix` re-points a path dependency it copies from an ancestor `package.json` (`file:`, `link:`, `portal:`, or `./`/`../` specs) so the copy names the same directory from the package being fixed. Previously the spec was copied unchanged and resolved against the wrong directory. Version ranges and `workspace:` specs are copied as before.
933
+ - 612fdfe: `nifra_explain` shows a codeframe only from project source files. A stack frame naming a dotfile or anything under a dot directory, such as `.env` or `.git/config`, gets no source excerpt.
934
+ - 0e622ae: NF-S001 reads a gate written as an arrow or function expression by the name it is bound to, such as `const requireAuth = async () => …` or `{ canEdit: () => … }`, so a fail-open catch in one is reported like one in a function declaration.
935
+ - d90e509: fix(cli): the `nifra_gallery` MCP tool declares itself non-destructive and idempotent in its
936
+ annotations, so clients that gate tool calls on those hints run it without asking.
937
+ - 8a2e7e5: fix(cli): `nifra assure --hydration` hydrates every route in its DOM run and fails when hydration does
938
+ not happen. With `happy-dom` installed, the run could not load a code-split client entry, imported
939
+ the entry only once (so routes after the first were never hydrated), and checked the page before the
940
+ framework had hydrated it. It now builds the entry so its chunks load from disk, gives each route its
941
+ own copy, waits for the document's `data-nifra-hydrated` marker (up to 5s) and reports a route that
942
+ never gets there. An error the client throws while hydrating is reported too. The page data comes
943
+ only from the document's handover, as in a browser, and framework runtimes get the DOM globals they
944
+ use (Vue's `SVGElement`).
945
+ - d1e82be: The hydration gate (`nifra assure --hydration`, `nifra_hydrate`, hydration replays) no longer reports a false NF-H001 when a project's config or loader prints to stdout: the runner's answer travels on its own tagged line, and `console.log` output from project code goes to stderr. A run now stops after five minutes, `nifra_hydrate` stops when the MCP call is cancelled, and the runner's output is bounded.
946
+ - 3e7cb83: The import scanners behind `nifra check`, `nifra doctor` and the capability provenance check read an import or re-export clause by its grammar: a default binding, then `* as name` or a `{ … }` list. Previously they scanned lazily to the next `from`. A long module with many `export const` lines and no string literal now scans in linear time; 16,000 lines took over 4 seconds before. Each re-export is attributed to its own line, and minified `import{a}from"x"` is read too.
947
+ - d2e392a: feat(cli): `nifra init-agents --sync-mcp` re-pins the `@nifrajs/cli@x.y.z` MCP launch in `.mcp.json`,
948
+ `.cursor/mcp.json`, `CLAUDE.md` and the `## MCP server` section of `AGENTS.md` to the nifra the
949
+ project installs. Only the version changes; every other byte stays as it is, no file is created, and
950
+ a second run is a no-op. The CLI-version drift warnings from `nifra mcp` and `nifra doctor` recommend
951
+ it, `nifra doctor` flags a stale pin even when the CLI itself matches, and a plain `nifra init-agents`
952
+ run points any kept file with a stale pin at the flag.
953
+ - a84f546: `nifra verify --release` runs the leak matrix (`bun run check:leak-matrix`): every way server code or a
954
+ credential can reach a browser, against both bundlers, both dev servers, the server build, each
955
+ framework's route syntax and each deploy target's output.
956
+ - 9fc5ef3: `nifra manifest emit --sign <keyId>` is available only from the CLI. The `nifra_manifest` MCP tool no longer lists `sign` in its input schema and answers a call that passes it with `{ ok: false, error: "sign is available only from the nifra CLI" }`, so an agent cannot ask the operator's `manifest.signer` callback to sign a manifest. Commands declare such fields with the new `cliOnlyFields` on their spec; the catalog entry carries them, and `commandMcpInputSchema()` gives the schema an MCP tool advertises.
957
+ - 0140def: `nifra_run` and `nifra_ws` return as soon as the answer is written. An app that keeps a handle open at load, such as a database pool or an interval, made each call wait out the 30-second child timeout.
958
+ - 6745d2a: `nifra mcp` runs no project code in its own process and keeps none of the project's `.env`. The tools that load the app (`nifra_context`, `nifra_routes`, `nifra_check`, `nifra_openapi` and the rest), the routes and OpenAPI resources, and the tools, resources and prompts the app declares on its backend run in a fresh subprocess per call, started in the project's directory. Each call sees the project's current code and its `.env`, wherever the client started the server, and a config or backend that exits or hangs fails only that call. `nifra_run`, `nifra_render`, `nifra_ws` and `nifra_hydrate` also start their processes in the project's directory. A server that Bun started with `.env` values serves from a copy of itself that never loads them; values set in the environment and `--env-file` values are kept. In a monorepo, each app's tools see that app's `.env` and no longer the root's; to share values across apps, set them in the environment or pass `--env-file`. A call that loads the app costs one process start, tens of milliseconds, more when the config imports heavy plugins.
959
+ - 3c70d9c: `nifra mcp --env-file <path>` values now reach the processes its tools start: `nifra_run` (one-off and `warm`), `nifra_render`, `nifra_ws`, `nifra_hydrate`, `nifra_test` and the `nifra_db_*` tools see them, as the app's own tools and the tools that load the app do.
960
+ - 429eff5: `nifra_run` and `nifra_render` with `warm: true` reuse one hot worker for the whole MCP session, as documented, instead of starting a new one per call. The source fingerprint that restarts the worker on a change no longer walks `node_modules`, build output or dot directories.
961
+ - ed12674: `nifra openapi` works on an API-only app: with no `nifra.config.ts` or `backend/framework.ts`, it reads `backend/app.ts` alone instead of asking for a UI adapter.
962
+ - c224eda: `nifra review --diff` no longer passes a change while the project has a type error in a file outside the diff. A change can break a caller it never touched, so the `typecheck` check reports `unavailable` with reason `filtered-out-of-scope` and the review is `inconclusive`. The text report names the reason next to each unavailable check.
963
+ - 58c092b: `nifra sdk` generates the client for a backend whose routes it reads from `backend/app.ts`, instead
964
+ of failing before it writes anything.
965
+ - 82f2e7d: `nifra sdk --lang go` writes a property's JSON name into a struct tag only when Go's `encoding/json` can read it there. A property name with a quote, backslash, backtick, comma or control character has no struct-tag spelling. Such a field is left out and reported like any other unsupported schema, and `--strict` refuses the document. A property named `-` is tagged `json:"-,"`, so it is no longer dropped.
966
+ - 7911e4a: NF-S002 flags a comparison against a secret read from configuration: an `UPPER_SNAKE` member such as `process.env.API_TOKEN` or `env.WEBHOOK_SECRET`, and a string-keyed read such as `process.env["API_KEY"]`. PascalCase enum members such as `ts.SyntaxKind.PlusToken` stay unflagged.
967
+ - c8a345d: `nifra check` reads every `secretExemptions` entry in `nifra.config.ts` when a string in it holds a bracket, brace or colon, such as the file `routes/[lang]/index.tsx`, instead of dropping that entry and the ones after it.
968
+ - bc73e9c: `nifra_test` keeps `pattern` inside the selected project. A pattern that resolves outside it, by `../`, an absolute path or a symlink, is refused before `bun test` starts.
969
+ - c4567cf: `nifra_test` keeps only the first 4,000 and last 8,000 characters of a test run's output as it reads, instead of holding all of it before trimming, so a run that prints hundreds of megabytes no longer grows the MCP server's memory with it. When output was dropped, the result marks where and how many bytes were left out.
970
+ - e8df2af: `nifra fix --code NF-S002` rewrites every flagged comparison in a file in one pass, found from the syntax tree rather than the reported line. A file with several comparisons, a property operand such as `headers.signature`, or a `"use server"` directive now comes out correct, and an existing `timingSafeEqual` import no longer collides with the added helper.
971
+ - e414818: `nifra check` parses a `.ts`, `.mts`, or `.cts` file as TypeScript instead of TSX in its SQL interpolation scan, security rules, nano and island lints, and route source facts. A generic arrow (`<T>(items: T[]) => ...`) or an angle-bracket cast in such a file no longer makes the file unparsable or hides the code after it from those checks, so findings they missed there now appear.
972
+ - 0fb7a13: `nifra check`'s typed-client rewrite for a simple own-API `fetch` appends a path segment the client reserves (`get`, `post`, `options`, `index`, `then` and the rest) with a call, as in `api.blog("post").get()`, so the suggested code reaches the route. Previously it suggested `api.blog.post.get()`, which the client cannot resolve.
973
+ - 88178b4: `nifra upgrade`:
974
+
975
+ - Removing a dependency whose successor is already declared keeps `package.json` valid when the removed entry is the last one in its block. An edit that would leave a manifest unparseable is not written.
976
+ - `dist/`, `build/` and `coverage/` directories at the workspace root are skipped like nested ones, so build output and coverage reports are no longer rewritten.
977
+
978
+ - 38cf032: `nifra build` for the `vercel` target writes to `.vercel/output`, where `vercel deploy --prebuilt`
979
+ reads it, unless `--out` names another directory.
980
+ - 19f1c8b: `nifra verify` and `nifra_verify` report a gate whose `package.json` script the project does not declare as `undeclared` instead of running it and failing. A project that declares `lint` and `test` gets those two gates run and the rest listed as not declared; the run passes when every gate that ran passed, and fails when none ran.
981
+ - 3734451: The verification work graph behind `nifra prove` (`nifra_prove`):
982
+
983
+ - `.svelte`, `.vue`, `.mdx` and `.css` files are app source. An edit to one after the last build makes the build stale, and each file is a node of the graph.
984
+ - A changed file under `routes/`, `frontend/`, `backend/` or `shared/` that the graph does not model, such as a deleted module, impacts every route and needs proof. Previously the plan was empty and the change was reported as done.
985
+
986
+ - 4801cac: `diffNifraManifests` and `nifra manifest diff` diff a route that is new in the candidate manifest against an empty route. The capabilities it declares are reported as added and breaking, and a `pii` or `secret` response classification as an increase that is breaking, the same as when an existing route makes that change. A new route that declares no capability and returns public data is still only an added route.
987
+ - ef28ef9: CLI output that lists routes, files, findings or packages - `nifra routes`, `nifra doctor`, `nifra check`, `nifra port`, `nifra manifest`, `nifra sync-manifest`, `nifra graph`, `nifra types` and the generated SDK - is ordered by code unit, so it comes out the same on every machine and in every locale.
988
+ - 9ccf198: `handleRpc` takes `exposeToolErrors`, which answers a throwing tool with `Tool execution failed: <message>` instead of the bare text. It is off by default, so a remote caller still sees nothing from an error message. `nifra mcp` turns it on for its stdio server, so the local agent sees why a project tool failed, for example the error that stopped the backend from loading.
989
+ - 0d8d426: fix(cli): `nifra mcp` no longer answers for a different nifra release than the project installs. When
990
+ the project has its own `@nifrajs/cli` at another version, the server hands the stdio session to the
991
+ project's `node_modules/.bin/nifra mcp` (passing an explicit project dir through). When that is
992
+ impossible - no project CLI, no linked bin, or a hand-off that still disagrees - `nifra_check`,
993
+ `nifra_types`, `nifra_docs`, `nifra_example`, `nifra_assure` and `nifra_contracts` fail with the
994
+ version split and the command that fixes it, while release-independent tools keep working.
995
+ - ff87ed3: `nifra migrate layout` finds an SFC's script blocks however their closing tag is spaced (`</script >`).
996
+ - ba5dd1c: feat(web): a directory's route middleware runs before every page in it and below.
997
+
998
+ ```ts
999
+ // routes/account/_layout.backend.ts
1000
+ import { type RouteMiddleware, redirect } from "@nifrajs/web";
1001
+
1002
+ export const middleware: RouteMiddleware = ({ request }) => {
1003
+ const signedIn =
1004
+ request.headers.get("cookie")?.includes("session=") ?? false;
1005
+ return signedIn ? undefined : redirect("/login");
1006
+ };
1007
+ ```
1008
+
1009
+ Route middleware runs on the server, outermost first, before the layouts' loaders (gates included)
1010
+ and the page's loader or action, for document requests, client navigations and form posts alike, and
1011
+ before a nested `_404` in its directory. It returns nothing to let the request through, or returns or
1012
+ throws a `redirect()`, a status such as `notFound()`, or a `Response` to answer with it. `ctx.set` adds
1013
+ headers and cookies, and `ctx.params` holds the params of its directory's URL prefix. It never reaches
1014
+ the client bundle, and a directory may export it from `_layout.backend.ts` without a frontend layout.
1015
+
1016
+ - dc2d4d3: fix(cli): duplicate-install findings name a copy reached through a symlink out of its install
1017
+
1018
+ When an importer reaches a copy of an identity-sensitive package through a symlink that points
1019
+ outside its own install (another project's `node_modules` linked into a shared package, or a
1020
+ `bun link`), `nifra doctor` prints a `links:` line with each link and its target, and the
1021
+ `nifra check` duplicate-install diagnostic names the link on that copy and lists it ahead of both
1022
+ fixes. The identity preflight carries it as `copies[].links` and `provenance`. Package-manager store
1023
+ links inside an install are not reported.
1024
+
1025
+ - d1e2f50: feat: starters type their routes with the generated `./+types`
1026
+
1027
+ The site and ISR starters type the landing page as `import type { Route } from "./+types/index"`:
1028
+ `props: Route.ComponentProps` in the page, `Route.LoaderArgs` / `Route.ActionArgs` in its backend
1029
+ half. `data` is the `loaderOutput` schema's type, which is what reaches the browser. A scaffold
1030
+ ships its `.nifra/types`, so the types resolve right after `bun install`, before any nifra command
1031
+ has run. The Svelte starter types its `$props()` the same way, and the Vue starter types the props it
1032
+ declares from `Route`. Svelte and Vue scaffolds include their `.svelte` / `.vue` files in
1033
+ `tsconfig.json`, so svelte-check, vue-tsc and the editor type-check routes. `nifra_frontend`'s
1034
+ loader-typing guidance now points at the route types.
1035
+
1036
+ - 562b4af: fix(client): a `.` or `..` param value is refused instead of sent
1037
+
1038
+ A URL reads a `.` or `..` path segment as a step to another path, in every encoding, so
1039
+ `api.users({ id: ".." }).delete()` was a request for `DELETE /`, not for a user named `..`.
1040
+
1041
+ - A call whose path has a `.` or `..` segment sends nothing and resolves to
1042
+ `{ ok: false, status: 0, data: null, error: { error: "invalid_path" } }` - the shape a network
1043
+ failure takes. No `onRequest` hook runs and nothing is retried.
1044
+ - `.subscribe()` reports `invalid_path` through `onError`, then closes. `.ws()` throws before a
1045
+ socket is opened.
1046
+ - `inProcessClient` and `testClient` behave the same way.
1047
+ - Values that only contain dots (`a.b`, `...`, `.hidden`) and a wildcard value such as `a/../b`
1048
+ (sent as one encoded segment) are unaffected.
1049
+ - The Python and Go clients from `nifra sdk` refuse the same values: Python raises `ValueError`,
1050
+ Go returns an error.
1051
+
1052
+ Validate a param where it is read: a `.` or `..` sent by another client still reaches the route
1053
+ as the param's value.
1054
+
1055
+ - 81c720e: fix(client): a segment that is part literal, part param is callable through the typed client
1056
+
1057
+ A route such as `/files/:name.json`, `/post-:id` or `/v:major.:minor` could not be reached through
1058
+ the typed client: `:name.json` was typed as a param named `name.json` whose call sent the value
1059
+ without `.json`, and `post-:id` was typed as a property that sent the pattern text itself. Such a
1060
+ segment is now a call with the segment as the request carries it:
1061
+
1062
+ ```ts
1063
+ await api.files("report.json").get(); // GET /files/:name.json, c.params.name === "report"
1064
+ await api("post-42").get(); // GET /post-:id
1065
+ await api("v1.2").get(); // GET /v:major.:minor
1066
+ ```
1067
+
1068
+ - The argument is typed as the segment's literal text around any string (`` `${string}.json` ``), so
1069
+ `api.files("report.txt")` does not compile. A constraint is not part of the text:
1070
+ `/img/:id{[0-9]+}.png` takes `` `${string}.png` ``, and the server decides whether the value fits.
1071
+ - The value is sent as one encoded segment, as a param value is: a `/` in it never adds a path level.
1072
+ - A static segment at the same position keeps its exact text (`api.files("index.json")` is
1073
+ `/files/index.json` when that route exists, which is the route the server picks), and a
1074
+ whole-segment param keeps its call by name (`api.files({ id })`).
1075
+ - Two such segments at one position that accept the same text resolve to the types of the one
1076
+ registered first.
1077
+ - `@nifrajs/core` exports `RequestPath<Path>`, the same reading for a whole path:
1078
+ `RequestPath<"/files/:name.json">` is `` `/files/${string}.json` ``, a constraint reads as
1079
+ `${string}`, and a path ending in optional params is one template per form.
1080
+ - The cli's route listings and the generated `llms.txt` print the call the same way
1081
+ (`` api.files(`${name}.json`) ``), and print an unnamed wildcard as `({ "*": rest })`.
1082
+
1083
+ - af1e8af: Release verification takes `--shared-runner`, which leaves out the timing gates and names them for a local run, and a failed gate now shows the last lines its command printed.
1084
+ - 5a63dd4: feat(web): pages can carry a strict Content-Security-Policy and still be cached.
1085
+ A per-request nonce makes every document unique, so nifra marks a nonce-bearing page
1086
+ `private, no-store` and no shared cache (`withISR`, a CDN) may store it. `createCspPolicy({ header })`
1087
+ is the cacheable alternative: pass it to `createWebApp({ csp })` (or `renderPage({ csp })`) instead of
1088
+ `nonce`. A document then carries a nonce only when it has a script specific to this request (a
1089
+ deferred value, or `meta` naming the nonce in `unsafeInlineScript`). Every other document is
1090
+ nonce-free, its constant inline scripts are allowed by sha256 hash, and its CSP header is the same on
1091
+ every request. `header` receives `sources`, the `script-src` list the document needs.
1092
+ `nifraScriptHashes(adapter)` returns the hashes for a policy set at a proxy or CDN. Passing both `csp`
1093
+ and `nonce` throws.
1094
+
1095
+ The page-state handover is now one inert `<script type="application/json" id="__nifra-handover">`
1096
+ instead of an executable script that assigned `window.__NIFRA_DATA__` and its siblings, so page data
1097
+ needs no nonce or hash under any policy. The client entry assigns the same globals before anything
1098
+ reads them. Code that read those globals from an inline script running before the client entry must
1099
+ run after it, or read the handover element (`HANDOVER_ID`). `nifra assure --hydration` reads the new
1100
+ format. `RenderAssemblyCache` loses its `tailMid` and `tailData` slots.
1101
+
1102
+ `withISR` warns once when it wraps an app created with `nonce`, since it can never store one of its
1103
+ pages. It also remembers, for its revalidate window, keys whose page answered `private` or
1104
+ `no-store` and skips the store lookup for them. A remembered key that turns cacheable is stored again.
1105
+
1106
+ - f90bf81: On Windows, `nifra upgrade` leaves build output and coverage alone, `nifra_explain` shows a codeframe for project source under a short path, and `nifra i18n check` names its entry with `/`. `nifra check` reports findings in the same order on every platform, and `nifra mcp` keeps the variables a process has besides its `.env` files: the ones Windows copies into every subprocess and the ones a bunfig preload sets.
1107
+ - Updated dependencies [a8b33bc]
1108
+ - Updated dependencies [c3057ee]
1109
+ - Updated dependencies [dde125b]
1110
+ - Updated dependencies [22e2af8]
1111
+ - Updated dependencies [72b62fa]
1112
+ - Updated dependencies [aa44e93]
1113
+ - Updated dependencies [4a3ee60]
1114
+ - Updated dependencies [963694f]
1115
+ - Updated dependencies [57356c0]
1116
+ - Updated dependencies [682d8bf]
1117
+ - Updated dependencies [4ab5c6a]
1118
+ - Updated dependencies [bd6786e]
1119
+ - Updated dependencies [a0cfffa]
1120
+ - Updated dependencies [aad6297]
1121
+ - Updated dependencies [dad0d41]
1122
+ - Updated dependencies [538adc2]
1123
+ - Updated dependencies [f47edd1]
1124
+ - Updated dependencies [df9530a]
1125
+ - Updated dependencies [3e6973f]
1126
+ - Updated dependencies [25e8edf]
1127
+ - Updated dependencies [2b5e5fc]
1128
+ - Updated dependencies [3b090de]
1129
+ - Updated dependencies [da7d792]
1130
+ - Updated dependencies [612a296]
1131
+ - Updated dependencies [fb14dfa]
1132
+ - Updated dependencies [8ae97f6]
1133
+ - Updated dependencies [4af6f39]
1134
+ - Updated dependencies [ca8b50d]
1135
+ - Updated dependencies [b00a889]
1136
+ - Updated dependencies [b53d64f]
1137
+ - Updated dependencies [66fd712]
1138
+ - Updated dependencies [9c3d524]
1139
+ - Updated dependencies [738e7a1]
1140
+ - Updated dependencies [4801cac]
1141
+ - Updated dependencies [1b2d53a]
1142
+ - Updated dependencies [25fe13d]
1143
+ - Updated dependencies [0852290]
1144
+ - Updated dependencies [0589dbe]
1145
+ - Updated dependencies [2e2d8c0]
1146
+ - Updated dependencies [856f5ce]
1147
+ - Updated dependencies [18aa5aa]
1148
+ - Updated dependencies [cfd86b3]
1149
+ - Updated dependencies [8ff96c9]
1150
+ - Updated dependencies [4c46199]
1151
+ - Updated dependencies [eef4932]
1152
+ - Updated dependencies [6de8686]
1153
+ - Updated dependencies [9868241]
1154
+ - Updated dependencies [dd0d5c1]
1155
+ - Updated dependencies [6ce7975]
1156
+ - Updated dependencies [5f1f3d8]
1157
+ - Updated dependencies [6c978a1]
1158
+ - Updated dependencies [7669f56]
1159
+ - Updated dependencies [a77b341]
1160
+ - Updated dependencies [ce169a2]
1161
+ - Updated dependencies [b83d400]
1162
+ - Updated dependencies [214d674]
1163
+ - Updated dependencies [86e2d0f]
1164
+ - Updated dependencies [a0cfffa]
1165
+ - Updated dependencies [d7892ea]
1166
+ - Updated dependencies [93e5e7f]
1167
+ - Updated dependencies [214d674]
1168
+ - Updated dependencies [4936309]
1169
+ - Updated dependencies [ff5a779]
1170
+ - Updated dependencies [772249a]
1171
+ - Updated dependencies [f70f99b]
1172
+ - Updated dependencies [49f106f]
1173
+ - Updated dependencies [4936309]
1174
+ - Updated dependencies [0e9b167]
1175
+ - Updated dependencies [bbdc5a1]
1176
+ - Updated dependencies [10bc446]
1177
+ - Updated dependencies [e8270d9]
1178
+ - Updated dependencies [d942c33]
1179
+ - Updated dependencies [ef28ef9]
1180
+ - Updated dependencies [ef28ef9]
1181
+ - Updated dependencies [d4d40a5]
1182
+ - Updated dependencies [0f486f2]
1183
+ - Updated dependencies [37dff1d]
1184
+ - Updated dependencies [d4a79de]
1185
+ - Updated dependencies [9ccf198]
1186
+ - Updated dependencies [ff4a062]
1187
+ - Updated dependencies [29c6c94]
1188
+ - Updated dependencies [43ba944]
1189
+ - Updated dependencies [46c741a]
1190
+ - Updated dependencies [7bfa25e]
1191
+ - Updated dependencies [216fe27]
1192
+ - Updated dependencies [52bb49e]
1193
+ - Updated dependencies [4936309]
1194
+ - Updated dependencies [6e257a6]
1195
+ - Updated dependencies [4a03d30]
1196
+ - Updated dependencies [8e30090]
1197
+ - Updated dependencies [28f3aaf]
1198
+ - Updated dependencies [6d20355]
1199
+ - Updated dependencies [08250bf]
1200
+ - Updated dependencies [6907cbe]
1201
+ - Updated dependencies [4b8d8de]
1202
+ - Updated dependencies [ba5dd1c]
1203
+ - Updated dependencies [d50f73e]
1204
+ - Updated dependencies [031c33d]
1205
+ - Updated dependencies [4936309]
1206
+ - Updated dependencies [fb7c5b3]
1207
+ - Updated dependencies [715186c]
1208
+ - Updated dependencies [4b8d8de]
1209
+ - Updated dependencies [f56b6a8]
1210
+ - Updated dependencies [8fa902c]
1211
+ - Updated dependencies [085e852]
1212
+ - Updated dependencies [0dac7ec]
1213
+ - Updated dependencies [b64c3ee]
1214
+ - Updated dependencies [dc2d4d3]
1215
+ - Updated dependencies [d1e2f50]
1216
+ - Updated dependencies [784d772]
1217
+ - Updated dependencies [af7648c]
1218
+ - Updated dependencies [fab1d24]
1219
+ - Updated dependencies [1afbe9f]
1220
+ - Updated dependencies [bda9637]
1221
+ - Updated dependencies [562b4af]
1222
+ - Updated dependencies [81c720e]
1223
+ - Updated dependencies [ed60b23]
1224
+ - Updated dependencies [0150ed4]
1225
+ - Updated dependencies [ae815ab]
1226
+ - Updated dependencies [ea2ee87]
1227
+ - Updated dependencies [3442e1c]
1228
+ - Updated dependencies [85d636b]
1229
+ - Updated dependencies [6c978a1]
1230
+ - Updated dependencies [bfe29b6]
1231
+ - Updated dependencies [8b99424]
1232
+ - Updated dependencies [87783f0]
1233
+ - Updated dependencies [135aba4]
1234
+ - Updated dependencies [47b0d65]
1235
+ - Updated dependencies [e32268d]
1236
+ - Updated dependencies [432fec3]
1237
+ - Updated dependencies [0e14068]
1238
+ - Updated dependencies [8f1b780]
1239
+ - Updated dependencies [dcc9ff6]
1240
+ - Updated dependencies [5a63dd4]
1241
+ - Updated dependencies [c49882f]
1242
+ - Updated dependencies [dfd19d8]
1243
+ - Updated dependencies [28e091f]
1244
+ - Updated dependencies [046e79d]
1245
+ - Updated dependencies [6393b1e]
1246
+ - Updated dependencies [a158b74]
1247
+ - Updated dependencies [ee19d29]
1248
+ - Updated dependencies [293d3c8]
1249
+ - Updated dependencies [7e1e1c3]
1250
+ - Updated dependencies [0cd5f6e]
1251
+ - Updated dependencies [2245bee]
1252
+ - Updated dependencies [feeec4a]
1253
+ - Updated dependencies [3eb6339]
1254
+ - Updated dependencies [f784c32]
1255
+ - Updated dependencies [e3b2b97]
1256
+ - Updated dependencies [5934b5d]
1257
+ - Updated dependencies [03a3729]
1258
+ - Updated dependencies [bd11269]
1259
+ - Updated dependencies [579d9a9]
1260
+ - Updated dependencies [3554ad8]
1261
+ - Updated dependencies [64e7a42]
1262
+ - Updated dependencies [ee19d29]
1263
+ - Updated dependencies [d6f806f]
1264
+ - Updated dependencies [38cf032]
1265
+ - Updated dependencies [b94e5cb]
1266
+ - Updated dependencies [0f6babe]
1267
+ - Updated dependencies [00f18bf]
1268
+ - Updated dependencies [a84f546]
1269
+ - Updated dependencies [669b6a2]
1270
+ - Updated dependencies [ff25d68]
1271
+ - create-nifra@4.0.0
1272
+ - @nifrajs/core@4.0.0
1273
+ - @nifrajs/schema@4.0.0
1274
+ - @nifrajs/web@4.0.0
1275
+ - @nifrajs/client@4.0.0
1276
+ - @nifrajs/i18n@4.0.0
1277
+ - @nifrajs/testing@4.0.0
1278
+ - @nifrajs/mcp@4.0.0
1279
+ - @nifrajs/mcp-db@4.0.0
1280
+ - @nifrajs/runner@4.0.0
1281
+ - @nifrajs/agent-review@4.0.0
1282
+
1283
+ ## 3.5.0
1284
+
1285
+ ### Patch Changes
1286
+
1287
+ - 6430334: Add the provider-neutral, content-free review report contract and expose `nifra review` through the CLI, authenticated agent RPC, and Workbench-safe view projections.
1288
+ - Updated dependencies [6046984]
1289
+ - Updated dependencies [ac27343]
1290
+ - Updated dependencies [d5b7c22]
1291
+ - Updated dependencies [6430334]
1292
+ - Updated dependencies [82c3018]
1293
+ - @nifrajs/core@3.5.0
1294
+ - @nifrajs/web@3.5.0
1295
+ - @nifrajs/agent-review@3.5.0
1296
+ - @nifrajs/schema@3.5.0
1297
+ - @nifrajs/testing@3.5.0
1298
+ - @nifrajs/client@3.5.0
1299
+ - @nifrajs/mcp@3.5.0
1300
+ - @nifrajs/runner@3.5.0
1301
+ - create-nifra@3.5.0
1302
+
1303
+ ## 3.4.0
1304
+
1305
+ ### Patch Changes
1306
+
1307
+ - 8d23613: Add the opt-in `@nifrajs/webmcp` package: typed WebMCP registration, core-backed receipts, deterministic predictive-UI reconciliation, and host-independent conformance checks. Also tighten agent execution cancellation cleanup so aborted local work cannot leak into later turns.
1308
+ - 8d23613: Add an opt-in Vite aggregate-CSS and deferred stylesheet-loading path that prevents lazy-route prefetch from attaching additional stylesheets before hydration.
1309
+ - Harden MCP error responses and browser-origin defaults, confine scaffold writes to `routes/`, and
1310
+ make sanitized HTML require an explicit sanitizer function.
1311
+ - Updated dependencies [8d23613]
1312
+ - Updated dependencies [8d23613]
1313
+ - Updated dependencies
1314
+ - Updated dependencies [719d82e]
1315
+ - @nifrajs/mcp@3.4.0
1316
+ - @nifrajs/web@3.4.0
1317
+ - @nifrajs/core@3.4.0
1318
+ - @nifrajs/schema@3.4.0
1319
+ - @nifrajs/testing@3.4.0
1320
+ - @nifrajs/client@3.4.0
1321
+ - @nifrajs/runner@3.4.0
1322
+ - create-nifra@3.4.0
1323
+
1324
+ ## 3.3.0
1325
+
1326
+ ### Patch Changes
1327
+
1328
+ - @nifrajs/client@3.3.0
1329
+ - @nifrajs/core@3.3.0
1330
+ - @nifrajs/mcp@3.3.0
1331
+ - @nifrajs/runner@3.3.0
1332
+ - @nifrajs/schema@3.3.0
1333
+ - @nifrajs/testing@3.3.0
1334
+ - @nifrajs/web@3.3.0
1335
+ - create-nifra@3.3.0
1336
+
1337
+ ## 3.2.0
1338
+
1339
+ ### Minor Changes
1340
+
1341
+ - 652201a: Make islands the first-class interactivity lane for zero-runtime vanilla pages. `@nifrajs/web/islands`
1342
+ now exports `defineIsland` to type an enhancer's props and `createIslandBus` for typed pub/sub between
1343
+ islands that share no state. `nifra check` gains `NF-C020`, warning when an island enhancer wires an
1344
+ event listener but returns no cleanup, and `nifra scaffold` emits a golden vanilla route stub. New
1345
+ "Islands" cookbook documents the counter, cart-badge, and filter patterns.
1346
+ - 19a9f84: Add `nifra_frontend` (MCP) and `nifra frontend` (CLI): a symptom-indexed catalog of client-side
1347
+ footguns across every adapter (React, Preact, Solid, Vue, Svelte, vanilla). Each entry returns the
1348
+ cause, the concrete fix, and how to verify it. It splits along the seam `nifra_check` already owns: the
1349
+ adapter-independent boundary issues (a server-only import leaking into a client component, a hydration
1350
+ mismatch, a duplicated framework runtime, loader-data typing) point at the `nifra_*` tool that fixes
1351
+ and checks them, while the per-framework reactivity-loss idioms (Vue ref, Solid props, Svelte runes,
1352
+ React effect deps) point at that framework's own ESLint plugin rather than re-implementing it. Reach
1353
+ for it when a rendered page misbehaves and the static check is green. The tool is project-independent,
1354
+ so it is served on every transport (project stdio, `nifra docs-mcp`, and the site's `/mcp` worker), and
1355
+ the per-framework `nifra_scaffold` notes now route to it.
1356
+ - 25305bb: Add `@nifrajs/web/nano`, the explicit-reactivity lane for small apps that want local state without a
1357
+ framework runtime. It exports `signal`, `computed(fn, [deps])` with an explicit dependency array,
1358
+ `resource(fetcher, [deps])` - an async cell with a `pending`/`error`/`ready` value union that aborts a
1359
+ superseded fetch and drops its stale result - and `bind` / `bindList` / `bindResource` DOM edges, all
1360
+ with no virtual DOM and no auto-tracking. Because every reactive edge is a visible call, `nifra check`
1361
+ gains three static lints: `NF-C021` (a `bind`/`bindList`/`bindResource` whose disposer is discarded),
1362
+ `NF-C022` (a `bindList` keyed by the array index), and `NF-C023` (a `computed`/`resource` that reads a
1363
+ signal its deps omit). `nifra scaffold` accepts `variant: "stateful"` to emit the golden nano island
1364
+ pattern on a vanilla project, and a new "nano" cookbook documents signals, keyed lists, async state,
1365
+ and where the lane stops.
1366
+
1367
+ ### Patch Changes
1368
+
1369
+ - e7d55cc: Centralize repository verification gates behind stable, ID-addressed plans and expose the same plan through the project MCP server, so default and release verification cannot drift when gates change.
1370
+ - e88c23a: Infer typed status responses across lifecycle hooks and contract-first routes, preserve precise
1371
+ success and error narrowing in the client, and optionally include supported response types in
1372
+ build-time OpenAPI output. Unsupported TypeScript types remain opaque and explicit runtime schemas
1373
+ remain authoritative.
1374
+ - 4c81384: Harden Windows Bun dev re-exec entry detection and TypeScript route navigation across short/long path aliases.
1375
+ - Updated dependencies [1a041a9]
1376
+ - Updated dependencies [652201a]
1377
+ - Updated dependencies [6aa39aa]
1378
+ - Updated dependencies [3aefb12]
1379
+ - Updated dependencies [8b58d1f]
1380
+ - Updated dependencies [c4ed8f7]
1381
+ - Updated dependencies [cefedc2]
1382
+ - Updated dependencies [25305bb]
1383
+ - Updated dependencies [095c320]
1384
+ - Updated dependencies [7504864]
1385
+ - Updated dependencies [e88c23a]
1386
+ - Updated dependencies [c39712e]
1387
+ - Updated dependencies [9010fd3]
1388
+ - Updated dependencies [7551709]
1389
+ - Updated dependencies [ea2356e]
1390
+ - Updated dependencies [a816b87]
1391
+ - @nifrajs/mcp@3.2.0
1392
+ - @nifrajs/testing@3.2.0
1393
+ - @nifrajs/web@3.2.0
1394
+ - @nifrajs/core@3.2.0
1395
+ - @nifrajs/client@3.2.0
1396
+ - @nifrajs/schema@3.2.0
1397
+ - @nifrajs/runner@3.2.0
1398
+ - create-nifra@3.2.0
1399
+
1400
+ ## 3.1.0
1401
+
1402
+ ### Patch Changes
1403
+
1404
+ - Updated dependencies [5b78473]
1405
+ - Updated dependencies [1400f6c]
1406
+ - Updated dependencies [8b136ee]
1407
+ - Updated dependencies [a7db515]
1408
+ - @nifrajs/core@3.1.0
1409
+ - @nifrajs/web@3.1.0
1410
+ - @nifrajs/client@3.1.0
1411
+ - @nifrajs/mcp@3.1.0
1412
+ - @nifrajs/schema@3.1.0
1413
+ - @nifrajs/testing@3.1.0
1414
+ - @nifrajs/runner@3.1.0
1415
+ - create-nifra@3.1.0
1416
+
1417
+ ## 3.0.0
1418
+
1419
+ ### Minor Changes
1420
+
1421
+ - 5a94db4: The reserved typed-client proxy keys are now a frozen, published contract with a migration path.
1422
+
1423
+ `nifra fix --code NF-C018` rewrites the call sites a reserved-named route segment breaks. It reads the sites from the compiler rather than from a text search, so it finds every one and never mistakes a real `.delete` verb call for a path segment; a site it cannot rewrite confidently (bracket access, a node held in a variable) is reported and left alone rather than guessed at.
1424
+
1425
+ `nifra routes` now annotates a colliding route with the reserved key and the spelling that reaches it, in both the table and `--json`, so the closed set is visible while the route is being written instead of when a build breaks. The typed-client call form printed by `nifra context` and the `nifra_routes` MCP tool is corrected for these routes too: a reserved segment is emitted as a call on the parent node, never as a property or bracket access, both of which the proxy intercepts.
1426
+
1427
+ `@nifrajs/client` exports the set itself - `RESERVED_VERB_KEYS`, `RESERVED_EXACT_KEYS`, `RESERVED_KEY_READOUT`, and `reservedKeyFor(segment)` - as the one place it is written down. The list is frozen: no name is ever added to it, because adding one breaks, at compile time, every consumer that happens to have a route segment with that name. Anything the client gains from here on is reached through a namespaced or symbol key, which no URL path segment can spell.
1428
+
1429
+ Client 2.12.0 should have been a major release: its reserved-segment types reject a property access that compiled in 2.11. Its changelog entry now says so, and `CONTRIBUTING.md` states the rule - a type that stops compiling is a breaking change, runtime behavior notwithstanding, and ships with a codemod.
1430
+
1431
+ ### Patch Changes
1432
+
1433
+ - 5948f24: A new `check:changesets` gate fails when a package's source changed since the last release without a changeset naming it. Versioning is fixed across the workspace, so an undeclared package still bumps - it just ships with a changelog that says nothing about what moved, which is how a consumer upgrades into a change no release note mentions. The gate anchors on the last release commit in git history, so it needs no tag, base ref, or network, and it runs in `nifra check` release mode as well as CI.
1434
+ - 627b0ba: `nifra` now accepts `--env-file <path>` on every command, repeatable, with later files winning and a variable already set in the process environment never overwritten.
1435
+
1436
+ Commands that reflect a project (`check`, `assure`, `levels`, `routes`, `capabilities`, `manifest`, `contracts`, `openapi`, `types`) do so by importing it, and a production-grade app validates its environment at module scope. Without that environment the app aborted the process before nifra reached its first check, so the entire output was the app's own `FATAL: invalid environment` with nothing tying it to the command that was run - an app whose environment lives in an uncommitted `.env.local` simply could not be checked. A missing `--env-file` is a hard error rather than a silent no-op, so a command never looks like it verified an environment it did not load.
1437
+
1438
+ When a reflected import kills the process anyway, the CLI now names the cause on the way out instead of leaving the app's bare abort as the only output.
1439
+
1440
+ - 293a7fe: Identity-parity findings now state the install topology, and `nifra doctor` and the build guard now answer on the same basis.
1441
+
1442
+ Both tools already shared one walker, but they anchored it differently: doctor scanned the workspace that governs the project while the build guard scanned the app directory it was invoked in, so a duplicate that lives in a sibling workspace package could show up in one output and not the other. Since neither printed which directory it had scanned, that read as two tools contradicting each other about the same invariant. The scan is now always anchored on the governing workspace, both tools name the root they answered on, and a scan that stopped at the workspace-enumeration cap reports itself as partial instead of returning "no duplicates".
1443
+
1444
+ A finding whose copies lie outside the directory the command was run in now says why it is still fatal there: the gate is workspace-wide deliberately, because a copy reached through a workspace-linked dependency is not visible from the app directory - the exact case that once had the check report "none" against an already-broken dev server. Running a build inside one app can therefore fail on a copy held by a sibling app, and the message states that trade rather than leaving it to look like the tool checking the wrong project.
1445
+
1446
+ Each finding also carries a topology line: how many physical paths, how many install roots they fall under, and whether any of those roots sits outside the scanned root. That distinction is the whole fix decision - copies under one workspace collapse with a single reinstall from the root, while a copy under a linked checkout or a standalone sibling install belongs to another project and no reinstall here can remove it. Previously the error listed paths only, leaving that to be reverse-engineered.
1447
+
1448
+ The hard gate now fails closed on a truncated scan. A scan that stopped at any of its caps - workspace packages, linked packages, or link probes - and then found no duplicates has not shown there is none; the duplicate can be sitting in the part it never reached. `assertIdentityParity` treats that state as inconclusive and throws, rather than reading an incomplete scan as a pass. The reporting surfaces (`nifra doctor`, the dev warning) still print the partial result and name the limit that was hit.
1449
+
1450
+ - 36801ae: New: a static `singleCopy` declaration that collapses an identity-sensitive package to one physical copy, for the duplicate no install can remove.
1451
+
1452
+ An app that consumes a package by `link:` from a **separate checkout** cannot deduplicate React (or `@nifrajs/*`) by installing differently. The linked files live in the other repo, so their imports resolve from that repo's real path, and that repo's install owns its `node_modules`: peer dependencies are already satisfied there, `overrides` govern the consuming install only, and a deleted nested copy returns on the sibling's next install. The build's existing per-framework dedupe covers bundled output, but nothing covered `bun test`, `bun run`, or a preloaded script - and `nifra check` failed the app with remediation ("deduplicate the install") that the topology makes impossible.
1453
+
1454
+ An app now declares the packages in its own `package.json`:
1455
+
1456
+ ```json
1457
+ { "nifra": { "singleCopy": ["react", "react-dom", "@nifrajs/*"] } }
1458
+ ```
1459
+
1460
+ Entries are exact names or `@scope/*` patterns; `true` expands to the built-in identity-sensitive set (`@nifrajs/*`, `react`, `react-dom`, `preact`, `solid-js`, `svelte`, `vue`). `@nifrajs/*` is in that set because two copies of `@nifrajs/core` are two distinct `Server` classes, so `.merge()` stops accepting an app built against the other one. The declaration is static so `nifra check` can read it without importing the app's config, which would mean executing app code inside a preflight.
1461
+
1462
+ `buildClient` and `buildServer` inject the resolver from the declaration, so bundled output needs no wiring. Unbundled phases are not covered automatically - Bun's runtime resolver never offers a bare specifier to a plugin - so an app preloads `@nifrajs/core/single-copy/register` from `bunfig.toml` (`preload` for `bun run`, `[test].preload` for `bun test`). `nifra check` now names the phase that is left uncovered when the declaration exists without the preload.
1463
+
1464
+ The redirect refuses to cross versions: two copies at different versions are skipped as `version-skew` and stay fatal, because collapsing them would turn a loud install problem into a quiet behavioural one. A declared duplicate is reported, not suppressed - `nifra check` keeps printing the copies as a warning and `nifra doctor` lists them under `deduplicatedInstalls` - so the topology stays visible without failing the gate.
1465
+
1466
+ New exports: `@nifrajs/core/single-copy` (`singleCopyPlugin`, `registerSingleCopy`, `planSingleCopy`, `readSingleCopyDeclaration`, `readSingleCopyRegistration`, `matchesSingleCopyDeclaration`, `IDENTITY_SENSITIVE_PACKAGES`) and the side-effect entry `@nifrajs/core/single-copy/register`.
1467
+
1468
+ The registration proof reads `preload` as entries rather than as text: an entry counts only when it **is** the register specifier, not when it merely contains it. A neighbouring path such as `"./vendor/@nifrajs/core/single-copy/register-shim.ts"` used to satisfy the check while Bun loaded that other module and the registrar never ran, so enforcement was reported as armed on a process still loading both copies. A `preload` this cannot read as quoted entries - a multi-line array, an interpolated value - now reports "not registered" instead of standing in for proof.
1469
+
1470
+ - 8895dca: `nifra check` picks up a TypeScript install that lands while a long-lived process is running, and refuses a "typescript" that is not the compiler.
1471
+
1472
+ The rule that parses source with the project's TypeScript resolved it through a resolver that memoizes a specifier for the life of the process and, when the project has none installed, falls back to the global download cache. In a long-lived process - the MCP server - the first lookup before `bun install` pinned that cache entry, so every later check in the same session kept using it: the typecheck went phantom until the server was restarted. Resolution is now a filesystem probe for `node_modules/typescript` from the project root upward, the same walk the typecheck gate uses to find `tsc`, so an install that lands mid-session is seen on the next run.
1473
+
1474
+ The cache entry it resolved to was also not a compiler, only a version stub, which crashed the scan with `undefined is not an object (evaluating 'ts.ScriptKind.TSX')` - a Nifra-looking stack trace for "no compiler is installed here". A module that does not expose the compiler API is now treated as a resolution miss, so the CLI falls back to its own copy or reports TypeScript as missing.
1475
+
1476
+ - 53fd454: Make `NF-C010` (workspace-linked dist older than its source) actually fixable.
1477
+
1478
+ The `workspace-dist.rebuild` recipe resolved the package through the project-contained path check, but a
1479
+ workspace link points outside the project by definition - the only kind of install that can go stale - so
1480
+ the check rejected every package the diagnostic can name and `nifra fix --code NF-C010` was a silent
1481
+ no-op. Resolution now goes through the same lookup the staleness scan uses (package name -> the project's
1482
+ own `node_modules` chain -> realpath), refuses with a stated reason (registry install, no `build` script,
1483
+ not installed) instead of reporting nothing, and surfaces the package's own build failure.
1484
+
1485
+ `nifra check` now names the directory and script in the warning (`cd ../pkg && bun run build`) instead of
1486
+ "usually `bun run build` in its directory", and `doctor --json` gained `packageDir` and `buildScript` on
1487
+ each stale-dist finding. `nifra fix` gained a `failed` array so one recipe that cannot act reports why
1488
+ without cancelling the rest of the run.
1489
+
1490
+ - Updated dependencies [f3d2a35]
1491
+ - Updated dependencies [6e43c15]
1492
+ - Updated dependencies [293a7fe]
1493
+ - Updated dependencies [485ae60]
1494
+ - Updated dependencies [627b0ba]
1495
+ - Updated dependencies [f0fd370]
1496
+ - Updated dependencies [004deee]
1497
+ - Updated dependencies [5a94db4]
1498
+ - Updated dependencies [86a555b]
1499
+ - Updated dependencies [8c5f4cf]
1500
+ - Updated dependencies [ee2744c]
1501
+ - Updated dependencies [f0fd370]
1502
+ - Updated dependencies [381bbf3]
1503
+ - Updated dependencies [36801ae]
1504
+ - Updated dependencies [9acadba]
1505
+ - Updated dependencies [99fc683]
1506
+ - Updated dependencies [73d894d]
1507
+ - @nifrajs/core@3.0.0
1508
+ - @nifrajs/web@3.0.0
1509
+ - @nifrajs/client@3.0.0
1510
+ - @nifrajs/runner@3.0.0
1511
+ - @nifrajs/mcp@3.0.0
1512
+ - @nifrajs/schema@3.0.0
1513
+ - @nifrajs/testing@3.0.0
1514
+ - create-nifra@3.0.0
1515
+
1516
+ ## 2.14.1
1517
+
1518
+ ### Patch Changes
1519
+
1520
+ - Updated dependencies [bf93902]
1521
+ - @nifrajs/core@2.14.1
1522
+ - @nifrajs/client@2.14.1
1523
+ - @nifrajs/mcp@2.14.1
1524
+ - @nifrajs/schema@2.14.1
1525
+ - @nifrajs/testing@2.14.1
1526
+ - @nifrajs/web@2.14.1
1527
+ - @nifrajs/runner@2.14.1
1528
+ - create-nifra@2.14.1
1529
+
1530
+ ## 2.14.0
1531
+
1532
+ ### Minor Changes
1533
+
1534
+ - 489c6b6: `nifra assure --json` again emits the route-assurance report `{ ok, routes, findings }`. A prior release
1535
+ had silently repurposed `--json` to print the structured `{ version, gates, verdict }` assurance bundle,
1536
+ so a consumer parsing the report shape saw its fields vanish with no version signal. The bundle is now
1537
+ opt-in behind an explicit `nifra assure --bundle` (always JSON); the bundle-only flags `--strict`,
1538
+ `--hydration`, `--interact`, and `--out` continue to imply it, and `--bundle --json` still yields the
1539
+ bundle. Plain `nifra assure` prints the human table as before. If you adopted `assure --json` for the
1540
+ bundle since it changed, switch to `assure --bundle`.
1541
+ - a8130aa: `nifra build` now fails when a workspace-linked dependency ships a `dist` artifact that is missing or
1542
+ older than its source. The `"bun": "./src"` / `"default": "./dist"` conditional-export split lets Bun
1543
+ (the build, the tests) read live source while the deployed app and any Node consumer read `dist`, so a
1544
+ green build could bundle stale or absent compiled output and nothing in a diff would show it. The check
1545
+ runs after the compile proves the source is buildable and names each offending package so the fix
1546
+ (rebuild it) is obvious. It is a no-op outside a workspace, since a tarball-installed dependency cannot
1547
+ drift. The doctor already surfaces the same skew as a development-time advisory; at build time it is now
1548
+ a hard failure, because that is the artifact that ships.
1549
+ - ea6b82a: `nifra --help` now lists a stable project command catalog, and the CLI, the `nifra mcp` project tools,
1550
+ and the generated `@nifrajs/cli` card all describe those commands - `check`, `assure`, `levels`,
1551
+ `capabilities`, `manifest`, `routes`, `context`, `doctor`, `fix`, `snapshot`, `diff`, `contracts`,
1552
+ `sync-manifest`, `sync-routes` - from one projection, so a command's name, one-line summary, and input
1553
+ schema can no longer drift between the three surfaces. A parity check fails the build if they do.
1554
+ `nifra verify` and `nifra prove` are intentionally excluded and stay hand-rolled.
1555
+
1556
+ `nifra fix` now prints a human summary by default and reserves JSON for `nifra fix --json`; the `--json`
1557
+ shape gains an `ok` field alongside `changed` and `diagnostics`. A script that parsed plain `nifra fix`
1558
+ output as JSON must pass `--json`.
1559
+
1560
+ Structured `--json` results carry a versioned envelope, and the reader still accepts the prior
1561
+ un-enveloped shape, so an existing consumer keeps working across the change.
1562
+
1563
+ - 489c6b6: `nifra dev` gains `--allow-duplicate-identity`, which downgrades the Vite dev server's startup
1564
+ identity-parity check from a hard failure to a loud warning. The check catches two physical copies of
1565
+ an identity-sensitive package (React, the framework adapter, `@nifrajs/core`) resolving in one process,
1566
+ which reliably breaks hydration and framework context - so it stays a hard stop by default, and
1567
+ `nifra build` never honors the flag. But when the duplicate originates in a linked sibling repo you
1568
+ cannot fix in the moment, the previous behavior took the dev server down with no way to keep working.
1569
+ With the flag, the server prints the same finding detail (packages, versions, resolved paths) and a
1570
+ reminder that duplicate identity can still corrupt hydration, then continues at exit 0. The web option
1571
+ `createViteDevServer({ allowDuplicateIdentity: true })` exposes the same escape programmatically.
1572
+ - a8130aa: The interpolated-SQL rule now resolves a query-call argument identifier to its same-file initializer
1573
+ before shaping it, so extracting a variable no longer launders a finding. Previously
1574
+ `` await c.query(`SELECT ... '${input}'`) `` was flagged but the identical hoisted form
1575
+ `` const q = `SELECT ... '${input}'`; await c.query(q) `` passed clean, because const-resolution
1576
+ reached consts referenced inside a template but never the argument identifier itself.
1577
+
1578
+ Resolution covers const and never-reassigned `let`, at both function-local and module scope, and
1579
+ follows a chain of identifier initializers transitively. The nearest enclosing binding wins, so a local
1580
+ never resolves through a shadowed outer name. A resolved dynamic statement is an error exactly as the
1581
+ inline form is; a static hoisted statement (including a const assembled from other static consts) stays
1582
+ green. Identifiers that cannot be resolved in-file - parameters, imports, reassigned bindings - are left
1583
+ unflagged rather than guessed at, so a helper that receives a prepared statement as a parameter is not
1584
+ falsely accused.
1585
+
1586
+ New per-statement escape hatch for the case where a dynamic-looking statement is provably safe (a
1587
+ generated placeholder list, say): a `// nifra-expect sql-dynamic: <reason>` comment on or directly above
1588
+ the flagged line silences that one statement. The reason is mandatory - a bare marker with no reason
1589
+ does not suppress.
1590
+
1591
+ ### Patch Changes
1592
+
1593
+ - 8dd97c0: App load now rejects a `clientModule` that has no `./` prefix but names a real local file. Such a
1594
+ specifier is read as a bare package specifier and resolved against `node_modules`, not the project - so
1595
+ `src/client.tsx` (a forgotten `./`) is ignored, no package is found, and the bundle fails deep in the
1596
+ build with an opaque "cannot resolve". Load catches it up front and reports the one-character fix
1597
+ (`./src/client.tsx`), so `nifra dev` and `nifra build` resolve the same local entry. Scoped (`@…`),
1598
+ absolute, and genuine bare-package specifiers are unaffected.
1599
+ - a8130aa: `nifra doctor` now flags a running CLI whose feature version differs from the `@nifrajs/cli` (or
1600
+ `@nifrajs/core`) the project installs. A stale global or `bunx`-cached binary answering about a
1601
+ project it does not match returns types, checks, and docs that describe a surface the code does not
1602
+ have, and every answer still reads as authoritative. The finding is advisory - it names both versions
1603
+ and points at the project's own CLI, but never fails the gate on its own, since a version mismatch of
1604
+ the binary is an environment condition rather than a defect in the project. Reported only when the
1605
+ command supplies its own version, so callers that already annotate drift (the MCP server) do not
1606
+ double-report; the `--json` shape gains an optional `toolingDrift` field. Patch differences are
1607
+ ignored - they never change the described surface.
1608
+ - a8130aa: `nifra check` now prints an advisory when the contract lock is vacuous - every route hashes to the
1609
+ empty-schema digest because no route declares a `body`, `query`, `params`, or `response` schema. Such a
1610
+ lock passes drift detection unconditionally: it can only ever compare an empty schema to an empty
1611
+ schema, so it guards nothing. The advisory says so and points at declaring route schemas, so a first
1612
+ run on an unschematized app does not leave a lock that looks protective but is not. A lock with no
1613
+ routes at all is not treated as vacuous, since there is no unguarded contract to warn about.
1614
+ - Updated dependencies [489c6b6]
1615
+ - Updated dependencies [701961a]
1616
+ - Updated dependencies [62e22e2]
1617
+ - Updated dependencies [62e22e2]
1618
+ - Updated dependencies [62133bf]
1619
+ - Updated dependencies [8dffdf4]
1620
+ - Updated dependencies [489c6b6]
1621
+ - @nifrajs/web@2.14.0
1622
+ - @nifrajs/core@2.14.0
1623
+ - @nifrajs/client@2.14.0
1624
+ - @nifrajs/mcp@2.14.0
1625
+ - @nifrajs/schema@2.14.0
1626
+ - @nifrajs/testing@2.14.0
1627
+ - @nifrajs/runner@2.14.0
1628
+ - create-nifra@2.14.0
1629
+
1630
+ ## 2.13.0
1631
+
1632
+ ### Minor Changes
1633
+
1634
+ - 6510fdc: Add `nifra verify`, one command that runs the repository verification gate. `--release` runs the full
1635
+ build, test, coverage, corpus, consumer, and cross-runtime set; the default runs a fast lint,
1636
+ typecheck, and test pass. `--json` emits a machine-readable result carrying each gate's status and
1637
+ remediation, so the same gate serves humans, CI, and agents.
1638
+
1639
+ ### Patch Changes
1640
+
1641
+ - Updated dependencies [e0b2dd6]
1642
+ - Updated dependencies [7535ce1]
1643
+ - Updated dependencies [1704308]
1644
+ - Updated dependencies [6510fdc]
1645
+ - @nifrajs/core@2.13.0
1646
+ - @nifrajs/web@2.13.0
1647
+ - @nifrajs/client@2.13.0
1648
+ - @nifrajs/mcp@2.13.0
1649
+ - @nifrajs/schema@2.13.0
1650
+ - @nifrajs/testing@2.13.0
1651
+ - @nifrajs/runner@2.13.0
1652
+ - create-nifra@2.13.0
1653
+
1654
+ ## 2.12.1
1655
+
1656
+ ### Patch Changes
1657
+
1658
+ - Updated dependencies [fba30c7]
1659
+ - @nifrajs/core@2.12.1
1660
+ - @nifrajs/client@2.12.1
1661
+ - @nifrajs/mcp@2.12.1
1662
+ - @nifrajs/schema@2.12.1
1663
+ - @nifrajs/testing@2.12.1
1664
+ - @nifrajs/web@2.12.1
1665
+ - @nifrajs/runner@2.12.1
1666
+ - create-nifra@2.12.1
1667
+
1668
+ ## 2.12.0
1669
+
1670
+ ### Minor Changes
1671
+
1672
+ - df100d3: Canonical project evidence: a single reflected snapshot of a project's routes, schemas, assurance,
1673
+ and capabilities, exported as `@nifrajs/core/evidence` (`snapshotProjectEvidence`). Tools that used
1674
+ to reflect the app a second time now project from the snapshot instead, so the manifest, the check
1675
+ report, and introspection cannot disagree about what the app declares.
1676
+
1677
+ `createManifest` accepts the snapshot as `evidence` and skips its own reflection when given one. It
1678
+ refuses to emit a manifest whose route-assurance or capability evidence is failing, so a manifest is
1679
+ never a record of a project that does not pass its own gates. The previous `source` input still
1680
+ works; one of the two is required.
1681
+
1682
+ - df100d3: `nifra check`'s text-scanning rules confirm their candidates against a parsed source model before
1683
+ reporting. A route path spelled inside an ordinary string, a `return new Response(` written in a
1684
+ comment or template text, and an erased inline `import { type X }` no longer produce findings that
1685
+ a reader has to dismiss by hand.
1686
+
1687
+ The parser is a refinement, never a relaxation: it is invoked lazily - only once a lexical scan
1688
+ finds something worth disambiguating - the parse is cached across rules for the run, and a file that
1689
+ fails to parse keeps its lexical finding so the security rules stay fail-closed.
1690
+
1691
+ - b5aa099: `nifra check` verdicts are now install- and cwd-invariant, fully visible in the text report, and configurable per rule:
1692
+
1693
+ - **Report parity.** Every diagnostic that affects the exit code now appears in the human text report, not only in `--json` - registry rules and application rule packs render under their code titles, and the trailer states the exact error/advisory counts behind the verdict.
1694
+ - **Typecheck can no longer skip silently.** A project with a `tsconfig.json` but no installed TypeScript now fails the check with an actionable diagnostic (`bun add -d typescript`) instead of a dim skip line, and the skip note names the reason.
1695
+ - **Project-resolved compiler.** `tsc` and the TypeScript API used by compiler-backed lints resolve upward from the project root (monorepo hoisting included), so verdicts no longer depend on the working directory or on how the CLI was installed. Security lints that cannot run without TypeScript emit an explicit "did NOT run" advisory instead of passing silently.
1696
+ - **`nifra.check.json` rule overrides.** A new `rules` map accepts per-rule `severity` (`error`/`warn`/`info`/`off`) and `ignore` globs, keyed by NF- code or legacy rule name; applied overrides are echoed in the report and the JSON result for auditability, and invalid entries warn instead of silently applying.
1697
+ - **NF-S002 severity by file role.** Non-constant-time secret comparisons in server-role files (`*.server.ts`, `server/`, `backend.ts`) stay errors; the same pattern in client-leaning files (`.tsx`/`.jsx`, `routes/`) reports as a warning. The `@nifra-gate-reviewed` marker now applies from anywhere inside the preceding comment block.
1698
+
1699
+ - 27e06a9: Typed collision escape for reserved-named route segments. The client proxy resolves the seven HTTP verbs (any casing) plus `subscribe`, `ws`, `index`, and `then` before path segments, so a route like `POST /api/delete` cannot be reached by dot access - `api.delete` is the DELETE verb. The typed spelling is now a call on the parent node: `api.api("delete").post()` sends `POST /api/delete`. The call signature accepts exactly the colliding segment names under that node (it is not a general string path builder), coexists with param calls on the same node (an object is a param bag, a string literal the segment), and covers all eleven reserved names including `then`. Purely additive - no runtime change, no existing call site affected.
1700
+
1701
+ `NF-C018` accordingly downgrades from error to warning and its message now spells out the escape call for the flagged route, alongside the existing rename and `nifra-expect reserved-segment` options.
1702
+
1703
+ - 9314567: `nifra doctor` follows linked dependencies when looking for duplicate installs. A package linked in
1704
+ from a sibling repo (`link:`, `npm link`, a local file dependency) resolves through a symlink that
1705
+ leaves the workspace, and the copies of `@nifrajs/*` installed inside that sibling were invisible to
1706
+ the duplicate check - the exact shape that produces two incompatible copies of core in one build.
1707
+ Doctor now resolves each linked dependency to its real path, probes it for identity-sensitive
1708
+ packages, and reports every copy with the path it was found at. The scan is bounded (linked roots
1709
+ and probes are capped) and stays inside the linked package's own repository.
1710
+ - 3d8d8e4: Add production-readiness checks to `nifra doctor`, including target-aware reporting and a `--strict` mode for failing when applicable guarantees are absent.
1711
+ - ce3128f: `nifra mcp` resolves the project it describes instead of trusting the directory it was spawned in.
1712
+ An MCP client configured with a different working directory used to get confident answers about
1713
+ whatever happened to be there - or about no project at all - with nothing in the response saying so.
1714
+
1715
+ - `nifra mcp <dir>` takes an explicit project directory; a human-named root always wins.
1716
+ - Without one, the spawn directory walks UP to the nearest nifra marker (a `package.json` depending
1717
+ on `@nifrajs/*`, or a `nifra.config.ts` monorepo root), so starting in a subdirectory still lands
1718
+ on the project.
1719
+ - After the handshake the server reads the client's MCP `roots`. When the guess found no project, or
1720
+ found one disjoint from every workspace root, and exactly ONE workspace root is a nifra project,
1721
+ that root is adopted. Ambiguity adopts nothing.
1722
+ - What cannot be resolved fails closed: project-scoped tools refuse with a remediation message that
1723
+ lists the candidate roots. When a root IS in effect, every project tool result carries a note
1724
+ naming it, and the `initialize` instructions announce it.
1725
+
1726
+ - ba85ce7: The MCP server says when it is answering from a different nifra than the project builds with. A
1727
+ client that launches a globally installed `nifra mcp` gets confident, authoritative answers about
1728
+ types, checks, and docs from whichever CLI version happens to be on the machine - the mismatch is
1729
+ invisible in every answer. The server now compares its own version against the `@nifrajs/cli` (or
1730
+ `@nifrajs/core`) installed in the resolved project root, and when the feature versions differ it
1731
+ stamps a warning naming both versions on the `initialize` instructions and on every project tool
1732
+ result, with the command that runs the project's own CLI instead. Patch-level differences are not
1733
+ reported.
1734
+ - 5a02c51: Route-table lints in `nifra check`: `NF-C018` (error) flags routes whose static path segments spell a reserved typed-client proxy key (get/post/put/patch/delete/head/options in any casing, plus `subscribe`, `ws`, `index`, `then`) - such routes are unreachable through the typed client; opt out for an intentionally non-typed-client route with `// nifra-expect reserved-segment` above the registration. `NF-C019` (error) flags the same method+path registered twice in one file, where which registration serves is undefined.
1735
+ - 0aadd62: Four new built-in security lints in `nifra check`: `NF-S004` warns when a `cors` origin predicate never reads the origin (it allows every origin), `NF-S005` warns on `redirect(..., { external: true })` call sites so open-redirect surfaces stay auditable, `NF-S006` warns when a security escape hatch (`allowLengthless`, `allowGlobalKey`, `allowInProduction`) is enabled and names the assurance claim it weakens, and `NF-S007` (info) nudges Secure cookies toward `__Host-`/`__Secure-` prefixes. All four honor the `@nifra-gate-reviewed` marker and share the existing one-parse-per-file pipeline.
1736
+ - 866d59f: `nifra check`'s interpolated-SQL rule follows a query fragment into the module that exports it. A project that keeps its column lists and order clauses in a `sql-fragments.ts` and imports them by name no longer gets an error on every query assembled from them, so the rule's errors stay the ones worth reading.
1737
+
1738
+ Resolution stops wherever proof does, because a wrong resolution here silences a real SQL injection rather than reporting a false one. It follows `export const NAME = "…"`, the two-statement `const NAME = …; export { NAME }`, and barrels (`export { NAME } from`, `export *`), reached by a named import from a relative specifier that lands on real source inside the project. Everything else still flags: a default or namespace import, an exported `let`, an initializer that is a call, a bare specifier (a dependency's exports are not the project's to prove), two `export *` sources offering the same name, a chain longer than three modules, a cyclic barrel, a file that does not parse, and a local binding that shadows the import. A resolved fragment still feeds the keyword scan, so hostile SQL parked in a shared constant is found rather than trusted, and the fragment's own identifiers are read in its own module - never in the file that imported it.
1739
+
1740
+ - a5d3f5b: Add stable diagnostic codes, application-supplied rule packs, fix recipes, assurance bundles, contract lock snapshots, hydration assurance hooks, replay metadata, security verification rules, and idempotency proofs.
1741
+ - e2d1939: Add typed tool contracts with shared fail-closed adapters, static verification work graphs, bounded provider-neutral agent turns, deterministic trajectory replay, and an explicit execution-policy seam with a non-isolating local process adapter.
1742
+ - e83e6eb: A capability provenance rule that matches nothing is now a finding. Seam specifiers in
1743
+ `provenance.imports` and `provenance.routeModules` are compared with the text the code imports, so a
1744
+ rule written as `src/db` when the module is imported as `./src/db.ts` silently governed zero
1745
+ modules - the policy looked satisfied because nothing was ever attributed to it. `nifra check` now
1746
+ reports `unmatched-provenance-seam` for every declared seam no scanned source matched, with the
1747
+ nearest specifiers that were actually seen ("did you mean ...?") and a fix that points at rewriting
1748
+ the rule to match the import, or deleting it.
1749
+
1750
+ `forbiddenImports` is deliberately excluded: zero matches there is the success state.
1751
+
1752
+ A rule that is genuinely absent in some projects sharing one policy can opt out with
1753
+ `optional: true`, which suppresses the finding for that seam only.
1754
+
1755
+ ### Patch Changes
1756
+
1757
+ - 33548fe: The two CLI paths that bound a caller-supplied path to the project root now resolve it through the
1758
+ filesystem instead of comparing strings. `loadBackend`'s entry check and `resolveProjectDir` both
1759
+ compared the textual path, so a symlink inside the project pointed anywhere and still read as inside -
1760
+ and importing an entry executes it. Both now canonicalize with `realpath` before the containment test
1761
+ (`resolveProjectDir` walks up to the deepest existing ancestor, so a not-yet-created directory still
1762
+ resolves), and the test itself covers the Windows cross-drive case where `relative()` returns an
1763
+ absolute path that starts with neither `..` nor a separator.
1764
+
1765
+ `nifra init-agents` refuses to write through a symlink: a symlinked ancestor directory or a symlinked
1766
+ target file aborts with an error rather than landing the file wherever the link points. Writes are
1767
+ also atomic (temp file plus rename, `wx` so the temp cannot follow an existing name), so an
1768
+ interrupted run can no longer leave a half-written config behind.
1769
+
1770
+ - 0a91064: The docs, examples, and types MCP searches bound their own cost. A query is truncated to 256
1771
+ characters and 12 distinct terms before scoring (`MAX_QUERY_CHARS` / `MAX_QUERY_TERMS`), and the
1772
+ schemas advertise the same 256-character limit. Each bundled corpus is read once per process and its
1773
+ sections are parsed, tokenized, and lowercased once, instead of on every call - the corpus ships
1774
+ immutable in a published build, so there is nothing to invalidate.
1775
+
1776
+ Auto-fixes write only inside the project. A diagnostic path is rejected when it is absolute, when it
1777
+ escapes the root lexically, or when its real path lands outside after symlinks resolve; the fix is
1778
+ skipped rather than applied. Both the generic MCP edit path and the fix recipes share the one
1779
+ `resolveInsideProject` helper.
1780
+
1781
+ - Updated dependencies [df100d3]
1782
+ - Updated dependencies [0efacea]
1783
+ - Updated dependencies [cd1732c]
1784
+ - Updated dependencies [df100d3]
1785
+ - Updated dependencies [27e06a9]
1786
+ - Updated dependencies [9a9346e]
1787
+ - Updated dependencies [b5f47c0]
1788
+ - Updated dependencies [fc33c0f]
1789
+ - Updated dependencies [7dd3f28]
1790
+ - Updated dependencies [fa51aba]
1791
+ - Updated dependencies [c4e8bb0]
1792
+ - Updated dependencies [11d1658]
1793
+ - Updated dependencies [33ee9ff]
1794
+ - Updated dependencies [9a692a2]
1795
+ - Updated dependencies [5f71c23]
1796
+ - Updated dependencies [3788b36]
1797
+ - Updated dependencies [0863ef0]
1798
+ - Updated dependencies [ae5338f]
1799
+ - Updated dependencies [8847825]
1800
+ - Updated dependencies [cb04de8]
1801
+ - Updated dependencies [f3cc02e]
1802
+ - Updated dependencies [9a9346e]
1803
+ - Updated dependencies [4c2123d]
1804
+ - Updated dependencies [5e4e31a]
1805
+ - Updated dependencies [24f1787]
1806
+ - Updated dependencies [9a9346e]
1807
+ - Updated dependencies [b045f9e]
1808
+ - Updated dependencies [df07059]
1809
+ - Updated dependencies [9a9346e]
1810
+ - Updated dependencies [9a9346e]
1811
+ - Updated dependencies [dbc0b79]
1812
+ - Updated dependencies [bd5c624]
1813
+ - Updated dependencies [3868e1b]
1814
+ - Updated dependencies [a5d3f5b]
1815
+ - Updated dependencies [00819c5]
1816
+ - Updated dependencies [e2bdd4a]
1817
+ - Updated dependencies [e2d1939]
1818
+ - Updated dependencies [e83e6eb]
1819
+ - Updated dependencies [64d25db]
1820
+ - Updated dependencies [c55f7a3]
1821
+ - Updated dependencies [f8b0097]
1822
+ - @nifrajs/core@2.12.0
1823
+ - @nifrajs/client@2.12.0
1824
+ - create-nifra@2.12.0
1825
+ - @nifrajs/web@2.12.0
1826
+ - @nifrajs/mcp@2.12.0
1827
+ - @nifrajs/schema@2.12.0
1828
+ - @nifrajs/testing@2.12.0
1829
+ - @nifrajs/runner@2.12.0
1830
+
1831
+ ## 2.11.0
1832
+
1833
+ ### Minor Changes
1834
+
1835
+ - b80a1af: Every run says which bundler it is on. `nifra dev` and `nifra build` print a `bundler:` line under their banner - the pipeline, and how it was arrived at: the Bun default with the flag that switches away from it, a `--vite` / `--bun` the user asked for, or an automatic Vite selection with the config reason that forced it. An auto-selected Vite build no longer looks like the default.
1836
+
1837
+ `nifra check` and `nifra doctor` answer the same question without starting a server, and the `nifra_check`, `nifra_doctor` and `nifra_context` MCP tools return it in their results. They read the config as text, so the answer is available on a repo before its dependencies are installed.
1838
+
1839
+ They also report the hazards that exist only because there are two pipelines:
1840
+
1841
+ - a plugin in the slot the other bundler reads - accepted, never called, and the build still succeeds
1842
+ - a dev toolchain imported by the file `nifra build` bundles into the production server entry, which builds cleanly and then fails at startup on a bundler dependency
1843
+ - `conditions` under `nifra dev` on Bun, whose client bundler takes no resolve conditions
1844
+
1845
+ Slot mistakes and a toolchain in the server entry fail the check; the resolve-condition notice is advisory.
1846
+
1847
+ The dev-and-HMR guide gains a "Which pipeline runs, when" table covering every config and flag combination, and the terminal output that answers it for a given app.
1848
+
1849
+ ### Patch Changes
1850
+
1851
+ - c29e0d0: Svelte runs on the Vite pipeline. `nifra dev` and `nifra build` now serve and build a Svelte app on either bundler, so a Svelte app is no longer the one framework pinned to a single pipeline, and pages render with routing context, typed search and layout data intact on both.
1852
+
1853
+ `@nifrajs/web` adds `setSsrModuleLoader` / `ssrModuleLoader`, the seam that makes it work. A dev server that owns SSR resolution publishes its module loader; a render adapter that has to load a compiled asset on the server reads it and loads through it, so that asset is compiled by the same toolchain as the app's routes and renders through the same copy of the framework runtime. Adapters that ship no compiled assets are unaffected.
1854
+
1855
+ `conditions` on the Bun dev pipeline reaches SSR, and says so when it cannot reach the client bundle Bun's dev server serves - a one-line startup notice instead of a package that quietly resolves to one file in dev and another in `nifra build`.
1856
+
1857
+ CSS Modules class names are now identical on both pipelines. The same class hashes to the same scoped name under `nifra dev`, `nifra dev --bun` and `nifra build`, so a selector written against a generated name behaves the same everywhere.
1858
+
1859
+ The dev-and-HMR guide gains a Gotchas section covering the config/adapter file split, plugin slots, resolve conditions, non-route SSR freshness, and the adapter loader.
1860
+
1861
+ - Updated dependencies [ed5e91c]
1862
+ - Updated dependencies [30f5ea3]
1863
+ - Updated dependencies [c29e0d0]
1864
+ - @nifrajs/web@2.11.0
1865
+ - @nifrajs/client@2.11.0
1866
+ - @nifrajs/core@2.11.0
1867
+ - @nifrajs/mcp@2.11.0
1868
+ - @nifrajs/runner@2.11.0
1869
+ - @nifrajs/schema@2.11.0
1870
+ - @nifrajs/testing@2.11.0
1871
+ - create-nifra@2.11.0
1872
+
1873
+ ## 2.10.0
1874
+
1875
+ ### Patch Changes
1876
+
1877
+ - 15bffdd: Add request-bound data capability evidence, resumable bounded channel subscriptions, ISR tag
1878
+ invalidation for memory and KV stores, and dependency-free Open Graph image responses with an
1879
+ optional rasterizer seam.
1880
+ - Updated dependencies [5263c4e]
1881
+ - Updated dependencies [15bffdd]
1882
+ - Updated dependencies [15bffdd]
1883
+ - Updated dependencies [15bffdd]
1884
+ - @nifrajs/web@2.10.0
1885
+ - @nifrajs/core@2.10.0
1886
+ - @nifrajs/client@2.10.0
1887
+ - @nifrajs/schema@2.10.0
1888
+ - @nifrajs/testing@2.10.0
1889
+ - @nifrajs/mcp@2.10.0
1890
+ - @nifrajs/runner@2.10.0
1891
+ - create-nifra@2.10.0
1892
+
1893
+ ## 2.9.1
1894
+
1895
+ ### Patch Changes
1896
+
1897
+ - Updated dependencies [01e36fb]
1898
+ - @nifrajs/core@2.9.1
1899
+ - @nifrajs/client@2.9.1
1900
+ - @nifrajs/schema@2.9.1
1901
+ - @nifrajs/testing@2.9.1
1902
+ - @nifrajs/web@2.9.1
1903
+ - @nifrajs/mcp@2.9.1
1904
+ - @nifrajs/runner@2.9.1
1905
+ - create-nifra@2.9.1
1906
+
1907
+ ## 2.9.0
1908
+
1909
+ ### Patch Changes
1910
+
1911
+ - Updated dependencies [b006d07]
1912
+ - Updated dependencies [e05e56d]
1913
+ - @nifrajs/client@2.9.0
1914
+ - @nifrajs/schema@2.9.0
1915
+ - @nifrajs/core@2.9.0
1916
+ - @nifrajs/web@2.9.0
1917
+ - @nifrajs/testing@2.9.0
1918
+ - @nifrajs/mcp@2.9.0
1919
+ - @nifrajs/runner@2.9.0
1920
+ - create-nifra@2.9.0
1921
+
1922
+ ## 2.8.2
1923
+
1924
+ ### Patch Changes
1925
+
1926
+ - f7d68e8: Numeric limit options (body/payload byte caps, TTLs, cache sizes, concurrency, ISR revalidate windows) are now validated at construction and throw a `RangeError` on non-finite or out-of-range values instead of silently disabling the bound - a `NaN` cap previously made `size > max` comparisons fail open. JWT `requiredClaims` now checks own properties only, so inherited names like `toString` no longer satisfy a required claim. `@nifrajs/mcp-db` gates multi-statement input with a real tokenizer, bounds `run_query` materialization to `maxRows + 1` via a wrapping subquery, and skips SQLite planner pseudo-nodes when verifying the table allowlist. `nifra scaffold` refuses to write through symlinked route directories.
1927
+ - Updated dependencies [f7d68e8]
1928
+ - @nifrajs/core@2.8.2
1929
+ - @nifrajs/mcp@2.8.2
1930
+ - @nifrajs/web@2.8.2
1931
+ - @nifrajs/client@2.8.2
1932
+ - @nifrajs/schema@2.8.2
1933
+ - @nifrajs/testing@2.8.2
1934
+ - @nifrajs/runner@2.8.2
1935
+ - create-nifra@2.8.2
1936
+
1937
+ ## 2.8.1
1938
+
1939
+ ### Patch Changes
1940
+
1941
+ - 93fdc89: `nifra doctor` now scans `*.test.ts`/`*.spec.ts` files for undeclared imports. Tests are part of the typechecked surface, so a package imported only by a test and declared nowhere still breaks a clean `bun install` build - doctor previously shared `nifra check`'s test exclusion and missed it. `nifra check`'s own scans still skip tests, which legitimately drive `fetch` and call routes directly.
1942
+ - Updated dependencies [78d66a4]
1943
+ - Updated dependencies [93fdc89]
1944
+ - @nifrajs/core@2.8.1
1945
+ - @nifrajs/client@2.8.1
1946
+ - @nifrajs/schema@2.8.1
1947
+ - @nifrajs/testing@2.8.1
1948
+ - @nifrajs/web@2.8.1
1949
+ - @nifrajs/mcp@2.8.1
1950
+ - @nifrajs/runner@2.8.1
1951
+ - create-nifra@2.8.1
1952
+
1953
+ ## 2.8.0
1954
+
1955
+ ### Minor Changes
1956
+
1957
+ - 118e4a5: `nifra dev --bun` now supports server functions and `*.server` modules. Bun's dev-server bundler accepts plugins only through bunfig's `[serve.static]` channel, so the CLI generates a config under `.nifra/dev-bun/` carrying the same production boundary plugins (server-fn RPC stubs, server-only emptying), merges the app's own bunfig `[serve.static] plugins` and `preload` entries, and re-launches itself once with `--config=` pointing at it - identical stubs across dev and build, and the old fail-closed refusal for those modules is gone. The relaunch is verified with a per-launch random token (matched against a file the parent just wrote, consumed on first read, constant-time compare), so no fixed environment value can make the server skip the boundary configuration; an unverifiable launch regenerates and re-launches instead of serving. The app's entire bunfig is carried into the generated config verbatim - jsx, defines, loaders, install settings - with path-bearing entries re-rooted; a bunfig field the generator cannot round-trip, or malformed TOML, fails loudly instead of being dropped. CSS Modules remain gated under `--bun`.
1958
+
1959
+ Also fixed in `@nifrajs/web`: `serverFn<Input, Output>(...)` with explicit type arguments is now recognized by the client-boundary scanner - it previously produced an exportless stub that failed the client build with a missing-export link error (a type argument containing parentheses still fails loudly with guidance, never silently). The dev loop's background leak guard now reports the underlying bundler errors instead of a bare "Bundle failed".
1960
+
1961
+ - 9a6b0c3: The docs MCP's example-browsing widget tool is now `nifra_gallery` (was `nifra_examples_app`), keeping every tool on the single-word `nifra_<noun>` pattern. Its description and `nifra_example`'s now state the split explicitly: `nifra_example` returns one verified snippet as text, `nifra_gallery` opens the browsable widget. The exported `examplesAppTool` API is unchanged.
1962
+ - ca60337: `nifra check`'s interpolated-SQL rule now resolves same-file constants. A module-scope `const` interpolated into a query - the shared column-projection idiom (`const COLS = "id, name"` ... `` `SELECT ${COLS} FROM ...` ``), a `const LIMIT = 50`, a const built from other consts, or a ternary whose branches are both literal - is compile-time text and no longer flags, with zero suppression config. Resolution is pure syntax with a depth cap: imported names, `let`, parameters, call results, member accesses, and shadowed names (including a hoisted `var` anywhere in the enclosing function) stay flagged exactly as before, and a resolved const still feeds the SQL-keyword scan, so hostile statement text in a const alongside a dynamic span is still caught. The named escape hatches (`unsafe`, `$queryRawUnsafe`) keep flagging statement-from-variable regardless.
1963
+
1964
+ ### Patch Changes
1965
+
1966
+ - Updated dependencies [118e4a5]
1967
+ - @nifrajs/web@2.8.0
1968
+ - @nifrajs/client@2.8.0
1969
+ - @nifrajs/core@2.8.0
1970
+ - @nifrajs/mcp@2.8.0
1971
+ - @nifrajs/runner@2.8.0
1972
+ - @nifrajs/schema@2.8.0
1973
+ - @nifrajs/testing@2.8.0
1974
+ - create-nifra@2.8.0
1975
+
1976
+ ## 2.7.1
1977
+
1978
+ ### Patch Changes
1979
+
1980
+ - Updated dependencies [52c89e0]
1981
+ - @nifrajs/core@2.7.1
1982
+ - @nifrajs/client@2.7.1
1983
+ - @nifrajs/schema@2.7.1
1984
+ - @nifrajs/testing@2.7.1
1985
+ - @nifrajs/web@2.7.1
1986
+ - @nifrajs/mcp@2.7.1
1987
+ - @nifrajs/runner@2.7.1
1988
+ - create-nifra@2.7.1
1989
+
1990
+ ## 2.7.0
1991
+
1992
+ ### Patch Changes
1993
+
1994
+ - Updated dependencies [7fd0fc7]
1995
+ - create-nifra@2.7.0
1996
+ - @nifrajs/client@2.7.0
1997
+ - @nifrajs/core@2.7.0
1998
+ - @nifrajs/mcp@2.7.0
1999
+ - @nifrajs/runner@2.7.0
2000
+ - @nifrajs/schema@2.7.0
2001
+ - @nifrajs/testing@2.7.0
2002
+ - @nifrajs/web@2.7.0
2003
+
2004
+ ## 2.6.1
2005
+
2006
+ ### Patch Changes
2007
+
2008
+ - Updated dependencies [5840c98]
2009
+ - Updated dependencies [80419f5]
2010
+ - @nifrajs/core@2.6.1
2011
+ - @nifrajs/web@2.6.1
2012
+ - @nifrajs/client@2.6.1
2013
+ - @nifrajs/schema@2.6.1
2014
+ - @nifrajs/testing@2.6.1
2015
+ - @nifrajs/mcp@2.6.1
2016
+ - @nifrajs/runner@2.6.1
2017
+ - create-nifra@2.6.1
2018
+
2019
+ ## 2.6.0
2020
+
2021
+ ### Patch Changes
2022
+
2023
+ - e6349e5: Security hardening across input parsing and code generation. Every regex that runs on caller-influenced input (URL paths, route patterns, stylesheet and SVG sources, manifest text) is now linear - no polynomial backtracking on adversarial input. SVG preamble stripping and tag removal can no longer splice removed delimiters into new markers. Static file serving rejects `..` traversal in the request form outright and confines the resolved path with a `relative()` containment check. Generated code embeds strings through an escaper that neutralizes `</script>` breakout and the U+2028/U+2029 line separators, and HTML entity decoding resolves `&amp;` last so double-encoded entities cannot double-unescape.
2024
+ - 10fb70c: `defineMcpTool` accepts `annotations` (the MCP tool safety hints - `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`, `title`), surfaced in `tools/list` and `tools/describe`. Hosts use these to pick confirmation UX, and connector directory reviews expect every tool to declare them. The hosted docs tools (`nifra_docs`, `nifra_example`, `nifra_types`, `nifra_learn`, `nifra_examples_app`) now all declare themselves read-only and closed-world.
2025
+ - Updated dependencies [e6349e5]
2026
+ - Updated dependencies [08fe221]
2027
+ - Updated dependencies [8383063]
2028
+ - Updated dependencies [10fb70c]
2029
+ - @nifrajs/web@2.6.0
2030
+ - @nifrajs/core@2.6.0
2031
+ - @nifrajs/mcp@2.6.0
2032
+ - @nifrajs/client@2.6.0
2033
+ - @nifrajs/schema@2.6.0
2034
+ - @nifrajs/testing@2.6.0
2035
+ - @nifrajs/runner@2.6.0
2036
+ - create-nifra@2.6.0
2037
+
2038
+ ## 2.5.0
2039
+
2040
+ ### Minor Changes
2041
+
2042
+ - 8251dfd: `nifra doctor` and `nifra check` now flag stale workspace dists. A workspace-linked dependency whose export map splits `bun` (source) from `default` (a `dist` artifact) serves live source to Bun but a build artifact to Vite's SSR runner and node consumers - and nothing in the dev loop rebuilds that artifact. Because `dist/` is gitignored, the drift never shows in a diff; it surfaces as a 500 inside the package's code and reads like an upstream regression. The new `stale-workspace-dist` rule compares each linked dependency's `default` target mtime against its newest source file and reports "rebuild <pkg>" with the lag (or "never built" when the artifact is missing). Advisory severity: it warns in the report and the `--json`/MCP diagnostics but never fails the gate, since a linked package's dist is legitimately behind while you are mid-edit. npm tarball installs are immutable and never flagged.
2043
+
2044
+ ### Patch Changes
2045
+
2046
+ - Updated dependencies [3731c69]
2047
+ - Updated dependencies [31ccc27]
2048
+ - Updated dependencies [02d9aa8]
2049
+ - Updated dependencies [0740f77]
2050
+ - @nifrajs/mcp@2.5.0
2051
+ - @nifrajs/testing@2.5.0
2052
+ - @nifrajs/web@2.5.0
2053
+ - @nifrajs/client@2.5.0
2054
+ - @nifrajs/core@2.5.0
2055
+ - @nifrajs/runner@2.5.0
2056
+ - @nifrajs/schema@2.5.0
2057
+ - create-nifra@2.5.0
2058
+
2059
+ ## 2.4.0
2060
+
2061
+ ### Minor Changes
2062
+
2063
+ - 1c2bf5a: The self-hosted docs MCP (`nifra docs-mcp` / `handleMcpHttp`) now serves `nifra_examples_app`, an MCP Apps widget that renders the verified code examples as an interactive, filterable list in hosts that support it; text-only hosts still get the example names. It reads the same bundled examples corpus as `nifra_example`, so every self-host exposes it from one definition.
2064
+ - 335eb2a: A guided, ordered path to build a nifra app end to end.
2065
+
2066
+ `nifra_learn` (MCP) and `nifra learn` (CLI) walk the same sequence - create the app, add a page route, load data, add a typed API, call it through the typed client, protect a route, do background work, deploy. Each step names the tool that emits the correct artifact (`nifra_scaffold`, `nifra_example`, `nifra_run`) and how to verify it, so the path composes the existing tools instead of pasting code that can drift from the installed version. Random-access search stays `nifra_docs`/`nifra_example`; this is the sequence for building something new.
2067
+
2068
+ - 795357f: DevTools' request-trace buffer is now queryable, not just streamable.
2069
+
2070
+ Alongside the live SSE overlay, the plugin serves a one-shot JSON snapshot at `/_nifra/devtools/state` - the recent request traces (method, path, status, duration, ISR status, response bytes), filterable by a `path` prefix and a `limit`, and guarded exactly like the stream (loopback-only unless `allowRemote`, origin-checked, optional `authorize` hook). A new `filterDevToolsEvents` export defines that query once, shared by the endpoint and its consumers.
2071
+
2072
+ `nifra_inspect` (MCP) reads that snapshot for a running dev server, so an agent can SEE what its requests actually did - which route answered, the status, how long, ISR hit or miss - instead of inferring it from the response alone. It needs the app to mount the `devtools()` plugin (which auto-enables in development).
2073
+
2074
+ - 23e6eb1: Errors resolve to a structured diagnostic - one object a person reads in the overlay and an agent reads as JSON.
2075
+
2076
+ The dev error overlay now shows a source codeframe around the offending line and, for failures nifra recognises (a server-only module or a `node:` built-in reaching the client, a schema mismatch), a plain-language cause and fix with a docs anchor. A new `@nifrajs/web/diagnostic` export builds that `Diagnostic` - stable `code`, the top frame in your own source, the codeframe, and the cause/fix - from any thrown value, and the dev server serves the most recent one as JSON at `/__nifra/last-error`.
2077
+
2078
+ `nifra_explain` (MCP) turns an error - pasted from `nifra_run`/`nifra_test` output, or the dev server's last - into that same diagnostic, so an agent gets the code, the codeframe in your source, and the fix instead of eyeballing a stack trace.
2079
+
2080
+ - 06f4aaa: `nifra upgrade` refuses to roll a dependency backward, and duplicate-install diagnostics name the type-inference symptom.
2081
+
2082
+ `nifra upgrade <version>` now fails closed when a target would set any pin below the installed version (for example running an older recipe on a newer install), listing each pin that would roll back and writing nothing; pass `--allow-downgrade` to apply it intentionally. `nifra doctor` and `nifra check` additionally call out that a second `@nifrajs/core` copy is the usual cause of `typeof backend` collapsing to `any` at `.merge()`.
2083
+
2084
+ ### Patch Changes
2085
+
2086
+ - 1c2bf5a: Harden the dev-only diagnostics endpoint and the agent-facing reads of it. The dev server now binds to `127.0.0.1`, answers `/__nifra/last-error` with an identity header, and resolves source paths so the codeframe stays inside the project. The Vite dev server serves that endpoint at parity with the Bun one. `nifra_explain` and `nifra_inspect` validate the target port, time out, cap the response size, and only return a body from a verified nifra endpoint - so pointing them at an unrelated local service returns a clear error instead of that service's response.
2087
+ - 1c2bf5a: `nifra upgrade`'s downgrade guard now respects prerelease precedence, so a target of `2.3.0-beta` is correctly treated as older than an installed `2.3.0` and blocked without `--allow-downgrade`. Previously only the numeric core was compared, so a release-to-prerelease step slipped past the guard.
2088
+ - Updated dependencies [06f4aaa]
2089
+ - Updated dependencies [1c2bf5a]
2090
+ - Updated dependencies [138bfba]
2091
+ - Updated dependencies [23e6eb1]
2092
+ - Updated dependencies [06f4aaa]
2093
+ - create-nifra@2.4.0
2094
+ - @nifrajs/web@2.4.0
2095
+ - @nifrajs/core@2.4.0
2096
+ - @nifrajs/testing@2.4.0
2097
+ - @nifrajs/client@2.4.0
2098
+ - @nifrajs/schema@2.4.0
2099
+ - @nifrajs/mcp@2.4.0
2100
+ - @nifrajs/runner@2.4.0
2101
+
2102
+ ## 2.3.0
2103
+
2104
+ ### Minor Changes
2105
+
2106
+ - 77715ca: `nifra check` fails on SQL built by interpolating a value into the statement text.
2107
+
2108
+ ```ts
2109
+ db.query(`SELECT * FROM notes WHERE id = ${id}`); // fails the check
2110
+ db.query("SELECT * FROM notes WHERE id = ?").get(id); // bound
2111
+ db.execute(sql`SELECT * FROM notes WHERE id = ${id}`); // bound by the tag
2112
+ ```
2113
+
2114
+ The interpolated value becomes statement rather than parameter, so anything the caller controls can end
2115
+ the literal and continue as SQL.
2116
+
2117
+ Two things it deliberately stays quiet about, because flagging a safe idiom is how a rule gets ignored:
2118
+ a TAGGED template (`` sql`… ${id} …` `` in postgres.js, drizzle and kysely binds its substitutions -
2119
+ that IS the parameterised form), and any literal without a substitution. A SQL keyword is required in
2120
+ the literal too, so `cache.query(`user:${id}`)` is left alone; the named escape hatches
2121
+ (`$queryRawUnsafe`, `sql.unsafe`) are flagged on the call alone, since taking a statement as text is
2122
+ their entire purpose.
2123
+
2124
+ - ea0a27f: Capability provenance says when it could not finish, instead of reporting a clean project.
2125
+
2126
+ The reachability walk stops at a module count and an import depth so a pathological graph cannot hang
2127
+ the check. Hitting either limit used to end the walk quietly, and the route came back covered - a
2128
+ passing report whose subject was partly unexamined, which is the shape of failure this whole gate
2129
+ exists to prevent.
2130
+
2131
+ Both limits now produce a `provenance-truncated` finding naming the route and the chain that reached
2132
+ it, the check fails, and the lockfile refuses to record a snapshot taken from a truncated walk.
2133
+
2134
+ - a4ecca9: The `.server` convention now holds in every client pipeline, not just one.
2135
+
2136
+ A `*.server.ts` module is server-only: the client build empties it so its import subtree - `node:`
2137
+ builtins, native modules, secrets - never reaches a browser. That was implemented once, as a
2138
+ `Bun.build` plugin, so it held in exactly one of the four client paths. `nifra build` emptied the
2139
+ module; `nifra dev` (Vite), a Vite production build, and `nifra dev --bun` all bundled it whole.
2140
+
2141
+ A guard that holds in one pipeline is worse than no guard, because the file NAME reads as protection
2142
+ everywhere it appears.
2143
+
2144
+ - `@nifrajs/web/plugins/vite-server-only` empties the module for Vite, registered in both the dev
2145
+ server and the production build. A parity test asserts it emits bytes identical to the Bun plugin.
2146
+ - `nifra dev --bun` refuses to start on an app containing one, naming the files - the same treatment
2147
+ `*.fn` already had, because Bun's dev bundler takes no plugins and cannot be fixed with one.
2148
+
2149
+ The three `nifra dev --bun` refusals (CSS Modules, `*.fn`, `*.server`) now have tests. Two of them
2150
+ guard secrets, and none of them had one.
2151
+
2152
+ - a92104e: The interpolated-SQL rule catches string concatenation, the oldest injection shape.
2153
+
2154
+ ```ts
2155
+ db.query("SELECT * FROM users WHERE id = " + req.params.id); // now fails the check
2156
+ ```
2157
+
2158
+ The rule inspected template literals only: a quoted string was skipped before the SQL-keyword test ever
2159
+ ran. So a codebase predating template literals - or an LLM emitting older-style JS - got a clean
2160
+ `nifra check` on textbook-injectable SQL, and `nifra check` reporting clean is a security claim that
2161
+ feeds the assurance ladder.
2162
+
2163
+ The same keyword requirement applies, so `cache.query("user:" + id)` stays quiet, and a statement built
2164
+ into a variable elsewhere still says nothing at the call site.
2165
+
2166
+ Also fixes the service-worker test suite, whose offline case never reached the code it claimed to test:
2167
+ the stub was assigned to `globalThis.fetch` after the worker had already captured `fetch` as a
2168
+ parameter, so the assertion was satisfied by a real network failure. A worker mutated to serve the
2169
+ offline page to every visitor passed all 19 tests; it now fails, and an online navigation is covered.
2170
+
2171
+ - ea0a27f: The interpolated-SQL rule reads the syntax tree, and TypeScript is an optional peer rather than a
2172
+ dependency.
2173
+
2174
+ The rule used to work on text, which meant guessing where strings and comments began and ending up
2175
+ lenient in the direction that matters: EVERY tagged template was treated as parameter binding, so
2176
+ `String.raw` or any no-op custom tag hid an interpolated statement from the check. It now parses with
2177
+ the compiler and trusts only `sql` and `Prisma.sql`. It also reads a concatenated statement built
2178
+ across `+`, and skips a file the parser could not read rather than turning recovery nodes into a second
2179
+ misleading diagnostic.
2180
+
2181
+ Trust is by NAME, and that is the honest limit of a scanner that reads syntax and runs no type checker:
2182
+ `sql` is what postgres.js, drizzle, slonik and Bun's driver all call theirs, and nothing here can prove
2183
+ a given `sql` binds anything. A no-op function with that name is trusted too. The rule finds mistakes,
2184
+ not an adversary who has read it - deciding otherwise needs a type checker, which is a different tool.
2185
+ Names earn their place on that list by being what drivers already call the thing.
2186
+
2187
+ The compiler is a ~25 MB install, and the CLI's own typecheck step already treats `tsc` as something
2188
+ the project provides. Forcing it on every install to run one rule was the wrong trade, so it is an
2189
+ optional peer resolved when the rule runs. Every Nifra project has TypeScript - the templates all ship
2190
+ a `typecheck` script - so this resolves in practice.
2191
+
2192
+ When it does not, `nifra check` says the rule did not run and how to enable it. That part is not
2193
+ cosmetic: an empty result is indistinguishable from a clean one, and for this rule a clean result means
2194
+ "no SQL injection was found". Silence there is the one answer it must never give.
2195
+
2196
+ - c823915: Typed, validated search params: a route declares a `searchSchema` and both its loader and its component read the parsed, validated query.
2197
+
2198
+ Export a Standard Schema as `searchSchema` from a route. The loader's `ctx.search` becomes the parsed URL query validated against it (typed via `LoaderArgs<typeof app, Env, typeof searchSchema>`), and the component reads the same value with `useSearch<typeof searchSchema>()`. Invalid or hostile input fails closed to the schema's defaults (never a 500); without a `searchSchema`, both are the raw parsed query. Validation runs at match time and the value is derived identically on the server and on client navigation, so a component never parses `window.location.search` by hand and the query it renders hydrates with no mismatch.
2199
+
2200
+ ```tsx
2201
+ export const searchSchema = v.object({
2202
+ page: v.optional(v.fallback(v.number(), 1), 1),
2203
+ });
2204
+
2205
+ export async function loader({
2206
+ search,
2207
+ api,
2208
+ }: LoaderArgs<typeof backend, unknown, typeof searchSchema>) {
2209
+ return { rows: await api.reports.list(search).get() }; // search.page is a number
2210
+ }
2211
+
2212
+ export default function Reports({ data }) {
2213
+ const { page } = useSearch<typeof searchSchema>(); // page: number, SSR-correct
2214
+ return <Pager page={page} />;
2215
+ }
2216
+ ```
2217
+
2218
+ A `_layout` can declare its own `searchSchema` for keys shared across a section (`?org`, `?theme`); the route's effective search merges the layout chain's schemas with the page's, page-wins on a conflict, so both the layout and the page read their validated slice from one object.
2219
+
2220
+ A route can also list `searchClientKeys` - search keys that are purely client-side UI (`?tab`, a client-side `?sort`, `?modal`). When a client navigation changes only those keys, the URL updates (so `useSearch` re-renders) without re-running the loader; any other key change revalidates as before, so data is never stale.
2221
+
2222
+ `useSearch` ships on every adapter - React (a value), Preact (a value), Vue (a `Ref`), Solid (an `Accessor`), and Svelte (an accessor), each in that framework's own shape.
2223
+
2224
+ `navigate` gains an object form on every adapter: `navigate({ to, search, replace })` serializes `search` onto `to` (no hand-built query strings). Run `nifra sync-routes` to generate `nifra-routes.d.ts` (each static route mapped to its schema output) and include it in your tsconfig, and `search` is typed against the target route's `searchSchema` - a wrong shape for a known route is a compile error, while an unmapped path takes a loose `search`. Regenerated from the route files, so a stale shape becomes a `tsc` error. The string-path and history-delta forms are unchanged.
2225
+
2226
+ ```ts
2227
+ navigate({ to: "/reports", search: { page: 2 } }); // search typed against /reports's schema
2228
+ ```
2229
+
2230
+ ### Patch Changes
2231
+
2232
+ - e88f36b: Two CI gates that could report success having measured nothing.
2233
+
2234
+ `@nifrajs/events` shipped with 17 passing tests CI had never executed. The two run scripts list their
2235
+ 30-odd test directories by hand and nobody added the new one, so the package published untested and the
2236
+ coverage ratchet was blind to it. The dead suite was the fail-closed half of a durable event boundary.
2237
+ A completeness check now asserts every package with test files appears in both scripts, with an
2238
+ explicit, reasoned opt-out list.
2239
+
2240
+ `check:size` dropped any row that failed to build - logging to stderr, returning null - and then
2241
+ compared budgets only against rows that survived. Rename a `@nifrajs/core/*` subpath and its row
2242
+ vanishes with its budget, every remaining row passes, and the gate exits 0. It now reconciles measured
2243
+ rows against declared rows, and the budget table against the feature matrix, before comparing anything.
2244
+
2245
+ - b9f4525: `nifra build` and `nifra dev` now print the real cause of a failed bundle. When `Bun.build` throws, it raises an `AggregateError` whose own message is a generic "Bundle failed" and whose underlying errors - the unresolved import, the plugin that threw, each with a file and line - were dropped by the CLI's error output. Those causes are now unwrapped and printed, one per line, at every CLI error boundary.
2246
+ - 1fbfb62: A `clientModule` given as a relative path (a local client entry, e.g. `./src/client.tsx`) now works in both `nifra dev` and `nifra build`. It is resolved to an absolute path when the framework config loads, so the generated client entry - which dev and build write into different directories - resolves it identically in both phases instead of loading in one and breaking in the other. A bare or package specifier (`@nifrajs/web-react/client`) is location-independent and unchanged.
2247
+ - c42d777: Documents seven packages that shipped without a single reference.
2248
+
2249
+ `web-vanilla` (zero-framework adapter) joins the frameworks page and gains `examples/web-vanilla`;
2250
+ `devtools` joins dev; `mock` joins testing; `events` joins backends; `prompt`, `agent-telemetry` and
2251
+ `mcp-db` join the coding-agents page.
2252
+
2253
+ All were real - 185 to 381 lines each, 9 to 23 tests each - and none were findable. Every added sample
2254
+ is compiled by the docs gate against the live API.
2255
+
2256
+ - fc034c6: Documents server functions and effect provenance.
2257
+
2258
+ Two features shipped without a page. Server functions span seven packages and had none at all, and the
2259
+ effect provenance firewall - now armed in every template - emits a finding (`unconfined-write-reach`)
2260
+ whose fix is structural and was explained nowhere outside code comments.
2261
+
2262
+ Both pages join the docs corpus the MCP server and `nifra_docs` search read from, so an agent finds them
2263
+ too.
2264
+
2265
+ - 45b0733: `nifra dev --bun` no longer waves `.fn.mts` / `.fn.cts` / `.fn.mjs` / `.fn.cjs` into the browser.
2266
+
2267
+ The refusal that keeps a server function off the Bun dev pipeline matched a hand-written glob,
2268
+ `**/*.fn.{ts,tsx,js,jsx}`, while both build pipelines stub anything matching
2269
+ `/\.fn(\.[cm]?[jt]sx?)?$/`. So a `todos.fn.mts` was a server function everywhere except the one check
2270
+ that exists to stop it leaking - it started the dev server and shipped the function bodies, and
2271
+ whatever they close over, to the browser. Measured across all eight extensions, four leaked.
2272
+
2273
+ Both refusals now test against the same matchers the transforms use, exported as `SERVER_FN_MODULE`
2274
+ and `SERVER_ONLY_MODULE` from `@nifrajs/web`. `SERVER_ONLY_MODULE` had two definitions and now has one
2275
+ owner. A test drives every accepted extension through the guard, so widening a convention without
2276
+ widening the guard fails there rather than in someone's browser.
2277
+
2278
+ - ea0a27f: A scaffolded project's `check` script runs the assurance gate it ships with, and the dev refusals cover
2279
+ extensionless modules.
2280
+
2281
+ Every template ships an assurance config, and every template's `check` script ran `nifra check` only -
2282
+ so the policy was shipped, documented, and never executed by the command a project actually runs in CI.
2283
+ It now runs `nifra check && nifra assure`.
2284
+
2285
+ `nifra dev --bun` refuses `.server` and `.fn` modules because Bun's dev bundler takes no plugins and
2286
+ would ship them whole. The refusal missed a module with no extension at all, which is the one shape a
2287
+ directory import produces.
2288
+
2289
+ - 1ed58b8: The documentation site now holds the bar it sells: `nifra.assurance.ts` plus a capability lockfile, at
2290
+ L2.
2291
+
2292
+ It is also the first validation of the capability model on an app nobody designed around it. Two things
2293
+ that only a real app can answer:
2294
+
2295
+ - **No false positives.** 47 route files carry dozens of documentation samples containing
2296
+ `import { Database } from "bun:sqlite"` and friends inside template literals. None became capability
2297
+ evidence, because the scanner blanks template contents before reading imports.
2298
+ - **Real imports are still caught.** Adding one genuine `bun:sqlite` import to the backend immediately
2299
+ flagged all four routes, including the GET dead end with its structural message.
2300
+
2301
+ - 803ec9d: `nifra_types` answers for every published package.
2302
+
2303
+ `@nifrajs/deno`, `@nifrajs/content` and `@nifrajs/workers` contributed nothing to the type index the
2304
+ MCP tool reads. They ship `files: ["src"]` and point `types` at `./src/index.ts`, which is right for a
2305
+ package resolved by Deno, workerd or Bun, while the index only ever looked for a built `dist/*.d.ts`.
2306
+ Asked about `serve`, `defineCollection` or `createWebSocketHub`, an agent got nothing back and wrote
2307
+ the API it guessed instead.
2308
+
2309
+ Their declarations are now emitted from source, per file and without a type checker, so the index
2310
+ starts where a consumer's resolver starts either way. Signatures are declarations, not implementations
2311
+ pasted in; the 1,545 entries already there are byte-identical.
2312
+
2313
+ The `--check` gate could not have caught this - it compares the regenerated file against the committed
2314
+ one, and a package missing from both matches forever. So `gen:llms` now fails when a published package
2315
+ contributes no types at all, which also turns the quietest failure here into a loud one: run it without
2316
+ building first and the file used to be rewritten with almost nothing in it.
2317
+
2318
+ - 5177627: `nifra check`, `nifra assure` and `nifra levels` are three views of one project verification.
2319
+
2320
+ All three read the same reflected project: the typed-contract scan, the route-assurance evaluation,
2321
+ and the static capability provenance. Each had grown its own orchestration over those pieces, so which
2322
+ command ran which policy was something a caller had to keep in their head, and `nifra levels` paid for
2323
+ it twice. Its L0 rung runs the whole check, and then L1 and L2 re-derived the route-assurance and
2324
+ capability-provenance evidence that same check had just produced. On a project with a capabilities
2325
+ policy the provenance walk is the expensive part, and it ran on every `levels` invocation once for the
2326
+ check and again for the ladder.
2327
+
2328
+ They now derive from a single verification pass. Each command renders its own slice of it: `assure`
2329
+ still never triggers the typecheck it has no use for, and `levels` climbs the ladder from evidence
2330
+ gathered once rather than a second time per rung. The output of all three is unchanged down to the
2331
+ byte, and a golden test per command and per mode holds that line so it stays that way.
2332
+
2333
+ - 4eb4e15: The release's version script regenerates the llms corpora, so the "Version Packages" PR can pass CI.
2334
+
2335
+ `types.json` stores exported signatures verbatim, including core's `VERSION` as the literal type
2336
+ `export declare const VERSION: "2.2.0"`. Bumping the version rewrote that constant and regenerated
2337
+ `api-reference.md` and the LLM cards, but not the corpora - so every Version PR failed `check:llms` on a
2338
+ stale `types.json`, and since Release only publishes after CI concludes successfully, nothing could
2339
+ ship.
2340
+
2341
+ - Updated dependencies [6f5b3ad]
2342
+ - Updated dependencies [cee03d7]
2343
+ - Updated dependencies [85b354d]
2344
+ - Updated dependencies [9b110b9]
2345
+ - Updated dependencies [7293a1c]
2346
+ - Updated dependencies [c8b79d7]
2347
+ - Updated dependencies [8514caa]
2348
+ - Updated dependencies [ea0a27f]
2349
+ - Updated dependencies [ea0a27f]
2350
+ - Updated dependencies [45b0733]
2351
+ - Updated dependencies [c42d777]
2352
+ - Updated dependencies [ea0a27f]
2353
+ - Updated dependencies [82b2053]
2354
+ - Updated dependencies [b271164]
2355
+ - Updated dependencies [8c77d47]
2356
+ - Updated dependencies [ea0a27f]
2357
+ - Updated dependencies [26cec7d]
2358
+ - Updated dependencies [8807004]
2359
+ - Updated dependencies [ea0a27f]
2360
+ - Updated dependencies [35af9fe]
2361
+ - Updated dependencies [ea0a27f]
2362
+ - Updated dependencies [d190b1c]
2363
+ - Updated dependencies [a4ecca9]
2364
+ - Updated dependencies [de8d992]
2365
+ - Updated dependencies [a92104e]
2366
+ - Updated dependencies [7f55876]
2367
+ - Updated dependencies [5fe332a]
2368
+ - Updated dependencies [c823915]
2369
+ - Updated dependencies [d2840ac]
2370
+ - Updated dependencies [62a8d03]
2371
+ - Updated dependencies [dcacfe7]
2372
+ - Updated dependencies [28704d7]
2373
+ - Updated dependencies [ea0a27f]
2374
+ - Updated dependencies [0c2de22]
2375
+ - @nifrajs/core@2.3.0
2376
+ - create-nifra@2.3.0
2377
+ - @nifrajs/client@2.3.0
2378
+ - @nifrajs/web@2.3.0
2379
+ - @nifrajs/schema@2.3.0
2380
+ - @nifrajs/testing@2.3.0
2381
+ - @nifrajs/mcp@2.3.0
2382
+ - @nifrajs/runner@2.3.0
2383
+
2384
+ ## 2.2.0
2385
+
2386
+ ### Minor Changes
2387
+
2388
+ - 2441577: `nifra build` picks its bundler from your config instead of a fixed default, and `--bun` joins `--vite`.
2389
+
2390
+ The two phases default differently on purpose: `nifra dev` is Vite (for the plugin ecosystem, and because
2391
+ Bun's dev-server bundler cannot compile CSS Modules), `nifra build` is Bun (faster, Bun-native). For an app
2392
+ with no transforms that costs nothing - there is nothing for the two to disagree about. For an app whose
2393
+ only transforms are `vitePlugins` it cost a class of production-only bug: those plugins ran in dev, and the
2394
+ Bun build reads `clientPlugins`/`serverPlugins` and never `vitePlugins`, so it dropped them. The build
2395
+ succeeded, the output looked plausible, and the transform had simply not happened.
2396
+
2397
+ That is the failure the pipeline-separation guard already refuses to allow - a plugin whose pipeline never
2398
+ runs - reached by crossing phases instead of slots, where the slot check cannot see it because the plugins
2399
+ are correctly placed.
2400
+
2401
+ So the default now follows the app. Vite plugins with no Bun counterpart means exactly one pipeline can
2402
+ build it, and that is the one used; `nifra build` prints the reason so an auto-selected Vite build never
2403
+ looks like you got the default. An app declaring both slots has supplied the Bun equivalent deliberately -
2404
+ nothing is dropped - so the faster Bun default stands, unchanged. An app with no plugins is unaffected.
2405
+
2406
+ `--vite` and the new `--bun` force the choice, with one exception: `--bun` on an app whose only transforms
2407
+ are `vitePlugins` is refused, naming the plugins it would discard, rather than producing the silently
2408
+ incomplete build the flag would otherwise ask for. Passing both flags is an error.
2409
+
2410
+ - a7d740a: Mount sub-apps and standalone-shaped backends without a `Proxy`; bound the render worker; lint removed imports.
2411
+
2412
+ **`mounts` and `apiStrip` on `createWebApp`.** Two shapes previously needed a hand-written ~40-line
2413
+ `Proxy` around the backend. The auto-mount dispatches the full `/api/v1/forms`, but a backend that also
2414
+ runs standalone declares its routes without the prefix and lets its own shell supply it - so every
2415
+ request 404'd inside it. And better-auth is not a `backend` route, so `/api/auth/*` hit the backend and
2416
+ 404'd silently. `apiStrip: true` removes the prefix before dispatch, and `mounts` takes any
2417
+ `{ path, app: { fetch } }` - so any library exposing its routes in that shape mounts directly, with no
2418
+ dependency from `@nifrajs/web` on it. Mounts are matched longest-path-first and before the `api`
2419
+ prefix, so `/api/auth` wins over `/api` regardless of declaration order.
2420
+
2421
+ **A layout that exports a `loader` now fails loudly.** Layouts do not run one - only route files do -
2422
+ and rendering while ignoring the export was the worst possible handling: it looks wired, the page
2423
+ renders, and the data is simply never there. The error names the file and says where the fetch should
2424
+ go instead. Running loaders in layouts is a real feature and is not this change.
2425
+
2426
+ **`nifra_render` and `nifra_run` can no longer hang.** The cold-path child wrote its result and then
2427
+ fell off the end of the module without exiting, unlike the warm-worker branch beside it. Loading an
2428
+ app runs its module side effects, so a database pool, a Redis client, or an interval kept the child's
2429
+ event loop alive forever while the parent waited on `proc.exited`. The child now exits explicitly, and
2430
+ both the cold and warm paths carry a 30s timeout as a backstop, reporting the likely cause rather than
2431
+ hanging.
2432
+
2433
+ **A `removed-import` lint in `nifra check`.** `@nifrajs/budget` folded into core in 2.x with no npm
2434
+ deprecation - `latest` is still 1.13.0, so a `^2` range resolves to nothing and `bun install` fails
2435
+ workspace-wide with an error naming neither cause nor replacement. The 2.0 WebSocket change has the
2436
+ same shape: `import "@nifrajs/core/ws"` no longer installs the runtime, and a consuming package kept
2437
+ it while its whole test suite stayed green and the app could not boot. Both are now caught before
2438
+ boot, with the replacement named. The WS rule flags only the bare side-effect form, since the module
2439
+ still exports `websocket` and a rule that fires on correct code gets ignored.
2440
+
2441
+ - 78e0b02: `nifra dev --bun` - the Bun pipeline is now selectable in dev, completing the pipeline matrix.
2442
+
2443
+ `nifra build --vite` already let an app choose its production bundler, but dev was Vite-only from the
2444
+ CLI: the Bun dev server existed solely as a library entry (`@nifrajs/web/dev`), so using it meant
2445
+ hand-writing a `dev.ts`. `nifra dev --bun` runs it directly - `Bun.serve`'s native HMR bundles and
2446
+ hot-reloads the client while Bun's runtime resolves SSR, with no Vite in the process. Both pipelines are
2447
+ now selectable in both phases, and neither ever runs inside the other.
2448
+
2449
+ It refuses one case rather than breaking quietly. Bun's DEV-server bundler and `Bun.build` are not the
2450
+ same bundler: `Bun.build` compiles `*.module.css` into a scoped class map (so the Bun production build of
2451
+ a CSS-Modules app is fine), but the dev server's bundler has no such transform - the import becomes a
2452
+ dangling reference and the browser throws `ReferenceError: import_X_module is not defined` from inside the
2453
+ component, naming neither CSS Modules nor the dev server. So `--bun` checks for CSS Modules up front and
2454
+ refuses with the offending files named and both ways forward. The check is deliberately narrow: only the
2455
+ transform proven missing is refused, so an app without CSS Modules gets the Bun dev loop.
2456
+
2457
+ Bun applies React Fast Refresh natively on this path - verified: editing a component-only module swaps its
2458
+ markup while a `useState` counter keeps its value, with no reload. The boundary rule is the same one Vite
2459
+ has (a route file that also exports `loader`/`meta` is not a refresh boundary, so saving it reloads). Plain
2460
+ CSS and Tailwind work; only `*.module.css` is refused.
2461
+
2462
+ Default is unchanged - `nifra dev` stays Vite, for its plugin ecosystem.
2463
+
2464
+ - 15ad6ca: Enforce pipeline separation, and make the client-leak guards bundler-neutral.
2465
+
2466
+ nifra supports both Vite and Bun, and the config already keeps them in separate slots - `vitePlugins`
2467
+ for the Vite pipeline, `clientPlugins` / `serverPlugins` for the Bun one. Nothing enforced the split,
2468
+ and the failure mode is silent: `Bun.build` has no `transform` hook and Vite never calls `setup`, so a
2469
+ plugin in the wrong slot is accepted, never invoked, and the build succeeds with the transform simply
2470
+ missing.
2471
+
2472
+ Loading an app now refuses that config, naming the plugin, the slot it is in, the pipeline that slot
2473
+ feeds, and where to move it. Checked at load rather than in `nifra check`, which holds a deliberate
2474
+ pre-`loadApp` invariant - reading plugins means importing the app's config. So `dev`, `build` and
2475
+ `start` are covered from one place, immediately before the plugins reach a bundler. Detection is by
2476
+ hook shape and deliberately conservative: a plugin matching neither shape is left alone, because a
2477
+ guard that fires on correct config is a guard people turn off.
2478
+
2479
+ The two client-leak guards - server-only code reaching the browser, `node:` builtins in client code -
2480
+ now take a bundler-neutral module graph instead of Bun's metafile, with a `fromBunMetafile` adapter
2481
+ behind it. Nothing changes today: Bun remains the only producer and the existing 19 tests pass
2482
+ unchanged, now routed through the adapter so it is covered too.
2483
+
2484
+ The point is what it makes possible. These are security guards - one stops secrets and database access
2485
+ shipping to a browser - so a second production pipeline must not arrive without them, and porting them
2486
+ under pressure beside a new bundler is how a guard ends up "mostly" ported. Introducing the seam while
2487
+ Bun is the only producer means the adapter can be verified against known-good behaviour, and adding
2488
+ Rollup later is one more adapter rather than a second copy of the detection logic.
2489
+
2490
+ - 6ba3173: `nifra routes --modes` - every route's render mode, hydration, and cache policy, gated against the target.
2491
+
2492
+ The facts were always in the route modules: `prerender`, `getStaticPaths`, `revalidate`, `hydrate`.
2493
+ Nowhere read them together. Answering "which pages are static?", "which revalidate, how often?", "which
2494
+ ship no JS?" meant opening every route file and holding the answer in your head - and the answer changes
2495
+ with the deploy target, which is nowhere near the route file.
2496
+
2497
+ The new `@nifrajs/web/route-manifest` derives one record per route - static | isr | ssr, hydration, cache
2498
+ policy - and resolves it against a target. `nifra routes --modes` prints the table; `--modes --target <t>`
2499
+ gates: a route the target cannot honour exits non-zero, so CI fails the build instead of production
2500
+ failing the request. The two cases that were previously silent are exactly the ones it catches: an ssr or
2501
+ isr route in a `static` build (no server, so the URL 404s in production while working in dev), and ISR
2502
+ where the target has no revalidation. Each conflict names the consequence, not the rule.
2503
+
2504
+ Two derivations are deliberate. `prerender` wins over `revalidate`, because a page rendered at build time
2505
+ is not revalidated at runtime - the build-time answer is the one that ships. And a dynamic route counts as
2506
+ static only once the build has actually emitted paths for it: `getStaticPaths` is the intent, the emitted
2507
+ paths are the evidence, and treating intent as sufficient is how a "static" build ships a page that 404s.
2508
+ Pass the paths `prerenderRoutes` produced via `buildRouteManifest`'s `prerendered` option to resolve those
2509
+ routes against what was really built.
2510
+
2511
+ - ca71a2e: `nifra_types` collapses oversized declarations in search results, and a bad `clientModule` says so.
2512
+
2513
+ **`nifra_types` query mode.** A search returned the complete declaration of every match, and the corpus
2514
+ is wildly uneven: the median symbol is small while `Server` alone is ~32,000 characters, five times the
2515
+ next largest. One broad query that happened to match it returned the entire class for near-zero value.
2516
+
2517
+ A `query` now returns a one-line summary plus the signature, collapsing an oversized body to its head
2518
+ and a member count, and saying which `name` call returns the rest. Measured on the real corpus:
2519
+ `"server"` drops from 36,355 to 1,739 characters (95%), `"route schema"` by 87%, `"rate limit"` by 69%.
2520
+
2521
+ An exact `name` lookup is **never** collapsed - there the caller asked for that symbol. Pass
2522
+ `full: true` to opt a query back into whole declarations.
2523
+
2524
+ **`clientModule`.** The option is a module specifier resolved by the bundler, so nothing type-checks
2525
+ that the module actually exports `mountRouter`. A self-executing client entry therefore built cleanly
2526
+ and failed at first paint with `mountRouter is not a function`, from inside a bundled chunk, naming
2527
+ neither the module nor the requirement - diagnosable only by reading `build.ts`.
2528
+
2529
+ The generated bootstrap now throws immediately, naming the offending specifier, the missing export, its
2530
+ call signature, and the specific trap that a self-executing entry will not work. The contract is also
2531
+ spelled out on the option's own type rather than in a parenthetical.
2532
+
2533
+ - 0fc215b: The Vite dev pipeline now resolves SSR too, which removes the dual-React class of bug.
2534
+
2535
+ `nifra dev` served the client through Vite while resolving route modules for SSR through Bun - two
2536
+ resolvers disagreeing about one specifier, inside one process. That is what made `resolve.dedupe`
2537
+ govern only half the app: an app added a hand-written React alias in `nifra.config.ts`, and it still
2538
+ crashed, because the alias reached Vite and SSR never asked Vite. The symptom named a React internal
2539
+ (`resolveDispatcher().useState` is null), so the actual cause - two copies at different paths - was
2540
+ hours of inference away.
2541
+
2542
+ `discoverRoutes` accepts a `load` option, and the Vite dev server passes `ssrLoadModule`. Both halves
2543
+ now resolve through the same toolchain, so an alias, a `dedupe`, or a condition configured for the
2544
+ client governs the server as well.
2545
+
2546
+ Two things follow from that and are removed rather than kept "just in case":
2547
+
2548
+ - **Bun's SFC plugins are no longer registered in `nifra dev`.** Vite compiles `.vue` / `.svelte` /
2549
+ Solid for SSR through the app's `vitePlugins`. Registering Bun's alongside was the intermix itself -
2550
+ two toolchains compiling one file, only one of them governed by Vite's resolution. `nifra start` and
2551
+ the build path keep theirs, which is correct: those are the Bun pipeline.
2552
+ - **The `importQuery` cache-buster is gone from the Vite path.** It existed to defeat Bun's import
2553
+ cache; Vite re-evaluates changed modules itself. `discoverRoutes` ignores `importQuery` when `load`
2554
+ is supplied, because appending one would mint a new module id per request and defeat that.
2555
+
2556
+ The dev server still re-creates the app on change, now only so a hard reload picks up a route add or
2557
+ remove - the manifest comes from a directory scan, which `ssrLoadModule` cannot invalidate.
2558
+
2559
+ - 2ff661f: The full Vite/Rollup production build: `buildClientVite`, `buildServerVite`, `buildTargetVite`, and `nifra build --vite`.
2560
+
2561
+ Production stays Bun by default - faster and Bun-native, the profile nifra is tuned for. This completes
2562
+ the escape hatch for the one case that default cannot serve: an app whose client needs a Vite-only
2563
+ transform with no Bun equivalent. It now has a real, full production path, not just the leak-guard plugin.
2564
+
2565
+ The design point is that this is NOT a second orchestrator. `buildTarget`'s deploy assembly - per-target
2566
+ server-entry codegen, `_worker.js` / `server.js` placement, `_routes.json`, prerender, size report - is
2567
+ bundler-agnostic and now lives behind `buildTargetWith(target, options, bundler)`, which takes a `Bundler`
2568
+ strategy (its two bundling steps). `buildTarget` passes the Bun strategy; `buildTargetVite` passes the
2569
+ Vite one. So the deploy-dir shape is produced in exactly one place and cannot drift between pipelines -
2570
+ `buildTargetVite` emits the identical directory for every target.
2571
+
2572
+ `buildClientVite` reconstructs the same `BuildManifest` the Bun `buildClient` does - content-hashed entry,
2573
+ per-route chunk lists, aggregate + per-route CSS, copied `public/` - from Vite's own `.vite/manifest.json`.
2574
+ It wires `viteLeakGuard()`, and it keeps `node:` builtins external so the guard names the offending builtin:
2575
+ left alone, rolldown-vite silently rewrites a `node:` import to a browser stub, which builds and ships and
2576
+ is a no-op at runtime - a worse footgun than Bun's polyfill, now a build failure. `buildServerVite`
2577
+ produces the same self-contained `ServerBuild`, tagging the bundle `NIFRA_SSR_BUNDLED` so the web-react
2578
+ adapter uses the bundled, deduped react-dom rather than re-rooting to a disk copy.
2579
+
2580
+ `nifra build --vite` selects the pipeline; the app's Vite plugins drive both halves. Verified end to end by
2581
+ building the React example for the `node` target, running the server, and confirming SSR plus live
2582
+ hydration in a real browser, alongside `cf-pages` (`_worker.js` + `_routes.json`) and `static` (prerender,
2583
+ no server) deploy shapes.
2584
+
2585
+ No change to the default Bun build: `buildTarget` now delegates to `buildTargetWith` with the Bun strategy,
2586
+ and its behaviour and output are identical.
2587
+
2588
+ ### Patch Changes
2589
+
2590
+ - 135d0c6: Find duplicate installs when `nifra check` runs from an app subdirectory.
2591
+
2592
+ The duplicate-install check anchored its discovery at the directory it was run from. In a monorepo you
2593
+ run it from the app - `apps/web` - and that manifest declares no `workspaces`, so the scan collapsed to
2594
+ the app itself and the sibling package holding the second copy was never probed. It printed
2595
+ `✓ duplicate identity-sensitive dependency install: none` while the dev server returned 500 on every
2596
+ page using a shared-kit hook, from exactly the condition the check exists to detect. Running from an
2597
+ app subdirectory is the normal case, so that was the configuration it was blind in.
2598
+
2599
+ Discovery now walks up to the workspace root that actually governs the directory, and probes from
2600
+ there. An ancestor is adopted only when its `workspaces` patterns genuinely match - a parent that
2601
+ merely contains a manifest is not this project's root - and the walk stops at a `.git` boundary.
2602
+ Findings are still reported relative to where you ran the command.
2603
+
2604
+ **Expect this to start reporting real findings in monorepos that were previously green.** That is the
2605
+ point rather than a regression: the duplicate was always there, and the check simply never looked in
2606
+ the right place.
2607
+
2608
+ An SSR error carrying a duplicate-instance signature (`resolveDispatcher()`, `Invalid hook call`, a
2609
+ null hook read) now names the likely cause. Two copies at the same version still fail, because module
2610
+ identity is path-based, and the raw error points at a React internal - so the message now says two
2611
+ copies are installed at different paths, that matching versions do not fix it, and to run
2612
+ `nifra check` for the paths.
2613
+
2614
+ - 1857d39: Serve `public/` in production, not just in dev.
2615
+
2616
+ `nifra dev` served a project's `public/` directory; production did not. There was no `publicDir`
2617
+ concept anywhere - dev got the behaviour for free because the HMR path runs on Vite, and Vite serves
2618
+ `public/` by default. So a file worked all the way through development and 404'd the moment it was
2619
+ deployed, and every app had to notice this and hand-roll static serving in its own server entry.
2620
+
2621
+ The failure is inverted, which is what makes it expensive: it appears only in production, and only for
2622
+ the assets nobody smoke-tests. It has already shipped once as a self-hosted webfont that 404'd in prod
2623
+ and silently fell back to a system font. Nothing errored and nothing alerted.
2624
+
2625
+ `publicDir` (default `"public"`) is now a first-class option. The build copies the directory into the
2626
+ output and records the file list on the build manifest, and `servePublicDir` is exported for a server
2627
+ entry to mount. Dev routes through the **same** handler rather than inheriting Vite's - two code paths
2628
+ with different defaults was the whole bug, so there is now one owner.
2629
+
2630
+ Behaviour, matching what apps arrived at independently: only paths with a file extension are probed,
2631
+ so a page route never pays a filesystem stat; a miss falls through to routing, so no route is shadowed;
2632
+ and cache headers differ by subtree - content-hashed `/assets/*` immutable, `public/` a day, both
2633
+ overridable. Path traversal is confined by resolving and then verifying containment, rather than
2634
+ scanning the input for `..` - a blocklist over encodings is the version that gets bypassed - and
2635
+ percent-encoded and NUL-bearing paths have tests.
2636
+
2637
+ Note that `publicPath` is a different thing: the URL prefix for content-hashed bundle chunks. It never
2638
+ covered user-authored files, and the name similarity actively misleads.
2639
+
2640
+ `nifra check` now points out that an app with a `public/` directory can delete its hand-rolled static
2641
+ serving. A tip rather than a finding - an existing handler still works, since it runs first.
2642
+
2643
+ On Cloudflare Pages the copied files are named individually in `_routes.json` so the CDN serves them
2644
+ without invoking the worker, within Cloudflare's cap of 100 include+exclude rules of at most 100
2645
+ characters each. An ordinary `public/` of icons, fonts and share images clears that cap, and the
2646
+ rejection lands at `wrangler pages deploy` - after a build that reported success.
2647
+
2648
+ Past the cap a directory is compacted to one `/dir/*` rule, but only after checking it against the
2649
+ app's real route patterns. The glob does not merely describe today's files; it hands Pages every future
2650
+ path under that prefix, so a `public/blog/hero.png` beside a `/blog/:slug` route would send
2651
+ `/blog/my-post` to a CDN that has no such file and 404 the page in production only. A directory
2652
+ therefore collapses only when no route can be served beneath it, and a single route with a dynamic
2653
+ first segment (`/:locale/…`) disables collapsing everywhere, since it can match under any name. A
2654
+ collapsed directory does give up the app's 404 page for a missing file beneath it - the right trade for
2655
+ a directory of static files, where a missing image should fail as a fast CDN 404 rather than an HTML
2656
+ error page.
2657
+
2658
+ Whatever still does not fit is dropped rather than widened, which is safe because the list is only an
2659
+ optimization: the emitted worker serves any path it recognises through the `ASSETS` binding, so an
2660
+ omitted file costs one worker invocation rather than a 404, and nothing else reaches that binding. The
2661
+ build prints how many it left out, since a cap you cannot see reads as coverage you do not have.
2662
+
2663
+ - Updated dependencies [39b1670]
2664
+ - Updated dependencies [d428f52]
2665
+ - Updated dependencies [135d0c6]
2666
+ - Updated dependencies [5f460db]
2667
+ - Updated dependencies [1394641]
2668
+ - Updated dependencies [e713cab]
2669
+ - Updated dependencies [a4645e2]
2670
+ - Updated dependencies [a7d740a]
2671
+ - Updated dependencies [6e996a1]
2672
+ - Updated dependencies [15ad6ca]
2673
+ - Updated dependencies [6aa0aac]
2674
+ - Updated dependencies [1857d39]
2675
+ - Updated dependencies [6ba3173]
2676
+ - Updated dependencies [ca71a2e]
2677
+ - Updated dependencies [0fc215b]
2678
+ - Updated dependencies [2ff661f]
2679
+ - Updated dependencies [a1327a4]
2680
+ - Updated dependencies [2500705]
2681
+ - @nifrajs/web@2.2.0
2682
+ - create-nifra@2.2.0
2683
+ - @nifrajs/core@2.2.0
2684
+ - @nifrajs/client@2.2.0
2685
+ - @nifrajs/schema@2.2.0
2686
+ - @nifrajs/testing@2.2.0
2687
+ - @nifrajs/mcp@2.2.0
2688
+ - @nifrajs/runner@2.2.0
2689
+
2690
+ ## 2.1.0
2691
+
2692
+ ### Patch Changes
2693
+
2694
+ - Updated dependencies [bd294bb]
2695
+ - Updated dependencies [d3aac63]
2696
+ - @nifrajs/core@2.1.0
2697
+ - @nifrajs/client@2.1.0
2698
+ - @nifrajs/web@2.1.0
2699
+ - @nifrajs/schema@2.1.0
2700
+ - @nifrajs/testing@2.1.0
2701
+ - @nifrajs/mcp@2.1.0
2702
+ - @nifrajs/runner@2.1.0
2703
+ - create-nifra@2.1.0
2704
+
2705
+ ## 2.0.0
2706
+
2707
+ ### Major Changes
2708
+
2709
+ - d91a45b: Remove Nifra's remaining deprecated and compatibility-only public surfaces for the 2.0 cutover.
2710
+
2711
+ - `@nifrajs/core` and `nifra` now expose only the lean HTTP server API at their package roots. Import
2712
+ optional systems from their documented subpaths. The deprecated invariant runner and the
2713
+ `@nifrajs/budget` compatibility package are removed; use `@nifrajs/testing` and
2714
+ `@nifrajs/core/budget` respectively.
2715
+ - Web redirects accept only an options object as their second argument, the prerender enumeration
2716
+ wrapper is removed in favor of `enumerateStaticRoutes()`, and fragment navigation resolves IDs only.
2717
+ - MCP Apps metadata uses only `_meta.ui.resourceUri`; the deprecated flat `ui/resourceUri` key is gone.
2718
+ - Telemetry uses `ObservationAdapter` directly; the `AgentSpan`, `AgentSpanExporter`, and `SpanExporter`
2719
+ aliases are removed.
2720
+ - Invalid HTTP method overrides always fail closed with 400; the legacy ignore mode is removed.
2721
+ - `nifra build` always emits a complete target deploy directory and defaults to Bun. The old
2722
+ client-only build branch is removed; `nifra start` runs the generated Bun `server.js`.
2723
+
2724
+ ### Minor Changes
2725
+
2726
+ - 6b0dbc3: Ship the executable 2.0 migration path and consolidated upgrade documentation.
2727
+
2728
+ - `nifra upgrade 2.0.0` updates the fixed Nifra package group while preserving range style, moves
2729
+ the removed `@nifrajs/budget` dependency to `@nifrajs/core`, rewrites its source imports to
2730
+ `@nifrajs/core/budget`, and prints the structural cutover notes it cannot safely infer.
2731
+ - Pin rules now treat bare package names as exact matches, so upgrading `nifra` cannot rewrite an
2732
+ unrelated dependency such as `nifra-plugin`.
2733
+ - The 1.x → 2.0 guide covers opt-in runtime plugins, lean subpath imports, backend mounts, typed
2734
+ client failures, web/protocol changes, release gates, and `nifra.check.json` external mounts for
2735
+ Better Auth-style route owners.
2736
+ - External-mount matching rejects percent-encoded parent traversal as well as literal `..`, so the
2737
+ lint exception cannot hide a fetch that URL normalization moves outside its declared prefix.
2738
+
2739
+ - 2324d38: `nifra check` can now reach green on an app that intentionally mounts a non-typed sub-app, and raw-Response routes have an explicit opt-out.
2740
+
2741
+ - **`nifra.check.json` external-mount allowlist.** A relative `fetch()` to a mounted handler that lives outside the typed contract (e.g. an auth plugin that owns `/auth/**`) was flagged as a hand-rolled own-API call - an error you could never clear. Declare those prefixes in `nifra.check.json` (`{ "externalMounts": ["/auth"] }`, segment-anchored: `/auth` blesses `/auth` and `/auth/**` but not `/authors`) and the typed-client scan skips them. The blessed prefixes are echoed on the result and printed in the report, so a suppressed mount stays auditable instead of silently hiding real drift. A malformed `nifra.check.json` is a non-fatal warning; the allowlist is simply ignored.
2742
+ - **`// nifra-expect raw-response` pragma.** A route that deliberately returns a raw `Response` (a file or redirect) raised the `response-route` advisory with no way to mark it intentional. A pragma comment on the return line, or the line above, now silences it for that route.
2743
+ - **Streaming guidance.** The `response-route` advisory now points streaming routes at the typed SSE route (`app.sse(...)`), which keeps typed events instead of collapsing the client to `data: never`.
2744
+
2745
+ - 5917e68: Add the `nifra_levels` MCP tool, so an agent can read the verification ladder it was already able to
2746
+ run from the CLI. It returns `{ achieved, levels[] }` across L0 typed contract, L1 route assurance,
2747
+ L2 capability lockfile, L3 route trust manifest, and L4 contract invariants, with the reasons a level
2748
+ does not hold. A project with no assurance config still answers, stopping at L0 rather than failing.
2749
+ - e97a92f: `nifra sync-manifest`, plus two toolchain guards that turn opaque failures into actionable ones.
2750
+
2751
+ - **`nifra sync-manifest`.** After adding/renaming/removing a page route, the committed `server-manifest.ts` drifts and `nifra check` flags it - and clearing that used to mean a full build (server + worker + migrate bundles). `nifra sync-manifest` re-scans `routes/` and rewrites just the manifest's route table in milliseconds, preserving the baked client-asset references. It does not rebuild the client bundle, so it prints a caveat: a brand-new hydrating route component still needs a full build for its client chunk. `@nifrajs/web/build` gains the pure `resyncServerManifestSource` (+ `parseManifestStyles` / `parseManifestRouteStyles`) it is built on.
2752
+ - **`nifra dev` peer preflight.** Run under `bunx @nifrajs/cli dev` (an isolated install where the project's peers do not resolve), the Vite import failed with an opaque `ERR_MODULE_NOT_FOUND`. It now checks `vite` resolves from the project first and, if not, says to run the workspace-local `bun run dev`.
2753
+ - **`nifra start` build-target guard.** Pointed at a Cloudflare Pages output (a `_worker.js` bundle, no `server.js`), `nifra start` now names the mismatch and the fix (`nifra build --target bun`, or serve with `wrangler pages`) instead of a bare "no server.js".
2754
+
2755
+ ### Patch Changes
2756
+
2757
+ - 7791470: `nifra check` now prints a one-line tip when the project has no `.mcp.json`, pointing at `nifra init-agents` (which wires `.mcp.json` + `.cursor/mcp.json` + a CLAUDE.md preamble, no-clobber). The tip is non-fatal and only in the human report - the `--json` path is unchanged - so a coding agent discovers the MCP wiring instead of learning the framework from sibling-app source.
2758
+ - Updated dependencies [a7b1d60]
2759
+ - Updated dependencies [a7b1d60]
2760
+ - Updated dependencies [eaac3d7]
2761
+ - Updated dependencies [ade0c7a]
2762
+ - Updated dependencies [82676e0]
2763
+ - Updated dependencies [1522d06]
2764
+ - Updated dependencies [b7017b9]
2765
+ - Updated dependencies [d91a45b]
2766
+ - Updated dependencies [d91a45b]
2767
+ - Updated dependencies [e97a92f]
2768
+ - Updated dependencies [202e758]
2769
+ - Updated dependencies [a7b1d60]
2770
+ - Updated dependencies [e8e49d1]
2771
+ - Updated dependencies [a7d34e5]
2772
+ - Updated dependencies [a7b1d60]
2773
+ - @nifrajs/core@2.0.0
2774
+ - @nifrajs/client@2.0.0
2775
+ - @nifrajs/schema@2.0.0
2776
+ - @nifrajs/web@2.0.0
2777
+ - create-nifra@2.0.0
2778
+ - @nifrajs/testing@2.0.0
2779
+ - @nifrajs/mcp@2.0.0
2780
+ - @nifrajs/runner@2.0.0
2781
+
2782
+ ## 1.13.0
2783
+
2784
+ ### Patch Changes
2785
+
2786
+ - f644556: `nifra doctor` also probes the workspace root for identity-sensitive packages, so it reports the split
2787
+ where every declaring package resolves one physical copy and the root holds another. Consulting only
2788
+ the packages that declare the dependency saw a single copy and stayed quiet.
2789
+ - Updated dependencies [aae8614]
2790
+ - Updated dependencies [5b6127a]
2791
+ - @nifrajs/core@1.13.0
2792
+ - @nifrajs/client@1.13.0
2793
+ - @nifrajs/web@1.13.0
2794
+ - @nifrajs/schema@1.13.0
2795
+ - @nifrajs/testing@1.13.0
2796
+ - @nifrajs/mcp@1.13.0
2797
+ - @nifrajs/runner@1.13.0
2798
+ - create-nifra@1.13.0
2799
+
2800
+ ## 1.12.0
2801
+
2802
+ ### Minor Changes
2803
+
2804
+ - 63d3845: Add bounded execution-causality contracts and propagation, OpenTelemetry causal links, event-envelope lineage, and a deterministic durable failure laboratory. `nifra levels` L4 now uses the deep adversarial contract engine through its explicitly isolated executor. Also add hash-verifiable adapter certification profiles and duplicate physical Nifra/React install detection in `nifra doctor`/`nifra check`.
2805
+
2806
+ ### Patch Changes
2807
+
2808
+ - Updated dependencies [63d3845]
2809
+ - Updated dependencies [246f498]
2810
+ - @nifrajs/core@1.12.0
2811
+ - @nifrajs/testing@1.12.0
2812
+ - @nifrajs/client@1.12.0
2813
+ - @nifrajs/schema@1.12.0
2814
+ - @nifrajs/web@1.12.0
2815
+ - @nifrajs/mcp@1.12.0
2816
+ - @nifrajs/runner@1.12.0
2817
+ - create-nifra@1.12.0
2818
+
2819
+ ## 1.11.0
2820
+
2821
+ ### Minor Changes
2822
+
2823
+ - 2dde7e5: Add the effect ledger, sandboxed contract-generated invariant tests, and the verification ladder.
2824
+
2825
+ **Effect ledger** - a per-request, append-only, ordered record of side-effect intents and outcomes.
2826
+ Routes that declare `schema.capabilities` get a bounded, token-only ledger when the server enables
2827
+ `server({ effectLedger })`; each `useCapability(c, id, { target, cost, digest })` beacon
2828
+ records an intent, `recordCapabilityOutcome` records its terminal result without double-debiting
2829
+ admission, and the sink receives the sealed ledger when the response settles - on success and
2830
+ error responses alike, so partial work is audited. Entries carry capability ids, phases, adapter
2831
+ tokens, dimensionless cost counters, an optional keyed-HMAC payload digest, and bounded error codes;
2832
+ the entry type has no payload field, and the sealed ledger names the route _pattern_ plus the declared
2833
+ capability set, never the concrete URL - redaction holds by construction. Includes an optional
2834
+ tamper-evident hash chain, a bounded in-memory sink,
2835
+ and `computeEffectDigest` (keyed HMAC-SHA-256, so low-entropy data cannot be brute-forced from a
2836
+ stored digest). The hash chain binds route identity, declarations, timestamps, and entries. Sink
2837
+ failures are logged without their potentially-sensitive message and do not turn a successful effect
2838
+ into a retryable 500; transactional audit belongs in the effect's owning transaction. Routes without
2839
+ capability declarations keep the existing fast path unchanged.
2840
+
2841
+ **Contract-generated invariant tests** - `runContractInvariants(app, { executor })` fuzzes each route from its
2842
+ declared JSON Schema with a deterministic seeded generator and verifies what the contract promises:
2843
+ valid inputs never crash, 2xx responses conform to the declared response schema, schema-violating
2844
+ bodies are rejected (never accepted, never a crash), and a route-level classification never
2845
+ understates its field-level tags. Findings carry the case seed for exact reproduction; ungeneratable
2846
+ routes are reported as skipped, never silently dropped.
2847
+ Dynamic execution requires an explicit `invariants.executor` backed by a disposable app/sandbox;
2848
+ verification never invokes a live app implicitly, and any skipped route prevents L4.
2849
+
2850
+ **Verification ladder** - `nifra levels` computes L0 typed contract → L1 route assurance → L2
2851
+ capability lockfile → L3 route manifest → L4 invariant-tested from the existing gates. Levels are
2852
+ cumulative and computed, never self-declared; `--min <n>` gates CI on a required floor.
2853
+
2854
+ - 279f80c: Add a deterministic versioned Nifra manifest that joins route schemas, assurance evidence,
2855
+ capabilities, and field-level response classification in one hash-verified artifact. Manifests can be
2856
+ signed through an operator-provided Ed25519 KMS/HSM callback; Nifra never handles private keys.
2857
+
2858
+ `nifra manifest emit` refuses failing assurance and writes byte-stable output, while
2859
+ `nifra manifest diff <before> <after>` hash-verifies both artifacts and fails deployment promotion on
2860
+ breaking contract, lost assurance, expanded effects, or increased data sensitivity.
2861
+
2862
+ ### Patch Changes
2863
+
2864
+ - Updated dependencies [2dde7e5]
2865
+ - Updated dependencies [80ed7b8]
2866
+ - Updated dependencies [279f80c]
2867
+ - Updated dependencies [5638ada]
2868
+ - Updated dependencies [279f80c]
2869
+ - @nifrajs/core@1.11.0
2870
+ - create-nifra@1.11.0
2871
+ - @nifrajs/client@1.11.0
2872
+ - @nifrajs/web@1.11.0
2873
+ - @nifrajs/schema@1.11.0
2874
+ - @nifrajs/mcp@1.11.0
2875
+ - @nifrajs/runner@1.11.0
2876
+
2877
+ ## 1.10.0
2878
+
2879
+ ### Minor Changes
2880
+
2881
+ - 92181be: Add hardened effect and capability assurance: reflected route declarations, fail-closed runtime
2882
+ beacons, static effect-provenance analysis, deterministic capability lockfiles, HTTP safe-method
2883
+ guards, and effect-specific request or durable idempotency requirements.
2884
+
2885
+ Add `nifra capabilities snapshot` and `nifra capabilities check` so capability drift and raw
2886
+ provider bypasses can be enforced in CI without adding work to the default request path.
2887
+
2888
+ ### Patch Changes
2889
+
2890
+ - Updated dependencies [92181be]
2891
+ - Updated dependencies [3773f0a]
2892
+ - Updated dependencies [92181be]
2893
+ - @nifrajs/core@1.10.0
2894
+ - @nifrajs/client@1.10.0
2895
+ - @nifrajs/schema@1.10.0
2896
+ - @nifrajs/web@1.10.0
2897
+ - @nifrajs/mcp@1.10.0
2898
+ - @nifrajs/runner@1.10.0
2899
+ - create-nifra@1.10.0
2900
+
2901
+ ## 1.9.1
2902
+
2903
+ ### Patch Changes
2904
+
2905
+ - 3eb27ae: Internal tidy - remove a dead local variable in the query engine and clean up example wording in doc comments. No API or behavior change.
2906
+ - Updated dependencies [3eb27ae]
2907
+ - @nifrajs/web@1.9.1
2908
+ - @nifrajs/mcp@1.9.1
2909
+ - @nifrajs/client@1.9.1
2910
+ - @nifrajs/core@1.9.1
2911
+ - @nifrajs/runner@1.9.1
2912
+ - @nifrajs/schema@1.9.1
2913
+ - create-nifra@1.9.1
2914
+
2915
+ ## 1.9.0
2916
+
2917
+ ### Patch Changes
2918
+
2919
+ - Updated dependencies [03cd76f]
2920
+ - Updated dependencies [0e1b4cc]
2921
+ - Updated dependencies [6b67833]
2922
+ - Updated dependencies [03cd76f]
2923
+ - @nifrajs/core@1.9.0
2924
+ - @nifrajs/web@1.9.0
2925
+ - @nifrajs/client@1.9.0
2926
+ - @nifrajs/schema@1.9.0
2927
+ - @nifrajs/mcp@1.9.0
2928
+ - @nifrajs/runner@1.9.0
2929
+ - create-nifra@1.9.0
2930
+
2931
+ ## 1.8.0
2932
+
2933
+ ### Minor Changes
2934
+
2935
+ - e47c4c5: Add reflection-time route assurance: middleware and plugins can publish lifecycle-accurate enforcement
2936
+ evidence, ordered policies fail closed on unclassified/missing/forbidden evidence, official hardening
2937
+ middleware emits canonical evidence, and `nifra assure` exposes a human/JSON CI gate.
2938
+ - 9433ad9: Add `nifra upgrade <version>`: an executable, per-release upgrade runner. A recipe declares the
2939
+ mechanical edits a target version needs - a dependency-pin sweep (sets every matching `@nifrajs/*`
2940
+ dependency to the target version across the workspace, preserving each spec's `^`/`~`/exact style and
2941
+ skipping `workspace:`/`link:` specs) and exact import-specifier moves - and the runner applies them
2942
+ `detect → transform → verify`, reusing the existing `nifra check` gate rather than adding a new one.
2943
+ Dry-run by default (`--write` applies, `--no-verify` skips the check, `--list` shows targets); fail-closed
2944
+ on an unknown version or a missing package.json; deterministic and idempotent. Ships the 1.8.0 recipe.
2945
+ Transforms are intentionally string/specifier-level - structural (AST) codemods are deferred until a
2946
+ recipe needs one.
2947
+
2948
+ ### Patch Changes
2949
+
2950
+ - Updated dependencies [e47c4c5]
2951
+ - Updated dependencies [1ffd48b]
2952
+ - @nifrajs/core@1.8.0
2953
+ - @nifrajs/web@1.8.0
2954
+ - @nifrajs/client@1.8.0
2955
+ - @nifrajs/schema@1.8.0
2956
+ - @nifrajs/mcp@1.8.0
2957
+ - @nifrajs/runner@1.8.0
2958
+ - create-nifra@1.8.0
2959
+
2960
+ ## 1.7.0
2961
+
2962
+ ### Patch Changes
2963
+
2964
+ - 9f23e90: Fix `nifra build --target static` producing pages that render but never hydrate. The prerender pass hardcoded a placeholder client entry, but the real bundle is content-hashed - so the prerendered HTML's hydration `<script src>` 404'd and every control was inert. `BuildTargetOptions.prerenderApp` is now a factory `(client: BuildManifest) => app` invoked with the completed client build, so the emitted `<script src>` uses the real hashed entry (plus the same styles / route-preload the SSR targets use). A regression test asserts the static HTML references the emitted hashed entry and that the file exists under `/assets`. Breaking only for code calling `buildTarget("static", …)` directly (pass a factory instead of a prebuilt app); `nifra build --target static` users just get working hydration.
2965
+ - Updated dependencies [bd95181]
2966
+ - Updated dependencies [9f23e90]
2967
+ - @nifrajs/core@1.7.0
2968
+ - @nifrajs/web@1.7.0
2969
+ - @nifrajs/client@1.7.0
2970
+ - @nifrajs/schema@1.7.0
2971
+ - @nifrajs/mcp@1.7.0
2972
+ - @nifrajs/runner@1.7.0
2973
+ - create-nifra@1.7.0
2974
+
2975
+ ## 1.6.0
2976
+
2977
+ ### Patch Changes
2978
+
2979
+ - @nifrajs/client@1.6.0
2980
+ - @nifrajs/core@1.6.0
2981
+ - @nifrajs/mcp@1.6.0
2982
+ - @nifrajs/runner@1.6.0
2983
+ - @nifrajs/schema@1.6.0
2984
+ - @nifrajs/web@1.6.0
2985
+ - create-nifra@1.6.0
2986
+
2987
+ ## 1.5.0
2988
+
2989
+ ### Minor Changes
2990
+
2991
+ - 1ac2fde: API breaking-change gate: `snapshotRoutes` + `diffRouteSnapshots` in `@nifrajs/core/diff` (direction-aware - a new required request field or a removed response field breaks; widening a request enum or adding a response field doesn't; fails closed on anything unprovable), and `nifra snapshot` / `nifra diff <baseline>` CLI commands that exit non-zero on breaking changes for CI.
2992
+
2993
+ ### Patch Changes
2994
+
2995
+ - Updated dependencies [1ac2fde]
2996
+ - Updated dependencies [bd3433f]
2997
+ - Updated dependencies [70aa836]
2998
+ - @nifrajs/core@1.5.0
2999
+ - @nifrajs/schema@1.5.0
3000
+ - @nifrajs/client@1.5.0
3001
+ - @nifrajs/web@1.5.0
3002
+ - @nifrajs/mcp@1.5.0
3003
+ - @nifrajs/runner@1.5.0
3004
+ - create-nifra@1.5.0
3005
+
3006
+ ## 1.4.0
3007
+
3008
+ ### Patch Changes
3009
+
3010
+ - 4d25970: Add one fail-open request-observation lifecycle shared by tracing, agent telemetry, and DevTools; secured development tooling; contract-based mock responses; validator-neutral schema/route reflection; executable render and storage adapter conformance modules; optional storage pagination/signing/copy capabilities; and metadata-preserving local file storage.
3011
+ - Updated dependencies [4d25970]
3012
+ - @nifrajs/core@1.4.0
3013
+ - @nifrajs/schema@1.4.0
3014
+ - @nifrajs/web@1.4.0
3015
+ - @nifrajs/client@1.4.0
3016
+ - @nifrajs/mcp@1.4.0
3017
+ - @nifrajs/runner@1.4.0
3018
+ - create-nifra@1.4.0
3019
+
3020
+ ## 1.3.1
3021
+
3022
+ ### Patch Changes
3023
+
3024
+ - 578da89: fix(cli): refresh the `nifra mcp` types/examples corpus for the 1.3.0 API + gate it
3025
+
3026
+ `@nifrajs/cli` bundles the MCP corpus (`docs/types.json` / `examples.json`) behind `nifra_types` and
3027
+ `nifra_context`. It shipped **stale in 1.3.0** - the release regenerated `api-reference.md` + the LLM cards
3028
+ but not this corpus - so agents couldn't see `server().tool()` / `.resource()` / `.prompt()`,
3029
+ `onValidationError`, `RouteSchema.errors`, `ToolAnnotations`, or `generateLlmsTxt` via MCP. Regenerated.
3030
+
3031
+ To prevent recurrence: `changeset:publish` now runs `gen:llms` after the build, so every published tarball
3032
+ carries a corpus regenerated from that exact build - the corpus can no longer ship stale regardless of what's
3033
+ committed.
3034
+
3035
+ - @nifrajs/client@1.3.1
3036
+ - @nifrajs/mcp@1.3.1
3037
+ - @nifrajs/runner@1.3.1
3038
+ - @nifrajs/schema@1.3.1
3039
+ - @nifrajs/web@1.3.1
3040
+ - create-nifra@1.3.1
3041
+
3042
+ ## 1.3.0
3043
+
3044
+ ### Minor Changes
3045
+
3046
+ - 9f8d2aa: feat(cli): `nifra_check` / `nifra_test` MCP tools accept a `dir` to scope a subdirectory
3047
+
3048
+ The MCP server runs at the project root, so `nifra check` / `nifra test` always ran from there - no way to
3049
+ target one app in a monorepo (a common pain: the root holds a builder + generated apps, but you want to
3050
+ check just `app/`). Both tools now take an optional `dir` (relative to the root, e.g. `"app"` or
3051
+ `"packages/api"`); the check/test runs against that subtree. Path-traversal-guarded - a `dir` that climbs
3052
+ out of the root (`../`, an absolute path elsewhere) is rejected, not run.
3053
+
3054
+ - 4a4b1c4: feat: `server().resource()` / `.prompt()` - app-declared MCP resources & prompts
3055
+
3056
+ Completing the MCP trio alongside `.tool()`: an app can now expose its own MCP **resources**
3057
+ (`.resource(uri, { name, description?, mimeType? }, read)`) and **prompts** (`.prompt(name, { description,
3058
+ arguments? }, handler)`). `nifra mcp` surfaces them in `resources/list` + `resources/read` and `prompts/list`
3059
+
3060
+ - `prompts/get` (namespaced per app in a monorepo). The `read`/`handler` closures run in the app process, so
3061
+ they capture whatever app state they need - no HTTP round-trip.
3062
+
3063
+ ### Patch Changes
3064
+
3065
+ - Updated dependencies [4a4b1c4]
3066
+ - Updated dependencies [4a4b1c4]
3067
+ - @nifrajs/mcp@1.3.0
3068
+ - @nifrajs/schema@1.3.0
3069
+ - @nifrajs/web@1.3.0
3070
+ - @nifrajs/client@1.3.0
3071
+ - @nifrajs/runner@1.3.0
3072
+ - create-nifra@1.3.0
3073
+
3074
+ ## 1.2.2
3075
+
3076
+ ### Patch Changes
3077
+
3078
+ - 281844e: fix(cli): `nifra check` respects `.gitignore` and bounds the MCP result
3079
+
3080
+ Two fixes so `nifra check` (and the `nifra_check` MCP tool) can't drown in a repo full of generated apps:
3081
+
3082
+ - **Scanner honours `.gitignore`** - `walkSource` now filters candidates through one batched
3083
+ `git check-ignore`, so a gitignored generated/build tree isn't walked. A repo that gitignores, e.g., a
3084
+ 238-app generated-output dir went from a **52 MB** check result to ~130 KB. Degrades to the built-in
3085
+ ignore list (node_modules/dist/…) when there's no git repo - never throws.
3086
+ - **`nifra_check` MCP tool caps its output** - `collectCheckResult` gains `maxDiagnostics` (the tool sets 100) and reports `truncated: { shown, total }`, so a huge project can't emit an MCP message large enough
3087
+ to break the stdio transport (`-32000: Connection closed`). `ok` still reflects the FULL set; the CLI
3088
+ terminal / `--json` output stays unbounded.
3089
+ - @nifrajs/client@1.2.2
3090
+ - @nifrajs/mcp@1.2.2
3091
+ - @nifrajs/runner@1.2.2
3092
+ - @nifrajs/schema@1.2.2
3093
+ - @nifrajs/web@1.2.2
3094
+ - create-nifra@1.2.2
3095
+
3096
+ ## 1.2.1
3097
+
3098
+ ### Patch Changes
3099
+
3100
+ - Updated dependencies [c3ebd73]
3101
+ - @nifrajs/web@1.2.1
3102
+ - @nifrajs/client@1.2.1
3103
+ - @nifrajs/mcp@1.2.1
3104
+ - @nifrajs/runner@1.2.1
3105
+ - @nifrajs/schema@1.2.1
3106
+ - create-nifra@1.2.1
3107
+
3108
+ ## 1.2.0
3109
+
3110
+ ### Patch Changes
3111
+
3112
+ - @nifrajs/client@1.2.0
3113
+ - @nifrajs/schema@1.2.0
3114
+ - @nifrajs/web@1.2.0
3115
+ - @nifrajs/mcp@1.2.0
3116
+ - @nifrajs/runner@1.2.0
3117
+ - create-nifra@1.2.0
3118
+
3119
+ ## 1.1.0
3120
+
3121
+ ### Patch Changes
3122
+
3123
+ - Updated dependencies [9905f7f]
3124
+ - Updated dependencies [17e57c4]
3125
+ - Updated dependencies [37d2383]
3126
+ - create-nifra@1.1.0
3127
+ - @nifrajs/schema@1.1.0
3128
+ - @nifrajs/web@1.1.0
3129
+ - @nifrajs/client@1.1.0
3130
+ - @nifrajs/mcp@1.1.0
3131
+ - @nifrajs/runner@1.1.0
3132
+
3133
+ ## 1.0.0
3134
+
3135
+ ### Minor Changes
3136
+
3137
+ - 5673ff1: `nifra_types` - a new MCP tool that returns the **exact TypeScript** of any exported `@nifrajs/*` symbol (interface, type, class, function, const). Each signature is generated at build time from the package's built `.d.ts` with the TS compiler - the literal declaration, complete and authoritative, never prose and never truncated - and shipped inside `@nifrajs/cli` (`docs/types.json`), so it works offline and on every transport (stdio, HTTP, the edge `/mcp`).
3138
+
3139
+ This closes the gap that made agents fall back to reading `.d.ts`: when an agent needs the precise shape of a type (`RateLimitStore`, `RouteSchema`, a function signature), `nifra_types({ name })` returns the literal block. The tool description makes the completeness explicit ("the source of truth - do NOT read `.d.ts`"), and `nifra_docs` now points at it for exact types. `nifra_examples_app` on the public docs MCP, and the `@nifrajs/cli/mcp` self-host surface, both expose it too (`TypeEntry` is re-exported).
3140
+
3141
+ ### Patch Changes
3142
+
3143
+ - c099d5f: Add `@nifrajs/mcp` - build MCP servers, and **MCP Apps** (interactive `ui://` widgets, SEP-1865), for a nifra app.
3144
+
3145
+ MCP tools have only ever returned text. MCP Apps lets a tool return **interactive UI**: a tool links a `ui://` resource (MIME `text/html;profile=mcp-app`); the host renders it in a sandboxed iframe and bridges it to the server over MCP-JSON-RPC-on-`postMessage`. `@nifrajs/mcp` ships:
3146
+
3147
+ - The transport-agnostic JSON-RPC core (`handleRpc`, shared with `@nifrajs/cli`'s dev MCP) extended for MCP Apps - `structuredContent`, `_meta.ui.resourceUri`, and the `io.modelcontextprotocol/ui` capability.
3148
+ - `respondMcpHttp` - a Web `fetch` handler you mount at `POST /mcp`. nifra route handlers can return a raw `Response`, so mounting is one line per verb.
3149
+ - `defineMcpWidget` - author a `ui://` widget as one self-contained HTML doc with a tiny zero-dependency `postMessage` bridge inlined (`mcpApp.onData(render)` to render the host-pushed `structuredContent`; `mcpApp.callTool(...)` to re-invoke a tool through the host).
3150
+ - `defineMcpTool` + `createMcpServer` - wire tools to widgets and get a mountable server. See `examples/mcp-app/`.
3151
+ - `@nifrajs/mcp/react` - `reactWidget({ component })` authors a widget from a React component instead of an HTML string: the component is bundled for the browser (Bun.build) and re-renders on each `structuredContent` push over the bridge. `react`/`react-dom` resolve from the consumer; the core stays dependency-free.
3152
+ - **Host theming + render intent** (see `THEMING.md`). `defineMcpTool({ intent })` adds `_meta.ui.intent` (`table`/`list`/`form`/…) so a generative host renders `structuredContent` with its own themed component. For iframe widgets, the bridge handles a `ui/notifications/theme` push and auto-applies the host's shadcn/Tailwind semantic tokens (`--primary`, `--card`, `--border`, `--radius`, …) to the widget root - so a widget that styles with `hsl(var(--primary))` matches the embedding app with zero extra code.
3153
+
3154
+ `@nifrajs/cli`'s MCP protocol core moved into `@nifrajs/mcp` (the CLI re-exports it); behavior is unchanged - a tool whose handler returns a plain `string` behaves exactly as before. nifra's own public docs MCP (nifra.dev `/mcp`) now also dogfoods this - `nifra_examples_app` renders the examples as an interactive widget.
3155
+
3156
+ - bb31594: Surface `@nifrajs/middleware` where agents look. The `nifra_context` conventions (and a scaffolded app's `AGENTS.md`) now carry a one-line pointer: cross-cutting concerns - rate limiting (`429`), CORS, security headers, body limits, auth, CSRF, IP restriction, caching, compression - are `app.use(...)` plugins in `@nifrajs/middleware`; call `nifra_docs("middleware")` for the full list. So an agent setting up routes finds the built-in middleware (it already shipped) without having to think to search for it.
3157
+ - de9675b: Pre-1.0 security hardening pass. A framework-wide audit found no critical/high issues; these close the medium/low items it surfaced.
3158
+
3159
+ - **`cache()` - no cross-user leak by default.** A `200` to a request bearing `Authorization`/`Cookie` is no longer stored (and replayed to other users) unless the response is explicitly `Cache-Control: public`/`s-maxage` (RFC 9111 §3.5). Opt back in per cache with `cacheAuthenticated: true` for a route that's identical for every caller.
3160
+ - **`idempotency()` - route-scoped keys + a `key` hook.** The default store key is now scoped by method+path, so the same `Idempotency-Key` on a different endpoint can't collide and replay another resource's response. Added a `key(req, header)` option to scope by principal (e.g. user id). Method matching normalized to upper-case.
3161
+ - **`etag()` - a `304` no longer carries the `200`'s `Content-Length`/`Content-Type`.**
3162
+ - **`@nifrajs/core` - inbound WebSocket frames are capped** when serving on Bun (`listen()`): frames over `wsMaxPayloadBytes` (default `maxBodyBytes`, 1 MB) are rejected by the runtime before reaching a handler, so a huge frame can't be buffered/parsed into memory. New `ServerOptions.wsMaxPayloadBytes`.
3163
+ - **`@nifrajs/core` - WebSocket routes are same-origin by default (CSWSH).** A `ws()` route with no `allowedOrigins` now rejects a **cross-origin browser** handshake (an `Origin` whose host differs from the request's) with `403` - closing cross-site WebSocket hijacking, since browsers send cookies on WS handshakes and don't apply CORS. Non-browser clients (no `Origin`) and same-origin browsers are unaffected. **Breaking** for a route that served a cross-origin browser without declaring `allowedOrigins`: set `allowedOrigins` to the permitted origins (or `() => true` for a genuinely public socket).
3164
+ - **`@nifrajs/node` - static file handler** now adds `X-Content-Type-Options: nosniff` and re-checks the real path (symlink containment) before streaming, matching the image server.
3165
+ - **`@nifrajs/mcp` - widget bridge** now rejects `postMessage` events whose source isn't the parent window (including null-source synthetic events), closing a spoofing gap the previous guard left open.
3166
+ - **`@nifrajs/cli` - the MCP `nifra_run`/`nifra_ws` `entry` arg** is kept inside the project root, so a crafted `entry` can't import/execute a module outside the project.
3167
+
3168
+ - a001558: **MCP warm worker survives a single per-request cancel.** The warm `nifra_run`/`nifra_render` worker is shared across concurrent calls (its `pending` map is id-keyed so several requests can be outstanding at once). Cancelling one request used to kill the whole worker process, which rejected every other in-flight request and forced a cold rebuild - defeating the warm reuse + concurrency the tool is built for. A per-request cancel now drops only that request and leaves the worker hot; it's still replaced on file change as before.
3169
+ - Updated dependencies [f1f0e18]
3170
+ - Updated dependencies [c099d5f]
3171
+ - Updated dependencies [bb31594]
3172
+ - Updated dependencies [3efb7cd]
3173
+ - Updated dependencies [de9675b]
3174
+ - @nifrajs/client@1.0.0
3175
+ - @nifrajs/web@1.0.0
3176
+ - @nifrajs/mcp@1.0.0
3177
+ - create-nifra@1.0.0
3178
+ - @nifrajs/schema@1.0.0
3179
+ - @nifrajs/runner@1.0.0
3180
+
3181
+ ## 1.0.0-beta.4
3182
+
3183
+ ### Patch Changes
3184
+
3185
+ - Updated dependencies [5181a35]
3186
+ - create-nifra@1.0.0-beta.4
3187
+ - @nifrajs/client@1.0.0-beta.4
3188
+ - @nifrajs/runner@1.0.0-beta.4
3189
+ - @nifrajs/schema@1.0.0-beta.4
3190
+ - @nifrajs/web@1.0.0-beta.4
3191
+
3192
+ ## 1.0.0-beta.3
3193
+
3194
+ ### Patch Changes
3195
+
3196
+ - @nifrajs/client@1.0.0-beta.3
3197
+ - @nifrajs/runner@1.0.0-beta.3
3198
+ - @nifrajs/schema@1.0.0-beta.3
3199
+ - @nifrajs/web@1.0.0-beta.3
3200
+ - create-nifra@1.0.0-beta.3
3201
+
3202
+ ## 0.1.0-beta.2
3203
+
3204
+ ### Patch Changes
3205
+
3206
+ - Updated dependencies [5018546]
3207
+ - @nifrajs/web@0.1.0-beta.2
3208
+ - @nifrajs/client@0.1.0-beta.2
3209
+ - @nifrajs/runner@0.1.0-beta.2
3210
+ - @nifrajs/schema@0.1.0-beta.2
3211
+ - create-nifra@0.1.0-beta.2