Skip to content

feat: make PDF auto-generation configurable via auto_pdf_score_threshold#28

Open
ageem23 wants to merge 2 commits into
upstream-baselinefrom
feature/configurable-pdf-gate
Open

feat: make PDF auto-generation configurable via auto_pdf_score_threshold#28
ageem23 wants to merge 2 commits into
upstream-baselinefrom
feature/configurable-pdf-gate

Conversation

@ageem23
Copy link
Copy Markdown
Owner

@ageem23 ageem23 commented May 20, 2026

What

Makes auto-PDF generation configurable via a single auto_pdf_score_threshold
key in config/profile.yml, read by both evaluation paths.

Addresses santifer#714.

Why

The two evaluation paths disagreed on when to auto-generate a tailored CV PDF,
and neither value was configurable:

Path File PDF gate (before)
A — interactive pipeline modes/pipeline.md score >= 3.0, hardcoded
B — batch worker batch/batch-prompt.md none — generated for every offer

So the same offer behaved differently depending on which path processed it, and
tuning the behavior meant editing system-layer mode files.

Change

  • Both paths now generate a PDF only when score >= auto_pdf_score_threshold.
  • Key absent → defaults to 5.1 (effectively disabled; max score is 5.0).
    Reports are always written; PDFs become opt-in / on-demand via
    /career-ops pdf {company-slug}.
  • When a PDF is skipped, the report header says so explicitly and the tracker
    line / output JSON reflect that no PDF was generated.

Files

  • modes/pipeline.md — replace hardcoded 3.0.
  • batch/batch-prompt.md — add the gate to Paso 4 + the **PDF:** header.
  • config/profile.example.yml — document the new key.

Testing

  • node test-all.mjs → 67 passed, 0 failed (1 expected warning:
    cv-sync-check.mjs without user data).

Notes

This PR is based on upstream-baseline (a snapshot of santifer/career-ops:main)
so the diff is the isolated PDF-gate change only — intended for CodeRabbit + CI
review before it goes upstream against santifer#714.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • PDF generation is now conditional and configurable by score threshold, with auto-generation disabled by default.
  • Documentation

    • Updated guides for configuring PDF generation settings and enabling automatic PDF generation.

Review Change Stack

The two evaluation paths disagree on when to auto-generate a tailored CV
PDF, and neither value is configurable:

- Path A (modes/pipeline.md) hardcodes a PDF gate at score >= 3.0.
- Path B (batch/batch-prompt.md) has no score gate at all — Paso 4 runs
  for every evaluated offer and the report header hardcodes a PDF path.

The same offer therefore behaves differently depending on which path
processed it, and there is no single place to tune the behavior.

This introduces a single config key, auto_pdf_score_threshold in
config/profile.yml, that both paths read:

- A PDF is auto-generated only when score >= auto_pdf_score_threshold.
- When the key is absent it defaults to 5.1 — effectively disabled, since
  the max possible score is 5.0. Reports are always written; PDFs become
  an opt-in / on-demand action via /career-ops pdf {company-slug}.
- When a PDF is skipped, the report header says so explicitly and the
  tracker line / output JSON reflect pdf as not generated.

Removes the hardcoded 3.0, gives the batch path a gate it lacked, and
makes both paths consistent and user-tunable.

Addresses santifer#714.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@ageem23 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 41 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8ee09648-68f3-449a-a306-beed5a57e33d

📥 Commits

Reviewing files that changed from the base of the PR and between b55a15a and 6eb45d2.

📒 Files selected for processing (3)
  • batch/batch-prompt.md
  • config/profile.example.yml
  • modes/pipeline.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/configurable-pdf-gate

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.

❤️ Share

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

@github-actions
Copy link
Copy Markdown

Welcome to career-ops, @ageem23! Thanks for your first PR.

A few things to know:

  • Tests will run automatically — check the status below
  • Make sure you've linked a related issue (required for features)
  • Read CONTRIBUTING.md if you haven't

We'll review your PR soon. Join our Discord if you have questions.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@batch/batch-prompt.md`:
- Line 270: The ordered-list prefix in the markdown uses "15." instead of the
expected "2." and triggers markdownlint MD029; locate the list items referencing
"Paso 5" (with `pdf_emoji` = `✅`) and "Paso 6" (setting `"pdf"` to the output
path) and change the numeric prefix from 15. to the correct ordered number
(e.g., 2.) or normalize the entire ordered list to use consistent numbering (or
all "1." implicit numbering) so the sequence is valid and the markdownlint MD029
warning is resolved.
- Line 203: The report header currently references the non-canonical path
"career-ops/output/cv-candidate-{company-slug}-{{DATE}}.pdf" which mismatches
the actual generation location used by the PDF generation command; update the
header to use the canonical "output/cv-candidate-{company-slug}-{{DATE}}.pdf"
path (matching the generation command and the guideline that output files go in
output/) so consumers can find the generated file; verify the text surrounding
the "PDF:" entry and the generation command "/career-ops pdf {company-slug}"
remain consistent.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 24ff4591-8970-4cb8-bb64-d98877a8f33c

📥 Commits

Reviewing files that changed from the base of the PR and between 82f0c2e and b55a15a.

📒 Files selected for processing (3)
  • batch/batch-prompt.md
  • config/profile.example.yml
  • modes/pipeline.md

Comment thread batch/batch-prompt.md Outdated
Comment thread batch/batch-prompt.md Outdated
…back

Change the default (key absent) from 5.1 to 3.0. 3.0 was the original
hardcoded gate in modes/pipeline.md, so an unconfigured install keeps the
interactive pipeline's prior behavior, and the batch path now matches it
instead of generating a PDF for every offer.

Also address CodeRabbit review on PR #28:
- batch-prompt.md: use the canonical `output/...` path in the report
  header (was `career-ops/output/...`, which mismatched the
  generate-pdf.mjs command).
- batch-prompt.md: convert the trailing post-generation instruction from
  an ordered-list item (`15.`) to a plain paragraph so it no longer trips
  markdownlint MD029.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ageem23
Copy link
Copy Markdown
Owner Author

ageem23 commented May 20, 2026

Pushed 6eb45d2 — addresses both CodeRabbit comments plus a default-value change.

CodeRabbit feedback

  • Canonical PDF path (batch-prompt.md report header): changed career-ops/output/...output/... to match the generate-pdf.mjs command and the "output files go in output/" guideline. ✅
  • MD029 ordered-list prefix: the 15. item sat after a fenced code block, which breaks the ordered list so markdownlint restarts numbering. Rather than renumber to 2. (which would leave 14. immediately followed by 2. — worse for a human reader), I converted the trailing post-generation instruction to a plain paragraph: no list prefix, no MD029. ✅

Default threshold: 5.1 → 3.0

The default when auto_pdf_score_threshold is absent is now 3.0 — the value modes/pipeline.md hardcoded before this PR. So an unconfigured install keeps the interactive pipeline's prior behavior, and the batch path now matches it instead of generating a PDF for every offer. Raise to 4.0+ to pre-generate fewer PDFs, or set 0 to generate one for every offer.

@ageem23
Copy link
Copy Markdown
Owner Author

ageem23 commented May 20, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant