Repository navigation
test(lifecycle): output oracle joins a plain line Rich wrapped at a space (#4334 cell red) - #4368
Merged
Merged
Conversation
…pace The I9 wrap joiner rejoined a continuation only after a status-prefixed line. The #4334 "Package target restriction: ..." line is plain and 82 characters wide, so Rich breaks it at a space; its two copies were no longer equal adjacent lines and the oracle missed the repeat. The STRICT #4334 cell then reported "did not fail" and turned test_mixed_case_links_survive_install_update_audit_and_uninstall red (main run 44753470995, #4258). A plain line now joins where the broken row ended in the space Rich broke at; width-filled rows still need a status prefix, so long unwrapped log lines (the #4332 shape) stay apart. Refs #4115 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 15:11
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the test-harness change that detects repeated diagnostics split by Rich wrapping.
No open issues 🎉
What changed in this PR
This test-harness-only fix lets the lifecycle output oracle detect repeated plain diagnostics split by Rich wrapping. It addresses the false “known cell did not fail” result for #4334 without fixing or masking the underlying product defect.
Changes:
- Join plain-line continuations when the preceding row ends with a space.
- Add regression coverage for wrapped duplicate diagnostics and preserve detection of repeated long, unwrapped stderr lines.
| File | Description |
|---|---|
tests/utils/lifecycle_evidence.py |
Extends logical-line reconstruction to handle plain diagnostics wrapped at a space. |
tests/unit/scripts/test_lifecycle_evidence.py |
Tests wrapped duplicate detection and preservation of unwrapped log repeats. |
Review effort: Balanced
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
The _logical_lines joiner agreed with Stream P (#4366, #4368): a row is a console wrap when it breaks at a space or fills the 79-80 column width; a longer row is unwrapped output (RA-010); a full-width fold keeps the space it broke at; a plain line joins only after a break at a space. Red/green unit cases for the unwrapped-long-line rule and for failed-check details on stderr. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
6 of 10 tasks
…put (AQ003) Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
_logical_lines keeps the wrap rule agreed with Stream P: a row wraps when it breaks at a space or fills the 79-80 column width; a longer row is unwrapped output (RA-010); #4366 fold-tail and #4368 plain-wrap cases pass. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
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.
Description
test_mixed_case_links_survive_install_update_audit_and_uninstallis red on main (run 44753470995 ona2aa8d1fc2, macOS arm64 and x86_64) and on #4258. It fails withI9: known cell install-verbose-diagnostics-repeat (#4334) did not fail. It also fails on Linux with-n 0, so it is deterministic, not platform-specific.Cause: the #4334 line
Package target restriction: [copilot, cursor]; effective targets: [copilot, cursor]is 82 characters. Rich wraps it at a space, so stdout holds...[copilot, \ncursor]twice._logical_linesintests/utils/lifecycle_evidence.py) rejoined a continuation only after a status-prefixed line. This line is plain, so the two copies were never equal adjacent lines.The product defect (#4334) is still present; the oracle just could not see it in wrapped output.
Fix (test harness only): a plain line also joins its continuation when the broken row ended with the space Rich broke at. Rows that fill the width with no trailing space still need a status prefix, so long unwrapped log lines on stderr (the #4332 shape) stay apart and their repeats are still reported. The new unit test covers both directions.
Sibling: #4366 fixes the other macOS red in the same function. The two PRs touch separate hunks and merge cleanly together (checked with
git merge-tree).Issue and approved scope
Issue: Refs #4115
Human scope-approval comment: the Stream P lead assigned this main-red fix under #4115 (wider PR checks and CI).
Does this PR complete the issue, or what remains? No. It removes one main red; #4115 continues. #4334 (the product defect) stays open, and its cell stays strict.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
Red before:
pytest -n 0 tests/unit/scripts/test_lifecycle_evidence.py::test_output_oracle_joins_a_plain_line_wrapped_at_a_spacefailed with the oracle change stashed (assert [] == ["stdout repeats a line: 'Package target restriction: ...'"]).Green after:
pytest -n 0 tests/unit/scripts/test_lifecycle_evidence.pypassed (207 passed).On main,
APM_E2E_TESTS=1 pytest -n 0 tests/integration/test_mixed_case_materialization_lifecycle.pyfailed with the apm install --verbose repeats target-restriction and perf diagnostic lines #4334 "did not fail" message. With the fix, that module plustests/integration/test_oci_mcp_lifecycle_contract.pypassed (5 passed).uvx [email protected] checkandformat --checkon the changed files passed.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)
Blast radius
Scope
38e7146e3. Tree scanned: test(lifecycle): output oracle joins a plain line Rich wrapped at a space (#4334 cell red) #4368 head34c49f79(main plus test(lifecycle): output oracle joins a plain line Rich wrapped at a space (#4334 cell red) #4368), with test(lifecycle): output oracle joins a path's space-led fold tail (macOS codex red) #4366's fold-tail rule applied by a temporary, uncommitted hook.tests/integrationmodules that useApmLifecycleRunner/run_sequenceor a kit that does, plus all oftests/lifecycle.APM_E2E_TESTS=1,-n 2 --dist loadfile, using the bounded fold predicate_WRAP_WIDTH <= len <= _WRAP_WIDTH + 1.Method. The hook in
check_cli_outputevaluated every APM command result twice: once with main's joiner, once with the combined #4366 + #4368 joiner. It logged every command whose violation list differed.Flips: exactly 1 command, 1 node
tests/integration/test_mixed_case_materialization_lifecycle.py::test_mixed_case_links_survive_install_update_audit_and_uninstall, commandapm install --target copilot,cursor --no-policy --parallel-downloads 0 --verboseknown cell install-verbose-diagnostics-repeat (#4334) did not failI9: stdout repeats a line: 'Package target restriction: [copilot, cursor]; effective targets: [copilot, cursor]'Attribution. The flipped line wraps after a 76-character row that ends in the space Rich broke at. Only #4368's rule (a plain line joins where it broke at a space) joins it. #4366's rule needs a 79-80 character row followed by a single-space-led row, so it cannot fire here. No other command changed in the combined scan.
Accounting
>=predicate (1565 tests) also logged 0 flips.