|
5 | 5 | The CLI SHALL recognize a **runtime rule** as a directory under `.taskless/runtime-rules/<name>/` |
6 | 6 | containing one or more ast-grep capture `*.yml` (one per capture rule) and a single `check.ts`, |
7 | 7 | its capture rules declaring `metadata.taskless.kind: runtime`. The rule's check file SHALL be |
8 | | -the `check.ts` in the rule directory. The CLI SHALL read `metadata.taskless.match` (`anchor` or |
9 | | -`broad`) to select the ast-grep invocation mode. Rule files under `.taskless/rules/` SHALL |
| 8 | +the `check.ts` in the rule directory. The CLI SHALL read **each capture rule's** |
| 9 | +`metadata.taskless.match` (`anchor` or `broad`) to select that capture rule's ast-grep |
| 10 | +invocation mode; capture rules within one runtime rule MAY mix modes (each is independent). |
| 11 | +Rule files under `.taskless/rules/` SHALL |
10 | 12 | continue to be treated as static ast-grep rules, not runtime rules. |
11 | 13 | `.taskless/runtime-rule-tests/<name>/` holds `valid/` and `invalid/` verification fixtures and |
12 | 14 | SHALL NOT be executed by `check`. |
@@ -47,7 +49,9 @@ The CLI SHALL normalize every narrow match to |
47 | 49 | `{ rule, ruleId, file, line, column, text, captures }`, where `file` is root-relative, `line` |
48 | 50 | is 1-indexed, and `rule` is the capture rule's stable model-assigned `name`. The CLI SHALL map |
49 | 51 | the hashed capture-rule `id` used by the scan back to that `name` so `match.rule` is the value |
50 | | -the check branches on, never the hash. |
| 52 | +the check branches on, never the hash. A `broad` (path-only, `--files-with-matches`) match |
| 53 | +carries no location or captures: its `line` and `column` SHALL be `1`, and its `text` and |
| 54 | +`captures` SHALL be empty. |
51 | 55 |
|
52 | 56 | #### Scenario: Hashed id maps to model name |
53 | 57 |
|
|
0 commit comments