Repository navigation
Validate input that names a context before entering it - #145
Conversation
An interactive submission naming a context, and a command line naming one, entered the context without ever running the application's input validators: only help and ambient commands were validated before dispatch. An Invalid or Incomplete result therefore did not stop the navigation. Input naming a context now passes through the validators before the context validators run and before the scope changes. A refusal is reported, keeps the session in its scope or the command line out of the context, and uses the exit codes of the module that mapped the context; a validator that throws is reported as an input callback failure instead of ending the session. The help refusal shares the same path. Fixes #140
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
autocarl
left a comment
There was a problem hiding this comment.
Approved exact head f42f3a8c37afbaa51849941f308bc95a7e8a405b.
Context navigation now runs application validation once before scope mutation/context validation, on CLI and interactive submission. Independent differential probes executed 496 rows across head and merge base: Invalid, Incomplete, thrown errors/unrelated OCE, Valid/disabled controls; nested/parameterized contexts, prefixes/case, injected services, typed globals, JSON/unknown formats, module exit mappings and caller cancellation. Help, ambient and routed-command callback counts remain unchanged. Parent reran the verification assertions. The related current-base delta does not overlap the changed execution/validation files; no merged-current-base runtime claim is made. No introduced P0–P2 found.
Parent Release solution build with -warnaserror: zero warnings/errors; full suite 2,399 passed, 0 failed, 3 expected skips. All applicable live CI checks pass. Documentation appropriately retains context authorization as a separate responsibility. Worktree clean; no merge performed.
Fixes #140.
What changes
tools) now passes through the application's input validators (UseInputValidator) before the context validators run and before the scope changes. Invalid and Incomplete refuse it: the refusal is reported and the session stays in its scope. Valid navigates as before.app toolshad the same gap through the context deep link; it is validated the same way, and a refusal never enters the context.ValidateCurrentInputAsyncruns the validators on the current input; the existing help refusal now uses it too.docs/advanced-input.mdsays input naming a context is validated, and warns that the words alone are not a reliable way to recognise it (relative scope, unique prefixes, letter case): access to a context belongs to its own validation.Verification
Given_AdvancedInput.When_ASubmissionNamesAContext_Then_InputValidationDecidesTheNavigation(Invalid, Incomplete, throwing, Valid): the validator runs exactly once for the submission, the refusal or failure is reported, the context validator does not run on refusal, and the nextwhereruns at the expected scope.Given_AdvancedInput.When_ACommandLineNamesAContextTheValidatorsRefuse_Then_TheContextIsNotEntered.Given_ModuleExitCodes.When_InputValidationRefusesAContext_Then_TheContextModuleDecides: the module's code (5), not the application's (2); checked red with the attribution removed.Not in this PR:
ParsedInputContextexposes no resolved context path, so validators cannot recognise a navigation independently of its spelling; context validation remains the place to guard access.