Repository navigation
test(lifecycle): output oracle joins a path's space-led fold tail (macOS codex red) - #4366
Merged
Merged
Conversation
…th in the output oracle
On macOS the pytest tmp path is long enough that Rich folds it into
full-width rows, and the word after it (" (local)") wraps with the space
it broke at. The I9 joiner refused space-led continuations, so the
indented " [+] <path> (local)" line collapsed to "[+] <path>" and
compared equal to the validation line, failing
test_oci_mcp_install_lifecycle_is_cross_adapter_and_idempotent[codex]
on macOS (run 44753470995). Reproduced on Linux with a 92-char --basetemp.
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:07
This was referenced Nov 20, 2026
Merged
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The line-folding logic alters unjoined rows and merges independent lines, causing repeated output to go undetected.
2 open issues
What changed in this PR
This test-harness change addresses a macOS lifecycle false positive caused by Rich wrapping long temporary paths. It supports the CI reliability work in #4115 without changing APM runtime behavior.
Changes:
- Allows single-space-led continuations after full-width output rows.
- Adds a regression test distinguishing wrapped validation output from installation output ending in
(local).
| File | Description |
|---|---|
| tests/utils/lifecycle_evidence.py | Adjusts continuation handling in the lifecycle output oracle. |
| tests/unit/scripts/test_lifecycle_evidence.py | Adds coverage for a wrapped 160-character path and its space-led tail. |
Review effort: Balanced
Comment on lines
+708
to
+709
| if len(previous_raw) >= _WRAP_WIDTH and re.match(r" \S", line): | ||
| line = line[1:] |
Comment on lines
+708
to
+709
| if len(previous_raw) >= _WRAP_WIDTH and re.match(r" \S", line): | ||
| line = line[1:] |
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]>
… via check_cli_output (AQ003) Matches the 80-column predicate agreed in #4143: a longer row is unwrapped output, never a wrap. 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_oci_mcp_install_lifecycle_is_cross_adapter_and_idempotent[codex]fails on macOS (main run 44753470995,a2aa8d1fc2) withI9: stdout repeats a diagnostic: '[+] <tmp path>'.Cause: the macOS pytest tmp path is 160 characters, so Rich folds it into two full-width rows. The next word (
(local)) then wraps onto a new row with the space it broke at. The output oracle's wrap joiner (_logical_linesintests/utils/lifecycle_evidence.py) refused space-led continuations, so the indented[+] <path> (local)line shrank to[+] <path>. It then compared equal to the earlier validation line[+] <path>. On Linux the path is short, so nothing wraps and the two lines differ.Fix (test harness only): when the previous raw row fills the wrap width and the next row starts with exactly one space, drop that space so the row joins back as a continuation. Real duplicate diagnostics are still reported.
This does not depend on codex, the codex binary, or the #4264 codex-pin stopgap. It depends only on the tmp path length.
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 macOS main red; #4115 continues.
Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
Red before:
uv run --frozen pytest -n 0 tests/unit/scripts/test_lifecycle_evidence.py::test_output_oracle_joins_the_space_led_tail_of_a_path_folded_at_full_widthfailed with the oracle change stashed.Green after:
uv run --frozen pytest -n 0 tests/unit/scripts/test_lifecycle_evidence.pypassed (207 passed).Linux repro of the macOS shape:
APM_E2E_TESTS=1 uv run --frozen pytest -n 0 --basetemp=/tmp/<87 chars> "tests/integration/test_oci_mcp_lifecycle_contract.py::test_oci_mcp_install_lifecycle_is_cross_adapter_and_idempotent"failed on main with the same I9 message and passes with the fix (3 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.