Skip to content

fix: Point the CLI binding registry at the row-render seam - #5174

Closed
Sinity wants to merge 1 commit into
masterfrom
fix/cli-render-seam-stale-refs
Closed

Sinity wants to merge 1 commit into
masterfrom
fix/cli-render-seam-stale-refs

Conversation

@Sinity

@Sinity Sinity commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

#5156 moved the CLI row renderers out of archive_query into cli/render/rows.py and made them public. Two sites kept naming the deleted private symbols. This clears 5 of the failures on master.

Evidence

Receipt .cache/verify/runs/20260914T233651Z-all-207009-89ddea6b (verify_all, job 1699, 22,540 selected, 29 failed).

Caveat on that receipt: its run.json records git_head: f7964acd12b25134c0e2e4cd8f73f9e6557a4a4f — the tip of branch rebase-5165, which is not master and not an ancestor of it — and final_git_head: 724d17535. The shared checkout advanced across 7 merged PRs during the 100-minute run, so that receipt is not evidence of a frozen tree. I re-ran all 29 node ids at true master HEAD (724d175): 17 reproduce, 12 do not. The 5 in this PR are among the 17.

Per-failure classification

Failure Classification Cause
test_cli_operation_binding_registry::test_each_binding_resolves_to_real_callables[cli.query] product defect CLI_OPERATION_BINDINGS names archive_query:_emit_daemon_list_payload / :_emit_daemon_search_payload; neither exists after #5156
…[query.units] product defect same, for archive_query:_emit_rows
test_archive_query::TestDaemonSearchEnvelopeHonestPagination::test_clamped_page_reports_the_next_offset stale test patch() dotted string still polylogue.cli.archive_query._emit_rows; #5156 retargeted the file's imports but a patch target is a string and is not checked at collection
…::test_final_page_reports_no_next_offset stale test same
…::test_limit_reports_what_the_daemon_applied stale test same

The registry test is doing exactly the job it was added for: it reported a real, unresolvable declaration rather than drifting quietly. Not weakened.

Solution

  • polylogue/cli/operation_bindings.py: point the cli.query and query.units renderers at polylogue.cli.render.rows:emit_session_list_page, :emit_session_search_page and :emit_rows. The canonical module is named rather than archive_query's re-export, so the binding does not go stale again when an import list is tidied.
  • tests/unit/cli/test_archive_query.py: patch polylogue.cli.render.rows.emit_rows, the module namespace emit_session_search_page actually calls through.

Anti-vacuity. The registry test goes red on any binding reference that does not resolve — reverting either renderer name reproduces it exactly. The three pagination tests keep the conditions stated in their own docstrings: hard-code next_offset to None, or echo the requested limit instead of the daemon's, and they go red. With the patch target wrong they were erroring before reaching any assertion, so they were vacuous until now.

Verification

devtools test tests/unit/cli/test_archive_query.py tests/unit/operations/test_cli_operation_binding_registry.py
devtools test: PASSED exit=0 diagnosis=pytest_passed receipt=.cache/verify/runs/20260915T013206Z-focused-test-311312-6ed000ce/run.json

Also resolved every entry in CLI_OPERATION_BINDINGS directly: 0 unresolvable references (was 3).

Schema closure

devtools schema closure polylogue/cli/operation_bindings.py
out  polylogue/cli/operation_bindings.py

OUT of the derived schema-identity closure. The test file is not a closure input. This PR does not need to land before an archive rebuild.

Residuals

  • archive_query still re-exports these renderers; the bindings no longer depend on that, but the re-export itself is untouched here.
  • The other 12 reproducing failures at HEAD are separate causes and are not addressed by this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Summary by CodeRabbit

  • Bug Fixes
    • Improved command-line query rendering for session lists, session searches, and unit results.
    • Corrected pagination handling to ensure results continue displaying properly across pages.
    • Standardized output behavior across supported query views.

#5156 moved the CLI row renderers out of `archive_query` into
`cli/render/rows.py` and made them public, but two sites kept naming the
deleted private symbols.

`CLI_OPERATION_BINDINGS` still declared
`polylogue.cli.archive_query:_emit_daemon_list_payload`,
`:_emit_daemon_search_payload` and `:_emit_rows`. None resolve, so the
`cli.query` and `query.units` declarations claimed a renderer that does not
exist — the registry's whole purpose is to make exactly that visible, and its
own test was reporting it. Name the canonical module rather than
`archive_query`'s re-export, so the binding does not go stale again the next
time the import list is tidied.

The pagination test patched the same dotted string. Its imports were already
retargeted to `render.rows`; only the `patch()` string, which is not checked
at collection time, was missed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-15T01:36:31.383216Z 03ac41c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a7531364-de95-4a43-9540-b3a0bd1d5492

📥 Commits

Reviewing files that changed from the base of the PR and between 724d175 and 03ac41c.

📒 Files selected for processing (2)
  • polylogue/cli/operation_bindings.py
  • tests/unit/cli/test_archive_query.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
🔇 Additional comments (2)
polylogue/cli/operation_bindings.py (1)

54-54: LGTM!

Also applies to: 60-61, 66-66

tests/unit/cli/test_archive_query.py (1)

1259-1259: LGTM!


📝 Walkthrough

Walkthrough

The CLI query bindings now resolve session list, session search, and row emitters from polylogue.cli.render.rows. The pagination test patches emit_rows at its new location.

Changes

CLI renderer binding

Layer / File(s) Summary
Renderer wiring and test alignment
polylogue/cli/operation_bindings.py, tests/unit/cli/test_archive_query.py
cli.query uses separate session-list and session-search emitters. query.units uses emit_rows. The pagination test patches emit_rows from polylogue.cli.render.rows.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 03ac4

The CLI renderer relocation is wired consistently, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: updating the CLI binding registry to use the row-render seam.
Description check ✅ Passed The description is detailed and relevant. It explains the problem, solution, verification results, affected tests, schema closure, and residual risks. It does not use every template heading, but it pr…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-render-seam-stale-refs

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.

❤️ Share

A rabbit checks the rows in line
Session lists now render fine
Search hops to its matching view
Unit rows follow the path anew
Tests patch the burrow too

Comment @coderabbitai help to get the list of available commands.

@Sinity

Sinity commented Sep 15, 2026

Copy link
Copy Markdown
Owner Author

Already fixed on master by #5173, which points the same three bindings at polylogue.cli.render.rows (as _RENDER_ROWS) rather than the moved archive_query internals. This PR makes the identical change under a different constant name (_ROWS), so it conflicts with no benefit.

Verified on current master (4105e36): every declared renderer reference resolves — unresolvable: none across all bindings.

Closing as redundant rather than merging a rename. If the binding-registry tests still fail after this, that is a separate cause worth its own diagnosis, since the references themselves are sound.

@Sinity Sinity closed this Sep 15, 2026
Sinity added a commit that referenced this pull request Sep 15, 2026
## Summary

Three pagination tests error before reaching any assertion because a
`patch()` target still names a symbol #5156 deleted. Replaces #5174,
which was closed after #5173 independently landed the product half of
the same fix.

## Evidence

Receipt `.cache/verify/runs/20260914T233651Z-all-207009-89ddea6b`
(`verify_all`, job 1699, 22,540 selected, 29 failed).

**Caveat on that receipt:** its `run.json` records `git_head:
f7964ac` — the tip of branch
`rebase-5165`, *not* `master` and not an ancestor of it — and
`final_git_head: 724d175`. The shared checkout advanced across 7
merged PRs during the run, so it is not evidence of a frozen tree. I
re-ran all 29 node ids at true `master` HEAD: 17 reproduce, 12 do not.
These 3 are among the 17, and still reproduce at `4105e3698`.

## Per-failure classification

| Failure | Classification | Cause |
| --- | --- | --- |
|
`test_archive_query::TestDaemonSearchEnvelopeHonestPagination::test_clamped_page_reports_the_next_offset`
| **stale test** | `patch("polylogue.cli.archive_query._emit_rows")` —
#5156 moved it to `cli/render/rows.py` as public `emit_rows` |
| `…::test_final_page_reports_no_next_offset` | **stale test** | same |
| `…::test_limit_reports_what_the_daemon_applied` | **stale test** |
same |

## Problem

#5156 moved the CLI row renderers out of `archive_query` into
`cli/render/rows.py` and made them public. This file's *imports* were
retargeted at the time; the `patch()` dotted string was not. A patch
target is a string, so nothing failed at collection — instead `mock`
raised `AttributeError` inside the context manager, before any assertion
ran.

`emit_session_search_page` calls `emit_rows` from its own module
namespace, so `polylogue.cli.render.rows.emit_rows` is the seam that
actually intercepts it.

#5173 fixed the other half of this same rename —
`CLI_OPERATION_BINDINGS` still naming
`archive_query:_emit_daemon_list_payload`,
`:_emit_daemon_search_payload` and `:_emit_rows`, none of which
resolved. I had that product fix in #5174; #5173 landed the identical
change first (as `_RENDER_ROWS`), so #5174 was closed as conflicting and
this PR carries only the remaining test half. After it, there is no
reference to `archive_query._emit_rows` left in the tree.

## Solution

One line: patch `polylogue.cli.render.rows.emit_rows`.

## Anti-vacuity

The three tests keep the conditions stated in their own docstrings —
hard-code `next_offset` to `None`, or echo the requested `limit` instead
of the one the daemon applied, and they go red. They could not go red
**for any reason** while the patch target was wrong, since they errored
before the assertions. That is what this restores, and it is why the fix
is worth making rather than deleting the tests: the behaviour they cover
(a daemon-proxied clamped page must not present itself as complete) is
not covered elsewhere — the golden-parity suite seeds a corpus smaller
than its own `--limit` and never reaches a clamped page, as the class
docstring notes.

## Verification

```
devtools test tests/unit/cli/test_archive_query.py tests/unit/operations/test_cli_operation_binding_registry.py
devtools test: PASSED exit=0 diagnosis=pytest_passed receipt=.cache/verify/runs/20260915T015359Z-focused-test-338452-90aec230/run.json
```

The binding registry file is included to confirm #5173's half and this
half agree at the current head.

## Schema closure

`tests/unit/cli/test_archive_query.py` — **out** of the derived
schema-identity closure. Test-only change; no product file touched. Does
not need to land before an archive rebuild.

## Residuals

None. This is the last stale reference to the pre-#5156 renderer names.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@Sinity
Sinity deleted the fix/cli-render-seam-stale-refs branch September 22, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant