Repository navigation
fix(test): sync _BUILDER_MEMBERS with build_message thread_replies_text (restore test_builder_members_keep_their_kind_and_signature) - #16078
Conversation
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging. BLOCKING -- test/test_app_script_cron_sibling_import.py:154 -- Class-level skip loosens the cross-platform ratchet Adjudication (Opus 5) — is blocking on each finding proportionate?MEDIUM — the skip is factually grounded ( [ADJUDICATION] 961243d total=1 uphold=1 downgrade=0 |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. Both fixes verified against the base tree: the live [DESIGN-REVIEWED] 961243d Description read[DESCRIPTION-READ] cb62becdf1c219b20e23fcfa3c92ca5b5b238451449b194451b669355d28835f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
… Windows command cron) Two independent main-side (cfb4284) test breakages that red on every rebased PR, both fixed minimally and test-only: 1. test_context_composition_contract.py::test_builder_members_keep_their_kind_and_signature (3.12 / Windows shard 5): kirodotdev#15761 added the keyword-only parameter thread_replies_text to ContextBuilder.build_message (a real feature param, used by slack/handler.py and slack/transport_dispatch.py) without updating the frozen _BUILDER_MEMBERS snapshot. The new signature is intended, so sync the snapshot. 2. test_app_script_cron_sibling_import.py::TestACommandCronRunningBundleCode ::test_the_call_site_leaves_the_bundle_readable (Backend Tests (Windows) (1)): the Windows CI traceback shows seen == [] — wrap_argv is never reached. Command crons do not run on Windows: run_command_sandboxed resolves a POSIX sh via _resolve_command_shell (never $PATH), finds none, and returns the _no_command_shell_message refusal before wrap_argv. Mark the command-cron subclass skipif(sys.platform == "win32"), matching the POSIX-only design. The script path is unchanged.
f7ceaa0 to
961243d
Compare
|
Thanks @chenmingwei23. Closing as superseded: #16083 (merged 2026-10-02) fixes the same two Windows-red tests in the same files, |
Problem / Motivation
Goal: restore two main-side test breakages to green so every rebased PR stops inheriting them.
On current
origin/main(cfb428485), these fail on rebased-PR CI (observed across the conductor's tracked PRs):test/test_context_composition_contract.py::TestSurface::test_builder_members_keep_their_kind_and_signatureon Backend Tests (3.12) shard 5 and Backend Tests (Windows) shard 5 (assertion attest_context_composition_contract.py:1629).test/test_app_script_cron_sibling_import.py::TestACommandCronRunningBundleCode::test_the_call_site_leaves_the_bundle_readableon Backend Tests (Windows) (1).Why it matters
Both are landed-on-
mainbreakages that red hard contract/regression lanes on every PR that rebases ontomain, blocking unrelated work until corrected.Not a goal
Changing any production code. Both the
build_messageparameter and the Windows "no command cron" behavior are intended; only the stale/over-broad test expectations are corrected.What changed (motivation → approach → change)
This PR fixes two independent main-side test breakages, both minimal:
1.
test_builder_members_keep_their_kind_and_signature(3.12 / Windows shard 5). Root cause: PR #15761 (fix(slack): show a thread turn the replies posted since its last turn,4e23df8e7) added a keyword-only parameterthread_replies_text: str | None = NonetoContextBuilder.build_message— a real feature parameter, consumed byslack/handler.pyandslack/transport_dispatch.pyand read incontext.pyto fence thread-reply text. That PR did not update the_BUILDER_MEMBERSfrozen snapshot in the contract test, so the recordedbuild_messagesignature lost sync with the live one. The new shape is intended, so the fix updates the contract (test snapshot), not the code: thebuild_messageentry in_BUILDER_MEMBERSnow includesthread_replies_textin the exact position the live keyword-only signature carries it (betweenexclude_last_nandfolder_path). No other member drifted.2.
TestACommandCronRunningBundleCode::test_the_call_site_leaves_the_bundle_readable(Backend Tests (Windows) (1)). Root cause: the Windows CI traceback showsassert len(spawns) == 1fails withseen == []—wrap_argvis never reached. Command crons resolve a POSIXshthrough_resolve_command_shell(never$PATH), which returnsNoneon Windows (cmd.exe is not POSIX; Git-for-Windows'ssh.exeis bash), sorun_command_sandboxedrefuses beforewrap_argv. This is a test fix: rather than skip the case on Windows (which would loosen the cross-platforma-ratchet-may-only-tightenratchet — the call-site mask invariant would stop being checked there), the test now forces the call site reachable on Windows. A_force_command_shell_on_windowshelper monkeypatches_resolve_command_shellto hand back the interpreter and_command_argvto build a direct[sys.executable, run.py]argv (nosh -c, which Windows cannot run), sowrap_argvis reached and the bundle-readable invariant is still asserted on Windows. POSIX is untouched — the real shell resolves and the realsh -cargv is used. The script path has no such restriction and is unchanged.Backwards compatibility
No runtime behavior change. Test-only edit; the production
build_messagesignature is unchanged.Tests
PYTHONPATH=src python -m pytest test/test_context_composition_contract.py→ 123 passed (was 1 failed).PYTHONPATH=src python -m pytest test/test_app_script_cron_sibling_import.py→ 2 passed, 2 skipped on POSIX (the 2 skips are the OS-sandbox-backend cases; the command call-site case now runs on Windows too via the forced resolver).black --check/isort --check-only/flake8on both changed files: clean.Manual verification
cfb428485with the worktree's ownsrconPYTHONPATH; the sole differing dict item wasbuild_messageand the sole delta was the missingthread_replies_textkeyword-only parameter. Traced it to fix(slack): show a thread turn the replies since its last turn #15761 viagit log -S; confirmed that commit did not touch the contract test.assert len(spawns) == 1fails withseen == [], i.e.wrap_argvis never reached. Confirmed incron_script.run_command_sandboxedthat_resolve_command_shell()returnsNoneon Windows and the function returns the_no_command_shell_messagerefusal beforewrap_argv, so the command path cannot run on Windows by design.Screenshots / video
N/A — test-only change, no UI.
Related Issues
Fixes the main-side breakage of
test_builder_members_keep_their_kind_and_signature(introduced by #15761) and ofTestACommandCronRunningBundleCode::test_the_call_site_leaves_the_bundle_readableon Windows (surfaced by the #13273 revert in #16072 that re-enabled the sibling-import regression test).Pattern harvest
Rule candidate: a contract/regression test that asserts an exact runtime shape must be updated in the same PR that changes that shape — a
ContextBuildermember signature change must update_BUILDER_MEMBERSintest_context_composition_contract.py. And when a cross-platform invariant test cannot reach its call site on one platform (a command cron finds no POSIXshon Windows), make the call site reachable there (monkeypatch the resolver to run the bundle viasys.executable) rather thanskipthe case — a platform skip loosens thea-ratchet-may-only-tightenratchet.Checklist
Contribution License Agreement
By submitting this pull request, I confirm that my contribution is made under the terms of the project's Contribution License Agreement.