Repository navigation
For Contributors
I prefer changes that start from observable behavior and then trace inward to the implementation. z-fasta shares contracts across commands, so a small parser change can reach farther than one source file.
Install Zig 0.16.0 from the official Zig download page and confirm the compiler before building:
zig version
zig build
zig build test --summary all
zig build test -Doptimize=ReleaseFast --summary all
zig build -Doptimize=ReleaseFastThe version command must print 0.16.0. A compiler installed on your PATH is fine when it is that exact version. The repository does not provide a public Zig wrapper or compiler download.
Tests select the executable compiled for their build mode and run with copied fixtures and generated indexes in the build cache. They do not install into zig-out or write sidecars beside source fixtures. Run zig build -Doptimize=ReleaseFast before installed smoke checks, the shell consumer, or local verification scripts.
For a focused edit, select the owning suite and optionally filter test names:
zig build test-index
zig build test-get
zig build test-stats
zig build test-validate
zig build test-cli -Dtest-filter=dispatchThe filter applies to Zig tests. Separate native callers still run when selected through test-diagnostics or test. Finish code topics with both full test modes.
-
src/main.zig: CLI parsing, help, dispatch, diagnostics and checked final status. -
src/root.zig: the Zig package:IndexedReader,RecordReader, andvalidation; Zig package describes it. -
src/diagnostics.zig: native codes, observed facts and caller-owned failure storage. -
src/reporting.zig: text and JSON encoding without allocation or flushing. -
src/indexer.zig: record scanning and index output. -
src/index_format.zig:.zfior.failoading, validation, lookup, and ownership. -
src/getter.zig: requests, coordinates, transforms, and bounded output. -
src/stats.zig: length and composition reports. -
src/validator.zig: the streaming validation scan, its report, and the repair written in the same pass. -
src/bed_parser.zig: BED row conversion and strand parsing. -
src/fasta.zig: bases, identifier ends, alphabet detection, the IUPAC complement, the record scanner, and the record reader. -
src/platform.zig: portable read-only mapping and advice.
The Wiki owns public behavior and workflow documentation. Source files and their tests own implementation details that are not part of the public contract.
zig build test-diagnostics
zig build test-reporting
bash tests/consumer_json.shThe separate caller in tests/consumer_commands.zig handles failures from the actual command functions and then calls them again successfully. It uses existing exports without running the CLI dispatcher. Preserve finite error unions, allocator cleanup, original causes and the primary failure when cleanup or reporting also fails. Reset Failure once at the owning operation entry; nested helpers retain facts before returning and must not reset them.
Borrowed source labels live through handling or reset. Retained preview views belong to their Failure. A validator Report copies the identifiers it keeps. Failure capture allocates no new message; preview exhaustion marks truncation and must not hide the original failure. See Error diagnostics for units, encoding and output states.
bash bench/index/run.sh --skip-benchmarks --skip-messy --skip-report
bash bench/get/run.sh --skip-benchmarks --skip-messy --skip-report
bash bench/stats/run.sh --skip-benchmarks --skip-messy --skip-report
bash bench/validate/run.sh --skip-benchmarks --skip-reportRun every affected gate after code changes. Synthetic unit fixtures do not replace real-data and peer verification.
- A present
.zfiis authoritative. - Positional GET stays byte-compatible with samtools on the verified path.
-
.faiemission fails instead of describing non-uniform layout incorrectly. -
.zfiwire bytes remain versioned and backward-aware. - Duplicate lookup is first exact match.
- Positional and BED coordinate systems remain distinct and explicit.
- Shared type detection changes are checked in stats, GET, and validate.
- GET and index hot paths stay bounded by fixed sequence payload buffers.
- Validate fix preserves every header byte and every symbol, and never overwrites input.
When CLI behavior changes, update:
- the relevant command page;
- Command cheat sheet;
- affected Recipes;
- Troubleshooting when diagnostics or recovery change;
- FAQ when the user decision changes;
- Limits and supported formats when a boundary moves;
-
_Sidebar.mdwhen pages or command names change; - the repository
README.mdfor landing-page claims.
When format behavior changes, also update Index formats and the internal .zfi wire contract.
The authored Wiki pages live in wiki/ in the main repository. Edit and review that directory first. Pull requests validate the tracked source. Pushes to main validate and publish it to the GitHub Wiki automatically. A manual workflow dispatch can also publish the selected main branch after validation. Do not leave a correction only in the live Wiki.
Important
Examples are product claims. Verify command, status, stdout, stderr, and filesystem effects before publishing them.
- Use short direct sentences and active voice.
- Keep prose unwrapped in Markdown source.
- Use fenced code blocks with language tags.
- Use tables only when comparison or repeated numeric structure earns one.
- Use no more than one or two GitHub alerts per page.
- Use alerts for user decisions, not decoration.
- Use
<details>for secondary output or advanced explanations. - Avoid emojis, decorative Unicode, and em-dashes.
- Link to one owner instead of duplicating deep format or implementation detail.
Before publishing Wiki changes:
- Check every sidebar page exists.
- Check every internal page link uses the published filename.
- Preview alerts and collapsed sections on GitHub.
- Run representative commands for changed examples.
- Confirm the documented version.
- Search for removed flags and stale limits.
State what succeeded, what failed or was redone, what was skipped, and whether the work is complete. Include the exact gates run.
z-fasta v0.4.0 | Home | Quick start | Cheat sheet | Troubleshooting | Releases | MIT License
z-fasta Wiki
Start
Use z-fasta
Understand behavior
- Index formats
- Coordinates and names
- Limits and supported formats
- Performance and correctness
- Tool comparison
Solve a problem
Contribute