diff --git a/.agents/skills/jobdanmark-search/cli/README.md b/.agents/skills/jobdanmark-search/cli/README.md index a621ca9..5504907 100644 --- a/.agents/skills/jobdanmark-search/cli/README.md +++ b/.agents/skills/jobdanmark-search/cli/README.md @@ -129,13 +129,6 @@ bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10 { "title": "IT-chef søges til RAH", "companyName": "Rah Service A/S", - "companyLogo": { - "key": "71f1c950-abcd-1234-efgh-000000000000", - "url": "https://jobdanmark.dk/media/k1epc2kk/rah-service-logo.jpg", - "focalPoint": null - }, - "companyLogoSvgMarkup": null, - "overlayColor": "#FFFFFF1F", "companyAddress": "Ndr Ringvej 4 6950 Ringkøbing", "jobTypes": ["fuldtid"], "boostJob": true, @@ -143,12 +136,6 @@ bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10 "applicationDeadline": "10-04-2026", "url": "https://jobdanmark.dk/job/it-chef-soeges-til-rah", "slug": "it-chef-soeges-til-rah", - "coverImage": { - "key": "cf06eb46-abcd-1234-efgh-000000000000", - "url": "https://jobdanmark.dk/media/idvbnt4y/rah-service-as-billede.png", - "focalPoint": { "top": 0.488, "left": 0.499 } - }, - "silhouetteLogo": false, "company": "Rah Service A/S", "location": "Ringkøbing", "date": "2026-03-12", @@ -162,9 +149,8 @@ bun run src/cli.ts search --text "sygeplejerske" --zip 8000 --limit 10 > - `url` is normalized to a full URL (CLI prepends `https://jobdanmark.dk` to the relative path from the API). > - `slug` is extracted from the relative `url` field (the path segment after `/job/`). > - `applicationDeadline` can be `null`. -> - `companyLogo` can be `null`. > - `publishedDate` format: `"DD-MM-YYYY"`. -> - `coverImage` can be `null`. +> - Presentation-only keys the API sends (`coverImage`, `companyLogo`, `companyLogoSvgMarkup`, `overlayColor`, `silhouetteLogo`) are dropped from search output — they were ~40% of a live payload and an agent can never use them. > - Every result also carries the cross-portal contract fields `company`, `location`, `date` and `deadline`, derived from `companyName`, the city after the postal code in `companyAddress`, and the day-first dates converted to `YYYY-MM-DD` — `/scrape` Step 2 expects search output to include title, company, location, date, and URL. Native fields are preserved unchanged. --- @@ -454,5 +440,4 @@ All errors are written to **stderr** in JSON format and exit with code `1`: ## URL construction - Job detail pages: `https://jobdanmark.dk/job/{slug}` -- Company logo images: `https://jobdanmark.dk{companyLogo.url}` (prepend base URL to relative path) -- Cover images: `https://jobdanmark.dk{coverImage.url}` (prepend base URL to relative path) +- Image URLs from the raw API (`companyLogo.url`, `coverImage.url`) are relative; prepend `https://jobdanmark.dk` if you consume the API directly (the CLI drops these keys) diff --git a/.agents/skills/jobdanmark-search/cli/src/commands/search.ts b/.agents/skills/jobdanmark-search/cli/src/commands/search.ts index e311c09..304399e 100644 --- a/.agents/skills/jobdanmark-search/cli/src/commands/search.ts +++ b/.agents/skills/jobdanmark-search/cli/src/commands/search.ts @@ -59,32 +59,14 @@ export function normalizeItem(item: ApiSearchItem): Record { // Extract slug from url path: /job/ const slug = relativeUrl.replace(/^\/job\//, "") - const companyLogo = item.companyLogo - ? { - key: item.companyLogo.key, - url: item.companyLogo.url.startsWith("http") - ? item.companyLogo.url - : `${BASE_URL}${item.companyLogo.url}`, - focalPoint: item.companyLogo.focalPoint, - } - : null - - const coverImage = item.coverImage - ? { - key: item.coverImage.key, - url: item.coverImage.url.startsWith("http") - ? item.coverImage.url - : `${BASE_URL}${item.coverImage.url}`, - focalPoint: item.coverImage.focalPoint, - } - : null - + // Presentation-only keys (coverImage, companyLogo, companyLogoSvgMarkup, + // overlayColor, silhouetteLogo) are dropped: they were ~40% of a live + // payload and the /scrape agent can never use an image or overlay colour. + // The #340 compatibility duplicates (companyName, publishedDate, + // applicationDeadline) stay. return { title: item.title, companyName: item.companyName, - companyLogo, - companyLogoSvgMarkup: item.companyLogoSvgMarkup ?? null, - overlayColor: item.overlayColor ?? null, companyAddress: item.companyAddress, jobTypes: item.jobTypes, boostJob: item.boostJob, @@ -92,8 +74,6 @@ export function normalizeItem(item: ApiSearchItem): Record { applicationDeadline: item.applicationDeadline ?? null, url: fullUrl, slug, - coverImage, - silhouetteLogo: item.silhouetteLogo, company: item.companyName, location: extractCity(item.companyAddress), date: toContractDate(item.publishedDate), diff --git a/.agents/skills/jobdanmark-search/cli/tests/search-normalization.test.ts b/.agents/skills/jobdanmark-search/cli/tests/search-normalization.test.ts index 1c20287..f52b538 100644 --- a/.agents/skills/jobdanmark-search/cli/tests/search-normalization.test.ts +++ b/.agents/skills/jobdanmark-search/cli/tests/search-normalization.test.ts @@ -88,4 +88,18 @@ describe("Jobdanmark search normalization", () => { expect(result.publishedDate).toBe("27-07-2026"); expect(result.applicationDeadline).toBe("17-08-2026"); }); + + test("omits presentation-only keys the agent can never use", () => { + // coverImage/companyLogo/companyLogoSvgMarkup/overlayColor/silhouetteLogo + // were ~40% of a live search payload, fed into agent context on every + // /scrape query (review finding F3, 2026-08-19). The #340 compatibility + // duplicates (companyName, publishedDate, applicationDeadline) stay. + const result = normalizeItem(item()); + + expect(result).not.toHaveProperty("coverImage"); + expect(result).not.toHaveProperty("companyLogo"); + expect(result).not.toHaveProperty("companyLogoSvgMarkup"); + expect(result).not.toHaveProperty("overlayColor"); + expect(result).not.toHaveProperty("silhouetteLogo"); + }); }); \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 803f30b..cab21d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,12 @@ per-file diff commands. ### Changed +- **`jobdanmark-search` search output drops presentation-only keys** - `coverImage`, + `companyLogo`, `companyLogoSvgMarkup`, `overlayColor`, and `silhouetteLogo` were ~40% + of a live payload (a 30-result response shrinks from ~30k to ~20k chars), fed into + agent context on every `/scrape` query, and unusable by an agent. The #340 + compatibility duplicates (`companyName`, `publishedDate`, `applicationDeadline`) and + `slug` stay. Pinned in `tests/search-normalization.test.ts`. - **BREAKING (jobbank forks): `jobbank-search` search output emits `deadline` as `YYYY-MM-DD`** - the feed's `DD.MM.YYYY` parenthetical was passed through raw, contradicting the `/scrape` contract, the other portals, and the same CLI's own