feat: add predict and predictions CLI commands#22
Conversation
recoup predict --url <fileUrl> --modality <type> runs a neural engagement prediction. recoup predictions list/get manages history. Made-with: Cursor
|
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 28 minutes and 24 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
There was a problem hiding this comment.
3 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/predict.ts">
<violation number="1" location="src/commands/predict.ts:5">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**
Narrating JSDoc that restates the code. The first line duplicates the `.description()` string, and the rest summarizes the obvious `post()` call and `console.log` output. Remove it or replace with genuinely useful context (e.g., expected API error codes, rate-limit behavior).</violation>
</file>
<file name="src/commands/predictions.ts">
<violation number="1" location="src/commands/predictions.ts:60">
P2: The peak-moments and weak-spots rendering blocks are duplicated almost verbatim from `predict.ts`. If the API response shape changes (e.g., a renamed field), both files need identical edits. Consider extracting a small shared helper (e.g., `printMoments(label, items)`) to keep them in sync.</violation>
<violation number="2" location="src/commands/predictions.ts:86">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**
Remove this narrating JSDoc block — it restates what `.description()` and the subcommand definitions already express. No other command file in the project has such a comment, and Commander already exposes this information via `--help`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| import { post } from "../client.js"; | ||
| import { printJson, printError } from "../output.js"; | ||
|
|
||
| /** |
There was a problem hiding this comment.
P2: Custom agent: Flag AI Slop and Fabricated Changes
Narrating JSDoc that restates the code. The first line duplicates the .description() string, and the rest summarizes the obvious post() call and console.log output. Remove it or replace with genuinely useful context (e.g., expected API error codes, rate-limit behavior).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/predict.ts, line 5:
<comment>Narrating JSDoc that restates the code. The first line duplicates the `.description()` string, and the rest summarizes the obvious `post()` call and `console.log` output. Remove it or replace with genuinely useful context (e.g., expected API error codes, rate-limit behavior).</comment>
<file context>
@@ -0,0 +1,67 @@
+import { post } from "../client.js";
+import { printJson, printError } from "../output.js";
+
+/**
+ * `recoup predict` — run a neural engagement prediction on content.
+ *
</file context>
| } | ||
| }); | ||
|
|
||
| /** |
There was a problem hiding this comment.
P2: Custom agent: Flag AI Slop and Fabricated Changes
Remove this narrating JSDoc block — it restates what .description() and the subcommand definitions already express. No other command file in the project has such a comment, and Commander already exposes this information via --help.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/predictions.ts, line 86:
<comment>Remove this narrating JSDoc block — it restates what `.description()` and the subcommand definitions already express. No other command file in the project has such a comment, and Commander already exposes this information via `--help`.</comment>
<file context>
@@ -0,0 +1,96 @@
+ }
+ });
+
+/**
+ * `recoup predictions` — manage engagement prediction history.
+ *
</file context>
| console.log(` Created: ${data.created_at}`); | ||
| console.log(); | ||
|
|
||
| const peaks = data.peak_moments as |
There was a problem hiding this comment.
P2: The peak-moments and weak-spots rendering blocks are duplicated almost verbatim from predict.ts. If the API response shape changes (e.g., a renamed field), both files need identical edits. Consider extracting a small shared helper (e.g., printMoments(label, items)) to keep them in sync.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/predictions.ts, line 60:
<comment>The peak-moments and weak-spots rendering blocks are duplicated almost verbatim from `predict.ts`. If the API response shape changes (e.g., a renamed field), both files need identical edits. Consider extracting a small shared helper (e.g., `printMoments(label, items)`) to keep them in sync.</comment>
<file context>
@@ -0,0 +1,96 @@
+ console.log(` Created: ${data.created_at}`);
+ console.log();
+
+ const peaks = data.peak_moments as
+ | { time_seconds: number; score: number }[]
+ | undefined;
</file context>
Summary
recoup predict --url <fileUrl> --modality <type>— run an engagement predictionrecoup predictions list— list past predictions with scoresrecoup predictions get <id>— get full prediction detail--jsonflag for machine-readable outputTest plan
pnpm build)recoup predict --helpshows correct optionsrecoup predictions list --helpandrecoup predictions get --helpworkMade with Cursor
Summary by cubic
Add CLI support to run engagement predictions and browse history. Includes human-readable and JSON output for easy scripting.
recoup predict --url <fileUrl> --modality <video|audio|text> [--json]— runs a prediction and prints score, modality, duration, inference time, peaks, weak spots, and ID.recoup predictions list [--limit <n>] [--offset <n>] [--json]— lists past predictions with ID, modality, score, and created time.recoup predictions get <id> [--json]— shows full details for a prediction, including file URL, timing, peaks, and weak spots.Written for commit 27b960b. Summary will update on new commits.