Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 33 additions & 26 deletions IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,32 +135,39 @@ bulldoze priorities.
- [x] Recursion depth cap at 5 → outer
`ParsedCommand.IsUnparseable=true` (interp #4)

### 10. Hand-authored corpus (SPEC §13 — minimum 105 entries)

- [ ] 10 simple-verb cases
- [ ] 10 multi-token-verb cases
- [ ] 15 compound cases
- [ ] 10 cd-in-compound cases
- [ ] 10 quote-handling cases
- [ ] 10 redirect cases
- [ ] 10 subshell cases
- [ ] 10 `bash -c` cases
- [ ] 10 dynamic-skip cases
- [ ] 10 per-verb path-rule cases
- [ ] 10 unparseable cases

### 11. Corpus runner test

- [ ] Single `[Theory] [MemberData]` enumerating
`tests/.../Corpus/bash/*.json`
- [ ] Per-entry test name so failures point at the specific case
- [ ] Structural equality helper `AstAssert.Equal`

### 12. PII audit (SPEC §14)

- [ ] Single `[Fact]` that scans `tests/.../Corpus/bash/*.json` for
SPEC §14 forbidden patterns
- [ ] Wired into `pr_validation.yml` via `dotnet test` (no separate job)
### 10. Hand-authored corpus (SPEC §13 — minimum 105 entries) — PR 6, complete

- [x] 10 simple-verb cases (01-10) — PR 3
- [x] 10 multi-token-verb cases (11-20) — PR 3
- [x] 15 compound cases (21-35) — PR 3
- [x] 10 cd-in-compound cases (71-80) — PR 5
- [x] 10 quote-handling cases (101-110) — PR 6
- [x] 10 redirect cases (36-45) — PR 3
- [x] 10 subshell cases (81-90) — PR 5
- [x] 10 `bash -c` cases (91-100) — PR 5
- [x] 10 dynamic-skip cases (51-60) — PR 4
- [x] 10 per-verb path-rule cases (61-70) — PR 4
- [x] 10 unparseable cases (46-50, 111-115) — PRs 3 + 6
- [x] **115 total corpus entries** (target was ≥105)

### 11. Corpus runner test — PR 6, complete

- [x] Single `[Theory] [MemberData]` enumerating
`tests/ShellSyntaxTree.Tests/Corpus/bash/*.json` (skeleton in PR 3)
- [x] Per-entry test name (file name) so failures point at the specific
case
- [x] Polished structural-equality helper `AstAssert.Equal` with
diff-friendly messages (e.g.
`clauses[1].args[2].kind: expected DynamicSkip, actual Literal`)

### 12. PII audit (SPEC §14) — PR 6, complete

- [x] Single `[Fact]` that scans
`tests/ShellSyntaxTree.Tests/Corpus/bash/*.json` for SPEC §14
forbidden patterns; allowlists generic placeholders; reports all
hits in one failure
- [x] Wired into `pr_validation.yml` via standard `dotnet test`
(no separate job)

### 13. Release v0.1.0-alpha

Expand Down
15 changes: 8 additions & 7 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,9 @@ The corpus is the **acceptance contract** for the parser. Implementation is

### Location

`tests/Corpus/bash/*.json` — one file per corpus entry. File name pattern:
`NN_descriptive_slug.json` where NN is a zero-padded sequence number.
`tests/ShellSyntaxTree.Tests/Corpus/bash/*.json` — one file per corpus
entry. File name pattern: `NN_descriptive_slug.json` where NN is a
zero-padded sequence number.

### Format

Expand Down Expand Up @@ -1050,7 +1051,7 @@ real-world commands (see §14).

### Test runner

A single xunit test method enumerates `tests/Corpus/bash/*.json`, parses
A single xunit test method enumerates `tests/ShellSyntaxTree.Tests/Corpus/bash/*.json`, parses
each `input`, and asserts the result matches `expected` field-by-field.
The runner emits a per-corpus-entry test name so failures point at the
specific case.
Expand Down Expand Up @@ -1126,7 +1127,7 @@ Apply these transformations to every seeded entry **before** committing:
Before any corpus PR merges, CI runs a regex check against the corpus
files for residual PII patterns. The check fails the build if any
sanitization-rule pattern appears in any committed corpus file. Implement
as a small `dotnet test` that scans `tests/Corpus/bash/*.json` for the
as a small `dotnet test` that scans `tests/ShellSyntaxTree.Tests/Corpus/bash/*.json` for the
forbidden patterns.

---
Expand All @@ -1142,7 +1143,7 @@ Adapt for ShellSyntaxTree:

- **Trigger NuGet publish on tag pattern `v*.*.*`** (e.g. `v0.1.0-alpha`).
- **Test job** runs the corpus runner plus all unit tests.
- **PII audit job** runs the sanitization-pattern scan over `tests/Corpus/`.
- **PII audit job** runs the sanitization-pattern scan over `tests/ShellSyntaxTree.Tests/Corpus/`.

### Versioning

Expand Down Expand Up @@ -1212,10 +1213,10 @@ v0.1.0-alpha ships when **all** of the following hold:

1. ✅ Public API matches §2 exactly. `dotnet pack` produces a
ShellSyntaxTree.0.1.0-alpha.nupkg.
2. ✅ Every corpus entry in `tests/Corpus/bash/*.json` parses to its
2. ✅ Every corpus entry in `tests/ShellSyntaxTree.Tests/Corpus/bash/*.json` parses to its
expected AST. `dotnet test` runs them all and passes.
3. ✅ Corpus has at least 105 entries spanning the categories in §13.
4. ✅ PII audit scan over `tests/Corpus/bash/*.json` finds zero hits.
4. ✅ PII audit scan over `tests/ShellSyntaxTree.Tests/Corpus/bash/*.json` finds zero hits.
5. ✅ `dotnet test` runs on PR via GitHub Actions and passes.
6. ✅ Tagging `v0.1.0-alpha` triggers `publish_nuget.yml` and the package
appears on nuget.org.
Expand Down
46 changes: 36 additions & 10 deletions openspec/changes/v0.1-locked-interpretations/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,42 @@ the SPEC.md sections that get updated alongside the implementation.

## 6. PR 6 — Corpus completeness + PII audit (interpretation #7)

- [ ] 6.1 Audit corpus categories from SPEC §13; fill to ≥105 entries
- [ ] 6.2 `tests/.../Corpus/AstAssert.cs` — structural equality with
diffable failures
- [ ] 6.3 `tests/.../Corpus/PiiAuditTests.cs` — `[Fact]` regex scan over
corpus JSON for SPEC §14 forbidden patterns
- [ ] 6.4 Verify pr_validation runs both via `dotnet test`
- [ ] 6.5 Confirm green on Linux + Windows (path separators)
- [ ] 6.6 Update `SPEC.md` §13 (replace abbreviated path with canonical
`tests/ShellSyntaxTree.Tests/Corpus/bash/*.json`)
- [ ] 6.7 Open OpenSpec change `corpus-location` for the §13 delta
- [x] 6.1 Audited corpus categories from SPEC §13; filled to **115
entries** (target was ≥105). Added 10 quote-handling (101-110)
and 5 more unparseable (111-115).
- [x] 6.2 `tests/.../Corpus/AstAssert.cs` — polished structural-equality
helper with path-prefixed messages (e.g.
`clauses[1].args[2].kind: expected DynamicSkip, actual Literal`).
CorpusRunnerTests refactored to delegate.
- [x] 6.3 `tests/.../Corpus/PiiAuditTests.cs` — `[Fact]` walks every
`bash/*.json`, applies SPEC §14 regex patterns; allowlists
generic placeholders; reports all hits in one failure.
- [x] 6.4 PR validation runs corpus runner + PII audit via standard
`dotnet test` (no separate job).
- [x] 6.5 Cross-platform: BashResolver (PR 4 fix) keeps forward-slash
paths regardless of host OS; corpus uses pinned
WorkingDirectory=/work, HomeDirectory=/home/test for stability.
- [x] 6.6 SPEC §13 updated to canonical
`tests/ShellSyntaxTree.Tests/Corpus/bash/*.json`; also fixed
stale refs in §14, §15, §17 acceptance criteria.
- [x] 6.7 Light Path-C adoption: §13 delta lives in this bootstrap
change; no separate `corpus-location` change needed.
- [x] 6.8 **353/353 tests passing**; clean build; PublicApiSnapshotTests
still 18/18 green; public API surface unchanged.

### PR 6 follow-ups (tracked for v0.1.x or post-v0.1.0-alpha)

- Single-quote `'literal $HOME'` resolver behavior: v0.1 substitutes
uniformly (corpus 104 pins). Bash semantics: doesn't substitute
inside single quotes. v0.1.x may carry quote-style through tokens.
- LooksLikePath heuristic: trailing backslash in quoted literal
triggers IsPath=true (corpus 109 pins). v0.1.x may tighten heuristic.
- Sentinel `Raw="<dynamic-cwd>"` for dynamic-cd attribution: pinned
by corpus 52 but SPEC §9 dynamic-cd subsection doesn't formalize
the value. v0.1.x can pin in spec text.
- `case x in a) ;; esac` form: hits "unbalanced parens" diagnostic
before keyword check. Acceptable v0.1 behavior; v0.1.x may pin
diagnostic precedence in SPEC §11.

## 7. Verify

Expand Down
Loading
Loading