Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eaeca47
Phase 0: buildable, testable, honest repo
richarah Jul 14, 2026
6e7c1ef
Phase 1 (core): fix framework correctness bugs
richarah Jul 14, 2026
75b455d
Phase 1 (sql, mime): fix correctness and security bugs
richarah Jul 14, 2026
26a1f12
Phase 3 (mime): consolidate into a single pipeline
richarah Jul 14, 2026
27751f1
Phase 2: truthful test suite, fuzzing, coverage
richarah Jul 14, 2026
bbd0d70
Phase 3 (sql): fix all 11 property-test bugs
richarah Jul 14, 2026
69e24cf
Phase 3 (sql): grouping sets, CONNECT BY, OUTPUT, optimizer
richarah Jul 15, 2026
ed35ad0
docs: add feature matrix (claimed vs implemented vs planned)
richarah Jul 15, 2026
6d21cb9
Wave 1: nine standard-SQL clause gaps closed
richarah Jul 15, 2026
4197fb1
Wave 2: dialect-specific SQL features
richarah Jul 15, 2026
bf80707
Wave 3: MIME encoding side, UTF-16, message/partial
richarah Jul 15, 2026
1e602c9
Wave 4: SECURITY.md, Doxyfile, current benchmark results
richarah Jul 15, 2026
53f969a
style: repo-wide clang-format sweep
richarah Jul 15, 2026
e97322e
chore: add .git-blame-ignore-revs for the format sweep
richarah Jul 15, 2026
a4389b4
Wave 4: tidy findings, size_t limits, matrix closed out
richarah Jul 15, 2026
a633865
Fix CI: Werror warnings, fuzz finding, find_package export
richarah Jul 16, 2026
43bd4c5
CI green + CONNECT BY recursive-CTE lowering
richarah Jul 16, 2026
4fed1dd
Issue #4: MIME corpus runner + CI gates (corpus, clang-tidy)
richarah Jul 16, 2026
bf956b2
Close issues #3/#4: dialect promotion, corpus, tidy CI
richarah Jul 16, 2026
9cbc81f
bench: measured comparison vs Python sqlglot 30.12
richarah Jul 16, 2026
e3ba765
docs: roadmap for the remaining work, structural wins first
richarah Jul 16, 2026
4c5f58e
Stage 1: dialect family inheritance (issue #5)
richarah Jul 16, 2026
7483985
Stage 2: promote 12 family-member dialects
richarah Jul 16, 2026
5e9dff1
Stage 3: MIME envelope gaps (issue #6)
richarah Jul 16, 2026
b6ac787
Stage 4: differential testing vs Python email (issue #7)
richarah Jul 16, 2026
1a0c1ae
Stage 5: ISO-8859-15, real mbox support, honest re-measurement
richarah Jul 17, 2026
3e33229
docs: README states only what CI or bench proves
richarah Jul 17, 2026
6aa0bba
Fix clang-tidy finding in stage-5 date parser
richarah Jul 17, 2026
40156f5
Enron at scale: 517k messages, and a real charset bug it found
richarah Jul 17, 2026
c38778b
docs: README cites the Enron corpus result
richarah Jul 17, 2026
2454a22
Stage 5 follow-up: residual, mime4j suite, security corpus
richarah Jul 18, 2026
658d34d
Close remaining stage-5 follow-ups: filenames, preamble, obs-syntax
richarah Jul 18, 2026
9aec60e
Implement the last two dead anomaly kinds
richarah Jul 19, 2026
c54b495
Head-to-head MIME speed benchmark vs Rust/Java/Python parsers
richarah Jul 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Matches the prevailing style of the existing headers.
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 100
AccessModifierOffset: -4
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Attach
PointerAlignment: Left
SpaceAfterTemplateKeyword: false
IndentPPDirectives: None
NamespaceIndentation: None
FixNamespaceComments: true
63 changes: 63 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# clang-tidy configuration.
#
# The bugprone-*, performance-*, and clang-analyzer-* families (the checks
# that find defects) run as errors in CI. The modernize-* and readability-*
# families are enabled too, but the specific style-tier checks that conflict
# with the codebase's deliberate and consistent idioms are disabled below,
# each with a reason. clang-format enforces layout; these checks would only
# churn it. Anything genuinely bug-prone stays on and is fixed, not silenced.
Checks: >
bugprone-*,
performance-*,
modernize-*,
readability-*,
clang-analyzer-*,
-modernize-use-trailing-return-type,
-modernize-use-default-member-init,
-modernize-use-nodiscard,
-modernize-use-emplace,
-modernize-use-auto,
-modernize-avoid-c-arrays,
-modernize-loop-convert,
-modernize-return-braced-init-list,
-modernize-use-designated-initializers,
-modernize-use-starts-ends-with,
-readability-identifier-length,
-readability-magic-numbers,
-readability-function-cognitive-complexity,
-readability-braces-around-statements,
-readability-implicit-bool-conversion,
-readability-else-after-return,
-readability-qualified-auto,
-readability-named-parameter,
-readability-redundant-member-init,
-readability-redundant-string-init,
-readability-redundant-casting,
-readability-convert-member-functions-to-static,
-readability-use-anyofallof,
-readability-container-contains,
-readability-container-size-empty,
-readability-simplify-boolean-expr,
-readability-avoid-unconditional-preprocessor-if,
-readability-avoid-nested-conditional-operator,
-readability-non-const-parameter,
-performance-enum-size,
-performance-no-int-to-ptr,
-performance-unnecessary-value-param,
-bugprone-easily-swappable-parameters,
-bugprone-branch-clone
# Rationale for the notable disables:
# modernize-use-default-member-init / avoid-c-arrays / return-braced-init-list
# - the codebase uses constructor init-lists and constexpr C-array lookup
# tables deliberately and uniformly.
# readability-qualified-auto / named-parameter / *-member-init
# - pervasive stylistic preferences, not correctness.
# performance-no-int-to-ptr - the arena's alignment computation is an
# intentional, correct uintptr_t round-trip.
# bugprone-branch-clone - the parser/generator have many intentionally
# parallel branches (per-token, per-dialect) that read clearer apart.
# bugprone-easily-swappable-parameters - advisory, high-noise on
# (row, col) / (start, end) style signatures.
WarningsAsErrors: ''
HeaderFilterRegex: '(core|sql|mime)/include/libglot/.*'
FormatStyle: file
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Commits to ignore in git blame (mechanical reformatting)
53f969a60fdc20fec9afe71bea1efb6d6cc6286d
206 changes: 206 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
build-and-test:
name: ${{ matrix.compiler.name }} ${{ matrix.build_type }}${{ matrix.sanitize && ' + sanitizers' || '' }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler:
- { name: GCC, cc: gcc-14, cxx: g++-14 }
- { name: Clang, cc: clang-18, cxx: clang++-18 }
build_type: [Debug, Release]
sanitize: [false]
include:
- compiler: { name: GCC, cc: gcc-14, cxx: g++-14 }
build_type: Debug
sanitize: true
- compiler: { name: Clang, cc: clang-18, cxx: clang++-18 }
build_type: Debug
sanitize: true

steps:
- uses: actions/checkout@v4

- name: Install toolchain
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ${{ matrix.compiler.cc == 'gcc-14' && 'gcc-14 g++-14' || 'clang-18' }}

- name: Configure
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \
-DLIBGLOT_WERROR=ON \
-DLIBGLOT_ENABLE_ASAN=${{ matrix.sanitize && 'ON' || 'OFF' }}

- name: Build
run: cmake --build build -j"$(nproc)"

- name: Test
run: ctest --test-dir build --output-on-failure -j"$(nproc)"

fuzz-smoke:
name: fuzzers (60s smoke per target)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y ninja-build clang-18
- name: Configure
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 \
-DBUILD_TESTING=OFF -DLIBGLOT_BUILD_FUZZERS=ON
- name: Build fuzzers
run: cmake --build build -j"$(nproc)"
- name: Run fuzzers
run: |
mkdir -p corpus/sql corpus/mime
printf 'SELECT a, b FROM t WHERE x BETWEEN 1 AND 10 ORDER BY a LIMIT 5' > corpus/sql/seed1
printf 'WITH c AS (SELECT 1) INSERT INTO t (a) SELECT * FROM c' > corpus/sql/seed2
printf 'Content-Type: multipart/mixed; boundary="b"\r\n\r\n--b\r\n\r\nhi\r\n--b--\r\n' > corpus/mime/seed1
./build/fuzz/fuzz_sql_parser -max_total_time=60 -timeout=10 corpus/sql
./build/fuzz/fuzz_sql_roundtrip -max_total_time=60 -timeout=10 corpus/sql
./build/fuzz/fuzz_mime_parser -max_total_time=60 -timeout=10 corpus/mime

coverage:
name: coverage report
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y ninja-build g++-14 gcovr
- name: Configure
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=g++-14 \
-DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_EXE_LINKER_FLAGS="--coverage"
- name: Build and test
run: |
cmake --build build -j"$(nproc)"
ctest --test-dir build -j"$(nproc)" --output-on-failure
- name: Report
run: |
gcovr --root . --filter 'core/include/' --filter 'sql/include/' --filter 'mime/include/' \
--exclude '.*/_deps/.*' --gcov-ignore-errors=no_working_dir_found \
--gcov-executable gcov-14 --print-summary --xml coverage.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml

mime-corpus:
name: MIME corpus gate
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y ninja-build g++-14
- name: Build corpus runner
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=g++-14 -DBUILD_TESTING=OFF \
-DLIBGLOT_BUILD_EXAMPLES=OFF -DLIBGLOT_BUILD_SQL=OFF
cmake --build build -j"$(nproc)" --target mime_corpus
- name: Committed sample corpus (must be 100%)
run: ./build/tools/mime_corpus --min-success 1.0 tests/corpus/mime
- name: SpamAssassin public corpus (best effort, reported not gated)
continue-on-error: true
run: |
mkdir -p sa && cd sa
for f in 20021010_easy_ham 20030228_hard_ham 20050311_spam_2; do
curl -fsSL "https://spamassassin.apache.org/old/publiccorpus/${f}.tar.bz2" -o "$f.tar.bz2" \
&& tar xjf "$f.tar.bz2" || echo "skip $f (download failed)"
done
cd ..
./build/tools/mime_corpus --min-success 0.0 --quiet sa || true

mime-differential:
name: MIME differential vs Python email
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y ninja-build g++-14
- name: Build mime_dump
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=g++-14 -DBUILD_TESTING=OFF \
-DLIBGLOT_BUILD_EXAMPLES=OFF -DLIBGLOT_BUILD_SQL=OFF
cmake --build build -j"$(nproc)" --target mime_dump
- name: Committed corpus must agree 100% with Python's email module
run: |
python3 scripts/mime_diff.py --tool build/tools/mime_dump \
--corpus tests/corpus/mime --fail-under 1.0 --verbose

clang-tidy:
name: clang-tidy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y clang-tidy-18
- name: Run clang-tidy over first-party TUs
run: |
# Each example/tool/fuzz TU transitively includes the whole public
# header surface; HeaderFilterRegex in .clang-tidy scopes the checks
# to first-party headers, and any warning fails the job.
INC="-std=c++20 -Icore/include -Isql/include -Imime/include"
status=0
for f in $(git ls-files 'examples/*.cpp' 'tools/*.cpp' 'fuzz/*.cpp'); do
echo "::group::clang-tidy $f"
clang-tidy-18 --warnings-as-errors='*' "$f" -- $INC || status=1
echo "::endgroup::"
done
exit $status

install-package:
name: install + find_package smoke test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: sudo apt-get update && sudo apt-get install -y ninja-build g++-14
- name: Build and install
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=g++-14 -DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/install"
cmake --build build -j"$(nproc)"
cmake --install build
- name: Consume via find_package
run: |
mkdir consumer && cd consumer
cat > CMakeLists.txt <<'EOF'
cmake_minimum_required(VERSION 3.28)
project(consumer CXX)
find_package(libglot REQUIRED)
add_executable(smoke smoke.cpp)
target_link_libraries(smoke PRIVATE libglot::sql libglot::mime)
EOF
cat > smoke.cpp <<'EOF'
#include <libglot/sql/parser.h>
#include <libglot/sql/generator.h>
#include <libglot/mime/parser.h>
#include <cassert>
int main() {
libglot::Arena arena;
libglot::sql::SQLParser parser(arena, "SELECT 1");
assert(parser.parse_top_level() != nullptr);
return 0;
}
EOF
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER=g++-14 \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install"
cmake --build build
./build/smoke
53 changes: 18 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
# Build directories
build/
build-release/
Testing/
# Build directories (out-of-source builds only; never build in the source tree)
build*/
cmake-build-*/
out/

# CMake generated files
# In-source build debris, in case one happens anyway
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
CTestTestfile.cmake
Testing/
_deps/
Makefile
*.cmake
!CMakeLists.txt
!CMakePresets.json
!cmake/
!/Makefile.dist

# Dependencies
_deps/
# Installed package artifacts
vcpkg_installed/

# Backup and temporary files
*.backup
*.bak
*.old
*.tmp
*.log
*~
.DS_Store

# Python bytecode
__pycache__/
*.pyc
*.pyo
*.py[co]

# IDE and editor files
# Editor and OS files
.vscode/
.idea/
.vs/
*.swp
*.swo
.vs/

# Test artifacts
test_*_bin
*_debug.cpp
debug_*.cpp

# Scripts (keeping source scripts, ignoring generated ones)
*.sh
*~
.DS_Store

# Text verification files
*.txt
!CMakeLists.txt
# Coverage and profiling output
*.gcda
*.gcno
*.profraw
coverage/
Loading
Loading