fix(salary): split combined name-and-city workbook columns

Merged
MV
2d ago
+318-10

What changed and why

tools/convert_salary_excel.py detects the IDA header Firmanavn og by (#615). That column stores the company and the city in one cell, Ørsted A/S,Fredericia, with no space after the comma. Convert copied the whole cell into company with city: "". salary_lookup.py --city only reads entry["city"], so the documented command in tools/README_SALARY_TOOL.md misses, and /apply (which adds --city whenever a posting names a city) silently loses the salary benchmark:

python3 salary_lookup.py "Ørsted" --city "Fredericia"

Fix: when the company header also names a city (by / city / ...) and there is no separate city column, the cell is split on the last comma (rsplit(",", 1)) and both parts are stripped. Splitting on the last comma keeps a company name that itself contains ", " intact: Rambøll Danmark A/S, Odense,Odense C becomes company Rambøll Danmark A/S, Odense, city Odense C. A plain Company header still keeps commas in the name (Acme, Inc.), and a combined cell with no comma stays company-only.

The docstrings, the CHANGELOG entry (under Unreleased), tools/README_SALARY_TOOL.md and the salary benchmarking section of README.md describe the split.

Not in this PR: the optional --validate duplicate check on company plus city. It lives in salary_lookup.py; happy to send it as a follow-up.

Failing case / reproduction (for fixes)

Workbook with header Firmanavn og by | Antal | Indeks and row Ørsted A/S,Fredericia | 200 | 105.2. Run the documented convert CLI, then the documented lookup CLI.

Master convert output:

{ "company": "Ørsted A/S,Fredericia", "city": "" }

Master lookup:

exit 1
No results found for 'Ørsted'
  (filtered by city: Fredericia)

After convert:

{ "company": "Ørsted A/S", "city": "Fredericia" }

After lookup: exit 0, Ørsted A/S / Location: Fredericia / index 105.2.

Verification

  • tests/test_salary_combined_city_cli.py runs convert then salary_lookup.py "Ørsted" --city "Fredericia" on a real .xlsx with the unspaced IDA cell shape.
  • Unit tests in tests/test_convert_salary_excel.py: the IDA header splits Example A/S,Aarhus; Company and City splits a multi-word city (Ørsted A/S,Kongens Lyngby); a company containing ", " (Rambøll Danmark A/S, Odense,Odense C) splits on the last comma only; Company + Acme, Inc. does not split; a combined cell with no comma stays company-only.
  • After merging current master: python3 -m unittest discover -s tests -t .: 806 tests, 7 skipped, OK.
  • python3 tools/lint_skills.py, python3 tools/check_framework_version.py (against master), python3 tools/security_guards.py: OK.
  • No CLI under .agents/skills/ is touched, so bun test / bun run typecheck do not apply.