Skip to content

feat(apollo-react): curated copy for built-in centralized guardrail parameters such as Applies to - #1302

Open
apetraru-uipath wants to merge 2 commits into
mainfrom
feat/al-606-centralized-builtin-parameters
Open

apetraru-uipath wants to merge 2 commits into
mainfrom
feat/al-606-centralized-builtin-parameters

Conversation

@apetraru-uipath

@apetraru-uipath apetraru-uipath commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What changed

CentralizedGuardrailDetails already lists a built-in guardrail's own parameters after the lifted entities and thresholds (AL-620), but a parameter the matching definition does not declare was shown with its raw id and raw value: appliesTo / Files. Agents now stamps exactly that parameter on centralized PII, prompt-attack, harmful-content and LLM-as-judge guardrails (UiPath/Agents#6545, AL-606), and the definition does not carry appliesTo when the file-support flags are off or on Automation Suite — which is when the policy value must still be readable.

  • resolveCentralizedGuardrailParameters takes the optional copy table the details component already holds. For a built-in parameter the definition does not declare, the label and option labels come from the curated validator copy (so the judge's guardrailText/model/threshold/examples read as in the builder), else from a shared appliesTo fallback: "Applies to", with "Text only" / "Files only" / "Text and files" — the builder's copy. Nothing known → the row keeps its raw id, as before.
  • Declared definitions keep their position; undeclared parameters keep the policy's arrival order whether or not the copy knows them. The host's definition.parameters is never mutated.
  • formatValue: a list of records renders as JSON instead of an empty row; string lists still join with ", ".
  • CentralizedParameterFallbackLabels.appliesTo is an optional group, so hosts calling the exported resolver with the old shape keep compiling.
  • Four new ids under guardrails.centralized.applies-to-* in i18n.ts and locales/en.json (other catalogs via the l10n sync); parity test entries; a "Built-in parameters" story (PII with appliesTo=Files, judge with all five params + appliesTo=Both, sentiment with language); README sentence.

How has this been tested

  • vitest src/canvas/components/Guardrails: 39 files, 978 tests pass (18 new: fallback copy for each option and unknown value, definition copy preferred over fallback, curated copy for judge params and sentiment language, declared order first then policy order, a repeated id described once, BYO never borrows copy, definition left untouched, JSON fallback for record lists, details render "Applies to" / "Files only" under the thresholds, judge with no definition shows all rows, axe).
  • Full pnpm test: 3861 pass; the 1 failure is the known local locale-data test in StageNode/formatDuration, identical on main.
  • biome lint (0 errors), format:check, tsc --noEmit and the package build are clean.

Consumer: UiPath/Agents bumps @uipath/apollo-react to the release carrying this so the Apollo centralized dialog shows the scope.

🤖 Generated with Claude Code

apetraru-uipath and others added 2 commits October 7, 2026 15:51
…ch as Applies to

Agents now stamps an appliesTo scope (Text / Files / Both) onto the
built-in guardrails a governance policy enforces on files, and the judge
carries its rule, model, strictness and examples as parameters. The
centralized details already appended a built-in's own parameters after
its lifted entity rows, but labelled them only from a matching
definition, so appliesTo showed as "appliesTo: Files" and the judge's
settings as raw ids whenever the tenant's catalog did not declare them.

A parameter the definition does not declare now takes its label and
option names from the curated copy for the validator ("Rule prompt",
"Languages"), and appliesTo from a fallback the details own: "Applies
to", "Text only", "Files only", "Text and files", the copy the
per-agent builder gets from the backend definition. A definition that
does declare the parameter still wins, the lifted rows are unchanged,
a lifted field still hides a parameter repeating its id, and BYO rows
never borrow curated copy. A list the value formatter cannot name item
by item falls back to JSON rather than an empty row.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…rs the copy describes

The centralized details appended the definitions it synthesised for a
built-in's undeclared parameters onto the definition list that orders
the rows, so a parameter the curated copy or the appliesTo fallback
could name sorted ahead of an undeclared one it could not, against the
policy's order the row contract promises. Those definitions are now
looked up by id only, so every undeclared parameter keeps its place and
nothing is ever pushed onto the host's definition array; a test pins
that array unchanged after resolving, and another the mixed order.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:09
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Oct 07, 2026, 06:16:08 AM
apollo-docs Ready Preview · Logs Oct 07, 2026, 06:16:08 AM
apollo-landing Ready Preview · Logs Oct 07, 2026, 06:16:08 AM
apollo-vertex Ready Preview · Logs Oct 07, 2026, 06:16:08 AM

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1937 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1708
ISC 88
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.3 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The newly required fields break consumers of the exported label interface.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Adds curated display copy for undeclared built-in guardrail parameters.

Changes:

  • Resolves parameter labels and appliesTo values from localized copy.
  • Preserves parameter ordering and formats record lists as JSON.
  • Adds stories, documentation, and comprehensive tests.
File Description
locales/​en.json Adds English appliesTo translations.
Guardrails/​README.md Documents parameter fallback behavior.
Guardrails/​i18n.ts Defines localized fallback labels.
Guardrails/​i18n.test.ts Verifies English label copy.
Guardrails/​centralized-parity.test.ts Records host-copy parity.
Guardrails/​centralized-guardrails.stories.tsx Demonstrates built-in parameters.
Guardrails/​centralized-guardrail-utils.ts Resolves curated labels and values.
Guardrails/​centralized-guardrail-utils.test.ts Tests resolver behavior and edge cases.
Guardrails/​centralized-guardrail-details.tsx Supplies copy and fallback labels.
Guardrails/​centralized-guardrail-details.test.tsx Tests rendered labels and accessibility.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1463 to +1466
appliesToFallback: string;
appliesToText: string;
appliesToFiles: string;
appliesToBoth: string;
Comment on lines +603 to +606
products render today. A built-in's own parameters the definition does not declare take the
curated copy for the validator ("Rule prompt", "Languages"), and `appliesTo`, which Agents
stamps onto every built-in it enforces on files, the details' own "Applies to" / "Files
only" fallback, so the dialog reads as the per-agent builder does.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — 42.02 MB 50.17 MB +6.3 KB
@uipath/apollo-react 48.8% 80.8% (21/26) 7.90 MB 30.84 MB +103.4 KB
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB +3.5 KB
@uipath/apollo-wind — — 678.6 KB 3.98 MB +116.1 KB
@uipath/ap-chat 85.8% — 43.92 MB 56.80 MB +27.2 KB

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 13 changed, 2 added (of 642 compared, 627 unchanged). View report

Baseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs

Updated (PT): Oct 07, 2026, 06:41:25 AM

@apetraru-uipath
apetraru-uipath marked this pull request as ready for review October 7, 2026 19:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:XL 500-999 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants