Skip to content

dev#1409

Merged
pelikhan merged 20 commits into
mainfrom
dev
Apr 2, 2025
Merged

dev#1409
pelikhan merged 20 commits into
mainfrom
dev

Conversation

@pelikhan
Copy link
Copy Markdown
Member

@pelikhan pelikhan commented Apr 1, 2025

Added logging for unknown reference types in activateChatParticipant.


🚀 Changes in this pull request 🚀

  • New Prompt Endpoints Added
    Added createPromptEndpoint to handle prompt creation and getPromptEndpoint to retrieve specific prompts by type, enabling more flexible prompt management.

  • 🔧 New Types for Better Type Checking
    Introduced advanced types:

    • $CoreBinaryTypeChecker
    • $CoreClassyTypeCheckingConfig
    • $CoreDomainCheckingConfig

    These improve template validation and inference accuracy.

  • 🛠️ Refactored Type Handling
    Updated type definitions to use structured tagging (@type parameter) 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.

AI-generated content by pr-describe may be incorrect

pelikhan added 2 commits April 1, 2025 03:35
Added logging for unknown reference types in activateChatParticipant.
@pelikhan pelikhan changed the title 🐛: Handle unknown reference types in state logging dev Apr 1, 2025
pelikhan added 2 commits April 1, 2025 03:49
* ✨ refactor: enhance schema validation with new utilities

Introduce tryValidateJSONWithSchema and integration with parsers.

* added docs

* updated tests

* updated prd

* docs

* caution
@pelikhan pelikhan marked this pull request as ready for review April 1, 2025 14:33
@pelikhan pelikhan requested a review from Copilot April 1, 2025 14:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Comment thread CONTRIBUTING.md Outdated
### 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
Copy link

Copilot AI Apr 1, 2025

Choose a reason for hiding this comment

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

Consider changing 'silently ignore' to 'silently ignored' for correct grammar.

Suggested change
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

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pelikhan pelikhan requested a review from Copilot April 1, 2025 15:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

pelikhan added 2 commits April 1, 2025 16:52
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.
Comment thread packages/core/src/annotations.ts Dismissed
@pelikhan pelikhan requested review from bzorn and Copilot April 2, 2025 14:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Comment thread docs/src/content/docs/reference/scripts/files.md Outdated
Comment thread .github/workflows/docs.yml Outdated
@pelikhan
Copy link
Copy Markdown
Member Author

pelikhan commented Apr 2, 2025

@bzorn can you approve this PR? we'll have to do this periodically to push changes to main.

pelikhan and others added 4 commits April 2, 2025 07:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@bzorn bzorn left a comment

Choose a reason for hiding this comment

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

Great to see ast-grep and mcp supported.

@pelikhan pelikhan merged commit 2cbb3d3 into main Apr 2, 2025
20 checks passed
@pelikhan pelikhan deleted the dev branch April 2, 2025 18:59
@pelikhan pelikhan restored the dev branch April 2, 2025 18:59
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.

4 participants