feat(core): add bounded key creation contract

Expose create_redis_value through the Tauri bridge, add NX-based string creation in redis-core, and surface duplicate-key handling through stable operator notices.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Senior Frontend Engineer
2026-03-31 10:14:13 +00:00
parent 8b6689c445
commit e83c518081
7 changed files with 288 additions and 8 deletions

View File

@@ -65,6 +65,28 @@ describe("operator notices", () => {
);
});
it("maps duplicate key creation into a stable neutral notice", () => {
expect(
toBackendErrorNotice(
{
code: "already_exists",
message: "Redis key creation does not overwrite an existing key.",
detail: "key `draft:key` already exists",
},
{
operation: "key_create",
connectionName: "redis-local-fixture",
databaseLabel: "db0",
keyName: "draft:key",
},
),
).toEqual(
createNeutralNotice(
"Redis refused to proceed while creating draft:key on redis-local-fixture / db0 because the key already exists. Choose a new key name or inspect the existing key before retrying. Backend detail: Redis key creation does not overwrite an existing key. (key `draft:key` already exists).",
),
);
});
it("describes command failures with command and scope context", () => {
expect(
toBackendErrorNotice(