Skip to content

Comments

Fix IMP-003: Document schema generation architecture and update conformance check#15744

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-schema-generation-functions
Feb 14, 2026
Merged

Fix IMP-003: Document schema generation architecture and update conformance check#15744
pelikhan merged 2 commits intomainfrom
copilot/add-schema-generation-functions

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

IMP-003 conformance check failed looking for schema generation in safe_outputs_config.go, but schema generation is implemented in safe_outputs_config_generation.go with proper separation of concerns.

Changes

  • Documentation: Added architecture overview to safe_outputs_config.go explaining:

    • Static schemas: 30+ built-in types embedded from js/safe_outputs_tools.json
    • Dynamic generation: generateCustomJobToolDefinition() builds MCP schemas for custom jobs
    • Schema filtering: Only enabled tools exposed to MCP gateway
    • Validation: Automated tests ensure MCP spec compliance
  • Conformance checker: Updated IMP-003 to validate actual implementation:

    • Checks safe_outputs_config_generation.go for generateCustomJobToolDefinition
    • Validates js/safe_outputs_tools.json contains MCP inputSchema definitions
    • Verifies architecture documentation exists

Architecture

safe_outputs_config.go          → Frontmatter parsing
safe_outputs_config_generation.go → MCP schema generation (dynamic)
js/safe_outputs_tools.json      → Static schemas (embedded)
safe_outputs_tools_schema_test.go → MCP compliance validation

The hybrid approach keeps static definitions as source of truth while generating custom job schemas programmatically.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name x_amd64/vet 50 s.cjs lock.yml x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name 0/x64/bin/node 50 /collect_ndjson_rev-parse /usr/bin/grep ache/go/1.25.0/x64/pkg/tool/linuremote.origin.url 0/x6�� 1540020069/.github/workflows grep /opt/hostedtoolcache/go/1.25.0/x-importcfg issues:\s*write|git /mcp_handler_sherev-parse l /opt/hostedtoolcache/go/1.25.0/x-test.v=true (http block)
    • Triggering command: /usr/bin/gh gh repo view --json owner,name --jq .owner.login + "/" + .name de_modules/.bin/-nolocalimports \s*write /create_code_scarev-parse lution-insights.--show-toplevel ache/go/1.25.0/x/tmp/go-build3568950605/b412/_testmain.go --no�� 3660642856/.github/workflows grep 0/x64/bin/npx *write|contents:git /mcp_handler_sheinit (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha uts-conformance.**/*.ts actions/setup/js**/*.json ede935968f9cb0ee--ignore-path pull-requests:\ssh actions/setup/js-c /usr/bin/grep x_amd64/compile --no�� h ../../../.prettierignore grep (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ath ../../../.pr**/*.json t_core.cjs 64/pkg/tool/linu../../../.prettierignore *write|contents:sh actions/setup/js-c s/pr-triage-agen"prettier" --write '../../../**/*.json' '!../../../pkg/workflow/js/**/*.json' ---p HV13EWybwoFQ er --noprofile cfg 64/pkg/tool/linux_amd64/vet pull-requests:\s/usr/lib/git-core/git-remote-https ^jobs: /usr/bin/grep 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ath ../../../.pr--ignore-path w.cjs 64/pkg/tool/linux_amd64/vet pull-requests:\snode grep /usr/bin/grep 64/pkg/tool/linu../../../**/*.json --no�� --noprofile 003 conformance ../../../.prettierignore 64/pkg/tool/linux_amd64/vet issues:\s*write|git s ls-report.lock.y--show-toplevel 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 actions/setup/js/check_workflow_-test.run=^Test x_amd64/compile 50 /check_rate_limirev-parse /usr/bin/grep x_amd64/compile 0/x6�� octokit\. actions/setup/js/safe_outputs_handlers.cjs x_amd64/compile issues:\s*write|git /github_api_helprev-parse st.lock.yml x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 584974/b138/vet.cfg x_amd64/vet \s*write /assign_to_user.rev-parse ck.yml x_amd64/vet -q (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 584974/b114/vet.main 64/bin/go 50 /autofix_code_screv-parse (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 584974/b080/vet.cfg x_amd64/compile *write|contents:git /check_permissiorev-parse /usr/bin/grep x_amd64/compile -q '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json .go 8d519d9/node_modules/.bin/node 50 /git_helpers.cjsrev-parse /usr/bin/grep /opt/hostedtoolcache/go/1.25.0/xremote.origin.url (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 actions/setup/js/check_workflow_-test.run=^Test tions/setup/node_modules/.bin/sh-test.short=true \s*write /check_rate_limirev-parse nalyzer.lock.yml--show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet -q '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json actions/setup/js/safe_outputs_mcp_server.cjs de_modules/.bin/node *write|contents:node /glob_pattern_he/tmp/js-hash-test-1816358341/test-hash.js /usr/bin/grep /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 actions/setup/js/close_discussiogithub.com/github/gh-aw/pkg/fileutil x_amd64/compile *write|contents:git /check_skip_if_mconfig /usr/bin/grep x_amd64/compile -q '**/*.ts' '**/*.json' --ignore-p-c=4 actions/setup/js/safe_outputs_to-nolocalimports x_amd64/link 50 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 584974/b077/vet.cfg x_amd64/vet 50 /check_skip_if_minit k.yml x_amd64/vet -q '**/*.ts' '**/*.json' --ignore-p-c=4 actions/setup/js/safe_outputs_mc-nolocalimports x_amd64/compile issues:\s*write|git /github_api_helprev-parse ator.lock.yml x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path octokit\. ers.cjs x_amd64/vet octokit\. actions/setup/js-c /home/REDACTED/.do"prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore x_amd64/vet --no�� --noprofile _files.cjs 64/pkg/tool/linux_amd64/vet --noprofile grep ormance.lock.ymlecho "��� JSON files formatted" 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 grep er.lock.yml 64/pkg/tool/linu-buildtags -A js/**/*.json' ---errorsas cfg 64/pkg/tool/linu-nilfunc *write|contents:git ^\s*agent: s/code-simplifie--show-toplevel 64/pkg/tool/linu-tests (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 ^\s*agent: s/daily-syntax-e--show-toplevel ache/go/1.25.0/x64/pkg/tool/linurev-parse (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion 50 /collect_ndjson_config l ache/go/1.25.0/xTest User 0/x6�� octokit\. actions/setup/js/write_large_content_to_file.cjspkg/workflow/expression_coverage_test.go git issues:\s*write|git /mcp_handler_javrev-parse ock.yml /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linupkg/workflow/expression_parser_comprehensive_test.go (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/vet octokit\. actions/setup/js/home/REDACTED/.npm/_npx/b388654678d519d9/node_modules/.bin/prettier est.lock.yml x_amd64/vet --no�� h ../../../.pret.prettierignore bash /node *write|contents:bash grep s/draft-pr-clean--noprofile 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo (http block)
    • Triggering command: /usr/bin/gh gh workflow list --repo owner/repo --json name,path,state tions/setup/js/node_modules/.bin-nolocalimports *write|contents:git (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name octokit\. actions/setup/js/expired_entity_-ifaceassert x_amd64/vet octokit\. actions/setup/js-c ntainer.lock.yml"prettier" --write 'scripts/**/*.js' --ignore-path .prettierignore x_amd64/vet -q pull-requests:\s*write|contents:\s*write cjs 64/pkg/tool/linux_amd64/vet --noprofile grep s/sub-issue-clos--write 64/pkg/tool/linu../../../**/*.json (http block)
  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login octokit\. to_created_issues.cjs x_amd64/vet octokit\. actions/setup/js-c k.yml x_amd64/vet -q pull-requests:\s*write|contents:-p _server.cjs 64/pkg/tool/linux_amd64/asm *write|contents:sh (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login pull-requests:\s*write|contents:\s*write e.cjs x_amd64/vet *write|contents:sh actions/setup/js-c /usr/bin/grep x_amd64/vet -q octokit\. fuzz/counters_supported.go 64/pkg/tool/linux_amd64/cgo pull-requests:\ssh actions/setup/js-c /usr/bin/grep 64/pkg/tool/linux_amd64/cgo (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login octokit\. cjs x_amd64/vet *write|contents:sh actions/setup/js-c /usr/bin/grep x_amd64/vet -q octokit\. dler_manager.cjs 64/pkg/tool/linux_amd64/compile octokit\. actions/setup/js-c /usr/bin/grep 64/pkg/tool/linux_amd64/compile (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Safe Outputs Conformance] IMP-003: Schema generation functions missing in safe_outputs_config.go</issue_title>
<issue_description>### Conformance Check Failure

Check ID: IMP-003
Severity: MEDIUM
Category: Implementation - Schema Validation

Problem Description

The pkg/workflow/safe_outputs_config.go file exists but does not contain schema generation functions (generateSchema, buildSchema, or toolSchema). The Safe Outputs specification requires that MCP tool schemas be generated programmatically to ensure consistency between specification and implementation.

Without schema generation functions:

  • Manual schema definitions may drift from the specification
  • Adding new safe output types requires manual schema updates in multiple places
  • Schema consistency cannot be automatically verified

Affected Components

File: pkg/workflow/safe_outputs_config.go

Current Behavior

The safe outputs configuration file exists but lacks functions for:

  • Generating MCP tool schemas from safe output type definitions
  • Building parameter schemas dynamically
  • Validating schema consistency across handlers

Expected Behavior

Per the Safe Outputs specification:

  • Schema generation SHOULD be automated and derived from type definitions
  • Each safe output type should have a programmatic schema generator
  • Schemas should be validated for consistency with the specification

Remediation Steps

  1. Audit current schema approach: Review how MCP tool schemas are currently defined and maintained

  2. Implement schema generation functions:

// Example schema generation function
func GenerateToolSchema(outputType string) (*ToolSchema, error) {
    config, exists := safeOutputConfigs[outputType]
    if !exists {
        return nil, fmt.Errorf("unknown safe output type: %s", outputType)
    }
    
    schema := &ToolSchema{
        Type: "object",
        Properties: make(map[string]PropertySchema),
        Required: config.RequiredFields,
    }
    
    for fieldName, fieldConfig := range config.Fields {
        schema.Properties[fieldName] = PropertySchema{
            Type: fieldConfig.Type,
            Description: fieldConfig.Description,
            MaxLength: fieldConfig.MaxLength,
        }
    }
    
    return schema, nil
}

func BuildParameterSchema(fields []FieldDefinition) map[string]interface{} {
    // Build JSON schema from field definitions
    // ...
}

func ValidateSchemaConsistency() error {
    // Verify all registered types have valid schemas
    // Check for required sections in each schema
    // ...
}
  1. Add schema generation tests:

    • Test that all registered output types can generate valid schemas
    • Verify required fields are present
    • Check max limits are applied correctly
  2. Document schema generation approach in code comments and specification

Alternative: Document Current Approach

If schema generation is handled elsewhere or schemas are intentionally static:

  1. Add comments in safe_outputs_config.go explaining the schema approach
  2. Reference where schemas are defined (if in separate files)
  3. Add note about why dynamic generation is not used
  4. Update conformance checker to reflect actual implementation pattern

Verification

After remediation, verify the fix by running:

bash scripts/check-safe-outputs-conformance.sh

The IMP-003 check should pass without errors.

References

  • Safe Outputs Specification: docs/src/content/docs/reference/safe-outputs-specification.md (Schema Validation section)
  • Conformance Checker: scripts/check-safe-outputs-conformance.sh:355-376
  • Run ID: §22022248558
  • Date: 2026-02-14

Generated by Daily Safe Outputs Conformance Checker

  • expires on Feb 15, 2026, 6:37 PM UTC

Comments on the Issue (you are @copilot in this section)

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add comprehensive documentation to safe_outputs_config.go explaining hybrid schema approach
- Update conformance checker to validate actual implementation (safe_outputs_config_generation.go)
- Check for generateCustomJobToolDefinition function (dynamic schema generation)
- Check for safe_outputs_tools.json with inputSchema (static schemas)
- Verify schema architecture documentation exists
- IMP-003 conformance check now passes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add schema generation functions in safe_outputs_config.go Fix IMP-003: Document schema generation architecture and update conformance check Feb 14, 2026
Copilot AI requested a review from pelikhan February 14, 2026 18:49
@pelikhan pelikhan marked this pull request as ready for review February 14, 2026 18:50
Copilot AI review requested due to automatic review settings February 14, 2026 18:50
Copy link
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

Updates the Safe Outputs conformance checker (IMP-003) to validate the repository’s actual hybrid MCP schema architecture, and documents that architecture in the Safe Outputs config extractor.

Changes:

  • Adjusts IMP-003 checks to look for dynamic schema generation in safe_outputs_config_generation.go and static embedded schemas in js/safe_outputs_tools.json.
  • Adds an architecture overview comment to safe_outputs_config.go describing static vs dynamic schema generation, filtering, and validation coverage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scripts/check-safe-outputs-conformance.sh Updates IMP-003 to validate the hybrid schema implementation (dynamic generator + static embedded schemas + docs presence).
pkg/workflow/safe_outputs_config.go Adds in-file documentation describing where schema generation and validation live.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Check if safe outputs config generation file exists with schema functions
if [ -f "pkg/workflow/safe_outputs_config_generation.go" ]; then
# Check for schema generation functions (custom job tool definition generation)
if ! grep -q "generateCustomJobToolDefinition" "pkg/workflow/safe_outputs_config_generation.go"; then
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The grep for generateCustomJobToolDefinition matches any occurrence of the string (including comments). To avoid false positives, make the check look for the actual function definition (e.g., matching "^func generateCustomJobToolDefinition"), so IMP-003 fails if the function is removed but a comment remains.

Suggested change
if ! grep -q "generateCustomJobToolDefinition" "pkg/workflow/safe_outputs_config_generation.go"; then
if ! grep -qE '^[[:space:]]*func[[:space:]]+generateCustomJobToolDefinition\>' "pkg/workflow/safe_outputs_config_generation.go"; then

Copilot uses AI. Check for mistakes.
if ! grep -q "Schema Generation Architecture" "pkg/workflow/safe_outputs_config.go"; then
log_medium "IMP-003: Schema architecture documentation missing"
failed=1
fi
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

IMP-003 no longer fails if pkg/workflow/safe_outputs_config.go is missing. The previous check treated a missing config file as a failure; consider restoring an explicit existence check (and marking failed=1) so the conformance result can’t pass with an incomplete Safe Outputs implementation.

Suggested change
fi
fi
else
log_medium "IMP-003: Safe outputs config file missing"
failed=1

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit 41034f5 into main Feb 14, 2026
126 checks passed
@pelikhan pelikhan deleted the copilot/add-schema-generation-functions branch February 14, 2026 18:53
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.

[Safe Outputs Conformance] IMP-003: Schema generation functions missing in safe_outputs_config.go

2 participants