[agent] Filed by the scheduled architecture audit routine (CLI and core). Register: discussion #560 register.
Kind: refactor. Source: Part 8.5 G/H (register C32). Child 1 of #1089. Measured on main @ 05ecc6e.
Problem
remove/covgap_commands_remove.rs (2,127 lines, 35 tests) pins 27 sentences of four or more words. Some examples:
"Removed 1 patch from manifest:" appears 4 times (L832, L1224, L1548, L1650).
"The manifest was not modified." (L435, L985).
"cannot restore pkg:npm/left-pad@1.3.0 to its upstream registry entry" (L982, L1014).
"Warning: blob cleanup failed", "…diffs cleanup failed" and "…packages cleanup failed" (L1654-L1662).
remove already emits the typed envelope (status, error.code, events[], summary). The file even has parse_envelope/event_purls helpers (L36-L55), but they are private to this file, while sibling suites re-implement them. Several tests are _json/_human twins over the same path, for example L332-L405.
Symptoms: none filed. The cost shows up as churn in copy-edit PRs such as #248 and #1043.
Proposed change
-
Add tests/common/envelope.rs with:
parse_envelope(stdout);
assert_error_code(&Value, &str);
event_codes(&Value) -> Vec<(action, code)>;
event_purls(&Value, action).
Delete this file's private copies.
-
Rewrite each sentence assertion as the equivalent --json assertion: the error code, event action/code, summary count, or the file bytes on disk.
-
Delete each _human twin whose _json sibling covers the path. Where the human rendering is the point (the prompt text at L1854-L1862), keep one assertion per message family.
-
Rename the file into the remove suite (for example remove/remove_failure_paths.rs) when done.
Size and scope
Acceptance criteria
Dependencies
Backlog review — 2026-10-08
Consolidated into #1089. The retained tracker(s) preserve this issue’s implementation scope and acceptance criteria. Closing this separate scheduling item as not planned, not as completed.
Explicit remove-test child of the stable-error-code test tracker; keep it as a checklist step.
[agent] Filed by the scheduled architecture audit routine (CLI and core). Register: discussion #560 register.
Kind: refactor. Source: Part 8.5 G/H (register C32). Child 1 of #1089. Measured on
main@05ecc6e.Problem
remove/covgap_commands_remove.rs (2,127 lines, 35 tests) pins 27 sentences of four or more words. Some examples:
"Removed 1 patch from manifest:"appears 4 times (L832, L1224, L1548, L1650)."The manifest was not modified."(L435, L985)."cannot restore pkg:npm/left-pad@1.3.0 to its upstream registry entry"(L982, L1014)."Warning: blob cleanup failed","…diffs cleanup failed"and"…packages cleanup failed"(L1654-L1662).removealready emits the typed envelope (status,error.code,events[],summary). The file even hasparse_envelope/event_purlshelpers (L36-L55), but they are private to this file, while sibling suites re-implement them. Several tests are_json/_humantwins over the same path, for example L332-L405.Symptoms: none filed. The cost shows up as churn in copy-edit PRs such as #248 and #1043.
Proposed change
Add
tests/common/envelope.rswith:parse_envelope(stdout);assert_error_code(&Value, &str);event_codes(&Value) -> Vec<(action, code)>;event_purls(&Value, action).Delete this file's private copies.
Rewrite each sentence assertion as the equivalent
--jsonassertion: the error code, event action/code, summary count, or the file bytes on disk.Delete each
_humantwin whose_jsonsibling covers the path. Where the human rendering is the point (the prompt text at L1854-L1862), keep one assertion per message family.Rename the file into the
removesuite (for exampleremove/remove_failure_paths.rs) when done.Size and scope
Acceptance criteria
.containsassertions remain in the file, each in a render-focused test.cargo test -p socket-patch-cli --test remove(or the renamed target) is green, as are the whole CLI tests.commands/remove.rsis not lower than onmain(coverage job).tests/common/envelope.rsis used by this file and documented for the next children.Dependencies
Backlog review — 2026-10-08
Consolidated into #1089. The retained tracker(s) preserve this issue’s implementation scope and acceptance criteria. Closing this separate scheduling item as not planned, not as completed.
Explicit remove-test child of the stable-error-code test tracker; keep it as a checklist step.