You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: raid doctor runs verify entries with self-heal (closes#42) (#87)
* feat: raid doctor runs verify entries with self-heal (closes#42)
Every verify: entry on the active profile and per-repo raid.yaml files
now runs as part of `raid doctor` and produces a finding:
- first-try pass → ok
- failure → onFail → pass → warn (remediated by onFail)
- failure that can't be healed → error
RunVerify now returns (VerifyOutcome, error) so doctor can distinguish
a clean pass from a successful self-heal — the latter is a warning so
the user knows something silently fixed itself. The remediated state
maps to the doctor warn severity; failures don't short-circuit
subsequent entries, so one run reports the full picture.
The cmd/doctor JSON shape is unchanged — verify findings flow through
the existing Finding type.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address Copilot review on doctor verify
- doctor: load per-repo raid.yaml verify entries before running them.
Previously the doctor path never invoked buildRepo/ExtractRepo on the
repo, so verify blocks defined only in raid.yaml were silently skipped
(BuildSingleRepoProfile keeps only name/path/branch; ExtractProfile
only sees what's in the wrapping profile).
- verify: fix VerifyOutcome doc comment — describe the real tri-state
enum rather than implying failed is a separate "fourth state".
- docs: clarify that verify tasks/onFail can be any task type
(HTTP, Git, Template, Prompt/Confirm, SetVar, …), not just shell.
Updates doctor.mdx warning, whats-new.mdx release note, and the
embedded verifyArray schema description (which still said verify
entries were inert / doctor integration was future work).
- tests: replace the pre-populated repo.Verify test with one that
exercises the load-from-raid.yaml path, and add a merge case that
covers both profile-level and raid.yaml verify entries.
Co-Authored-By: Copilot <copilot@github.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Mr. Meeseeks <alex.salerno+meeseeks@me.com>
Co-authored-by: Copilot <copilot@github.com>
Copy file name to clipboardExpand all lines: schemas/raid-defs.schema.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -636,7 +636,7 @@
636
636
},
637
637
"verifyArray": {
638
638
"type": "array",
639
-
"description": "Declarative precondition checks. Each entry runs `tasks:` to assert a dependency or environmental precondition; if any task exits non-zero and `onFail:` is provided, raid runs the remediation once and re-runs `tasks:` exactly once. Verify entries are inert at the CLI today — `raid doctor` (#42) surfaces them as findings. Keep checks small and fast: each entry is run on every doctor invocation.",
639
+
"description": "Declarative precondition checks. Each entry runs `tasks:` to assert a dependency or environmental precondition; if any task exits non-zero and `onFail:` is provided, raid runs the remediation once and re-runs `tasks:` exactly once. `raid doctor` runs every verify entry on the active profile and per-repo `raid.yaml` files and surfaces each as a finding (ok / warn / error). Keep checks small and fast: each entry is run on every doctor invocation.",
Copy file name to clipboardExpand all lines: site/docs/references/schema.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ install:
211
211
212
212
Declarative precondition checks. Each entry runs `tasks:` to assert that a dependency or environmental requirement is in place. An optional `onFail:` remediation gets exactly one chance to fix things — if remediation succeeds, raid re-runs `tasks:` once; if that pass succeeds the verify is reported as remediated, otherwise it fails.
213
213
214
-
Verify entries are accepted on both profiles and per-repo `raid.yaml` files. They share execution context with `install:` — the active environment, raid vars, and task options all apply. The schema accepts verify entries today; a future release will surface them through `raid doctor` (and, longer-term, a dedicated `raid verify` command).
214
+
Verify entries are accepted on both profiles and per-repo `raid.yaml` files. They share execution context with `install:` — the active environment, raid vars, and task options all apply. `raid doctor` runs every verify entry and surfaces each as a finding: a first-try pass is an `ok` finding, a successful self-heal is a `warn` (the precondition holds now, but didn't before — worth knowing), and a failure is an `error` carrying the underlying task error.
- Every [`verify:`](../references/schema#verify) entry on the profile and per-repo `raid.yaml` files
31
+
32
+
## Verify entries
33
+
34
+
If your profile or any repo's `raid.yaml` defines a [`verify:`](../references/schema#verify) block, doctor runs every entry and surfaces each as its own finding:
35
+
36
+
| Outcome | Severity | What it means |
37
+
|---|---|---|
38
+
| First-try pass |`ok`| The verify's `tasks:` exited cleanly on the first try. |
39
+
| Remediated |`warn`|`tasks:` failed, the optional `onFail:` block ran, and the re-run of `tasks:` then passed. The precondition holds *now* — but it didn't before, so doctor warns you to investigate why. |
40
+
| Failed |`error`| Either no `onFail:` was defined, `onFail:` itself failed, or the retry of `tasks:` failed again. The underlying task error is included in the finding's message. |
41
+
42
+
Doctor runs verify tasks with the same execution context as `install:` — the active environment, raid vars, and task options all apply. A failure on one verify entry does not prevent subsequent entries from running, so you see the full health picture in a single pass.
43
+
44
+
:::warning Verify tasks execute real work
45
+
Doctor invokes the actual `tasks:` and `onFail:` blocks you've defined — that's any task type raid supports (shell commands, HTTP, Git, Template, Prompt/Confirm, SetVar, …), not just shell. Non-shell tasks can still make network calls, mutate files, or prompt for input. Keep verify checks small, fast, and side-effect-light (a `node --version` probe, a `test -f`, a `Wait` against a local port). Heavy bootstrap work belongs in `install:`.
Copy file name to clipboardExpand all lines: site/docs/whats-new.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ User-visible changes per release, latest first. For full commit history see the
11
11
12
12
## 0.14.0 — upcoming
13
13
14
-
**Declarative `verify:` blocks.** Profiles and per-repo `raid.yaml`s now accept a top-level `verify:` list. Each entry runs `tasks:` to assert a precondition (a tool is installed, a port is reachable, a credentials file exists), and an optional `onFail:` remediation gets exactly one chance to fix things — if it succeeds, raid re-runs `tasks:` once and the verify is reported as remediated; otherwise it surfaces as a structured `VERIFY_FAILED` error. Verify entries share execution context with `install:` tasks (active env + raid vars + task options). `raid doctor` integration to surface verify entries as health-report findings follows in [#42](https://github.com/8bitAlex/raid/issues/42). See [Schema → Verify](/docs/references/schema#verify). Closes [#38](https://github.com/8bitAlex/raid/issues/38).
14
+
**`raid doctor` runs `verify:` entries with self-heal.** Every `verify:` entry on the active profile and per-repo `raid.yaml` files now runs as part of `raid doctor` and produces its own finding: `ok` for a first-try pass, `warn` when the optional `onFail:` block recovered a failing precondition (the verify holds *now*, but didn't before — worth knowing), and `error` when the precondition can't be made to hold. Failures don't short-circuit subsequent entries, so a single `raid doctor` run reports the full picture. Doctor invokes the actual `tasks:` and `onFail:` blocks — any task type raid supports (shell, HTTP, Git, Template, Prompt/Confirm, SetVar, …), not just shell. Keep verify checks small and fast, since they'll run every time you (or CI, or an agent) checks raid's health. See [Doctor → Verify entries](/docs/usage/doctor#verify-entries). Closes [#42](https://github.com/8bitAlex/raid/issues/42).
15
+
16
+
**Declarative `verify:` blocks.** Profiles and per-repo `raid.yaml`s now accept a top-level `verify:` list. Each entry runs `tasks:` to assert a precondition (a tool is installed, a port is reachable, a credentials file exists), and an optional `onFail:` remediation gets exactly one chance to fix things — if it succeeds, raid re-runs `tasks:` once and the verify is reported as remediated; otherwise it surfaces as a structured `VERIFY_FAILED` error. Verify entries share execution context with `install:` tasks (active env + raid vars + task options). `raid doctor` integration is now wired (see entry above). See [Schema → Verify](/docs/references/schema#verify). Closes [#38](https://github.com/8bitAlex/raid/issues/38).
15
17
16
18
**Shared `options:` block on every task type.** A new `options:` block on the base task definition composes uniformly across every task type (and on user-defined commands) so cross-cutting fields don't have to be re-declared per type. The initial field, `showExeTime: bool`, prints a dim line to stderr after a task or command completes with the elapsed time: `task-name complete in 1.2s`. Omitting `options` (or any field within it) leaves current behavior unchanged, so the addition is fully backwards compatible. Additional fields (`quiet`, `timeout`, …) will ship additively. Closes [#54](https://github.com/8bitAlex/raid/issues/54).
0 commit comments