Conversation
Added logging for unknown reference types in activateChatParticipant.
* ✨ refactor: enhance schema validation with new utilities Introduce tryValidateJSONWithSchema and integration with parsers. * added docs * updated tests * updated prd * docs * caution
There was a problem hiding this comment.
Pull Request Overview
This PR introduces logging for unknown reference types in the activateChatParticipant function and updates branch configurations in various files while enhancing JSON schema validation support.
- Added logging for unknown reference types in chatparticipant.ts
- Updated branch lists in CI/CD workflows and configuration files to include the dev branch
- Enhanced JSON schema validation by integrating tryValidateJSONWithSchema across multiple modules
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vscode/src/chatparticipant.ts | Logs unknown reference types when an unexpected type is encountered |
| packages/sample/src/tla/PR.yml | Adds additional branches (main, dev) for PR triggering |
| packages/sample/genaisrc/workspace.genai.mjs | Updates script configuration and adds schema validation for JSON |
| packages/sample/genaisrc/samples/prd.genai.mts | Hardcodes defaultBranch to "dev" instead of dynamically fetching it |
| packages/sample/genaisrc/git-release-notes.genai.mjs | Reformats object literal for commitsName configuration |
| packages/core/src/workspace.ts | Integrates tryValidateJSONWithSchema into several read* functions |
| packages/core/src/schema.ts | Adds debug logging and implements tryValidateJSONWithSchema |
| packages/core/src/schema.test.ts | Introduces and extends tests for schema validation functionality |
| packages/core/src/promptcontext.ts | Updates readJSON and readYAML to accept and pass through options |
| packages/core/src/parsers.ts | Wraps multiple parser functions with tryValidateJSONWithSchema |
| packages/core/src/data.ts | Applies schema validation to parsed data using tryValidateJSONWithSchema |
| docs/src/content/docs/reference/scripts/files.md | Adds documentation for the new readData API and schema validation |
| CONTRIBUTING.md | Fixes typo in branch selection instructions |
| .github/workflows/playwright.yml, licenses.yml, build.yml | Updates branch configurations to include the dev branch |
Files not reviewed (2)
- docs/src/content/docs/reference/scripts/redteam.mdx: Language not supported
- docs/src/content/docs/reference/scripts/schemas.mdx: Language not supported
| ### Schema validation | ||
|
|
||
| You can provide a [JSON schema](/genaiscript/reference/scripts/schemas) to validate the parsed data. | ||
| By default, invalid data is silently ignore and the return value is `undefined` but you can force |
There was a problem hiding this comment.
Consider changing 'silently ignore' to 'silently ignored' for correct grammar.
| By default, invalid data is silently ignore and the return value is `undefined` but you can force | |
| By default, invalid data is silently ignored and the return value is `undefined` but you can force |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the system’s capabilities in prompt management, type validation, and dynamic query handling while also improving logging and documentation.
- Adds logging for unknown reference types in activateChatParticipant.
- Integrates tryValidateJSONWithSchema into workspace and parser functions for enhanced schema validation.
- Updates documentation, tests, and workflows to support the “dev” branch alongside main.
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vscode/src/chatparticipant.ts | Adds logging for unknown reference types. |
| packages/sample/src/tla/PR.yml | Updates branch triggers for pull requests. |
| packages/sample/genaisrc/workspace.genai.mjs | Adjusts script configuration and schema validation options. |
| packages/sample/genaisrc/samples/prd.genai.mts | Hardcodes defaultBranch to "dev". |
| packages/sample/genaisrc/git-release-notes.genai.mjs | Formats object options more clearly. |
| packages/core/src/workspace.ts | Incorporates schema validation via tryValidateJSONWithSchema. |
| packages/core/src/schema.ts | Introduces debug logging for schema output and error details. |
| packages/core/src/schema.test.ts | Adds tests for schema validation and tryValidateJSONWithSchema. |
| packages/core/src/promptcontext.ts | Updates readJSON/readYAML to accept options. |
| packages/core/src/parsers.ts | Wraps parsers with tryValidateJSONWithSchema. |
| packages/core/src/data.ts | Uses tryValidateJSONWithSchema in dataTryParse. |
| docs/src/content/docs/reference/scripts/files.md | Documents new readData API and schema validation options. |
| CONTRIBUTING.md, .github/workflows/* | Updates branch references to include the “dev” branch. |
Files not reviewed (2)
- docs/src/content/docs/reference/scripts/redteam.mdx: Language not supported
- docs/src/content/docs/reference/scripts/schemas.mdx: Language not supported
Comments suppressed due to low confidence (2)
packages/vscode/src/chatparticipant.ts:32
- [nitpick] The logging in this block only prints the 'typeof value', which may not be enough context to diagnose issues. Consider logging additional information (e.g., a stringified representation) if it is safe to do so.
else
packages/core/src/schema.ts:77
- [nitpick] The debug log output (dbg(res)) added here may expose internal schema details. Consider conditionally enabling this logging or ensuring it's not included in production builds.
const res = lines.join("\n") // Join lines into a single TypeScript definition
Improve diagnostic handling by adding support for parsing GitHub Flavored Markdown annotations such as WARNING and CAUTION, mapping severities, and refining output formats. New tests added to validate functionality.
* help cli for scripts * add sparc rules * fixes to support dev * output trace again
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new prompt endpoints and enhances type validation, alongside refactoring several commands and workflows to support a new dev branch. Key changes include:
- New endpoints (createPromptEndpoint and getPromptEndpoint) for flexible prompt management.
- Introduction of advanced type checking using structured tagging.
- Updates to CLI commands, documentation, and GitHub workflows to accommodate the dev branch.
Reviewed Changes
Copilot reviewed 39 out of 46 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/cli.ts | Added a new help/info command using the scriptInfo action. |
| docs/src/content/docs/reference/scripts/files.md | Added documentation for the new readData API and schema validation. |
| docs/src/content/docs/reference/cli/commands.md | Updated command usage and examples for help/info commands. |
| CONTRIBUTING.md | Updated instructions to select the dev branch. |
| .github/workflows/* | Updated branch targets from main to include dev where applicable. |
| .github/prompts/sparc.md | Added a new guidelines document for SPARC agentic development rules. |
Files not reviewed (7)
- docs/package.json: Language not supported
- docs/src/content/docs/blog/ast-grep-and-transform.mdx: Language not supported
- docs/src/content/docs/blog/mcp-resources.mdx: Language not supported
- docs/src/content/docs/reference/scripts/redteam.mdx: Language not supported
- docs/src/content/docs/reference/scripts/schemas.mdx: Language not supported
- package.json: Language not supported
- packages/cli/package.json: Language not supported
|
@bzorn can you approve this PR? we'll have to do this periodically to push changes to main. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bzorn
left a comment
There was a problem hiding this comment.
Great to see ast-grep and mcp supported.
Added logging for unknown reference types in activateChatParticipant.
🚀 Changes in this pull request 🚀
✅ New Prompt Endpoints Added
Added
createPromptEndpointto handle prompt creation andgetPromptEndpointto retrieve specific prompts by type, enabling more flexible prompt management.🔧 New Types for Better Type Checking
Introduced advanced types:
$CoreBinaryTypeChecker$CoreClassyTypeCheckingConfig$CoreDomainCheckingConfigThese improve template validation and inference accuracy.
🛠️ Refactored Type Handling
Updated type definitions to use structured tagging (
@typeparameter) instead of direct type definition, enhancing clarity and maintainability.✍️ New Function Added
createCodePrompt: Generates custom prompts tailored to the query's AST (Abstract Syntax Tree), improving interaction personalization.
This pull request enhances the system's capabilities in prompt management, type validation, and dynamic query handling.