Commit Graph

59 Commits

Author SHA1 Message Date
0df5eb1b63 debug: add modal structure diagnostics — iframe detection, child tags, html snippet
Logs iframe count, child element tags, and first 500 chars of modal innerHTML
on step 0 to diagnose why buttons/heading aren't being found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:13:22 -08:00
e6fb380e1c fix: cover letter silent drop, submit verification, autocomplete scoping
- Text inputs matched to cover letter now report as unknown if required,
  instead of silently leaving the field empty
- Submit click now verifies modal closed before reporting success;
  returns 'incomplete' with actionable log if modal stays open
- selectAutocomplete scoped to container (modal) to avoid clicking
  wrong dropdowns from the underlying page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:11:44 -08:00
e62756c6ca fix: robustness improvements — atomic writes, timeouts, shell injection, validation errors
- Atomic JSON writes (write-to-tmp + rename) prevent queue/log corruption
- Per-job (3min) and overall run (45min) timeouts prevent hangs
- execFileSync in ai_answer.mjs prevents shell injection with resume paths
- Validation error detection after form fill in Easy Apply modal
- Config-driven enabled_apply_types (from settings.json)
- isRequired() detects required/aria-required/label * patterns
- getLabel() strips trailing * from required field labels
- Actionable logging on failures ("Action: ..." messages)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:01:53 -08:00
a7ce119bde fix: resilient modal button detection and form filler robustness
easy_apply.mjs:
- findModalButton() uses 3-strategy detection: aria-label exact/substring,
  then exact button text match — survives LinkedIn aria-label changes
- Check order fixed: Next → Review → Submit (submit only when no forward nav)
- All queries scoped to modal + :not([disabled])
- dismissModal() with fallback chain: Dismiss → Close/X → Escape → Discard
- Uses innerText for button text (ignores hidden children)

form_filler.mjs:
- All queries scoped to container (modal when present, page otherwise)
- Radio labels use $$('label') + textContent instead of broken :has-text()
- Autocomplete uses waitForSelector instead of blind 800ms sleep
- EEO selects iterate options directly (selectOption doesn't accept regex)
- Country code check ordered before country to prevent fragile match order

constants.mjs:
- Add AUTOCOMPLETE_WAIT, AUTOCOMPLETE_TIMEOUT
- Remove unused button selectors (now handled inline by findModalButton)

ai_answer.mjs + keywords.mjs:
- Use ANTHROPIC_API_URL constant, claude-sonnet-4-6 model

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:54:44 -08:00
33c50178f4 debug: full-page button scan, modal heading, real progress, validation errors; bump max steps to 20 2026-03-06 17:43:03 +00:00
b79e9d0b9c feat: city autocomplete dropdown, phone country code, checkboxes, EEO selects, location/heard-about answers 2026-03-06 17:39:05 +00:00
8556208405 debug: verbose step-by-step logging in easy_apply modal flow 2026-03-06 17:27:39 +00:00
093b349aad fix: waitForSelector on modal after click instead of fixed 1.5s delay 2026-03-06 17:13:56 +00:00
8c626b5147 debug: log apply elements on skip; use state=attached for waitForSelector 2026-03-06 17:05:57 +00:00
318da35e01 fix: scroll page before waiting for Easy Apply button; extend timeout to 12s 2026-03-06 17:04:27 +00:00
45ad5d1ec9 fix: Easy Apply is an <a> not <button> — update selector; wait for element instead of fixed timeout 2026-03-06 17:01:02 +00:00
02a7501e9d fix: use aria-label selectors for LinkedIn Easy Apply button (class names are now hashed) 2026-03-06 16:53:25 +00:00
b8a0e03c75 feat: AI answer generation for unknown questions + Easy Apply only mode 2026-03-06 16:47:58 +00:00
b1528ac0ad refactor: extract magic numbers to constants, fix audit issues
- Centralize all magic numbers/strings in lib/constants.mjs
- Fix double-replaced import names in filter.mjs
- Consolidate duplicate fs imports in job_applier/job_searcher
- Remove empty JSDoc block in job_searcher
- Update keywords.mjs model from claude-3-haiku to claude-haiku-4-5
- Extract Anthropic API URLs to constants
- Convert :has-text() selectors to page.locator() API
- Fix SIGTERM handler conflict — move partial-run notification into lock.onShutdown
- Remove unused exports (LOCAL_USER_AGENT, DEFAULT_REVIEW_WINDOW_MINUTES)
- Fix variable shadowing (b -> v) in job_filter reduce callback
- Replace SKILL.md PM2 references with system cron

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 08:45:17 -08:00
37b95b6b85 feat: track token usage and estimated cost per filter run in filter_runs.json 2026-03-06 16:22:14 +00:00
3575f06018 fix: dedupeAfterFilter skips groups with unscored members — wait until all copies are scored 2026-03-06 16:00:23 +00:00
c9b527c83a feat: find-all → filter → dedup flow
- addJobs: allows same job on multiple tracks (dedup key = track::id)
- Cross-track copies get composite id (job.id_track) to avoid batch collisions
- dedupeAfterFilter(): after collect, keeps highest-scored copy per URL, marks rest as 'duplicate'
- Called automatically at end of collect phase
2026-03-06 15:55:00 +00:00
2dfadbde99 refactor: generic system prompt — dumps full JSON profiles, no hardcoded criteria 2026-03-06 11:36:05 +00:00
c88a71fc20 feat: one batch per track — separate GTM/AE batches with their own system prompts
- submitBatch → submitBatches: groups jobs by track, submits one batch each
- filter_state.json now stores batches[] array instead of single batch_id
- Collect waits for all batches to finish before processing
- Each track gets its own cached system prompt = better caching + cleaner scoring
- Idempotent collect: skips already-scored jobs
2026-03-06 11:35:15 +00:00
aadec0704b fix: AE filter criteria - don't penalize company size, SMB, or staffing agencies with real roles 2026-03-06 11:32:30 +00:00
2f05a40954 fix: addJobs always reads fresh from disk to prevent searcher clobbering filter scores 2026-03-06 11:24:05 +00:00
fac286aaeb fix: use claude-sonnet-4-6 (no date suffix) for batch API, bump max_tokens to 1024 2026-03-06 11:01:46 +00:00
0b40d284cd fix: bump max_tokens to 256, note batch API requires native model IDs 2026-03-06 10:58:11 +00:00
728e0773b9 fix: sanitize Unicode surrogates in job descriptions, handle custom_id > 64 chars 2026-03-06 10:18:54 +00:00
dbe9967713 feat: rewrite filter to use Anthropic Batch API
- Batch API = 50% cost savings vs synchronous calls
- Prompt caching on system prompt (profile + criteria shared across all jobs)
- One request per job with custom_id = job ID for result matching
- Two-phase state machine: submit → poll/collect (hourly cron safe)
- filter_state.json tracks pending batch ID between runs
- Model configurable via settings.filter.model (default: claude-sonnet-4-6)
- Telegram notifications on submit + collect
- Errors pass through — never block applications due to filter failure
- --stats flag for queue overview
2026-03-06 10:12:47 +00:00
9bf904dada feat: AI job filter — score jobs 0-10 with Claude Haiku before applying
- lib/filter.mjs: batch scoring engine (10 jobs/call, Claude Haiku)
- job_filter.mjs: standalone CLI with --dry-run and --stats flags
- Threshold configurable globally + per-search in search_config.json (filter_min_score, default 5)
- Job profiles (gtm/ae) passed as context via settings.filter.job_profiles
- Filtered jobs get status='filtered' with filter_score + filter_reason
- Filter errors pass jobs through (never block applications)
- status.mjs: added 'AI filtered' line to report
2026-03-06 10:01:15 +00:00
be20f5a4e9 feat: capture job description from right panel during search — no extra page load 2026-03-06 02:49:28 +00:00
4a2b24d562 fix: show global keyword position (2/20) not slice position (1/19) in logs 2026-03-06 02:47:39 +00:00
c01abe8884 fix: location scraper — use .tvm__text selector, also capture work_type (Remote/Hybrid/On-site) 2026-03-06 02:44:17 +00:00
97b753d401 feat: cache keywords in search_progress.json — restarts reuse same keywords, no regeneration mid-run 2026-03-06 02:24:54 +00:00
65d6d1e50c feat: per-keyword resume — restart picks up from last completed keyword, not keyword 1 2026-03-06 02:23:07 +00:00
ffb9eec4cb feat: log keyword progress (X/N) during search 2026-03-06 02:20:32 +00:00
261f5800ad fix: load API keys from .env at runtime — never embed credentials in cron payloads or source code 2026-03-06 02:04:55 +00:00
1c3e9f3561 fix: split skip counters for accurate reporting, complete status docs
- Split skipped_no_easy_apply into skipped_no_apply (no button/modal)
  and skipped_other (honeypot/stuck/incomplete) for clearer reporting
- Update Telegram summary, status.mjs display, and job_applier counters
- Add missing skipped_easy_apply_unsupported to README status table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:44:25 -08:00
8212f97aba refactor: normalize apply statuses, remove dead code, fix signal handler
- lib/apply/index.mjs: add STATUS_MAP to normalize platform-specific statuses
  to generic ones (no_button/no_submit/no_modal → skipped_no_apply).
  Documented all generic statuses for AI/developer reference.
- job_applier.mjs: handleResult now handles skipped_no_apply, default case
  logs + saves instead of silently dropping
- lib/linkedin.mjs: remove dead applyLinkedIn() and detectAts(), clean imports
  (~110 lines removed). Search-only module now.
- lib/wellfound.mjs: remove dead applyWellfound(), clean imports.
  Search-only module now.
- lib/lock.mjs: fix async signal handler — shutdown handlers now actually
  complete before process.exit()
- test_linkedin_login.mjs: add try/catch/finally with proper browser cleanup
- README: update status table with all current statuses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:39:48 -08:00
1bf676bb80 fix: add error logging to applier, session polling, and job card clicks
- job_applier.mjs: stack traces on per-job and browser-level errors
- session.mjs: log pending status and poll count during session refresh
- linkedin.mjs: log warning when job card click fails instead of silent catch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:30:24 -08:00
ed908c91af fix: audit bugs + better error logging for searcher debugging
Bugs fixed:
- form_filler.mjs: add missing await on el.evaluate() in getLabel()
- analyze_ats.mjs: check job.apply_type instead of non-existent job.easy_apply
- status.mjs: fix typo "that run" → "in that run"
- README: add missing lock.mjs to project structure

Logging improvements:
- job_searcher.mjs: log browser creation, login steps, stack traces on error
- linkedin.mjs/wellfound.mjs: catch and log navigation failures per keyword
- browser.mjs: descriptive errors for Kernel and CDP connection failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:28:23 -08:00
ec68e621b8 fix: audit cleanup — ReDoS guard, Telegram validation, README accuracy
- form_filler.mjs: reject regex patterns over 200 chars to mitigate ReDoS
- notify.mjs: check res.ok before parsing Telegram API response
- README: update project structure with new lib/apply/ modules, session.mjs,
  keywords.mjs; fix max_applications_per_run docs (no limit by default);
  clarify ATS stub status in roadmap

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:20:32 -08:00
33f85c4752 fix: validate API response in keywords.mjs, delete unused classifier.mjs
- Add res.ok check before parsing Anthropic API response
- Validate data.content[0].text exists before accessing
- Remove classifier.mjs (86 lines of dead code, never imported)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:19:16 -08:00
fb7fc31fe1 fix: move Kernel connection IDs out of source into settings.json (gitignored) 2026-03-06 01:17:52 +00:00
e49851e12a fix: remove local browser fallback — Kernel only, fail fast if unavailable 2026-03-06 01:09:57 +00:00
f065a9a786 feat: auto-refresh Kernel Managed Auth session on login failure — ensureLoggedIn() with retry 2026-03-06 01:09:30 +00:00
4fb5917c87 fix: restore real Wellfound apply logic in lib/apply/wellfound.mjs (not a stub) 2026-03-06 01:05:35 +00:00
35fdbc487a refactor: handler registry pattern — lib/apply/<ats>.mjs, applyToJob() routes by apply_type 2026-03-06 01:03:11 +00:00
2574276a85 refactor: classify apply_type inline during search (click card → detect right panel); no second pass 2026-03-06 01:00:59 +00:00
dee6e98603 feat: searcher Phase 2 classifies apply type; applier sorts by priority; already-applied detection 2026-03-06 00:58:22 +00:00
86d00297df feat: search progress tracking — resume on restart, skip completed platform:track combinations 2026-03-06 00:37:35 +00:00
b091473735 fix: graceful shutdown — write last-run file on SIGTERM, show interrupted state in status 2026-03-06 00:35:10 +00:00
b496ee4a3a feat: ATS breakdown in Telegram summary after each apply run 2026-03-06 00:27:43 +00:00
58c2ad5295 feat: capture external ATS URLs + analyze_ats.mjs to rank platforms by job count 2026-03-06 00:26:28 +00:00