Skip to content

Contributing

Canontra is an open-source systems research project licensed under Apache-2.0.

  • GHC: 9.6.6
  • Stack (recommended, LTS 22.28) or Cabal (>= 3.0)
  • Git
Terminal window
git clone https://github.com/symtrace/canontra.git
cd canontra
stack build --fast
stack exec canontra -- --help

All pull requests must pass all 795 automated tests with zero warnings and zero failures, plus HLint checks:

Terminal window
stack test --pedantic
hlint --hint=.hlint.yaml src app bench test

Canontra compiles with:

-Wall -Werror -Wcompat -Widentities -Wincomplete-record-updates
-Wincomplete-uni-patterns -Wmissing-export-lists -Wpartial-fields
-Wredundant-constraints

Pull requests run three automated GitHub Actions gates:

  • .github/workflows/ci.yml: Strict -Wall --pedantic build and all 795 tests.
  • .github/workflows/lint.yml: Deterministic HLint + reviewdog inline PR review, shellcheck, actionlint, and cabal check.
  • .github/workflows/security.yml: Zero-trust architectural invariant gate, Gitleaks OSS secret scan, Google OSV-Scanner dependency audit, and zizmor workflow security audit.
  1. 100% Pure Haskell: Never introduce C-FFI bindings, C/C++ libraries, or dynamic runtime dependencies (libtree-sitter).
  2. Air-Gapped Zero-Trust: Never import networking, HTTP, socket, or telemetry packages.
  3. Cross-Platform Bit-Identity: Serialize all integers big-endian, normalize paths to forward slashes /, and preserve OS-independent collation.
  4. Memory Hygiene: Prefer LinearAST arenas, ByteString-native flatparse/SIMDScan lexing, unboxed CSRGraph vectors, 4KB CNTR\x07 SlabV7 records, mutable MV.IOVector Chase-Lev deques, and SwissTable interning over pointer-heavy GC trees.
  5. Stateless AI Harness Hygiene (Canontra.Harness.*, Alpha): Preserve zero background daemons, zero IPC/network sockets, zero .git mutation, preflight SHA-256 + path-containment verification prior to snap rewind, and auto-ignored .canontra/ state.

4. Adding Parser or Normalization Features

Section titled “4. Adding Parser or Normalization Features”
  1. Frontend / Pass Location: Parsers live in src/Canontra/Parser/ (Python.hs, FastPython.hs, JS.hs, Go.hs, Rust.hs); normalizers live in src/Canontra/Normalize/.
  2. Metamorphic Tests: Add both a soundness test (confirming F1, F2, F_T, F4 invariance under trivia/canonical transforms) and a sensitivity test (confirming F1 and F4 divergence under semantic mutation) in test/Canontra/MetamorphicSpec.hs.
  3. Installer Checks: If modifying installer scripts, validate syntax before submitting:
Terminal window
bash -n install.sh
Terminal window
powershell -NoProfile -Command "Get-Command .\install.ps1 -Syntax"