Skip to content

refactor(uipath-platform/data-fabric): extract reserved-keywords lookup + consolidate confirmation protocol#1790

Open
AditiGoyalUipath wants to merge 6 commits into
mainfrom
feat/df-skill-restructure
Open

refactor(uipath-platform/data-fabric): extract reserved-keywords lookup + consolidate confirmation protocol#1790
AditiGoyalUipath wants to merge 6 commits into
mainfrom
feat/df-skill-restructure

Conversation

@AditiGoyalUipath

Copy link
Copy Markdown
Contributor

Stacks on #1747. Base will move to main once #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:

  • Entity / field-name validator (case-insensitive, full C#/VB list)
  • Choice-value Name validator (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.md Rule 4: ~200 words → 1 paragraph
  • choice-sets.md value-name section: ~250 words → 4 lines
  • entity-schema.md name-validation note: 1 line
  • Error-code table rows in data-fabric.md: link to reserved-keywords.md for the rejection matrix

Move 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:

  1. Scope — tenant vs folder (Rule 19)
  2. Pick-or-create — target disambiguation (Rule 13)
  3. Schema preview — before create / addFields / updateFields / removeFields (Rule 14)
  4. Inferred types — CSV / sample-driven schemas (Rule 14 clause)
  5. Cascade decision — CHOICE_SET_* / RELATIONSHIP field deletes (Rule 11)
  6. Destructive op — the delete table

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.md and 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

  • Existing DF smoke tests pass unchanged (no rule semantics moved).
  • Grep for orphan links to the removed anchor #value-name-validation (updated the one known reference).
  • Skim reserved-keywords.md and verify no rejection case that Rule 4 previously covered is missing.

🤖 Generated with Claude Code

AditiGoyalUipath and others added 6 commits July 1, 2026 16:35
… 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>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @AditiGoyalUipath's task in 2m 22s —— View job


PR Review: refactor(uipath-platform/data-fabric): extract reserved-keywords lookup + consolidate confirmation protocol

  • Read review criteria (.github/code_review.md, CLAUDE.md, .claude/rules/skill-review.md)
  • Read existing PR conversation
  • Read full diff
  • Read all changed files in full context
  • Verify relative links resolve
  • Check for cross-skill references, secrets, consistency
  • Post review findings

Summary

Extracts reserved-keyword validator documentation into a new reserved-keywords.md reference file and consolidates the Destructive Operations block + Rule 0 into a unified "Confirmation Protocol — the six triggers" block. Net effect: ~200 words removed from data-fabric.md, ~250 words removed from choice-sets.md, zero semantic changes — every constraint is preserved in the new locations.

Change-by-Change Review

1. references/data-fabric/reserved-keywords.md (ADDED)

Severity: OK

Well-structured extraction. The file has clear sections: which validator fires, shared alphabet rules, reserved system field names, entity/field-name validator, choice-value Name validator, portability warning, and an "API is authoritative" escape hatch. The two-table layout (entity/field vs choice-value) makes the behavioral differences scannable. The "Do NOT assume portability" section with concrete examples (Select, New) is a strong agent guardrail.

The back-reference to data-fabric.md Rule 18 in the final section is correct and anchors the fallback behavior.

2. references/data-fabric/data-fabric.md (MODIFIED)

Severity: OK

Two logical changes, both clean:

  • Confirmation Protocol block (lines 52–81): The six-trigger table replaces the previous multi-paragraph prose. Every prior constraint is accounted for — scope, pick-or-create, schema preview, inferred types, cascade decision, and destructive op. The destructive-op table retains all CLI shapes. The "what clears the gate" and "what to do when you can't ask" clauses preserve the non-bypassable semantics verbatim. Rule 0 collapses to a single directive that points at the protocol.

  • Rule 4 (line 89): Compressed from ~150 words to a pointer to reserved-keywords.md plus a one-sentence bridge. The bridge retains the key insight (the two validators don't overlap) and the Rule 18 back-reference.

  • Error table rows (lines 339–340): Updated to link to reserved-keywords.md instead of inlining the rejection details. The choice-set error row's NumberId caveat link updated from #value-name-validation to #sourcing-numberid-after-batch-value-creates — correct anchor.

  • Task Navigation table (lines 262, 271, 278): All three "see Destructive Operations block" references updated to "see Confirmation Protocol" — no stale references remain (verified by grep).

3. references/data-fabric/choice-sets.md (MODIFIED)

Severity: OK

The ## Value 'Name' validation section compressed from a comparison table + paragraph to a two-bullet pointer to reserved-keywords.md. The two retained facts (different code path warning, snake_case convention) are the only authoring-specific details not in the extracted file. Good reference pointer discipline — bridge content only, no duplication.

4. references/data-fabric/entity-schema.md (MODIFIED)

Severity: OK

One-line change at line 93: the name-validation bullet now links to reserved-keywords.md instead of referencing data-fabric.md Rule 4. Clean and correct — the link resolves (verified).

What's Missing

Nothing identified. The PR is well-scoped — it moves content without changing semantics, updates all internal references, and leaves no stale anchors. The ## Value 'Name' validation heading is preserved in choice-sets.md so the existing self-reference at line 92 (#value-name-validation) still resolves.

Area Ratings

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.md are 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.

@AditiGoyalUipath AditiGoyalUipath force-pushed the feat/df-rules-scope-cascade-csv-isunique branch from 199298b to e955743 Compare July 3, 2026 05:15
Base automatically changed from feat/df-rules-scope-cascade-csv-isunique to main July 3, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant