refactor(cli): P1-5 CLI の排他的オプションを ArgGroup と typed request で表現する#92
Merged
Conversation
…表現する --dry-run と --apply の静的排他を Picocli @Arggroup に移し、call() 内の 手動 ParameterException / new CommandLine(this) を削除する。実行 mode は CanonicalizationExecutionMode で表し、未指定時は従来どおり dry-run を既定とする。
--entry / --entry-index / --entry-title-regex / --entry-url-regex の値を parse 段階で FeedEntrySelection へ変換する。blank・不正値は TypeConversionException として usage error にし、command 内の手動 parse へ持ち込まない。
4 つの selector を optional exclusive group にまとめ、複数指定を優先順位ではなく usage error にする。resolveSelection の priority chain と blank fall-through を廃止し、 未指定時のみ first を default とする。help からも selection priority 文言を削除する。
article/feed probe の URL 検証と FullTextMethod capability 判定を ProbeArticleCliRequest / ProbeFeedCliRequest の factory へ移し、command の call() を request 生成 → service 呼び出し → outcome mapping に限定する。 service 側の defensive validation は維持する。
@Arggroup の exclusive/multiplicity を reflection で検証し、手動 exclusivity や resolveSelection / selection priority の再導入を source guard で防ぐ。 SreaderCliExecutor 経由でも mode/selector conflict と dynamic capability が exit code 2 かつ service 未呼び出しになることを確認する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
P1-5 として、CLI の静的な排他 option と method 値依存の制約を、command 内の手動 validation から Picocli / 型境界へ移した。
content canonicalizeの--dry-run/--applyを optional exclusive@ArgGroupとCanonicalizationExecutionModeで表現(未指定は dry-run)probe feedの 4 entry selector を optional exclusive@ArgGroup化し、複数指定を優先順位ではなく usage error に変更FeedEntrySelectionへ変換し、blank は usage errorProbeArticleCliRequest/ProbeFeedCliRequestに集約意図的な semantic correction
call()内 → parse 段階(exit 2 は維持)Test plan
docker compose run --rm maven mvn clean verify(668 tests、jacoco check 通過)mvn spotless:check/checkstyle:checkdocker compose config/docker compose build appresolveSelection/new CommandLine(this)/selection priorityは production から除去(defensivedryRun && applyのみ group 内に残存)Base
b995305f38dd018d268d52d8cd966e18fde864404.7.7