fix(cli): parse job files with a UTF-8 BOM - #115
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The fix is covered by targeted regression tests and no unresolved issues remain.
Pull request overview
Fixes CLI job-file parsing when files begin with a UTF-8 BOM.
Changes:
- Strip the BOM before parsing.
- Add Markdown and CLI regression coverage.
File summaries
| File | Description |
|---|---|
test/jobfile.test.ts |
Adds parser and CLI regression tests. |
src/cli/jobfile.ts |
Removes leading BOMs before parsing. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
A UTF-8 byte-order marker at the start of a job file prevents the parser from recognizing its front matter.
agenticjobs post job.mdthen asks for an employer even whenorg:is present. The same marker also hides the first title heading in a plain Markdown job.Remove the leading encoding marker before normalizing line endings and parsing. The regressions cover plain Markdown and actual CLI
post/editrequests from both ordinary files and BOM-prefixed CRLF files, preserving the employer, title, quoted requirements and description.Validation: the new plain-title case and expanded CLI case both fail against the unmodified source. The fixed TypeScript build and 357 local tests pass on Node 24.18.0. Upstream CI also passes typechecking, all 448 tests with PostgreSQL 17, and the Docker build/startup checks. The database integration cases were exercised in CI; no test database was configured locally.
Implemented and tested with AI assistance.