LearnNewsExamplesServices
Frontmatter
id16194
titleMechanize believed-open MCP schema and query oracle
stateClosed
labels
bugaitesting
assigneesneo-gpt-emmy
createdAtJul 30, 2026, 11:36 PM
updatedAtJul 31, 2026, 1:30 AM
githubUrlhttps://github.com/neomjs/neo/issues/16194
authorneo-gpt-emmy
commentsCount0
parentIssue16136
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 31, 2026, 1:30 AM

Mechanize believed-open MCP schema and query oracle

Closed Backlog/active-chunk-11 bugaitesting
neo-gpt-emmy
neo-gpt-emmy commented on Jul 30, 2026, 11:36 PM

Summary

Repair two post-merge verification gaps in the believed-open list_pull_requests leaf:

  1. OpenAPI array constraints are declared but do not reach the generated MCP tools/list schema.
  2. The default-query regression test imports its expected query from production, so production and oracle can drift together.

This is a narrow successor to the resolved feature ticket and PR. It restores executable contract truth without changing the belief projection, adding an MCP tool, or broadening the response shape.

Problem

The merged OpenAPI source declares maxItems: 100 and uniqueItems: true for believedOpen. The shared OpenAPI-to-Zod compiler currently drops both keywords, so the actual list_pull_requests.inputSchema published through tools/list does not contain the constraints. A raw-YAML assertion can therefore pass while the agent-consumed contract is weaker than declared.

The no-belief regression test also imports the production FETCH_PULL_REQUESTS constant as its expected value. That proves the captured query equals itself, not that the predecessor query bytes remain stable.

Architectural reality

  • ai/mcp/validation/openApiValidator.mjs owns OpenAPI → Zod → emitted MCP input-schema compilation.
  • test/playwright/unit/ai/mcp/validation/OpenApiValidatorCompliance.spec.mjs owns the generic compiler contract.
  • The GitHub Workflow MCP tool service owns the real tools/list publication surface.
  • test/playwright/unit/ai/services/github-workflow/PullRequestService.spec.mjs owns the default-query regression witness.

No new subsystem or file is required.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
Existing list_pull_requests.inputSchema.properties.believedOpen emitted by tools/list ai/mcp/server/github-workflow/openapi.yaml through the shared compiler Publish an array of unique positive integers with at most 100 entries Invalid duplicate, non-positive, or over-cap values remain rejected before GitHub I/O by the direct service guard No new docs; preserve the existing OpenAPI declaration Generic compiler tests plus the real GitHub tool-service listTools() projection
Existing no-belief GraphQL request in PullRequestService.listPullRequests() Merged predecessor behavior from PR #16170 Preserve the predecessor query at 987 bytes and SHA-256 68b60ee57194252d68f3b50f2e174f25ff3859d3ba89bd2a66d7e2d873e1914f Any byte drift fails against an independent literal oracle JSDoc remains current Captured default-path query length and digest assertions

Acceptance Criteria

  • The generated real list_pull_requests MCP input schema contains type: array, maxItems: 100, uniqueItems: true, and an integer item minimum of 1.
  • OpenAPI-derived runtime validation rejects duplicate and over-cap arrays; generic minItems behavior is also covered.
  • The existing direct service guard remains authoritative and rejects invalid believedOpen input before GitHub I/O.
  • The no-belief test verifies the captured query against an independent 987-byte / SHA-256 predecessor oracle rather than importing the production constant.
  • Focused compiler, tool-registration, and service tests pass.
  • The MCP catalog smoke suite passes.

Out of Scope

  • Refining unverifiable reasons from GitHub response.errors; that is a separate diagnosability concern.
  • Changing the three result buckets or belief-projection semantics.
  • Adding an MCP tool, compatibility layer, state, or request.
  • General OpenAPI completeness beyond array constraints already present in the current server specifications.

Avoided Traps

  • Treating raw YAML as proof of the emitted tools/list contract.
  • Importing the production query as its own regression oracle.
  • Reopening the resolved predecessor ticket.
  • Mixing response diagnosability into a compiler-and-test restoration.

Decision Record Impact

None. This restores the declared and merged contract; it introduces no architectural decision.

Relationships

Parent: #16136

Successor to #16191

Related: #16192, #16170

Retrieval Hint

#16192 generated tools/list maxItems uniqueItems self-referential FETCH_PULL_REQUESTS oracle

Origin Session

b1ebc46a-5a83-496c-aa8b-385af785e9cb

tobiu referenced in commit c59dc15 - "fix(github): mechanize believed-open schema constraints (#16194) (#16195)" on Jul 31, 2026, 1:30 AM
tobiu closed this issue on Jul 31, 2026, 1:30 AM