Skip to content

Fix CLI option registry drift (#4861) - #4959

Draft
Widthdom wants to merge 6 commits into
mainfrom
fix-issue4861
Draft

Fix CLI option registry drift (#4861)#4959
Widthdom wants to merge 6 commits into
mainfrom
fix-issue4861

Conversation

@Widthdom

@Widthdom Widthdom commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • make CliFlagSchema the authoritative source for command-specific accepted values, aliases, safety/scope metadata, nested completion contexts, help, validation, and parser option partitions
  • generate command-specific Bash, Zsh, Fish, and PowerShell values and hook completions, including audit SARIF, search origins/result kinds, hook-install --dry-run, hook install/uninstall --force, and path-aware hook project completion
  • stop advertising rejected goto --exact, preserve exact output-format normalization, and document the registry contract in the bilingual developer, testing, and user guides
  • normalize captured console help line endings in the regression test so the same contract is validated on Windows CRLF and Unix LF hosts
  • add the bilingual changelog fragment changelog.d/unreleased/4861.fixed.md

Root cause

Accepted option names and values were duplicated across parsers, help text, validation, and four completion renderers. Those parallel lists drifted, so valid values were omitted while rejected options or aliases were advertised. Nested hook verbs also lacked enough shared context to scope safety-sensitive flags accurately.

The initial pipeline failure was test-only: ConsoleUiTests.PrintCommandUsage_DedicatedParsersOnlyEmitAuthoritativeParentOptionLists_Issues4571_4861 asserted LF delimiters directly, while Windows captured CRLF output. The test now normalizes line endings before checking section boundaries.

Validation

  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false — passed, 0 warnings/errors
  • dotnet build CodeIndex.sln -c Debug -p:UseSharedCompilation=false — passed, 0 warnings/errors
  • schema/help tests after merging latest origin/main: net8.0 297 passed; net9.0 297 passed
  • the previously failing focused ConsoleUiTests case passed on net8.0 after line-ending normalization
  • Bash, Zsh, and PowerShell generated-script syntax checks — passed
  • Bash and PowerShell runtime completion checks for option-before-verb, project-value skipping, install, uninstall, and status — passed
  • dotnet format CodeIndex.sln --verify-no-changes --no-restore — passed
  • changelog fragment validation — passed (36 fragments)
  • index freshness check — index_matches_workspace: true at f6b21a176
  • Codex adversarial review: two rounds completed; all three first-round P2 findings and both final-round P2 findings were fixed and retested

A full Release test run was also attempted before the CI follow-up: net9 was green; net8 retained the known subproject watcher failure tracked by #4955. A separate transient Unicode worker failure passed when rerun in isolation.

Fixes #4861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate CLI help from the accepted option and value registry

1 participant