Unblock the last two commands from the 3DX session replay - #108
Merged
Conversation
Replaying parser/testdata/corpus/session-3dx.yaml end to end (parse + validate) left 4 of 17 commands blocked. Two were real defects. get-psdrive declared `flags: []`, so `-PSProvider FileSystem` was rejected even though it parsed. The corpus filed this command under "Already works" — true of the parser, false of the validator, and nothing checked the difference until the validator corpus existed. IPv4 literals failed the lexer: Number is [0-9]+ with no dots, so `127.0.0.1` matched `127` and left an unlexable `.0.0.1`, because Ident must start with a letter. Adds an IPLiteral token ahead of Number and a matching PSLiteral alternative. Requiring all four octets keeps it from swallowing decimals like `2.5`, which stay unsupported as before. Added to PSLiteral only, not PSAtom — an IP inside arithmetic is meaningless. Replay now runs 16/17. The remaining entry is Get-WmiObject, correctly denied with a redirect to Get-CimInstance. Also corrects the corpus annotations, which had gone stale and were actively misleading: the "manifest miss" group was fixed by case-insensitive cmdlet lookup and now passes both layers, and the "Already works" heading now says which layer it means.
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.
Why
Replaying
parser/testdata/corpus/session-3dx.yamlend to end — parse and validate,not parse alone — left 4 of 17 commands from the recorded 3DEXPERIENCE session blocked.
Two were real defects, and both had been invisible because the only harness was
parser-level.
What changed
get-psdrivedeclaredflags: [].Get-PSDrive -PSProvider FileSystemparsed fineand was then rejected by the validator. The corpus filed this command under "Already
works" — true of the parser, false of the validator. Added
-PSProvider,-Name, and-Scope.IPv4 literals failed the lexer.
Numberis[0-9]+with no dots, so127.0.0.1matched
127and left an unlexable.0.0.1, becauseIdentmust start with a letter.Adds an
IPLiteraltoken ahead ofNumberplus a matchingPSLiteralalternative.Two deliberate limits on that token:
2.5— decimals stayunsupported exactly as before.
PSLiteralonly, notPSAtom. An IP inside an arithmetic expression ismeaningless; an IP as a flag value is the real case.
Corpus annotations corrected. They had gone stale and were actively misleading — the
"manifest miss" group was fixed by case-insensitive cmdlet lookup and now passes both
layers, but the heading still said otherwise. That staleness caused a reader to twice
report those commands as outstanding work when they already passed.
Result
Session replay: 16/17 clean, up from 13. The one remaining entry is
Get-WmiObject,correctly denied with a redirect to
Get-CimInstance— the guard rail working, not a gap.Testing
TestIPv4LiteralsParse,TestIPLiteralDoesNotShadowExistingTokens(guards the lexerordering against size literals, Windows paths, and
/1GBarithmetic),TestGetPSDriveProviderFlag,TestIPLiteralReachesValidator.Full suite passes including
-raceand the parser fuzz seeds;go vetclean.Untested gap
Not exercised against a real Windows or DSLS host — none available. Everything here is
verified against the recorded transcript and unit tests only.
🤖 Generated with Claude Code