Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
485 commits
Select commit Hold shift + click to select a range
2ea542b
Merge the not-ready restore
varunj-msft Nov 10, 2026
9fca651
Merge the not-ready restore
varunj-msft Nov 10, 2026
0ba47e8
Merge the not-ready restore
varunj-msft Nov 10, 2026
130f6e2
Merge the not-ready restore
varunj-msft Nov 10, 2026
f1ff143
Keep an "@" in a URL's path when redacting URLs in text
richlundeen Nov 10, 2026
009e761
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
21f22a4
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
e9103ff
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
57b069a
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
7c88228
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
616a7df
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
fede632
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
aaae79f
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
9214fa1
Merge the restore read and redaction fixes
varunj-msft Nov 10, 2026
cc4ae4d
Merge main
varunj-msft Nov 10, 2026
9f4c71e
Merge main
varunj-msft Nov 10, 2026
5121026
Merge main
varunj-msft Nov 10, 2026
d15f7fd
Merge main
varunj-msft Nov 11, 2026
84ad3fe
Merge main
varunj-msft Nov 11, 2026
ddfe03c
Merge main
varunj-msft Nov 11, 2026
7104a25
Merge main
varunj-msft Nov 11, 2026
b01bd1a
Merge main
varunj-msft Nov 11, 2026
2554f78
Merge main
varunj-msft Nov 11, 2026
be0b885
Use the dialog's save button in the new tests from main
varunj-msft Nov 11, 2026
7b08ca0
Press the hidden-targets button in the saved-by test
varunj-msft Nov 11, 2026
6c8d33a
Merge the dialog test fixes
varunj-msft Nov 11, 2026
cabb56f
Merge the dialog test fixes
varunj-msft Nov 11, 2026
b709141
Merge the dialog test fixes
varunj-msft Nov 11, 2026
2cff4c4
Merge the dialog test fixes
varunj-msft Nov 11, 2026
187191c
Answer suite readiness storage failures through the shared storage ha…
varunj-msft Nov 11, 2026
ee8162c
Give the HTTPTarget save test the connection field a create now needs
varunj-msft Nov 11, 2026
bb2a620
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
db7451a
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
b200c92
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
4c42a6b
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
43096e8
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
22b057c
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
9909158
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
77b80f4
Merge the readiness and save test fixes
varunj-msft Nov 11, 2026
374c620
Merge main
varunj-msft Nov 11, 2026
7ac059c
Answer suite readiness storage failures through the shared storage ha…
varunj-msft Nov 11, 2026
dc0dda8
Press the dialog's save button in the nullable parameters test from main
varunj-msft Nov 11, 2026
e08b67a
Merge main
varunj-msft Nov 11, 2026
7fa4ca4
Expect storage errors from main's version-checked delete tests the wa…
varunj-msft Nov 11, 2026
9bf5886
Merge main
varunj-msft Nov 11, 2026
626d2d4
Merge main
varunj-msft Nov 11, 2026
4a86017
Merge main
varunj-msft Nov 11, 2026
9568edb
Merge main
varunj-msft Nov 11, 2026
54e4374
Merge main
varunj-msft Nov 11, 2026
0d97131
Merge main
varunj-msft Nov 11, 2026
2849ae8
Merge main
varunj-msft Nov 11, 2026
c9f0f7b
Merge main
varunj-msft Nov 11, 2026
ace84a9
Merge main
varunj-msft Nov 11, 2026
e34258c
Fit the explicit-target E2E from main to the dialog's save button and…
varunj-msft Nov 11, 2026
bf91430
Merge the explicit-target E2E fix
varunj-msft Nov 11, 2026
a9dccb3
Merge the explicit-target E2E fix
varunj-msft Nov 11, 2026
9e96747
Merge the explicit-target E2E fix
varunj-msft Nov 11, 2026
e738666
Merge the explicit-target E2E fix
varunj-msft Nov 11, 2026
c506195
Merge main
varunj-msft Nov 11, 2026
1ba526f
Merge main
varunj-msft Nov 11, 2026
9cdf7e7
Merge main
varunj-msft Nov 11, 2026
40d36ed
Merge main
varunj-msft Nov 11, 2026
6a52054
Merge main
varunj-msft Nov 11, 2026
23a7ec1
Merge main
varunj-msft Nov 11, 2026
70fbc3d
Merge main
varunj-msft Nov 11, 2026
a1e79d1
Merge main
varunj-msft Nov 11, 2026
a5d42d1
Merge main
varunj-msft Nov 11, 2026
2402df2
Merge main
varunj-msft Nov 11, 2026
1b2ea03
Merge main
varunj-msft Nov 11, 2026
10c488f
Merge main
varunj-msft Nov 11, 2026
8c517d0
Use the dialog's save button in main's endpoint tests
varunj-msft Nov 11, 2026
1137977
Merge the endpoint test fix
varunj-msft Nov 11, 2026
aaefa8f
Merge the endpoint test fix
varunj-msft Nov 11, 2026
6356a56
Merge the endpoint test fix
varunj-msft Nov 11, 2026
9f3e096
Merge the endpoint test fix
varunj-msft Nov 11, 2026
0e7a21f
Exempt the storage error handler from the keyword-only check
varunj-msft Nov 11, 2026
891e8d6
Make get_target's parameters keyword-only
varunj-msft Nov 11, 2026
c35fa01
Merge keyword-only fixes
varunj-msft Nov 11, 2026
953dcce
Merge keyword-only fixes
varunj-msft Nov 11, 2026
d6079a1
Merge keyword-only fixes
varunj-msft Nov 11, 2026
21556ed
Merge keyword-only fixes
varunj-msft Nov 11, 2026
14004e9
Merge keyword-only fixes
varunj-msft Nov 11, 2026
3abc824
Merge keyword-only fixes
varunj-msft Nov 11, 2026
623fd40
Merge keyword-only fixes
varunj-msft Nov 11, 2026
2d74284
Merge keyword-only fixes
varunj-msft Nov 11, 2026
1fc386a
Merge keyword-only fixes
varunj-msft Nov 11, 2026
ee0a223
Merge keyword-only fixes
varunj-msft Nov 11, 2026
779f0c7
Merge keyword-only fixes
varunj-msft Nov 11, 2026
bf97225
Log every problem with a saved file that isn't valid
varunj-msft Nov 11, 2026
5e6faed
Merge the full schema-validation log
varunj-msft Nov 11, 2026
7625f89
Merge the full schema-validation log
varunj-msft Nov 11, 2026
8dbd4c2
Merge the full schema-validation log
varunj-msft Nov 11, 2026
5c7223a
Merge the full schema-validation log
varunj-msft Nov 11, 2026
8676ee5
Merge the full schema-validation log
varunj-msft Nov 11, 2026
74e1310
Merge the full schema-validation log
varunj-msft Nov 11, 2026
072a560
Merge the full schema-validation log
varunj-msft Nov 11, 2026
32e088c
Merge the full schema-validation log
varunj-msft Nov 11, 2026
35199cc
Leave the error behind a storage failure out of the logs
varunj-msft Nov 12, 2026
efcdfa9
Test a blob upload that fails with a transport or authentication error
varunj-msft Nov 12, 2026
0fdebdc
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
c413994
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
c057e30
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
dc97ec7
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
a9478df
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
dc0c058
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
8f27c91
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
4f2208d
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
d22d466
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
167dd8e
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
dfc704c
Merge the storage log and restore report fixes
varunj-msft Nov 12, 2026
c9b795a
Merge main
varunj-msft Nov 12, 2026
38c981c
Merge main
varunj-msft Nov 12, 2026
eb71448
Merge main
varunj-msft Nov 12, 2026
1be067e
Merge main
varunj-msft Nov 12, 2026
162fc2a
Merge main
varunj-msft Nov 12, 2026
6c0c3dd
Merge main
varunj-msft Nov 12, 2026
3d0950d
Merge main
varunj-msft Nov 12, 2026
8b59c5d
Merge main
varunj-msft Nov 12, 2026
d1504ec
Merge main
varunj-msft Nov 12, 2026
457563c
Merge main
varunj-msft Nov 12, 2026
8353569
Merge main
varunj-msft Nov 12, 2026
1214160
Merge main
varunj-msft Nov 12, 2026
4e8d9c2
Return 409 when a suite's launch scripts would replace a saved entry
varunj-msft Nov 12, 2026
b1bbbe6
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
9ce29cb
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
4e0e640
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
0b9efb3
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
28c9398
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
359553a
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
dcc24fd
Merge the suite launch conflict status
varunj-msft Nov 12, 2026
15e00de
Merge main
varunj-msft Nov 12, 2026
0c5baa8
Merge main
varunj-msft Nov 12, 2026
a3f65ad
Merge main
varunj-msft Nov 12, 2026
dd7358b
Merge main
varunj-msft Nov 12, 2026
fc37262
Merge main
varunj-msft Nov 12, 2026
8618ce3
Merge main
varunj-msft Nov 12, 2026
836d0a3
Merge main
varunj-msft Nov 12, 2026
d4337d8
Merge main
varunj-msft Nov 12, 2026
48bc6d1
Merge main
varunj-msft Nov 12, 2026
9789264
Merge main
varunj-msft Nov 12, 2026
42b9853
Merge main
varunj-msft Nov 12, 2026
fd7a648
Merge main
varunj-msft Nov 12, 2026
9d5293a
Merge main
varunj-msft Nov 12, 2026
81008a4
Merge main
varunj-msft Nov 12, 2026
805ca2a
Merge main into part 7
varunj-msft Nov 13, 2026
b9c50e1
Merge part 7 into part 8
varunj-msft Nov 13, 2026
5363c0b
Merge part 8 into part 9
varunj-msft Nov 13, 2026
d50f393
Merge part 9 into part 10
varunj-msft Nov 13, 2026
1c80cf5
Merge part 10 into part 11
varunj-msft Nov 13, 2026
84c564c
Merge part 11 into part 12
varunj-msft Nov 13, 2026
e33ca58
Merge part 12 into part 13
varunj-msft Nov 13, 2026
cdbe6ad
Keep the recipe storage setup apart from the saved target requirements
varunj-msft Nov 13, 2026
450b1e5
Merge part 7 into part 8
varunj-msft Nov 13, 2026
699ab5b
Move saving a target into the registry library
varunj-msft Nov 13, 2026
7d914b1
Merge part 8 into part 9
varunj-msft Nov 13, 2026
b008ce5
Merge part 9 into part 10
varunj-msft Nov 13, 2026
47ba126
Merge part 10 into part 11
varunj-msft Nov 13, 2026
59794d4
Merge part 11 into part 12
varunj-msft Nov 13, 2026
713f7d1
Merge main into part 8
varunj-msft Nov 13, 2026
793316a
Merge part 8 into part 9
varunj-msft Nov 13, 2026
4ca4f25
Merge part 9 into part 10
varunj-msft Nov 13, 2026
e4f32e3
Merge part 10 into part 11
varunj-msft Nov 13, 2026
1dbebcb
Merge part 11 into part 12
varunj-msft Nov 13, 2026
922696b
Merge part 12 into part 13
varunj-msft Nov 13, 2026
2e2e85d
Merge main into part 11
varunj-msft Nov 13, 2026
a2ce936
Merge part 11 into part 12
varunj-msft Nov 13, 2026
33f082b
Merge part 12 into part 13
varunj-msft Nov 13, 2026
048283e
Merge main into part 8
varunj-msft Nov 13, 2026
6c243b6
Merge part 8 into part 9
varunj-msft Nov 13, 2026
1411c5d
Merge part 9 into part 10
varunj-msft Nov 13, 2026
b248a32
Merge part 10 into part 11
varunj-msft Nov 13, 2026
c283787
Merge part 11 into part 12
varunj-msft Nov 13, 2026
3905a7e
Merge part 12 into part 13
varunj-msft Nov 13, 2026
f273bff
Merge main into part 8
varunj-msft Nov 14, 2026
d692b25
Merge main into part 9
varunj-msft Nov 14, 2026
dc2a52c
Merge main into part 10
varunj-msft Nov 14, 2026
24bf3b2
Merge main into part 11
varunj-msft Nov 14, 2026
c983027
Merge main into part 12
varunj-msft Nov 14, 2026
ddca4a1
Merge main into part 13
varunj-msft Nov 14, 2026
54d9332
Check saved entries against restore's inputs and settle cancelled saves
varunj-msft Nov 14, 2026
0529525
Merge part 8 into part 9
varunj-msft Nov 14, 2026
d0bb066
Ask the backend whether a target's values can be saved
varunj-msft Nov 14, 2026
eef542d
Merge part 9 into part 10, keeping who saved a target in capability d…
varunj-msft Nov 14, 2026
3de68f9
Merge part 10 into part 11
varunj-msft Nov 14, 2026
f9d8ee6
Merge part 11 into part 12
varunj-msft Nov 14, 2026
83408f9
Expect the cause in the converter storage failure log
varunj-msft Nov 14, 2026
05fe656
Merge part 12 into part 13
varunj-msft Nov 14, 2026
c05e125
Check saveability with a request that registers nothing
varunj-msft Nov 14, 2026
0d6cc7a
Merge part 9 into part 10
varunj-msft Nov 14, 2026
0310478
Merge part 10 into part 11
varunj-msft Nov 14, 2026
a2f1834
Merge part 11 into part 12
varunj-msft Nov 14, 2026
188ee22
Merge part 12 into part 13
varunj-msft Nov 14, 2026
e47689c
Wrap the saveability note in the backend README
varunj-msft Nov 14, 2026
3a81a37
Merge part 10
varunj-msft Nov 14, 2026
b3af544
Merge part 11
varunj-msft Nov 14, 2026
fbaec87
Merge part 12
varunj-msft Nov 14, 2026
e4c28ca
Merge part 13
varunj-msft Nov 14, 2026
e6cfbd9
Answer the saveability check in the numeric controls end-to-end mocks
varunj-msft Nov 14, 2026
192552a
Merge part 10
varunj-msft Nov 14, 2026
bd98bb1
Merge part 11
varunj-msft Nov 14, 2026
941d5dc
Merge part 12
varunj-msft Nov 14, 2026
b3ef7f5
Merge part 13
varunj-msft Nov 14, 2026
87de386
Bound the URL scheme when redacting text
varunj-msft Nov 14, 2026
96361e5
Merge part 9
varunj-msft Nov 14, 2026
e1ab38a
Merge part 10
varunj-msft Nov 14, 2026
977ad50
Merge part 11
varunj-msft Nov 14, 2026
351419b
Merge part 12
varunj-msft Nov 14, 2026
edbc24a
Merge part 13
varunj-msft Nov 14, 2026
33650ff
Merge main into part 8
varunj-msft Nov 17, 2026
87a4abf
Merge main into part 9
varunj-msft Nov 17, 2026
b369843
Merge main into part 9
varunj-msft Nov 17, 2026
00adffb
Merge main into part 10
varunj-msft Nov 17, 2026
5f1871b
Merge main into part 11
varunj-msft Nov 17, 2026
0000312
Merge main into part 12
varunj-msft Nov 17, 2026
abfe8ec
Merge main into part 13
varunj-msft Nov 17, 2026
ed3141f
Merge main into part 9
varunj-msft Nov 18, 2026
f691ba6
Keep saveability available as a target name
varunj-msft Nov 18, 2026
0bba24f
Merge main into part 10
varunj-msft Nov 18, 2026
1ac1352
Merge main into part 11
varunj-msft Nov 18, 2026
a9fcd3e
Merge main into part 12
varunj-msft Nov 18, 2026
73f3098
Merge main into part 13
varunj-msft Nov 18, 2026
2c15d96
Merge main into part 9
varunj-msft Nov 19, 2026
d055396
Keep the class save rule in the library and answer with the cause alone
varunj-msft Nov 19, 2026
ca4324b
Create targets only you can use, or that allow credential updates, as…
varunj-msft Nov 19, 2026
d331b4a
Take out who saved each target
varunj-msft Nov 19, 2026
6a22e0d
Merge part 9 into part 11
varunj-msft Nov 19, 2026
b2ad86f
Expect a class's own reason when it can't be saved
varunj-msft Nov 19, 2026
a05c3cd
Merge part 11 into part 12
varunj-msft Nov 19, 2026
2067564
Merge part 12 into part 13
varunj-msft Nov 19, 2026
4513dcc
Answer a taken converter name with 409 whether or not it's saved
varunj-msft Nov 19, 2026
39bd5ab
Show why a converter can't be saved next to its buttons, giving the c…
varunj-msft Nov 19, 2026
0be207e
Merge part 12 into part 13
varunj-msft Nov 19, 2026
d9a66f6
Give each reason a target stays Temporary as its cause only, and drop…
varunj-msft Nov 19, 2026
8bc4161
Say the saveability check runs create's checks on the type, parameter…
varunj-msft Nov 19, 2026
9eff025
Merge part 9 into part 11
varunj-msft Nov 19, 2026
b1b9bd3
Merge part 11 into part 12
varunj-msft Nov 19, 2026
0105ade
Give the default-reference and uploaded-file refusals as their cause …
varunj-msft Nov 19, 2026
33f634e
Merge part 12 into part 13
varunj-msft Nov 19, 2026
06f48c0
Give the uploaded-file reason in the converter dialog as its cause only
varunj-msft Nov 19, 2026
fa087b1
Merge main into part 9
varunj-msft Nov 19, 2026
0dc92aa
Merge main into part 9
varunj-msft Nov 19, 2026
d45e575
Merge part 9 into part 11
varunj-msft Nov 19, 2026
d6ec40b
Merge part 11 into part 12
varunj-msft Nov 19, 2026
8b8b0c5
Merge part 12 into part 13
varunj-msft Nov 19, 2026
77e2514
Merge main into part 11
varunj-msft Nov 19, 2026
d600c7d
Merge part 11 into part 12
varunj-msft Nov 19, 2026
1abd9d3
Merge part 12 into part 13
varunj-msft Nov 19, 2026
4ff636f
Let saved converters and scorers use this server's credentials
varunj-msft Nov 20, 2026
9496042
Merge part 12 into part 13
varunj-msft Nov 20, 2026
4798fcb
Drop the Azure Speech converters from the converter types that can't …
varunj-msft Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/getting_started/pyrit_conf.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ A SAS query string may be included; otherwise, PyRIT uses `DefaultAzureCredentia

### `registry_recipes_source`

Stores saved targets, converters, scorers, and techniques in a local directory or Azure Blob container, so they come back when the backend restarts. Targets created through `POST /api/targets` with `"persist": true` are saved here. An Azure URI may include a blob-name prefix:
Stores saved targets, converters, scorers, and techniques in a local directory or Azure Blob container, so they come back when the backend restarts. Targets, converters, and scorers created through `POST /api/targets`, `POST /api/converters`, and `POST /api/scorers` with `"persist": true` are saved here. An Azure URI may include a blob-name prefix:

```yaml
registry_recipes_source: https://account.blob.core.windows.net/pyrit-storage/registry-recipes
Expand Down
16 changes: 14 additions & 2 deletions doc/gui/0_gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ Expand a target, scorer, technique, or converter name to inspect its identity
JSON. Target identity inspection is independent of expanding composite target
members; defaults, visibility, and the target's configuration columns remain
available. Converter inputs and outputs stay visible in the table. Use the small
red X to remove a converter from the live registry; confirmation is required.
red X to remove a converter from the live registry; confirmation is required. A
saved converter can't be removed there yet: delete its file
(`converters/<name>.json`) in `registry_recipes_source`, then restart the backend.

**Scenario presets** save a scenario configuration for reuse with a target
chosen at launch. **Suites** maintain ordered collections of preset definitions.
Expand Down Expand Up @@ -239,7 +241,17 @@ A Temporary target is gone after the backend restarts or is reinitialized.
The Targets table labels each target **Saved**, **From configuration**
(registered by an initializer at startup), or **Temporary**.

Converters and techniques added only to the live registry must be recreated
New converters are saved the same way, wherever you add one: **New Converter** in
the Converters tab, the converter panel in chat, or **New converter** in the
technique editor. The dialog suggests a name such as `base64_converter`. A
converter type that needs an uploaded file, a converter with an uploaded file, or
one that uses a Temporary target is created as **Temporary** instead, and the
dialog says why.
**Save to registry** on a converter's changed settings, in chat or in a technique
edit, makes a Temporary copy. The Converters and Scorers tables use the same three
labels; scorers can be saved through the API.

Techniques added only to the live registry must be recreated
after a backend restart or reinitialization. Use
[initializers](../code/setup/0_setup.md) for repeatable component setup.

Expand Down
123 changes: 97 additions & 26 deletions frontend/e2e/registry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,33 @@ test("creates and selects a runtime technique with the real backend @seeded", as
expect(promptRequests).toEqual([]);
});

test("saves a converter from the New Converter dialog and still lists it as Saved after a reload @seeded", async ({ page, request }) => {
const name = `saved_caesar_${Date.now()}`;
await page.goto("/registry/converters");
await page.getByRole("button", { name: "New Converter" }).click();
const dialog = page.getByRole("dialog");
await dialog.getByRole("combobox", { name: "Converter type" }).click();
await page.getByTestId("converter-type-option-CaesarConverter").click();
await expect(dialog.getByRole("textbox", { name: "Registry name", exact: true })).toHaveValue(/^caesar_converter/);
await dialog.getByRole("textbox", { name: "Registry name", exact: true }).fill(name);
await dialog.getByRole("textbox", { name: "caesar_offset *", exact: true }).fill("5");
await expect(dialog.getByText("This converter can't be saved")).toHaveCount(0);
await dialog.getByRole("button", { name: "Save Converter" }).click();
await expect(dialog).toHaveCount(0);

const row = page.getByRole("row", { name: new RegExp(name) });
await expect(row.getByText("Saved", { exact: true })).toBeVisible();
await expect(row.getByRole("button", { name: `Remove ${name}` })).toHaveAttribute("aria-disabled", "true");
const saved = await request.get(`/api/converters/${name}`, { headers: compatibilityHeaders() });
expect(saved.ok(), await saved.text()).toBe(true);
expect((await saved.json()).origin).toBe("saved");
const removal = await request.delete(`/api/converters/${name}`, { headers: compatibilityHeaders() });
expect(removal.status()).toBe(409);

await page.reload();
await expect(page.getByRole("row", { name: new RegExp(name) }).getByText("Saved", { exact: true })).toBeVisible();
});

test("saves a target from the New Target dialog and still lists it as Saved after a reload @seeded", async ({ page, request }) => {
const name = `saved_chat_${Date.now()}`;
await page.goto("/registry/targets");
Expand Down Expand Up @@ -180,6 +207,7 @@ interface RegisteredConverter {
};
is_llm_based: boolean;
description?: string;
origin?: "saved" | "configuration" | "temporary";
}

const CONVERTER_TYPES = {
Expand Down Expand Up @@ -219,6 +247,15 @@ const CONVERTER_TYPES = {
is_llm_based: true,
description: "Rewrites prompts.",
},
{
converter_type: "TemporaryOnlyConverter",
supported_input_types: ["text"],
supported_output_types: ["text"],
parameters: [],
is_llm_based: false,
description: "A converter type that can't be saved.",
not_saveable_reason: "It needs an uploaded file, which saved converters can't keep yet.",
},
...Array.from({ length: 16 }, (_, index) => ({
converter_type: `ViewportConverter${index}`,
supported_input_types: ["text"],
Expand Down Expand Up @@ -294,6 +331,14 @@ async function installRegistryMocks(page: Page): Promise<void> {
return;
}
const converterId = decodeURIComponent(route.request().url().split("/").pop() ?? "");
if (registeredConverters.some((converter) => converter.converter_id === converterId && converter.origin === "saved")) {
await route.fulfill({
status: 409,
contentType: "application/json",
body: JSON.stringify({ detail: `Saved converter '${converterId}' can't be removed yet.` }),
});
return;
}
registeredConverters = registeredConverters.filter(
(converter) => converter.converter_id !== converterId,
);
Expand Down Expand Up @@ -325,6 +370,7 @@ async function installRegistryMocks(page: Page): Promise<void> {
},
is_llm_based: converterType?.is_llm_based ?? false,
description: converterType?.description,
origin: body.persist ? "saved" : "temporary",
};
registeredConverters.push(converter);
await route.fulfill({
Expand All @@ -349,17 +395,17 @@ async function submitDuplicateName(page: Page): Promise<() => void> {
status: 409,
contentType: "application/json",
body: JSON.stringify({
detail: "Converter instance 'caesar-custom' already exists",
detail: "Converter instance 'caesar_custom' already exists",
}),
});
});

await page.getByRole("button", { name: "Create First Converter" }).click();
await page.getByRole("combobox", { name: "Converter type" }).click();
await page.getByTestId("converter-type-option-CaesarConverter").click();
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill("caesar-custom");
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill("caesar_custom");
await page.getByRole("textbox", { name: "caesar_offset *", exact: true }).fill("5");
await page.getByRole("button", { name: "Add Converter" }).click();
await page.getByRole("button", { name: "Save Converter" }).click();
await expect(page.getByRole("button", { name: "Adding..." })).toBeVisible();

return () => releaseCreate?.();
Expand All @@ -370,7 +416,15 @@ async function createCaesarConverter(page: Page, name: string): Promise<void> {
await page.getByTestId("converter-type-option-CaesarConverter").click();
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill(name);
await page.getByRole("textbox", { name: "caesar_offset *", exact: true }).fill("5");
await page.getByRole("button", { name: "Add Converter" }).click();
await page.getByRole("button", { name: "Save Converter" }).click();
}

async function createTemporaryConverter(page: Page, name: string): Promise<void> {
await page.getByRole("combobox", { name: "Converter type" }).click();
await page.getByTestId("converter-type-option-TemporaryOnlyConverter").click();
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill(name);
await expect(page.getByRole("status")).toContainText("This converter can't be saved");
await page.getByRole("button", { name: "Create as Temporary" }).click();
}

async function submitSlowCreate(page: Page, name: string): Promise<() => void> {
Expand Down Expand Up @@ -404,25 +458,43 @@ test.describe("Converter Registry", () => {
await page.goto("/registry/converters");
});

test("adds and removes a named converter without an active action", async ({ page }) => {
test("adds and removes a Temporary converter without an active action", async ({ page }) => {
await expect(page.getByRole("heading", { name: "Converter Registry" })).toBeVisible();
await expect(page.getByRole("region", { name: "Target defaults" })).toHaveCount(0);

await page.getByRole("button", { name: "New Converter" }).click();
await page.getByRole("combobox", { name: "Converter type" }).click();
await page.getByTestId("converter-type-option-CaesarConverter").click();
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill("caesar-custom");
await page.getByRole("textbox", { name: "caesar_offset *", exact: true }).fill("5");
await page.getByRole("button", { name: "Add Converter" }).click();
await createTemporaryConverter(page, "temporary_custom");

await expect(page.getByText("caesar-custom")).toBeVisible();
await page.getByRole("button", { name: "Remove caesar-custom" }).click();
const row = page.getByRole("row", { name: /temporary_custom/ });
await expect(row.getByText("Temporary", { exact: true })).toBeVisible();
await page.getByRole("button", { name: "Remove temporary_custom" }).click();
await page.getByRole("button", { name: "Remove", exact: true }).click();

await expect(page.getByText("caesar-custom")).toHaveCount(0);
await expect(page.getByText("temporary_custom")).toHaveCount(0);
await expect(page.getByText("No Converters Registered")).toBeVisible();
});

test("saves a named converter and keeps it from being removed", async ({ page }) => {
await page.getByRole("button", { name: "New Converter" }).click();
const createRequest = page.waitForRequest(
(request) => request.method() === "POST" && /\/api\/converters$/.test(request.url()),
);
await createCaesarConverter(page, "caesar_custom");

expect((await createRequest).postDataJSON()).toEqual({
name: "caesar_custom", type: "CaesarConverter", params: { caesar_offset: 5 }, persist: true,
});
const row = page.getByRole("row", { name: /caesar_custom/ });
await expect(row.getByText("Saved", { exact: true })).toBeVisible();
const remove = page.getByRole("button", { name: "Remove caesar_custom" });
await expect(remove).toHaveAttribute("aria-disabled", "true");
await expect(remove).toHaveAccessibleDescription(
"Saved converters can't be removed here yet. Delete the converter's saved file and restart the backend.",
);
await remove.click({ force: true });
await expect(page.getByRole("dialog")).toHaveCount(0);
});

test("restores focus to the trigger when the add dialog is dismissed", async ({ page }) => {
const trigger = page.getByRole("button", { name: "New Converter" });
await trigger.click();
Expand All @@ -439,13 +511,13 @@ test.describe("Converter Registry", () => {
await page.getByRole("button", { name: "Create First Converter" }).click();
await page.getByRole("combobox", { name: "Converter type" }).click();
await page.getByTestId("converter-type-option-CaesarConverter").click();
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill("caesar-focus");
await page.getByRole("textbox", { name: "Registry name", exact: true }).fill("caesar_focus");
await page.getByRole("textbox", { name: "caesar_offset *", exact: true }).fill("5");
await page.getByRole("button", { name: "Add Converter" }).click();
await page.getByRole("button", { name: "Save Converter" }).click();

// The empty-state trigger unmounts with the list it belonged to, so focus
// falls back to the always-mounted header action.
await expect(page.getByText("caesar-focus")).toBeVisible();
await expect(page.getByText("caesar_focus")).toBeVisible();
await expect(page.getByRole("button", { name: "New Converter" })).toBeFocused();
});

Expand All @@ -463,13 +535,12 @@ test.describe("Converter Registry", () => {
release();
});

test("moves focus to the error when the registry rejects the name", async ({ page }) => {
test("moves focus to the name when the registry says it is taken", async ({ page }) => {
const release = await submitDuplicateName(page);
release();

const alert = page.getByRole("alert");
await expect(alert).toContainText(/already exists/i);
await expect(alert).toBeFocused();
await expect(page.getByRole("alert")).toContainText(/already exists/i);
await expect(page.getByRole("textbox", { name: "Registry name", exact: true })).toBeFocused();

// Escape only reaches the dialog surface while focus is still inside it.
await page.keyboard.press("Escape");
Expand All @@ -478,20 +549,20 @@ test.describe("Converter Registry", () => {

test("leaves the removal dialog in place when a dismissed creation succeeds", async ({ page }) => {
await page.getByRole("button", { name: "Create First Converter" }).click();
await createCaesarConverter(page, "caesar-first");
await expect(page.getByText("caesar-first")).toBeVisible();
await createTemporaryConverter(page, "temporary_first");
await expect(page.getByText("temporary_first")).toBeVisible();

const release = await submitSlowCreate(page, "caesar-late");
const release = await submitSlowCreate(page, "caesar_late");
await page.keyboard.press("Escape");
await expect(page.getByRole("dialog")).toBeHidden();

const removeTrigger = page.getByRole("button", { name: "Remove caesar-first" });
const removeTrigger = page.getByRole("button", { name: "Remove temporary_first" });
await removeTrigger.click();
const removeDialog = page.getByRole("dialog");
await expect(removeDialog).toBeVisible();

release();
await expect(page.getByText("caesar-late")).toBeVisible();
await expect(page.getByText("caesar_late")).toBeVisible();

// Moving focus out makes Tabster mark the still-visible dialog aria-hidden,
// and Escape then stops dismissing it, so the late response has to leave
Expand All @@ -516,7 +587,7 @@ test.describe("Converter Registry", () => {

// The request settles either way; only its failure is dropped, so the
// reopened dialog keeps the empty form the user opened.
await expect(dialog.getByRole("button", { name: "Add Converter" })).toBeEnabled();
await expect(dialog.getByRole("button", { name: "Save Converter" })).toBeEnabled();
await expect(page.getByRole("alert")).toHaveCount(0);
await expect(dialog.getByRole("textbox", { name: "Registry name", exact: true })).toHaveValue("");
});
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/Config/CreateTargetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
targetType as getTargetType,
targetUnderlyingModelName,
} from '@/utils/targetIdentity'
import { TARGET_ORIGIN_LABELS } from '@/utils/targetOrigin'
import { ORIGIN_LABELS } from '@/utils/registryOrigin'
import { useCreateTargetDialogStyles } from './CreateTargetDialog.styles'
import {
canConfigureTargetType,
Expand Down Expand Up @@ -1061,7 +1061,7 @@ export default function CreateTargetDialog({ open, onClose, onCreated, existingT
<option key={t.target_registry_name} value={t.target_registry_name}>
{t.target_registry_name} — {getTargetType(t)}
{targetModelName(t) ? ` (${targetModelName(t)})` : ''}
{t.origin === 'temporary' ? ` · ${TARGET_ORIGIN_LABELS.temporary}` : ''}
{t.origin === 'temporary' ? ` · ${ORIGIN_LABELS.temporary}` : ''}
</option>
))}
</Select>
Expand All @@ -1084,7 +1084,7 @@ export default function CreateTargetDialog({ open, onClose, onCreated, existingT
)
const selectedTargetLabel = `${target?.target_registry_name ?? sel.registryName}${
target && targetModelName(target) ? ` (${targetModelName(target)})` : ''
}${target?.origin === 'temporary' ? ` · ${TARGET_ORIGIN_LABELS.temporary}` : ''}`
}${target?.origin === 'temporary' ? ` · ${ORIGIN_LABELS.temporary}` : ''}`
const weightParse = parseWeight(sel.weightInput)
const weightError = weightParse.ok ? null : weightParse.error
return (
Expand Down
23 changes: 0 additions & 23 deletions frontend/src/components/Config/TargetOriginBadge.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/src/components/Config/TargetTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {

import ContextualHelpLabel from '@/components/ContextualHelpLabel'
import { HELP_DEFINITIONS } from '@/components/helpDefinitions'
import OriginBadge from '@/components/Registry/OriginBadge'
import RegistryIdentityRow from '@/components/Registry/RegistryIdentityRow'
import { useUserPreferences } from '@/hooks/useUserPreferences'
import type { TargetCapabilityDetection } from '@/hooks/useTargetCapabilityDetection'
Expand All @@ -66,7 +67,6 @@ import {
type TargetFilters,
} from './targetFilters'
import TargetFiltersBar from './TargetFiltersBar'
import TargetOriginBadge from './TargetOriginBadge'
import { useTargetTableStyles } from './TargetTable.styles'
import TargetSelect from './TargetSelect'

Expand Down Expand Up @@ -642,7 +642,7 @@ export default function TargetTable({
nameContent={
(target.origin || isDefaultAdversarial(target)) && (
<div className={styles.defaultIndicators}>
{target.origin && <TargetOriginBadge origin={target.origin} />}
{target.origin && <OriginBadge origin={target.origin} />}
{isDefaultAdversarial(target) && (
<Badge appearance="outline" color="brand" size="small" aria-label="Default adversarial target">
Adversarial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ describe('SaveConverterDialog', () => {
jest.mocked(convertersApi.createConverter).mockResolvedValue(saved)
})

it('should say the copy is Temporary, since a copy cannot be saved yet', () => {
render(tree())

expect(
screen.getByText(/The new converter is Temporary: it's gone after the backend restarts or is reinitialized\./),
).toBeInTheDocument()
expect(screen.queryByText(/available until the backend restarts/)).not.toBeInTheDocument()
})

it('should require a name before creating a registry entry', async () => {
const user = userEvent.setup()
render(tree())
Expand Down
Loading
Loading