Repository navigation
CI: apply suite asserts codes, not sentences (#1089) - #1546
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 14, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 14, 2026
The apply suite's covgap tests pinned English sentences, so a copy edit to an apply message broke them even when the exit code, error code, events and bytes on disk were unchanged. covgap_commands_apply.rs splits three ways inside the apply suite: apply_failure_paths.rs checks --json codes, events and disk state through common::envelope (no 4+-word sentence asserts), apply_render.rs keeps one human render check per message family, and apply_fixture.rs holds the fixtures both share. The paths that only had human tests (go drift arms, stale-redirect pruning, no matching package, already-patched dry run, strict per-package failures, the PnP refusal) now have a --json test too. coverage_fix_apply_silent_mute_exit.rs joins the apply suite as apply_silent_staging_errors.rs, so CI links one fewer test binary. Refs #1089. Assisted-by: Claude Code:claude-opus-5-5
The orphan-replace --json test no longer reads the drift sentence; the module-keyed event already says which arm fired. The reconcile tests pin that the envelope carries no event for a pruned redirect, the bun and vlt render tests again check the run falls through to "No patches to apply.", and the silent staging tests reuse the suite's runner and manifest writer instead of private copies. Refs #1089. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 14, 2026 20:12
Collaborator
Author
|
BugBot review Generated by Claude Code |
Tanmay Singla (Tanmay182003)
approved these changes
Oct 14, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-ci-apply-envelope-asserts
branch
October 14, 2026 21:00
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
LLM Description written by Claude Code:claude-opus-5-5
Refs #1089 (apply slice of child 3; the tracking issue stays open for the vendor silent-mute twin, which waits on #1544 to avoid a conflict, and children 4-6).
Summary
apply/covgap_commands_apply.rspinned English sentences, so a copy edit to an apply message broke tests even when the exit code, error code, events and bytes on disk were unchanged. This PR splits it three ways inside theapplysuite:apply/apply_failure_paths.rs: the--jsontests. They assertstatus,error.code,events[](throughcommon::envelope) and disk state. A message is read only for the paths aWrongReplacePathdrift must name. 4+-word.containssentence asserts: 0.apply/apply_render.rs: the human render checks, one per message family (go drift report, stale-redirectRemoved/Would remove,No patches to apply., the no-match error block, dry-run counts,--verboselabels, pnpm/bun/vlt notes, PnP refusal, gem fallback-home warning,--dry-run --vexskip). 18 sentence asserts, all in this render suite as Tracking: assert stable codes instead of human sentences in CLI tests, and fold the covgap suites #1089's target design allows.apply/apply_fixture.rs: the fixtures and runner both files share.Paths that only had human tests now also have a
--jsontest: theOrphanReplaceandWrongReplacePathdrift arms (go_redirect_drift), stale-redirect pruning, the no-matchpackage_not_installedskip, the dry-runalready_patchedskip, the--strictapply_failedevents, and themanifest_invalid/yarn_pnp_unsupportedsplit under a PnP layout.coverage_fix_apply_silent_mute_exit.rsjoins the apply suite asapply/apply_silent_staging_errors.rsand reuses the shared runner and manifest writer. Its stderr checks stay: the--silentstderr output is what those tests are about.Old 4+-word sentence asserts in
covgap_commands_apply.rs: 25. Now: 0 in--jsontests, 18 in the render suite.CI cost
Test-only change. A lean PR run keeps the same ~28 Linux jobs and ~8 min (about the same job-minutes before and after). There is one fewer integration test binary to link.
scripts/ci-test-durations.jsonfolds the old target's 4.05 s intoapply(10.48 → 14.53 s). The split adds about 10 subprocess runs; locally the whole apply suite finishes in 6.7-7.7 s.Test evidence
cargo test -p socket-patch-cli --all-features --test apply: 146 passed, 1 ignored (as on main).cargo test -p socket-patch-cli --all-features --test cli envelope: 16 passed (theenvelope_helper_copiesratchet).python3 -m pytest scripts/tests -q: 342 passed, 6 skipped. It caught thedocs/testing/vlt-coverage.jsonreference, sovlt_layout_prints_informational_note_in_human_modekeeps its name.cargo fmt --all -- --check: clean.cargo clippy -p socket-patch-cli --all-features --test apply: no warnings in the new or moved files./code-review highraised 9 findings and 8 are fixed. Not fixed: run each scenario once for both the human and--jsonchecks. Keeping one test per contract is the design Tracking: assert stable codes instead of human sentences in CLI tests, and fold the covgap suites #1089 asks for, and the extra runs cost about a second.🤖 Generated with Claude Code
https://claude.ai/code/session_01BBSnJCsDWPGfUPbTm7Ataj
Note
Low Risk
Test-only reorganization with no changes to
socket-patch applyproduction code; risk is limited to CI/runtime of the apply test binary.Overview
Refactors the
applyintegration tests so machine contracts and human copy are tested separately, addressing #1089.The monolithic
covgap_commands_apply.rsis removed and replaced byapply_fixture.rs(shared runners and fixtures),apply_failure_paths.rs(--jsonchecks on exit codes,status,error.code,events[], and disk state), andapply_render.rs(human-mode sentence pins for drift reports, layout notes, dry-run summaries, etc.). Several scenarios that previously only had human asserts now also have--jsoncoverage (e.g.OrphanReplace/WrongReplacePathdrift, stale Go redirect reconcile,package_not_installed,already_patched, strictapply_failed, PnP vs corrupt manifest).coverage_fix_apply_silent_mute_exitmoves into theapplybinary asapply_silent_staging_errors.rs, reusing the shared fixture helpers; cross-suite comments point at the new path.scripts/ci-test-durations.jsondrops the standalonecoverage_fix_apply_silent_mute_exittarget and folds its budget intoapply(~10.48s → ~14.53s).Reviewed by Cursor Bugbot for commit 4d90f26. Configure here.
Generated by Claude Code