@@ -64,13 +64,18 @@ jobs:
6464
6565 fuzzer :
6666 if : needs.config.outputs.pg_latest
67- name : LLM fuzzer PG ${{ needs.config.outputs.pg_latest }}
67+ name : ${{ matrix.display_name }}
6868 runs-on : ubuntu-22.04
6969 needs : config
7070 permissions :
7171 contents : read
7272 pull-requests : read
7373 issues : read
74+ strategy :
75+ matrix :
76+ include :
77+ - oracle : " internal-error"
78+ display_name : " Internal Program Errors"
7479
7580 steps :
7681 - name : Install Linux Dependencies
@@ -176,6 +181,9 @@ jobs:
176181 EVENT_WHAT : ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.schedule || github.event_name }}
177182 EVENT_BRANCH : ${{ github.head_ref || github.ref_name }}
178183 EVENT_BASE : ${{ github.base_ref || github.ref_name }}
184+ EVENT_NAME : ${{ github.event_name }}
185+ SHA : ${{ github.event.pull_request.head.sha || github.sha }}
186+ ORACLE_NAME : ${{ matrix.oracle }}
179187 run : |
180188 export PATH=$HOME/$PG_INSTALL_DIR/bin:$PATH
181189 export PGDATABASE=postgres
@@ -184,43 +192,8 @@ jobs:
184192 claude -p --output-format stream-json --verbose \
185193 --max-budget-usd 5.00 --dangerously-skip-permissions \
186194 --model opus --effort high \
187- "$(cat <<PROMPT
188- Find bugs in the TimescaleDB code modified in this change set. Focus
189- on crashes, assertion failures, sanitizer errors, and internal errors
190- (SQLSTATE XX000) -- these are detected automatically from server
191- logs. Do not chase wrong-result bugs that need manual verification.
192- That is, if you see a bug, but it manifests in a way that is not
193- going to be caught by the reproduction step of this workflow, choose
194- another bug. Stop after one reproducible bug.
195-
196- Read the workflow at .github/workflows/llm-fuzzer.yaml. You are
197- running in that workflow. PostgreSQL with TimescaleDB is already
198- built and installed, with AddressSanitizer enabled. The build
199- environment is functional, use it to rebuild with debug logging as
200- needed.
201-
202- Determine whether we are testing a PR or a commit on a branch. Focus
203- on the changes in that change set. Do not explore unrelated git
204- history or old commits.
205-
206- Only use public SQL APIs (CREATE, ALTER, SELECT, INSERT, etc. and
207- documented timescaledb functions). Do not directly modify internal
208- catalog tables (_timescaledb_catalog.*, _timescaledb_internal.*) --
209- corrupting internal state is not a useful bug. The goal is to find
210- inputs that break the code through its public interface.
211-
212- When done, generate a self-contained ~/llm-fuzzer-repro.sql that
213- reproduces the error when the subsequent workflow step replays it
214- against a fresh server.
215-
216- Some details about the GitHub Actions event that triggered this workflow
217- what=$EVENT_WHAT
218- branch=$EVENT_BRANCH
219- base=$EVENT_BASE
220- event=${{ github.event_name }}
221- sha=${{ github.event.pull_request.head.sha || github.sha }}
222- PROMPT
223- )" > ${{ runner.temp }}/claude-execution-output.json || rc=$?
195+ "$(envsubst < .github/workflows/llm-fuzzer/prompt.txt)" \
196+ > ${{ runner.temp }}/claude-execution-output.json || rc=$?
224197
225198 # When it goes over the budget, mostly it terminates gracefully because
226199 # the agent is aware of the remaining budget, but sometimes there's a
@@ -323,8 +296,11 @@ jobs:
323296 pg_ctl start
324297
325298 psql -c "create extension timescaledb;"
326- psql -v ON_ERROR_STOP=0 -f ~/llm-fuzzer-repro.sql
327- psql -c "select 1"
299+
300+ .github/workflows/llm-fuzzer/oracle/${{ matrix.oracle }}/verify.sh
301+
302+ psql -c "select 1;"
303+
328304
329305 pg_ctl stop
330306
@@ -334,9 +310,13 @@ jobs:
334310 if : always() && steps.repro.outputs.found == 'true'
335311 run : |
336312 ! jq 'select(
337- (.state_code == "XX000" and .error_severity != "LOG" and (.message | test("TestFailure") | not))
338- or (.message | test("resource was not closed|could not close|leak"))
339- ) | [.message, .func_name, .statement] | @tsv
313+ (
314+ .state_code == "XX000" and .func_name != "exec_stmt_raise"
315+ and .error_severity != "LOG" and (.message | test("TestFailure") | not)
316+ ) or (
317+ .message | test("resource was not closed|could not close|leak")
318+ )
319+ ) | [.message, .func_name, .statement] | @tsv
340320 ' -r postmaster.json | grep .
341321
342322 - name : Collect the logs
0 commit comments