Open
Conversation
8c45c1f to
080109d
Compare
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.
R006: Multiple Marker Semantics
Motivation
A test, effect, or function can carry multiple condition markers. The tutorial currently states that "the exact combination semantics for multiple markers are not yet established." This RFC formalizes the semantics that are already implemented and explains the expressiveness they provide.
The Rule
Each marker independently decides "skip" or "don't skip". If any marker decides to skip, the item is skipped. This is a logical OR over skip decisions.
The implementation iterates through the marker list. Each marker evaluates its condition and determines whether it triggers a skip. The first marker that triggers a skip short-circuits evaluation and the item is skipped. If no marker triggers a skip, the item runs.
Emergent Properties
This single rule produces two intuitive combination semantics depending on the marker kind.
skipmarkers combine with ORSkip if SLOW is set or SKIP_NETWORK is set. Any reason to skip is sufficient.
runmarkers combine with ANDRun only if OS matches and jq is installed. Every condition must hold.
This AND emerges naturally:
run if Xmeans "skip if not X". OR over those skip decisions gives skip if ¬A ∨ ¬B, which is equivalent to run if A ∧ B (De Morgan's law).Mixing
skipandrunis allowedBecause both kinds reduce to the same underlying mechanism — each marker contributes a skip predicate, OR'd together — they compose freely:
This is equivalent to the pure-
runversion above. Users choose whichever phrasing reads most naturally for each condition.flakycomposes with bothThe
flakymarker is orthogonal to skip/run. It sets the flaky flag independently and does not participate in skip decisions. A flaky marker can coexist with any combination of skip and run markers:Expressiveness
The system can express:
# skipmarkers# runmarkersThe system cannot express:
These limitations are theoretical. In practice:
# run if "${OS}" ? ^(linux|darwin)$which("curl") or which("wget")) is not meaningful in a deterministic DSL — if you cannot branch on which tool was found, you must commit to one tool, and the marker should guard on that specific toolChanges Required
Documentation
docs/semantics.mdto expand the one-line summary with the emergent OR/AND propertiesREADME.mdImplementation
None. The current
eval_markerimplementation already implements these semantics correctly.