fix(8249): a redundant verdict can name a cover the sync has not read yet
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m7s
CI & Build / integration (push) Successful in 2m41s
CI & Build / Build & push image (push) Successful in 25s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m7s
CI & Build / integration (push) Successful in 2m41s
CI & Build / Build & push image (push) Successful in 25s
A test is usually rewritten in the same change that removes the one it replaces, so the cover is new to the ledger when the verdict is recorded, and the next refresh retires the removed test. classify_shapes refused such a cover as matching no live shape. With a bound `repo` the cover now resolves the way the judged shape already does, as a provisional row the next sync adopts; without one it is refused as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -800,12 +800,22 @@ async def classify_shapes(
|
||||
status = item["status"]
|
||||
cover_id = None
|
||||
if status == "redundant":
|
||||
# The cover is a live row of this project, resolved exactly
|
||||
# like the shape being judged; a cover no row matches is an
|
||||
# error, because a redundant verdict without its cover is the
|
||||
# one claim nobody can check.
|
||||
# The cover resolves exactly like the shape being judged: a
|
||||
# live row, or with a bound `repo` a provisional one, because
|
||||
# a test is usually rewritten in the same change that removes
|
||||
# the one it replaces, so the cover is new to the ledger. A
|
||||
# cover nothing can name is an error: a redundant verdict
|
||||
# without its cover is the one claim nobody can check.
|
||||
cover = item["covered_by"]
|
||||
covers = by_key.get((cover["path"].strip(), cover["symbol"].strip())) or []
|
||||
cpath, csymbol = cover["path"].strip(), cover["symbol"].strip()
|
||||
covers = by_key.get((cpath, csymbol)) or []
|
||||
if not covers and repo_key:
|
||||
covers = [await provisional_row(
|
||||
session, project_id=project_id, repo_key=repo_key, path=cpath,
|
||||
symbol=csymbol, kind=snippet_kind(csymbol, ""),
|
||||
)]
|
||||
by_key.setdefault((cpath, csymbol), []).extend(covers)
|
||||
provisional += 1
|
||||
if not covers:
|
||||
raise ValueError(
|
||||
f"covered_by {cover['path']}::{cover['symbol']} matches no live shape "
|
||||
|
||||
Reference in New Issue
Block a user