Contributing
Report a bug
Section titled “Report a bug”The most useful bug report is one line: the input string, and the output you expected. That's usually enough to turn it into a fixture. If it came from a specific place (a YouTube title, a Beatport export, a file name), say so, because that decides which mode it belongs to.
Open an issue on GitHub. You can paste a playground link: the URL contains the input. It doesn't matter which language you use. The five packages share the rules, so a wrong result in one is a wrong result in all of them. If JavaScript, Python, Rust, Go and C ever disagree with each other, that is a bug of its own, and worth reporting with the two outputs.
Change a rule
Section titled “Change a rule”Behaviour starts in the spec, not in the code:
- Add or amend a rule in
spec/SPEC.md. Rule IDs are never renumbered or reused. - Add handwritten fixtures that cite the rule (format): the positive case, the near-miss that must not trigger, and one exact case if the rule touches many fields.
- If the rule is combinatorial (a new joiner, a new version word), teach the generator the atom and regenerate.
- Change every port, JavaScript, Python, Rust, Go and C, and cite the rule ID in a comment.
- Check that every fixture passes in all five ports and that the cross-port diff reports zero differences.
- Update the pages of this site that describe the rule, with an example in each language.
How it works explains the pipeline, and How it's tested explains the fixtures and the generator.
Word lists live only in spec/data. They're compiled into each port, so a new keyword is a JSON
change plus codegen, not a code change.
The repository
Section titled “The repository”spec/ SPEC.md, word lists, JSON Schemas, fixtures, the fixture generatorjs/ the npm package (reference implementation)python/ the PyPI packagerust/ the crates.io packagego/ the Go modulec/ the C librarysite/ this websitescripts/ cross-port diff and other toolsWorking on the JavaScript package
Section titled “Working on the JavaScript package”From the repository root. Development needs Node 22 or newer and pnpm.
pnpm installpnpm test # fixtures, properties, API tests, generator testspnpm conformance # pass rate per fixture file and per rulepnpm lint # Biome lint and format checkpnpm --filter trackparse typecheckpnpm gen:data # regenerate js/src/data.generated.ts from spec/datapnpm gen:fixtures # regenerate spec/fixtures/generatedpnpm build # build js/distWorking on the Python package
Section titled “Working on the Python package”Python 3.9 or newer, with uv.
cd pythonuv sync # install the dev environmentuv run pytest # fixtures, properties, API testsuv run python scripts/conformance.py # pass rate per fixture file and per ruleuv run ruff check . && uv run ruff format --check .uv run mypy --strict srcuv run python scripts/gen_data.py # regenerate src/trackparse/_data.py from spec/dataWorking on the Rust crate
Section titled “Working on the Rust crate”Rust 1.74 or newer, and Node 24 for the codegen: the Unicode tables are generated from the Unicode data built into Node, so another Node version can write different tables.
cd rustcargo test # fixtures, invariants, API testsTRACKPARSE_REPORT=1 cargo test --test fixtures -- --nocapture # pass rate per file and per rulecargo fmt --checkcargo clippy --all-targets --all-features -- -D warningsnode scripts/gen_data.mjs # regenerate src/data.rs and src/unicode_tables.rsWorking on the Go module
Section titled “Working on the Go module”Go 1.22 or newer, and Node 24 for the codegen: as in Rust, the Unicode tables come from Node, not from the Go toolchain.
cd gogo test ./... # fixtures, invariants, unit testsTRACKPARSE_REPORT=1 go test -run TestFixtures -v . # pass rate per file and per rulegofmt -l . && go vet ./...node scripts/gen_data.mjs # regenerate data_gen.go from spec/datanode scripts/gen_unicode.mjs # regenerate unicode_gen.gopnpm --filter trackparse build && node scripts/dump_artist_cases.mjs # data for the artist-side testsThe artist-side tests compare with values from the JavaScript package. Their data file is too big to ship in the module, so it is not committed: the last command writes it, and without it those tests are skipped. CI writes it and requires it.
Working on the C library
Section titled “Working on the C library”A C11 compiler, CMake 3.16 or newer, and Node 24 for the codegen: as in Go, the Unicode tables come
from Node, not from the C library or the platform. The C code is a translation of the Go port, file
by file; c/src/PORTING.md has
the conventions.
cmake -S c -B c/build-test -DTRACKPARSE_WERROR=ONcmake --build c/build-testctest --test-dir c/build-test --output-on-failure # fixtures, schema check, unit testsTRACKPARSE_REPORT=1 c/build-test/trackparse-fixtures spec/fixtures/*/*.json # pass rate per file and per ruleTRACKPARSE_ONLY=brackets-version-001 c/build-test/trackparse-fixtures spec/fixtures/*/*.json # one casecmake -S c -B c/build-asan -DTRACKPARSE_SANITIZE=ON # the same suite under ASan and UBSannode c/scripts/gen_data.mjs # regenerate src/data_gen.c from spec/datanode c/scripts/gen_unicode.mjs # regenerate src/unicode_gen.cnode c/scripts/amalgamate.mjs # write trackparse.c, .h and .hpp into c/distsrc/ uses no strtod, no float printf, no <ctype.h> and no qsort: the first three follow
the process locale, and qsort is not stable.
Comparing the ports
Section titled “Comparing the ports”After a change in any port, build the JavaScript package and run the cross-port diff from the repository root. It runs every fixture through all five ports and compares the complete output.
pnpm buildnode scripts/compare-ports.mjs # must print "differences: 0"node scripts/compare-ports.mjs --only=rust # one port against JavaScript (or --only=python, --only=go, --only=c)node scripts/fuzz-ports.mjs # the same diff on random inputThis website
Section titled “This website”The site lives in site/. Every code example has a JavaScript, a Python, a Rust, a Go and a C tab, and every
output in it comes from running the code.
pnpm docs # run the site locallypnpm docs:build # build it; fails on broken pagesAGENTS.md has the full repository map, every command and the release process. Commits follow Conventional Commits, because the changelog is generated from them. The five packages and the spec are released together under one version number.
See also
Section titled “See also”- How it works for the pipeline and the rule groups.
- How it's tested for the fixtures, the generator and the cross-port diff.
- Ports for what a new language has to get right.
- Limitations and roadmap for what is planned.
License
Section titled “License”MIT © Maksim Maksimov.