diff --git a/hub/scripts/compile-manifests.mjs b/hub/scripts/compile-manifests.mjs index 8a7b791..084aa3c 100644 --- a/hub/scripts/compile-manifests.mjs +++ b/hub/scripts/compile-manifests.mjs @@ -248,6 +248,37 @@ export const VALID_HTML_MODES = new Set([ 'finra_brokercheck_html', 'pacer_case_locator_html', 'state_court_portals_html', + // Wave 3 B1 Category A (Local Gov #202-#216, deduplicated with #140) + 'govdelivery_html', + 'municipal_cms_html', + 'boarddocs_html', + 'civicclerk_html', + 'primegov_html', + 'agenda_portal_html', + 'accela_html', + 'tyler_energov_html', + 'opengov_html', + 'public_bid_html', + 'arcgis_hub_html', + 'junar_tyler_html', + // Wave 3 B1 Category B (Education #217-#225, deduplicated with #140) + 'finalsite_html', + 'blackboard_wcm_html', + 'edlio_thrillshare_html', + 'acalog_html', + 'coursedog_html', + 'canvas_public_html', + 'edx_coursera_html', + 'schema_course_html', + // Wave 3 B1 Category C (Public/Staffing Jobs #226-#233) + 'neogov_html', + 'bullhorn_portal_html', + 'taleo_full_html', + 'paradox_olivia_html', + 'staffing_ats_pack_html', + 'smb_ats_full_html', + 'edu_job_boards_html', + 'healthcare_careers_html', ]); const pslDatPath = join(manifestsDir, 'public_suffix_list.dat'); @@ -395,6 +426,37 @@ const APPROVED_WILDCARD_DOMAIN_PATTERNS = new Set([ '*.zendesk.com', '*.giant-bicycles.com', '*.liv-cycling.com', + // Wave 3 B1 Category A + '*.civicclerk.com', + '*.primegov.com', + '*.escribemeetings.com', + '*.novusagenda.com', + '*.civicweb.net', + '*.opengov.com', + '*.bonfirehub.com', + '*.hub.arcgis.com', + '*.opendata.arcgis.com', + '*.opendatasoft.com', + '*.junar.com', + // Wave 3 B1 Category B + '*.edlio.com', + '*.apptegy.us', + '*.sites.thrillshare.com', + '*.acalog.com', + '*.coursedog.com', + '*.instructure.com', + // Wave 3 B1 Category C + '*.governmentjobs.com', + '*.schooljobs.com', + '*.bullhornstaffing.com', + '*.taleo.net', + '*.paradox.ai', + '*.jobdiva.com', + '*.ceipal.com', + '*.zohorecruit.com', + '*.freshteam.com', + '*.homerun.co', + '*.healthcaresource.com', ]); const RESERVED_CORE_ATS_DOMAINS = new Set([ @@ -434,6 +496,10 @@ const APPROVED_SAP_ATS_EXACT_EXEMPTIONS = Object.freeze( 'enterprise-ats:jobs.jobvite.com', 'gem-ats:jobs.gem.com', 'ukg-paylocity-dover:jobs.dover.com', + 'paradox-olivia:jobs.mchire.com', + 'staffing-ats-pack:jobs.crelate.com', + 'smb-ats-full:jobs.manatal.com', + 'edu-job-boards:jobs.chronicle.com', ]), ); diff --git a/hub/scripts/run-tests.mjs b/hub/scripts/run-tests.mjs index 0d9d403..681270b 100644 --- a/hub/scripts/run-tests.mjs +++ b/hub/scripts/run-tests.mjs @@ -102,6 +102,7 @@ const suiteSpecs = [ ['test/wave2d-dev.test.ts', 'wave2d-dev.test.mjs'], ['test/wave2d-local.test.ts', 'wave2d-local.test.mjs'], ['test/wave2d-sports-misc.test.ts', 'wave2d-sports-misc.test.mjs'], + ['test/wave3-b1-gov-edu-jobs.test.ts', 'wave3-b1-gov-edu-jobs.test.mjs'], ['test/mcp-part2-wave2e.test.ts', 'mcp-part2-wave2e.test.mjs'], ['test/wave2-security-fixes.test.ts', 'wave2-security-fixes.test.mjs'], ['test/hub-secrets-policy.test.ts', 'hub-secrets-policy.test.mjs'], diff --git a/hub/src/extractors/declarative.ts b/hub/src/extractors/declarative.ts index a3a5f6c..77aa6d5 100644 --- a/hub/src/extractors/declarative.ts +++ b/hub/src/extractors/declarative.ts @@ -577,7 +577,21 @@ export type DeclarativeJsonMode = | 'calendly_booking_json' | 'bosch_ebike_error_code_json' | 'finra_brokercheck_json' - | 'ncaa_espn_json'; + | 'ncaa_espn_json' + | 'civicclerk_json' + | 'primegov_json' + | 'tyler_energov_json' + | 'opengov_json' + | 'arcgis_hub_json' + | 'junar_tyler_json' + | 'coursedog_json' + | 'canvas_course_json' + | 'edx_course_json' + | 'neogov_json' + | 'bullhorn_joborder_json' + | 'staffing_ats_json' + | 'manatal_jobs_json' + | 'smb_ats_json'; export interface DeclarativeExtractSpec { commerceMode?: DeclarativeCommerceMode; @@ -607,7 +621,8 @@ export interface DeclarativeExtractSpec { | 'chocolatey_xml' | 'edge_cloud_changelog_xml' | 'fhfa_hpi_csv' - | 'public_share_csv'; + | 'public_share_csv' + | 'boarddocs_text'; pathParam?: string; codeByPath?: DeclarativeCodeByPathSpec; xml?: DeclarativeXmlSpec; @@ -878,7 +893,35 @@ export type DeclarativeHtmlMode = | 'ncaa_espn_html' | 'finra_brokercheck_html' | 'pacer_case_locator_html' - | 'state_court_portals_html'; + | 'state_court_portals_html' + | 'govdelivery_html' + | 'municipal_cms_html' + | 'boarddocs_html' + | 'civicclerk_html' + | 'primegov_html' + | 'agenda_portal_html' + | 'accela_html' + | 'tyler_energov_html' + | 'opengov_html' + | 'public_bid_html' + | 'arcgis_hub_html' + | 'junar_tyler_html' + | 'finalsite_html' + | 'blackboard_wcm_html' + | 'edlio_thrillshare_html' + | 'acalog_html' + | 'coursedog_html' + | 'canvas_public_html' + | 'edx_coursera_html' + | 'schema_course_html' + | 'neogov_html' + | 'bullhorn_portal_html' + | 'taleo_full_html' + | 'paradox_olivia_html' + | 'staffing_ats_pack_html' + | 'smb_ats_full_html' + | 'edu_job_boards_html' + | 'healthcare_careers_html'; export interface DeclarativeHtmlRouteSpec { id?: string; diff --git a/hub/src/search-index.ts b/hub/src/search-index.ts index 213d5d9..ffee6f2 100644 --- a/hub/src/search-index.ts +++ b/hub/src/search-index.ts @@ -1560,6 +1560,7 @@ export async function executeExtractCall(params: { status: number; cached: boolean; title?: string; + extractorId?: string; markdown?: string; jobPosting?: StructuredJobPosting; contentState?: ContentState; @@ -2572,6 +2573,7 @@ export async function executeExtractCall(params: { status: typeof r.status === 'number' ? r.status : 200, cached: false, title: twinOut.title, + extractorId: twinSpec.id, contentState: twinState.state, markdown: redactPii ? redactPiiText(sanitizedTwin) : sanitizedTwin, truncated: r.truncated === true || (r.bodyOmitted === true && r.extractedOnNode !== true), @@ -2757,6 +2759,7 @@ export async function executeExtractCall(params: { const structuredDoc = icsDoc || feedDoc || jsonDoc || csvDoc || patchDoc || srcDoc; let md: string; let title: string | undefined; + let extractorId: string | undefined; let jobPosting: StructuredJobPosting | undefined; let contentSource: 'meta-description' | 'ssr-hydration' | undefined; @@ -2855,6 +2858,7 @@ export async function executeExtractCall(params: { fetchBoundedTwin: fetchBoundedForExtract, }); if (compRes && compRes.doc.markdown.trim()) { + extractorId = compRes.extractorId; setActiveSpanAttribute('edgefetch.adapter_id', compRes.extractorId, activeTracer ?? undefined); platformCompDoc = { extractorId: compRes.extractorId, @@ -3038,6 +3042,7 @@ export async function executeExtractCall(params: { contentSource = 'meta-description'; } if (!platformCompDoc && extracted?.extractorId) { + extractorId = extracted.extractorId; setActiveSpanAttribute('edgefetch.adapter_id', extracted.extractorId, activeTracer ?? undefined); } } @@ -3109,6 +3114,7 @@ export async function executeExtractCall(params: { status: typeof r.status === 'number' ? r.status : 200, cached: false, ...(title ? { title } : {}), + ...(extractorId ? { extractorId } : {}), ...(jobPosting ? { jobPosting } : {}), contentState: stateRes.state, ...(contentSource ? { contentSource } : {}), @@ -3246,6 +3252,7 @@ export async function executeExtractCall(params: { status: entry.status, cached: entry.cached, ...(safeFinalTitle ? { title: safeFinalTitle } : {}), + ...(entry.extractorId ? { extractorId: entry.extractorId } : {}), ...(entry.contentState ? { contentState: entry.contentState } : {}), ...(entry.contentSource ? { contentSource: entry.contentSource } : {}), ...(entry.waybackSnapshotUrl ? { waybackSnapshotUrl: entry.waybackSnapshotUrl, waybackTimestamp: entry.waybackTimestamp } : {}), @@ -3294,6 +3301,7 @@ export async function executeExtractCall(params: { status: entry.status, cached: entry.cached, ...(safeFinalTitle ? { title: safeFinalTitle } : {}), + ...(entry.extractorId ? { extractorId: entry.extractorId } : {}), ...(entry.contentState ? { contentState: entry.contentState } : {}), ...(entry.contentSource ? { contentSource: entry.contentSource } : {}), ...(entry.waybackSnapshotUrl ? { waybackSnapshotUrl: entry.waybackSnapshotUrl, waybackTimestamp: entry.waybackTimestamp } : {}), diff --git a/hub/test/fixtures/adapters/acalog.json b/hub/test/fixtures/adapters/acalog.json new file mode 100644 index 0000000..49ef288 --- /dev/null +++ b/hub/test/fixtures/adapters/acalog.json @@ -0,0 +1,42 @@ +{ + "adapterId": "acalog", + "mode": "html", + "inputUrl": "https://csulb.catalog.acalog.com/preview_course_nopop.php?catoid=12&coid=1397", + "mockPayload": "Course: CECS 328 - California State University, Long Beach

CECS 328 - Data Structures and Algorithms

Credits: 3. Prerequisites: CECS 228. Study of trees, graphs, sorting, hashing, and algorithm analysis.

CECS 329
", + "expectTitleIncludes": "CECS 328", + "expectMarkdownIncludes": [ + "CSULB Academic Catalog", + "CECS 328", + "Acalog", + "Data Structures and Algorithms" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Course Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://csulb.catalog.acalog.com/error", + "payload": "Error

Catalog error

" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "Service Unavailable

Scheduled Maintenance

Catalog is temporarily unavailable due to maintenance. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + }, + { + "name": "robots-disallowed-ajax-route", + "status": 200, + "finalUrl": "https://csulb.catalog.acalog.com/ajax/preview_course.php?catoid=12&coid=1397", + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/accela-citizen-access.json b/hub/test/fixtures/adapters/accela-citizen-access.json new file mode 100644 index 0000000..6dad309 --- /dev/null +++ b/hub/test/fixtures/adapters/accela-citizen-access.json @@ -0,0 +1,35 @@ +{ + "adapterId": "accela-citizen-access", + "mode": "html", + "inputUrl": "https://aca-prod.accela.com/SANDIEGO/Cap/CapDetail.aspx?Module=DSD&TabName=DSD&capID1=REC26&capID2=00000&capID3=008YQ&agencyCode=SANDIEGO", + "mockPayload": "Accela Citizen Access

Message Bar

PMT-3398658Combination Building PermitClosed2027-06-30
1200 Third Ave, San Diego, CA 92101
Tenant improvement and interior electrical upgrade for municipal office suite.
", + "expectTitleIncludes": "PMT-3398658", + "expectMarkdownIncludes": [ + "PMT-3398658", + "Combination Building Permit", + "1200 Third Ave, San Diego, CA 92101" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://aca-prod.accela.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This portal is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/agenda-portal-pack.json b/hub/test/fixtures/adapters/agenda-portal-pack.json new file mode 100644 index 0000000..03f8129 --- /dev/null +++ b/hub/test/fixtures/adapters/agenda-portal-pack.json @@ -0,0 +1,34 @@ +{ + "adapterId": "agenda-portal-pack", + "mode": "html", + "inputUrl": "https://pub-london.escribemeetings.com/", + "mockPayload": "London City Council Public Meetings - eSCRIBE
City Council Meeting - 2026-12-01
", + "expectTitleIncludes": "London City Council Public Meetings", + "expectMarkdownIncludes": [ + "escribe", + "City Council Meeting - 2026-12-01" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://pub-london.escribemeetings.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This portal is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/arcgis-hub.json b/hub/test/fixtures/adapters/arcgis-hub.json new file mode 100644 index 0000000..07e0d07 --- /dev/null +++ b/hub/test/fixtures/adapters/arcgis-hub.json @@ -0,0 +1,35 @@ +{ + "adapterId": "arcgis-hub", + "mode": "twin", + "inputUrl": "https://hub.arcgis.com/api/search/v1/collections/all/items?limit=3", + "expectedFetchUrl": "https://hub.arcgis.com/api/search/v1/collections/all/items?limit=3", + "mockPayload": "{\"type\":\"FeatureCollection\",\"numberMatched\":1200,\"numberReturned\":1,\"features\":[{\"id\":\"9f4a2e1c\",\"type\":\"Feature\",\"properties\":{\"id\":\"9f4a2e1c\",\"title\":\"Municipal Zoning Districts\",\"owner\":\"CityGIS\",\"modified\":\"2026-11-20T12:00:00Z\",\"description\":\"Official municipal zoning boundary polygons.\"},\"links\":[{\"rel\":\"self\",\"href\":\"https://hub.arcgis.com/api/search/v1/collections/all/items/9f4a2e1c\"}]}]}", + "expectTitleIncludes": "Municipal Zoning Districts", + "expectMarkdownIncludes": [ + "Municipal Zoning Districts", + "CityGIS" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "{\"error\":{\"code\":404,\"message\":\"Collection not found\"}}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://hub.arcgis.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This service is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-feature-collection", + "status": 200, + "payload": "{\"type\":\"FeatureCollection\",\"numberMatched\":0,\"numberReturned\":0,\"features\":[]}" + } + ] +} diff --git a/hub/test/fixtures/adapters/blackboard-wcm.json b/hub/test/fixtures/adapters/blackboard-wcm.json new file mode 100644 index 0000000..0b6c13e --- /dev/null +++ b/hub/test/fixtures/adapters/blackboard-wcm.json @@ -0,0 +1,35 @@ +{ + "adapterId": "blackboard-wcm", + "mode": "html", + "inputUrl": "https://www.bhusd.org/calendar", + "mockPayload": "District Calendar | Beverly Hills Unified

Upcoming District Events

Winter Robotics Showcase
", + "expectTitleIncludes": "Upcoming District Events", + "expectMarkdownIncludes": [ + "Beverly Hills Unified School District", + "SchoolMessenger Presence", + "Winter Robotics Showcase" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Page Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.bhusd.org/error", + "payload": "Error
Error
" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "503 Service Unavailable

Scheduled Maintenance

District website is down for maintenance. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading..." + } + ] +} diff --git a/hub/test/fixtures/adapters/boarddocs.json b/hub/test/fixtures/adapters/boarddocs.json new file mode 100644 index 0000000..13d3c2b --- /dev/null +++ b/hub/test/fixtures/adapters/boarddocs.json @@ -0,0 +1,39 @@ +{ + "adapterId": "boarddocs", + "mode": "html", + "inputUrl": "https://go.boarddocs.com/ca/sandi/Board.nsf/Public", + "mockPayload": "San Diego Unified School District - BoardDocs Public

San Diego Unified Board of Education Meetings

Public agendas, board policies, and supporting meeting packets for the San Diego Unified School District.

Upcoming Board Meetings
", + "expectTitleIncludes": "San Diego Unified Board of Education Meetings", + "expectMarkdownIncludes": [ + "BoardDocs", + "San Diego Unified" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://go.boarddocs.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This site is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + }, + { + "name": "cloudfront-403-block", + "status": 403, + "payload": "ERROR: The request could not be satisfied

403 ERROR

Error from cloudfront

" + } + ] +} diff --git a/hub/test/fixtures/adapters/bullhorn-career-portal.json b/hub/test/fixtures/adapters/bullhorn-career-portal.json new file mode 100644 index 0000000..740db0c --- /dev/null +++ b/hub/test/fixtures/adapters/bullhorn-career-portal.json @@ -0,0 +1,42 @@ +{ + "adapterId": "bullhorn-career-portal", + "mode": "twin", + "inputUrl": "https://public-rest33.bullhornstaffing.com/rest-services/sample/search/JobOrder?query=(isOpen:1)&fields=id,title,publishedCategory,address,employmentType,dateLastPublished&count=25", + "expectedFetchUrl": "https://public-rest33.bullhornstaffing.com/rest-services/sample/search/JobOrder?query=(isOpen:1)&fields=id,title,publishedCategory,address,employmentType,dateLastPublished&count=25", + "mockPayload": "{\"total\":2,\"start\":0,\"count\":2,\"data\":[{\"id\":10421,\"title\":\"Registered Nurse - ICU\",\"employmentType\":\"Contract\",\"publishedCategory\":{\"id\":12,\"name\":\"Healthcare\"},\"address\":{\"city\":\"Denver\",\"state\":\"CO\",\"countryName\":\"United States\"},\"dateLastPublished\":1795132800000},{\"id\":10422,\"title\":\"Clinical Informatics Analyst\",\"employmentType\":\"Full-Time\",\"publishedCategory\":{\"id\":15,\"name\":\"Health IT\"},\"address\":{\"city\":\"Austin\",\"state\":\"TX\",\"countryName\":\"United States\"},\"dateLastPublished\":1795219200000}]}", + "expectTitleIncludes": "Bullhorn Career Portal (public-rest33)", + "expectMarkdownIncludes": [ + "Registered Nurse - ICU", + "Denver, CO, United States", + "Clinical Informatics Analyst", + "Austin, TX, United States" + ], + "negativeCases": [ + { + "name": "bad-corp-token", + "status": 200, + "payload": "{\"errorMessageKey\":\"errors.badCorpToken\",\"errorMessage\":\"Invalid corpToken\",\"errorCode\":400}" + }, + { + "name": "http-404", + "status": 404, + "payload": "{\"status\":404,\"error\":\"Not Found\"}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://public-rest33.bullhornstaffing.com/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-page", + "status": 503, + "payload": "Service Unavailable

Under Maintenance

" + }, + { + "name": "empty-results-json", + "status": 200, + "payload": "{\"total\":0,\"start\":0,\"count\":0,\"data\":[]}" + } + ] +} diff --git a/hub/test/fixtures/adapters/canvas-public-courses.json b/hub/test/fixtures/adapters/canvas-public-courses.json new file mode 100644 index 0000000..ae62d3a --- /dev/null +++ b/hub/test/fixtures/adapters/canvas-public-courses.json @@ -0,0 +1,41 @@ +{ + "adapterId": "canvas-public-courses", + "mode": "twin", + "inputUrl": "https://ocw.instructure.com/api/v1/courses/44012", + "expectedFetchUrl": "https://ocw.instructure.com/api/v1/courses/44012", + "mockPayload": "{\"id\":44012,\"name\":\"Introduction to Distributed Systems\",\"course_code\":\"CS 440\",\"workflow_state\":\"available\",\"is_public\":true,\"term\":{\"name\":\"Fall 2026\"},\"syllabus_body\":\"

Topics include consensus, Raft, Paxos, and fault-tolerant replicated storage.

\"}", + "expectTitleIncludes": "Introduction to Distributed Systems", + "expectMarkdownIncludes": [ + "CS 440", + "Canvas LMS", + "Raft, Paxos" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "{\"errors\":[{\"message\":\"The specified resource does not exist.\"}]}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://ocw.instructure.com/error", + "payload": "Error

404 Not Found

" + }, + { + "name": "maintenance-503", + "status": 503, + "payload": "503 Service Unavailable

Free-for-Teacher Platform

This service is temporarily unavailable due to scheduled maintenance. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + }, + { + "name": "unauthorized-json", + "status": 401, + "payload": "{\"errors\":[{\"message\":\"user authorization required\"}],\"status\":\"unauthorized\"}" + } + ] +} diff --git a/hub/test/fixtures/adapters/civicclerk.json b/hub/test/fixtures/adapters/civicclerk.json new file mode 100644 index 0000000..900ac1b --- /dev/null +++ b/hub/test/fixtures/adapters/civicclerk.json @@ -0,0 +1,36 @@ +{ + "adapterId": "civicclerk", + "mode": "twin", + "inputUrl": "https://mauicounty.portal.civicclerk.com/", + "expectedFetchUrl": "https://mauicounty.api.civicclerk.com/v1/Events?$top=25", + "mockPayload": "{\"@odata.context\":\"https://mauicounty.api.civicclerk.com/v1/$metadata#Events\",\"value\":[{\"id\":1023,\"eventName\":\"County Council Regular Meeting\",\"eventDescription\":\"Regular Council meeting for County of Maui.\",\"eventDate\":\"2026-12-04T09:00:00Z\",\"startDateTime\":\"2026-12-04T09:00:00Z\",\"isPublished\":true,\"agendaId\":5512,\"agendaName\":\"Regular Agenda\",\"categoryName\":\"County Council\",\"mediaSourcePath\":\"https://mauicounty.api.civicclerk.com/v1/Meetings/1023/Files/5512\"}]}", + "expectTitleIncludes": "County Council Regular Meeting", + "expectMarkdownIncludes": [ + "County Council Regular Meeting", + "2026-12-04T09:00:00Z", + "Regular Agenda" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "{\"error\":{\"code\":\"NotFound\",\"message\":\"Event not found\"}}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://mauicounty.api.civicclerk.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This portal is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-odata-value", + "status": 200, + "payload": "{\"@odata.context\":\"https://mauicounty.api.civicclerk.com/v1/$metadata#Events\",\"value\":[]}" + } + ] +} diff --git a/hub/test/fixtures/adapters/civicplus.json b/hub/test/fixtures/adapters/civicplus.json index 089b6b7..07a8055 100644 --- a/hub/test/fixtures/adapters/civicplus.json +++ b/hub/test/fixtures/adapters/civicplus.json @@ -13,12 +13,23 @@ { "name": "http-404", "status": 404, - "payload": "404 Page Not Found

Not Found

" + "payload": "404 Page Not Found

Not Found

" }, { - "name": "maintenance-or-block", + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.gulfshoresal.gov/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", "status": 503, - "payload": "Scheduled Maintenance

Service Unavailable

" + "payload": "Scheduled Maintenance

This site is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" } ] } diff --git a/hub/test/fixtures/adapters/coursedog.json b/hub/test/fixtures/adapters/coursedog.json new file mode 100644 index 0000000..8bf2182 --- /dev/null +++ b/hub/test/fixtures/adapters/coursedog.json @@ -0,0 +1,36 @@ +{ + "adapterId": "coursedog", + "mode": "html", + "inputUrl": "https://catalog.pratt.edu/courses", + "mockPayload": "Courses | Pratt Institute Catalog

Courses

ARCH-101 - Architectural Design I

Explore undergraduate and graduate studio offerings across Pratt Institute.

", + "expectTitleIncludes": "Courses", + "expectMarkdownIncludes": [ + "Pratt Institute", + "Coursedog", + "ARCH-101", + "Architectural Design I" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Page Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://catalog.pratt.edu/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "503 Service Unavailable

Down for Maintenance

Coursedog catalog is temporarily unavailable. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/courseleaf.json b/hub/test/fixtures/adapters/courseleaf.json index ef0c6b9..2cf5987 100644 --- a/hub/test/fixtures/adapters/courseleaf.json +++ b/hub/test/fixtures/adapters/courseleaf.json @@ -13,12 +13,23 @@ { "name": "http-404", "status": 404, - "payload": "404 Page Not Found

Not Found

" + "payload": "404 Not Found

Not Found

" }, { - "name": "maintenance-or-block", + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://catalog.unc.edu/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-shell", "status": 503, - "payload": "Scheduled Maintenance

Service Unavailable

" + "payload": "Service Unavailable

Scheduled Maintenance

Catalog is temporarily unavailable. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" } ] } diff --git a/hub/test/fixtures/adapters/dkan.json b/hub/test/fixtures/adapters/dkan.json index 3ed3003..ab65400 100644 --- a/hub/test/fixtures/adapters/dkan.json +++ b/hub/test/fixtures/adapters/dkan.json @@ -15,10 +15,21 @@ "status": 404, "payload": "{\"message\":\"Not found\",\"status\":404}" }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://data.medicaid.gov/error", + "payload": "404 Page Not Found

Page Not Found

" + }, { "name": "maintenance-or-block", "status": 503, "payload": "Scheduled Maintenance

Service Unavailable

" + }, + { + "name": "empty-dataset-array", + "status": 200, + "payload": "[]" } ] } diff --git a/hub/test/fixtures/adapters/edlio-thrillshare.json b/hub/test/fixtures/adapters/edlio-thrillshare.json new file mode 100644 index 0000000..57b65d2 --- /dev/null +++ b/hub/test/fixtures/adapters/edlio-thrillshare.json @@ -0,0 +1,35 @@ +{ + "adapterId": "edlio-thrillshare", + "mode": "html", + "inputUrl": "https://www.worldcompassacademy.com/apps/news/", + "mockPayload": "News | World Compass Academy

School News & Announcements

Science Fair Winners Announced

Congratulations to all middle school STEM finalists.

", + "expectTitleIncludes": "School News", + "expectMarkdownIncludes": [ + "World Compass Academy", + "Edlio", + "Science Fair Winners Announced" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.worldcompassacademy.com/error", + "payload": "Error
Error
" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "Service Unavailable

Under Maintenance

Portal is temporarily unavailable. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/edu-job-boards.json b/hub/test/fixtures/adapters/edu-job-boards.json new file mode 100644 index 0000000..e106ac9 --- /dev/null +++ b/hub/test/fixtures/adapters/edu-job-boards.json @@ -0,0 +1,41 @@ +{ + "adapterId": "edu-job-boards", + "mode": "html", + "inputUrl": "https://jobs.chronicle.com/job/38070836/director-of-occupational-therapy/", + "mockPayload": "Director of Occupational Therapy | Chronicle Jobs

Director of Occupational Therapy

Direct accredited graduate occupational therapy curriculum and clinical partnerships.

", + "expectTitleIncludes": "Director of Occupational Therapy", + "expectMarkdownIncludes": [ + "Pacific Northwest University", + "Yakima, WA, US", + "2026-11-19", + "occupational therapy curriculum" + ], + "negativeCases": [ + { + "name": "incapsula-waf-challenge", + "status": 200, + "payload": "" + }, + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found

Job Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://jobs.chronicle.com/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-page", + "status": 503, + "payload": "Scheduled Maintenance

System Under Maintenance

" + }, + { + "name": "edjoin-unhydrated-csr-template", + "status": 200, + "payload": "Search
\"><%- item.positionTitle %>
" + } + ] +} diff --git a/hub/test/fixtures/adapters/edx-coursera.json b/hub/test/fixtures/adapters/edx-coursera.json new file mode 100644 index 0000000..0f14ba8 --- /dev/null +++ b/hub/test/fixtures/adapters/edx-coursera.json @@ -0,0 +1,37 @@ +{ + "adapterId": "edx-coursera", + "mode": "twin", + "inputUrl": "https://courses.edx.org/api/courses/v1/courses/course-v1:HarvardX+CS50+X/", + "expectedFetchUrl": "https://courses.edx.org/api/courses/v1/courses/course-v1:HarvardX+CS50+X/", + "mockPayload": "{\"id\":\"course-v1:HarvardX+CS50+X\",\"name\":\"CS50's Introduction to Computer Science\",\"number\":\"CS50\",\"org\":\"HarvardX\",\"effort\":\"10-20 hours per week\",\"pacing\":\"self\",\"start\":\"2026-01-01T00:00:00Z\",\"short_description\":\"An introduction to the intellectual enterprises of computer science and the art of programming.\"}", + "expectTitleIncludes": "CS50's Introduction to Computer Science", + "expectMarkdownIncludes": [ + "HarvardX", + "CS50", + "edX", + "art of programming" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "{\"detail\":\"Not found.\"}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://courses.edx.org/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "Service Unavailable

Scheduled Maintenance

edX is temporarily unavailable due to scheduled maintenance. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/finalsite.json b/hub/test/fixtures/adapters/finalsite.json new file mode 100644 index 0000000..e8969c9 --- /dev/null +++ b/hub/test/fixtures/adapters/finalsite.json @@ -0,0 +1,36 @@ +{ + "adapterId": "finalsite", + "mode": "html", + "inputUrl": "https://www.greenwichschools.org/calendar", + "mockPayload": "Calendar | Greenwich Public Schools

District Calendar

Board of Education Regular Meeting2026-12-03
2026-27 Academic Calendar PDF
", + "expectTitleIncludes": "District Calendar", + "expectMarkdownIncludes": [ + "Greenwich Public Schools", + "Finalsite", + "Board of Education Regular Meeting", + "2026-27 Academic Calendar PDF" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found - Greenwich Public Schools

404 - Page Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.greenwichschools.org/error", + "payload": "Error
Page Error
" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "Service Unavailable

Scheduled Maintenance

This Finalsite portal is temporarily unavailable due to scheduled maintenance. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/granicus-govdelivery.json b/hub/test/fixtures/adapters/granicus-govdelivery.json new file mode 100644 index 0000000..7723c40 --- /dev/null +++ b/hub/test/fixtures/adapters/granicus-govdelivery.json @@ -0,0 +1,40 @@ +{ + "adapterId": "granicus-govdelivery", + "mode": "html", + "inputUrl": "https://content.govdelivery.com/accounts/ILEVANSTON/bulletins/4345149", + "mockPayload": "Winter Snow Operations Update
City of Evanston • 2026-11-24

Winter Snow Operations Update

Public Works crews are prepared for winter snow clearing operations across municipal arterials and neighborhood routes.

Snow Route Map
Sent by City of Evanston
", + "expectTitleIncludes": "Winter Snow Operations Update", + "expectMarkdownIncludes": [ + "Granicus GovDelivery", + "Winter Snow Operations Update", + "Public Works crews" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://content.govdelivery.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This service is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + }, + { + "name": "http-406-not-acceptable", + "status": 406, + "payload": "Not Acceptable

406

" + } + ] +} diff --git a/hub/test/fixtures/adapters/healthcare-careers.json b/hub/test/fixtures/adapters/healthcare-careers.json new file mode 100644 index 0000000..f76b440 --- /dev/null +++ b/hub/test/fixtures/adapters/healthcare-careers.json @@ -0,0 +1,41 @@ +{ + "adapterId": "healthcare-careers", + "mode": "html", + "inputUrl": "https://pm.healthcaresource.com/CS/midwesthealth#/job/98123", + "mockPayload": "ICU Charge Nurse | Midwest Health

ICU Charge Nurse

Coordinate critical care nursing teams in a 32-bed Magnet-designated intensive care unit.

", + "expectTitleIncludes": "ICU Charge Nurse", + "expectMarkdownIncludes": [ + "Midwest Health System", + "Madison, WI, US", + "2026-11-21", + "Magnet-designated intensive care unit" + ], + "negativeCases": [ + { + "name": "healthcaresource-application-error", + "status": 200, + "payload": "Application Error

You have encountered a system error. Please verify that you have entered the correct URL .

" + }, + { + "name": "cloudflare-challenge", + "status": 403, + "payload": "Just a moment...
Checking your browser before accessing...
" + }, + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://pm.healthcaresource.com/error", + "payload": "Error

Error

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Careers
" + } + ] +} diff --git a/hub/test/fixtures/adapters/junar-tyler-data.json b/hub/test/fixtures/adapters/junar-tyler-data.json new file mode 100644 index 0000000..42429a9 --- /dev/null +++ b/hub/test/fixtures/adapters/junar-tyler-data.json @@ -0,0 +1,40 @@ +{ + "adapterId": "junar-tyler-data", + "mode": "html", + "inputUrl": "https://data.paloalto.gov/dataviews/251890/business-registry-2018/", + "mockPayload": "Business Registry 2018 - City of Palo Alto Open Data

Business Registry 2018

Active municipal business registry records published via Junar Open Data portal.

Download CSV
", + "expectTitleIncludes": "Business Registry 2018", + "expectMarkdownIncludes": [ + "Junar / Tyler Open Data", + "Business Registry 2018" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://data.paloalto.gov/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This portal is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + }, + { + "name": "tyler-login-redirect", + "status": 200, + "finalUrl": "https://data.tylertech.com/login", + "payload": "Sign In

Sign In

" + } + ] +} diff --git a/hub/test/fixtures/adapters/laserfiche-weblink.json b/hub/test/fixtures/adapters/laserfiche-weblink.json index ebb3e98..ee52ed9 100644 --- a/hub/test/fixtures/adapters/laserfiche-weblink.json +++ b/hub/test/fixtures/adapters/laserfiche-weblink.json @@ -16,10 +16,21 @@ "status": 404, "payload": "{\"data\":{\"name\":null,\"folderId\":0,\"results\":null,\"failed\":true}}" }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://cc-publicdocs.santa-ana.org/error", + "payload": "404 Page Not Found

Page Not Found

" + }, { "name": "maintenance-or-block", "status": 503, "payload": "Scheduled Maintenance

Service Unavailable

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" } ] } diff --git a/hub/test/fixtures/adapters/municipal-cms-pack.json b/hub/test/fixtures/adapters/municipal-cms-pack.json new file mode 100644 index 0000000..1b942a6 --- /dev/null +++ b/hub/test/fixtures/adapters/municipal-cms-pack.json @@ -0,0 +1,35 @@ +{ + "adapterId": "municipal-cms-pack", + "mode": "html", + "inputUrl": "https://www.maplevalleywa.gov/government/city_council_meetings_agendas_and_minutes.php", + "mockPayload": "City Council Meetings - Maple Valley WA

City Council Meetings, Agendas and Minutes

Access official Maple Valley City Council meeting packets, schedules, and approved minutes.

November 2026 Council Agenda
", + "expectTitleIncludes": "City Council Meetings, Agendas and Minutes", + "expectMarkdownIncludes": [ + "revize", + "Maple Valley City Council", + "November 2026 Council Agenda" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Page Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.maplevalleywa.gov/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This website is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/neogov.json b/hub/test/fixtures/adapters/neogov.json new file mode 100644 index 0000000..3828034 --- /dev/null +++ b/hub/test/fixtures/adapters/neogov.json @@ -0,0 +1,36 @@ +{ + "adapterId": "neogov", + "mode": "html", + "inputUrl": "https://www.governmentjobs.com/careers/lacounty/jobs/4567890/senior-civil-engineer", + "mockPayload": "Senior Civil Engineer | County of Los Angeles

Senior Civil Engineer

Lead structural design and capital infrastructure inspections for county public works projects.

", + "expectTitleIncludes": "Senior Civil Engineer", + "expectMarkdownIncludes": [ + "County of Los Angeles", + "Los Angeles, CA, US", + "2026-11-20", + "capital infrastructure inspections" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found

Job Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.governmentjobs.com/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-page", + "status": 503, + "payload": "Scheduled Maintenance

System Under Maintenance

Please check back later.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Job Details

Job Details

" + } + ] +} diff --git a/hub/test/fixtures/adapters/opendatasoft.json b/hub/test/fixtures/adapters/opendatasoft.json index cce4900..c26a52d 100644 --- a/hub/test/fixtures/adapters/opendatasoft.json +++ b/hub/test/fixtures/adapters/opendatasoft.json @@ -3,7 +3,7 @@ "mode": "twin", "inputUrl": "https://public.opendatasoft.com/explore/dataset/us-state-boundaries/", "expectedFetchUrl": "https://public.opendatasoft.com/api/explore/v2.1/catalog/datasets/us-state-boundaries", - "mockPayload": "{\"visibility\":\"domain\",\"fields\":[{\"name\":\"gid\",\"description\":null,\"annotations\":{},\"label\":\"gid\",\"type\":\"int\",\"label_en\":\"gid\",\"label_fr\":\"gid\",\"description_en\":null,\"description_fr\":null},{\"name\":\"arealand\",\"description\":null,\"annotations\":{\"facetsort\":\"-count\"},\"label\":\"arealand\",\"type\":\"text\",\"label_en\":\"arealand\",\"label_fr\":\"arealand\",\"description_en\":null,\"description_fr\":null},{\"name\":\"division\",\"description\":null,\"annotations\":{},\"label\":\"division\",\"type\":\"int\",\"label_en\":\"division\",\"label_fr\":\"division\",\"description_en\":null,\"description_fr\":null},{\"name\":\"intptlat\",\"description\":null,\"annotations\":{},\"label\":\"intptlat\",\"type\":\"double\",\"label_en\":\"intptlat\",\"label_fr\":\"intptlat\",\"description_en\":null,\"description_fr\":null},{\"name\":\"name\",\"description\":null,\"annotations\":{\"facet\":true},\"label\":\"name\",\"type\":\"text\",\"label_en\":\"name\",\"label_fr\":\"name\",\"description_en\":null,\"description_fr\":null},{\"name\":\"objectid\",\"description\":null,\"annotations\":{},\"label\":\"objectid\",\"type\":\"int\",\"label_en\":\"objectid\",\"label_fr\":\"objectid\",\"description_en\":null,\"description_fr\":null},{\"name\":\"areawater\",\"description\":null,\"annotations\":{\"facetsort\":\"-count\"},\"label\":\"areawater\",\"type\":\"text\",\"label_en\":\"areawater\",\"label_fr\":\"areawater\",\"description_en\":null,\"description_fr\":null},{\"name\":\"intptlon\",\"description\":null,\"annotations\":{},\"label\":\"intptlon\",\"type\":\"double\",\"label_en\":\"intptlon\",\"label_fr\":\"intptlon\",\"description_en\":null,\"description_fr\":null}],\"dataset_id\":\"us-state-boundaries\",\"dataset_uid\":\"da_2w3hfe\",\"has_records\":true,\"features\":[\"analyze\",\"geo\"],\"attachments\":[],\"alternative_exports\":[],\"data_visible\":true,\"metas\":{\"default\":{\"title\":\"US State Boundaries\",\"description\":\"

This dataset represents States and equivalent entities, which are the primary governmental divisions of the United States. The TIGER/Line shapefiles and related database files (.dbf) are an extract of selected geographic and cartographic information from the U.S. Census Bureau's Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB). The MTDB represents a seamless national file with no overlaps or gaps between parts, however, each TIGER/Line shapefile is designed to stand alone as an independent data set, or they can be combined to cover the entire nation. In addition to the fifty States, the Census Bureau treats the District of Columbia, Puerto Rico, and each of the Island Areas (American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands) as the statistical equivalents of States for the purpose of data presentation.

\",\"theme\":[\"Administration\"],\"keyword\":[\"States\",\"US\",\"Boundary\",\"Boundaries\"],\"license\":\"Public domain\",\"license_url\":\"https://en.wikipedia.org/wiki/Public_domain\",\"language\":\"en\",\"modified\":\"2017-06-27T13:41:50+00:00\",\"publisher\":\"U.S. Census Bureau\",\"references\":\"https://hifld-geoplatform.opendata.arcgis.com/datasets/us-state-boundaries\",\"attributions\":null,\"update_frequency\":null,\"bbox\":{\"type\":\"Feature\",\"geometry\":{\"coordinates\":[[[-64.51267403550446,71.44068698398769],[144.56357399001718,71.44068698398769],[144.56357399001718,-14.601813023909926],[-64.51267403550446,-14.601813023909926],[-64.51267403550446,71.44068698398769]]],\"type\":\"Polygon\"},\"properties\":{}},\"data_processed\":\"2019-10-24T08:34:32+00:00\",\"federated\":false,\"geographic_reference\":[\"world\"],\"geographic_reference_auto\":true,\"geometry_types\":[\"MultiPolygon\",\"Polygon\"],\"metadata_languages\":[\"en\"],\"metadata_processed\":\"2025-09-18T08:03:51.203000+00:00\",\"modified_updates_on_data_change\":false,\"modified_updates_on_metadata_change\":false,\"parent_domain\":null,\"records_count\":56,\"shared_catalog\":null,\"source_dataset\":null,\"source_domain\":null,\"source_domain_address\":null,\"source_domain_title\":null,\"territory\":[\"World\"],\"timezone\":null}}}\n", + "mockPayload": "{\"visibility\":\"domain\",\"fields\":[{\"name\":\"gid\",\"description\":null,\"annotations\":{},\"label\":\"gid\",\"type\":\"int\",\"label_en\":\"gid\",\"label_fr\":\"gid\",\"description_en\":null,\"description_fr\":null},{\"name\":\"arealand\",\"description\":null,\"annotations\":{\"facetsort\":\"-count\"},\"label\":\"arealand\",\"type\":\"text\",\"label_en\":\"arealand\",\"label_fr\":\"arealand\",\"description_en\":null,\"description_fr\":null},{\"name\":\"division\",\"description\":null,\"annotations\":{},\"label\":\"division\",\"type\":\"int\",\"label_en\":\"division\",\"label_fr\":\"division\",\"description_en\":null,\"description_fr\":null},{\"name\":\"intptlat\",\"description\":null,\"annotations\":{},\"label\":\"intptlat\",\"type\":\"double\",\"label_en\":\"intptlat\",\"label_fr\":\"intptlat\",\"description_en\":null,\"description_fr\":null},{\"name\":\"name\",\"description\":null,\"annotations\":{\"facet\":true},\"label\":\"name\",\"type\":\"text\",\"label_en\":\"name\",\"label_fr\":\"name\",\"description_en\":null,\"description_fr\":null},{\"name\":\"objectid\",\"description\":null,\"annotations\":{},\"label\":\"objectid\",\"type\":\"int\",\"label_en\":\"objectid\",\"label_fr\":\"objectid\",\"description_en\":null,\"description_fr\":null},{\"name\":\"areawater\",\"description\":null,\"annotations\":{\"facetsort\":\"-count\"},\"label\":\"areawater\",\"type\":\"text\",\"label_en\":\"areawater\",\"label_fr\":\"areawater\",\"description_en\":null,\"description_fr\":null},{\"name\":\"intptlon\",\"description\":null,\"annotations\":{},\"label\":\"intptlon\",\"type\":\"double\",\"label_en\":\"intptlon\",\"label_fr\":\"intptlon\",\"description_en\":null,\"description_fr\":null}],\"dataset_id\":\"us-state-boundaries\",\"dataset_uid\":\"da_2w3hfe\",\"has_records\":true,\"features\":[\"analyze\",\"geo\"],\"attachments\":[],\"alternative_exports\":[],\"data_visible\":true,\"metas\":{\"default\":{\"title\":\"US State Boundaries\",\"description\":\"

This dataset represents States and equivalent entities, which are the primary governmental divisions of the United States. The TIGER/Line shapefiles and related database files (.dbf) are an extract of selected geographic and cartographic information from the U.S. Census Bureau's Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB). The MTDB represents a seamless national file with no overlaps or gaps between parts, however, each TIGER/Line shapefile is designed to stand alone as an independent data set, or they can be combined to cover the entire nation. In addition to the fifty States, the Census Bureau treats the District of Columbia, Puerto Rico, and each of the Island Areas (American Samoa, the Commonwealth of the Northern Mariana Islands, Guam, and the U.S. Virgin Islands) as the statistical equivalents of States for the purpose of data presentation.

\",\"theme\":[\"Administration\"],\"keyword\":[\"States\",\"US\",\"Boundary\",\"Boundaries\"],\"license\":\"Public domain\",\"license_url\":\"https://en.wikipedia.org/wiki/Public_domain\",\"language\":\"en\",\"modified\":\"2017-06-27T13:41:50+00:00\",\"publisher\":\"U.S. Census Bureau\",\"references\":\"https://hifld-geoplatform.opendata.arcgis.com/datasets/us-state-boundaries\",\"attributions\":null,\"update_frequency\":null,\"bbox\":{\"type\":\"Feature\",\"geometry\":{\"coordinates\":[[[-64.51267403550446,71.44068698398769],[144.56357399001718,71.44068698398769],[144.56357399001718,-14.601813023909926],[-64.51267403550446,-14.601813023909926],[-64.51267403550446,71.44068698398769]]],\"type\":\"Polygon\"},\"properties\":{}},\"data_processed\":\"2019-10-24T08:34:32+00:00\",\"federated\":false,\"geographic_reference\":[\"world\"],\"geographic_reference_auto\":true,\"geometry_types\":[\"MultiPolygon\",\"Polygon\"],\"metadata_languages\":[\"en\"],\"metadata_processed\":\"2025-09-18T08:03:51.203000+00:00\",\"modified_updates_on_data_change\":false,\"modified_updates_on_metadata_change\":false,\"parent_domain\":null,\"records_count\":56,\"shared_catalog\":null,\"source_dataset\":null,\"source_domain\":null,\"source_domain_title\":null,\"territory\":[\"World\"],\"timezone\":null}}}\n", "expectTitleIncludes": "US State Boundaries", "expectMarkdownIncludes": [ "`us-state-boundaries`", @@ -16,10 +16,21 @@ "status": 404, "payload": "{\"message\":\"Not found\",\"status\":404}" }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://public.opendatasoft.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, { "name": "maintenance-or-block", "status": 503, "payload": "Scheduled Maintenance

Service Unavailable

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" } ] } diff --git a/hub/test/fixtures/adapters/opengov-portals.json b/hub/test/fixtures/adapters/opengov-portals.json new file mode 100644 index 0000000..8010861 --- /dev/null +++ b/hub/test/fixtures/adapters/opengov-portals.json @@ -0,0 +1,35 @@ +{ + "adapterId": "opengov-portals", + "mode": "html", + "inputUrl": "https://torranceca.opengov.com/transparency", + "mockPayload": "City of Torrance Transparency Portal

City of Torrance Financial Transparency

Explore annual operating budgets, general fund revenues, departmental expenditures, and capital improvement projects.

", + "expectTitleIncludes": "City of Torrance", + "expectMarkdownIncludes": [ + "OpenGov Portal", + "City of Torrance", + "2026" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "OpenGov — Page Not Found

Page Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://torranceca.opengov.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This portal is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/paradox-olivia.json b/hub/test/fixtures/adapters/paradox-olivia.json new file mode 100644 index 0000000..b1484ee --- /dev/null +++ b/hub/test/fixtures/adapters/paradox-olivia.json @@ -0,0 +1,36 @@ +{ + "adapterId": "paradox-olivia", + "mode": "html", + "inputUrl": "https://careers.fedex.com/account-manager-ii/job/P25-397759-1", + "mockPayload": "Account Manager II | FedEx Careers

Account Manager II

Powered by Paradox Olivia

", + "expectTitleIncludes": "Account Manager II", + "expectMarkdownIncludes": [ + "FedEx", + "Memphis, TN, US", + "2026-11-22", + "enterprise freight accounts" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found

Job Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://careers.fedex.com/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-page", + "status": 503, + "payload": "Scheduled Maintenance

System Under Maintenance

" + }, + { + "name": "empty-next-spa-shell", + "status": 200, + "payload": "Loading
" + } + ] +} diff --git a/hub/test/fixtures/adapters/primegov.json b/hub/test/fixtures/adapters/primegov.json new file mode 100644 index 0000000..33534fe --- /dev/null +++ b/hub/test/fixtures/adapters/primegov.json @@ -0,0 +1,36 @@ +{ + "adapterId": "primegov", + "mode": "twin", + "inputUrl": "https://okc.primegov.com/public/portal", + "expectedFetchUrl": "https://okc.primegov.com/api/v2/PublicPortal/ListUpcomingMeetings", + "mockPayload": "[{\"id\":8812,\"title\":\"City Council Regular Meeting\",\"dateTime\":\"2026-12-08T08:30:00\",\"committeeName\":\"City Council\",\"agendaUrl\":\"https://okc.primegov.com/Portal/Meeting?meetingTemplateId=8812\"}]", + "expectTitleIncludes": "PrimeGov Meetings", + "expectMarkdownIncludes": [ + "City Council Regular Meeting", + "2026-12-08T08:30:00", + "City Council" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "{\"error\":\"Not Found\"}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://okc.primegov.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This service is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-meetings-array", + "status": 200, + "payload": "[]" + } + ] +} diff --git a/hub/test/fixtures/adapters/public-bid-portals.json b/hub/test/fixtures/adapters/public-bid-portals.json new file mode 100644 index 0000000..fa1daef --- /dev/null +++ b/hub/test/fixtures/adapters/public-bid-portals.json @@ -0,0 +1,41 @@ +{ + "adapterId": "public-bid-portals", + "mode": "html", + "inputUrl": "https://www.bidnetdirect.com/colorado/solicitations/open-bids/W-38th-Ave-Multimodal-Improvements-Design-Services/0000443656?purchasingGroupId=8409951&origin=2", + "mockPayload": "202686685 - W. 38th Ave. Multimodal Improvements Design Services
Login

202686685 - W. 38th Ave. Multimodal Improvements Design Services

Reference Number
0000443656
Closing Date
2026-12-15 14:00 MST
Location
Denver, Colorado

The City and County of Denver Department of Transportation and Infrastructure seeks qualified civil engineering consulting firms to provide preliminary and final roadway design, multimodal pedestrian safety engineering, storm drainage analysis, signal timing design, utility coordination, public outreach support, environmental clearance documentation, and construction phase engineering support services along the West 38th Avenue corridor.

", + "expectTitleIncludes": "W. 38th Ave. Multimodal Improvements Design Services", + "expectMarkdownIncludes": [ + "bidnet", + "0000443656", + "City and County of Denver DOTI", + "2026-12-15 14:00 MST" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://www.bidnetdirect.com/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This portal is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + }, + { + "name": "login-wall-gated-detail", + "status": 200, + "payload": "Sign In

Sign In

Please sign in to view solicitation attachments and register to download bid documents.

" + } + ] +} diff --git a/hub/test/fixtures/adapters/schema-course.json b/hub/test/fixtures/adapters/schema-course.json new file mode 100644 index 0000000..0e5a804 --- /dev/null +++ b/hub/test/fixtures/adapters/schema-course.json @@ -0,0 +1,36 @@ +{ + "adapterId": "schema-course", + "mode": "html", + "inputUrl": "https://pll.harvard.edu/course/cs50-introduction-computer-science", + "mockPayload": "CS50's Introduction to Computer Science | Harvard

CS50's Introduction to Computer Science

", + "expectTitleIncludes": "CS50's Introduction to Computer Science", + "expectMarkdownIncludes": [ + "Harvard University", + "CS50", + "David J. Malan", + "Online" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Page Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://pll.harvard.edu/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-shell", + "status": 503, + "payload": "503 Service Unavailable

Scheduled Maintenance

This site is down for maintenance. Please check back soon.

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Loading...
" + } + ] +} diff --git a/hub/test/fixtures/adapters/smb-ats-full.json b/hub/test/fixtures/adapters/smb-ats-full.json new file mode 100644 index 0000000..758009d --- /dev/null +++ b/hub/test/fixtures/adapters/smb-ats-full.json @@ -0,0 +1,43 @@ +{ + "adapterId": "smb-ats-full", + "mode": "twin", + "inputUrl": "https://api.manatal.com/open/v3/career-page/manatal/jobs/", + "expectedFetchUrl": "https://api.manatal.com/open/v3/career-page/manatal/jobs/", + "mockPayload": "{\"count\":2,\"next\":null,\"previous\":null,\"results\":[{\"id\":2883259,\"hash\":\"L9Y69V66\",\"organization_name\":\"Manatal\",\"position_name\":\"Senior Backend Engineer\",\"city\":\"Bangkok\",\"state\":\"\",\"country\":\"Thailand\",\"is_remote\":true,\"contract_details\":\"Full-time\",\"created_at\":\"2026-11-15T08:00:00Z\",\"description\":\"

Build scalable recruitment APIs in Python and Go.

\"},{\"id\":2883260,\"hash\":\"K4P19Z11\",\"organization_name\":\"Manatal\",\"position_name\":\"Product Designer\",\"city\":\"Remote\",\"state\":\"\",\"country\":\"Global\",\"is_remote\":true,\"contract_details\":\"Full-time\",\"created_at\":\"2026-11-16T08:00:00Z\",\"description\":\"

Craft candidate workflow experiences.

\"}]}", + "expectTitleIncludes": "Manatal — Open Roles", + "expectMarkdownIncludes": [ + "Senior Backend Engineer", + "Product Designer", + "2026-11-15", + "Remote" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "{\"detail\":\"Not found.\"}" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://api.manatal.com/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-page", + "status": 503, + "payload": "Service Unavailable

Under Maintenance

" + }, + { + "name": "empty-results-json", + "status": 200, + "payload": "{\"count\":0,\"next\":null,\"previous\":null,\"results\":[]}" + }, + { + "name": "homerun-404-redirect-shell", + "status": 200, + "finalUrl": "https://404.homerun.co/vacancies/jobs/homerun", + "payload": "404 - Page Not Found

Vacancy not found

" + } + ] +} diff --git a/hub/test/fixtures/adapters/staffing-ats-pack.json b/hub/test/fixtures/adapters/staffing-ats-pack.json new file mode 100644 index 0000000..8d4b4ad --- /dev/null +++ b/hub/test/fixtures/adapters/staffing-ats-pack.json @@ -0,0 +1,42 @@ +{ + "adapterId": "staffing-ats-pack", + "mode": "html", + "inputUrl": "https://jobs.crelate.com/portal/promotive", + "mockPayload": "Promotive Staffing Jobs | Crelate

Senior Embedded Firmware Engineer

Crelate Portal

", + "expectTitleIncludes": "Senior Embedded Firmware Engineer", + "expectMarkdownIncludes": [ + "Promotive Staffing", + "San Diego, CA, US", + "2026-11-21", + "RTOS firmware" + ], + "negativeCases": [ + { + "name": "organization-portal-disabled", + "status": 200, + "finalUrl": "https://jobs.crelate.com/Public/DisabledPortal", + "payload": "Organization Portal Disabled

Organization Portal Disabled

This job board is currently disabled.

" + }, + { + "name": "http-404", + "status": 404, + "payload": "404 - Page Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://jobs.crelate.com/error", + "payload": "Error

Error

" + }, + { + "name": "maintenance-page", + "status": 503, + "payload": "Service Unavailable

Under Maintenance

" + }, + { + "name": "empty-spa-shell", + "status": 200, + "payload": "Careers
" + } + ] +} diff --git a/hub/test/fixtures/adapters/taleo-full.json b/hub/test/fixtures/adapters/taleo-full.json index e6d8502..7d22357 100644 --- a/hub/test/fixtures/adapters/taleo-full.json +++ b/hub/test/fixtures/adapters/taleo-full.json @@ -15,10 +15,21 @@ "status": 404, "payload": "{\"message\":\"Not found\",\"status\":404}" }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://hdr.taleo.net/error", + "payload": "Error

Error

" + }, { "name": "maintenance-or-block", "status": 503, "payload": "Scheduled Maintenance

Service Unavailable

" + }, + { + "name": "empty-requisition-list", + "status": 200, + "payload": "{\"requisitionList\":[]}" } ] } diff --git a/hub/test/fixtures/adapters/tyler-energov.json b/hub/test/fixtures/adapters/tyler-energov.json new file mode 100644 index 0000000..368e087 --- /dev/null +++ b/hub/test/fixtures/adapters/tyler-energov.json @@ -0,0 +1,35 @@ +{ + "adapterId": "tyler-energov", + "mode": "html", + "inputUrl": "https://energovweb.capecoral.gov/EnerGovProd/selfservice", + "mockPayload": "Building Permit BLDR-2026-0412 - EnerGov SelfService

Building Permit BLDR-2026-0412

Permit Type: Residential Alteration Permit. Status: Issued. Parcel Address: 1015 Cultural Park Blvd, Cape Coral, FL 33990. Issued Date: 2026-11-18.

", + "expectTitleIncludes": "BLDR-2026-0412", + "expectMarkdownIncludes": [ + "Tyler EnerGov", + "BLDR-2026-0412", + "Cultural Park Blvd" + ], + "negativeCases": [ + { + "name": "http-404", + "status": 404, + "payload": "404 Not Found

Not Found

" + }, + { + "name": "redirect-to-error", + "status": 200, + "finalUrl": "https://energovweb.capecoral.gov/error", + "payload": "404 Page Not Found

Page Not Found

" + }, + { + "name": "maintenance", + "status": 200, + "payload": "Scheduled Maintenance

This service is currently undergoing scheduled maintenance. Please check back shortly.

" + }, + { + "name": "empty-angularjs-spa-shell", + "status": 200, + "payload": "SelfService Public Site" + } + ] +} diff --git a/hub/test/wave3-b1-cat-a.ts b/hub/test/wave3-b1-cat-a.ts new file mode 100644 index 0000000..c276bfb --- /dev/null +++ b/hub/test/wave3-b1-cat-a.ts @@ -0,0 +1,689 @@ +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; +import test from 'node:test'; +import { resolveAdapterPolicyForUrl } from '../src/adapter-policy'; +import { KNOWN_TELEMETRY_ADAPTER_IDS } from '../src/dev-telemetry'; +import { validateSingleErrorEvent } from '../../telemetry/src/index'; +import { DECLARATIVE_SITE_ADAPTERS } from '../src/extractors/declarative'; +import { resolveSiteExtractorTwin } from '../src/extractors/registry'; +import { postExtractHtml } from './post-fetch-wasm'; +import { resetOverflowRobotsCacheForTests } from '../src/overflow'; +import { RequestTracer } from '../src/otel'; +import { executeScrapeCall, isTrustedTwinRedirectUrl } from '../src/scrape'; +import { executeExtractCall } from '../src/search-index'; +import { resetIsolateBudgetForTests } from '../src/wasm-bridge'; + +export const WAVE3_B1_CAT_A_IDS = [ + 'civicplus', + 'granicus-govdelivery', + 'municipal-cms-pack', + 'boarddocs', + 'civicclerk', + 'primegov', + 'agenda-portal-pack', + 'laserfiche-weblink', + 'accela-citizen-access', + 'tyler-energov', + 'opengov-portals', + 'public-bid-portals', + 'arcgis-hub', + 'dkan', + 'opendatasoft', + 'junar-tyler-data', +] as const; + +interface GovFixture { + adapterId: string; + mode: 'twin' | 'html'; + inputUrl: string; + expectedFetchUrl?: string; + mockPayload: string; + expectTitleIncludes?: string; + expectMarkdownIncludes: string[]; + negativeCases: Array<{ name: string; status?: number; finalUrl?: string; payload: string }>; +} + +const noopHtmlToMd = () => ({ markdown: '', links: [] as string[] }); + +export function registerWave3B1CatATests(): void { + test('Wave 3 B1 Category A: All 16 Local Gov adapter IDs registered with Rule 7 & domain separation intact', () => { + const registered = new Set(DECLARATIVE_SITE_ADAPTERS.map((a) => a.id)); + for (const id of WAVE3_B1_CAT_A_IDS) { + assert.ok(registered.has(id), `Missing Wave 3 B1 Category A manifest: ${id}`); + assert.ok(KNOWN_TELEMETRY_ADAPTER_IDS.has(id), `Missing KNOWN_TELEMETRY_ADAPTER_IDS entry: ${id}`); + assert.equal( + validateSingleErrorEvent({ + schemaVersion: 1, + version: '2.8.32', + runtime: 'workers', + os: 'cloudflare', + arch: 'v8', + mode: 'hub', + spanName: 'edgefetch.scrape', + adapterId: id, + wafVendor: '', + httpStatus: 500, + errorClass: 'timeout', + }).ok, + true, + `Collector validateSingleErrorEvent rejected adapterId: ${id}`, + ); + } + + const arcgis = DECLARATIVE_SITE_ADAPTERS.find((a) => a.id === 'arcgis'); + assert.ok(arcgis); + assert.deepEqual(arcgis.domains, ['services.arcgis.com'], 'arcgis.yaml must be narrowed to services.arcgis.com'); + assert.equal(arcgis.universalEngine, true, 'arcgis.yaml must preserve universalEngine: true'); + + const dkan = DECLARATIVE_SITE_ADAPTERS.find((a) => a.id === 'dkan'); + assert.ok(dkan); + assert.equal(dkan.universalEngine, true); + for (const forbiddenDkan of ['data.cms.gov', 'healthdata.gov']) { + assert.equal(dkan.domains.includes(forbiddenDkan), false, `#214 dkan must NOT claim ${forbiddenDkan}`); + } + + const ods = DECLARATIVE_SITE_ADAPTERS.find((a) => a.id === 'opendatasoft'); + assert.ok(ods); + assert.equal(ods.strictRobots, true, '#215 opendatasoft must enforce strictRobots'); + assert.equal( + resolveSiteExtractorTwin('https://public.opendatasoft.com/explore/assets/geonames-all-cities-with-a-population-1000/'), + null, + '#215 opendatasoft must NOT rewrite HTML /explore/ URLs to robots-disallowed /api/', + ); + + const govdeliv = DECLARATIVE_SITE_ADAPTERS.find((a) => a.id === 'granicus-govdelivery'); + assert.ok(govdeliv); + assert.equal( + resolveSiteExtractorTwin('https://content.govdelivery.com/accounts/ILEVANSTON/bulletins/4345149'), + null, + '#202 granicus-govdelivery must NOT rewrite HTML bulletins to .rss', + ); + + const junar = DECLARATIVE_SITE_ADAPTERS.find((a) => a.id === 'junar-tyler-data'); + assert.ok(junar); + assert.equal( + junar.domains.some((d) => d.includes('socrata.com')), + false, + '#216 junar-tyler-data must NOT claim *.socrata.com', + ); + + for (const strictId of ['primegov', 'agenda-portal-pack', 'public-bid-portals', 'boarddocs', 'opendatasoft']) { + const a = DECLARATIVE_SITE_ADAPTERS.find((x) => x.id === strictId); + assert.ok(a?.strictRobots, `${strictId} must enforce strictRobots: true`); + } + + const arcHubPol = resolveAdapterPolicyForUrl('https://hub.arcgis.com/api/v3/datasets'); + assert.equal(arcHubPol.adapterId, 'arcgis-hub'); + const arcHubTwin = resolveSiteExtractorTwin('https://opendata.dc.gov/api/v3/datasets?page[size]=1'); + assert.ok(arcHubTwin && arcHubTwin.id === 'arcgis-hub'); + assert.ok(arcHubTwin.fetchUrl.includes('fields%5Bdatasets%5D='), '#213 arcgis-hub must project sparse fields[datasets]'); + + const ccTwin = resolveSiteExtractorTwin('https://mauicounty.portal.civicclerk.com/'); + assert.ok(ccTwin && ccTwin.fetchUrl === 'https://mauicounty.api.civicclerk.com/v1/Events?$top=25'); + + const compileSrc = readFileSync(resolve('scripts', 'compile-manifests.mjs'), 'utf8'); + for (const forbidden of [ + '*.civicclerk.com', + '*.primegov.com', + '*.escribemeetings.com', + '*.novusagenda.com', + '*.civicweb.net', + '*.opengov.com', + '*.bonfirehub.com', + '*.hub.arcgis.com', + '*.opendata.arcgis.com', + '*.opendatasoft.com', + '*.junar.com', + ]) { + const crossBlock = compileSrc.slice( + compileSrc.indexOf('APPROVED_CROSS_DOMAIN_TWIN_HOSTS'), + compileSrc.indexOf('APPROVED_WILDCARD_DOMAIN_PATTERNS'), + ); + assert.equal(crossBlock.includes(forbidden), false, `Rule 7 violation: ${forbidden} must never be in APPROVED_CROSS_DOMAIN_TWIN_HOSTS`); + } + }); + + test('Wave 3 B1 Category A: All 16 fixtures pass positive, RequestTracer edgefetch.adapter_id, and >=4 negative checks', async () => { + resetIsolateBudgetForTests(); + resetOverflowRobotsCacheForTests(); + + for (const slug of WAVE3_B1_CAT_A_IDS) { + const fx = JSON.parse(readFileSync(resolve('test', 'fixtures', 'adapters', `${slug}.json`), 'utf8')) as GovFixture; + assert.equal(fx.adapterId, slug); + assert.ok(fx.negativeCases.length >= 4, `${slug} must have >= 4 negativeCases`); + + if (fx.mode === 'twin') { + const twin = resolveSiteExtractorTwin(fx.inputUrl); + assert.ok(twin && twin.id === slug, `${slug}: expected twin for ${fx.inputUrl}`); + if (fx.expectedFetchUrl) { + assert.equal(twin.fetchUrl, fx.expectedFetchUrl, `${slug}: unexpected fetchUrl`); + } + const out = twin.formatTwin(fx.mockPayload, fx.inputUrl, noopHtmlToMd); + assert.ok(out && out.markdown.trim().length > 0, `${slug}: positive formatTwin returned null/empty`); + if (fx.expectTitleIncludes) { + assert.ok(out.title.includes(fx.expectTitleIncludes), `${slug}: title "${out.title}" missing "${fx.expectTitleIncludes}"`); + } + for (const needle of fx.expectMarkdownIncludes) { + assert.ok(out.markdown.includes(needle), `${slug}: markdown missing "${needle}"`); + } + if (out.records) { + assert.ok(out.records.length <= 50, `${slug}: records[] exceeds 50`); + } + + const scTracer = RequestTracer.fromRequest(new Request('https://hub.example.com/v1/scrape')); + let scRes!: Awaited>; + await scTracer.withSpan('edgefetch.scrape', async () => { + scRes = await executeScrapeCall({ + payload: { url: fx.inputUrl, formats: ['markdown', 'records'], discoverLlmsTxt: false, noCache: true }, + env: {}, + tracer: scTracer, + executeHubFetch: async (_target, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [ + { + id: req.id, + url: fx.expectedFetchUrl || fx.inputUrl, + outcome: 'ok', + status: 200, + contentType: 'application/json', + body: fx.mockPayload, + }, + ], + }), + }; + }, + }); + }); + assert.equal(scRes.status, 200, `${slug} scrape failed: ${JSON.stringify(scRes.body)}`); + assert.equal(scRes.body.extractorId, slug); + assert.equal(scRes.body.contentState, 'active'); + assert.equal(scTracer.getRecordedSpans().find((s) => s.name === 'edgefetch.scrape')?.attributes?.['edgefetch.adapter_id'], slug); + + const exTracer = RequestTracer.fromRequest(new Request('https://hub.example.com/v1/extract')); + let exRes!: Awaited>; + await exTracer.withSpan('edgefetch.extract', async () => { + exRes = await executeExtractCall({ + payload: { urls: [fx.inputUrl], noCache: true }, + env: {}, + tracer: exTracer, + executeHubFetch: async (_target, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [ + { + id: req.id, + url: fx.expectedFetchUrl || fx.inputUrl, + outcome: 'ok', + status: 200, + contentType: 'application/json', + body: fx.mockPayload, + }, + ], + }), + }; + }, + }); + }); + assert.equal(exRes.status, 200); + assert.equal(exTracer.getRecordedSpans().find((s) => s.name === 'edgefetch.extract')?.attributes?.['edgefetch.adapter_id'], slug); + + for (const nc of fx.negativeCases) { + if (nc.finalUrl && nc.finalUrl !== fx.inputUrl) { + assert.equal( + isTrustedTwinRedirectUrl(slug, fx.expectedFetchUrl || fx.inputUrl, { finalUrl: nc.finalUrl }), + false, + `${slug}:${nc.name} redirect to ${nc.finalUrl} must be rejected`, + ); + } else { + const neg = twin.formatTwin(nc.payload, fx.inputUrl, noopHtmlToMd); + assert.equal(Boolean(neg && neg.markdown.trim()), false, `${slug}:${nc.name} must return null/empty`); + } + } + } else { + const postOut = postExtractHtml(fx.mockPayload, fx.inputUrl, ''); + assert.ok(postOut && postOut.extractorId === slug, `${slug}: postExtractHtml failed`); + if (fx.expectTitleIncludes && postOut.title) { + assert.ok(postOut.title.includes(fx.expectTitleIncludes), `${slug}: title "${postOut.title}" missing "${fx.expectTitleIncludes}"`); + } + for (const needle of fx.expectMarkdownIncludes) { + assert.ok(postOut.markdown.includes(needle), `${slug}: markdown missing "${needle}"`); + } + if (postOut.records) { + assert.ok(postOut.records.length <= 50, `${slug}: records[] exceeds 50`); + } + + const scTracer = RequestTracer.fromRequest(new Request('https://hub.example.com/v1/scrape')); + let scRes!: Awaited>; + await scTracer.withSpan('edgefetch.scrape', async () => { + scRes = await executeScrapeCall({ + payload: { url: fx.inputUrl, formats: ['markdown', 'records'], discoverLlmsTxt: false, noCache: true }, + env: {}, + tracer: scTracer, + executeHubFetch: async (_target, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string; url: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [{ id: req.id, url: req.url, outcome: 'ok', status: 200, contentType: 'text/html', body: fx.mockPayload }], + }), + }; + }, + }); + }); + assert.equal(scRes.status, 200); + assert.equal(scRes.body.extractorId, slug); + assert.equal(scRes.body.contentState, 'active', `${slug}: golden HTML case must classify active`); + assert.equal(scTracer.getRecordedSpans().find((s) => s.name === 'edgefetch.scrape')?.attributes?.['edgefetch.adapter_id'], slug); + + const exTracer = RequestTracer.fromRequest(new Request('https://hub.example.com/v1/extract')); + let exRes!: Awaited>; + await exTracer.withSpan('edgefetch.extract', async () => { + exRes = await executeExtractCall({ + payload: { urls: [fx.inputUrl], noCache: true }, + env: {}, + tracer: exTracer, + executeHubFetch: async (_target, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string; url: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [{ id: req.id, url: req.url, outcome: 'ok', status: 200, contentType: 'text/html', body: fx.mockPayload }], + }), + }; + }, + }); + }); + assert.equal(exRes.status, 200); + assert.equal(exTracer.getRecordedSpans().find((s) => s.name === 'edgefetch.extract')?.attributes?.['edgefetch.adapter_id'], slug); + + for (const nc of fx.negativeCases) { + const targetUrl = nc.finalUrl || fx.inputUrl; + const negPost = postExtractHtml(nc.payload, targetUrl, ''); + assert.equal(negPost, null, `${slug}:${nc.name} must return null`); + } + } + + // End-to-end negativeCases through executeScrapeCall and executeExtractCall -> never contentState: "active" + for (const nc of fx.negativeCases) { + const ncStatus = nc.status ?? 200; + const ncFinal = nc.finalUrl || fx.expectedFetchUrl || fx.inputUrl; + const itemContentType = nc.payload.trimStart().startsWith('<') ? 'text/html' : 'application/json'; + const hubMock = async (_target: unknown, body: string) => { + const parsed = JSON.parse(body) as { requests?: Array<{ id?: string; url?: string }> }; + const req = parsed.requests?.[0]; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [ + { + id: req?.id ?? 'neg-1', + url: req?.url ?? fx.inputUrl, + finalUrl: ncFinal, + outcome: 'ok', + status: ncStatus, + contentType: itemContentType, + body: nc.payload, + }, + ], + }), + }; + }; + + const scNeg = await executeScrapeCall({ + payload: { url: fx.inputUrl, discoverLlmsTxt: false, noCache: true }, + env: {}, + executeHubFetch: hubMock, + }); + assert.notEqual( + (scNeg.body as { contentState?: string }).contentState, + 'active', + `scrape ${slug}:${nc.name} must not return contentState=active`, + ); + + const exNeg = await executeExtractCall({ + payload: { urls: [fx.inputUrl], noCache: true }, + env: {}, + executeHubFetch: hubMock, + }); + const exFirst = ((exNeg.body as { results?: Array<{ contentState?: string }> }).results ?? [])[0]; + assert.notEqual( + exFirst?.contentState, + 'active', + `extract ${slug}:${nc.name} must not return contentState=active`, + ); + } + } + }); + + test('Wave 3 B1 Category A: Laserfiche ?cr=1, Accela Default.aspx, EnerGov SPA & BidNet login_wall guardrails', async () => { + resetIsolateBudgetForTests(); + + // #208 Laserfiche WebLink ?cr=1 / STR_ERROR_PAGE_TITLE / INDEX_COOKIE_WARNING rejected + assert.equal( + postExtractHtml( + 'STR_ERROR_PAGE_TITLE

INDEX_COOKIE_WARNING

', + 'https://records.hawaiicounty.gov/WebLink/Browse.aspx?dbid=1&cr=1', + '', + ), + null, + ); + + // #209 Accela Default.aspx without permit spans rejected + assert.equal( + postExtractHtml( + 'Accela Citizen Access

Message Bar

', + 'https://aca-prod.accela.com/SANDIEGO/Default.aspx', + '', + ), + null, + ); + + // #210 Tyler EnerGov unhydrated AngularJS shell rejected + assert.equal( + postExtractHtml( + 'SelfService Public Site

Welcome to portal home

', + 'https://energovweb.capecoral.gov/EnerGovProd/selfservice', + '', + ), + null, + ); + + // #212 Public BidNet solicitation with header .loginWindow succeeds as active; gated detail classifies as login_wall + const bidFx = JSON.parse(readFileSync(resolve('test', 'fixtures', 'adapters', 'public-bid-portals.json'), 'utf8')) as GovFixture; + const gated = bidFx.negativeCases.find((c) => c.name === 'login-wall-gated-detail')!; + const gatedRes = await executeScrapeCall({ + payload: { url: bidFx.inputUrl, discoverLlmsTxt: false, noCache: true }, + env: {}, + executeHubFetch: async (_t, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string; url: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [{ id: req.id, url: req.url, outcome: 'ok', status: 200, contentType: 'text/html', body: gated.payload }], + }), + }; + }, + }); + assert.equal(gatedRes.body.contentState, 'login_wall', '#212 login-gated bid detail must classify as login_wall'); + }); + + test('Wave 3 B1 Category A: Challenger regressions (#214 DKAN exclusions, #212 concise BidNet, #208 Laserfiche ?cr=1, #209 Accela Default.aspx)', async () => { + resetIsolateBudgetForTests(); + resetOverflowRobotsCacheForTests(); + + // #214 dkan resolves data.medicaid.gov & data.healthcare.gov, and NEVER claims data.cms.gov or healthdata.gov + assert.equal( + resolveSiteExtractorTwin('https://data.medicaid.gov/dataset/ae4d5347-5137-5f6c-b66c-3420fa0316d8')?.id, + 'dkan', + ); + for (const u of [ + 'https://data.cms.gov/dataset/mj5m-pzi6', + 'https://data.cms.gov/api/1/metastore/schemas/dataset/items/mj5m-pzi6', + 'https://healthdata.gov/dataset/my-dataset', + 'https://healthdata.gov/api/1/metastore/schemas/dataset/items/my-dataset', + 'https://www.healthdata.gov/dataset/my-dataset', + ]) { + const twin = resolveSiteExtractorTwin(u); + assert.notEqual(twin?.id, 'dkan', `#214 dkan must NEVER claim twin for ${u}`); + } + const dkanHtmlSample = + 'Dataset - DKAN

Medicaid Rebate

'; + for (const u of [ + 'https://data.cms.gov/dataset/mj5m-pzi6', + 'https://healthdata.gov/dataset/my-dataset', + 'https://www.healthdata.gov/dataset/my-dataset', + ]) { + const ext = postExtractHtml(dkanHtmlSample, u, ''); + assert.notEqual(ext?.extractorId, 'dkan', `#214 dkan must NEVER match HTML on ${u}`); + } + + // #212 Concise (<65w) public BidNet solicitation with header .loginWindow password input stays active + const conciseBidHtml = + 'RFP-2026-101 - Snow Plowing' + + '
' + + '

RFP-2026-101 - Snow Plowing

' + + '
Reference Number
0000443657
' + + '
Closing Date
2026-12-20
' + + '
Location
Denver, CO
' + + '
'; + const bidRes = await executeScrapeCall({ + payload: { url: 'https://www.bidnetdirect.com/colorado/solicitations/open-bids/rfp/0000443657', discoverLlmsTxt: false, noCache: true }, + env: {}, + executeHubFetch: async (_t, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string; url: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [{ id: req.id, url: req.url, outcome: 'ok', status: 200, contentType: 'text/html', body: conciseBidHtml }], + }), + }; + }, + }); + assert.equal(bidRes.body.extractorId, 'public-bid-portals'); + assert.equal(bidRes.body.contentState, 'active', '#212 concise public BidNet solicitation must classify as active'); + + // #208 Laserfiche single-marker & >=60w ?cr=1 shells -> empty_shell (never active) + const lfCases = [ + { + name: 'STR_ERROR_PAGE_TITLE only', + url: 'https://records.hawaiicounty.gov/WebLink/Browse.aspx?dbid=1&cr=1', + html: 'STR_ERROR_PAGE_TITLE

Cookies required.

', + }, + { + name: 'INDEX_COOKIE_WARNING only', + url: 'https://records.hawaiicounty.gov/WebLink/Browse.aspx?dbid=1', + html: 'WebLink

INDEX_COOKIE_WARNING

', + }, + { + name: '?cr=1 >=60w cookie help text', + url: 'https://records.hawaiicounty.gov/WebLink/Browse.aspx?dbid=1&cr=1', + html: `WebLink

Cookies Required

${'Please enable browser cookies in your browser preferences to continue using WebLink repository browsing. '.repeat(6)}

`, + }, + ]; + for (const tc of lfCases) { + const res = await executeScrapeCall({ + payload: { url: tc.url, discoverLlmsTxt: false, noCache: true }, + env: {}, + executeHubFetch: async (_t, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string; url: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [{ id: req.id, url: req.url, finalUrl: tc.url, outcome: 'ok', status: 200, contentType: 'text/html', body: tc.html }], + }), + }; + }, + }); + assert.equal(res.body.contentState, 'empty_shell', `#208 ${tc.name} must classify as empty_shell`); + } + + // #209 Accela Default.aspx "Message Bar" / aspnetForm (short & welcome-copy) -> empty_shell (never active) + const accelaVariants = [ + 'Accela Citizen Access

Message Bar

', + `Accela Citizen Access

Message Bar

${'Welcome to the municipal Accela Citizen Access online permitting portal where residents can search records and inspect applications. '.repeat(5)}

`, + ]; + for (const html of accelaVariants) { + const res = await executeScrapeCall({ + payload: { url: 'https://aca-prod.accela.com/SANDIEGO/Default.aspx', discoverLlmsTxt: false, noCache: true }, + env: {}, + executeHubFetch: async (_t, body) => { + const req = (JSON.parse(body) as { requests: Array<{ id: string; url: string }> }).requests[0]!; + return { + status: 200, + via: 'hub:overflow', + bodyText: JSON.stringify({ + results: [{ id: req.id, url: req.url, finalUrl: req.url, outcome: 'ok', status: 200, contentType: 'text/html', body: html }], + }), + }; + }, + }); + assert.equal(res.body.contentState, 'empty_shell', '#209 Accela Default.aspx shell must classify as empty_shell'); + } + + // Iteration 3 Challenger bypass vectors (#212 sign in to download, #212 .loginWindow inside
, #208 empty MetadataPanel, #209