Skip to content

Quality and Datasets

Joe Curlee (w4ffl35) edited this page Feb 17, 2026 · 6 revisions

Quality, Datasets, and Versioning

This document defines the quality harness, dataset versioning, and stable/unstable feature gates for Curlee.

End-to-end tests

  • tests/run/ contains curated end-to-end programs.
  • The E2E harness (curlee_e2e_tests) verifies and (for tests/run) executes programs.
  • CI runs ctest, which includes the E2E harness.

Correct samples dataset

  • tests/correct_samples/ contains verified programs generated deterministically (see Glossary).
  • The generator is scripts/generate_correct_samples.py.
  • The dataset is exported to training_data.txt for downstream RAG/training use.

Deterministic generation

  • The generator uses a fixed seed (default 1337).
  • The output is deterministic for the same seed and count.
  • Regenerating with different parameters must update training_data.txt and the dataset.

Benchmark harness (optional)

  • Run scripts/benchmark.py after building the CLI.
  • Example:
    cmake --preset linux-debug
    cmake --build --preset linux-debug
    ./scripts/benchmark.py --dirs tests/run
  • The harness reports average time across runs.

Quality audit policy

Curlee ships a deterministic structural quality audit script:

python3 scripts/quality_audit.py --format json --out build/quality-audit-report.json

CI policy (v1):

  • Blocking rules: violations with severity error.
  • Non-blocking rules: violations with severity warning (reported, but do not fail CI).
  • CI uploads the JSON report as an artifact for review on both pass/fail.

This keeps enforcement strict for high-risk regressions while allowing incremental cleanup of warning-level debt.

Fuzzing (optional)

Curlee includes an optional lexer fuzz target intended for deterministic, capability-safe fuzzing.

  • Configure/build:
    CC=clang CXX=clang++ cmake --preset linux-debug -DCURLEE_ENABLE_FUZZING=ON
    cmake --build --preset linux-debug --target curlee_lexer_fuzz curlee_parser_fuzz
  • Run (libFuzzer):
    ./build/linux-debug/curlee_lexer_fuzz -seed=1 -runs=10000 -max_len=4096 -artifact_prefix=/tmp/curlee-lexer-fuzz/
    ./build/linux-debug/curlee_parser_fuzz -seed=1 -runs=10000 -max_len=4096 -artifact_prefix=/tmp/curlee-parser-fuzz/
  • Reproduce a crash from a saved input:
    ./build/linux-debug/curlee_lexer_fuzz /tmp/curlee-lexer-fuzz/crash-*
    ./build/linux-debug/curlee_parser_fuzz /tmp/curlee-parser-fuzz/crash-*

If you are not using Clang/libFuzzer, the target builds as a standalone harness that accepts a single input file path.

Regression fixtures (no fuzzer required)

When fuzzing finds a crash, commit the minimized repro input so it runs in CI as a normal unit test.

  • Save the repro input under:
    • tests/fuzz_regressions/lexer/ for lexer crashes
    • tests/fuzz_regressions/parser/ for parser crashes
  • Prefer small, descriptive filenames (e.g., unterminated_string.curlee, weird_unicode.bin).
  • Run the regression harness locally:
    cmake --preset linux-debug
    cmake --build --preset linux-debug
    ctest --preset linux-debug -R '^curlee_fuzz_regression_tests$' --output-on-failure

Versioning policy

  • Dataset versions increment when:
    • The generator changes,
    • The language surface changes,
    • The verification scope changes.
  • Each dataset export should annotate the seed and sample count in the header.

Stable/unstable feature gates

  • Stable: syntax and semantics covered by MVP verification scope.
  • Unstable: experimental features (e.g., new contracts, ownership types, interop).
  • E2E datasets must use only stable features.
  • Unstable features must be flagged in docs and excluded from tests/correct_samples/.

Clone this wiki locally