Skip to content

fix: sanitize taxonomy JSON output#324

Open
OpadijoIdris wants to merge 1 commit into
Toolbox-Lab:mainfrom
OpadijoIdris:fix/taxonomy-json-sanitization
Open

fix: sanitize taxonomy JSON output#324
OpadijoIdris wants to merge 1 commit into
Toolbox-Lab:mainfrom
OpadijoIdris:fix/taxonomy-json-sanitization

Conversation

@OpadijoIdris

Copy link
Copy Markdown

Title:
fix: sanitize taxonomy JSON output

Body:

Summary
This PR hardens the taxonomy export pipeline by sanitizing text values and preserving large integer error codes without lossy JavaScript number coercion.

What changed
Added a TOML parsing and normalization step for the taxonomy export script
Trimmed and normalized whitespace in text fields to avoid layout-breaking newline/carriage-return issues
Validated numeric error codes so unsafe integers are preserved as strings instead of silently rounded in JavaScript
Wrote the final artifact using deterministic JSON serialization to disk
Why
The previous pipeline allowed raw TOML-derived strings and large numeric identifiers to pass through without safeguards, which could lead to:

silent precision loss for large error codes
unwanted whitespace/CRLF artifacts in UI-facing descriptions
Verification
Ran node --test index.test.js && node index.js
Result: 2 tests passed, 0 failed
Closes #309

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.

Task 13: Large Rust Integers Lose Precision When Converted to JavaScript Numbers

1 participant