Skip to content

Progressive disclosure trees, anti-rationalization, think strategies #46

Progressive disclosure trees, anti-rationalization, think strategies

Progressive disclosure trees, anti-rationalization, think strategies #46

Workflow file for this run

name: way-match
on:
push:
paths:
- 'tools/way-match/**'
- 'bin/way-match'
- '.github/workflows/way-match.yml'
pull_request:
paths:
- 'tools/way-match/**'
- 'bin/way-match'
- '.github/workflows/way-match.yml'
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cosmocc
run: |
mkdir -p "$HOME/.cosmocc"
curl -sL https://cosmo.zip/pub/cosmocc/cosmocc.zip -o /tmp/cosmocc.zip
unzip -q /tmp/cosmocc.zip -d "$HOME/.cosmocc"
- name: Build from source
run: |
export COSMOCC="$HOME/.cosmocc/bin/cosmocc"
make -f tools/way-match/Makefile bin/way-match
- name: Verify binary runs
run: bin/way-match --version
- name: Run test harness (BM25 vs NCD)
run: bash tools/way-match/test-harness.sh --verbose
- name: Run test harness (BM25 accuracy gate)
run: |
bash tools/way-match/test-harness.sh --bm25-only 2>&1 | tee /tmp/results.txt
accuracy=$(grep "BM25:" /tmp/results.txt | sed -n 's/.*accuracy=\([0-9]*\/[0-9]*\).*/\1/p')
correct=$(echo "$accuracy" | cut -d/ -f1)
total=$(echo "$accuracy" | cut -d/ -f2)
threshold=$((total * 75 / 100))
if [ "$correct" -lt "$threshold" ]; then
echo "FAIL: BM25 accuracy $accuracy is below 75% threshold ($threshold/$total)"
exit 1
fi
echo "PASS: BM25 accuracy $accuracy meets 75% threshold"
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: way-match-ape
path: bin/way-match
# NOTE: cosmocc cross-compiles on Linux to produce APE (Actually Portable Executable)
# binaries that run on Linux, macOS, Windows, FreeBSD, and OpenBSD natively.
# No need for multi-platform build matrix — one build covers all targets.
# The checked-in bin/way-match is a local gcc build for development convenience.