Skip to content

PDX-476: fix(mcp): address Copilot review follow-ups from PR #161#162

Merged
mrdailey99 merged 1 commit into
developfrom
fix/PDX-476-copilot-pr161-followup
May 12, 2026
Merged

PDX-476: fix(mcp): address Copilot review follow-ups from PR #161#162
mrdailey99 merged 1 commit into
developfrom
fix/PDX-476-copilot-pr161-followup

Conversation

@mrdailey99
Copy link
Copy Markdown
Collaborator

@mrdailey99 mrdailey99 commented May 12, 2026

Summary

  • Fix ajvErrorToIssue to use err.params.additionalProperty/missingProperty for accurate field/applies_to on additionalProperties and required AJV errors
  • Normalize docs/NITROX_CATALOG_SOURCE.json to stable shape: remove repo field, add schemasUpdated: null
  • Add provardx-cli bin alias in package.json so npx -y @provartesting/provardx-cli resolves unambiguously by package name
  • Update stale "7 MCP prompts" count to 11 in README.md and docs/mcp.md

Jira

https://provartesting.atlassian.net/browse/PDX-476

Test plan

  • yarn compile passes
  • yarn test:only passes (954 passing)
  • yarn lint passes
  • node scripts/mcp-smoke.cjs passes

Changes

  • src/mcp/tools/nitroXTools.ts: special-case additionalProperties/required keywords in ajvErrorToIssue to pull property names from err.params
  • docs/NITROX_CATALOG_SOURCE.json: remove repo, add schemasUpdated: null
  • package.json: add provardx-cli bin alias pointing to ./bin/mcp-start.js
  • README.md, docs/mcp.md: update prompt count from 7 to 11

RCA: Four issues identified in post-merge Copilot review: AJV error
mapping for additionalProperties/required used instancePath (parent
object) instead of err.params, NITROX_CATALOG_SOURCE.json had an
exposed repo field and missing schemasUpdated key, the provardx-cli
bin alias was absent making npx resolution ambiguous, and prompt
counts in README/docs were stale at 7 (now 11).
Fix: ajvErrorToIssue now special-cases additionalProperties and
required keywords to pull field/applies_to from err.params; committed
JSON normalised to stable shape; package.json adds provardx-cli bin
alias; README.md and docs/mcp.md updated to 11 MCP prompts.
Copilot AI review requested due to automatic review settings May 12, 2026 21:24
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

Quality Orchestrator

🟢 LOW · 2 / 100 · All changed files have mapped tests.


🧪 Tests to Run · Running 1 of 43 tests

  • unit/mcp/nitroXTools.test.ts
▶ Run command
npx vitest run \
  unit/mcp/nitroXTools.test.ts

⚡ quality-orchestrator  ·  /qo stub <file>  ·  qo analyze-local

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 addresses follow-ups from PR #161 by improving NitroX AJV schema validation issue mapping, stabilizing NitroX catalog source metadata shape, ensuring npx -y @provartesting/provardx-cli resolves a predictable bin name, and updating documentation to reflect the current number of MCP prompts.

Changes:

  • Update ajvErrorToIssue to derive field/applies_to from err.params for AJV additionalProperties and required errors.
  • Normalize docs/NITROX_CATALOG_SOURCE.json to a stable/public shape (remove repo, add schemasUpdated: null).
  • Add a provardx-cli bin alias and refresh docs prompt counts (7 → 11).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mcp/tools/nitroXTools.ts Improves AJV error → NitroX issue mapping for additionalProperties/required keywords.
README.md Updates documented MCP prompt count to 11.
package.json Adds provardx-cli bin alias pointing to the MCP start script.
docs/NITROX_CATALOG_SOURCE.json Stabilizes catalog source metadata shape (remove repo, add schemasUpdated).
docs/mcp.md Updates documented MCP prompt count to 11.

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

Comment on lines 69 to 88
@@ -75,7 +84,7 @@ function ajvErrorToIssue(err: ErrorObject): NitroXIssue {
message: `Schema: ${instancePath || 'root'} — ${err.message ?? 'validation failed'}`,
applies_to: appliesTo,
};
if (pathParts.length > 0) issue.field = pathParts[pathParts.length - 1];
issue.field = leafProp ?? (pathParts.length > 0 ? pathParts[pathParts.length - 1] : undefined);
return issue;
@mrdailey99 mrdailey99 merged commit 85516e7 into develop May 12, 2026
12 checks passed
mrdailey99 added a commit that referenced this pull request May 12, 2026
…talog source shape, bin alias, prompt count + test coverage (#164)

* PDX-476: fix(mcp): address Copilot review follow-ups from PR #161 (#162)

RCA: Four issues identified in post-merge Copilot review: AJV error
mapping for additionalProperties/required used instancePath (parent
object) instead of err.params, NITROX_CATALOG_SOURCE.json had an
exposed repo field and missing schemasUpdated key, the provardx-cli
bin alias was absent making npx resolution ambiguous, and prompt
counts in README/docs were stale at 7 (now 11).
Fix: ajvErrorToIssue now special-cases additionalProperties and
required keywords to pull field/applies_to from err.params; committed
JSON normalised to stable shape; package.json adds provardx-cli bin
alias; README.md and docs/mcp.md updated to 11 MCP prompts.

* PDX-476: test(mcp): assert field/applies_to for AJV additionalProperties and required errors

RCA: Copilot review noted that the new ajvErrorToIssue params-based mapping
for additionalProperties and required keywords had no test coverage for the
field and applies_to values, leaving the mapping free to silently regress.
Fix: Expanded NX_SCHEMA_ADDITIONAL_PROPERTIES test to assert field and
applies_to equal the extra property name; added NX_SCHEMA_REQUIRED case
asserting field and applies_to equal the missing property name; added
applies_to/field assertions to the NX_SCHEMA_TYPE test.
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