fix(jobdanmark-search): drop presentation-only keys from search output

coverImage, companyLogo, companyLogoSvgMarkup, overlayColor, and
silhouetteLogo were ~40% of a live payload - image keys, focal points
and overlay colours an agent can never act on, paid into context on
every /scrape query. A live 30-result response drops from ~30k to ~20k
chars. The #340 compatibility duplicates and slug (the detail command's
input) are kept deliberately. Review finding F3 (2026-08-19), decision
approved by Mads.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mads Lorentzen
2026-08-19 20:33:16 +02:00
co-authored by Claude Opus 5
parent 48965960d3
commit 56f679e5c0
4 changed files with 27 additions and 42 deletions
@@ -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");
});
});