Thank you for your interest in contributing. Please read the guidelines below before submitting changes.
- What can I contribute?
- Before you start
- Development setup
- Coding standards
- Commit messages
- Pull request process
- Specification changes
- Adding a codec
- Reporting bugs
- Security vulnerabilities
- License agreement
Code contributions (Apache-2.0)
- Bug fixes in the reader, writer, CLI, or crypto module
- Performance improvements
- New built-in codec integrations with a frozen UUID assigned
- Test coverage additions (unit tests, integration tests, property-based tests)
- Platform-specific build fixes (Windows, macOS, Linux, WASM)
- FFI bindings (Python, C, Go, …)
Specification contributions (CC BY 4.0)
- Clarifications and editorial improvements to
spec.md - Formal grammar or pseudo-code additions
- Translations of
spec.md(must retain CC BY 4.0 header)
Documentation and benchmarks
- Improvements to
BENCHMARK.md,README.md,CHANGELOG.md - Additional benchmark scenarios (real-world data, multi-file archives, …)
- Corrections to measured numbers (must include raw data + methodology)
- Open a GitHub issue before beginning any non-trivial change. This avoids duplicate work and lets design questions be settled before code is written.
- For specification changes, open an issue tagged
specand allow at least one week for discussion before opening a pull request. - For new codec UUIDs, a UUID must be assigned in the issue before any implementation begins. Once assigned, a UUID is permanent.
# Clone
git clone https://github.com/cyh/sixcy.git
cd sixcy
# Build (debug)
cargo build
# Build (release)
cargo build --release
# Run all tests
cargo test
# Run integration tests only
cargo test --test integration_test
# Run benchmarks
cargo bench
# Check formatting
cargo fmt --check
# Run linter
cargo clippy -- -D warningsRust stable 1.70 or later. We do not use nightly features.
- Run
cargo fmtbefore every commit. The project uses the defaultrustfmtconfiguration (norustfmt.tomloverrides). - Run
cargo clippy -- -D warnings. All warnings are treated as errors in CI. - No
unsafecode in the core library (src/) without a documented safety invariant and a comment explaining why the safe alternative is insufficient. Theplugin.rsFFI wrapper is the sole intentionalunsafeboundary.
- Use
thiserrorfor library error types. Nounwrap()orexpect()in library code paths that can be reached from user input. - Use
?for propagation. Match and convert at module boundaries.
- All numeric writes use explicit
.to_le_bytes()— neverbyteorderwrite traits that could silently change byte order. - All numeric reads use explicit
u32::from_le_bytes(buf[n..n+4].try_into()).
- Every bug fix must include a regression test that would have caught the bug.
- New public API functions must have at least one unit test and, where
meaningful, a property-based test using
proptest.
- All public API items (
pub fn,pub struct,pub enum,pub const) must have///doc comments. - Internal implementation details go in
//comments or module-level//!docs.
Follow the Conventional Commits format:
<type>(<scope>): <summary>
[optional body]
[optional footer: BREAKING CHANGE / Fixes #N]
Types: feat, fix, perf, refactor, test, docs, chore, ci
Scope (optional): block, superblock, codec, crypto, index,
io_stream, archive, plugin, cli, spec, bench
Examples:
feat(codec): add Brotli codec with frozen UUID 9c1e5f3a-...
fix(io_stream): read_at now spans chunk boundaries correctly
perf(block): eliminate intermediate Vec allocation in decode_block
docs(spec): clarify solid block intra_offset semantics
-
Fork the repository and create a branch from
main:git checkout -b fix/my-fix
-
Make your changes. Ensure:
cargo fmt --checkpassescargo clippy -- -D warningspassescargo testpasses
-
Update
CHANGELOG.mdunder the[Unreleased]section. -
Open a pull request against
main. Fill in the PR template completely. -
A maintainer will review within 7 days. Expect at least one round of feedback. Please respond to review comments within 14 days or the PR may be closed.
-
PRs are merged via squash merge to keep the main branch history linear.
Changes to spec.md that affect the binary format require a format_version
bump and MUST:
- Be discussed in a GitHub issue for at least one week before implementation.
- Include concrete justification for why the change cannot be expressed within the current format version.
- Update the version history table in
spec.md §14. - Update
CHANGELOG.mdwith a clear "Format changes" subsection. - Include a migration note explaining what happens to existing archives.
Editorial changes (grammar, examples, clarifications that do not affect byte-level behavior) can be submitted directly as PRs.
-
Open an issue requesting a UUID assignment. Provide: codec name, crate name and version, a brief description, and why it belongs in the built-in registry rather than as a plugin.
-
Once a UUID is assigned in the issue, the UUID is permanent. It will be added to the frozen registry table in
spec.md §7.1even if the codec is later deprecated. -
Implement the
Codectrait insrc/codec/mod.rs. Add the UUID constant and updateCodecId::from_uuid(),CodecId::uuid(),CodecId::name(), andCodecId::from_name(). -
Register in
get_codec()andget_codec_by_uuid(). -
Add to the CLI
parse_codec()function insrc/main.rs. -
Add to the
required_codecstable inspec.md §7.1. -
Add unit tests covering compress → decompress round-trip and an empty-input edge case.
Open a GitHub issue with:
- Title: one-line description of the bug
- Version:
6cy --versionoutput - OS: operating system and version
- Steps to reproduce: minimal commands or code
- Expected behavior: what you expected
- Actual behavior: what happened (include full error output)
- Archive file: if the bug involves a specific archive, attach or link it (remove sensitive data first)
For crashes or panics, include the full stack trace (RUST_BACKTRACE=1).
Do not open a public GitHub issue for security vulnerabilities.
See SECURITY.md for the responsible disclosure process.
By submitting a pull request, you confirm that:
- You have the right to submit the contribution under the Apache License 2.0 (for code) or CC BY 4.0 (for specification changes).
- You grant the project maintainer a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable license to reproduce, distribute, and sublicense your contribution as part of this project.
- Contributions to
spec.mdare submitted under CC BY 4.0.
No Contributor License Agreement (CLA) signature is required beyond the act of submitting a pull request.