Urgent.News

What's breaking now, across thousands of outlets.

Tech

This week in Cursor + .NET — 7 rules (week ending October 18, 2026)

Every weekday a single, opinionated rule for senior C#/.NET engineers using Cursor. Here's the full week in one read — canonical posts live on the Agentic Architect blog . 7 daily senior rules Rule 8: CancellationToken Propagation Sun 18 Oct Every async method in your codebase should accept and forward a CancellationToken. Make it a rule that any new async signature without one is flagged. Stops…

On Monday, October 12, 2026, senior C#/.NET engineers were reminded that Controllers should not contain database logic. All IQueryable access must remain in the Infrastructure layer to keep business logic pure and readable for the LLM.

Tuesday brought the importance of structured logging. Log messages must use ILogger with structured templates, steering clear of string interpolation. This ensures that when logs are fed back into Cursor for debugging, the AI can recognize the patterns instantly.

Wednesday reminded engineers to enforce FluentValidation rules on every MediatR Request. The AI must check the validator before writing handler logic, preventing "context rot" where the AI forgets business constraints.

Thursday saw the recommendation to use MapGroup and EndPoints for .NET 9 services. This keeps the context window lean and focused, allowing the AI to provide more accurate code suggestions compared to massive, bloated Controllers.

Friday emphasized the need to inject a TimeProvider, such as IClock, instead of letting Cursor hardcode DateTime.Now or DateTime.UtcNow in business logic. This makes time deterministic for tests and stops the AI from relying on static APIs when generating time-aware code.

On Saturday, October 17, the importance of using IHttpClientFactory was highlighted. Refusing to use new HttpClient() in any generated code and forcing Cursor to inject IHttpClientFactory or a typed client prevents classic socket-exhaustion bugs that AI-generated code might unintentionally introduce.

Finally, on Sunday, October 18, the rule about CancellationToken propagation was enforced. Every async method in the codebase should accept and forward a CancellationToken, preventing the AI from quietly losing cancellation half-way down a call chain.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I built an attention head out of a 1982 associative memory and measured where it breaks

The second-biggest story on Hacker News this morning (590 points) is titled "You could have invented transformers from memory" — the argument, in one line, is that attention is what you get when you…

  • Attention in neural networks can be understood as a differentiated version of associative memory.
  • Hopfield network and attention head were implemented in the same code to test the claim.
  • Associative memory degrades gradually with increasing patterns and poor input cue quality.

Five Agents, One Dev Database: Clone a Postgres per Worktree With Postgres 18

Book: Database Playbook Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship…

  • Five agents cloned Postgres databases per worktree in Postgres 18.
  • Each worktree had its own database copy using filecopymethod.
  • Clone command created databases named after worktree branches.

More from Sunday 18 October →