Skip to content
Merged
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
41 changes: 37 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Copy to .env and fill in whichever provider you want to use.
#
# Personal local use: ./scripts/run_local.sh sets PERSONAL_MODE=1 (no
# sign-up/login/billing/quotas; you're the single local owner). An Anthropic
# key also unlocks Claude's server-side web search for live company / salary
# research and open-web job discovery.
# PERSONAL_MODE=1
# PERSONAL_OWNER_EMAIL=me@personal.local
# WEB_RESEARCH=1 # 0 = never use Claude web search
# ANTHROPIC_REFUSAL_FALLBACK=1 # server-side fallback model on refusals
# WEB_SEARCH_USD_PER_CALL=0.01 # cost ledger: $10 per 1,000 searches

# Auto-detection order: Anthropic -> OpenAI -> Featherless.
# Override with LLM_PROVIDER=anthropic|openai|featherless.

Expand All @@ -12,11 +23,22 @@
# Featherless (OpenAI-compatible, hosts Qwen / DeepSeek)
# FEATHERLESS_API_KEY=...

# Model tiers ("Fast" / "Detailed" in the UI). Defaults: Anthropic
# claude-haiku-5-5 / claude-opus-5-5; OpenAI gpt-5-mini / gpt-5.
# Sonnet 5.5 halves Detailed-tier cost vs Opus 5.5 ($2/$10 vs $4/$20 per 1M tokens):
# ANTHROPIC_FAST_MODEL=claude-haiku-5-5
# ANTHROPIC_DETAILED_MODEL=claude-sonnet-5-5
# OPENAI_FAST_MODEL=gpt-5-mini
# OPENAI_DETAILED_MODEL=gpt-5

# Tuning (optional)
# LLM_PROVIDER=anthropic
# LLM_TEMPERATURE=0.4
# LLM_MAX_TOKENS=2000
# LLM_MAX_RETRIES=3
# LLM_TEMPERATURE=0.4 # only sent to models that accept it
# LLM_MAX_TOKENS=16000 # thinking/reasoning tokens count toward this
# LLM_MAX_RETRIES=3 # transient errors only (timeouts, 429, 5xx)
# LLM_TIMEOUT_SECONDS=300
# ANTHROPIC_EFFORT=low # low|medium|high; unset = model default
# OPENAI_REASONING_EFFORT=low # minimal|low|medium|high (gpt-5 / o-series)

# Persistence
# DATABASE_URL=postgresql://user:pass@localhost:5432/joboffer
Expand All @@ -36,7 +58,8 @@
# BROWSERBASE_PROJECT_ID=... # both required; falls back to local
# # Playwright when BROWSER_SCRAPER_ENABLED=1

# Phase 4 — real salary benchmarks via Adzuna (free tier, ~1000 calls/month)
# Adzuna — real salary benchmarks AND a UK/EU job-discovery source
# (free tier, ~1000 calls/month)
# Sign up at https://developer.adzuna.com/
# ADZUNA_APP_ID=...
# ADZUNA_APP_KEY=...
Expand Down Expand Up @@ -125,6 +148,16 @@

# Telegram bot channel (alternative to the Streamlit UI)
# TELEGRAM_BOT_TOKEN=... # from @BotFather
# /analyze requires a chat linked to a web account (metered like the web UI).
# Private single-user bots can allow anonymous chats instead:
# TELEGRAM_ALLOW_UNLINKED_ANALYZE=1

# Operators allowed to run the System test tab (live integration probes).
# Unset: everyone when billing is off (self-hosted), nobody when it's on.
# ADMIN_EMAILS=you@example.com

# PDF export embeds the bundled DejaVu Unicode font from assets/fonts/.
# PDF_FONT_DIR=/path/to/dir/with/DejaVuSans.ttf+DejaVuSans-Bold.ttf

# Secrets at rest — envelope-encrypt the TOTP 2FA secret (and any future
# sensitive low-volume fields). Set to any string/passphrase; a Fernet key is
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ jobs:
with:
python-version: "3.12"
cache: pip
- name: Install deps + type stubs
# Type-check against the locked versions Replit installs (uv sync), not
# whatever pip resolves today: unpinned numpy 2.5 stubs use 3.12-only
# syntax that mypy rejects under python_version = 3.11, and drift like
# that should never be what turns the gate red.
- name: Lockfile matches pyproject
run: |
python -m pip install --upgrade pip
pip install -e ".[telegram,worker,dev]"
- run: mypy
python -m pip install --upgrade pip "uv>=0.5"
uv lock --check
- name: Install locked deps + type stubs
run: uv sync --frozen --python python3.12 --extra telegram --extra worker --extra dev
- run: .venv/bin/mypy

security:
name: bandit + pip-audit
Expand Down Expand Up @@ -170,6 +176,8 @@ jobs:
"webhooks", "webhook_deliveries", "oauth_identities",
"email_verification_tokens", "llm_usage",
"subscriptions", "usage_events", "waitlist_entries",
"candidate_profiles", "discovered_jobs", "master_cv_revisions",
"password_reset_tokens", "telegram_link_tokens",
}
missing = required - tables
assert not missing, f"missing tables after migrate: {missing}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ credentials.json
!tests/**/*token*
!services/**/*token*
!db/**/*token*
backups/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
40 changes: 36 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ Postgres); a `docker-compose.yml` runs the full multi-service stack.

```
app.py Streamlit web UI (single entry; all tabs + sidebar)
agents/ LangGraph pipeline: orchestrator + per-stage agents
orchestrator.py Checkpoint-aware graph: job -> (company || salary) -> resume? -> report
ui/ New UI modules split out of app.py (discover tab,
search-profile editor); app.py calls render_* funcs
agents/ Analysis pipeline: orchestrator + per-stage agents
orchestrator.py Checkpointed stage sequence: job -> (company || salary) -> resume? -> report
job_/company_/salary_/resume_analyzer.py, report_generator.py
tools/ LLM-facing tools + ingestion
job_tools, company_tools, salary_tools, resume_tools, data_sources,
url_ingest, browser_scraper (Playwright, optional), html_extract (shared),
company_research (agentic keyless DuckDuckGo + Browserbase fallback)
company_research (Claude web research; keyless DuckDuckGo fallback),
job_sources (discovery connectors: public ATS + job-board APIs only)
services/ Business logic (34 modules) — the bulk of the app
auth, totp, oauth, api_tokens, rate_limit, audit (identity/security)
applications, stages, analytics, timeline, background_analysis (tracking)
Expand Down Expand Up @@ -67,7 +70,7 @@ app.py / api/ / bot/ entry points (UI, REST, Telegram)
▼
db/ SQLAlchemy models + session

agents/ (LangGraph pipeline) ─┐
agents/ (analysis pipeline) ─┐
tools/ (LLM-facing tools) ├─▶ utils/ (LEAF — depends on nothing internal)
─┘
worker/ (Celery) consumes services; runs the same pipeline off-process.
Expand All @@ -93,6 +96,20 @@ worker/ (Celery) consumes services; runs the same pipeline off-process.
intentionally empty (no symbol re-exports) so a submodule is never shadowed
by a same-named re-exported value.

### Feature isolation (personal mode)

- **Core vs side features** are declared once in `utils/features.py`. Side
features (accounts, billing, api_tokens, webhooks, telegram,
notifications, sharing, background, audit_log, rate_limits) are checked
with `feature_enabled("<name>")`. `PERSONAL_MODE=1` turns them all off.
- **What "off" means:** the web app doesn't import their modules (app.py
imports them inside `if not PERSONAL_MODE:`); service-level side effects
(webhook dispatch in stages/applications, billing gates in
`analysis_runner`) are skipped.
- **Enforced by** `PersonalModeIsolationTests` (fresh subprocess, asserts no
side-feature module is loaded). Keep new side-feature imports out of
core modules, or make them lazy.

### Shared helpers — use these, don't re-roll them

- **Config:** `utils/env.env_{str,bool,int,float}` — never `os.getenv(...) ==
Expand Down Expand Up @@ -213,6 +230,21 @@ same canned "TechCorp" text regardless of input) to the current product:

## Production-readiness roadmap (what's left)

> **Personal mode** (`PERSONAL_MODE=1`, default in `scripts/run_local.sh`):
> single local owner (`services/personal`), no auth/billing/quota UI. Search
> profile in `services/profile` (JSON doc, table `candidate_profiles`) feeds
> the report's "Fit for You" + verdict, discovery and triage. Job discovery:
> connectors in `tools/job_sources` (public ATS + job-board APIs only),
> pipeline in `services/discovery` (table `discovered_jobs`). Claude web
> research (`utils/llm.web_research`, server-side web search/fetch) powers
> company + salary research when an Anthropic key is set.
>
> **Superseded in part by `docs/ASSESSMENT.md` (2026-10-19)**: the current
> verified state, remaining paid-launch blockers, and P1 backlog. Some items
> marked ✅ below were not actually true at that point (e.g. 5
> `use_container_width` sites remain). Local single-user launch:
> `./scripts/run_local.sh` (nothing in the app loads `.env` by itself).

The app is feature-complete and deployed, but several things stand between it
and "production-grade for real multi-user traffic." Prioritized:

Expand Down
169 changes: 0 additions & 169 deletions DEVELOPMENT.md

This file was deleted.

10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# syntax=docker/dockerfile:1
FROM python:3.12-slim AS base
# trixie ships postgresql-client 17; pg_dump must be >= the server (16).
FROM python:3.12-slim-trixie AS base

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1

WORKDIR /app

# System deps: build tools for any wheels that need them; curl for healthchecks.
# System deps: build tools for any wheels that need them; curl for healthchecks;
# postgresql-client for scripts/backup_db.sh (run by the scheduler service).
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential curl \
&& apt-get install -y --no-install-recommends build-essential curl postgresql-client \
&& rm -rf /var/lib/apt/lists/*

# Install Python deps first (better layer caching). Copy only metadata so a
# code change doesn't bust the dependency layer.
COPY pyproject.toml ./
# Editable install needs the package dirs to exist at build time.
COPY . .
RUN pip install --upgrade pip && pip install ".[telegram]"
RUN pip install --upgrade pip && pip install ".[telegram,worker,billing,research,pdf]"

EXPOSE 5000

Expand Down
Loading
Loading