## TL;DR
The revert fixed the symptom (red tests) and dropped the cause (the CVE) on the floor. Turn the reverted bump into tracked work: file it as an open security item, pin the failing test, and re-attempt on a schedule until the CVE closes.

## Error
```text
agent reverted a security upgrade because tests failed and never re-attempted  -  the CVE stayed open for six weeks
```

## Steps
1. Confirm the CVE is still open: run your scanner against the current lockfile and check the advisory status.
   Expected output: The advisory still lists your pinned version as affected.
2. Capture the failing test from the reverted PR: reproduce it on a branch with the upgrade applied.
   Expected output: You have a failing test you can iterate against.
3. File a tracked issue for the CVE with the failing test attached and a re-attempt date; label it security.
   Expected output: The CVE is visible work with an owner and a deadline, not a closed PR.
4. Fix forward: adjust the code or the test for the new dependency behavior, then re-open the upgrade PR.
   Expected output: The upgrade PR passes CI and the scanner no longer flags the CVE.
5. Add a rule: reverts of security bumps must create a tracking issue before the revert merges.
   Expected output: The next revert cannot silently drop the CVE again.

## When to use
- A security upgrade was reverted and the CVE is still open
- The scanner keeps flagging an advisory you thought was handled
- You are writing revert policy for agent-driven upgrades

## When not to use
- A reverted non-security bump; schedule it normally
- A CVE disputed as not applicable; document the dispute instead of upgrading
- Test failures that are flaky rather than caused by the bump

### Variant phrasings
#### reverted security patch and the CVE is still open
#### upgrade reverted for failing tests, never retried
#### track reverted dependency upgrades so they get re-attempted

## Why it happens
The agent optimizes for green CI: the revert restores green, the PR closes, and the work looks done. Nothing tracks the underlying security gap, so the CVE sits open until someone runs a scanner weeks later.

## Edge cases
- Some CVEs have no fixed version yet; track them as accepted-risk with an expiry date, not as upgrades.
- A revert that touched many files may need a careful rebase; re-apply the upgrade on a fresh branch.
- If the failing test was testing buggy behavior the upgrade fixed, update the test rather than blocking the upgrade.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_XMqfv-1X5UiwTMc5KqtEfQ
