You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValidateOptionsArgumentArity groups all parsed options by name, accumulates their total argument count across all occurrences, then enforces the registered ArgumentArity(Min, Max) constraint with three mutually-exclusive error cases:
Case
Condition
Error type
Expects no arguments
Max == 0 AND arity > 0
Specific "no arguments" message
Too few arguments
arity < Min
"expects at least Min"
Too many arguments
arity > Max AND Max > 0
"expects at most Max"
Open Questions Documented
OQ-1: Absent required options (Min > 0 but option not in parse result) are not caught here β delegated to ValidateConfigurationAsync. Coverage gap.
OQ-2: providerAndOptionByOptionName[optionName] will throw KeyNotFoundException if pipeline order changes and ValidateNoUnknownOptions is skipped.
OQ-3: Arity is aggregated cumulatively across all occurrences β --opt a --opt b yields arity 2, not 1.
Theorems Ready for Lean (Task 3)
7 theorem stubs identified, all provable with omega or decide:
T2: "no arguments" branch iff Max == 0 AND arity > 0
T4: three error branches are mutually exclusive given 0 β€ Min β€ Max
T3: exact-arity check correctness
T5: soundness (if Valid, then Min β€ arity β€ Max for every option)
Lean Toolchain Note
Lean is not available in this sandbox (network firewall blocks elan/curl). Task 3 (formal Lean spec) is blocked until the CI toolchain is available.
The patch file is available in the agent artifact in the workflow run linked above.
To create a pull request with the changes:
# Download the artifact from the workflow run
gh run download 25274572198 -n agent -D /tmp/agent-25274572198
# Create a new branch
git checkout -b lean-squad/task2-informal-spec-arity-validation-2026-05-03-16f4e68783c14e26
# Apply the patch (--3way handles cross-repo patches where files may already exist)
git am --3way /tmp/agent-25274572198/aw-lean-squad-task2-informal-spec-arity-validation-2026-05-03.patch
# Push the branch to origin
git push origin lean-squad/task2-informal-spec-arity-validation-2026-05-03-16f4e68783c14e26
# Create the pull request
gh pr create --title '[Lean Squad] feat(fv): Task 2 β informal spec for CommandLineOptionsValidator arity validation' --base main --head lean-squad/task2-informal-spec-arity-validation-2026-05-03-16f4e68783c14e26 --repo microsoft/testfx
π¬ Lean Squad β automated formal verification agent. Run: https://github.com/microsoft/testfx/actions/runs/25274572198
Summary
This PR completes Task 2 (Informal Spec Extraction) for Target 4:
CommandLineOptionsValidator.ValidateOptionsArgumentArity.Changes
formal-verification/specs/commandlineoptionsvalidator_arity_informal.mdformal-verification/TARGETS.mdβ Target 4 β phase 2; fix Target 5 to show phase 2 (spec was merged in PR [Lean Squad] feat(fv): Task 2 β informal spec for CommandLineParseResult.EqualsΒ #7918)Spec Highlights
ValidateOptionsArgumentAritygroups all parsed options by name, accumulates their total argument count across all occurrences, then enforces the registeredArgumentArity(Min, Max)constraint with three mutually-exclusive error cases:Max == 0 AND arity > 0arity < Minarity > Max AND Max > 0Open Questions Documented
Min > 0but option not in parse result) are not caught here β delegated toValidateConfigurationAsync. Coverage gap.providerAndOptionByOptionName[optionName]will throwKeyNotFoundExceptionif pipeline order changes andValidateNoUnknownOptionsis skipped.--opt a --opt byields arity 2, not 1.Theorems Ready for Lean (Task 3)
7 theorem stubs identified, all provable with
omegaordecide:Max == 0 AND arity > 00 β€ Min β€ MaxMin β€ arity β€ Maxfor every option)Lean Toolchain Note
Lean is not available in this sandbox (network firewall blocks
elan/curl). Task 3 (formal Lean spec) is blocked until the CI toolchain is available.Note
This was originally intended as a pull request, but the git push operation failed.
Workflow Run: View run details and download patch artifact
The patch file is available in the
agentartifact in the workflow run linked above.To create a pull request with the changes:
Show patch preview (210 of 210 lines)