Files
Ignacy Łątka b27f222386 fix(flows): refuse to record a step whose native-devtools precheck blocked (#1116)
Fixes #935.

**Cause:** a blocked native-devtools precheck is a *resolved* result, so
`flow-add-step` read "it returned" as "it ran" and wrote the step - a
`restart-app` that terminated and launched nothing became a passing
`launch:`, while the runner scores that same result an error at replay.

**Fix:** the recorder reads the runner's own
`isNativeDevtoolsBlockResult` right after the sub-invoke and fails the
call, recording nothing. Keyed on `params.command`, so it covers all
nine precheck tools, not just the `restart-app` in the report.

**Left alone:** `isDebuggerNotConnectedResult` is the same shape on the
recorder path and is filed separately as #964;
`nestedOrchestratorOutcome` is #719's scope.

**Docs:** none needed - no tool, CLI, config key or flow directive
changed, and `flow-add-step`'s description already states that an error
means nothing was recorded.

<details>
<summary>Verification</summary>

New
`packages/tool-server/test/flows/flow-record-native-devtools-gate.test.ts`
- all four block statuses on `restart-app`, the raw `tool:` spelling on
`native-full-hierarchy`, plus two negative controls (a green
`restart-app` still records `launch:`; a `gesture-tap` answering
`{status: "connect_pending"}` still records).

Discriminates - with the source hunk stashed:

```
Tests  5 failed | 2 passed (7)
AssertionError: promise resolved "{ ...(5) }" instead of rejecting
+   "message": "Step added to \"nd-rec\" flow",
+   "recorded": "1. tool: native-full-hierarchy {\"bundleId\":\"com.example.app\"}",
```

Restored:

```
Test Files  1 passed (1)
     Tests  7 passed (7)
```

- `npx tsc --build` - clean
- `npm run typecheck:tests -w @argent/tool-server` - clean
- `npm test -w @argent/tool-server` - 369 files, 4839 passed, 1 skipped
- `npx prettier --check` on both files - unchanged
- eslint on the two files could not run locally
(`packages/docs/tsconfig.json` needs its own `npm ci`); CI covers it.

</details>

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 16:56:23 +02:00
..
2026-08-28 09:55:47 +02:00