feat(studio): add guardrail detail tabs with structured Configuration viewer and draft editing - #830
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
34a76bf to
a6b221b
Compare
5026a87 to
e86c1ac
Compare
e86c1ac to
2f33320
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughGuardrail details now provide nested configuration routing, structured configuration panels, editable general fields, local drafts, reset/save actions, and PATCH-based updates with test coverage for routing, form behavior, flow recognition, detectors, and rendered sections. ChangesGuardrail configuration workflow
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
web/packages/studio/src/routes/guardrails/GuardrailConfigTab/DraftTextAreaField.tsx (1)
7-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the prop contract readonly.
Mark
DraftTextAreaFieldPropsmembersreadonly. As per coding guidelines, usereadonlyfor immutable properties in TypeScript interfaces and types.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/DraftTextAreaField.tsx` around lines 7 - 15, Update the DraftTextAreaFieldProps interface so every property, including label, description, placeholder, value, and onChange, is marked readonly. Preserve the existing property types and optionality.Source: Coding guidelines
web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts (2)
7-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDeclare the hook return type.
Expose the non-null context value as the exported hook contract. As per coding guidelines, exported public APIs require explicit return types.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts` around lines 7 - 13, Update the exported useGuardrailDraft hook to declare an explicit return type matching the non-null context value returned after the GuardrailDraftContext check. Preserve the existing provider validation and return behavior.Source: Coding guidelines
4-5: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep external imports before internal imports.
web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts#L4-L5: move the React import before the internal context import.web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx#L4-L12: placelucide-reactand React imports before@studioimports.web/packages/studio/src/routes/guardrails/GuardrailConfigTab/LlmSection.tsx#L4-L22: placelucide-reactand React imports before@studioimports.web/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsx#L4-L9: placelucide-reactand React imports before@studioimports.web/packages/studio/src/routes/guardrails/GuardrailConfigTab/index.tsx#L4-L17: placelucide-reactand React imports before@studioimports.As per coding guidelines, “Group imports: external libraries, internal modules, relative imports in TypeScript.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts` around lines 4 - 5, Reorder imports so external libraries precede internal `@studio` modules: in web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts lines 4-5, move the React import before GuardrailDraftContext; apply the same ordering in web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx lines 4-12, LlmSection.tsx lines 4-22, BehaviorSection.tsx lines 4-9, and index.tsx lines 4-17, placing lucide-react and React imports before `@studio` imports.Source: Coding guidelines
web/packages/studio/src/routes/guardrails/GuardrailConfigTab/RawConfigSection.tsx (1)
20-30: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winDefer raw JSON generation until expanded.
JSON.stringifyruns on every draft update even while collapsed. SinceGuardrailConfigTabalways mounts this section and textarea edits update the draft per keystroke, lazily mount or serialize the raw body only when the accordion is open.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/RawConfigSection.tsx` around lines 20 - 30, Update RawConfigSection so JSON.stringify(data, null, 2) is evaluated only after the raw-config AccordionItem is expanded, rather than on every draft update while collapsed. Use the accordion’s existing open-state mechanism to conditionally render or lazily compute the pre content, preserving the current JSON display when expanded.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/studio/src/mocks/handlers/guardrails.ts`:
- Around line 73-81: Update the PATCH handler for guardrail configs to merge the
parsed request body into the matched entry in mockGuardrailConfigs before
returning the response. Preserve the 404 behavior for unknown names, and ensure
subsequent GET/refetch requests observe the persisted merged configuration.
In
`@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsx`:
- Around line 46-47: Update hasBehaviorContent to base visibility on content
that the BehaviorSection actually renders: count behavior fields and only treat
tracing as present when it produces rendered tracing fields or a badge. Ensure
empty tracing objects and disabled enable_content_capture values do not make the
behavior panel appear unless their disabled state is explicitly rendered.
In `@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.ts`:
- Around line 116-120: Update SECRET_KEY and formatScalar so secret-bearing keys
with snake_case prefixes or suffixes, including nim_api_key, hf_token, and
access_token, are masked while existing exact-name matches remain supported. Add
regression cases covering these prefixed/suffixed keys and verify non-secret
keys remain rendered normally.
---
Nitpick comments:
In
`@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/DraftTextAreaField.tsx`:
- Around line 7-15: Update the DraftTextAreaFieldProps interface so every
property, including label, description, placeholder, value, and onChange, is
marked readonly. Preserve the existing property types and optionality.
In
`@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/RawConfigSection.tsx`:
- Around line 20-30: Update RawConfigSection so JSON.stringify(data, null, 2) is
evaluated only after the raw-config AccordionItem is expanded, rather than on
every draft update while collapsed. Use the accordion’s existing open-state
mechanism to conditionally render or lazily compute the pre content, preserving
the current JSON display when expanded.
In
`@web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts`:
- Around line 7-13: Update the exported useGuardrailDraft hook to declare an
explicit return type matching the non-null context value returned after the
GuardrailDraftContext check. Preserve the existing provider validation and
return behavior.
- Around line 4-5: Reorder imports so external libraries precede internal
`@studio` modules: in
web/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.ts
lines 4-5, move the React import before GuardrailDraftContext; apply the same
ordering in
web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx
lines 4-12, LlmSection.tsx lines 4-22, BehaviorSection.tsx lines 4-9, and
index.tsx lines 4-17, placing lucide-react and React imports before `@studio`
imports.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c6632b2c-01dd-469f-a7e5-6ecd64fdf81f
📒 Files selected for processing (27)
web/packages/studio/src/constants/routes.tsweb/packages/studio/src/mocks/handlers/guardrails.tsweb/packages/studio/src/routes/groups/guardrailsRoutes.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/DetectorsSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/DraftTextAreaField.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/LlmSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/PipelineSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/RawConfigSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/configPrimitives.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/flowRegistry.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/flowRegistry.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/index.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/instructions.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/instructions.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/types.tsweb/packages/studio/src/routes/guardrails/GuardrailDetailRoute/index.test.tsxweb/packages/studio/src/routes/guardrails/GuardrailDetailRoute/index.tsxweb/packages/studio/src/routes/guardrails/GuardrailDraft/GuardrailDraftProvider.tsxweb/packages/studio/src/routes/guardrails/GuardrailDraft/GuardrailHeaderActions.tsxweb/packages/studio/src/routes/guardrails/GuardrailDraft/context.tsweb/packages/studio/src/routes/guardrails/GuardrailDraft/useGuardrailDraft.tsweb/packages/studio/src/routes/utils.ts
|
…viewer Introduce the guardrail detail tab shell and a structured, read-only Configuration tab that renders the full RailsConfig schema (pipeline stages, detectors, models/prompting, behavior) instead of a raw JSON dump. Includes a flow-recognition registry and detector scope derivation. Signed-off-by: Alex Ray <alray@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsx (1)
68-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid casting incomplete objects to
RailsConfigOutput.Lines 72, 82, and 92 bypass the schema with
as RailsConfigOutput, so future required-field changes can compile while tests continue using invalid fixtures. Create one valid typed config fixture/factory and override onlytracing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsx` around lines 68 - 97, Replace the incomplete object casts in the BehaviorSection tests with a single valid typed RailsConfigOutput fixture or factory, then override only its tracing field for each scenario. Update all three test cases to use this fixture while preserving their existing tracing-specific assertions.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsx`:
- Around line 68-97: Replace the incomplete object casts in the BehaviorSection
tests with a single valid typed RailsConfigOutput fixture or factory, then
override only its tracing field for each scenario. Update all three test cases
to use this fixture while preserving their existing tracing-specific assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4a5be4c4-4906-4fa5-9d39-38e61bdb0a00
📒 Files selected for processing (5)
web/packages/studio/src/mocks/handlers/guardrails.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
- web/packages/studio/src/mocks/handlers/guardrails.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.test.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx (1)
4-11: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueGroup external imports before internal aliases.
Move
lucide-reactandreactabove the@studio/...imports. As per coding guidelines, group imports as external libraries, then internal modules.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx` around lines 4 - 11, Reorder imports in GeneralSection.tsx so external packages, including lucide-react and react, appear before the internal `@studio/`... aliases; leave the imported symbols and functionality unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx`:
- Around line 4-11: Reorder imports in GeneralSection.tsx so external packages,
including lucide-react and react, appear before the internal `@studio/`...
aliases; leave the imported symbols and functionality unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 092c29a3-ab61-43bc-b950-c6eb99eae1aa
📒 Files selected for processing (1)
web/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsx
- persist PATCH body in the guardrails mock so save-then-refetch observes edits - broaden secret-key masking to prefixed/suffixed keys (nim_api_key, hf_token) - base behavior-panel visibility on rendered content so empty tracing hides it Adds regression tests for secret masking and empty behavior panels. Signed-off-by: Alex Ray <alray@nvidia.com>
41d3173 to
a869d48
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
web/packages/studio/src/routes/guardrails/GuardrailForm/useGuardrailForm.ts (1)
7-13: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd explicit return type for this public hook.
As per coding guidelines,
web/**/*.{ts,tsx}: "Use explicit return types for public APIs and complex functions in TypeScript."useGuardrailFormis exported without one.-export const useGuardrailForm = () => { +export const useGuardrailForm = (): GuardrailFormContextValue => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailForm/useGuardrailForm.ts` around lines 7 - 13, Add an explicit TypeScript return type to the exported useGuardrailForm hook, using the type of GuardrailFormContext so its current context return value and provider error behavior remain unchanged.Source: Coding guidelines
web/packages/studio/src/routes/guardrails/GuardrailForm/GuardrailFormProvider.tsx (1)
67-76: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winConsider debouncing draft persistence.
Draft is written to localStorage on every
valueschange while dirty (i.e., every keystroke). Fine for small drafts; a debounce would avoid repeated stringify/write on the input hot path for long instruction/sample-conversation text.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/packages/studio/src/routes/guardrails/GuardrailForm/GuardrailFormProvider.tsx` around lines 67 - 76, Debounce draft persistence in the useEffect that watches isDirty and values, so setStored is not called on every keystroke while editing long fields. Preserve the existing clearStored behavior when the form is no longer dirty, and cancel or clean up the pending debounce on dependency changes or unmount.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/studio/src/routes/guardrails/GuardrailForm/formModel.ts`:
- Around line 41-52: Update applyFormToConfig so the instructions field uses the
result from setGeneralInstruction directly, preserving an empty array when the
user removes the sole general instruction; do not fall back to base.instructions
for an empty computed list.
In
`@web/packages/studio/src/routes/guardrails/GuardrailForm/GuardrailFormProvider.tsx`:
- Around line 82-99: Separate the successful updateConfig call from cache
invalidation in the save handler created by GuardrailFormProvider. Treat
updateConfig success as the save completion: clearStored, reset the form, and
show the success toast even if invalidateQueries fails; handle invalidation
failure independently without reporting the PATCH as a save failure.
---
Nitpick comments:
In
`@web/packages/studio/src/routes/guardrails/GuardrailForm/GuardrailFormProvider.tsx`:
- Around line 67-76: Debounce draft persistence in the useEffect that watches
isDirty and values, so setStored is not called on every keystroke while editing
long fields. Preserve the existing clearStored behavior when the form is no
longer dirty, and cancel or clean up the pending debounce on dependency changes
or unmount.
In `@web/packages/studio/src/routes/guardrails/GuardrailForm/useGuardrailForm.ts`:
- Around line 7-13: Add an explicit TypeScript return type to the exported
useGuardrailForm hook, using the type of GuardrailFormContext so its current
context return value and provider error behavior remain unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 434e0841-cea4-429d-a10d-ca378580628b
📒 Files selected for processing (27)
web/packages/studio/src/constants/routes.tsweb/packages/studio/src/mocks/handlers/guardrails.tsweb/packages/studio/src/routes/groups/guardrailsRoutes.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/DetectorsSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/GeneralSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/LlmSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/PipelineSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/RawConfigSection.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/configPrimitives.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/flowRegistry.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/flowRegistry.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/index.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/instructions.test.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/instructions.tsweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsxweb/packages/studio/src/routes/guardrails/GuardrailConfigTab/types.tsweb/packages/studio/src/routes/guardrails/GuardrailDetailRoute/index.test.tsxweb/packages/studio/src/routes/guardrails/GuardrailDetailRoute/index.tsxweb/packages/studio/src/routes/guardrails/GuardrailForm/GuardrailFormProvider.tsxweb/packages/studio/src/routes/guardrails/GuardrailForm/GuardrailHeaderActions.tsxweb/packages/studio/src/routes/guardrails/GuardrailForm/context.tsweb/packages/studio/src/routes/guardrails/GuardrailForm/formModel.tsweb/packages/studio/src/routes/guardrails/GuardrailForm/useGuardrailForm.tsweb/packages/studio/src/routes/utils.ts
🚧 Files skipped from review as they are similar to previous changes (19)
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/RawConfigSection.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/types.ts
- web/packages/studio/src/routes/utils.ts
- web/packages/studio/src/mocks/handlers/guardrails.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/DetectorsSection.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/BehaviorSection.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/sections.test.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/detectors.test.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/configPrimitives.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/flowRegistry.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/PipelineSection.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/instructions.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/flowRegistry.test.ts
- web/packages/studio/src/routes/groups/guardrailsRoutes.tsx
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/LlmSection.tsx
- web/packages/studio/src/constants/routes.ts
- web/packages/studio/src/routes/guardrails/GuardrailConfigTab/instructions.test.ts
- web/packages/studio/src/routes/guardrails/GuardrailDetailRoute/index.test.tsx
- web/packages/studio/src/routes/guardrails/GuardrailDetailRoute/index.tsx
- applyFormToConfig: persist removal of the sole general instruction as an empty list instead of falling back to the still-populated base instructions. - GuardrailFormProvider.save: treat the PATCH as the save completion — clear the draft, reset the form, and toast success even if the follow-up cache invalidation fails; handle that refetch failure silently. Adds formModel unit tests covering the instruction edge cases. Signed-off-by: Alex Ray <alray@nvidia.com>
Introduce the guardrail detail tab shell and a structured Configuration tab
that renders the full RailsConfig schema (pipeline stages, detectors,
models/prompting, behavior) instead of a raw JSON dump. Includes a
flow-recognition registry and detector scope derivation.
Editing & the guardrail draft
The General section is now editable — General instruction (mapped to
the first
generalentry ininstructions[]) and Sample conversation(
sample_conversation) are free-text fields that hide their underlying schema.Edits flow into a page-level guardrail draft rather than saving immediately:
in-progress edits survive reloads.
diverges from the server config (
isDirty); editing a field back to itsserver value clears the draft entirely.
updated_at) isdiscarded automatically, so edits are never PATCHed on top of a config that
changed underneath.
draft, and toasts.
The remaining sections (pipeline, detectors, models & prompting, behavior, raw
config) stay read-only for now.
Signed-off-by: Alex Ray alray@nvidia.com
Summary by CodeRabbit