Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens interface-schema validation in the agent orchestrator (pagination typing + empty DTO detection) and updates the Realize authoring guides to reduce common Prisma/DTO mistakes (exact FK naming, computed field selection, and correct where syntax).
Changes:
- Added schema validation to reject non-canonical
.IPaginationDTO variants and restored validation that flags empty object DTOs used in operations. - Updated schema factory to rewrite
$refvalues that incorrectly point to*.IPaginationinto the canonicalIPage.IPagination. - Expanded Realize prompts/guides with stricter rules and examples for FK column naming, computed fields, and Prisma
whereclause syntax.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/agent/src/orchestrate/interface/utils/AutoBeJsonSchemaValidator.ts | Adds pagination-variant validation and re-enables empty-properties validation for DTOs used in operations. |
| packages/agent/src/orchestrate/interface/utils/AutoBeJsonSchemaFactory.ts | Rewrites invalid .IPagination $ref targets to IPage.IPagination. |
| packages/agent/prompts/REALIZE_TRANSFORMER_WRITE.md | Adds rules/examples for exact FK naming and computing derived fields in transform(). |
| packages/agent/prompts/REALIZE_TRANSFORMER_CORRECT.md | Adds diagnostics guidance for computed-field selection errors and reinforces exact FK naming. |
| packages/agent/prompts/REALIZE_OPERATION_WRITE.md | Clarifies checklist and adds Prisma where syntax guidance (null + logical operators). |
| packages/agent/prompts/REALIZE_OPERATION_CORRECT.md | Extends troubleshooting/checklist items for FK naming and where filter syntax. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…aValidator.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
sunrabbit123
pushed a commit
that referenced
this pull request
Apr 9, 2026
* feat(agent): automated agent healing process. * check zero peropties * turn off zero property checking due to gpt-5.4-mini * Update packages/agent/src/orchestrate/interface/utils/AutoBeJsonSchemaValidator.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes significant improvements to the Prisma/DTO authoring guides and strengthens schema validation for pagination and property naming. The main focus is on enforcing exact foreign key (FK) column names from the schema (never abbreviating), clarifying computed field handling, and improving validation for pagination DTO variants. It also updates the checklist and error documentation to help prevent common mistakes during implementation.
Prisma/DTO Authoring Guide Improvements
REALIZE_OPERATION_CORRECT.md,REALIZE_OPERATION_WRITE.md,REALIZE_TRANSFORMER_CORRECT.md,REALIZE_TRANSFORMER_WRITE.md) now emphasize that FK column names must be copied exactly from the schema (e.g.,hrm_platform_organization_id, notorganization_id), and never abbreviated. This is reinforced in checklists and code examples. [1] [2] [3] [4] [5] [6] [7] [8]total_hours,average_rating) must be derived intransform(), not selected directly; selecting them as columns will cause TS2353 errors. [1] [2] [3]wherefilter syntax is further clarified: use directnull(not{ equals: null }), logical operators must be uppercase (NOT,AND,OR), and relation filters must use the correct object structure. [1] [2] [3] [4]Schema Validation Enhancements
AutoBeJsonSchemaFactory.ts, all$refreferences to bogus.IPaginationvariants are rewritten to the canonicalIPage.IPagination, preventing accidental use of invalid pagination types.AutoBeJsonSchemaValidator.ts, a newvalidatePaginationVariantfunction rejects any DTO type ending with.IPaginationexceptIPage.IPagination, with a clear error message. The previously commented-outvalidateEmptyPropertiesis restored and called, ensuring all DTOs used in API operations have at least one property. [1] [2]These changes will help prevent common mistakes, enforce stricter contract between schema and implementation, and provide clearer errors and guidance for future development.