Skip to content

Commit e61fb12

Browse files
thecodedriftclaude
andcommitted
docs(openspec): tighten runtime-rule specs per Copilot review
Address the remaining #49 review comments (items 1-4, 6-7): - cli-check: the degrade --json scenario now allows the additive `skipped` array (not 'only { success, results }'); --dangerously-run-scripts is described as 'without server validation' rather than 'trusting local signatures' (which the reconciliation spec forbids as an auth mechanism). - cli-rule-reconciliation: rename the requirement heading to 'Reconcile reports every runtime rule's check.ts' (RENAMED op) so the title matches the scoped body instead of the old 'every held rule file'. - cli-runtime-rule-execution: clarify that match mode is read per capture rule (rules may mix modes); state that a broad path-only match carries line/column = 1 and empty text/captures. - design: note the generator path lives in the internal taskless/taskless repo, not this one. (Item 5 — the 'exactly as before' wording — is left as-is by decision.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f3c5dc1 commit e61fb12

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

  • openspec/changes/archive/2026-07-03-runtime-rule-execution

openspec/changes/archive/2026-07-03-runtime-rule-execution/design.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ mode, and never parses rule intent beyond this metadata envelope and the ast-gre
6666
already understands. `.taskless/runtime-rule-tests/<name>/` holds `valid/`/`invalid/` fixtures
6767
and is not executed by `check`.
6868

69-
This layout is confirmed against the generator
70-
(`workers/generator/src/actions/add-runtime-rule.ts`), which writes
69+
This layout is confirmed against the Taskless internal generator — in the sibling
70+
`taskless/taskless` repo, not this one — at `workers/generator/src/actions/add-runtime-rule.ts`,
71+
which writes
7172
`.taskless/runtime-rules/<slug>-<suffix>/` with `<capture-name>.yml` per capture rule and a
7273
`check.ts`, and hashes `check.ts` with the same `canonicalHash` envelope reconcile uses.
7374

openspec/changes/archive/2026-07-03-runtime-rule-execution/specs/cli-check/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ did not run.
7272
### Requirement: Check accepts --dangerously-run-scripts to run runtime rules without server validation
7373

7474
`taskless check` SHALL accept a `--dangerously-run-scripts` flag that runs **all** runtime
75-
rules by trusting their local signatures without server validation, regardless of auth state.
75+
rules without server validation, regardless of auth state.
7676
When the flag is set the CLI SHALL NOT reconcile — it SHALL skip the network entirely (matching
7777
how `--anonymous` forces the no-network path) and execute every present runtime rule. The CLI
7878
SHALL emit a prominent warning that runtime rule code is being executed unverified. The flag
@@ -163,7 +163,7 @@ non-zero code solely because reconciliation failed, and the warning SHALL be sup
163163
#### Scenario: Degrade warning is suppressed under --json
164164

165165
- **WHEN** the CLI degrades and `--json` is set
166-
- **THEN** stdout SHALL contain only the existing `{ success, results }` JSON shape
166+
- **THEN** stdout SHALL contain the machine JSON shape (`{ success, results }` plus the additive optional `skipped` array for the skipped runtime rules)
167167
- **AND** SHALL NOT contain the human-readable degrade warning
168168

169169
## REMOVED Requirements

openspec/changes/archive/2026-07-03-runtime-rule-execution/specs/cli-rule-reconciliation/spec.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
## RENAMED Requirements
2+
3+
- FROM: `### Requirement: Reconcile reports every held rule file`
4+
- TO: `### Requirement: Reconcile reports every runtime rule's check.ts`
5+
16
## MODIFIED Requirements
27

3-
### Requirement: Reconcile reports every held rule file
8+
### Requirement: Reconcile reports every runtime rule's check.ts
49

510
Reconciliation SHALL be scoped to the **`check.ts` of runtime rules** — the only artifact that
611
carries arbitrary code execution. Static ast-grep rules and runtime-rule capture `*.yml` are

openspec/changes/archive/2026-07-03-runtime-rule-execution/specs/cli-runtime-rule-execution/spec.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
The CLI SHALL recognize a **runtime rule** as a directory under `.taskless/runtime-rules/<name>/`
66
containing one or more ast-grep capture `*.yml` (one per capture rule) and a single `check.ts`,
77
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
1012
continue to be treated as static ast-grep rules, not runtime rules.
1113
`.taskless/runtime-rule-tests/<name>/` holds `valid/` and `invalid/` verification fixtures and
1214
SHALL NOT be executed by `check`.
@@ -47,7 +49,9 @@ The CLI SHALL normalize every narrow match to
4749
`{ rule, ruleId, file, line, column, text, captures }`, where `file` is root-relative, `line`
4850
is 1-indexed, and `rule` is the capture rule's stable model-assigned `name`. The CLI SHALL map
4951
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.
5155

5256
#### Scenario: Hashed id maps to model name
5357

0 commit comments

Comments
 (0)