Skip to content
Open
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
18 changes: 18 additions & 0 deletions src/applypilot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,30 @@ def run(
"lenient: banned words ignored, LLM judge skipped (fastest, fewest API calls)."
),
),
url: Optional[str] = typer.Option(
None, "--url",
help="Inject a specific job URL and run enrich -> score -> tailor -> cover -> pdf on it (skips discover).",
),
) -> None:
"""Run pipeline stages: discover, enrich, score, tailor, cover, pdf."""
_bootstrap()

from applypilot.pipeline import run_pipeline

# --url: inject the job into the DB and skip discover
if url:
from applypilot.database import get_connection, store_jobs
conn = get_connection()
new, dup = store_jobs(conn, [{"url": url}], site="manual", strategy="manual")
if new:
console.print(f"[green]Added job URL to pipeline:[/green] {url}")
else:
console.print(f"[yellow]Job URL already in database:[/yellow] {url}")
if not stages:
stages = ["enrich", "score", "tailor", "cover", "pdf"]
else:
stages = [s for s in stages if s != "discover"]

stage_list = stages if stages else ["all"]

# Validate stage names
Expand Down
5 changes: 4 additions & 1 deletion src/applypilot/scoring/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ def validate_json_fields(data: dict, profile: dict, mode: str = "normal") -> dic

if isinstance(data["experience"], list):
for company in preserved_companies:
# The LLM may place the company in either the header ("Title at
# Company") or the subtitle ("Company | Dates"), so check both.
has_company = any(
company.lower() in str(e.get("header", "")).lower()
company.lower()
in f"{e.get('header', '')} {e.get('subtitle', '')}".lower()
for e in data["experience"]
)
if not has_company:
Expand Down