skip
skip
¶
Runtime evaluation of skip_when command predicates (#360, renamed #119).
A score may declare, per sheet, a shell command that decides at dispatch time whether the sheet should be skipped:
skip_when:
8: {command: 'grep -q "PHASES: 1" {workspace}/plan.md'}
Semantics (mirroring :class:SkipWhenCommand's own docstring):
- exit
0→ the condition is met → SKIP the sheet. - exit non-zero → PROCEED (run the sheet normally).
- timeout / spawn error / substitution error → PROCEED (fail-open).
The fail-open bias is deliberate and matches the model contract. The cost of a wrong-skip is silently dropping real work (invisible, unrecoverable); the cost of a wrong-proceed is one phantom instance (visible in logs, leaves an artifact). For brand-stake workflows, silent omission is the higher-severity failure, so a broken predicate must never cause a skip. Every fail-open path logs a WARNING so the misconfiguration is diagnosable.
This replicates the process-group-safe subprocess pattern from
ValidationEngine._check_command_succeeds (execution/validation/engine.py)
rather than importing it — the musician path must not depend on the validation
engine, and the skip/proceed return shape differs from a ValidationResult. A
future pass could unify both on a shared runner (see #360).
Classes¶
Functions:¶
evaluate_skip_command
async
¶
Evaluate a skip_when command predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
swc
|
SkipWhenCommand
|
The command rule (command string + timeout). |
required |
workspace
|
Path
|
The sheet's workspace (substituted for |
required |
context
|
dict[str, Any]
|
Template variables for |
required |
sheet_num
|
int | None
|
Optional sheet number for log correlation. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
|
str
|
exit-0; every error path returns |
Source code in src/marianne/daemon/baton/skip.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |