Question 270
A coding agent edits a generated dist/app.js file despite a path rule forbidding changes to generated output. What additional enforcement is useful?
Explanation
Correct Answer
Text guidance benefits from an execution-level backstop on prohibited paths. Supply the supported regeneration command separately. Generated dist files should be protected at the write boundary, not only described as read-only in a rule. Enforce filesystem or CI guards and direct edits to upstream source that can regenerate the artifact safely. Test alternate write paths including shell redirection. Text emphasis is not an access-control boundary. Promises cannot prevent an unintended write. That breaks build artifact handling.
Incorrect Answers
A stronger instruction can reduce accidental requests but is not an enforcement boundary. An agent can still attempt to modify a tracked generated artifact through Edit, Write, or shell commands despite the reminder. The observed failure is a write that should have been prevented, so the project needs host-side deny rules, filesystem restrictions, or CI checks against protected output paths. Prompt guidance can accompany those controls but cannot replace them.
Git ignore rules govern whether untracked files are offered for version control; they do not make existing tracked files read-only, and they do not prevent a process from changing bytes on disk. If the generated dist/app.js file is already tracked or writable, an agent can still modify it. Enforce the protected output boundary through file permissions, tool-policy restrictions, or CI verification, and regenerate artifacts only through an authorized build pipeline.
Post-build deletion may hide a modified generated artifact from the package, but it does not prevent the unauthorized edit to the working tree or the possibility that other tasks already consumed the changed file. It also risks deleting legitimate build output. The boundary should reject or detect writes to the protected generated directory before acceptance, with a clean rebuild and version-aware review where necessary. Removing a file after the fact is not equivalent to enforcing the no-edit path policy.



Claude Certified Architect - Foundations (CCA-F) Practice Tests