Skip to content

Agent robustness + Harbor eval suite for Search & Auto-Apply agents #39

Description

@Mayank-glitch-cpu

Tracking issue for hardening the two server-side agents and building a Harbor-based eval suite with code verifiers. Full design doc: docs/agent-architecture-and-evals.md (architecture diagrams, workflow-vs-agent assessment, eval/verifier specs).

Context

  • Search Agent (mcp-server/src/lib/agent/search-agent.ts) is a genuine autonomous tool-use loop, but has no verification: the run result is whatever the model claims plus an upsert tally. Nothing enforces recency, link liveness, or filters on what actually lands in the pipeline.
  • Auto-Apply Agent (mcp-server/src/lib/agent/auto-apply-agent.ts) is a code-driven workflow with an approval gate (correct design), but has no recovery loop: conditional fields, multi-page wizards, and off-menu select answers are unhandled.
  • There are no agent evals. Plan follows Demystifying evals for AI agents: containerized environments (Harbor), record/replay ATS fixtures with a frozen clock, code verifiers + calibrated LLM judge, pass@k for search / pass^k for auto-apply, multi-model matrix via JOBSYNC_AGENT_MODEL.

Phase 1 — Post-run audit in prod (verifier logic, no new infra)

  • search-audit.ts: audit every job upserted during a search run
    • Recency: datePosted parses and falls within the lookback window
    • Liveness: re-verify apply links via the existing board-specific checkers (link-check-tools.ts)
    • Filters: title matches target roles (when roles were specified)
    • No-fabrication: every upserted applyLink must appear in a prior tool result in the transcript
  • Collect upserted jobs + observed tool output inside the runSearchAgent loop; run the audit after the loop; surface an AuditReport on SearchResult and flag violations in the pipeline (notes)
  • Unit tests (vitest, mocked verifier)

Phase 2 — Fixture recorder + mock ATS server

  • Recorder that snapshots Greenhouse/Lever/Ashby/Workday API responses + job pages for ~30 companies on a date D
  • Fixture server that replays them; frozen-clock support (env override for "now")
  • Mock apply-form server (cloned GH/Lever/Ashby forms) with a request recorder — outcome source for auto-apply grading; doubles as the RL environment

Phase 3 — Search-agent eval suite (Harbor)

  • ~10 tasks: happy path, recency trap, dead links, dedupe (pre-seeded seen-state), filter traps, dead slugs, sparse world, empty profile, negative case (adds zero)
  • Reference solutions (expected job-link sets) written before the tasks
  • Code verifiers (reuse Phase 1 logic): recency, liveness, filters, dedupe, no-fabrication (hard gate), yield, summary faithfulness, budget
  • 3-model matrix run (haiku / sonnet / opus) with pass@k + cost-per-added-job report

Phase 4 — Auto-apply eval suite

  • Tasks: standard form, open questions, select traps, dry-run safety, email-code gate, CAPTCHA handoff, conditional fields
  • Hard gates first: zero submit POSTs before approval; no CAPTCHA bypass attempts; applied-mark ⇔ confirmed submit
  • Field-accuracy, select-integrity, grounding (LLM judge) graders; pass^k reporting

Phase 5 — Agent robustness (informed by eval failures)

  • Search: structured final report contract (JSON schema) validated against transcript
  • Search: prompt caching on system+tools prefix; compact JSON from discovery tools
  • Search: budgets (wall-clock, tokens, per-tool-call caps) surfaced to the model
  • Auto-apply: re-inspect after fill (conditional fields); code-validate select answers against offered options with one retry
  • Auto-apply: bounded page-wizard loop for Workday-style multi-page flows
  • Cross-run portal memory (slug 404s, yield stats) injected into kickoff

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions