Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e88b737
chore: restore lint-clean baseline
flyingrobots Oct 15, 2025
77d8c6e
docs: link F013 spec
flyingrobots Oct 15, 2025
3e69a21
feat: add phase 1 scaffolding and clang tidy job
flyingrobots Oct 16, 2025
818908a
fix: address review feedback for phase 1 scaffolding
flyingrobots Oct 16, 2025
0be5885
fix: retain test assertions in release builds
flyingrobots Oct 16, 2025
6f961a4
fix: align rule edge copies with destination width
flyingrobots Oct 16, 2025
ef28cbf
chore: sync docs and tooling per review
flyingrobots Oct 16, 2025
a21e7be
docs: clarify ownership and workflow guidance
flyingrobots Oct 16, 2025
3aa3ce0
ci: fix coverage instrumentation and tidy summary
flyingrobots Oct 17, 2025
7f45aac
fix: support clang warning set on CI
flyingrobots Oct 17, 2025
2b752fb
build: drop redundant apple clang warning overrides
flyingrobots Oct 17, 2025
02aabf2
fix: simplify error string count macro
flyingrobots Oct 17, 2025
950a0d0
docs: fix c style guide fences
flyingrobots Oct 17, 2025
6dac5b4
fix: satisfy clang-tidy secure api checks
flyingrobots Oct 17, 2025
c55923d
chore: unblock phase 1 branch gate
flyingrobots Oct 17, 2025
986b0dc
chore: repair commitlint range parsing
flyingrobots Oct 17, 2025
c2b4638
chore: resolve commitlint base ref lookup
flyingrobots Oct 17, 2025
1bbfe6a
chore: invoke commitlint via npx directly
flyingrobots Oct 17, 2025
e4e9a29
chore: apply conventional config for commitlint
flyingrobots Oct 17, 2025
a8fd61c
chore: install commitlint deps via npx
flyingrobots Oct 17, 2025
9147339
chore: pin commitlint packages in ci
flyingrobots Oct 17, 2025
c280e7a
ci: add commitlint config
flyingrobots Oct 17, 2025
06e687f
ci: invoke commitlint cli binary
flyingrobots Oct 17, 2025
45c1ade
ci: allow build commit type
flyingrobots Oct 17, 2025
ae3d992
fix: replace insecure libc usage
flyingrobots Oct 17, 2025
5e58ef7
fix: harden cli buffer handling
flyingrobots Oct 17, 2025
c0437b2
chore: drop unused include from mg-cli
flyingrobots Oct 17, 2025
aa82e9d
Revert "chore: drop unused include from mg-cli"
flyingrobots Oct 17, 2025
b0d34ad
chore: address review feedback
flyingrobots Oct 17, 2025
ceadb81
fix: satisfy ci static analysis
flyingrobots Oct 17, 2025
cd249c1
fix: appease ci lint fallout
flyingrobots Oct 17, 2025
72248c9
Update src/match.c
flyingrobots Oct 17, 2025
d465550
feat: record qca tick timing metrics
flyingrobots Oct 17, 2025
2144c76
fix: undef fortify before redefining
flyingrobots Oct 17, 2025
4286bf7
ci: drop macos jobs from matrix
flyingrobots Oct 17, 2025
08608a8
chore: add local quality matrix helper
flyingrobots Oct 17, 2025
3174e00
feat: add docker quality matrix tooling
flyingrobots Oct 17, 2025
f38ddc4
docs: sync clang-tidy snippet with canonical config
flyingrobots Oct 19, 2025
afcde34
feat(qca): handle split_w matches
flyingrobots Oct 19, 2025
15cc444
fix(error): widen digit buffer for 64-bit conversions
flyingrobots Oct 19, 2025
37b7a47
fix(match): guard push against count overflow
flyingrobots Oct 19, 2025
67602a9
fix(qca): zero match counters on failure
flyingrobots Oct 19, 2025
699a7da
docs(workflow): add shell fences for matrix commands
flyingrobots Oct 19, 2025
3eb3172
chore(ci): fix env propagation in matrix leg
flyingrobots Oct 19, 2025
4d6aa8f
chore(ci): fix option loop in local matrix script
flyingrobots Oct 19, 2025
0d7bcbe
chore(ci): honor build dir in security audit
flyingrobots Oct 19, 2025
c8b0b31
chore(ci): document MG_TIDY_BUILD_DIR usage
flyingrobots Oct 19, 2025
377dd86
ci: drop commitlint extends dependency
flyingrobots Oct 19, 2025
0e0ac7b
chore: drop build artifacts and finalize lint run
flyingrobots Oct 20, 2025
ea7295f
fix: repair ci coverage lint and security steps
flyingrobots Oct 20, 2025
56a0e0c
fix: stabilize coverage and security jobs
flyingrobots Oct 20, 2025
0ac952c
fix: address ci review feedback
flyingrobots Oct 20, 2025
d377f43
fix: restore lint env and clamp digits base
flyingrobots Oct 20, 2025
4224e90
fix: unblock sanitizer workflows
flyingrobots Oct 20, 2025
5093c57
fix: link safe-stack runtime for coverage
flyingrobots Oct 20, 2025
f8dc548
fix: appease clang tidy bool conversions
flyingrobots Oct 20, 2025
6c60116
fix: keep stack canaries visible for audit
flyingrobots Oct 20, 2025
4a45f74
fix: teach audit about safe stack
flyingrobots Oct 20, 2025
6b97996
fix: modernize error assert and audit pie detection
flyingrobots Oct 20, 2025
884e4b8
fix: appease tidy on digits static assert
flyingrobots Oct 20, 2025
77f2ba0
docs: record safetystack follow-up debrief
flyingrobots Oct 20, 2025
dd579fc
ci: isolate sanitizer flags per matrix job
flyingrobots Oct 20, 2025
a654324
chore: move debrief log and harden ci tooling
flyingrobots Oct 20, 2025
a4dc698
docs: log 2025-10-20 debrief
flyingrobots Oct 20, 2025
7947dff
docs: clean debrief log formatting
flyingrobots Oct 20, 2025
2f9d7a9
ci: skip non-conventional bot commits
flyingrobots Oct 21, 2025
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
31 changes: 7 additions & 24 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MetaGraph clang-tidy Configuration
# EXTREME quality standards - ALL warnings are errors

# Enable comprehensive check coverage
Checks: >
-*,
bugprone-*,
Expand All @@ -12,15 +11,12 @@ Checks: >
performance-*,
portability-*,
readability-*,
-readability-magic-numbers
-readability-magic-numbers,
-bugprone-easily-swappable-parameters

# ALL warnings become compilation errors - zero tolerance
WarningsAsErrors: '*'

# Apply checks to our headers only
HeaderFilterRegex: '(include|src)/.*\.(h|c)$'

# Check configuration
CheckOptions:
# Naming conventions for MetaGraph
- key: readability-identifier-naming.TypedefCase
Expand All @@ -40,7 +36,7 @@ CheckOptions:
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.FunctionPrefix
value: 'metagraph_'
value: ''
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
Expand All @@ -60,11 +56,11 @@ CheckOptions:
- key: readability-function-size.LineThreshold
value: '50'
- key: readability-function-size.StatementThreshold
value: '25'
value: '60'
- key: readability-function-size.BranchThreshold
value: '8'
value: '15'
- key: readability-function-size.ParameterThreshold
value: '6'
value: '8'
- key: readability-function-size.NestingThreshold
value: '5'

Expand All @@ -82,7 +78,7 @@ CheckOptions:
- key: performance-no-automatic-move.AllowedTypes
value: ''

# Modernize to C23
# Modern C (disabled for C builds)
- key: modernize-replace-auto-ptr.IncludeStyle
value: google
- key: modernize-use-auto.MinTypeNameLength
Expand All @@ -97,16 +93,3 @@ CheckOptions:
# Thread safety
- key: misc-misplaced-const.CheckPrimitiveCasts
value: true

# Force checking of system headers for complete validation
SystemHeaders: false

# Use absolute paths in diagnostics for IDE integration
UseColor: true

# Enable all available experimental checks
# Note: When using compilation database, extra args should be passed via command line
# to avoid being interpreted as file paths

# Performance: run checks in parallel
# Parallel: true # Not supported in this clang-tidy version
142 changes: 117 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler: [clang]
include:
- os: ubuntu-latest
cc: clang-18
cxx: clang++-18
- os: macos-latest
cc: clang
cxx: clang++

steps:
- uses: actions/checkout@v4
Expand All @@ -45,14 +42,10 @@ jobs:
cmake ninja-build \
clang-tidy-${{ env.LLVM_VERSION }} \
clang-format-${{ env.LLVM_VERSION }} \
valgrind

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install cmake ninja llvm@${{ env.LLVM_VERSION }}
echo "/opt/homebrew/opt/llvm@${{ env.LLVM_VERSION }}/bin" >> $GITHUB_PATH
valgrind \
python3-pip
python3 -m pip install --user semgrep
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Configure CMake
env:
Expand Down Expand Up @@ -129,11 +122,33 @@ jobs:
CC: clang-18
CXX: clang++-18
run: |
SAN="${{ matrix.sanitizer }}"
EXTRA_SANITIZER_FLAGS="-DMETAGRAPH_SANITIZERS=ON"

case "$SAN" in
address)
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=ON -DMETAGRAPH_UBSAN=ON -DMETAGRAPH_TSAN=OFF -DMETAGRAPH_MSAN=OFF"
;;
undefined)
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=OFF -DMETAGRAPH_UBSAN=ON -DMETAGRAPH_TSAN=OFF -DMETAGRAPH_MSAN=OFF"
;;
thread)
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=OFF -DMETAGRAPH_UBSAN=OFF -DMETAGRAPH_TSAN=ON -DMETAGRAPH_MSAN=OFF"
;;
memory)
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=OFF -DMETAGRAPH_UBSAN=OFF -DMETAGRAPH_TSAN=OFF -DMETAGRAPH_MSAN=ON"
;;
*)
echo "Unsupported sanitizer '$SAN'. Expected one of: address, undefined, thread, memory." >&2
exit 1
;;
esac

cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DMETAGRAPH_SANITIZERS=ON \
-DCMAKE_C_FLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}"
${EXTRA_SANITIZER_FLAGS} \
-DCMAKE_C_FLAGS="-fsanitize=${SAN} -fno-omit-frame-pointer" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${SAN}"

- name: Build
run: cmake --build build
Expand All @@ -158,7 +173,7 @@ jobs:
chmod +x llvm.sh
sudo ./llvm.sh ${{ env.LLVM_VERSION }}
sudo apt-get update
sudo apt-get install -y cmake ninja-build lcov
sudo apt-get install -y cmake ninja-build lcov llvm-${{ env.LLVM_VERSION }}-tools

- name: Configure with coverage
env:
Expand All @@ -167,27 +182,104 @@ jobs:
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage -fprofile-instr-generate -fcoverage-mapping" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
-DCMAKE_C_FLAGS="-fprofile-instr-generate -fcoverage-mapping" \
-DCMAKE_CXX_FLAGS="-fprofile-instr-generate -fcoverage-mapping" \
-DCMAKE_EXE_LINKER_FLAGS="-fprofile-instr-generate -fcoverage-mapping" \
-DCMAKE_SHARED_LINKER_FLAGS="-fprofile-instr-generate -fcoverage-mapping"

- name: Build
run: cmake --build build

- name: Test
run: |
LLVM_PROFILE_FILE="coverage-%p.profraw" ctest --test-dir build --output-on-failure
llvm-profdata-18 merge -sparse coverage-*.profraw -o coverage.profdata
PROFILE_DIR="${{ github.workspace }}/build"
LLVM_PROFILE_FILE="$PROFILE_DIR/coverage-%p.profraw" ctest --test-dir build --output-on-failure
if ! ls "$PROFILE_DIR"/coverage-*.profraw >/dev/null 2>&1; then
echo "No coverage profiles generated"
exit 1
fi
llvm-profdata-18 merge -sparse "$PROFILE_DIR"/coverage-*.profraw -o coverage.profdata
llvm-cov-18 report ./build/bin/* -instr-profile=coverage.profdata
# Export LCOV for Codecov
llvm-cov-18 export ./build/bin/* -instr-profile=coverage.profdata -format=lcov > coverage.lcov

- name: Upload coverage reports
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
files: ./coverage.profdata
fail_ci_if_error: true
files: ./coverage.lcov
fail_ci_if_error: false

clang-tidy-god-tier:
name: GNU-GON-CRY-GOD-TIER-SUPERSTRICT™ clang-tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install LLVM toolchain
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ env.LLVM_VERSION }}
sudo apt-get update
sudo apt-get install -y cmake ninja-build \
clang-tidy-${{ env.LLVM_VERSION }} \
clang-format-${{ env.LLVM_VERSION }}
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${{ env.LLVM_VERSION }} 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${{ env.LLVM_VERSION }} 100

- name: Configure GNU-GON-CRY-GOD-TIER build
env:
CC: clang-18
CXX: clang++-18
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DMETAGRAPH_DEV=ON \
-DMETAGRAPH_SANITIZERS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Build compile database
run: cmake --build build --parallel

- name: Verify compile database
run: |
if [ ! -f build/compile_commands.json ]; then
echo "Error: compile_commands.json not generated; build may have failed" >&2
exit 1
fi

- name: Run GNU-GON-CRY-GOD-TIER-SUPERSTRICT™ clang-tidy
env:
MG_TIDY_BUILD_DIR: build
run: |
set +e
set -o pipefail
./scripts/run-clang-tidy.sh --check | tee clang-tidy.log
tidy_status=$?
head -n 200 clang-tidy.log || true
set -e
warnings=$(grep -c "warning:" clang-tidy.log || true)
errors=$(grep -c "error:" clang-tidy.log || true)
echo "::notice title=GNU-GON-CRY-GOD-TIER-SUPERSTRICT™ clang-tidy::${warnings} warnings / ${errors} errors"
{
echo "## clang-tidy summary"
echo ""
echo "- Warnings: ${warnings}"
echo "- Errors: ${errors}"
} >> "$GITHUB_STEP_SUMMARY" || true
exit "$tidy_status"

- name: Upload clang-tidy log
if: failure()
uses: actions/upload-artifact@v4
with:
name: clang-tidy-god-tier-log
path: clang-tidy.log
retention-days: 7

all-checks-pass:
name: All Checks Pass
needs: [quality-matrix, format-check, sanitizers, coverage]
needs: [quality-matrix, format-check, sanitizers, coverage, clang-tidy-god-tier]
runs-on: ubuntu-latest
steps:
- run: echo "All checks passed!"
- run: echo "All checks passed!"
15 changes: 7 additions & 8 deletions .github/workflows/nightly-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,21 @@ jobs:
fi

- name: Run fuzzing
env:
DURATION: ${{ github.event.inputs.duration || 3600 }}
ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:strict_string_checks=1:print_stats=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=0:print_module_map=1
run: |
DURATION=${{ github.event.inputs.duration || 3600 }}

./build-fuzz/tests/fuzz/fuzz-${{ matrix.target }} \
corpus/${{ matrix.target }} \
-max_total_time=$DURATION \
-max_total_time="$DURATION" \
-print_final_stats=1 \
-jobs=$(nproc) \
-workers=$(nproc) \
-jobs="$(nproc)" \
-workers="$(nproc)" \
-max_len=1048576 \
-timeout=30 \
-rss_limit_mb=4096 \
-artifact_prefix=crashes/
env:
ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:strict_string_checks=1:print_stats=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=0:print_module_map=1

- name: Check for crashes
id: check_crashes
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/pr-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,29 @@ jobs:
with: { fetch-depth: 0 }

- name: Branch naming & target rules
env:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
scripts/ci/guard-branch.sh \
"${{ github.event.pull_request.head.ref }}" \
"${{ github.event.pull_request.base.ref }}"
"$PR_HEAD_REF" \
"$PR_BASE_REF"

- name: Version downgrade guard
env:
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
scripts/ci/guard-version.sh \
"${{ github.event.pull_request.head.sha }}" \
"${{ github.event.pull_request.base.ref }}"
"$PR_HEAD_SHA" \
"$PR_BASE_REF"

- name: Install commitlint tooling
run: npm ci

- name: Conventional-commit lint
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
scripts/ci/lint-commits.sh "$BASE_REF...$HEAD_SHA"
scripts/ci/lint-commits.sh "$BASE_REF...$HEAD_SHA"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ DerivedData/
# Build directories
build/
build-*/
build-asan/
compile_commands.json
dist/
bin/
Expand Down Expand Up @@ -92,5 +93,8 @@ missing
*.core
vgcore.*

# Node.js tooling
node_modules/

# Performance baseline (machine-dependent, not tracked)
performance-baseline.txt
Loading
Loading