Dashboard › cli › Distillation
219c9524-c01e-4312-8cab-e94d0af16188["lore_tm_v1_a9FQlXSEVe7Om4EujwTnnyxoaDfX2DNpnGHKzqCpg4Y","lore_tm_v1_PvpqIhAFeOVedqKjSb3nyJKZdmmNwki4IB4k1bsRsV4","lore_tm_v1_0A06hJAcpT45LJBfpJ0HAOE8GZnWdRMnqNXuE3A4tRk","lore_tm_v1_ZGHzIbTUWBnAG5iBpmK3uvLa40SLI-W1TpSWBKX77uE"]
DEFAULT_OUTCOMES = ["strong_outcome", "medium_outcome"] and RISK_LABELS: low β { name: "risk: low", color: "0E8A16", description: "PR risk score: low" }; medium β { name: "risk: medium", color: "FBCA04", description: "PR risk score: medium" }; high β { name: "risk: high", color: "D93F0B", description: "PR risk score: high" }.argparse.ArgumentParser(prog="risk-pr", description="Offline PR risk dataset tooling") with required subcommands.build command requires repeatable --repo values in GitHub owner/name form, supports integer --max-prs, and accepts --git-repo.survey command estimates repository slice size before a large backfill; arguments are required --repo, optional --since and --until in YYYY-MM-DD, --months with default 12, optional local checkout --git-repo, and --git-ref defaulting to origin/master; it dispatches to cmd_survey.cmd_build() computes dates with parse_since(args.since, args.months) and parse_until(args.until), creates GitHubClient(sleep_seconds=args.sleep), and writes under <out>/raw and <out>/processed.cmd_build() maps local repositories using parse_git_repo_specs(args.git_repo or [], args.repo), backfills each parsed RepoRef, optionally calls collect_git_reverts_by_pr(git_path, args.git_ref, since=since, until=until), and adds manifest fields git_repo, git_ref, git_revert_target_prs, and git_revert_commits.processed_root / repo.path_slug, cmd_build() scores them with outcomes from args.outcome or DEFAULT_OUTCOMES and honors args.include_unmerged.cmd_score_pr() requires --repo when GITHUB_REPOSITORY is unset, parses it with RepoRef.parse(), and invokes score_pull_request() with pr_number, history_paths, model_path, skip_reviews, git_repo, and git_ref.args.label_pr is enabled, cmd_score_pr() calls apply_pr_risk_label(repo, args.pr, result, label_prefix=args.label_prefix); on GitHubError, it stores result["github_label_error"], prints warning: failed to apply PR risk label: {exc} to stderr, continues writing outputs, and re-raises the label error afterward.cmd_score_pr() optionally writes JSON to args.out; writes result["markdown_summary"] to args.summary_file, otherwise to GITHUB_STEP_SUMMARY when set; then calls write_github_outputs(result), prints the Markdown summary, and finally raises any deferred labeling error.score_pull_request() defaults to a new GitHubClient(), obtains the current row via fetch_pr_row(client, repo, pr_number, utc_now_iso(), skip_reviews=skip_reviews), and marks it with current_row["data_source"] = "github_api".> Experimental advisory signal only. This workflow should not block merges yet.packages/cli/src/lib/introspect.ts: CommandInfo contains fullDescription?: string and examples: string[]; command metadata supports __examples?: readonly CommandExample[]; and buildCommandInfo() prefers mapped cmd.__examples when present, otherwise falling back to supplied documentation examples.packages/cli/src/lib/command.ts defines canonical examples?: readonly CommandExample[], renders examples into fullDescription, and stores them in metadata.__examples; command-owned examples are prepared before schema enrichment.packages/cli/src/lib/help.ts exposes printCustomHelp(), formatHelpHuman(), and uses resolveCommandPath(); comments state formatHelpHuman() renders the branded banner for human output.printCustomHelp()βs sixel probe or terminal I/O; this behavior is associated with formatHelpHuman() and the --json path.packages/cli/src/commands/help.ts wires formatHelpHuman as the human formatter and documents that --json does not invoke the human-only path.packages/cli/src/app.ts builds the application with buildApplication(routes, ...), name sentry, version CLI_VERSION, determineExitCode: getExitCode, and localization loadText: () => customText.packages/cli/src/app.ts uses caseStyle: "allow-kebab-for-camel", allowArgumentEscapeSequence: true, and topLevelFlags: buildTopLevelFlags().allowArgumentEscapeSequence: true permits -- to stop flag parsing so wrapper commands such as sentry monitor run <slug> -- <command> can forward flags like -e and --verbose unambiguously.topLevelFlags: buildTopLevelFlags() recognizes global flags before subcommands at any route depth, such as sentry --verbose issue list, and forwards them to the leaf command through the patched @stricli/core route scanner; it is derived from GLOBAL_FLAGS.packages/cli/src/app.ts configures documentation.renderHelp: ({ prefix, unprocessedInputs }) => renderJsonHelp(prefix, unprocessedInputs), using the patched Stricli renderer to make --help --json produce structured JSON through the same introspection path as sentry help --json.renderHelp returns undefined for non-JSON help so Stricliβs built-in text output remains unchanged; this replaces the former argv rewrite from --help --json to the help command.${prefix} ${exc.format()} for formatted exceptions, Unexpected error: ${exc.stack ?? exc.message} for Error instances, and Unexpected error: ${stringifyUnknown(exc)} for other values; prefix is colored only when ansiColor is enabled.