No description
  • Scheme 55.6%
  • Shell 20.3%
  • C 13.4%
  • Makefile 10.4%
  • Common Lisp 0.3%
Find a file
ober 1a09b632f8
Some checks failed
required-ci / required (push) Failing after 4m26s
Merge pull request #3
2026-09-19 16:48:48 -04:00
.forgejo Use FreeBSD Forgejo CI runner 2026-08-03 14:52:46 -06:00
.jerboa Security hardening and release readiness 2026-06-23 10:51:48 -06:00
docs fix: close security audit findings 2026-07-11 17:25:58 -06:00
native perf(tree-sitter): batch node-range into a single FFI call 2026-07-22 13:56:05 -06:00
scripts fix: guard tree-sitter native lifetimes 2026-09-05 13:05:48 -06:00
src fix: guard tree-sitter native lifetimes 2026-09-05 13:05:48 -06:00
support Set up Forgejo CI/CD policy 2026-08-03 12:50:54 -06:00
tests fix: bound public traversal API against stack-overflow/OOM DoS (P1 #26) 2026-07-21 17:55:22 -06:00
vendor/grammars Add tree-sitter-kotlin and tree-sitter-dart grammars (ABI 15, generated) 2026-06-01 23:33:50 -06:00
.gitignore build: remove tracked generated .sls files and ignore them 2026-07-24 11:44:07 -06:00
.gitsafeignore Set up Forgejo CI/CD policy 2026-08-03 12:50:54 -06:00
AGENTS.md docs(agents): add checkout hygiene policy (work dirs under ~/work, cleanup when done) 2026-09-12 19:11:04 -06:00
jpkg.sexp Use FreeBSD Forgejo CI runner 2026-08-03 14:52:46 -06:00
LICENSE Switch to MIT license 2026-07-21 13:42:20 -06:00
Makefile fix: guard tree-sitter native lifetimes 2026-09-05 13:05:48 -06:00
PLAN.md Security hardening and release readiness 2026-06-23 10:51:48 -06:00
README.md fix: close security audit findings 2026-07-11 17:25:58 -06:00
SECURITY.md fix: close security audit findings 2026-07-11 17:25:58 -06:00
VERSION fix: guard tree-sitter native lifetimes 2026-09-05 13:05:48 -06:00

jerboa-treesitter

Minimal Jerboa bindings for Tree-sitter, built for the jerboa-semgrep port.

This repository is experimental Lane B parser/FFI infrastructure. It is designed to keep the parser boundary narrow:

  • No dynamic grammar loading.
  • Only statically compiled grammars are available.
  • The grammar set is pinned and statically compiled from vendor/grammars.
  • Parser APIs consume caller-provided strings; they do not read files.
  • Native Tree-sitter handles are wrapped and must be closed by callers.

Build

make security
make test
make adversarial-corpus
make audit
make runtime-provenance-check
make reproducibility-report
make target-evidence
make release-evidence

The build uses a local ../tree-sitter checkout when present. Otherwise make fetches the pinned Tree-sitter runtime into .tree-sitter.

make release-evidence writes the local release artifact bundle under dist/release-evidence/, including the pinned Tree-sitter runtime commit and ABI, vendored grammar manifest, native linkage, a 512-case valid/malformed/bounded grammar corpus, source hashes, sanitized target evidence, and a hash-only two-clean-build reproducibility report. make target-evidence records target-only parser/FFI review blockers and fails closed when JTREESITTER_REQUIRE_TARGET_PROOF=1 is set without a marker-complete JTREESITTER_TARGET_PROOF_FILE; overlarge, host-private, or high-confidence secret proof files are rejected before copying.

Usage

(import (tree-sitter tree-sitter))

(define result (parse-string 'json "{\"a\": 1}"))
(node-type (parse-result-root result))

parse-string caps UTF-8 input at 8 MiB, enforces a five-second monotonic native parse deadline, and does not eagerly traverse the tree. Use parse-string/with-errors for bounded detailed diagnostics, or construct a parse-limits record and call parse-string/limits for tighter source, parse, node, depth, error-count, and traversal-time budgets. Check parse-result-errors-truncated? before treating a detailed error list as complete.

Dynamic builds must set JERBOA_TREE_SITTER_LIB to the absolute trusted directory containing the shim. Relative paths, CWD/bare-name searches, final symlinks, and missing shims are rejected. Statically registered builds do not need the variable.

Dynamic grammar loading is intentionally absent from this implementation. Additional Semgrep-required grammars should be added as pinned, static grammar sources first.

Security

Review SECURITY.md, docs/ffi-boundary.md, docs/runtime-provenance.md, docs/resource-limits.md, and docs/release-evidence.md before using these bindings in release candidates. Public release still requires full grammar provenance review, broader external malformed-input soak, downstream jerboa-semgrep integration evidence, and marker-complete target parser proof.