From 8643426a496627940d926e9ab0a9274acc639a72 Mon Sep 17 00:00:00 2001 From: Griffin Long <151978260+DrunkOnJava@users.noreply.github.com> Date: Mon, 30 Nov 2026 01:29:49 -0500 Subject: [PATCH 1/3] ci(measure): a probe input runs named examples at the head over the corpus directory --- .github/workflows/measure.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/measure.yml b/.github/workflows/measure.yml index ac473e2..52df824 100644 --- a/.github/workflows/measure.yml +++ b/.github/workflows/measure.yml @@ -9,6 +9,12 @@ name: Measure # # gh workflow run measure.yml -f ref= -f base=main # +# `probe` names examples to build at the head and run once over the whole +# corpus directory, each writing measure/probe-.txt (for a probe of a +# derived field list against its corpus records, such as +# probe_assoc_pers_subent); `probe_features` is the cargo feature list they +# need (dxf-reader for the DXF twins). Probe output is a report, not a gate. +# # On a pull request that changes the measurement itself, the PR is measured # against its merge-base with `main`. This is a report, not a gate: the # ratchet is the Corpus job in ci.yml. The DXF value oracle (#99) runs on @@ -25,6 +31,14 @@ on: description: Branch, tag or commit to compare against required: true default: main + probe: + description: Examples to run at the head over the corpus directory, space-separated (optional) + required: false + default: "" + probe_features: + description: Cargo features the probes need, comma-separated (optional) + required: false + default: "" pull_request: branches: [main] paths: @@ -223,6 +237,35 @@ jobs: else echo "DXF value oracle: NOT MEASURED (the head has no examples/dxf_oracle)." >> "$GITHUB_STEP_SUMMARY" fi + - name: Run the requested probes at the head + if: steps.fetch.outputs.measured == 'true' && inputs.probe != '' + env: + PROBES: ${{ inputs.probe }} + PROBE_FEATURES: ${{ inputs.probe_features }} + run: | + # Inputs reach the shell only through env and are held to example + # and feature name characters before any is used. + set -uo pipefail + for p in $PROBES; do + [[ "$p" =~ ^[a-z0-9_]+$ ]] || { echo "::error::'$p' is not an example name"; exit 1; } + done + [[ -z "$PROBE_FEATURES" || "$PROBE_FEATURES" =~ ^[a-z0-9_,-]+$ ]] \ + || { echo "::error::'$PROBE_FEATURES' is not a feature list"; exit 1; } + features=() + if [ -n "$PROBE_FEATURES" ]; then features=(--features "$PROBE_FEATURES"); fi + status=0 + for p in $PROBES; do + if ! (cd "$RUNNER_TEMP/head" && CARGO_TARGET_DIR="$GITHUB_WORKSPACE/target" \ + cargo +stable build --release "${features[@]}" --example "$p"); then + echo "::error::probe $p does not build at the head" + status=1 + continue + fi + "target/release/examples/$p" "$HOME/dwg-corpus" > "measure/probe-$p.txt" 2>&1 + code=$? + echo "Probe \`$p\`: exit $code, $(wc -l < "measure/probe-$p.txt") lines in \`measure/probe-$p.txt\`." >> "$GITHUB_STEP_SUMMARY" + done + exit "$status" # Measurements and logs only; never a sample file. - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: always() && steps.fetch.outputs.measured == 'true' From fbb7a2c880a93149a69d907ed273196175b65808 Mon Sep 17 00:00:00 2001 From: Griffin Long <151978260+DrunkOnJava@users.noreply.github.com> Date: Mon, 30 Nov 2026 01:37:48 -0500 Subject: [PATCH 2/3] ci(measure): probe runs of the same refs no longer cancel each other, and probe names are never expanded as file patterns --- .github/workflows/measure.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/measure.yml b/.github/workflows/measure.yml index 52df824..7b201ad 100644 --- a/.github/workflows/measure.yml +++ b/.github/workflows/measure.yml @@ -54,7 +54,7 @@ permissions: contents: read concurrency: - group: measure-${{ github.event_name }}-${{ github.ref }}-${{ inputs.ref }}-${{ inputs.base }} + group: measure-${{ github.event_name }}-${{ github.ref }}-${{ inputs.ref }}-${{ inputs.base }}-${{ inputs.probe }}-${{ inputs.probe_features }} cancel-in-progress: true env: @@ -245,7 +245,8 @@ jobs: run: | # Inputs reach the shell only through env and are held to example # and feature name characters before any is used. - set -uo pipefail + # The names are split on spaces and never expanded as file patterns. + set -f -uo pipefail for p in $PROBES; do [[ "$p" =~ ^[a-z0-9_]+$ ]] || { echo "::error::'$p' is not an example name"; exit 1; } done From 15347925b2ec2166af5fd61b3fbcdee23afd571b Mon Sep 17 00:00:00 2001 From: Griffin Long <151978260+DrunkOnJava@users.noreply.github.com> Date: Mon, 30 Nov 2026 01:43:22 -0500 Subject: [PATCH 3/3] ci(measure): a probe that exits non-zero is reported with its status, not fatal to the step --- .github/workflows/measure.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/measure.yml b/.github/workflows/measure.yml index 7b201ad..c601b2a 100644 --- a/.github/workflows/measure.yml +++ b/.github/workflows/measure.yml @@ -262,8 +262,10 @@ jobs: status=1 continue fi - "target/release/examples/$p" "$HOME/dwg-corpus" > "measure/probe-$p.txt" 2>&1 - code=$? + # GitHub runs the step under bash -e: a probe's own failure is + # reported, not fatal, so its status is caught here. + code=0 + "target/release/examples/$p" "$HOME/dwg-corpus" > "measure/probe-$p.txt" 2>&1 || code=$? echo "Probe \`$p\`: exit $code, $(wc -l < "measure/probe-$p.txt") lines in \`measure/probe-$p.txt\`." >> "$GITHUB_STEP_SUMMARY" done exit "$status"