Skip to content

fix(ops): make recording exporters honor --help without writing artifacts - #52

Closed
nish3451 wants to merge 4 commits into
mainfrom
fix/recording-exporter-cli-help-lane1
Closed

fix(ops): make recording exporters honor --help without writing artifacts#52
nish3451 wants to merge 4 commits into
mainfrom
fix/recording-exporter-cli-help-lane1

Conversation

@nish3451

@nish3451 nish3451 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

What

The recording exporters (queue / cockpit / teleprompter / rehearsal-check) ignored --help / -h and generated their artifacts anyway, overwriting files like prospects/recording-cockpit.html.

Fix

Each of the four exporters now handles --help / -h before doing any work: it prints usage and exits 0 without writing or overwriting any recording artifact (and without spawning draft-prospect-message in the cockpit exporter).

  • scripts/export-recording-queue.mjs
  • scripts/export-recording-cockpit.mjs
  • scripts/export-recording-teleprompter.mjs
  • scripts/export-recording-rehearsal-check.mjs

Tests

Extends scripts/test-active-operator-surfaces.mjs with a --help surface for all four recording exporters: exit 0, usage printed, sentinel artifacts not overwritten.

  • node scripts/test-active-operator-surfaces.mjs passes
  • npm test passes (all suites, 0 failures)

Summary by CodeRabbit

  • New Features

    • Added --help and -h options to recording export commands.
    • Commands now display usage information and exit successfully without generating output.
  • Tests

    • Added checks confirming help output, successful command execution, and protection of existing recording files.

…acts

The recording queue, cockpit, teleprompter, and rehearsal-check exporters
ignored --help/-h and generated their artifacts anyway. Each now handles
--help/-h before doing any work: it prints usage and exits 0 without
writing or overwriting any recording artifact (and without spawning
draft-prospect-message in the cockpit exporter).

Extend test-active-operator-surfaces.mjs with a --help surface for all
four recording exporters (exit 0 + usage + no artifact overwrite).

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nish3451, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e803e3b3-3bfa-45b5-a0ff-7d036a7d84bc

📥 Commits

Reviewing files that changed from the base of the PR and between 68f1e74 and 5054203.

📒 Files selected for processing (1)
  • scripts/test-active-operator-surfaces.mjs
📝 Walkthrough

Walkthrough

The four recording exporters now support --help and -h. Integration checks validate usage output, successful exits, and preservation of existing artifacts.

Changes

Recording exporter help

Layer / File(s) Summary
CLI help handling and validation
scripts/export-recording-cockpit.mjs, scripts/export-recording-queue.mjs, scripts/export-recording-rehearsal-check.mjs, scripts/export-recording-teleprompter.mjs, scripts/test-active-operator-surfaces.mjs
The exporters print supported options and exit before normal processing when given a help flag. Integration checks validate the output, exit status, and preservation of existing recording artifacts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: recording exporters now honor --help without writing artifacts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/recording-exporter-cli-help-lane1

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/test-active-operator-surfaces.mjs`:
- Around line 104-112: Extend the recordingHelpSurface test loop to execute each
script with both --help and -h. Apply the existing exit-status, usage-output,
and artifact-preservation assertions independently for each flag, ensuring
sentinel files are recreated and cleaned up for every invocation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 84532485-3864-4c0a-ae50-07acd340d600

📥 Commits

Reviewing files that changed from the base of the PR and between ccbf68c and 68f1e74.

📒 Files selected for processing (5)
  • scripts/export-recording-cockpit.mjs
  • scripts/export-recording-queue.mjs
  • scripts/export-recording-rehearsal-check.mjs
  • scripts/export-recording-teleprompter.mjs
  • scripts/test-active-operator-surfaces.mjs

Comment on lines +104 to +112
for (const [name, artifactPaths] of recordingHelpSurface) {
for (const path of artifactPaths) writeFileSync(join(T, path), "help sentinel\n")
const helped = run([`scripts/${name}`, "--help"])
eq(helped.status, 0, `${name} --help must exit 0: ${helped.stderr || helped.stdout}`)
mat(helped.stdout, /Usage:/, `${name} --help must print usage`)
for (const path of artifactPaths) {
deq(readFileSync(join(T, path), "utf8"), "help sentinel\n", `${name} --help must not overwrite ${path}`)
unlinkSync(join(T, path))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover the -h path as well as --help.

This loop invokes each exporter only with --help. Run the same status, usage, and artifact-preservation assertions for both supported flags.

Suggested test adjustment
 for (const [name, artifactPaths] of recordingHelpSurface) {
-	for (const path of artifactPaths) writeFileSync(join(T, path), "help sentinel\n")
-	const helped = run([`scripts/${name}`, "--help"])
-	eq(helped.status, 0, `${name} --help must exit 0: ${helped.stderr || helped.stdout}`)
-	mat(helped.stdout, /Usage:/, `${name} --help must print usage`)
-	for (const path of artifactPaths) {
-		deq(readFileSync(join(T, path), "utf8"), "help sentinel\n", `${name} --help must not overwrite ${path}`)
-		unlinkSync(join(T, path))
+	for (const flag of ["--help", "-h"]) {
+		for (const path of artifactPaths) writeFileSync(join(T, path), "help sentinel\n")
+		const helped = run([`scripts/${name}`, flag])
+		eq(helped.status, 0, `${name} ${flag} must exit 0: ${helped.stderr || helped.stdout}`)
+		mat(helped.stdout, /Usage:/, `${name} ${flag} must print usage`)
+		for (const path of artifactPaths) {
+			deq(readFileSync(join(T, path), "utf8"), "help sentinel\n", `${name} ${flag} must not overwrite ${path}`)
+			unlinkSync(join(T, path))
+		}
 	}
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (const [name, artifactPaths] of recordingHelpSurface) {
for (const path of artifactPaths) writeFileSync(join(T, path), "help sentinel\n")
const helped = run([`scripts/${name}`, "--help"])
eq(helped.status, 0, `${name} --help must exit 0: ${helped.stderr || helped.stdout}`)
mat(helped.stdout, /Usage:/, `${name} --help must print usage`)
for (const path of artifactPaths) {
deq(readFileSync(join(T, path), "utf8"), "help sentinel\n", `${name} --help must not overwrite ${path}`)
unlinkSync(join(T, path))
}
for (const [name, artifactPaths] of recordingHelpSurface) {
for (const flag of ["--help", "-h"]) {
for (const path of artifactPaths) writeFileSync(join(T, path), "help sentinel\n")
const helped = run([`scripts/${name}`, flag])
eq(helped.status, 0, `${name} ${flag} must exit 0: ${helped.stderr || helped.stdout}`)
mat(helped.stdout, /Usage:/, `${name} ${flag} must print usage`)
for (const path of artifactPaths) {
deq(readFileSync(join(T, path), "utf8"), "help sentinel\n", `${name} ${flag} must not overwrite ${path}`)
unlinkSync(join(T, path))
}
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/test-active-operator-surfaces.mjs` around lines 104 - 112, Extend the
recordingHelpSurface test loop to execute each script with both --help and -h.
Apply the existing exit-status, usage-output, and artifact-preservation
assertions independently for each flag, ensuring sentinel files are recreated
and cleaned up for every invocation.

@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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

nish3451 added a commit that referenced this pull request Aug 11, 2026
The fleet keeps dispatching the same finding to multiple lanes, producing
duplicate same-fix PR pairs: #36/#44 and #55/#56 are byte-identical or
near-identical patches of the operator export --help fix, #39/#49 the
offername article fix, #40/#52 the recording exporter --help fix, plus
#38/#48/#51, #30/#61/#72, #45/#64, #42/#60, #43/#54 and #46/#74.

Add a PR Duplicate Guard:
- scripts/check-pr-duplicates.mjs compares a PR's diff against every other
  open PR (shared changed-file coverage >= 0.8 and patch similarity >= 0.5).
  Calibrated on all 79 open PRs on 2026-08-11: every pair above the
  thresholds was a genuine duplicate-cluster member, zero false positives.
- .github/workflows/pr-duplicate-guard.yml runs it on every PR event and
  posts one marker comment naming the duplicate(s) and the canonical PR; the
  check fails loudly when a duplicate is found. Informational, not required.
- scripts/test-pr-duplicates.mjs covers parsing, similarity, detection, and
  comment upsert with an injected API; wired into npm ci and npm test.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@nish3451

Copy link
Copy Markdown
Collaborator Author

Superseded by #56, which covers the four export-recording-*.mjs scripts plus the other 25 exporters via the shared helper. Closing in favour of #56.

@nish3451

Copy link
Copy Markdown
Collaborator Author

Correction to my closing comment above: the keeper for this cluster is #160, not #56.

I had wrongly concluded that main had no exporters wired for --help. In fact main already wires 18 of 29 exporters to scripts/lib/operator-cli.mjs; only 11 remain, and #160 covers exactly those 11 using main's current helper. #56 has since been closed because it would revert main's newer operator-cli.mjs and re-apply an older calling convention across 18 already-finished exporters.

This PR stays closed either way — its content is superseded by what is already on main plus #160 — but the pointer should be to #160.

nish3451 added a commit that referenced this pull request Aug 21, 2026
…main by PR #80 (duplicate guard) (#234)

The duplicate-PR guard (PR #80, merged 2026-08-19) is now live on main,
preventing the same-fix duplication pattern at the CI level. The named
duplicate pairs (#36/#44, #39/#49, #40/#52) are functionally superseded:
their underlying fixes are on main via PRs #135, #145, and #178. The
prior 2026-08-15 lane run had concluded the guard existed but was stuck
unmerged; on 2026-08-19 it landed and the item is resolved at the
root-cause level.

Verification-only run (no product or test files touched):
- PR #80 source commit 2091c7a and merge commit 0a9909b are ancestors of origin/main
- scripts/test-pr-duplicates.mjs → 'test-pr-duplicates: ok' (exit 0)
- Superseding PRs #135 (d4f3ef4), #145 (fc44b42), #178 (77f6922) all on main
- Guard workflow runs on pull_request events; not a required status, so existing work never blocks

Co-authored-by: minimax-vps <minimax-vps@nish3451.dev>
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