Skip to content

sequant_logs: include QA verdict summary in structured output #434

Closed

Description

@admarble

Problem

When reviewing QA results for multiple issues, sequant_logs only returns phase-level pass/fail status. To see the actual QA findings (AC coverage, gaps, suggestions), you must separately fetch issue comments via the GitHub API.

This creates friction in the batch QA review workflow — checking gaps for 4 issues required 7+ API calls hunting through PR comments, PR reviews, and issue comments to find the right content.

Proposed Solution

Include a condensed QA verdict summary in the sequant_logs response for phases where phase === "qa". For example:

{
  "phase": "qa",
  "status": "success",
  "durationSeconds": 362.409,
  "verdict": "READY_FOR_MERGE",
  "summary": {
    "acMet": 3,
    "acTotal": 3,
    "gaps": [],
    "suggestions": ["Consider adding SHA format regex validation"]
  }
}

Alternatives

  • Pointer only: Include a link/reference to the issue comment containing the full QA review, rather than embedding the summary
  • Status quo: Keep logs lightweight, rely on issue comments for details

Context

Discovered during batch QA of #325, #377, #384, #378. QA reviews are posted as issue comments, but this isn't obvious — searched PR comments and PR reviews first before finding them.

Activity

  1. added
    enhancement
    on Mar 25, 2026
  2. admarble commented on Mar 26, 2026

    @admarble
    ContributorAuthor

    → CLARIFY — No explicit acceptance criteria; three approaches proposed (full summary, pointer, status quo) with no decision

    Need: explicit ACs and decision on which approach to implement

  3. admarble commented on Mar 28, 2026

    @admarble
    ContributorAuthor

    Spec Plan — #434: Include QA verdict summary in sequant_logs

    Acceptance Criteria

    • AC-1: Expose existing verdict field in sequant_logs MCP response (already stored in PhaseLog, currently omitted from mapping)
    • AC-2: Add qaSummary schema to PhaseLog with fields: acMet, acTotal, gaps[], suggestions[]
    • AC-3: Parse AC coverage data from QA output text during phase execution (new parseQaSummary function alongside existing parseQaVerdict)
    • AC-4: Store parsed QA summary in PhaseLog during batch execution and pass through to log files
    • AC-5: Backward compatibility — old logs without qaSummary parse without errors

    Verification Criteria

    AC Method Given/When/Then
    AC-1 Unit Test Given log with verdict → When sequant_logs called → phase includes verdict
    AC-2 Unit Test Given log with qaSummary → When parsed → validates against QaSummarySchema
    AC-3 Unit Test Given QA output text → When parseQaSummary called → returns { acMet, acTotal, gaps, suggestions }
    AC-4 Unit Test Given QA phase completes → When completePhaseLog called → PhaseLog contains qaSummary
    AC-5 Unit Test Given old log without qaSummary → When parsed → no errors, field is undefined

    Implementation Plan

    Phase 1: Schema — Add QaSummarySchema to run-log-schema.ts, add optional qaSummary to PhaseLogSchema

    Phase 2: Parser — Add parseQaSummary(output) in phase-executor.ts to extract AC results, gaps, suggestions from QA output

    Phase 3: Capture — Wire parseQaSummary into batch-executor.ts to store summary in PhaseLog alongside verdict

    Phase 4: Expose — Add verdict and qaSummary to MCP response mapping in mcp/tools/logs.ts

    Design Decisions

    1. Parse from output text vs read from state.json: Parse from output — logs should be self-contained snapshots, not coupled to mutable state
    2. Pattern: Follows existing parseQaVerdict + optional PhaseLog field pattern exactly
    3. Backward compat: All new fields are optional in schema; old logs parse unchanged

    Non-Goals

    • Extracting full QA review text (only condensed summary)
    • Changing how/where QA reviews are posted to GitHub
    • Adding new MCP tool parameters for QA filtering

    Scope

    ✅ SCOPE_OK — Single feature, 4 AC items, 2 directories

  4. added a commit that references this issue on Mar 28, 2026
  5. admarble commented on Mar 28, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #434

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Expose existing verdict field in MCP response MET Conditional spread ...(p.verdict && { verdict: p.verdict }) in logs.ts
    AC-2 Original Add qaSummary schema to PhaseLog MET QaSummarySchema with acMet, acTotal, gaps, suggestions in run-log-schema.ts
    AC-3 Original Parse AC coverage data from QA output MET parseQaSummary() in phase-executor.ts with 8 unit tests
    AC-4 Original Store parsed QA summary in PhaseLog during execution MET Wired through phase-executor → batch-executor → log-writer
    AC-5 Derived Backward compatibility — old logs parse without errors MET All new fields are optional; explicit backward compat test added

    Coverage: 5/5 AC items fully met


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 9 OK
    Lines added +324 -
    Lines deleted -2 -
    Security patterns 0 OK

    CI Status

    Check State Bucket
    build (20.x) SUCCESS pass
    build (22.x) SUCCESS pass
    typecheck SUCCESS pass
    validate-plugin SUCCESS pass
    validate-skills SUCCESS pass

    CI Summary: 5/5 passed


    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    phase-executor.ts Standard ✅ Yes phase-executor.test.ts
    run-log-schema.ts Standard ✅ Yes run-log-schema.test.ts
    batch-executor.ts Standard ✅ Yes batch-executor.test.ts (existing)
    log-writer.ts Standard ✅ Yes log-writer.test.ts (existing)
    types.ts Optional - Types only
    logs.ts Standard ✅ Yes server.test.ts (existing)

    Coverage: 5/6 changed source files have tests (types-only file excluded)


    Code Review

    Strengths:

    • Clean, focused implementation following existing patterns exactly (parseQaVerdict → parseQaSummary)
    • All new schema fields are optional — fully backward compatible
    • Comprehensive test suite (8 parser tests + 4 schema tests)
    • Conditional spread in MCP response avoids cluttering non-QA phases with empty fields

    Issues:

    • None

    Suggestions:

    • None — implementation is minimal and focused

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Tests assert on parsed output structure, not regex internals
    Coverage Depth ✅ OK Standard table, compact table, mixed statuses, realistic full output, null cases
    Mock Hygiene ✅ OK Pure function tests — no mocks needed
    Test Reliability ✅ OK Deterministic string-in, object-out tests

    Call-Site Review

    New exported functions: 1 (parseQaSummary)

    Function Call Sites Loop? Conditions AC Match
    parseQaSummary() phase-executor.ts:424 No phase === "qa" && agentResult.output ✅ Matches AC-3

    Self-Evaluation

    • Verified working: Yes — build passes, all 130 targeted tests pass, CI green
    • Test efficacy: High — parser tests cover all QA output formats including realistic multi-section output
    • Likely failure mode: QA output format changes (e.g., new AC status values) — parser would return null gracefully
    • Verdict confidence: High — additive change, no existing behavior modified, comprehensive tests

    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (MCP tool response enriched)
    [Unreleased] entry ✅ Present
    Entry format ✅ Valid (includes #434)

    Verdict: READY_FOR_MERGE

    All 5 AC items met. Clean implementation following established patterns. Comprehensive test coverage. Backward compatible. CI green.

    Next Steps

    1. Merge PR feat(#434): include QA verdict summary in sequant_logs output #481
  6. added 2 commits that reference this issue on Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions