Observed once during ACE-083 development (#199), under dev.py cover. Did not reproduce in roughly 20 subsequent runs: five full-suite runs (two with coverage, three without), ten standalone runs of the file, and every gate run since. Unrelated to that change: model_store.select_examples and tools.tool_get_prompt_examples share no code path with the aggregate detector, and it does not reproduce on the base tree either.
tests/test_prompt_examples_serving.py::test_large_library_is_ranked_and_capped
Likely cause, not confirmed: write_examples mints ids with uuid4().hex and select_examples has no ORDER BY, so SQLite is free to return rows in an order that varies per run. A ranking-and-capping test over an unordered read will then disagree with itself at the cap boundary whenever two candidates tie.
Filing rather than burying it, since an intermittent failure in the retrieval path is worth a deterministic read regardless of whether it is this test's bug or the query's. If the diagnosis holds, the fix is an explicit ORDER BY on the selection query, which also makes the served examples stable across processes.
Observed once during ACE-083 development (#199), under
dev.py cover. Did not reproduce in roughly 20 subsequent runs: five full-suite runs (two with coverage, three without), ten standalone runs of the file, and every gate run since. Unrelated to that change:model_store.select_examplesandtools.tool_get_prompt_examplesshare no code path with the aggregate detector, and it does not reproduce on the base tree either.tests/test_prompt_examples_serving.py::test_large_library_is_ranked_and_cappedLikely cause, not confirmed:
write_examplesmints ids withuuid4().hexandselect_exampleshas noORDER BY, so SQLite is free to return rows in an order that varies per run. A ranking-and-capping test over an unordered read will then disagree with itself at the cap boundary whenever two candidates tie.Filing rather than burying it, since an intermittent failure in the retrieval path is worth a deterministic read regardless of whether it is this test's bug or the query's. If the diagnosis holds, the fix is an explicit
ORDER BYon the selection query, which also makes the served examples stable across processes.