Structs§
Functions§
- build_
registry - canonical_
name - The canonical command name
cmdresolves to via the registry’s alias map (gcat→cat,glink→ln). Returnscmdunchanged when it is already canonical or unknown, so callers can canonicalize unconditionally. This is what lets the engine’s path-gate dispatch reach an aliased invocation: without it,gcat /etc/shadowmisses every resolver and falls through to the (ungated) legacy classifier. Custom registry first (an override may rename), then TOML. - check_
handler_ policy - Validate
tokensagainstcmd_name’s named flag policy declared in a[command.handler_policy.KEY]block. Returnsfalseif no such policy is declared or the tokens fail it. Used by handlers whose dispatch logic genuinely can’t move to TOML (e.g. gh’s sub × action matrix) but whose per-policy WordSets should live in TOML rather than as RustWordSetconstants. - custom_
dispatch - Looks up the command in the runtime custom registry (project-local
.safe-chains.toml, then user-level~/.config/safe-chains.toml). A match here wins over the built-in hardcoded handlers, which is how an override ofghtakes effect. - dispatch_
spec - is_
eval_ safe_ invocation - Returns true iff this invocation is tagged eval-safe — meaning its
stdout is documented shell-init code that can safely be substituted
inside
eval "$(...)". - load_
toml - toml_
command_ docs - toml_
command_ names - toml_
dispatch - try_
fallback_ grammar - Apply
cmd_name’s TOML-declared[command.fallback]grammar. ReturnsNoneif no fallback is declared. - try_
matrix_ dispatch - Dispatch
tokensagainstcmd_name’s[[command.matrix]]blocks. Looks attokens[1](parent) andtokens[2](action), finds the first matrix whoseparentscontains the parent and whoseactionsmap contains the action, then validatestokens[2..]against the named policy (and a guard flag if the matrix entry declared one). ReturnsNoneif no matrix matched — the handler can then fall through to its remaining special cases or deny. - try_
sub_ dispatch - Look up
cmd_name’s TOML-declared subs (set via[[command.sub]]blocks alongsidehandler = "...") and dispatch the one whose name matchestokens[1]. ReturnsNoneif no sub matched, so the handler can fall through to its fallback grammar (or deny).