Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions web/packages/studio/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,44 @@ Wrong — transparent dropdown:

Exception: call sites that fill SelectContent with custom children containing their
own background (e.g. a sticky Block with bg-surface) are fine as-is.

### KUI form gotchas — the silent-failure set

Each compiles, lints and typechecks clean, then renders nothing wrong — the element is
simply inert or invisible.

**`slotError` needs `status="error"` to render.** Without a status `FormField` shows
`slotHelp` instead and drops the message. `Controlled*` wrappers set status from
react-hook-form only, so any other error source must set it too (`formFieldProps` spreads
last, so it wins):

```tsx
formFieldProps={{ slotError: fieldError, status: fieldError ? 'error' : undefined }}
```

**`FormModal.disabled` blocks closing.** It means "busy": it kills Cancel and stops
`handleUserClose`, trapping the user. For validation use `submitDisabled`.

```tsx
disabled={isPending} // busy → intentionally locked
submitDisabled={!isValid} // invalid → submit blocked, dismiss still works
```

**`Text` has no `color="danger"`, and `text-danger` is not an emitted utility.** `danger`
exists only on `Button`; the token is `--text-color-feedback-danger`. Devtools showing
**"Inherited from"** means no rule matched at all, not that yours lost a specificity fight.

```tsx
<Text className="text-[var(--text-color-feedback-danger)]">…</Text>
```

**Modals seeded from a prop must re-seed on `open`.** `useForm({ defaultValues })` reads
once at mount; a persistently-rendered modal mounts before the prop exists and keeps the
empty default forever. Callers passing a constant work by accident, so the bug arrives
with the second caller.

```tsx
useEffect(() => {
resetForm(makeDefaultValues(agentProp)); // NOT `if (!open)` — that only resets on close
}, [open, agentProp, resetForm]);
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ llms:
llm:
_type: openai
api_key: not-used
model_name: ${NEMO_DEFAULT_MODEL}
model_name: default/nvidia-nemotron-3-nano-30b-a3b
temperature: 0.0
max_tokens: 1024
workflow:
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,199 +1,60 @@
{
"tasks": [
"dataset": "<workspace>/<fileset>#dataset.jsonl",
"prompt_template": "Subject: {{ item.subject }}\nFrom: {{ item.sender }}\n\n{{ item.body }}",
"metrics": [
{
"id": "email-0",
"intent": "Classify this email as phishing or benign",
"inputs": {
"instruction": "Subject: Claim Your Free iPhone Now!\nFrom: prize@example.com\n\nDear valued customer,\nCongratulations! You have been selected to receive a brand new iPhone absolutely free. To claim your prize, simply click the link below and provide your shipping address.\nhttp://malicious-link.example.com/claim\nThis offer is limited, so act fast!"
},
"reference": {
"label": "phishing"
},
"metadata": [
{
"key": "arrival_time",
"value": "2023-05-14 10:15:30"
},
{
"key": "intents",
"value": "{'money': {'label': 'Money', 'id': 0, 'score': 0.9998}, 'banking': {'label': 'Personal', 'id': 1, 'score': 0.9997}, 'crypto': {'label': 'NonCrypto', 'id': 1, 'score': 0.9996}}"
},
{
"key": "source",
"value": "gift"
},
{
"key": "extra_info",
"value": "unverified"
}
]
},
{
"id": "email-1",
"intent": "Classify this email as phishing or benign",
"inputs": {
"instruction": "Subject: Urgent: Your Account Has Been Suspended\nFrom: security-alerts@bank.com\n\nHello,\nWe have detected unusual activity on your account. To prevent suspension, please verify your identity by clicking the link below and entering your credentials.\nhttp://verify-account.example.com\nIf you do not verify within 24 hours, your account will be disabled.\nThank you,\nSupport Team"
},
"reference": {
"label": "phishing"
},
"metadata": [
{
"key": "arrival_time",
"value": "2023-06-22 14:07:12"
},
{
"key": "intents",
"value": "{'money': {'label': 'Money', 'id': 0, 'score': 0.9999}, 'banking': {'label': 'Personal', 'id': 1, 'score': 0.9999}, 'crypto': {'label': 'NonCrypto', 'id': 1, 'score': 0.9995}}"
},
{
"key": "source",
"value": "password"
},
{
"key": "extra_info",
"value": "suspicious"
}
]
},
{
"id": "email-2",
"intent": "Classify this email as phishing or benign",
"inputs": {
"instruction": "Subject: Important: Invoice Attached\nFrom: accounts@shop-example.com\n\nHi there,\nPlease find the invoice attached for your recent purchase. Click here to view the details.\nhttp://invoice-example.com/view?invoice=12345\nIf you have any questions, feel free to contact us.\nBest regards,\nCustomer Service"
},
"reference": {
"label": "phishing"
},
"metadata": [
{
"key": "arrival_time",
"value": "2023-07-01 09:30:45"
},
{
"key": "intents",
"value": "{'money': {'label': 'Money', 'id': 0, 'score': 0.9997}, 'banking': {'label': 'Personal', 'id': 1, 'score': 0.9998}, 'crypto': {'label': 'NonCrypto', 'id': 1, 'score': 0.9994}}"
},
{
"key": "source",
"value": "money"
},
{
"key": "extra_info",
"value": "pending"
}
]
},
{
"id": "email-3",
"intent": "Classify this email as phishing or benign",
"inputs": {
"instruction": "Subject: Project Meeting Reminder\nFrom: bob@example.com\n\nHi Team,\nJust wanted to remind you about our project update meeting on Friday at 2pm. Please let me know if you can attend.\nThanks!\n-Bob"
},
"reference": {
"label": "benign"
},
"metadata": [
{
"key": "arrival_time",
"value": "2023-08-10 15:30:00"
},
{
"key": "intents",
"value": "{'money': {'label': 'NonMoney', 'id': 1, 'score': 0.9995}, 'banking': {'label': 'NonPersonal', 'id': 1, 'score': 0.9995}, 'crypto': {'label': 'NonCrypto', 'id': 1, 'score': 0.9994}}"
},
{
"key": "source",
"value": "meeting"
},
{
"key": "extra_info",
"value": "trusted"
}
]
},
{
"id": "email-4",
"intent": "Classify this email as phishing or benign",
"inputs": {
"instruction": "Subject: Invoice Follow-up\nFrom: alice@company.com\n\nHi John,\nPlease find the invoice #1234 attached for your recent purchase. Let me know if you have any questions.\nBest regards,\nAlice"
},
"reference": {
"label": "benign"
},
"metadata": [
{
"key": "arrival_time",
"value": "2023-09-01 09:15:22"
},
{
"key": "intents",
"value": "{'money': {'label': 'Money', 'id': 0, 'score': 0.9996}, 'banking': {'label': 'Personal', 'id': 1, 'score': 0.9996}, 'crypto': {'label': 'NonCrypto', 'id': 1, 'score': 0.9993}}"
},
{
"key": "source",
"value": "finance"
},
{
"key": "extra_info",
"value": "trusted"
}
]
}
],
"metric": {
"bundle_kind": "metric-bundle",
"bundle_format_version": "v1",
"metric_type": "llm-judge",
"metadata": {
"description": null,
"labels": {}
},
"outputs": [
{
"name": "accuracy",
"description": null,
"value_json_schema": {
"description": "Continuous numeric metric value.",
"title": "ContinuousScore",
"type": "number"
"bundle_kind": "metric-bundle",
"bundle_format_version": "v1",
"metric_type": "llm-judge",
"metadata": {
"description": "Verdict accuracy vs the dataset's label column.",
"labels": {}
},
"outputs": [
{
"name": "accuracy",
"description": null,
"value_json_schema": {
"description": "Continuous numeric metric value.",
"title": "ContinuousScore",
"type": "number"
}
}
}
],
"secrets": {},
"payload": {
"kind": "inline",
"metric": {
"type": "llm-judge",
"model": "default/nvidia-nemotron-3-super-120b-a12b",
"prompt_template": {
"messages": [
],
"secrets": {},
"payload": {
"kind": "inline",
"metric": {
"type": "llm-judge",
"model": "default/nvidia-nemotron-3-super-120b-a12b",
"prompt_template": {
"messages": [
{
"role": "user",
"content": "You are scoring an email phishing classifier. The expected answer is the ground-truth label: \"{{ item.label }}\". The agent's response may contain reasoning; extract ONLY its final verdict (the last clear \"phishing\" or \"benign\").\n\nAgent response:\n{{ sample.output_text }}\n\nRespond with a JSON object {\"accuracy\": <value>} where accuracy is 1 if the extracted verdict matches the expected label, else 0."
}
]
},
"scores": [
{
"role": "user",
"content": "You are scoring an email phishing classifier. The expected answer is the ground-truth label: \"{{ item.reference.label }}\". The agent's response may contain reasoning; extract ONLY its final verdict (the last clear \"phishing\" or \"benign\").\n\nAgent response:\n{{ sample.output_text }}\n\nRespond with a JSON object {\"accuracy\": <value>} where accuracy is 1 if the extracted verdict matches the expected label, else 0."
"name": "accuracy",
"minimum": 0,
"maximum": 1
}
]
},
"scores": [
{
"name": "accuracy",
"minimum": 0,
"maximum": 1
}
],
"inference": {
"max_tokens": 1024,
"extra_body": {
"nvext": {
"max_thinking_tokens": 256
],
"inference": {
"max_tokens": 1024,
"extra_body": {
"nvext": {
"max_thinking_tokens": 256
}
}
},
"reasoning": {
"end_token": "</think>"
}
},
"reasoning": {
"end_token": "</think>"
}
}
}
},
"max_concurrent_tasks": 1
]
}

This file was deleted.

This file was deleted.

Loading