@@ -740,25 +740,31 @@ syntactic rule disambiguates `origin` (a branch name) from `worktree`
740740(a subcommand verb) without per-CLI semantic knowledge — and we will
741741not bake per-CLI knowledge into the parser.
742742
743- Consumers needing security-grade verb identification should pattern-prefix
744- match against the source-ordered ` Clause.Elements ` view:
745-
746- > A command matches an approval pattern ` P ` if and only if the first
747- > ` len(P.verb_prefix) ` verb elements of the command equal ` P.verb_prefix ` .
748-
749- This punts depth choice to the consumer (via the pattern they author)
750- and accommodates the parser's over-extraction transparently:
751-
752- - Pattern ` git push * ` (verb-prefix length 2) matches `git push origin
753- main` because the first two command tokens are ` [ git, push] `.
754- - Pattern ` kubectl get pods * ` (verb-prefix length 3) matches
755- ` kubectl get pods my-pod ` because the first three tokens are
756- ` [kubectl, get, pods] ` .
757- - Auto-proposed patterns for unknown commands should default to
758- the ** full** extracted verb chain (greedy match), which is the
759- security-correct default: a subsequent variation re-prompts rather
760- than silently auto-grants. Operators wanting broader grants opt in
761- explicitly.
743+ Consumers needing security-grade command identification choose one of two
744+ strategies over the source-ordered ` Clause.Elements ` view:
745+
746+ 1 . ** Strict authored-stream matching.** Match every modeled significant
747+ element in source order. A strict matcher may define explicit operand slots
748+ or wildcards, but it SHALL NOT discard an intervening argument merely
749+ because the parser assigned it ` Role=Argument ` . Therefore a strict
750+ ` git commit ` pattern does not match ` git -C /repo commit ` .
751+ 2 . ** General executable-aware matching.** Pass the complete authored stream to
752+ a grammar owned by the consumer. The grammar consumes known options and
753+ operands, identifies the executable's semantic command, and returns both a
754+ normalized approval identity and every policy-relevant operand or scope.
755+ Equivalent syntax may reuse an approval only after complete interpretation.
756+
757+ For example, a Git-aware matcher may interpret ` git -C /repo commit ` as the
758+ general identity ` git commit ` with effective directory ` /repo ` . It may then
759+ reuse a ` git commit ` approval only when that approval's directory policy covers
760+ ` /repo ` . Likewise, executable-aware matchers may intentionally normalize
761+ ` git push origin main ` to ` git push ` or ` kubectl get pods my-pod ` to
762+ ` kubectl get pods ` when their grammars establish which suffixes are operands.
763+
764+ There is no shell-generic rule that selects all ` Role=Verb ` elements and
765+ compares them as a contiguous semantic prefix. For unknown executables or an
766+ unrecognized option shape, consumers should use strict matching or prompt;
767+ they should not silently fall back to a broader general identity.
762768
763769False-negative (re-prompt) is recoverable. False-positive (silent
764770destructive grant) is not. Narrow-by-default favors the recoverable
0 commit comments