Source: https://frameworkrecipes.dev/nestjs/

# NestJS: preserve requirements through advanced agent edits

Work through TypeScript examples of real application boundaries: Reject unlisted NestJS mutation fields at the validation pipe; Keep NestJS event persistence on the supplied TypeORM transaction manager. Each recipe includes implementation code, integration prerequisites, failure-path tests to add, a Perch rule, and the captured broken/fixed source checks.

[Download the NestJS rule pack ZIP](https://reporules.fyi/nestjs/rule-pack.zip) · [Inspect the YAML rules](https://reporules.fyi/nestjs/rules.yaml)

TypeScript

## [Reject unlisted NestJS mutation fields at the validation pipe](https://frameworkrecipes.dev/nestjs/strict-input-boundary/)

A TypeScript DTO describes types to the compiler, not runtime JSON. A ValidationPipe with decorated DTO classes establishes a request boundary. Rejecting unexpected fields makes an attempted privileged assignment visible to the caller and tests.

Broken edit flagged · corrected edit passes

TypeScript

## [Keep NestJS event persistence on the supplied TypeORM transaction manager](https://frameworkrecipes.dev/nestjs/outbox-transaction-manager/)

TypeORM’s global manager can run outside the transaction callback’s connection. That can leave an event committed without its business change or a change committed without its event. Keep every related read and write on the manager supplied to the callback.

Broken edit flagged · corrected edit passes

## Use a correction as a saved requirement

Choose the failure you need to prevent, add the scoped rule to your repository, and check both the broken and corrected implementation. Ask your agent to inspect the finding, repair the code and recheck the same rule. Keep framework tests beside the model check.

Perch keeps the requirement beside the code. Reuse the named check during the agent’s next edit and in CI, with cached answers free on unchanged requests.

[Official NestJS documentation](https://docs.nestjs.com/) · [All language and framework recipes](https://frameworkrecipes.dev/)

**Framework Recipes**

Implementation, failure path, check.

Published by Perch · © 2026 Verglas LLC. Framework Recipes is a Perch publication.

Perch’s MIT license covers the CLI; hosted model analysis is a paid service. Relevant source is sent to the configured model service.

[Perch CLI MIT license](https://github.com/lakeday-org/perch/blob/main/LICENSE) · [Article text](https://frameworkrecipes.dev/nestjs/index.md) · [Resource index](https://frameworkrecipes.dev/llms.txt)
