test(lint): pin block-style branch/path scoping for WP001 (oleks/pipetree#22) #23

Closed
oleks wants to merge 1 commits from test/pipetree-22-blockstyle-fixtures into main

1 Commits

Author SHA1 Message Date
Oleks d6a0d37db9 test(lint): pin block-style branch/path scoping for WP001 (oleks/pipetree#22)
ci/woodpecker/pr/woodpecker Pipeline was successful
Every `branch:` in the corpus was flow-style `[main]` or scalar `main`; no
fixture used the block form

    branch:
      - main

so the parser's handling of it was correct but unpinned. That matters now
because oleks/emmett 278a567 deleted the hand-rolled xonsh check and cut the
pre-push WPR slot over to `pipetree lint` -- and block-style scoping is the
exact input that defeated that predecessor (oleks/emmett#385), where it read
as an unscoped trigger and hard-failed correctly-scoped configs. pipetree is
now the sole guard for the class, so a silent regression here would land
straight in everyone's pre-push hook.

Adds two `_clean` fixtures (block `branch:`, and block `path:` with two
entries so a first-item-wins parse cannot pass by accident), both wired into
TestWP001_CleanCases.

The verdict assertion alone is NOT sufficient, which is the reason for the
separate TestWP001_BlockStyleScopingParsesAsScoped: a parser that drops the
list value still leaves the `branch` KEY in the condition, so WP001 sees a
non-`event` key and stays quiet whether or not the scoping survived. Silence
cannot tell "understood" from "lost".

Verified by mutation rather than by assertion alone -- making scalarOrList
reject non-flow sequences (simulating oleks/emmett#385) leaves
TestWP001_Fires, _EventListFires, _CleanCases and _RemediationCarriesClass2Caveat
all PASSING and fails only the new parse test. The mutation was reverted; the
diff here touches no parser code.

verdicts.json regenerated with the real woodpecker-cli via `-update`, not
hand-written: the oracle corpus is globbed, so new fixtures would otherwise
drift it out of sync. Woodpecker's own parser independently reports both as
valid with a when-block and one step, and no existing entry changed.
2026-08-13 22:27:21 +03:00