Repository navigation
fix: resolve reports/ from the scripts, not the cwd - #38
Merged
Merged
Conversation
|
🔱 Poseidon started reviewing this PR — central run. |
There was a problem hiding this comment.
🔱 Poseidon Review
Summary — Resolves reports/ from each script's own location instead of the cwd, drops the dead default-JSON arguments and the redundant mkdir blocks, and adds a foreign-cwd regression test; low risk, no issues found on this pass.
Walkthrough
- ♻️ Refactor —
merge-qa-reports.shandgenerate-report.jsnow resolve inputs/outputs from$SCRIPT_DIR(orKOSH_REPORTS_DIR), and merge reads the HTML path back from the generator'sHTML report generated:line rather than rebuilding it with a copy of the slug rule. - 🐛 Fix —
merge-qa-reports.shno longer renders and then exits 1 under a foreign cwd; a singletrap 'rm -f "$MERGED_JSON"' EXITreplaces the three scatteredrmlines and covers theset -eleak. - 🧪 Tests — new
tests/reports-dir.test.jsruns both shell scripts from a sibling cwd and asserts the HTML/archive land under the reports dir and nothing leaks into the cwd. - 📝 Docs —
CLAUDE.mdanddocs/getting-started.mddocument the "scripts resolve from their own dir, skills stay cwd-relative,KOSH_REPORTS_DIRredirects scripts only" rule.
ℹ️ Review info
- Commit: a150411
- Files reviewed: CLAUDE.md, docs/getting-started.md, scripts/generate-report.js, scripts/merge-qa-reports.sh, scripts/run-qa-report.sh, tests/reports-dir.test.js
- Files skipped: none
- Model: claude-opus-4-8
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.
what
scripts/run-qa-report.shmkdir -p ./reports— the generator creates its ownreportsDir, so this only ever left a stray folder in a foreign cwdreports/data/qa-report.jsonwas dead (no skill writes that name)scripts/merge-qa-reports.shKOSH_REPORTS_DIR, elsereports/next to the script's real directory (pwd -P, so symlinks agree with the generator's__dirname)HTML report generated:line instead of rebuilding it from./reports+ a copy of the slug ruletrap 'rm -f "$MERGED_JSON"' EXITreplaces threermlines and covers theset -eexit that leaked the temp file when the generator failedscripts/generate-report.js— the input argument is required; its default was the same deadqa-report.jsontests/reports-dir.test.js— runs both scripts from a foreign cwdCLAUDE.mdstates the rule and thatKOSH_REPORTS_DIRredirects scripts only, not where skills write;docs/getting-started.mdsays why to stay in thekoshfolderwhy
the generator, the stamp script and the hook already agreed that
reports/lives next toscripts/. the two shell scripts had their own./reports, which only matched because the documented launch iscd kosh && claude --plugin-dir .. underKOSH_REPORTS_DIRor any other cwd,merge-qa-reports.shrendered the report and then exited 1:because it was looking at its own rebuilt path.
run-qa-report.shwas subtler — it worked, but left an emptyreports/wherever you ran it from. the upcoming refactor's portability conventions need one answer to "where isreports/?": scripts resolve from their own location, skills stay cwd-relative, the cwd must be the plugin root.co-authored by claude fable 5.1 🧭