Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/export-recording-cockpit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import { sendChannelGuidance } from "./lib/send-channel-guidance.mjs";
import { routedContactPlan } from "./lib/contact-route.mjs";
import { listOutboundProspectFolders } from "./lib/outbound-prospects.mjs";

if (process.argv.includes("--help") || process.argv.includes("-h")) {
console.log("Usage: npm run prospect:cockpit -- [--limit=5] [--output=prospects/recording-cockpit.html]");
process.exit(0);
}

const limitArg = process.argv.find((arg) => arg.startsWith("--limit="));
const limit = limitArg ? Number(limitArg.split("=")[1]) : 5;
const outputArg = process.argv.find((arg) => arg.startsWith("--output="));
Expand Down
5 changes: 5 additions & 0 deletions scripts/export-recording-queue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { join } from "node:path";
import { listOutboundProspectFolders } from "./lib/outbound-prospects.mjs";
import { checkProspectReadiness, prospectWarningWeight } from "./lib/prospect-readiness.mjs";

if (process.argv.includes("--help") || process.argv.includes("-h")) {
console.log("Usage: npm run prospect:queue -- [--limit=5] [--output=prospects/recording-queue.md]");
process.exit(0);
}

const limitArg = process.argv.find((arg) => arg.startsWith("--limit="));
const limit = limitArg ? Number(limitArg.split("=")[1]) : 5;
const outputArg = process.argv.find((arg) => arg.startsWith("--output="));
Expand Down
4 changes: 4 additions & 0 deletions scripts/export-recording-rehearsal-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { localIsoDate } from "./date-utils.mjs";
import { listOutboundProspectFolders } from "./lib/outbound-prospects.mjs";

const args = process.argv.slice(2);
if (args.includes("--help") || args.includes("-h")) {
console.log("Usage: npm run prospect:rehearsal -- [--limit=5] [--output=prospects/recording-rehearsal-check.md] [--html=prospects/recording-rehearsal-check.html]");
process.exit(0);
}
const limitArg = args.find((arg) => arg.startsWith("--limit="));
const outputArg = args.find((arg) => arg.startsWith("--output="));
const htmlArg = args.find((arg) => arg.startsWith("--html="));
Expand Down
5 changes: 5 additions & 0 deletions scripts/export-recording-teleprompter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { sendChannelGuidance } from "./lib/send-channel-guidance.mjs";
import { routedContactPlan } from "./lib/contact-route.mjs";
import { listOutboundProspectFolders } from "./lib/outbound-prospects.mjs";

if (process.argv.includes("--help") || process.argv.includes("-h")) {
console.log("Usage: npm run prospect:teleprompter -- [--limit=5] [--output=prospects/recording-teleprompter.html]");
process.exit(0);
}

const limitArg = process.argv.find((arg) => arg.startsWith("--limit="));
const limit = limitArg ? Number(limitArg.split("=")[1]) : 5;
const outputArg = process.argv.find((arg) => arg.startsWith("--output="));
Expand Down
19 changes: 19 additions & 0 deletions scripts/test-active-operator-surfaces.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ try {
}
for (const path of privateRuntimeArtifacts) eq(existsSync(join(T, path)), true, `Private runtime artifact is missing: ${path}`)

// Recording exporters must honor --help/-h before doing any work: print
// usage, exit 0, and never write or overwrite a recording artifact.
const recordingHelpSurface = [
["export-recording-queue.mjs", ["prospects/recording-queue.md"]],
["export-recording-cockpit.mjs", ["prospects/recording-cockpit.html"]],
["export-recording-teleprompter.mjs", ["prospects/recording-teleprompter.html"]],
["export-recording-rehearsal-check.mjs", ["prospects/recording-rehearsal-check.md", "prospects/recording-rehearsal-check.html"]]
]
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`)
Comment on lines +104 to +108

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

for (const path of artifactPaths) {
deq(readFileSync(join(T, path), "utf8"), "help sentinel\n", `${name} --help must not overwrite ${path}`)
unlinkSync(join(T, path))
}
}

const application = JSON.parse(readFileSync(join(T, "contracts/fixtures/sprint-application.v1.json"), "utf8"))
const importResult = run(["scripts/import-sprint-application.mjs", "contracts/fixtures/sprint-application.v1.json"])
eq(importResult.status, 0)
Expand Down