Repository navigation
refactor(cli): absorb correlate command into read --view correlation (#1842) - #1894
Conversation
…1842) Problem: the standalone `correlate` command (session→git/GitHub correlation: commits in the session window, issue/PR refs, optional GitHub-API enrichment and OTLP span evidence) is a session-seeded explainable report that the #1842 floor folds into `read --view <view>`, like neighbors. What changed: - Convert correlate_command's body into run_correlation_view(env, *, session_id, repo_path, since_hours, output_format, confidence_threshold, github_api, otlp); all logic helpers (GitHub enrichment, OTLP, pretty-print) kept in correlate.py. Dropped a dead `_parse_git_log` helper (the live parser is _parse_git_log_blocks in insights/session_commit.py) and the now-unused click import. - Add `correlation` to read's _READ_VIEWS plus --repo-path/--since-hours/ --confidence-threshold/--github-api/--otlp options and a dispatch branch that resolves the seed from --id/id:/--latest. - Delete the correlate command registrations (command_registration short-help + ROOT_COMMANDS, commands discovery map, output_assurance entry). - MCP correlate_session(s) tools and the insights.session_commit logic unchanged. - Add tests/unit/cli/test_correlate_view.py (json payload, missing-session exit, plain render) — the command previously had no dedicated CLI test. Removed the command from the click-app / json-output enumeration suites. Verification: devtools verify --quick → exit 0; devtools test over test_correlate_view + test_click_app + test_json_output → 127 passed. Baselines/snapshots/topology/cli-reference regenerated. Ref #1842 Co-Authored-By: Claude <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe Changescorrelate → read --view correlation migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e383f55d6a
ℹ️ 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".
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".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Folds the standalone
correlatecommand intoread --view correlation, continuing the #1842 CLI floor. MCPcorrelate_session(s)tools and the correlation logic are untouched — no capability lost.Problem
correlate <session>is a session-seeded explainable report: git commits within the session's time window (by explicit ref / file-overlap / time), issue & PR references, optional GitHub-API enrichment, and optional OTLP span evidence. That is structurally aread --view(likeneighbors/context), not a top-level command — the #1842 floor isfind QUERY then read|mark|analyze|delete.Solution
polylogue/cli/commands/correlate.py: convertcorrelate_commandintorun_correlation_view(env, *, session_id, repo_path, since_hours, output_format, confidence_threshold, github_api, otlp); all logic helpers (GitHub enrichment, OTLP evidence, pretty-print) retained. Removed a dead_parse_git_loghelper (the live parser is_parse_git_log_blocksininsights/session_commit.py) and the now-unusedclickimport.polylogue/cli/query_verbs.py: addcorrelationto_READ_VIEWS, the five correlation options (--repo-path,--since-hours,--confidence-threshold,--github-api/--no-github-api,--otlp), and a dispatch branch resolving the seed from--id/id:/--latest.correlatecommand registrations (short-help +ROOT_COMMANDS,commandsdiscovery map,output_assuranceentry).correlate_session(s)tools andinsights.session_commitlogic.tests/unit/cli/test_correlate_view.py(JSON payload, missing-session exit, plain render) — the command had no dedicated CLI test before. Removed the command from the click-app / json-output enumeration suites.Verification
Baselines (help-main/help-read; help-correlate deleted), syrupy snapshots, topology projection, and cli-reference regenerated.
Ref #1842
Summary by CodeRabbit
New Features
readcommand via the new--view correlationoption for unified access to correlation functionality.--repo-path,--since-hours,--confidence-threshold,--github-api/--no-github-api, and--otlpfor customized analysis and enrichment.Changes
correlatecommand has been retired.