GeezerVison is showing github.com — CI: remove suite asserts codes, not sentences (#1089) by mikolalysenko · Pull Request #1535 · SocketDev/socket-patch
Conversation
LLM Description written by Claude Code:claude-opus-5-5
Refs #1089 (child 1, the #1090 scope: remove/covgap_commands_remove.rs)
Problem
The remove failure-path suite pinned whole English sentences in its
--json tests and kept private copies of the envelope readers that
tests/common/envelope.rs (#1272) provides. A copy edit to a remove
message broke these tests even when the exit code, error.code,
events and bytes on disk didn't change.
Change (test-only, 4 files)
--json tests read the envelope through common::envelope and
assert error.code, events, summary counts and on-disk state. They
read the message only for what it must name: a purl, a flag, a path,
the git checkout -- remedy, the "manifest was not modified"
promise, or the short phrase that tells two causes apart when they
share one code (restored lockfiles for the write failure, the
Error during rollback: prefix for the rollback Err branch).
- Dropped: the exact
lock_held message pin (the code is checked, and
e2e_safety_lock owns that contract), and the sentence halves of the
ledger, flavor, 404 and offline checks.
- Human-mode tests stay as the render checks. Each keeps one assertion
per message family. The "Removed 1 patch from manifest:" lines are
gone where the manifest is already checked on disk, and the mixed
drift-keep human test now checks the manifest itself.
common::envelope gains event_purls and has_event, with
self-tests and ratchet entries. The file leaves
PENDING_PRIVATE_READERS.
- Renamed to
remove/remove_failure_paths.rs (no tests deleted, so
commands/remove.rs coverage can't drop).
4+-word .contains("…") assertions in the file: 24 → 13. 11 are in
human-mode render tests. The 2 in --json legs are the vendor
"manifest was not modified" promise and the git checkout -- remedy. #1089's per-file target (≤3) needs the render suite from child 6,
so this PR says Refs, not Fixes.
Evidence
cargo fmt --all -- --check passes.
cargo test -p socket-patch-cli --all-features --test remove:
100 passed. As root the 4 chmod tests skip, so I also ran the suite
binary as nobody: remove_failure_paths 38 passed, with the
read-only-dir legs executing (no skipping: lines).
cargo test … --test cli -- envelope_helper: 11 passed (ratchet and
helper self-tests).
cargo clippy -p socket-patch-cli --all-features --test remove --test cli -- -D warnings: only the pre-existing duplicate-module
lints in common/mod.rs and prebuilt_common/mod.rs; nothing in the
changed files.
- Refactor only, so there is no red→green test.
CI cost
Test-only, no workflow changes. A lean PR run keeps the same job count
and minutes (about 28 Linux jobs, ~8 min wall), before and after.
Review notes (/code-review high)
Fixed: has_event moved into common::envelope; the git checkout --
remedy and the vendor "manifest was not modified" promise are checked
again; the mixed human test checks the manifest; the --json stderr
check looks for a Note: line, not the note's wording; dropped the
events shadowing; event_purls self-test covers non-string purls;
no throwaway String in the warning checks.
Not changed, by design: the Error during rollback: prefix and the
restored lockfiles phrase stay. They're the only thing that tells
two causes with the same error.code apart, and the module doc now
says so.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KroheaumCd65y9D9wJ9LKS
Generated by Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 14, 2026
The remove failure-path tests pinned whole English sentences in
--json mode and kept private copies of the envelope readers, so a
copy edit to a remove message broke them even when the exit code,
error code, events and bytes on disk were unchanged.
The --json tests now read the envelope through common::envelope and
check error codes, events, summary counts and on-disk state. Where a
message must name something, they check that token (a purl, a flag, a
path). Human-mode tests stay as the render checks, minus lines whose
disk state is asserted already. common::envelope gains event_purls,
and the file moves into the remove suite as remove_failure_paths.rs.
Refs #1089.
Assisted-by: Claude Code:claude-opus-5-5
Review follow-ups on the remove suite rewrite:
- has_event moves into common::envelope next to event_purls, with
self-tests (including a non-string purl) and a ratchet entry.
- The hosted refusal again checks the `git checkout --` remedy, and
the vendor flavor refusal the "manifest was not modified" promise.
- The mixed drift-keep human test checks the manifest on disk, since
it no longer reads the "Removed 1 patch" line.
- The --json preserve-state leg checks for no `Note:` line on stderr
instead of the note's wording.
- The module doc says which message parts the --json tests still read.
Assisted-by: Claude Code:claude-opus-5-5
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7a173fa. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|