Repository navigation
Description
π¬ Lean Squad β Task 2: Informal Spec Extraction | Run 25028150874
Summary
Extracts a precise informal specification for ResponseFileHelper.SplitCommandLine, a pure tokeniser that splits command-line strings into token sequences. This method is used when parsing @response-file arguments.
What's in this PR
formal-verification/specs/responsefilehelper_splitcommandline_informal.md:
- Complete state-machine description (two variables:
seeking,seekingQuote) - Transition table for all character categories (whitespace,
", other) - 23 named properties across 5 groups:
- Group 1: Trivial inputs (empty, whitespace-only, single word, leading/trailing trim)
- Group 2: Whitespace splitting (delimiter, multiple spaces, tab handling)
- Group 3: Quote handling (grouping, stripping, empty
""token, mid-word embedding) - Group 4: Structural invariants (determinism, quote-free output, empty token only from
"") - Group 5: Composition (single-word round-trip, concatenation with space)
- Edge case table with 14 specific examples including confirmed surprising behaviours
- 5 design issues identified (see below)
formal-verification/TARGETS.md: advances ResponseFileHelper.SplitCommandLine from phase 1 β phase 2
Design Issues Identified
| Issue | Description |
|---|---|
| Issue 1 | No escape sequence support β cannot embed literal " in a token |
| Issue 2 | Unclosed opening quote at TokenStart silently discards all input: SplitCommandLine("\"abc") = [] |
| Issue 3 | Unclosed mid-word quote includes content: SplitCommandLine("abc\"def") = ["abcdef"] (asymmetric with Issue 2) |
| Issue 4 | Adjacent quoted strings emit two tokens: SplitCommandLine("\"foo\"\"bar\"") = ["foo", "bar"] (closing " triggers yield+reset) |
| Issue 5 | No unit tests exist for this method |
Issue 2 is the most notable: a response file line like "hello (opening quote without closing) would produce no tokens β the entire line is silently dropped. This may surprise users.
Approximations for Lean 4
- Model strings as
List Charfor structural induction - Model
char.IsWhiteSpaceas a decidable predicate - Model
IEnumerable<string>asList String(termination guaranteed:posstrictly increases) - Represent state machine as tail-recursive function with accumulator
Next Steps
Task 3: Write the Lean 4 formal spec for this target (blocked pending Lean toolchain availability in runner).
This PR was created automatically by the Lean Squad FV agent.
Generated by π Lean Squad, see workflow run.
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch lean-squad/task2-splitcommandline-2026-04-28-af0bc0029033d7ce.
To fix the permissions issue, go to Settings β Actions β General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (280 of 280 lines)
From 613f94876ac3f759ae82703c3257e2fb1600b027 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Tue, 28 Apr 2026 01:09:55 +0000
Subject: [PATCH] =?UTF-8?q?feat(fv):=20Task=202=20=E2=80=94=20informal=20s?=
=?UTF-8?q?pec=20for=20ResponseFileHelper.SplitCommandLine?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Extracts a precise informal specification for the SplitCommandLine
tokeniser in ResponseFileHelper. Documents:
- State machine with two variables (seeking, seekingQuote)
- 23 named properties across 5 groups (trivial, whitespace, quotes,
structural invariants, composition)
- Edge case analysis including unclosed-quote behaviour (Issue 2/3)
- Asymmetry: unclosed opening quote silently discards content;
unclosed mid-word quote is included in output token
- Adjacent quoted segments emit two separate tokens (Issue 4)
- No escape sequence support (Issue 1)
- No existing unit tests (Issue 5)
- Approximations for Lean 4 model (List Char, decidable isWhitespace)
Advances ResponseFileHelper.SplitCommandLine from phase 1 to phase 2.
Co-authored-by: Copilot <[email protected]>
---
formal-verification/TARGETS.md | 2 +-
...nsefilehelper_splitcommandline_informal.md | 225 ++++++++++++++++++
2 files changed, 226 insertions(+), 1 deletion(-)
create mode 100644 formal-verification/specs/responsefilehelper_splitcommandline_informal.md
diff --git a/formal-verification/TARGETS.md b/formal-verification/TARGETS.md
index 12b9d0277..bc67adc21 100644
--- a/formal-verification/TARGETS.md
+++ b/formal-verification/TARGETS.md
@@ -21,7 +21,7 @@
| 3 | `CommandLineParser.ParseOptionAndSeparators` | `src/Platform/Microsoft.Testing.Platform/CommandLine/Parser.cs` | 1 | Identified | β |
| 4 | `CommandLineOptionsValidator` arity validation | `src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOptionsValidator.cs` | 1 | Identifie
... (truncated)
Activity