Skip to content

test(architecture): make the bare POSIX flag guard report violations and record the coordination ceiling - #8812

Closed
CharleoYang wants to merge 1 commit into
loopx-project:mainfrom
CharleoYang:codex/portability-repair-20261115
Closed

CharleoYang wants to merge 1 commit into
loopx-project:mainfrom
CharleoYang:codex/portability-repair-20261115

Conversation

@CharleoYang

Copy link
Copy Markdown

Problem

tests/architecture/test_posix_flag_portability.py::test_no_module_exceeds_its_bare_posix_flag_ceiling fails at the official baseline with ValueError: too many values to unpack (expected 2) instead of reporting the offending module, and the guard's real violation is a module that deliberately refuses hosts without descriptor-relative opens.

Root cause

  1. The failure message iterates for line, what in uses where uses is the {ceiling, observed} mapping, so the diagnostic raises over its own keys.
  2. loopx/chat/coordination.py:85 refuses the host unless os.open supports dir_fd and the three flags exist, then opens with O_DIRECTORY/O_NOFOLLOW/O_NONBLOCK at 92-98; the ceiling fixture had no entry for it.

Change

  • Fixed the diagnostic to iterate the observed use list and print path:line: expression, keeping both guard assertions and the guidance text.
  • Recorded loopx/chat/coordination.py: 6 in posix_flag_ceilings.json with the line-85 capability refusal as the reason, per that fixture's own rule that a raise needs a recorded reason.
  • Added a synthetic-root regression that a violation report names the offending path and expression.

Evidence

env -u PYTHONPATH LOOPX_USAGE_PING=0 TMPDIR=<outside repo> uv run --extra test python -m pytest -q tests/architecture/test_posix_flag_portability.py -> 5 passed, 0 failed, 0 skipped (11.35s).

Not covered

The unsupported-host runtime branch was not exercised; the ceiling justification rests on the retained capability refusal at loopx/chat/coordination.py:85. No product behaviour changed.

…coordination ceiling

Signed-off-by: Qi Yang <yangqi45@meituan.com>
@CharleoYang

Copy link
Copy Markdown
Author

Closing without merge: the owner directed that this work be published on the internal Sankuai remote (origin = ssh://git@git.sankuai.com/~yangqi45/loopx.git) and not on GitHub. The branch is pushed there; no GitHub PR is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant