Commit 5aa12cf
feat(e2e): fail the gate if an example tracks a regenerable artifact (#134)
* feat(e2e): fail the gate if an example tracks a regenerable artifact
The examples-e2e harness runs each example in an isolated temp copy, so a
post-run git status on the repo tree never catches accidentally-committed
regenerable artifacts. Add a STATIC per-example guard, alongside
validateManifest / assertCommittedPin in loadExample, that inspects what git
TRACKS for the example (git ls-files -z, cwd: ROOT) and FAILS the example if
any tracked path is a regenerable artifact: .ponder/ or generated/ at any
depth, ponder-env.d.ts, or package-lock.json — exactly the paths the root
.gitignore already ignores. These must never be committed.
The guard requires no live run, RPC, or secrets, is dep-free, throws
HarnessFailure like the other static checks (so it participates in the same
PASS/FAIL table), and names the offending path(s) with a git rm --cached
remediation hint.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(e2e): anchor regenerable-artifact match to the example's direct children
isRegenerableArtifact matched `.ponder`/`generated` path segments at any depth,
which is broader than the .gitignore set it mirrors (examples/*/.ponder/,
examples/*/generated/, examples/*/ponder-env.d.ts, examples/*/package-lock.json
— all direct children). That would falsely fail a legitimately committed
nested `src/generated/` (e.g. graphql-codegen output).
Anchor the match: for a tracked path examples/<ex>/<rel>, FAIL iff the first
segment of <rel> is `.ponder` or `generated`, or <rel> is exactly
`ponder-env.d.ts` or `package-lock.json` — nothing deeper. The FAIL message,
`git rm --cached` hint, -z NUL parse, and HarnessFailure are unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent ac824c6 commit 5aa12cf
1 file changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
245 | 291 | | |
246 | 292 | | |
247 | 293 | | |
| |||
0 commit comments