fix: surface server error body & cap scenarios#324
Conversation
SavioBS629
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Failed - see PR comment.
Claude Code PR ReviewPR: #324 • Head: 5f37f10 • Reviewers: stack:code-review SummaryPMAA-147 hardens the Test Case Generator (TCG) flow: batches test-case-detail fetches and bulk-create into chunks of ≤10, caps scenarios per document at 10, adds an 8-minute poll deadline, rewrites Review Table
Findings
Verdict: FAIL — the polling rewrite, instrumentation, auth, and multi-tenant rules are clean and the suite passes, but scenarios beyond the cap of 10 are silently discarded with the user told "N of N", a data-loss-without-surfacing path (High). Resolve that (most likely by removing the cap) before merge. |
SavioBS629
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Failed - see PR comment.
| export const BULK_CREATE_MAX_BATCH = 10; | ||
|
|
||
| // Cap scenarios per document (mirrors TCG's former maxScenariosPerDocument=10). | ||
| export const MAX_SCENARIOS_PER_DOCUMENT = 10; |
There was a problem hiding this comment.
[High] Scenarios beyond this cap are still silently discarded (unresolved)
Both the scenario and testcase branches gate on canAcceptScenario(scenariosMap, sc.id, MAX_SCENARIOS_PER_DOCUMENT). When the backend returns >10 distinct scenarios, the extras and all their test cases are dropped, and bulkCreateTestCases reports "…in <doneCount> of <total> scenarios" where total is the capped Object.keys(scenariosMap).length — so a 14-scenario doc reports "10 of 10" with no truncation notice.
The real backend constraint is 10 IDs per fetch-details request, already enforced by chunkArray(ids, TC_DETAILS_MAX_BATCH). This separate per-document scenario cap is reverse-engineered from a constant that isn't a real hard backend limit, and it's untested (no test covers the drop path).
Suggestion: Remove MAX_SCENARIOS_PER_DOCUMENT + the canAcceptScenario gating entirely. If a per-document cap is genuinely required, surface it — track the true incoming count and append "Note: N scenarios exceeded the per-document limit and were not created" to the result string, plus a test asserting the >10 case.
Reviewer: stack:code-review
| if (sc) { | ||
| if ( | ||
| sc && | ||
| canAcceptScenario(scenariosMap, sc.id, MAX_SCENARIOS_PER_DOCUMENT) |
There was a problem hiding this comment.
[High] Drop site for the silent scenario cap
This canAcceptScenario(..., MAX_SCENARIOS_PER_DOCUMENT) gate (and the matching one in the scenario branch) silently skips every scenario past the 10th — fetchTestCaseDetails is never called for it and its test cases are never created. Combined with the capped total in the result string, the user gets no signal that data was dropped. See the config.ts comment for the full finding and suggested fix.
Suggestion: Remove the per-document cap (chunking already handles the real per-request limit), or surface dropped scenarios in the result string.
Reviewer: stack:code-review
Claude Code PR ReviewPR: #324 • Head: 039dbd0 • Reviewers: stack:code-review SummaryRe-review of PMAA-147 TCG hardening (batch ≤10, deadline-bounded polling rewritten to recursive Review Table
Findings
Resolved since prior review
Verdict: FAIL — the recursive- |
Claude Code PR ReviewPR: #324 • Head: c064e62 • Reviewers: stack:code-review SummaryCap test case batches to 10 per request in TCG utilities by exporting a constant Review Table
FindingsNo blocking issues found. The PR applies a batch-size limit consistently across two test-case processing paths ( Verdict: PASS |
No description provided.