Skip to content

feat(#1200): mcp sequant_run result carries each issue's qa summary and findings - #1218

Merged
admarble merged 4 commits into
mainfrom
feature/1200-feat-mcp-sequant-run-result-carries-each-issue-s-q
Sep 29, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1200-feat-mcp-sequant-run-result-carries-each-issue-s-q

Conversation

@admarble

@admarble admarble commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • RunToolIssueSummary gains optional acMet/acTotal/gaps/findings/truncated fields, read through from the qa phase's existing PhaseLog.summary (no schema change), for every verdict — not just success.
  • capFindings caps findings at 10 entries, with description/evidence at 300 chars each. capGaps applies the same limits to gaps, which repeats the findings' descriptions (a QA AC_NOT_MET finding: with only findings capped, the full text rode along in gaps). Any cap sets truncated: true.
  • enforceResponseSizeLimit now does more than trim rawOutput/error. If the response is still over 64KB (a many-issue run), it drops findings, then gaps, from the last issue backward, and sets truncated. acMet/acTotal/verdict always survive.

Pre-PR AC Verification

AC Description Status Evidence
AC-1 Each issue's result includes the qa summary (acMet/acTotal/gaps/findings) for every verdict ✅ Implemented src/mcp/tools/run.ts buildStructuredResponse; tests in src/mcp/tools/run.test.ts — describe("buildStructuredResponse — qa summary (#1200 AC-1)"), parametrized over all four verdicts
AC-2 Findings capped (count + length) with a truncated flag, result stays under the MCP size limit ✅ Implemented src/mcp/tools/run.ts capFindings/capGaps/enforceResponseSizeLimit; tests in describe("buildStructuredResponse — findings capping (#1200 AC-2)"), including a 12-issue run asserted <= 64 * 1024 bytes

Test plan

  • npm run build passes
  • npm run lint passes (0 errors)
  • npx vitest run src/mcp/tools/run.test.ts — 95 passed (85 pre-existing + 10 new), runner re-run after the QA fix
  • npx tsc --noEmit clean; npx eslint src/mcp/tools/run.ts clean

Mutation checks (runner, after QA fix)

Mutation-verified: AC-2 — capGaps(qaSummary.gaps) replaced with a passthrough; caps gaps by count and length failed (1/95); restored.

Mutation-verified: AC-2 — the findings/gaps drop loop in enforceResponseSizeLimit emptied; keeps a many-issue run … under the 64KB limit failed (1/95); restored.

Pre-PR Confidence Check

  • Weakest part: Cap constants (10 entries / 300 chars) are a starting guess per the spec's Open Question 1. The 64KB bound no longer depends on them, because the drop pass enforces it.
  • Coverage gaps: None — both ACs have direct unit test coverage in the same file the AC evidence names.

Closes #1200
Refs #1203

🤖 Generated with Claude Code

@admarble
admarble merged commit 8edb0e0 into main Sep 29, 2026
7 checks passed
@admarble
admarble deleted the feature/1200-feat-mcp-sequant-run-result-carries-each-issue-s-q branch September 29, 2026 19:03
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.

feat(mcp): sequant_run result carries each issue's QA summary and findings

1 participant