Skip to content

Skip empty product resources from trailing newlines#29

Open
GHX5T-SOL wants to merge 1 commit into
zerocracy:masterfrom
GHX5T-SOL:fix/products-trailing-newline
Open

Skip empty product resources from trailing newlines#29
GHX5T-SOL wants to merge 1 commit into
zerocracy:masterfrom
GHX5T-SOL:fix/products-trailing-newline

Conversation

@GHX5T-SOL

Copy link
Copy Markdown

Summary

  • filter empty product names after splitting the /products response
  • prevent trailing newlines from producing an invalid products:// resource
  • add a regression test for a product1\nproduct2\n response body

Fixes #27.

Validation

  • npm ci --ignore-scripts --no-audit --no-fund --progress=false
  • npx jest --config jest.config.ts --no-color --ci test/resources.test.ts --coverage=false
  • npx eslint . --config eslint.config.mjs
  • npx tsc --target es2020 --module nodenext --outDir dist index.ts src/baza.ts src/prompts.ts src/resources.ts src/server.ts src/to_gpt.ts src/tools.ts
  • git diff --check HEAD~1 HEAD
  • git show --format= --patch HEAD | gitleaks stdin --no-banner --redact

Notes

  • Full npx jest --config jest.config.ts --no-color --ci currently fails in the existing live baza and server tests because the fixture token receives HTTP error responses from the Zerocracy API; the focused resource regression passes.
  • make it was attempted, but the command hung in npm exec @modelcontextprotocol/inspector before producing temp/tools.json.
  • AI-assisted contribution disclosure: I used OpenAI Codex to inspect the issue, make this focused code/test change, and run the checks above. I reviewed the resulting diff before submission.

@0crat

0crat commented May 16, 2026

Copy link
Copy Markdown

@GHX5T-SOL Hey! Just a heads up - the branch name fix/products-trailing-newline doesn't follow our naming convention, so I had to deduct -6 points as per policy. For next time, try using just the ticket number like 28 - it keeps things clean and consistent! Your current score is -12, and you can always check your full Zerocracy account for updates.

@GHX5T-SOL

Copy link
Copy Markdown
Author

Thanks for flagging this. I missed the branch-name convention on this PR; I will use the ticket number as the branch name for future Zerocracy contributions.

@kreinba kreinba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter removes empty entries split from a trailing newline, the regression test exercises product1\nproduct2\n, jest and eslint pass locally on this branch. Resolves the symptom in #27 without touching unrelated code. 0 inline comments.

@yegor256

Copy link
Copy Markdown
Member

Please fix the merge conflicts so this pull request can be merged.

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.

Trailing newline in '/products' endpoint response causing invalid 'products://' URI creation

4 participants