Repository navigation
fix(cli): resolve golden bench fixtures relative to package, not cwd - #1
Open
mosesman831 wants to merge 1 commit into
Open
mosesman831 wants to merge 1 commit into
mosesman831 wants to merge 1 commit into
Conversation
lexloop bench golden resolved the default fixtures/golden dir against process.cwd(), so running it from anywhere but the repo root silently found zero fixtures and reported an all-zero result. Resolve the corpus relative to the module location instead (walk up from import.meta.url until fixtures/golden exists; works from the bundled dist/cli.js and from the source tree alike) and fail loudly with LL4005 when a fixture dir yields zero files. Explicit --dir still resolves against cwd. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
lexloop bench goldensilently reported an all-zero result when run from any cwd other than the repo root: the default fixture dirfixtures/goldenwas resolved againstprocess.cwd(),listJsonFilesswallowsENOENT, and the run then produced a misleading{"loops": 0, ...}bench instead of an error.bench/golden.tsnow resolves the default corpus relative to the module location viadefaultGoldenDir(): it walks upward fromimport.meta.urluntil afixtures/goldendirectory exists. This covers both layouts —bench/when run from source andpackages/cli/dist/in the bundleddist/cli.js— so the bench works from any cwd. An explicit--dirstill resolves against cwd.runGoldenBenchnow throwsLL4005when a fixture dir yields zero.jsonfiles (loops/+productive/combined), instead of reporting zeros; the CLI surfaces it viaexitWith(2, ...)(gate failure stays exit 3).Verification (E2E, clean install)
pnpm install+pnpm --filter @latticeag/lexloop-cli build, thennode packages/cli/dist/cli.js:bench golden/tmp/elsewhere(outside repo)loops:16, loops_detected:16, loops_false_productive:0, productive:16, exit 0bench goldenbench golden --dir fixtures/golden--dirunchanged)bench golden --dir /nonexistent/tmp/elsewhereLL4005 no golden fixtures found under /nonexistent ..., exit 2 — fails loudly instead of printing zerosinit+doctor/tmp/elsewherewatch --from-jsonl events.jsonl/tmp/elsewherereplayed 5 steps (observe-only), exit 0pnpm test: 171/171 across 20 files.pnpm typecheck: clean.Link to Devin session: https://app.devin.ai/sessions/98f9894639bd4e3b903f7517b118edc8
Open in Devin Desktop: https://app.devin.ai/desktop/session/98f9894639bd4e3b903f7517b118edc8?variant=devin
Requested by: @mosesman831