Skip to content

Add authoring-time reminder for a new blanket win32-skip test (#589) - #591

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/589
Sep 6, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
fix/589

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closes #589.

#585 and #588 each hit the same gap in one session: a new module-level pytestmark = pytest.mark.skipif(sys.platform == "win32", ...) needs a docs/windows-skip-triage.md row in the same commit, and both times this was caught only well into a CI run rather than at authoring time.

What this adds

  • A .claude/jit-context tools-dimension entry (tools/00-manual/win32-skip-triage-entry.md) that fires on a supertool Bash call whose command text contains the module-level skip pattern -- this repo's own write path always carries a new file's content inside the Bash command string (paste:@-/edit:@- heredocs), so a content-shaped rule can see it even though jit-context deliberately never inspects a native Edit/Write tool_input.content.
  • The same convention stated in CONTRIBUTING.md and in docs/windows-skip-triage.md's own header, as a backstop for a contributor whose write does not go through supertool -- the one path the jit-context rule cannot see into.
  • A changelog fragment (changelog.d/589.added.md).

Half 2: the audit

Audited tests/test_path_resolution.py for other instances of "a docstring/comment promises an exclusion the code does not implement, with no positive-control test proving it fires" -- the issue's own named example (command -v jq) is already fixed in a prior merged PR and is untouched by this diff. Found no other instance; made no code change as a result.

Self-review caught a real bug

The first committed version of the jit-context rule required the win32 condition to sit immediately after the opening parenthesis of skipif(, with no separator, so it only matched a single-line skip. Both spawned reviewers (Explore and oss:auditor) independently caught this: only 5 of 118 blanket-skip test modules in this tree use that single-line form -- the other ~113, including tests/test_plugin_promo_574.py (the exact #588 incident this rule cites as its motivation), write the condition on its own line. The rule would not have fired on the incident it was written to catch.

Explore also found the rule had no pytestmark anchor, so it would have re-fired on a per-test @pytest.mark.skipif(...) decorator -- exactly the shape this repo's own declined trap 487.ostype-immutable-on-windows-gitbash already reasoned a rule should not restate.

Fixed in a follow-up commit: the pattern now requires pytestmark to appear before an unclosed skipif(...win32...) call, tolerant of any whitespace/newlines in between (including the list-form), bounded at the first literal closing parenthesis. Re-verified against the real installed hook on the actual multi-line content of tests/test_plugin_promo_574.py: fires; a per-test decorator with no pytestmark: silent.

Adjacent, below the bar to chase further

This issue's own narrative is in some tension with a fact both reviewers surfaced: tests/test_windows_skip_triage_497.py is platform-agnostic (AST-based) and runs identically on every leg of the 3-OS matrix, so it should already catch a missing triage-doc row on every platform, not only windows-latest. Did not chase the actual #585/#588 CI job logs far enough to resolve why the reported failure pattern read as Windows-specific -- both PRs are merged and closed, and it does not change that an authoring-time check is strictly earlier than any CI leg regardless of which ones would have caught it.

🤖 Generated with Claude Code

[AI-generated]

fdaviddpt and others added 2 commits September 6, 2026 01:57
#585 and #588 each hit the same gap in one session: a new module-level
`pytestmark = pytest.mark.skipif(sys.platform == "win32", ...)` needs a
`docs/windows-skip-triage.md` row in the same commit, and both times this
was caught only well into a CI run rather than at authoring time.

Add a `.claude/jit-context` tools-dimension entry
(`tools/00-manual/win32-skip-triage-entry.md`) that fires on a `supertool`
Bash call whose command text contains the `pytestmark = pytest.mark.skipif`
pattern -- this repo's own write path always carries a new file's content
inside the Bash command string (`paste:@-`/`edit:@-` heredocs), so a
content-shaped regex can see it even though jit-context deliberately never
inspects a native Edit/Write tool_input.content. Proven to fire on a
matching payload and stay silent on a non-matching one (both checked
directly against pre-tool-hook.sh).

State the same convention in `CONTRIBUTING.md` and in
`docs/windows-skip-triage.md`'s own header, as a backstop for a contributor
whose write does not go through `supertool` -- the one path the jit-context
rule cannot see into.

Audited tests/test_path_resolution.py for other instances of the issue's
second half (a docstring/comment promising an exclusion the code does not
implement, with no positive-control test proving it fires): the
`command -v jq` case is already fixed (#574/#588 follow-up); no other
instance found. Every other per-line exclusion in that file is a plain,
correctly-implemented containment check or a whole-file omission, not a
substring pattern that can quietly amnesty a real violation.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bv6BGZD2EdZ9EuJ7tPDTb7
…tting (#589)

Both spawned reviewers (Explore and oss:auditor) independently caught the same
high-severity bug in the previous commit: `match:
~pytest\.mark\.skipif\(sys\.platform *== *.win32.` requires `sys.platform`
immediately after the literal `(`, with no separator. That only matches a
single-line `pytestmark = pytest.mark.skipif(sys.platform == "win32", ...)`.
Only 5 of 118 blanket-skip test modules in this tree use that form; the other
~113, including `tests/test_plugin_promo_574.py` -- the exact #588 incident
this rule cites as its motivation -- write the condition on its own line. The
rule would not have fired on the incident it was written to catch.

Explore also found a second issue: the old regex had no `pytestmark` anchor,
so it would also fire on a per-test `@pytest.mark.skipif(...)` decorator --
exactly the shape this repo's own declined trap
`487.ostype-immutable-on-windows-gitbash`
(`.claude/jit-context/tools/00-manual/00-README.md`) already reasoned a rule
should not restate, since the skip is already visible at the decorator site.

New pattern: `~pytestmark[^)]*skipif\([^)]*win32`. Requires `pytestmark`
somewhere before an unclosed `skipif(...win32...)` call, tolerating any
whitespace/newlines in between (including the list-form
`pytestmark = [pytest.mark.skipif(...), ...]`) while stopping at the first
literal `)`, so it does not cross into an unrelated statement. Re-verified
against `pre-tool-hook.sh` directly: fires on the real multi-line content of
`tests/test_plugin_promo_574.py`, fires on a synthetic single-line form,
stays silent on a per-test decorator with no `pytestmark`, and stays silent
on ordinary test content.

The auditor's other observation -- `tests/test_windows_skip_triage_497.py`
already catches the same doc/tree drift on every CI leg via an AST scan, so
this rule's only independent value is firing before push -- is now stated
in the entry's own body rather than left implicit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bv6BGZD2EdZ9EuJ7tPDTb7
@fdaviddpt
fdaviddpt merged commit 242610c into main Sep 6, 2026
16 checks passed
@fdaviddpt
fdaviddpt deleted the fix/589 branch September 6, 2026 05:56
fdaviddpt added a commit that referenced this pull request Sep 6, 2026
* Fix stale prose totals in docs/windows-skip-triage.md (#595)

The doc's table (guarded against the live tree by
tests/test_windows_skip_triage_497.py) grew to 102 modules / 82 unclear
across #589/#591, but four prose sentences next to it still said 98/78 --
nothing recomputed them. Update the prose to 102/82 and add
tests/test_windows_skip_triage_prose_totals_595.py, which ties each of
those sentences to the table's own row count rather than to another
hardcoded number.

Co-Authored-By: Max <noreply>

* Widen #595's prose-total guard per self-review

Reviewer flagged that the doc separately states "8 modules" (convertible)
and "12 modules" (not-convertible) right next to the same table, left
uncovered by the first version of the guard -- the identical staleness
risk, half-fixed. Add both patterns.

Auditor flagged that the guard's row-parsing regex was an independent
second copy of tests/test_windows_skip_triage_497.py's own row regex, with
nothing tying the two together. Factor both into a shared
scripts.windows_skip_triage_497.parse_doc_table_rows helper.

Co-Authored-By: Max <noreply>

* Close remaining gaps from #595's second audit round

Add the missing positive-control tests for the not-convertible and
unclear prose patterns -- the prior commit's message claimed both new
counts (convertible, not-convertible) got a dedicated fire-test, but only
convertible did; unclear had none from the first commit either. All four
prose patterns now have one.

Reformat the noqa-suppressed import in tests/test_windows_skip_triage_497.py
into ruff's own multi-line form instead of silencing the rule -- the rule
turned out not to be enforced by any CI workflow here, but suppressing an
inert check is still worse than not needing to.

Co-Authored-By: Max <noreply>
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.

New blanket-win32-skip tests miss their windows-skip-triage.md entry until Windows CI catches it (#585, #588); a jq-scan test that could never fail

1 participant