No description
  • C++ 80.7%
  • Python 15.2%
  • Rust 2.2%
  • Meson 1%
  • Shell 0.7%
  • Other 0.2%
Find a file
trvon b03c8615ca
Some checks failed
build / build-linux (pull_request) Failing after 8m12s
build / build-macos (pull_request) Has been cancelled
build / release (pull_request) Has been cancelled
fix(sarif): point informationUri at git.trevon.dev
fold lives only on git.trevon.dev, but every SARIF report advertised
https://github.com/trvon/fold as the tool's information URI, so code
scanning UIs and SARIF viewers linked readers to a repository fold no
longer uses. The driver now points at https://git.trevon.dev/trevon/fold.

test_scan_e2e asserts the URI; it failed before this change.
2026-09-25 08:07:37 -06:00
.forgejo/workflows ci: use Forgejo artifact actions; disable unsupported cache 2026-08-30 10:34:24 -06:00
.githooks Add githooks, clang-format all code, fix CI Z3 paths 2026-05-15 00:08:47 -04:00
.github/workflows ci: pin GitHub Actions to commit SHAs 2026-08-16 16:42:14 -06:00
bench bench: wire gold precision/recall gates into fold/yams manifests 2026-08-31 17:49:43 -06:00
docker many good updates for binary and SAST / DAST scanning 2026-06-02 12:39:03 -04:00
docs fix(scan): report quarantined TUs as coverage gaps 2026-09-24 21:41:42 -06:00
include/fold refactor(cli): one TU path normalizer for coverage, fan-out and quarantine 2026-09-24 21:46:12 -06:00
meson Phase 1-3: Z3 parallelism, &&/|| path forking, MemberExpr memoization 2026-05-15 10:48:47 -04:00
scripts fix(eval): finding fingerprint must be identity-based, not content-based 2026-09-01 19:54:54 -06:00
skills/fold-sast docs: expand fold-sast skill; document call-graph decomposition + budgets 2026-08-16 16:41:33 -06:00
src fix(sarif): point informationUri at git.trevon.dev 2026-09-25 08:07:37 -06:00
subprojects checkpoint 2026-06-04 20:20:29 -04:00
tests fix(sarif): point informationUri at git.trevon.dev 2026-09-25 08:07:37 -06:00
third_party many good updates for binary and SAST / DAST scanning 2026-06-02 12:39:03 -04:00
tools fix(rust): refine path join traversal provenance 2026-09-02 05:58:14 -06:00
.build.yml Add scan router and MCP job queue 2026-05-19 00:24:12 -04:00
.clang-format fold: bounded symbolic SAST for C++ 2026-05-14 23:14:54 -04:00
.clang-tidy Add scan router and MCP job queue 2026-05-19 00:24:12 -04:00
.clangd fold: bounded symbolic SAST for C++ 2026-05-14 23:14:54 -04:00
.fold-suppressions chore: add self-scan suppressions file + dogfood results 2026-05-28 10:49:02 -04:00
.gitignore test(bench): scope benchmark schema test to checked-in documents 2026-08-30 20:46:03 -06:00
.inferconfig chore: add Infer config to suppress known-safe FP patterns 2026-05-29 12:50:36 -04:00
.tsan-suppress Fix TSAN: suppress Z3 internal threading false positives 2026-05-15 08:42:45 -04:00
AGENTS.md fix(scan): report unanalyzed translation units and exit 2 2026-09-24 20:37:51 -06:00
BUILD.md docs: trim the README and move the performance roadmap to docs/ 2026-09-24 21:11:54 -06:00
CLAUDE.md feat: checkpoint. Bug fixes and good improvements 2026-07-10 09:59:49 -04:00
CMakeLists.txt fold: bounded symbolic SAST for C++ 2026-05-14 23:14:54 -04:00
conanfile.py perf(detect): accelerate clone scoring 2026-07-23 14:54:38 -04:00
DIFFERENTIAL_REVIEW_REPORT.md checkpoint 2026-06-04 20:20:29 -04:00
FOLLOWUP_FIXES_REPORT.md checkpoint 2026-06-04 20:20:29 -04:00
LICENSE fold: bounded symbolic SAST for C++ 2026-05-14 23:14:54 -04:00
meson.build refactor(cli): one TU path normalizer for coverage, fan-out and quarantine 2026-09-24 21:46:12 -06:00
meson_options.txt checkpoint 2026-06-04 20:20:29 -04:00
README.md docs: trim the README and move the performance roadmap to docs/ 2026-09-24 21:11:54 -06:00
ROADMAP_EXPANSION_TASKS_REPORT.md checkpoint 2026-06-04 20:20:29 -04:00
setup.sh fix(build): harden setup.sh meson native-file array + hooks path 2026-08-16 16:41:03 -06:00

fold

Bounded symbolic static analysis for C++: dead-branch and hazard detection (null dereference, division by zero, integer overflow, out-of-bounds, and more), clone and equivalence detection, and taint tracking, built on Clang LibTooling and the Z3 solver. Rust (HIR), Swift and binary scan modes also exist; the Rust detectors are heuristic today.

Every finding carries a confidence tier that says how it was established:

Tier Meaning
concrete-witness A fuzzer ran the solver's witness under a sanitizer and produced a correlated crash.
proved An exact bounded model proved it: SAT for a hazard witness, or UNSAT for a negated invariant.
latent Proved inside the function, but only reachable if a caller supplies a value the callee never guards.
heuristic Some part of the model was over-approximated.
syntactic An AST pattern or hash match only.

"Bounded" is literal: loops are unrolled to a fixed depth, and a condition that depends on a loop's exit is never reported as proved. The contract behind each tier is in docs/research/soundness.md.

Quick start

./setup.sh release     # needs LLVM/Clang 18+ and libz3 headers; Conan handles the rest
fold scan --compile-db compile_commands.json \
  --detectors null-deref --detectors div-by-zero \
  --format sarif --output findings.sarif
fold grep "null pointer" findings.sarif --field message --ignore-case

Per-platform install lines and a Docker validation harness are in BUILD.md.

Output formats are sarif, versioned findings-json, and markdown. Both machine formats record which translation units were analysed. A scan exits 0 with no findings, 1 with any unsuppressed finding, and 2 when a report could not be written or any translation unit was not analysed (compile errors, frontend failure, crash, timeout): no findings from an incomplete scan is not evidence of no bugs.

Documentation

License

GPL-3.0-only