Skip to content

fix(upstream): pre-flight labels, dedupe assessment issues, fail loudly past the 50-release window, stop filing fixes as deprecations #1179

Closed

Description

@admarble

Observed (2026-09-26, bringing the upstream workflow up after #1153)

  1. A missing label crashes the run after it has already filed issues. Dispatch run 36210265921 filed assessment issue Upstream: Claude Code v2.1.283 Assessment #1170, then died on the first finding with gh issue create failed: could not add label: 'needs-triage' not found (the labels come from src/lib/upstream/report.ts:302-311). Four earlier weekly runs failed the same way on assessment.
  2. Assessment issues never dedupe. createAssessmentIssue (src/lib/upstream/issues.ts:281) files unconditionally, and isAlreadyAssessed checks the report file, which only reaches main when the report PR merges. A re-run therefore files a second Upstream: Claude Code <v> Assessment (Upstream: Claude Code v2.1.283 Assessment #1170 had to be closed by hand).
  3. --since silently caps at 50. getReleasesSince (src/lib/upstream/assessment.ts:123) walks listReleases() (default limit 50) until it meets the baseline tag. When the baseline is older than the 50 newest releases (it was v2.1.42 against a latest of v2.1.283), it never meets it and returns all 50. The next weekly run would have filed 50+ issues.
  4. Bug fixes are filed as deprecations. The deprecation pattern (src/lib/upstream/relevance.ts:19) matches any remov(e|ed|ing), and deprecation outranks everything but breaking (:99). Four of the six v2.1.283 findings were release-note fixes that mention removing something: chore: Deprecated: Fixed claude plugin marketplace remove not saying which installed plugins it u... (from Claude Code v2.1.283) #1173, chore: Deprecated: Fixed claude plugin uninstall removing the other of two installed plugins whos... (from Claude Code v2.1.283) #1174, chore: Deprecated: Fixed claude mcp add, add-json, and remove reporting success when the user... (from Claude Code v2.1.283) #1175, chore: Deprecated: Windows: Fixed the PowerShell tool letting cmd /c rd, rmdir, del or `erase... (from Claude Code v2.1.283) #1176 (chore: Deprecated: Fixed …).
  • Tier: mechanical (strong-model QA)

Acceptance criteria

  • AC-1: before filing anything, a non-dry run checks that every label the upstream code can apply exists (upstream, assessment, needs-triage, priority:high, bug, enhancement) and exits non-zero naming the missing ones, having created no issue — Evidence: npx vitest run src/lib/upstream/__tests__/issues.test.ts -t "labels" passes, mutation-verified (delete the pre-flight call; the case fails)
  • AC-2: createAssessmentIssue reuses an open issue whose title is exactly Upstream: Claude Code <version> Assessment instead of filing a second — Evidence: npx vitest run src/lib/upstream/__tests__/issues.test.ts -t "existing assessment" passes, mutation-verified (bypass the lookup; the case fails)
  • AC-3: getReleasesSince throws a named error (the baseline tag and how many releases were searched) when the baseline tag is not among the fetched releases, instead of returning all of them — Evidence: npx vitest run src/lib/upstream/__tests__/assessment.test.ts -t "baseline not found" passes, mutation-verified (restore the silent fall-through; the case fails)
  • AC-4: a release note that fixes something (begins Fixed after an optional Platform: prefix, e.g. Windows: Fixed …) and mentions removing something is not categorized deprecation; genuine deprecations (deprecat…, no longer support…, removed support for …) still are — Evidence: npx vitest run src/lib/upstream/__tests__/relevance.test.ts -t "1179" passes, with the four v2.1.283 notes below as fixtures, mutation-verified (restore the bare remov(e|ed|ing) alternative; the case fails)

Fixtures for AC-4 (verbatim from .sequant/upstream/v2.1.283.md). Each must not be deprecation:

  • Fixed \claude plugin marketplace remove` not saying which installed plugins it uninstalled with the marketplace; it now lists them`
  • Fixed \claude plugin uninstall` removing the other of two installed plugins whose ids differ only in case, with its options and secrets, when the one named had no `enabledPlugins` entry at that scope`
  • Fixed \claude mcp add`, `add-json`, and `remove` reporting success when the user or local config file could not be written, for example inside a sandbox`
  • Windows: Fixed the PowerShell tool letting \cmd /c rd`, `rmdir`, `del` or `erase` delete drive roots, the home folder and other folders that `Remove-Item` refuses`

Non-Goals

Activity

  1. added
    bug
    upstream
    on Sep 26, 2026
  2. admarble commented on Sep 26, 2026

    @admarble
    ContributorAuthor

    Runner context: these rules apply to the spec, exec AND qa phases.

    • All four ACs are gate tests. Each needs a <!-- SEQUANT_MUTATION: {...} --> marker and a Mutation-verified: line in the PR body, and failedTest must start with the test file path (src/lib/upstream/__tests__/<file>.test.ts > …). The -t filters in the Evidence commands must match the test names you write.
    • AC-1's label check must run before the first issue is created, including createAssessmentIssue. Mock gh/the provider in tests; no network.
    • qa phase: don't run the full npm test; run the four named test files. The runner runs the suite once. exec phase: commit WIP before long commands, run the suite at most once in the foreground with a timeout, and never run_in_background.
    • One CHANGELOG [Unreleased] line. Stop at the PR.
  3. admarble commented on Sep 26, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, 1 directory: src/lib/upstream/)

    AC Quality Check

    All four ACs are single-line, name an Evidence: command, and carry a mutation clause. Nothing vague. One note: the -t filters (labels, existing assessment, baseline not found, 1179) are substring matches, so the test names/describe blocks must contain those exact strings.

    Scope Assessment

    Non-Goals: present (recategorizing #1172–#1177, newTool pattern, workflow YAML/cron, creating labels from code).

    Metric Value Status
    Feature count 4 (one per defect) ✅
    AC items 4 ✅
    Directory spread 1 ✅

    Verdict: ✅ SCOPE_OK

    Acceptance Criteria

    AC-1: Label pre-flight before any issue is filed

    Verification: Unit Test (issues.test.ts -t "labels", provider mocked, no network)
    Scenario: Given needs-triage is absent in the repo → When a non-dry createAssessmentIssue runs → Then it throws/exits non-zero naming needs-triage, and createIssueWithBodyFileSync was never called.
    Assumptions: GitHubProvider has no label-listing method today; add listLabelsSync(repo) (gh label list --json name --limit 200).

    AC-2: Reuse an open assessment issue with the same title

    Verification: Unit Test (-t "existing assessment")
    Scenario: Given an open issue titled exactly Upstream: Claude Code v2.1.283 Assessment → When createAssessmentIssue runs with that title → Then it returns that issue's number and creates nothing.
    Assumptions: searchIssuesSync already lists open issues only (gh issue list default), which is the "open" requirement.

    AC-3: getReleasesSince fails loudly past the window

    Verification: Unit Test (assessment.test.ts -t "baseline not found")
    Scenario: Given 50 fetched releases without the baseline tag → When getReleasesSince("v2.1.42") runs → Then it throws naming v2.1.42 and 50.
    Assumptions: the existing case "returns all versions if target not found" asserts the old behavior and must be rewritten, not deleted.

    AC-4: Fix notes are not deprecations

    Verification: Unit Test (relevance.test.ts -t "1179", four v2.1.283 notes as verbatim fixtures)
    Scenario: Given each fixture note → When categorized → Then category is not deprecation; Removed support for X, Deprecated …, no longer supports … still are.

    Implementation Plan

    Phase 1: Relevance (AC-4), independent

    1. src/lib/upstream/relevance.ts:19: split the pattern so deprecat… and no longer support match anywhere, while the remov(e|ed|ing) alternative only matches when the note does not begin with an optional Platform: prefix plus Fixed, e.g. /\b(deprecat(e|ed|ing|ion)|no longer support)|^(?!(?:[A-Za-z]+:\s*)?Fixed\b).*\bremov(e|ed|ing)\b/i. Keeps the DetectionPatterns shape (matchPatterns untouched).
    2. relevance.test.ts: add a 1179 describe with the four fixtures plus positive controls.

    Phase 2: Window (AC-3), independent

    1. assessment.ts:123: if the baseline is never met and releases.length > 0, throw Baseline tag <x> not found among the <N> most recent releases searched. Empty list still returns [].
    2. Rewrite the old "returns all if target not found" case; add baseline not found.

    Phase 3: Issues (AC-1, AC-2), same file so sequential

    1. github.ts: add listLabelsSync(repo).
    2. issues.ts: export REQUIRED_LABELS (the six the upstream code can apply; reference from report.ts:302-311 so they cannot drift) and assertLabelsExist(owner, repo), throwing an error that lists the missing ones. Call it first in non-dry createAssessmentIssue. That is before any issue in both assessVersion and assessSince, so nothing is filed. Confirm the throw reaches a non-zero exit in the CLI entry (the runUpstream caller).
    3. createAssessmentIssue: after the pre-flight, look up open issues with labels upstream,assessment and an exact title match; return that number if found.
    4. Tests in issues.test.ts; mocks need listLabelsSync in the provider mock and a default returning all six labels in beforeEach (existing tests would otherwise break).
    5. One CHANGELOG [Unreleased] line.

    Design Review

    1. Where does the logic belong? issues.ts owns gh interaction and dedupe; assessment.ts owns release windowing; relevance.ts owns categorization.
    2. Simplest correct approach? Pre-flight inside createAssessmentIssue rather than a new orchestrator step, since it is the first creator. Rejected: creating missing labels (Non-Goal); a separate call site in runUpstream (not covered by the issues.test.ts gate).
    3. Existing pattern? Same guard-and-throw style as validateRepoParams.
    4. Reviewer challenge: "Why not drop bare remov entirely?" It would stop flagging real removals like "Removed the /foo command"; the anchored negative lookahead only excludes fix notes.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Both mock files (issues.test.ts, assessment.test.ts) construct the provider as a hand-rolled class, so a new provider method must be added there or existing tests fail.
    • Gate tests: each AC needs a SEQUANT_MUTATION marker with failedTest starting with the test file path, plus Mutation-verified: lines in the PR body.
    • Rule touchpoints: none triggered.

    Open Questions

    1. Empty release list in getReleasesSince — listReleases swallows gh errors and returns [], so an API failure still reads as "no new versions". Recommendation: leave as is (out of AC); file a follow-up. Impact: a gh outage looks like a quiet week.
    2. Removal notes — recommendation above keeps non-fix "Removed …" as deprecation. Impact if the owner wants them dropped too: one regex change.

    Recommended Workflow

    Phases: testgen → exec → qa
    Quality Loop: disabled
    Reasoning: AC-1..4 declare unit-test evidence, so testgen stubs them first; small mechanical change in one directory. Per issue runner notes, qa runs only the four named test files, not the full suite.

    Label Review

    Current: bug, upstream
    Recommended: bug, upstream, planned
    Quality Loop: Won't auto-enable (SCOPE_OK)

  4. added
    planned
    on Sep 26, 2026
  5. admarble commented on Sep 26, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    Gaps:

    • The only new function added to github.ts has no direct unit test, so its gh argv, 200-label limit, JSON parse and non-zero-exit branch are unexercised
    • AC-2's dedupe silently degrades to filing a duplicate assessment issue when gh fails or rate-limits, the exact bug it fixes, while the same diff's listLabelsSync uses a null sentinel to avoid this
    • Bracket-prefixed fix notes are still categorized deprecation because the lookahead only handles the Platform: colon form; outside AC-4's literal scope but the same root cause
    • The gating test check was still running at review time, so merge readiness cannot be confirmed
    • listLabelsSync (github.ts:559-578) is the only new function in github.ts and has no direct unit test, while its immediate sibling searchIssuesSync does — including a failure-path case (github.test.ts:260-303). Everything downstream mocks it, so the gh label list argv, the --limit 200 ceiling, the JSON parse, and the status !== 0 → null branch are all unexercised.
    • searchIssuesSync returns [] both when the search finds nothing and when gh fails or rate-limits (github.ts:545, :551). AC-2's dedupe therefore degrades silently into filing a duplicate — the exact bug it was written to prevent. The correct pattern (null sentinel) is present in this very diff on listLabelsSync but wasn't applied to the load-bearing lookup.

    Suggestions:

    • Give listLabelsSync a direct test mirroring searchIssuesSync's, including the status !== 0 path.
    • Consider a searchIssuesSyncOrNull (or reuse the null convention) so the dedupe can fail loudly, consistent with AC-1's own philosophy of failing before filing.
  6. added 2 commits that reference this issue on Sep 26, 2026
  7. admarble commented on Sep 26, 2026

    @admarble
    ContributorAuthor

    Runner verification (PR #1180): QA returned AC_MET_BUT_NOT_A_PLUS. Both of its fix-now gaps are fixed in d894b436: the duplicate check now fails loudly when the gh lookup fails (new searchIssuesOrNullSync), and listLabelsSync has direct tests. The bracket-prefix note is also folded in ([Product] Fixed …). Each fix is mutation-verified (see the PR body). Full npm run build && npm test: 341 files and 8449 tests passed. CI at d894b436: test and canary success.

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

    bugplannedupstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions