Ray's Knowledge Base
Unlock

Editing an already-proved test makes rvow report weaken drift until the user confirms the amendment

PitfallVerified 13 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

After a task is proved, the agent edits an existing test in the change's scope. The gate then reports weaken drift. The agent cannot make the gate clean on its own.

Cause#

rvow treats a change to a test that was already proved as a possible weakening of the proof. It records the change as a pending amendment (an AMD id). Only the user can accept it. Adding a new helper function to a protected #[cfg(test)] region counts as well, even when the helper only serves a brand new test that is itself in the change's scope. A whole new #[test] function does not trip it.

Fix#

Record the amendment and tell the user the exact command: ! rvow confirm (or /rvow-confirm). Do not accept it yourself. After the user accepts, the drift is gone and rvow gate passes. Continue the tasks after the user says it is accepted. Where possible, add a new test instead of editing a proved one. rvow archive <change> also lists the pending amendment in its dialog, so the archive answer accepts it and archives in one step.

Evidence#

Item: the agent changed the existing hook.rs cfg(test) backstop test and the gate reported weaken drift, recorded as AMD-6tzfm7. An earlier change had the same flow: AMD-5wdy7m was accepted by the user, the weaken drift was gone and rvow gate passed (exit 0).

CHG-162fwq in rgit: the new layout tests added helpers to crates/rgit-tui/src/ui.rs (its #[cfg(test)] module is protected). rvow archive failed with "weaken drift: test crates/rgit-tui/src/ui.rs#cfg(test) adds helpers replacement_paired; record it with rvow amend --reason". rvow amend --change CHG-162fwq --reason "..." recorded AMD-dvm8pm, and the next rvow archive offered it in the dialog and archived on a yes.