Skip to content

fix(band): name the project by its folder and read the model without grep on Windows - #1179

Open
markdconnelly wants to merge 1 commit into
DietrichGebert:mainfrom
markdconnelly:fix/band-windows-paths
Open

markdconnelly wants to merge 1 commit into
DietrichGebert:mainfrom
markdconnelly:fix/band-windows-paths

Conversation

@markdconnelly

Copy link
Copy Markdown

Two Windows defects in what the band records to the ledger and the board.

1. The project name was the whole path. base() split only on /, but on Windows $.session.repo().root and $.session.cwd() come back as C:\Development\GitHub\shop. So the ledger's project column held the full path, and every ledger file was named like C__Development_GitHub_shop.csv. base() now splits on both separators and still trims a trailing one.

2. The model column was always empty. readModel only shelled out to grep -o, which Windows doesn't have, so every row's model stayed ''. It now falls back to $.fs.read the same way readTitle does: it reads transcripts under 4 MiB, and the findstr note on readTitle applies here too.

Existing ledgers: this change doesn't migrate anything. Rows already written on Windows keep their full-path project and stay in their C__…csv files, so the board keeps showing them under that name. New tasks go to <folder>.csv. Anyone who wants them merged can delete or rename the old CSVs by hand.

Test: a new test in tests/band.test.tsx uses a backslash repo root with a trailing separator, a process.run that refuses (no grep, no git), and a transcript read through fs.read. It asserts the ledger is …/band/shop.csv with project: shop and the majority model. It fails when either fix is reverted on its own.

Note: on a Windows machine, claude plugin test already fails 3 band tests before this change (after /ponytail band…, after /clear…, after /resume…). They compare mocked POSIX paths exactly, and the test kit hands paths on with backslashes. That's untouched here, and CI on Linux is unaffected.

🤖 Generated with Claude Code

…grep on Windows

On Windows the repo root and cwd come with backslashes, so base() kept the
whole path: the ledger's project column was C:\...\shop and every CSV was
named C__..._shop.csv. Split on both separators.

readModel shelled out to grep -o only, which Windows lacks, so every row's
model stayed empty. Fall back to $.fs.read like readTitle does (transcripts
under 4 MiB).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant