Skip to content

PDX-512: fix(mcp): correct invalid TryCatchFinally apiId to control.Finally#221

Merged
mrdailey99 merged 1 commit into
developfrom
fix/PDX-512-trycatchfinally-apiid
Jun 8, 2026
Merged

PDX-512: fix(mcp): correct invalid TryCatchFinally apiId to control.Finally#221
mrdailey99 merged 1 commit into
developfrom
fix/PDX-512-trycatchfinally-apiid

Conversation

@mrdailey99

Copy link
Copy Markdown
Collaborator

Summary

  • com.provar.plugins.bundled.apis.control.TryCatchFinally does not exist in Provar — the canonical control-flow step is com.provar.plugins.bundled.apis.control.Finally (confirmed against a live Provar project and provar_test_step_schema.json).
  • The bogus id was published in the reference doc (an MCP resource), whitelisted in the bestPracticesEngine VALID_API_IDS allow-list, and referenced in the loop authoring prompts — so API-UNKNOWN-001 never flagged it and agents were steered toward generating a step Provar cannot load.
  • Also corrected a doubled list.ListCompareListCompare apiId in the schema (the correct id, list.ListCompare, was already in the doc and allow-list).

Jira

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

Changes

  • src/mcp/tools/bestPracticesEngine.ts: removed the invalid control.TryCatchFinally from VALID_API_IDS (the correct control.Finally was already present); updated a stale doc comment.
  • docs/PROVAR_TEST_STEP_REFERENCE.md: normalized all 6 TryCatchFinally references to Finally — table row, section heading, example apiId + name=, and the cleanup checklist (kept the descriptive title="Try/Catch/Finally").
  • src/mcp/prompts/loopPrompts.ts: reworded two prose references from TryCatchFinally to "a Finally block (try/catch/finally)".
  • src/mcp/rules/provar_test_step_schema.json: fixed ListCompareListCompareListCompare.
  • test/unit/mcp/bestPracticesEngine.test.ts: added a data-driven parity test that extracts every apiId documented in PROVAR_TEST_STEP_REFERENCE.md and asserts the validator raises no API-UNKNOWN-001 for any of them — locking the reference doc to the allow-list so the two can never silently drift again — plus explicit regressions that the bogus TryCatchFinally is now flagged and that control.Finally passes.
  • package.json + server.json: bumped version 1.6.0 → 1.6.1 (kept in sync).

Test plan

  • yarn compile passes
  • unit tests pass (1482 passing; 3 new PDX-512 tests green)
  • yarn lint passes
  • mcp-smoke.cjs: 29/31 PASS — the 2 failures (provar_automation_compile, provar_automation_testrun) are pre-existing environmental timeouts (require a live Provar runtime + Salesforce org), unrelated to this change

Public-docs follow-up

docs/PROVAR_TEST_STEP_REFERENCE.md is an MCP resource served verbatim to agents. If the customer-facing docs (provar-mcp-public-docs, University of Provar course) mirror the TryCatchFinally/ListCompare step references, the Provar team should update those manually.

RCA: docs/PROVAR_TEST_STEP_REFERENCE.md, the bestPracticesEngine VALID_API_IDS allow-list and the loop prompts all referenced control.TryCatchFinally, an apiId that does not exist in Provar (the canonical control-flow step is control.Finally), and the schema also carried a doubled list.ListCompareListCompare
Fix: normalized every TryCatchFinally reference to control.Finally across the reference doc, allow-list, comment and prompts; corrected the ListCompare schema apiId; added a data-driven test pinning every documented apiId to the validator allow-list; bumped version to 1.6.1 and synced server.json

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Quality Orchestrator

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


🧪 Tests to Run · Running 2 of 57 tests

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

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

@mrdailey99 mrdailey99 merged commit da75f0f into develop Jun 8, 2026
4 checks passed
@mrdailey99 mrdailey99 deleted the fix/PDX-512-trycatchfinally-apiid branch June 8, 2026 15:43
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.

1 participant