PR 6: corpus completeness + AstAssert.Equal + PII audit#9
Merged
Conversation
Brings the corpus to **115 entries** (target was ≥105 per SPEC §13),
introduces a polished AstAssert.Equal helper with diff-friendly failure
messages, and adds the PII audit Fact required for v0.1.0-alpha
release acceptance.
What's added:
- tests/.../Corpus/AstAssert.cs:
* Equal(expected, actual, fileName) — structural deep-equality with
path-prefixed XunitException messages, e.g.
"clauses[1].args[2].kind: expected DynamicSkip, actual Literal"
* Dump() diagnostic for shape inspection
* CorpusRunnerTests refactored to delegate (~140 lines of inline
comparison removed)
- tests/.../Corpus/PiiAuditTests.cs:
* Single [Fact] walks every Corpus/bash/*.json
* Applies SPEC §14 regex patterns to input/notes/raw fields only
(skips synthetic resolved paths and sentinels)
* Allowlists generic placeholders (user, test, foo, dev, runner,
gh-actions, ci) and repo names (sample-repo, project, repo)
* Reports all hits in a single failure with file paths
Corpus additions:
- bash/101..110_*.json (10 quote-handling): single-quoted literal,
double-quoted with $HOME, escaped quotes, mixed-style triple, FileVerb
with quoted path, etc.
- bash/111..115_*.json (5 unparseable): process substitution <(cmd) and
>(cmd), case keyword, while loop, function name { ... } form
Total: 115 entries spanning all SPEC §13 categories.
SPEC.md updates:
- §13 corpus location: tests/Corpus/bash/* → tests/ShellSyntaxTree.Tests/Corpus/bash/*
(the canonical path locked by interpretation #7)
- Stale references in §14, §15, §17 acceptance criteria fixed for
consistency
Tests: 353/353 passing (was 337). Public API surface unchanged;
PublicApiSnapshotTests still 18/18 green.
PR 6 follow-ups tracked in tasks.md:
- Single-quote $HOME substitution (corpus 104 pins v0.1 behavior;
bash semantics differ — v0.1.x candidate)
- LooksLikePath trailing-backslash quirk (corpus 109 pins;
v0.1.x heuristic tightening candidate)
- Sentinel <dynamic-cwd> Raw value formalization in SPEC §9
- Diagnostic precedence ordering in SPEC §11 (case-with-paren-arg case)
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
PR 6 of the v0.1.0-alpha shipping plan. Brings the corpus to 115 entries (target was ≥105 per SPEC §13), polishes the
AstAssert.Equalhelper with diff-friendly failure messages, and adds the PII audit[Fact]required for v0.1.0-alpha release acceptance.What landed
tests/.../Corpus/AstAssert.cs— polished structural-equality helper. Path-prefixed messages likeclauses[1].args[2].kind: expected DynamicSkip, actual Literalmake CI failures actionable. CorpusRunnerTests refactored to delegate (~140 lines of inline comparison removed).tests/.../Corpus/PiiAuditTests.cs—[Fact]scans everyCorpus/bash/*.jsonfor SPEC §14 forbidden patterns. Allowlists generic placeholders (user, test, foo, dev, runner, gh-actions, ci) and repo names (sample-repo, project, repo). Reports all hits in one failure for easy cleanup.\$HOME, escaped quotes, mixed-style triple, FileVerb with quoted path<(cmd)and>(cmd),casekeyword,whileloop,function name { ... }formtests/ShellSyntaxTree.Tests/Corpus/bash/*.json; stale references in §14/§15/§17 fixed for consistency.SPEC §13 coverage (115 / 105 minimum)
bash -cVerification
dotnet build -c Release— clean (0 warnings)dotnet test -c Release— 353/353 passing (was 337)pwsh ./scripts/Add-FileHeaders.ps1 -Verifyopenspec validate v0.1-locked-interpretations --strictTest plan
Test-ubuntu-latestTest-windows-latestv0.1.x follow-ups (tracked in tasks.md)
'literal \$HOME': v0.1 substitutes uniformly; bash semantics differRaw=\"<dynamic-cwd>\"formalization in SPEC §9Next
PR 7 — package icon + RELEASE_NOTES.md + version bump. Auto-merge but pause before tag push per the plan; the
v0.1.0-alpha→ nuget.org publish is irreversible.