Repository navigation
fix(pipeline): invert embed dependency, pipeline imports substrate not cli - #461
Conversation
…t cli Closes #430. Move embedding execution and stats-payload helpers out of polylogue/cli/ and into a substrate module under polylogue/lib/embeddings/. The CLI modules become thin click-formatting wrappers; pipeline calls substrate directly without the _PlainUI/_EmbedEnv shim that proxied a fake CLI into pipeline. - polylogue/lib/embeddings/runtime.py: click-free embed_conversation_sync + iter_pending_conversations + EmbedConversationOutcome. - polylogue/lib/embeddings/stats.py: embedding_status_payload + payload type definitions (was already click-free, just moved). - polylogue/cli/embed_runtime.py / embed_stats.py: thin click wrappers that compose substrate output into the existing CLI surface. - polylogue/pipeline/run_stages.py: imports substrate; emits its own click.echo for the existing pipeline-stage user output. _PlainUI and _EmbedEnv shims removed. Verification: tests/unit/pipeline/test_no_cli_imports.py asserts no polylogue/pipeline/**/*.py imports from polylogue/cli/**. test_run_stages_runtime.py updated to patch substrate locations. devtools verify (full): all checks pass.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 48 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…462) ## Summary Closes #406. Stacked on #461. ## Problem The single-conversation ``export`` command silently ignored root-level ``--message-role`` and ``--dialogue-only`` flags. Users had to dump full JSON and post-filter in Python to extract user-only prose: polylogue --message-role user export <id> --format json # returns full message list, ignoring --message-role ## Solution Wires the flags through the same helper the verbs use: ``conversation.with_roles(roles)``. Honors ``--message-role`` (one or more roles); when ``--dialogue-only`` is set without an explicit role filter, defaults to user+assistant. ## Verification ``tests/unit/cli/test_export.py`` covers both paths against a synthetic conversation with mixed roles (user / assistant / system). ``devtools verify`` (full): all checks pass.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…t cli (#461) ## Summary Closes #430. Moves embedding execution and stats payload helpers out of ``polylogue/cli/`` and into a new substrate module under ``polylogue/lib/embeddings/``. The CLI modules become thin click-formatting wrappers; pipeline calls substrate directly without the ``_PlainUI`` / ``_EmbedEnv`` shims that proxied a fake CLI surface back into pipeline. ## Problem ``polylogue/pipeline/run_stages.py`` imported ``embed_batch`` / ``embed_single`` / ``show_embedding_stats`` from ``polylogue/cli/``, inverting the documented placement rule and creating a true substrate↔ surface cycle that ``devtools verify-cluster-cohesion`` flags. The imports were lazy (inside function bodies) so they didn't crash at module load, but they bound pipeline to a CLI shape and required pipeline to fabricate a fake UI object to satisfy the CLI's protocol. ## Solution - ``polylogue/lib/embeddings/runtime.py`` — click-free ``embed_conversation_sync`` + ``iter_pending_conversations`` + ``EmbedConversationOutcome``. - ``polylogue/lib/embeddings/stats.py`` — ``embedding_status_payload`` and payload type definitions (was already click-free; just moved). - ``polylogue/cli/embed_runtime.py`` / ``embed_stats.py`` — thin click wrappers composing substrate outcomes into the existing CLI surface; no behavior change to ``polylogue run embed`` output. - ``polylogue/pipeline/run_stages.py`` — imports substrate; emits its own ``click.echo`` for the pipeline-stage user output. ``_PlainUI`` and ``_EmbedEnv`` shims removed. ## Verification - ``tests/unit/pipeline/test_no_cli_imports.py`` (new) — regression guard asserting no ``polylogue/pipeline/**/*.py`` imports from ``polylogue/cli/**``. - ``tests/unit/pipeline/test_run_stages_runtime.py`` — updated to patch substrate locations rather than CLI re-exports. - ``devtools verify`` (full, including pytest): all checks pass. ## Acceptance criteria checklist - [x] No ``polylogue/pipeline/**/*.py`` imports from ``polylogue/cli/**``. - [x] Embedding behavior is callable from pipeline without going through ``cli``. - [x] Existing CLI behavior unchanged. - [ ] ``devtools verify-cluster-cohesion`` reports no ``cli ↔ pipeline`` cycle — will be exercised by the lint introduced in #429 / Phase 1 of #432.
…462) ## Summary Closes #406. Stacked on #461. ## Problem The single-conversation ``export`` command silently ignored root-level ``--message-role`` and ``--dialogue-only`` flags. Users had to dump full JSON and post-filter in Python to extract user-only prose: polylogue --message-role user export <id> --format json # returns full message list, ignoring --message-role ## Solution Wires the flags through the same helper the verbs use: ``conversation.with_roles(roles)``. Honors ``--message-role`` (one or more roles); when ``--dialogue-only`` is set without an explicit role filter, defaults to user+assistant. ## Verification ``tests/unit/cli/test_export.py`` covers both paths against a synthetic conversation with mixed roles (user / assistant / system). ``devtools verify`` (full): all checks pass.
Summary
Closes #430. Moves embedding execution and stats payload helpers out of
polylogue/cli/and into a new substrate module underpolylogue/lib/embeddings/. The CLI modules become thin click-formattingwrappers; pipeline calls substrate directly without the
_PlainUI/_EmbedEnvshims that proxied a fake CLI surface back into pipeline.Problem
polylogue/pipeline/run_stages.pyimportedembed_batch/embed_single/show_embedding_statsfrompolylogue/cli/,inverting the documented placement rule and creating a true substrate↔
surface cycle that
devtools verify-cluster-cohesionflags. Theimports were lazy (inside function bodies) so they didn't crash at module
load, but they bound pipeline to a CLI shape and required pipeline to
fabricate a fake UI object to satisfy the CLI's protocol.
Solution
polylogue/lib/embeddings/runtime.py— click-freeembed_conversation_sync+iter_pending_conversations+EmbedConversationOutcome.polylogue/lib/embeddings/stats.py—embedding_status_payloadand payload type definitions (was already click-free; just moved).
polylogue/cli/embed_runtime.py/embed_stats.py— thin clickwrappers composing substrate outcomes into the existing CLI surface;
no behavior change to
polylogue run embedoutput.polylogue/pipeline/run_stages.py— imports substrate; emits itsown
click.echofor the pipeline-stage user output._PlainUIand
_EmbedEnvshims removed.Verification
tests/unit/pipeline/test_no_cli_imports.py(new) — regressionguard asserting no
polylogue/pipeline/**/*.pyimports frompolylogue/cli/**.tests/unit/pipeline/test_run_stages_runtime.py— updated to patchsubstrate locations rather than CLI re-exports.
devtools verify(full, including pytest): all checks pass.Acceptance criteria checklist
polylogue/pipeline/**/*.pyimports frompolylogue/cli/**.cli.devtools verify-cluster-cohesionreports nocli ↔ pipelinecycle —will be exercised by the lint introduced in feat(devtools): make architectural cohesion executable #429 / Phase 1 of feat(devtools): evidence-driven structural specification — cross-cut manifest, witness, dashboard #432.