Skip to content

Commit 36439b0

Browse files
committed
docs(agent): let check's own output decide the 0.12.0 ledger's v2 steps
Instead of preconditions on login state, run check --json once after init and act on the messages it prints: a copy of an issued rule, an edited rule, a pre-v2 runtime rule, a missing rule. A run where signatures do not apply (logged out, an expired token, an uncovered repository) prints none of them, so there is nothing to decide up front.
1 parent 2e347ac commit 36439b0

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

‎packages/cli/src/agent/update.md‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -302,39 +302,39 @@ removes the emptied legacy directory. A test that matches no rule is
302302
left where it is. `check` refuses to run until the project is migrated,
303303
logged in or not, and names `init`. Commit the moved files.
304304

305-
**Only if `loggedIn` is `true` in `%(TASKLESS_CLI)s info --json`:** the
306-
CLI now speaks the Taskless v2 rule API, which addresses a rule by its
307-
own id (its directory name under `.taskless/rules/<engine>/`) and checks
308-
every issued rule against what Taskless issued. Logged out, nothing is
309-
checked, runtime rules are skipped as before, and none of the four
310-
entries below applies.
311-
312-
- **Rules issued before 0.12.0 are treated as locally written.** They
313-
came through the v1 API, which v2 does not know, so reconcile answers
314-
them `unknown` and nothing can restore them. An ast-grep or Vale rule
315-
keeps running, as any rule you wrote yourself. A runtime rule does
316-
not: an `unknown` runtime rule never executes, so `check` skips it and
317-
names it in `skipped` under `--json`. Regenerate each one with
305+
**Then run `%(TASKLESS_CLI)s check --json` once, and act on what it
306+
reports.** The CLI now speaks the Taskless v2 rule API, which checks
307+
every rule Taskless issued against what it issued, so `check` itself
308+
says whether any rule needs attention. If none of the following appears
309+
in its output, there is nothing to do. That includes every run that is
310+
logged out, where nothing is checked.
311+
312+
- **"is a copy of Taskless rule `<source>`"** (in `failures`, `notices`,
313+
or a `skipped` reason): the rule carries a file Taskless issued to
314+
another rule, so it did not run. If the message says the source "was
315+
deleted", run `%(TASKLESS_CLI)s rule restore <source>`; either way,
316+
delete the copy. Never restore the copy's own id.
317+
- **"was edited since Taskless issued it"**: run
318+
`%(TASKLESS_CLI)s rule restore <ruleId>` rather than editing it back
319+
by hand. It writes only bytes whose signatures verify, and on a plan
320+
without rule recovery it prints how to recover the rule from git
321+
instead.
322+
- **A runtime rule in `skipped` with "not issued by the rule service"**:
323+
it was generated before 0.12.0, through the v1 API, and v2 cannot
324+
vouch for it, so it never runs. Regenerate it with
318325
`%(TASKLESS_CLI)s agent create-remote-rule`, then delete the old
319-
directory.
320-
- **An edited issued rule fails `check`.** An edited ast-grep or Vale
321-
rule does not run and fails the run, naming each changed, removed or
322-
added file; an edited runtime rule does not run. Do not edit a rule
323-
back by hand: run `%(TASKLESS_CLI)s rule restore <ruleId>`, which
324-
writes only bytes whose signatures verify. On a plan without rule
325-
recovery it prints how to recover the rule from git instead. `check`
326-
itself never rewrites a rule.
327-
- **A copied or renamed issued rule fails `check` too.** A rule under a
328-
new id that still carries a file Taskless issued to another rule does
329-
not run, and the failure names the rule it came from. If the original
330-
was deleted, the pair is reported as one rename: restore the original
331-
with `rule restore <originalId>`, then delete the copy. Never restore
332-
the copy's own id.
333-
- **`rule create --json` prints `requestId`, not `ruleId`.** The old
334-
field always held the request id. The ids of the rules written are in
335-
`rules`, and those are what `rule improve`, `rule restore`,
336-
`rule revisions` and `rule rollback` take. Update anything that read
337-
`ruleId` from `rule create`.
326+
directory. An ast-grep or Vale rule from before 0.12.0 keeps running,
327+
as a rule you wrote yourself, and needs nothing.
328+
- **"was issued for this repository but is not in .taskless/rules/"**:
329+
run `%(TASKLESS_CLI)s rule restore <ruleId>` to bring it back, or
330+
ignore it if the rule was removed on purpose.
331+
332+
`check` never rewrites a rule itself; each fix above is a command you
333+
run. Separately, **`rule create --json` prints `requestId`, not
334+
`ruleId`**: the old field always held the request id. The ids of the
335+
rules written are in `rules`, and those are what `rule improve`,
336+
`rule restore`, `rule revisions` and `rule rollback` take. Update any
337+
script that read `ruleId` from `rule create`.
338338

339339
**Files over 128KB are linted again.** 0.11.2 skipped any target file
340340
over 128KB that a matcher's section reached, naming it in a `notices`

0 commit comments

Comments
 (0)