Framework RecipesImplementation, failure path, check

Agent repair workflows by failure

Release resources on success, failure and disposal

Keep release or disposal on every path that ends ownership, including exceptions and cancellation. A successful request alone cannot reveal a connection leak; check the error path and the lifetime of the component that owns the resource.

How do I keep an agent edit from leaking a connection or subscription?

Choose the implementation for your framework. Each linked guide includes the source, integration prerequisites, failure-path tests, saved requirement and recorded check.

Existing captured source checks; these are individual examples
ImplementationSaved requirementBroken sourceCorrected sourceCapture date
Return the PostgreSQL client after every Express transaction outcometransaction-releases-clientRule findingNo rule finding2026-10-14
Dispose Qt network replies after their completion signalreply-has-deferred-deletionRule findingNo rule finding2026-10-14
Dispose Vue realtime subscriptions when the owner disappearsfeed-scope-disposes-resourcesRule findingNo rule finding2026-10-14
Cancel Flutter timers and streams when the screen is disposedscreen-disposes-owned-workRule findingNo rule finding2026-10-14

Inspect the requirement before installing it

The Return the PostgreSQL client after every Express transaction outcome example uses this requirement on transaction.cjs:

- name: transaction-releases-client
  where: "transaction.cjs"
  ensure: >-
    The withTransaction helper returns every acquired PostgreSQL client to its pool by executing client.release() in finally, including when the operation or rollback throws. A finally block containing only a comment leaves the acquired client unreleased.

Exact corrected source and broken edit · Recorded Perch output · Download this requirement

Make the agent check the requirement after its edit

Keep your existing perch.yaml. The scoped rule pack installs the saved requirement under .perch/rules/. Review its file selector and use the implementation’s integration prerequisites before adapting it to your application.

Install Perch and configure your agent

npm install -g @lakeday/perch
perch login
# Choose the setup command for your agent:
perch setup claude-code
# Or: perch setup codex
# Or: perch setup cursor

Check the edit and recheck the repair

curl -fL 'https://reporules.fyi/express/transaction-cleanup/rule-pack.zip' -o requirement.zip
unzip -n requirement.zip
perch check transaction.cjs --rules transaction-releases-client --json
# Read the finding, repair the implementation, then repeat:
perch check transaction.cjs --rules transaction-releases-client --json

Run the same check on the repaired working file before committing. Keep the application regression tests alongside it. Fresh model judgments can vary; an unchanged request can reuse its cached answer. A passing check does not prove application correctness.

Compare the implementations before choosing a rule

Keep the check tied to its source

The table reports saved checks on the exact linked source versions. Adapt the paths, adapters and regression tests to your repository. The example source may differ from the released framework or your service; the recorded outcome belongs to that example.

Other agent-edit failure paths · All framework recipes