Fix IMP-003: Document schema generation architecture and update conformance check#15744
Fix IMP-003: Document schema generation architecture and update conformance check#15744
Conversation
- 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>
There was a problem hiding this comment.
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.goand static embedded schemas injs/safe_outputs_tools.json. - Adds an architecture overview comment to
safe_outputs_config.godescribing 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 |
There was a problem hiding this comment.
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.
| 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 |
| if ! grep -q "Schema Generation Architecture" "pkg/workflow/safe_outputs_config.go"; then | ||
| log_medium "IMP-003: Schema architecture documentation missing" | ||
| failed=1 | ||
| fi |
There was a problem hiding this comment.
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.
| fi | |
| fi | |
| else | |
| log_medium "IMP-003: Safe outputs config file missing" | |
| failed=1 |
IMP-003 conformance check failed looking for schema generation in
safe_outputs_config.go, but schema generation is implemented insafe_outputs_config_generation.gowith proper separation of concerns.Changes
Documentation: Added architecture overview to
safe_outputs_config.goexplaining:js/safe_outputs_tools.jsongenerateCustomJobToolDefinition()builds MCP schemas for custom jobsConformance checker: Updated IMP-003 to validate actual implementation:
safe_outputs_config_generation.goforgenerateCustomJobToolDefinitionjs/safe_outputs_tools.jsoncontains MCPinputSchemadefinitionsArchitecture
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/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)/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)/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/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)/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)/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/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/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/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/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/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/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/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/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)/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)/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/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/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)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo(http block)/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/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/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)/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)/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
💡 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.