Shiny: preserve requirements through advanced agent edits
Work through R examples of real application boundaries: Check Shiny session authorization inside the write observer; Remove Shiny’s session-owned temporary files on session end. Each recipe includes implementation code, integration prerequisites, failure-path tests to add, a Perch rule, and the captured broken/fixed source checks.
Download the Shiny rule pack ZIP · Inspect the YAML rules
R
A hidden button is not permission enforcement. A Shiny observer can be triggered by a client input, so the write boundary must check the session’s verified permission and carry its tenant/user scope into the persistence adapter.
Broken edit flagged · corrected edit passes
R
Session reports can contain private data and consume disk after the browser disconnects. Give each session its own directory and register cleanup with that session’s owner. A shared fixed path permits one session to overwrite or delete another’s report.
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 Shiny documentation · All language and framework recipes