1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Command classification — how the kernel will resolve a command name.
//!
//! `CommandKind` is the typed answer to "what will kaish actually run for this
//! name?" It exists so embedders (kaijutsu's consent gate, kaibo) can walk a
//! parsed script and bucket each command node without re-implementing kaish's
//! resolution rules. Re-deriving those rules in the embedder forks kaish's
//! command-resolution truth: the day the kernel refines how a name resolves, a
//! hand-rolled copy silently disagrees with what kaish will actually execute —
//! a security-relevant divergence for anything gating external commands.
/// The category the kernel resolves a command name into.
///
/// Returned by `Kernel::classify_command`. The classification mirrors the
/// interpreter's real resolution order (`execute_command_depth`), not the
/// validator's warning heuristics — it answers "what will run", which is what a
/// consent gate needs.
///
/// The safe direction of any imprecision is to *over*-report `External`: an
/// embedder gating external commands should never see something classified as
/// internal that in fact escapes to `PATH`.