{"version":"2.1.296","anchor":"artifact-write-emits-a-saved-event-for-local-path","canonical_anchor":"artifact-write-emits-a-saved-event-for-local-path","heading":"project_write errors and refusals now carry reason codes","tier":"notice","area":"Artifacts","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.296\/e\/artifact-write-emits-a-saved-event-for-local-path","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.296","markdown":"### project_write errors and refusals now carry reason codes\n\nproject_write by local_path now attaches machine-readable codes to its errors and refusals, and reports when a file is saved\n\n**What**\n\nThe `project_write` tool, which writes a file into a project, gains structured reporting when it works from a `local_path` (a file on your machine):\n\n- Errors now carry a code next to the message, such as `local_path_outside_cwd`, `local_path_too_long` and `content_has_nul`.\n\n- Refusals carry reason codes such as `local_path_file_too_large`, `local_path_hard_link`, `local_path_protected_file` and `project_knowledge_full`.\n\n- After a successful write with `local_path` set, a `saved` event is emitted with whether an existing file was replaced (`replaced`) and how many bytes were saved (`savedBytes`).\n\n- The outcome of a write by local path (cancelled, refused or failed), its reason, and where the file was read from are now recorded.\n\nThe error and refusal text you see is unchanged.\n\n**Why**\n\nNothing changes in what you see when a write is refused. The codes let failures be told apart and counted reliably instead of by matching message text.\n\n- Area: Artifacts\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}