GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — P2: Test Expectations Misalignment — API Documentation & Coverage · Issue #1716 · lightspeedwp/.github

P2: Test Expectations Misalignment — API Documentation & Coverage #1716

New issue
Copy link
New issue
Copy link
Closed
#1729
Closed
P2: Test Expectations Misalignment — API Documentation & Coverage#1716
#1729
Copy link
Assignees
ashleyshaw
Labels
meta:needs-changelogmigrate:meta:needs-changelogRequires a changelog entry before mergemigrate:priority:importantMust-do high prioritymigrate:priority:normalDefault prioritymigrate:status:needs-more-infoMissing details to proceedmigrate:type:bugBug or defectmigrate:type:testTesting/coveragepriority:importantpriority:normalstatus:needs-more-infostatus:needs-template-fixtype:bugtype:test

Description

@ashleyshaw
ashleyshaw
opened on Aug 10, 2026
Issue body actions

Overview

Priority: P2 (Testing/Quality)
Type: Test Quality & Documentation
Blocking: No (tests pass, but weak test coverage)
Effort: 4–5 hours
Related: PR #1713 (Phase 3 findings)

Problem Statement

The handle-needs-triage handler tests codify arbitrary behavior instead of verifying the documented handler API. Tests accept overly-permissive assertions that may mask logic bugs in the issue triage automation system.

Files Affected

  • scripts/automation/__tests__/handle-needs-triage.test.js (lines 17, 27, 37, 46, 57, 50-58)
  • scripts/agents/includes/handle-needs-triage.js (handler implementation)
  • Docs: docs/HANDLER_API_REFERENCE.md (documentation)

Impact Assessment

  • Current State: Non-blocking (tests pass 100%, but weak)
  • Risk Scope: Issue triage handler inference logic, confidence score interpretation
  • Blocking Tests: None (tests pass)
  • CI Status: ✅ CI passes (tests pass, but assertions are weak)
  • Quality Risk: Weak tests may mask logic bugs during refactoring

Problem Details

Issue 1: Arbitrary Default Behavior

Lines 17, 27, 37, 46, 57
Tests assert that confidence < 0.3 for generic input remains untyped, but tests don't verify:

  • Why this threshold exists
  • What the handler actually implements
  • Whether behavior matches documentation

Issue 2: Overly-Permissive Assertions

Lines 50-58
Tests accept first zero-score entry instead of requiring meaningful confidence:

  • Current: expect(result.type).toBe(firstZeroScoreEntry.type)
  • Problem: Accepts any low-confidence match, doesn't verify meaningful inference
  • Risk: May mask bugs in scoring logic

Issue 3: Weak Edge Case Coverage

Missing tests for:

  • Empty issue content
  • Mixed keywords (ambiguous typing)
  • Low confidence scores
  • Boundary conditions

Remediation Scope

1. Audit Handler Implementation

  • Review handle-needs-triage.js actual behavior
  • Document actual confidence thresholds
  • Identify undocumented quirks or edge cases
  • Map test assertions to handler code paths

2. Update Test Expectations

  • Match test assertions to actual handler behavior
  • Fix overly-permissive tests
  • Document why tests assert what they do (WHY comments)
  • Link test assertions to handler documentation

3. Add Edge Case Tests

  • Empty issue content → should not crash, returns default
  • Mixed keywords → ambiguous typing, return lowest-confidence option
  • Low confidence scores → verify threshold behavior
  • Boundary conditions → confidence exactly at threshold

4. Document Handler API

  • Configuration options
  • Confidence threshold behavior (≥0.3 for type, <0.3 untyped)
  • Return value semantics (type field, confidence field, etc.)
  • Known limitations and assumptions

Completion Criteria

  • All test assertions justified
  • Edge cases covered
  • Handler API documented
  • No weak tests that mask bugs
  • All tests passing (existing + new)
  • Code review approved
  • Merged to develop

Testing

  • Unit tests for each confidence level (0, 0.15, 0.3, 0.5, 1.0)
  • Edge case tests (empty, ambiguous, boundary)
  • Integration test with real issue data
  • Documentation review

References

  • Related Issue: Develop Branch Stability Initiative (chore: Establish develop branch stability baseline #1713)
  • Test Status: Initial report in Phase 3 audit
  • Handler: scripts/agents/includes/handle-needs-triage.js
  • Tests: scripts/automation/__tests__/handle-needs-triage.test.js

Suggested Owner: @ash (or assign based on availability)
Timeline: After issue #1715 completes
Labels: type:testing-coverage, priority:important, area:automation, meta:needs-changelog

Activity

  1. linear-code commented on Aug 10, 2026

    @linear-code
    linear-codeBot
    on Aug 10, 2026 – with Linear Code
    More actions

    LS-2425

  2. ashleyshaw
    added
    migrate:type:testTesting/coverage
    migrate:priority:importantMust-do high priority
    migrate:meta:needs-changelogRequires a changelog entry before merge
    on Aug 10, 2026
  3. ashleyshaw
    added a commit that references this issue on Aug 10, 2026

    docs: Update project files with PR #1713 and follow-up issue references

    ec53cdf
  4. github-actions commented on Aug 10, 2026

    @github-actions
    github-actionsBot
    on Aug 10, 2026 – with GitHub Actions
    Contributor
    More actions

    ⚠️ This issue does not follow a required issue template.

    Missing required section(s): Definition of Ready (DoR), Definition of Done (DoD)

    The issue will remain open and flagged until the body is corrected.
    Please update the issue with one of the official templates:

    • https://github.com/lightspeedwp/.github/issues/new/choose

    If this was opened by automation, update the automation to preserve the template sections before creating the issue.

  5. github-actions
    added
    migrate:status:needs-more-infoMissing details to proceed
    migrate:priority:normalDefault priority
    migrate:status:needs-triageNeeds triage
    migrate:type:bugBug or defect
    on Aug 10, 2026
  6. github-actions commented on Aug 10, 2026

    @github-actions
    github-actionsBot
    on Aug 10, 2026 – with GitHub Actions
    Contributor
    More actions

    ⏱️ Aging and SLA annotation

    • Age: 0 day(s)
    • SLA state: Within SLA
    • Thresholds: warn at 7 days, breach at 14 days
    • Last updated: 2026-08-10T16:54:06.097Z

    Maintained by project-meta-sync workflow.

  7. ashleyshaw
    added 6 commits that reference this issue on Aug 10, 2026

    chore: Establish develop branch stability baseline (#1713)

    16f0eec

    fix: Remove non-functional gitOps test and update CHANGELOG (#1715 #1716

    42f51fe

    fix: Fix changelog regex bugs and strengthen test assertions (#1715 #…

    1f1c35e

    docs: Add CHANGELOG entry for regex bug fixes and test improvements (#…

    0caa628

    fix: Remove non-functional gitOps test and update CHANGELOG (#1715 #1716

    4f15688

    fix: Fix changelog regex bugs and strengthen test assertions (#1729)

    f4f5092
  8. ashleyshaw
    closed this as completedin #1729on Aug 11, 2026
  9. github-actions
    added
    status:needs-template-fix
    and removed
    migrate:status:needs-triageNeeds triage
    on Aug 11, 2026
  10. ashleyshaw
    self-assigned this
    on Sep 8, 2026
  11. linear-code
    added
    priority:important
    priority:normal
    status:needs-more-info
    type:bug
    type:test
    meta:needs-changelog
    on Sep 8, 2026
  12. github-actions commented on Sep 8, 2026

    @github-actions
    github-actionsBot
    on Sep 8, 2026 – with GitHub Actions
    Contributor
    More actions

    ⚠️ Bare Labels Detected

    This issue has labels that are not in the canonical taxonomy:

    • migrate:priority:important
    • migrate:priority:normal
    • migrate:status:needs-more-info
    • migrate:meta:needs-changelog
    • migrate:type:bug
    • migrate:type:test
    • status:needs-template-fix

    Valid Canonical Labels

    Please use labels with a prefix from the canonical taxonomy:

    • Type: type:bug, type:feature, type:task, type:documentation, etc.
    • Status: status:needs-triage, status:in-progress, status:done, etc.
    • Priority: priority:critical, priority:high, priority:normal, priority:low
    • Area: area:ci, area:docs, area:labels, area:security, etc.
    • Meta: meta:needs-changelog, meta:duplicate, meta:blocked, etc.

    For the complete list, see .github/labels.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @ashleyshaw
    ashleyshaw

Labels

meta:needs-changelogmigrate:meta:needs-changelogRequires a changelog entry before mergemigrate:priority:importantMust-do high prioritymigrate:priority:normalDefault prioritymigrate:status:needs-more-infoMissing details to proceedmigrate:type:bugBug or defectmigrate:type:testTesting/coveragepriority:importantpriority:normalstatus:needs-more-infostatus:needs-template-fixtype:bugtype:test

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.