{"version":"2.1.265","anchor":"new-as-level-parameter-lets-read-dbwrite-db-simulate-anothe","canonical_anchor":"artifact-db-str-replace-action-is-built-but-flagged-off","heading":"Artifact database gains in-place edits, version checks, and access simulation","tier":"use","area":"Artifacts","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.265\/e\/new-as-level-parameter-lets-read-dbwrite-db-simulate-anothe","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.265","markdown":"### Artifact database gains in-place edits, version checks, and access simulation\n\nArtifact database writes can now edit a field in place, check document versions, and simulate lower access levels\n\n**What**\n\n- The artifact database's write tool gained a `str_replace` operation for editing a string field in place by exact old-text\/new-text match, instead of resending the whole document. It supports `replace_all` to replace every match, and reports clear errors when the match can't be made: `edit_no_match`, `edit_ambiguous`, `edit_field_missing`, `edit_field_not_string`.\n\n- Writes can now use optimistic concurrency: passing `if_version` (`ifVersion`) rejects the write with a `version_mismatch` error if the document changed since it was last read, and write results can report the document's new version number.\n\n- A new `as_level` parameter on `read_db`\/`write_db` lets the caller simulate reading or writing as a lower access level (`interact` or `admin`), to check what a less-privileged user would be allowed to do, without actually lowering the caller's own access.\n\n- `str_replace` is threaded through both the single-write and batch (`write_db`\/`batch`) code paths, and is currently gated off by default behind a feature flag (requiring both the artifact database and a dedicated str-replace flag to be enabled).\n\n**Why**\n\nThese changes let Claude make small, precise edits to artifact database records instead of rewriting entire documents, avoid clobbering concurrent changes via version checks, and preview permission outcomes for other access levels before acting.\n\n- Area: Artifacts\n- Names: `as_level`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 4\/5"}