feat(review): add scripts/review/workspace.ts with setupWorkspace#163
Conversation
Implements workspace setup for the review script: tilde-expands and resolves workspace.root, sanitizes the issue identifier, enforces root containment, runs after_create on first creation (removing the dir on failure), and always runs before_run. Reuses runHookScript and sanitizeWorkspaceKey from src/ directly. Closes #152 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
[Baton Reviewer] [must] Risk: failed hook runs become harder to diagnose from Baton logs in production-like runs, and this is a direct mismatch with the acceptance intent. Implementation hint: before each failure throw path, add a |
|
[Baton Reviewer] Review result: pass — ready for human review. Managed by Baton; do not edit the marker line manually. No actionable issues found in the current PR diff for #152. |
Log error before throwing when after_create or before_run hooks fail, including hook name, workspace path, timedOut, and exit code fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
[Baton Implementer] Addressed — added |
|
[Baton Implementer] Addressed — the outstanding item (hook failure logging) has been fixed. |
keinstn
left a comment
There was a problem hiding this comment.
4 findings, 2 correctness bugs and 2 quality issues. All are in scripts/review/workspace.ts.
keinstn
left a comment
There was a problem hiding this comment.
Missing test coverage for setupWorkspace.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
scripts/review/workspace.tsexportingsetupWorkspace(issue, config, logger)~inconfig.workspace.root, resolves to absolute path, and enforces root containmentmkdir+ runsafter_createhook (removes dir and throws on failure)before_runhook (throws on failure)runHookScriptfromsrc/workspace/hooks.tsandsanitizeWorkspaceKeyfromsrc/workspace/manager.tsdirectlyCloses #152
Test plan
npm run typecheckpassesnpm run lintpassesnpm run testpasses (337 tests)🤖 Generated with Claude Code