refactor(uipath-platform/data-fabric): extract reserved-keywords lookup + consolidate confirmation protocol#1790
refactor(uipath-platform/data-fabric): extract reserved-keywords lookup + consolidate confirmation protocol#1790AditiGoyalUipath wants to merge 6 commits into
Conversation
… inference, isUnique rules - Rule 0 (new): ask liberally; destructive ops non-bypassable; anti-self-resolve clause catches "I'll default to tenant" patterns and inability-to-ask rationalisations. - Rule 5b (new): isUnique is immutable after field creation — `updateFields` silently no-ops it but returns Success. Mandates entities-get re-read after every updateFields. - Rule 11 (rewritten): CHOICE_SET_* / RELATIONSHIP field-delete now raises a dropdown asking whether to cascade-delete the referenced choice set / target entity. FILE stays no-cascade. Replaces prior "NEVER cascade" policy per user direction. - Rule 14 (extended): CSV / sample-data inference must flag every type as inferred and dropdown-confirm ambiguous columns (date-shaped strings, 0/1 flags, decimal precision, UUID-shaped) before invoking entities create. - Rule 19 (sharpened): scope-prompt bypass clause covers scope resolution ONLY; destructive-op confirmation still fires even on "do not ask" prompts. Adds a second AskUserQuestion for "Provide folder GUID" vs "List accessible folders". - Cross-folder reference matrix: folder↔folder allowed for entities and choice sets; folder↔tenant blocked for user-authored targets but ALLOWED for tenant-level system entities (EntityAttachment for FILE; User referenced by CreatedBy/UpdatedBy). - SKILL.md activation: front-loaded DF verbs in description + when_to_use to improve auto-activation on bare prompts like "create a choice set called X". - entity-schema.md Not Supported table: isUnique-toggle row + recreate workaround; Verify-after-update section generalising the silent-Success pattern. - bulk-import.md: top callout for CSV-driven create routing to Rule 14 inference flow. - New smoke tests: - smoke_csv_type_confirm.yaml — validates CSV inference confirmation flow (passes) - smoke_choiceset_scope_ask.yaml — validates scope-prompt halt behavior Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… requirement + referenceFieldId display-field confirm
Two gaps surfaced by a real RELATIONSHIP-create session:
1. referenceFolderKey is required even when the parent and target live in
the same folder — not only on cross-folder bindings. Omitting it fails
with the misleading "Cannot create relationship field from folder-level
entity ('<parent>') to tenant-level entity ('')" — the server treats
missing referenceFolderKey as "target is tenant" and trips the cross-
scope block. Updated entity-schema.md `referenceFolderKey` bullet, the
cross-folder matrix (Folder A → Folder A row now requires the key), and
data-fabric.md cross-folder paragraph. Added an explicit Same-folder
gotcha callout with the misleading error verbatim.
2. referenceFieldId on RELATIONSHIP / FILE fields is a user-visible
display choice — it controls which target field renders in pickers,
lists, and the Data Fabric UI. Was being silently defaulted to the
target's Id UUID (which renders as opaque text). Rule 14 now has a
sub-paragraph mandating an AskUserQuestion dropdown of plausible
display fields (Name / Email / Title / etc.). entity-schema.md
referenceFieldId bullet rewritten to mark it as user-domain, not a
technical default. Auto Mode does not waive this confirmation.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…olderKey requirement CHOICE_SET_SINGLE / CHOICE_SET_MULTIPLE fields do NOT need referenceFolderKey at the API level — the backend resolves the choice-set's folder server-side from choiceSetId alone. Previous commit incorrectly grouped CHOICE_SET_* with RELATIONSHIP / FILE under the "same-folder needs the key" rule. Updated: - entity-schema.md referenceFolderKey bullet: scoped to RELATIONSHIP/FILE only; added explicit "CHOICE_SET_* does NOT need referenceFolderKey" callout. - entity-schema.md cross-folder matrix: split the per-field-key column into two — one for RELATIONSHIP/FILE, one for CHOICE_SET_*. CHOICE_SET_* rows uniformly omit (or n/a for the not-supported rows). - entity-schema.md Same-folder gotcha callout: scoped to RELATIONSHIP/FILE. - entity-schema.md addFields trailing note: reversed — do NOT pass referenceFolderKey on CHOICE_SET_* fields even when the choice set is in a different folder. - data-fabric.md cross-folder paragraph: split the rule by field type. - choice-sets.md line 34: was instructing to pass referenceFolderKey for cross-folder choice-set bindings; corrected to "pass only choiceSetId". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… co-mention with CHOICE_SET_* The create-entity cheatsheet row in data-fabric.md still grouped CHOICE_SET_* with RELATIONSHIP under "required extras (including cross-folder referenceFolderKey)". That wording survived the previous correction and could lead an agent to add referenceFolderKey on a choice-set field, which crashes the tool. Spelled out per-type extras inline: choiceSetId for CHOICE_SET_*; referenceEntityId + referenceFieldId + referenceFolderKey (even same-folder) for folder-scoped RELATIONSHIP/FILE; explicit "CHOICE_SET_* does NOT take referenceFolderKey, the server resolves from choiceSetId". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…Fields, and query response shape - Split the choice-set-value Name validator from the entity/field-name validator (Rule 4): the two are separate code paths. Entity/field is case-insensitive over the full C#/VB list; choice-value is case-sensitive over a partial list. SQL keywords are NOT rejected by either. - Reinstate `removeFields` in the `entities update` op table (previously marked as rejected) and link to Deleting a Field. - Correct `records query` response shape: `Data.Items` (not `Data.Records`), and `NextCursor` is an object — page with `NextCursor.Value`.
…up + consolidate confirmation protocol Reduces prose bloat in the Data Fabric skill without changing semantics. Addresses PR #1747 reviewer feedback that "20 dense critical rules" are becoming hard for agents to respect. - New references/data-fabric/reserved-keywords.md: single lookup table covering both the entity/field-name validator (case-insensitive, full C#/VB list) and the choice-value Name validator (case-sensitive, partial list). Explicit non-portability warning. - Rule 4 in data-fabric.md collapses from ~200 words of prose to a 1-paragraph pointer at reserved-keywords.md. - choice-sets.md value-Name section: comparison table extracted; only the authoring-specific convention (lowercase snake_case + DisplayName) stays inline. - entity-schema.md name-validation note: 1-line pointer. - Error-code table rows in data-fabric.md point at reserved-keywords.md for the rejection matrix. - Rename hoisted "Destructive Operations — STOP and Confirm" block to "Confirmation Protocol — the six triggers". Leads with a triggers table (Scope / Pick-or-create / Schema-preview / Inferred-types / Cascade-decision / Destructive-op), then the destructive-op CLI shapes, then "what clears the gate" / "what to do when you can't ask". - Rule 0 collapses from three dense sub-paragraphs (~600 words) to one directive that references the Protocol. - Rules 10 / 11 / 14 and the Task Navigation delete rows updated to reference "the Confirmation Protocol" instead of "the hoisted Destructive Operations block". Semantic changes: none. Every previous constraint is either retained verbatim or restated in the Protocol table. Follow-up refactor moves verb mechanics into per-verb reference files (deferred). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @AditiGoyalUipath's task in 2m 22s —— View job PR Review: refactor(uipath-platform/data-fabric): extract reserved-keywords lookup + consolidate confirmation protocol
SummaryExtracts reserved-keyword validator documentation into a new Change-by-Change Review1.
|
| Area | Status | Notes |
|---|---|---|
| Frontmatter | OK | No frontmatter changes in this PR (reference files, not SKILL.md) |
| E2E Tests | OK | No semantic changes — existing DF smoke tests cover the same behavior |
| Skill Body | OK | Confirmation Protocol consolidation is faithful to the original constraints |
| References & Assets | OK | New reserved-keywords.md is well-structured; all links resolve; no duplication beyond bridge content |
| Repo Hygiene | OK | No secrets, no cross-skill dependencies, changes scoped to data-fabric references only |
Issues for Manual Review
- Domain accuracy of the keyword lists. The rejected/accepted keyword examples in
reserved-keywords.mdare carried over from the original prose (marked "empirically verified" and "partial, non-exhaustive"). A domain expert should confirm these still match the current Data Fabric API behavior.
Conclusion
Clean refactoring PR. Both moves (keyword extraction, confirmation protocol consolidation) reduce prose without losing constraints, follow reference pointer discipline, and update all cross-references. No issues found — approve.
a646007 to
b857277
Compare
aef010d to
199298b
Compare
199298b to
e955743
Compare
Stacks on #1747. Base will move to
mainonce #1747 merges.Addresses reviewer feedback on #1747 that the Data Fabric skill has grown into ~20 dense critical rules and agent adherence is starting to slip. This PR takes two structural moves that shrink prose without dropping constraints — a proof-of-pattern before the bigger reorg.
Move 1 — Extract reserved-keywords lookup
New file:
references/data-fabric/reserved-keywords.md. One place documents both name validators:Namevalidator (case-sensitive, partial list)Explicit non-portability warning: a name legal in one place may be illegal in the other.
Callers compressed to pointers:
data-fabric.mdRule 4: ~200 words → 1 paragraphchoice-sets.mdvalue-name section: ~250 words → 4 linesentity-schema.mdname-validation note: 1 linedata-fabric.md: link toreserved-keywords.mdfor the rejection matrixMove 2 — Consolidate the Confirmation Protocol
The hoisted "Destructive Operations — STOP and Confirm" block + Rule 0's three sub-paragraphs were saying the same thing four ways. Merged into a single "Confirmation Protocol — the six triggers" block:
Followed by the destructive-op CLI shapes, "what clears the gate" clause, and "what to do when you can't ask" clause. Rule 0 body collapses to a single directive: "Never mutate before the Confirmation Protocol clears."
Rules 10 / 11 / 14 and the Task Navigation delete rows updated to reference "the Confirmation Protocol" instead of "the hoisted Destructive Operations block".
Semantic changes
None. Every previous constraint is either retained verbatim or restated in the Protocol table. Verified by re-reading each removed sentence against the new location.
What's deferred
Bigger restructure — hoisting per-verb mechanics (CLI shapes, body keys, error tables) out of
data-fabric.mdand into the per-verb reference files (entity-schema.md,choice-sets.md,records-query.md, etc.) — is a follow-up PR once this pattern lands. That one is a 4+ file touch and better validated on its own.Test plan
#value-name-validation(updated the one known reference).reserved-keywords.mdand verify no rejection case that Rule 4 previously covered is missing.🤖 Generated with Claude Code