Skip to content

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

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

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

Conversation

@nish3451

@nish3451 nish3451 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

What

The four recording exporters (prospect:queue, prospect:cockpit, prospect:teleprompter, prospect:rehearsal) 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 from the cockpit exporter).

Files changed

  • scripts/export-recording-queue.mjs
  • scripts/export-recording-cockpit.mjs
  • scripts/export-recording-teleprompter.mjs
  • scripts/export-recording-rehearsal-check.mjs
  • scripts/test-active-operator-surfaces.mjs — adds a --help surface for all four exporters: exit 0, usage printed, and the default artifacts are left untouched (sentinel no-overwrite check).

Validation

  • node scripts/<exporter> --help and -h exit 0, print Usage:, and create no prospects/ artifacts (verified live in a checkout with no prospects/ dir).
  • node scripts/test-active-operator-surfaces.mjs passes (covers both the new --help surface and the normal regeneration path through prepare-recording-batch).
  • Full npm test passes (exit 0, no failures).

Summary by CodeRabbit

  • New Features

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

    • Added integration checks confirming help output, successful exits, and preservation of existing recording artifacts.

…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 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

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

Changes

Recording exporter help

Layer / File(s) Summary
Add exporter help handling
scripts/export-recording-*.mjs
The cockpit, queue, rehearsal-check, and teleprompter exporters print usage details for --help and -h, then exit before generating output.
Validate help surfaces
scripts/test-active-operator-surfaces.mjs
Integration checks verify successful exits, usage text, 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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 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

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

@nish3451

nish3451 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Note: the repo-checks failure is a pre-existing GitHub Actions account billing issue ("The job was not started because recent account payments have failed or your spending limit needs to be increased"). It affects every branch — e.g. fix/homepage-managed-service-heading-hierarchy (run 31321194024) and fix/operator-copy-offername-article (run 31321669990) failed the same way before this branch existed. Last successful run was chore/refresh-msp-aware-market-benchmark (31319833388). Local validation for this PR is green: npm test exit 0, node scripts/test-active-operator-surfaces.mjs passes.

@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-108: Expand the help checks in the recordingHelpSurface loop
to invoke each exporter with both --help and -h, asserting successful exit and
usage output for each alias. Add assertions for the exporter-specific options,
including --html for rehearsal, so the integration test validates the complete
advertised help surface rather than only Usage:.
🪄 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: 0971d036-98e7-466b-8a9f-1b82ddcddd34

📥 Commits

Reviewing files that changed from the base of the PR and between e0769ca and a87bb8b.

📒 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 +108
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`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Exercise both help aliases in this integration check.

The test invokes only --help, so the -h branch can regress without failing this check. Run each exporter with both aliases. Also assert the exporter-specific options, including --html for rehearsal, instead of checking only the Usage: prefix.

Proposed test matrix
 	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) {
+		for (const helpArg of ["--help", "-h"]) {
+			for (const path of artifactPaths) writeFileSync(join(T, path), "help sentinel\n")
+			const helped = run([`scripts/${name}`, helpArg])
+			eq(helped.status, 0, `${name} ${helpArg} must exit 0: ${helped.stderr || helped.stdout}`)
+			mat(helped.stdout, /Usage:/, `${name} ${helpArg} 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))
+			}
 		}
 	}
🤖 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 - 108, Expand the
help checks in the recordingHelpSurface loop to invoke each exporter with both
--help and -h, asserting successful exit and usage output for each alias. Add
assertions for the exporter-specific options, including --html for rehearsal, so
the integration test validates the complete advertised help surface rather than
only Usage:.

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

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

Copy link
Copy Markdown
Collaborator Author

Superseded by #56, which covers the four export-recording-*.mjs scripts along with the other 25 exporters using the shared operator-cli.mjs 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