Skip to content

Add comp cache, unit tests, and tiered evaluation framework#202

Open
akivanc88 wants to merge 3 commits intosantifer:mainfrom
akivanc88:claude/review-project-claims-I2L61
Open

Add comp cache, unit tests, and tiered evaluation framework#202
akivanc88 wants to merge 3 commits intosantifer:mainfrom
akivanc88:claude/review-project-claims-I2L61

Conversation

@akivanc88
Copy link
Copy Markdown

What does this PR do?

This PR introduces three major improvements to the career-ops pipeline:

  1. Compensation Research Cache (comp-cache.mjs): A local YAML-based cache for salary data (p25/p50/p75) with 60-day TTL, eliminating repeated WebSearch calls for the same role/stage/location combinations. Includes CLI for lookup, save, list, and purge operations.

  2. Comprehensive Unit Tests: Added test suites for all major modules (comp-cache.test.mjs, verify-pipeline.test.mjs, merge-tracker.test.mjs, normalize-statuses.test.mjs) covering pure functions and edge cases. Tests use Node's built-in node:test framework with no external dependencies.

  3. Tiered Evaluation Framework: Introduced Stage 0 pre-screen (cheap, ~1K tokens) that runs before full evaluation blocks. Pre-screen scores alignment to North Star archetypes and overlap with must-haves, allowing early rejection of misaligned roles without expensive full analysis.

Additional improvements:

  • Refactored verify-pipeline.mjs to export pure validation functions for testability
  • Added context pre-loading in batch-runner.sh to inject cv.md + profile.yml once, reducing tool calls
  • Updated batch prompt and mode documentation with cache-first protocol and tiering rules
  • Added test fixtures (sample JDs, tracker entries, cache samples)
  • Updated .gitignore to exclude data/comp-cache.yml (local-only, personal salary data)

Related issue

N/A (foundational infrastructure improvements)

Type of change

  • Bug fix
  • New feature
  • Documentation / translation
  • Refactor (no behavior change)

Checklist

  • I have read CONTRIBUTING.md
  • My PR does not include personal data (CV, email, real names)
  • I added unit tests covering new functionality
  • My changes respect the Data Contract

Test Plan

Run the new test suite:

npm test

All tests pass, covering:

  • comp-cache: Key building, TTL expiration, YAML parsing/serialization, round-trip consistency
  • verify-pipeline: Status validation, markdown/date stripping, score format checking, duplicate detection
  • merge-tracker: Status normalization, company normalization, fuzzy role matching, score parsing
  • normalize-statuses: Alias mapping, DUPLICADO handling, edge cases

The cache CLI can be tested manually:

node comp-cache.mjs save "senior-ai-engineer" "series-b" "remote" '{"p25":180000,"p50":210000,"p75":260000,"sources":["glassdoor"]}'
node comp-cache.mjs lookup "senior-ai-engineer" "series-b" "remote"
node comp-cache.mjs list
node comp-cache.mjs purge

https://claude.ai/code/session_01PQ1cMmnoQPQTeR1cZYkq4e

claude added 3 commits April 12, 2026 02:58
- Tiered evaluation: Stage 0 pre-screen gates full A-F evaluation behind
  preliminary score (0.4×archetype fit + 0.6×CV overlap). Offers scoring
  <3.0 skip immediately with a SKIP TSV — no WebSearch, no STAR stories.
  Verbosity tiers: 3.0-3.9→A+B only, 4.0-4.4→A-E, ≥4.5→full A-G.

- Comp research caching: new comp-cache.mjs (no new deps) caches salary
  data from WebSearch with 60-day TTL. Modes check cache before querying
  Glassdoor/Levels.fyi/Blind, saving 3 WebSearch calls per repeated role.

- JD summarization: long JDs (>1500 words) are summarized before the
  pre-screen to reduce input tokens for the cheap filtering step.

- Batch context pre-building: batch-runner.sh reads cv.md + profile.yml
  once before spawning workers and inlines them via {{CONTEXT_PRELOADED}},
  eliminating per-worker Read tool calls for static files.

- Test infrastructure: 106 tests across 4 files using Node built-in
  node:test (no new deps). Refactored merge-tracker, verify-pipeline, and
  normalize-statuses to export pure functions under a main guard.

https://claude.ai/code/session_01PQ1cMmnoQPQTeR1cZYkq4e
This commit translates all mode instruction files and related systems from Spanish to English while preserving all functionality:

Mode files translated:
- modes/oferta.md → English with preserved technical terminology
- modes/auto-pipeline.md → Translated pipeline stages and instructions
- modes/_shared.md → Translated archetype definitions and guidelines
- modes/ofertas.md → Translated comparison matrix terminology
- modes/scan.md → Translated portal scanning instructions
- modes/tracker.md → Translated tracker status explanations
- modes/apply.md → Translated application assistant mode
- batch/batch-prompt.md → Translated batch worker prompt and section labels

Code changes:
- Updated CANONICAL_STATES arrays in merge-tracker.mjs, verify-pipeline.mjs, and normalize-statuses.mjs from Spanish to English values
- Updated aliases to support both Spanish and English input, normalizing to English output
- Updated all test fixtures and test assertions to use English status values
- All 106 tests passing with new English-based canonical statuses

Status values (Spanish → English):
- Evaluada → Evaluated
- Aplicado → Applied
- Respondido → Responded
- Entrevista → Interview
- Oferta → Offer
- Rechazado → Rejected
- Descartado → Discarded
- NO APLICAR → SKIP

Backward compatibility maintained: system accepts Spanish input (for existing trackers) and normalizes to English output.

https://claude.ai/code/session_01PQ1cMmnoQPQTeR1cZYkq4e
- normalize-statuses.mjs: rechazada? only matched 'rechazada', not
  'rechazado' — changed to rechazad[ao] to cover both forms
- test: monitor correctly maps to SKIP (not Evaluated) per states.yml

https://claude.ai/code/session_01PQ1cMmnoQPQTeR1cZYkq4e
@akivanc88 akivanc88 force-pushed the claude/review-project-claims-I2L61 branch from b322dd0 to 069875a Compare April 12, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants