Repository navigation
Prove the root query surface on selections that return rows - #5170
Conversation
`scripts/golden_find_bytes.py` replays every documented `polylogue find` invocation and is the right acceptance evidence for "the documented surface did not change". On its own it is weaker than it looks: on the seeded `cli-mixed` corpus the documented aggregate examples (`analyze count`, `analyze by ...`) and the `id:`-scoped examples all match nothing, so a change can pass 37/37 without one aggregate row, ranked hit, page boundary or attached-unit projection ever being rendered. Measured, not asserted: zeroing `total` on every list page leaves all 37 documented goldens byte-identical, and is caught by 2 of the 22 cases here. `scripts/golden_nonempty_bytes.py` is the companion, built for the CLI unification migration (S4/S6/S7) and committed so S5 and S8-S12 can re-run the same evidence. Its cases are hand-picked rather than extracted, because the documentation does not contain them -- that absence is the gap. Each names one thing the documented set leaves unproven: list pages in all five output formats, `--limit`/`--offset` boundaries, `--fields` projection, aggregates with rows in them, ranked search in three formats, a narrowing `--origin`, `--sort`/`--reverse`, a `messages where` unit query, `--sample`, and the `with messages` attached-unit fold. 17 of the 22 return rows. It reuses the documented harness's seeded workload, frozen clock and runner, so the two are one pair. `--compare` exits nonzero when any case changed and normalizes the three authority fields (`run_id`, `generation_id`, `archive_epoch`) that vary per run on an unmodified checkout. TESTING.md now points at both. Neither was referenced in any document before, which is why the companion was re-derived by hand rather than re-run. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedNext included review available in 52 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Commits the non-empty golden harness I built for the CLI unification migration and cited as evidence in #5156, #5157 and #5158, so the next steps can re-run it instead of re-deriving it. Adds a
TESTING.mdpointer to both harnesses.What gap this closes
scripts/golden_find_bytes.pyreplays every documentedpolylogue findinvocation indocs/cli-reference.md. That is the right acceptance evidence for "the documented surface did not change", and it is weaker than it looks on its own.On the seeded
cli-mixedcorpus, the documented examples that exercise the interesting code paths land on empty selections. The aggregate examples (analyze count,analyze by ...) and theid:-scoped examples all match nothing. A change can therefore pass 37/37 documented goldens without a single aggregate row, ranked hit, page boundary or attached-unit projection ever being rendered — so aggregates, projections,--sampleand--latestneed non-empty coverage before the documented set proves anything about them.That is not a hypothesis. Measured on this branch, by perturbing the list envelope to report
"total": 0on every page:golden_find_bytes.py(documented)golden_nonempty_bytes.py(this PR)A regression that zeroes the total on every list page is completely invisible to the documented set.
Solution
scripts/golden_nonempty_bytes.py, a companion built on the same machinery — same immutable seeded workload, same frozen clock, same in-processRunner, same recorded shape (exit code + exact stdout/stderr bytes). The two are one pair.Its 22 cases are hand-picked, not extracted, and that is the point: the documentation does not contain invocations that return rows, which is the gap itself. Each case names one thing the documented set leaves unproven:
markdown/json/ndjson/csv/yaml) — the row renderer's per-format branches--limitand--limit+--offset— page boundary,total,next_offset--fields— row projectionanalyze count,analyze by origin,analyze by day— aggregate envelopes with rows in them, text and JSON--origin— a filter that actually narrows--sort/--sort --reverse— orderingmessages where role:assistant— the unit-row renderer--sample— the sampling windowwith messages— the attached-unit projection fold17 of the 22 return rows; the rest exercise formats or filters that legitimately come back empty and still pin their bytes.
The
CASEStuple is documented as append-only where possible: removing a case removes coverage, and the keys are the comparison identity.Usage
Deliberately the same shape as S3's harness, so a migration step runs both:
uv run python scripts/golden_find_bytes.py BEFORE.json uv run python scripts/golden_nonempty_bytes.py BEFORE-NONEMPTY.json # ... make the change ... uv run python scripts/golden_find_bytes.py AFTER.json uv run python scripts/golden_nonempty_bytes.py AFTER-NONEMPTY.json --compare BEFORE-NONEMPTY.json--compareis the one thing the documented harness does not provide, and it exists because I needed it three times: it exits nonzero when any case changed and normalizes the three authority fields that vary per run on an unmodified checkout —run_id(a fresh UUID),generation_id(carries the archive clone's inode) andarchive_epoch(derived from it). Everything else is compared byte-for-byte. Without that normalization one case (find messages where role:assistant --format json) reports a false difference on every run.Verification
Anti-vacuity, run as described above: with
"total": 0forced into the list envelope,--comparereports22 compared, 2 differingand exits 1, while the documented harness reports 0 differing across all 37. The perturbation was reverted and the clean compare re-confirmed atexit=0before committing.No product code is touched: the diff is one new script plus a
TESTING.mdsection. Nothing from #5156/#5157/#5158 is folded in — this branch is cut frommasterat890a2921e.Note on discoverability
Neither harness was referenced in any tracked document before this PR. That is the actual reason the companion was re-derived by hand rather than re-run: there was nowhere to find it. The new
TESTING.mdsection documents both, states that the pair is not optional, and gives the"total": 0example as the concrete reason.Residuals
cli-mixedworkload. A workload change re-bases every golden; that is inherited from the documented harness and is why both record the workload name in their output.golden_find_bytes.pystill records only — it has no--compare, so its consumers diff by hand. I did not add one here to keep this PR to the gap the coordinator named; lifting--compareinto a shared helper is a reasonable follow-up.readviews,continueand the mutation ceremony have no golden-bytes coverage in either harness.🤖 Generated with Claude Code
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK