Skip to content
Closed
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
28 changes: 27 additions & 1 deletion batch/batch-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ process_offer() {

update_state "$id" "$url" "completed" "$started_at" "$completed_at" "$report_num" "$score" "-" "$retries"
echo " ✅ Completed (score: $score, report: $report_num)"

# Warn when a freshly-scored offer falls below --min-score
if [[ "$score" != "-" && -n "$score" ]] && (( $(echo "$MIN_SCORE > 0" | bc -l) )); then
if (( $(echo "$score < $MIN_SCORE" | bc -l) )); then
echo " ⚠️ Score $score is below --min-score $MIN_SCORE"
fi
fi
else
retries=$((retries + 1))
local error_msg
Expand Down Expand Up @@ -401,7 +408,7 @@ print_summary() {
return
fi

local total=0 completed=0 failed=0 pending=0
local total=0 completed=0 failed=0 pending=0 below_min=0
local score_sum=0 score_count=0

while IFS=$'\t' read -r sid _ sstatus _ _ _ sscore _ _; do
Expand All @@ -412,6 +419,9 @@ print_summary() {
if [[ "$sscore" != "-" && -n "$sscore" ]]; then
score_sum=$(echo "$score_sum + $sscore" | bc 2>/dev/null || echo "$score_sum")
score_count=$((score_count + 1))
if (( $(echo "$MIN_SCORE > 0" | bc -l) )) && (( $(echo "$sscore < $MIN_SCORE" | bc -l) )); then
below_min=$((below_min + 1))
fi
fi
;;
failed) failed=$((failed + 1)) ;;
Expand All @@ -426,6 +436,10 @@ print_summary() {
avg=$(echo "scale=1; $score_sum / $score_count" | bc 2>/dev/null || echo "N/A")
echo "Average score: $avg/5 ($score_count scored)"
fi

if (( below_min > 0 )); then
echo "Below --min-score $MIN_SCORE: $below_min offers"
fi
}

# Main
Expand Down Expand Up @@ -474,6 +488,18 @@ main() {
local status
status=$(get_status "$id")

# --min-score: skip completed offers that already scored below the threshold
if [[ "$status" == "completed" ]] && (( $(echo "$MIN_SCORE > 0" | bc -l) )); then
local prev_score
prev_score=$(get_score "$id")
if [[ "$prev_score" != "-" && -n "$prev_score" ]]; then
if (( $(echo "$prev_score < $MIN_SCORE" | bc -l) )); then
echo "SKIP #$id: score $prev_score below --min-score $MIN_SCORE"
continue
fi
fi
fi

if [[ "$RETRY_FAILED" == "true" ]]; then
# Only process failed offers
if [[ "$status" != "failed" ]]; then
Expand Down
8 changes: 4 additions & 4 deletions docs/CUSTOMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Key sections:
- **compensation**: Target range, minimum, currency
- **location**: Country, timezone, visa status, on-site availability

## Target Roles (modes/_shared.md)
## Target Roles (modes/_profile.md)

The archetype table in `_shared.md` determines how offers are scored and CVs are framed. Edit the table to match YOUR career targets:
The archetype table in `_profile.md` determines how offers are scored and CVs are framed. Edit the table to match YOUR career targets:

```markdown
| Archetype | Thematic axes | What they buy |
Expand Down Expand Up @@ -42,7 +42,7 @@ The HTML template uses these design tokens:

To customize fonts/colors, edit the CSS in the template. Update font files in `fonts/` if switching fonts.

## Negotiation Scripts (modes/_shared.md)
## Negotiation Scripts (modes/_profile.md)

The negotiation section provides frameworks for salary discussions. Replace the example scripts with your own:
- Target ranges
Expand Down Expand Up @@ -73,4 +73,4 @@ Save hooks in `.claude/settings.json`.
The canonical states rarely need changing. If you add new states, update:
1. `templates/states.yml`
2. `normalize-statuses.mjs` (alias mappings)
3. `modes/_shared.md` (any references)
3. `modes/_profile.md` (any references)