Repository navigation
Added
- Routing:
IThrottleStoreandThrottleDecision, the store thethrottlemiddleware counts attempts in (PDR-024, stage R31). The default store is the in-process limiter andthrottlebehaves exactly as before (counters per application instance, empty after a restart, sameX-RateLimit-*,Retry-Afterand 429); registering your ownIThrottleStorereplaces it. No shared store ships yet: it follows in a separate package. - Routing: how
throttletreats a registeredIThrottleStorethat fails (PDR-024, stage R31). A call that throws or takes longer thanRoutingOptions.Throttle.StoreTimeout(default 250 ms) opens one breaker per store forThrottle.BreakerPeriod(default 5 s); in that time the store is not called and each policy'sThrottleFailureModedecides the request:DegradeToLocal(the default: this instance's in-process limiter with the policy's numbers),FailClosed(503 withRetry-After, set per policy with the newConfigureThrottlePolicyoverload) orFailOpen(no limit, explicit opt-in). After the period one request probes the store. A client that disconnects is not a failure, and no fallback decision admits it: underFailOpena request whose client has already gone ends with the cancellation instead of being admitted (DegradeToLocalalready ended it that way, andFailClosedrefuses it). New counters on theNaravel.Routingmeter:naravel.routing.throttle(policy, outcome) andnaravel.routing.throttle.store_failures(policy, reason). The default in-process store has no timeout or breaker and behaves as before. - Routing.Cache: a new package,
Naravel.Routing.Cache, withAddNaravelSharedThrottle(storeName): anIThrottleStorethat counts thethrottlemiddleware's attempts in a namedNaravel.Cachestore, so every application instance that uses the same store shares one quota (PDR-024, stage R31). One atomicICacheStore.IncrementAsynccall per request and no lock; the key isthrottle:{SHA-256 of the partition key}:{window index}, so it has a fixed length and no client address in it. The window is aligned to the clock (floor(UtcNow / window)): a caller can use the limit on both sides of a boundary (up to twice the limit in a short time) and the instances need clocks within the usual NTP skew. Policies,throttle:login, theX-RateLimit-*headers and the 429 are unchanged, and a backend that is down or slow follows each policy's failure mode. Thememorystore is process-local, so it counts per process like the default. The package depends onNaravel.RoutingandNaravel.Cache; Routing does not reference Cache. Nothing is released by this entry: a new package id and new Routing API need a version bump and a tag. - CI:
.github/scripts/check-package-metadata.pyfails a package with fewer than four tags, and.github/scripts/check-package-readmes.pyfails a package whose README has a relative link or image (nuget.org does not render relative images, and a README cannot be corrected after the version is published). Both follow Microsoft's NuGet package guidance. - CI:
.github/scripts/consumer-smoke.pyinstalls every packed package into a consumer outside the repository the way a user does (Naravel.*from the packed files only, a fresh package cache), builds it, loads every Naravel assembly and runs theNaravel.AotSmokeprogram against the packages. It runs in the pack job, where a failure fails the build and so also stops a release; the manual workflowpackage-smoke.ymlruns it against a version published on nuget.org, with an optionalexcludelist for packages that were added after that version (0.1.1 predatesNaravel.Routing.Cache). Nothing else consumed a packed package before. - CI:
.github/workflows/release-notes.ymlcreates the GitHub Release for each version tag from that version's section of this changelog (.github/scripts/release-notes.py, whose self-test thepinsjob runs), so every package's NuGet "Release notes" link leads somewhere. It runs when a tag is pushed and whenmainchanges, where it also creates the release of any version tag that has none (thev0.1.1tag predates it); pull requests get a read-only dry run. It is separate from the NuGet publish job and never edits an existing release. - CI:
.github/scripts/check-doc-names.pyreports names inREADME.md,docs/enanddocs/nugetthat the source does not define: anAdd*method that noPublicAPIbaseline lists, adotnet add package Naravel.*id that no project undersrc/has, and a configuration key (in ajsonblock, aSection:Keypath or aSection__Keyvariable) that no code reads. Microsoft, BCL and illustration names are listed with a reason in.github/scripts/doc-names.allow. It is report only (the findings go to the job summary and the step passes);--strictmakes it fail. It checks that a name exists, not what it means. - CI:
.github/scripts/check-api-shipped.pyfails a version-tag build, and with it the publish, while any project'sPublicAPI.Unshipped.txtstill has an entry, and names each such project, so a release cannot go out with API that the baseline still calls unreleased (stage R33). It does not run on pull requests or on main, where those files hold the next release's work; its self-test runs in thepinsjob on every pull request. - Repository:
README.mdis now a short front page (banner, a Laravel-to-Naravel comparison, a runnable quickstart, the module table, status and links). The install matrix, the registration calls, the sample-app notes and every module's example moved, unchanged, todocs/en/getting-started.md, anddocs/en/modules.md, anddocs/README.mdindexes every guide. No code or package content changed.
Changed
- Docs:
docs/en/foundation.mdsays how to avoid a driver being created after its manager was disposed (stop the callers first, let the factory stop on the token the manager cancels, do not letDisposethrow), and that the failure of the disposal of such a driver is not reported, which is intended (the owner's choice of 2026-11-10; AUDIT D-84, stage R32.T02). No code changes. - Repo:
AGENTS.mdnow lists "never invent an API, a package or a configuration key; verify it in the code or the docs first" as hard rule 13, with the place to check each kind of name in this repository. The longer "Evidence before claims" section stays as the detail. - Docs: English is now the only maintained documentation language. The Persian guides, decision records,
README.fa.md,ROADMAP.fa.md,CONTRIBUTING.fa.mdandCODE_OF_CONDUCT.fa.mdare removed (they stay in git history),roadmap/check.pyfails if a localized file comes back or a maintained page links to a removed one, andAGENTS.mdand the pull request template carry the new operating rules: source evidence for every API and example, links closed in the same change, a default pull request size, no weakened tests. - Docs: the module guides are being rewritten with complete, source-checked examples, the exact error messages and a testing section. Done so far:
Naravel.Foundation, the database dialect contract,Naravel.Cache(a runnable memory-only quickstart, every operation with its return value, howBlockAsyncwaits and releases, creating an asynchronous-only store, an Errors section),Naravel.Events(a runnable quickstart, an Errors section including the queued-listener messages; the duplicate testing and example sections were merged),Naravel.MailandNaravel.Notifications(a runnable quickstart each, an Errors section with the exact messages, copies and a sender of your own for a mailable),Naravel.Queue(a quickstart that runs on the memory driver with an in-process worker, an Errors section; the Redis walkthrough is kept as its own section),Naravel.Queue.Coordination(a quickstart that runs on the memory queue and the memory Cache, the names the middleware give to the Cache, an Errors section with the exact messages, and a Testing section with examples that are run),Naravel.Database(a quickstart on in-memory SQLite, an Errors section with the exact messages, a completeDatabaseFakeexample and a note on testing against SQLite in memory),Naravel.Pagination(one runnable quickstart with the three kinds of page that replaces the incomplete "complete example", an Errors section with the exact messages including the cursor ones, and a Testing section),Naravel.Filesystem(a runnable quickstart on a local disk, an Errors section with the exact messages, the archive example, and a Testing section with a completeStorageFakeexample; the old "Complete example" section is gone),Naravel.Routing(a runnable quickstart, an Errors section with the exact messages that says which mistakes are reported at startup, which only on the first request and which not at all, and a Testing section with a middleware test, aTestServertest and how to test an expired signed link; the Complete example is kept),Naravel.Scheduling(a runnable worker quickstart that needs no cache, an Errors section with the exact messages and the log lines of a failing run, and a Testing section with the guards under two fakes and a task that needs services; the Complete example is kept) andNaravel.Broadcasting(a runnable quickstart that needs no sign-in and no Events registration, and an Errors section with the exact messages, including what a client sees when the hub refuses and what is only logged, and a Testing section with the fake, a rule kept in a method and a hub test onTestServer). TheDocsExampleTests.csfiles in the Cache, Mail, Notifications, Queue, Queue.Coordination, Database, Pagination.EntityFrameworkCore, Filesystem, Routing, Scheduling and Broadcasting test projects run the new snippets and assert the documented messages. - Docs: the "Honest about guarantees" line of
README.mdno longer says that route throttling is always process-local. It is by default; the routing guide describes the shared store and what it does not cover. - NuGet metadata:
Naravel.Notificationshas five tags instead of three, so a search for notification channels finds it; the change ships with this version, because metadata cannot be edited after a version is pushed. - Repo:
.gitignoreignores Python bytecode, and the two.pycfiles that an earlier change committed by mistake are removed. The README check ignores fenced code with CommonMark rules (a four-backtick fence can show a three-backtick example). - NuGet package pages: every package page now has a
Usesection with the registration call, the configuration and a minimal example, so the page on nuget.org says how to start, not only how to install. Each name and configuration key was checked against the source and the public API baselines; the snippets are not compiled by CI. - NuGet package pages: the pages now share one at-a-glance layout so a visitor sees what a package is before reading any code: four badges (version, downloads, .NET 10, MIT), a one-line pitch, a facts table (install command, target, dependencies, providers or drivers), a short "What you get" list, the
Useexample as "Quick start", the related packages as a table and the links to the guide. All 36 pages underdocs/nugethave it,Naravel.Foundationincluded (its page was its full guide,docs/en/foundation.md, until now; the guide is unchanged and the page links to it). The badges are images from img.shields.io, a host nuget.org allows.
Fixed
- Routing: the
throttlepartition key could be the same for two different partitions. It joined the policy name, the endpoint and the subject with|and nothing else, so a policy or endpoint name that contains|could make two partitions share one counter (the endpointa|bwith the subjectcand the endpointawith the subjectb|ccounted together). Each of the three is now written as its length, a colon and the text (3:5:2|8:/limited|11:203.0.113.7), so the key can be read back in one way only. Policies and endpoints whose names do not contain|count exactly as before;IThrottleStoreis not in a published version, so no stored counter is left under the old text (AUDIT D-87, stage R32). - Foundation:
Managerdid not notice some changes to a store's configuration, so it went on using the old driver: text moving between a key and a value or between a value and the next key (aBarofb;Foo=aread the same as aBarofbnext to aFooofa), a missing value becoming an empty one, or a change to the value of a store written as a single value. The fingerprint it compares on every configuration reload now writes each key and value with its length and includes the store's own value, so these changes rebuild the drivers. - Foundation: the synchronous
Manager.Drivercould wait for an asynchronous factory. It checked that the factory was synchronous and then read the factory again to create the driver, so a factory replaced by an asynchronous one in between (Extend, or a registration on the registry from another thread) was awaited on the calling thread, against the documented rule thatDrivernever blocks on an asynchronous factory. It now creates the driver through the registry's synchronous path, which reads the factory once, and throws the sameInvalidOperationExceptionas for an asynchronous-only driver that does not exist yet. An asynchronous caller that had joined that creation starts over and gets the driver of the new factory. - Foundation: disposing a
Managercould leave its drivers undisposed. The manager cancels the token it passes to asynchronous factories, and a callback registered on that token that throws made the cancellation throw before any driver was disposed, after the cache was already emptied, so the drivers were lost and a secondDisposedid nothing. The same held for a failure while detaching the manager's subscriptions to the registry and to option changes. Each failure is now kept, every driver is disposed, and oneAggregateExceptionreports them together with any driver's. Its message is nowThe manager did not dispose cleanly: one or more drivers, lifetime callbacks or subscriptions failed. - Foundation:
Manager.DriverAsynccould start a creation for a caller that had already cancelled. When the entry it waited on was a synchronous creation that found its factory replaced by an asynchronous one, the caller started over without looking at its token, andTask.WaitAsyncreturns a creation that has already finished even for a cancelled token, so a caller that had given up could be handed the driver. It now throwsOperationCanceledExceptionbefore starting over.
All Naravel packages share this version, for example Naravel.Foundation 0.2.0.