fix: align MCP gateway schema and reference examples by pelikhan · Pull Request #70865 · github/gh-aw · GitHub
Skip to content

fix: align MCP gateway schema and reference examples - #70865

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan-silver-memory
Oct 21, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan-silver-memory

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Allow the already implemented sandbox.mcp.trusted-bots configuration in the canonical workflow schema, requiring a nonempty array of safe literal identities. Validate the same identity characters at the renderer boundary to prevent shell expansion when callers bypass the schema.
  • Remove the unreachable trustedBots frontmatter extraction alias. Frontmatter uses sandbox.mcp.trusted-bots; generated gateway JSON uses gateway.trustedBots.
  • Correct the OIDC gateway reference example to put mcp-servers at the frontmatter root, with the required token permission and network allowlist.
  • Turn both examples into complete workflows and compile the actual documentation blocks in regression tests, asserting the emitted trusted-bot identities and OIDC gateway configuration.

Addresses the reproduced schema/example mismatches reported in #69855. This intentionally does not add unsupported tools.github.refusal-labels or change concurrency behavior.

ADR: ADR-70865

Validation

  • Reproduced the original trusted-bots schema rejection before the schema change.
  • Focused parser/workflow regressions pass for schema validation, extraction, renderer validation, and the complete reference examples. Tests reject command substitutions, backticks, variable/template expressions, malformed identities, and the unsupported camelCase frontmatter key without executing payloads.
  • make build and make fmt pass.
  • The final make agent-report-progress passed schema freshness and impacted unit tests, but did not pass the complete lint gate: Go lint encountered another runner's global lock, and custom lint flagged existing unchecked fmt.Fprintf calls in the now-touched renderer. Those calls are outside the added validation lines and write to a strings.Builder.
  • A bounded concurrent-runner Go lint retry produced no diagnostics and was stopped after exceeding its requested timeout. Full Go lint remains unverified.
  • Supplemental make check-workflow-drift passed after the review fixes: all 346 workflows compile, and all lock files remain in sync. Existing workflow warnings are unchanged.
  • Completed the generated ADR's context, decision, alternatives, and consequences. Its acceptance remains pending maintainer review; automation does not establish approval.

Publication uses the original session branch because the requested branch rename was blocked by an existing shared packed-refs.lock; no shared Git lock was removed.

Accept the existing trusted-bots gateway configuration with strict array validation and compile the complete trusted-bots and OIDC reference examples as regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 21, 2026 11:56
Copilot AI max review requested due to automatic review settings October 21, 2026 11:56
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · 5.88 AIC · ⌖ 5.3 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #70865

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Commit pushed: 3f5eaf3

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict

No blocking correctness issues found in the changed lines. The schema addition, corrected frontmatter placement, and documentation compilation coverage are consistent with the existing implementation. Static review only; tests and builds were not run.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · 2.45 AIC · ⌖ 0.539 AIC · ⊞ 1.6K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /grill-with-docs and /tdd (via pr-triage). This is a tight, well-tested fix for a real schema/docs mismatch.

📋 Key Themes & Highlights

Key Themes

  • Latent alias drift: The schema now validates trusted-bots (kebab-case), matching the extraction code, but the code also accepts a trustedBots camelCase alias (frontmatter_extraction_security.go:626) that the schema still rejects due to additionalProperties: false. The doc prose above the first example still references trustedBots too. Flagged inline — same bug class this PR fixes, just the other spelling.

Positive Highlights

  • ✅ Both reference examples are now complete, runnable workflows (frontmatter + body), not just fragments — directly addresses the discussions/69855 report.
  • ✅ mcp_gateway_reference_test.go extracts the doc fences and actually compiles them, asserting on emitted lock-file content (trustedBots array, OIDC URL/audience, id-token: write, token env vars). This closes the loop so docs drift will fail CI going forward — exactly the kind of regression guard /grill-with-docs asks for.
  • ✅ schema_trusted_bots_test.go covers the meaningful edge cases (empty list, empty string, mixed types, scalar, null) rather than just the happy path.
  • ✅ Verified locally: both new test files pass (go test ./pkg/parser/... -run TestSandboxMCPTrustedBotsSchema and ./pkg/workflow/... -run TestMCPGatewayReferenceExamplesCompile).

No blocking issues — the one inline comment is a pre-existing gap adjacent to this PR's scope, worth a quick follow-up rather than holding this up.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 31.1 AIC · ⌖ 15 AIC · ⊞ 10.2K
Comment /matt to run again

Comment thread pkg/parser/schemas/main_workflow_schema.json
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR adds more than 100 new lines in business logic directories (pkg/: 109 lines), but it has no linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/70865-compile-reference-doc-examples-as-regression-tests.md. Review and complete it before merging.

The draft records two decisions:

  • sandbox.mcp.trusted-bots is now allowed in the schema as a nonempty array of nonempty strings.
  • The mcp-gateway.md reference examples are compiled as regression tests. The test pulls the exact aw fenced blocks from the docs page.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR on your branch. It was generated from the PR diff.
  2. Complete the missing sections. Add context the AI couldn't infer (for example, deciders), refine the rationale, and confirm the alternatives you actually considered.
  3. Commit the finalized ADR to docs/adr/ on your branch.
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-70865: Expose sandbox.mcp.trusted-bots in the Schema and Compile Reference Doc Examples as Regression Tests

Once an ADR is linked in the PR body, this gate will re-run and check that the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context: What is the problem? What forces are at play?
  • Decision: What did you decide, and why?
  • Alternatives Considered: What else could have been done?
  • Consequences: What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus55 · 24.4 AIC · ⌖ 40.4 AIC · ⊞ 1.9K · ◷
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Accepted trusted-bot values can execute shell commands during generated gateway setup.

1 open issue
What changed in this PR

Aligns MCP gateway schema validation and documentation with existing compiler support.

Changes:

  • Adds sandbox.mcp.trusted-bots schema support.
  • Makes both reference examples complete workflows and corrects OIDC configuration.
  • Adds schema validation and documentation-compilation regression tests.
File Description
pkg/​workflow/​mcp_gateway_reference_test.go Compiles documentation examples and checks generated configuration.
pkg/​parser/​schemas/​main_workflow_schema.json Allows nonempty trusted-bot lists.
pkg/​parser/​schema_trusted_bots_test.go Tests accepted and rejected trusted-bot values.
docs/​src/​content/​docs/​reference/​mcp-gateway.md Provides complete trusted-bot and OIDC workflows.

Review effort: Max

Comment thread pkg/parser/schemas/main_workflow_schema.json
Remove the unreachable camelCase frontmatter alias, validate literal identities at the schema and renderer boundaries, cover unsafe substitutions without executing them, and complete the design decision record.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to #70865 (comment):

No code change is needed for this completion notice because it contains no concrete finding. I validated the actual revision separately with focused schema/gateway tests and the 346-workflow drift check; the remaining lint limitations are recorded in the PR description.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to #70865 (comment):

No code change is needed for this status-only report, and reported_no_action is not being treated as validation evidence. The review fixes were independently tested and published in c921e3d, with incomplete lint coverage called out explicitly.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to #70865 (comment):

The completion notice itself requires no additional code change; the substantive alias feedback was accepted and addressed in its inline thread. Frontmatter now consistently uses trusted-bots, while gateway JSON uses trustedBots, with regression coverage for that boundary.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to #70865 (comment):

Accepted the generated ADR follow-up: I reviewed and completed the draft rather than treating this completion notice as approval. The ADR now records the final identity validation and reference-test decisions and is linked in the PR body.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

In response to #70865 (comment):

No additional code change is required by this completion notice, which contains no concrete finding. The separate alias and shell-safety findings were addressed, and the final validation results and lint limitations are documented in the PR description.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@pelikhan
pelikhan merged commit 5f09008 into main Oct 21, 2026
56 checks passed
@pelikhan
pelikhan deleted the pelikhan-silver-memory branch October 21, 2026 14:26
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.

2 participants