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 · Inspect the YAML rules
TypeScript
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
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 · All language and framework recipes