Compacting a compressed chunk can do unbounded work when many overlapping batches need merging, which makes policy runs hard to bound. Add an optional limit on how much batch-decompression work a single compact_chunk invocation will do before returning, so large chunks can be compacted incrementally across runs. Zero must mean unlimited; negative values must be rejected. The limit must be checked only between merge groups after a group has been fully flushed—never leave a partially rewritten overlap group—so a single merge group may decompress more batches than the limit when those batches belong to one overlapping set. Expose the same limit on the compaction policy API/config and pass it through when the policy compacts each chunk. Cover limited vs unlimited compact_chunk behavior (including multi-group progress across calls) and policy validation/config wiring with regression tests.
Interface contract — the change must expose exactly this surface:
_timescaledb_functions.compact_chunk(uncompressed_chunk regclass, max_batches integer DEFAULT 0); add_compaction_policy(..., max_batches integer = NULL, ...) persisting config key "max_batches" when > 0; policy_compaction_check rejects max_batches < 0.
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_timescaledb_c9b1d8e68a27e`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.