import { describe, expect, it } from "vitest"; import type { ConnectorContext, RawDocument } from "@dci/connectors"; import { extractAnnouncement, parseAllMoney, parseExpectedOpening, parsePhaseCount, projectMoneyFigures, qualifiesAsProject } from "./extract-project.js"; import { detectOperators, OPERATORS } from "./operators-lexicon.js"; import { detectLocation } from "./locations-lexicon.js"; import { newsArticleParser } from "./article-parser.js"; import { detectDecision, planningPdfParser } from "./planning-pdf-parser.js"; import { edgarFtsParser } from "./edgar.js"; const NOW = new Date("2026-09-11T12:00:00Z"); const x = (title: string, text: string, publishedAt = "2026-09-10") => extractAnnouncement(title, text, { publishedAt, now: NOW }); describe("announcement → project extraction", () => { it("1. Vantage Frederick: MW, USD, city/state, operator, status, phase date", () => { const a = x( "Vantage Data Centers announces 192MW campus in Frederick, Maryland with $2 billion investment; first phase slated for Q2 2027", "DENVER, September 10, 2026 — Vantage Data Centers, a leading global provider of hyperscale data center campuses, today announced plans for a new 192MW campus in Frederick, Maryland. The company will invest more than $2 billion in the site. The first phase is slated for Q2 2027, with the remaining buildings delivered in two additional phases.", ); expect(a.headlineMw).toBe(192); expect(a.money).toEqual({ amount: 2_000_000_000, currency: "USD" }); expect(a.investmentUsd).toBe(2_000_000_000); expect(a.location?.city).toBe("Frederick"); expect(a.location?.region).toBe("Maryland"); expect(a.location?.country).toBe("US"); expect(a.operator?.name).toBe("Vantage Data Centers"); expect(a.status).toBe("announced"); expect(a.expectedOpening).toBe("2027-Q2"); expect(a.projectName).toBe("Vantage Data Centers Frederick campus"); expect(qualifiesAsProject(a)).toBe(true); }); it("2. Loudoun approval: approved > other statuses, acreage in acres, RFS date beats construction start", () => { const a = x( "Loudoun County approves rezoning for 300 MW Aligned data center campus in Leesburg", "The Loudoun County Board of Supervisors voted 7-2 on Tuesday to approve the rezoning of a 118-acre site along Sycolin Road for a data center campus proposed by Aligned Data Centers. Construction is expected to begin in 2026. The first buildings are expected to be ready for service in 2028.", ); expect(a.status).toBe("approved"); expect(a.headlineMw).toBe(300); expect(a.acreage).toBe(118); expect(a.operator?.name).toBe("Aligned Data Centers"); expect(a.location?.city).toBe("Leesburg"); expect(a.location?.country).toBe("US"); expect(a.expectedOpening).toBe("2028"); expect(qualifiesAsProject(a)).toBe(true); }); it("3. Microsoft groundbreaking: under_construction, $1bn short form, City, State", () => { const a = x("Microsoft breaks ground on $1bn data centre in Mount Pleasant, Wisconsin", "Microsoft has broken ground on its $1bn data centre in Mount Pleasant, Wisconsin, on land once earmarked for Foxconn. The hyperscaler said the facility would support its cloud and AI services."); expect(a.status).toBe("under_construction"); expect(a.money).toEqual({ amount: 1_000_000_000, currency: "USD" }); expect(a.location).toMatchObject({ city: "Mount Pleasant", region: "Wisconsin", country: "US" }); expect(a.operator?.name).toBe("Microsoft"); expect(a.headlineMw).toBeNull(); expect(qualifiesAsProject(a)).toBe(true); // investment ≥ $50M }); it("4. Equinix opening: operational facility is not a pipeline project", () => { const a = x("Equinix opens 20MW PA11 data center in Paris", "Equinix has opened PA11, its newest International Business Exchange (IBX) data center in Paris, France. The 20MW facility adds 2,300 cabinets of capacity to the Paris metro."); expect(a.status).toBe("operational"); expect(a.headlineMw).toBe(20); expect(a.location).toMatchObject({ city: "Paris", country: "FR" }); expect(a.operator?.name).toBe("Equinix"); expect(qualifiesAsProject(a)).toBe(false); }); it("5. Google Eemshaven: EUR money stays out of investmentUsd, expansion event type", () => { const a = x("Google to invest €1 billion in expansion of Eemshaven data center campus in the Netherlands", "Google will invest €1 billion to expand its data center campus in Eemshaven, the Netherlands, adding an additional 100MW of capacity. The expansion is expected to be operational in 2027."); expect(a.money).toEqual({ amount: 1_000_000_000, currency: "EUR" }); expect(a.investmentUsd).toBeNull(); expect(a.investmentUsdApprox).toBeGreaterThan(50_000_000); expect(a.headlineMw).toBe(100); expect(a.pageType).toBe("expansion"); expect(a.eventType).toBe("expansion_announced"); expect(a.location).toMatchObject({ city: "Eemshaven", country: "NL" }); expect(a.operator?.name).toBe("Google"); expect(a.expectedOpening).toBe("2027"); expect(qualifiesAsProject(a)).toBe(true); }); it("6. Slough planning application: permitting, hectares → acres, GB city, Yondr", () => { const a = x("Planning application lodged for 90MW data centre in Slough", "Yondr Group has submitted plans to Slough Borough Council for a 90MW data centre on an 8.5 hectare site off the A4. If approved, the facility is expected to be operational by 2028."); expect(a.status).toBe("permitting"); expect(a.headlineMw).toBe(90); expect(a.acreage).toBe(21); expect(a.location).toMatchObject({ city: "Slough", country: "GB" }); expect(a.operator?.name).toBe("Yondr"); expect(a.expectedOpening).toBe("2028"); expect(a.pageType).toBe("planning_document"); expect(qualifiesAsProject(a)).toBe(true); }); it("7. AWS Mississippi: state-only location, 'come online' is a plan not an operational status", () => { const a = x("AWS plans $10 billion investment in Mississippi data centers", "Amazon Web Services will build two data center complexes in Madison County, Mississippi, the largest single capital investment in the state's history. The company said the facilities would come online in 2027."); expect(a.operator?.name).toBe("Amazon Web Services"); expect(a.money).toEqual({ amount: 10_000_000_000, currency: "USD" }); expect(a.location?.region).toBe("Mississippi"); expect(a.location?.country).toBe("US"); expect(a.status).toBe("announced"); expect(a.expectedOpening).toBe("2027"); expect(qualifiesAsProject(a)).toBe(true); }); it("8. Meta Zeewolde: cancelled beats everything, ambiguous 'Meta' resolved by verb lookahead", () => { const a = x("Meta scraps plans for Zeewolde hyperscale data centre", "Meta has scrapped plans for a 200MW hyperscale data centre in Zeewolde after the Dutch senate moved to block the project. The company had announced the campus in 2021."); expect(a.status).toBe("cancelled"); expect(a.operator?.name).toBe("Meta"); expect(a.location).toMatchObject({ city: "Zeewolde", country: "NL" }); expect(qualifiesAsProject(a)).toBe(false); }); it("9. Riot Corsicana: GW → MW, phase count in words", () => { const a = x("Riot Platforms to develop 1 GW AI data center campus in Corsicana, Texas across four phases", "Riot Platforms said it will develop the 1GW Corsicana campus in four phases, converting part of its bitcoin mining site into AI and HPC data halls."); expect(a.headlineMw).toBe(1000); expect(a.phaseCount).toBe(4); expect(a.location).toMatchObject({ city: "Corsicana", region: "Texas", country: "US" }); expect(a.operator?.name).toBe("Riot Platforms"); expect(a.status).toBe("announced"); }); it("10. CyrusOne Frankfurt: approved, completion date preferred over construction start", () => { const a = x("CyrusOne secures approval for 240 MW Frankfurt campus", "CyrusOne has secured planning approval for a 240 MW campus in Frankfurt, Germany. Construction is scheduled to begin in 2026, with completion targeted for late 2028."); expect(a.status).toBe("approved"); expect(a.headlineMw).toBe(240); expect(a.location).toMatchObject({ city: "Frankfurt", country: "DE" }); expect(a.operator?.name).toBe("CyrusOne"); expect(a.expectedOpening).toBe("2028"); }); it("11. Data4 Didcot: GBP money kept as original currency", () => { const a = x("Data4 to invest £1.2bn in 200MW UK campus in Didcot", "French operator Data4 plans to invest £1.2bn in a new 200MW campus in Didcot, Oxfordshire, its first in the United Kingdom."); expect(a.money).toEqual({ amount: 1_200_000_000, currency: "GBP" }); expect(a.investmentUsd).toBeNull(); expect(a.headlineMw).toBe(200); expect(a.location).toMatchObject({ city: "Didcot", country: "GB" }); expect(a.operator?.name).toBe("Data4"); expect(qualifiesAsProject(a)).toBe(true); }); it("12. off-topic real-estate story is not a data center project", () => { const a = x("Canadian firm raises £680m for 6,000-home UK build-to-rent push", "The developer plans a campus-style residential scheme in Manchester and said the first homes would be delivered in 2028. The 40MW figure quoted by the council refers to the district heating network."); expect(a.relevance).not.toBe("strong"); expect(qualifiesAsProject(a)).toBe(false); }); it("13. rumored site near Des Moines", () => { const a = x("Microsoft reportedly eyeing 500MW site near Des Moines, Iowa", "Microsoft is reportedly in talks to acquire a 500MW site near Des Moines, Iowa, according to local officials."); expect(a.status).toBe("rumored"); expect(a.location).toMatchObject({ city: "Des Moines", region: "Iowa", country: "US" }); expect(a.headlineMw).toBe(500); }); it("14. delayed campus keeps its delayed status", () => { const a = x("Aligned delays 180MW Phoenix campus amid power constraints", "Aligned Data Centers has pushed back the delivery of its 180MW Phoenix campus to 2028 as the utility works through grid interconnection constraints."); expect(a.status).toBe("delayed"); expect(a.operator?.name).toBe("Aligned Data Centers"); expect(a.location).toMatchObject({ city: "Phoenix", region: "Arizona", country: "US" }); }); it("15. explicit project name and large acreage gate", () => { const a = x("Prince William Digital Gateway wins final approval for 2,100 acres of data centers", "The Prince William Digital Gateway, developed by QTS and Compass Datacenters, was approved by the Prince William Board of County Supervisors early Wednesday. The 2,100-acre corridor along Pageland Lane could host up to 27 million square feet of data centers."); expect(a.explicitName).toBe("Prince William Digital Gateway"); expect(a.projectName).toBe("Prince William Digital Gateway"); expect(a.status).toBe("approved"); expect(a.acreage).toBe(2100); expect(a.operators.map((o) => o.name)).toEqual(expect.arrayContaining(["QTS", "Compass Datacenters"])); expect(a.location?.country).toBe("US"); expect(qualifiesAsProject(a)).toBe(true); }); it("16. 'phase 1 of 3' and construction start in Toronto", () => { const a = x("STACK Infrastructure begins construction on phase 1 of 3 at 250MW Toronto campus", "STACK Infrastructure has started construction on the first of three buildings at its 250MW campus in Toronto, Ontario."); expect(a.phaseCount).toBe(3); expect(a.status).toBe("under_construction"); expect(a.location).toMatchObject({ city: "Toronto", country: "CA" }); expect(a.operator?.name).toBe("STACK Infrastructure"); }); it("17. title gives the state, lead gives the county — merged location", () => { const a = x("Amazon plans $650 million data center in Pennsylvania", "Amazon will build the facility in Salem Township, Luzerne County, Pennsylvania, next to the Susquehanna nuclear plant, under a power purchase agreement with Talen Energy."); expect(a.operator?.name).toBe("Amazon Web Services"); expect(a.location?.region).toBe("Pennsylvania"); expect(a.location?.country).toBe("US"); expect(a.location?.city).toBe("Luzerne County"); expect(a.money).toEqual({ amount: 650_000_000, currency: "USD" }); }); it("18. market statistics above 20 GW are not a project figure; per-MWh prices are not investments", () => { const a = x("US data center capacity to hit 50GW by 2030, report says", "The report estimates US data center capacity will reach 50GW by 2030. Power prices of $45/MWh were assumed. Equinix's new 36MW Dallas facility was cited as an example."); expect(a.headlineMw).toBe(36); expect(a.money).toBeNull(); }); }); describe("helpers", () => { describe("precision pass 2026-09-11 (hand-classified false positives)", () => { it("appointments, awards, interviews, events and leadership changes never yield a project", () => { for (const [t, body] of [ ["AirTrunk appoints Laura Coad as Chief Data Centre Officer (CDCO)", "Asia Pacific & Japan (APJ) hyperscale data centre specialist, AirTrunk today announced the executive appointment of Laura Coad as Chief Data Centre Officer, responsible for 1.4GW of capacity across the region."], ["AirTrunk recognised alongside Blackstone at Mergermarket M&A Awards", "AirTrunk, the hyperscale data centre specialist, was recognised at the awards for the 300MW SYD1 campus transaction."], ["AITech interview with COO Erling Guðmundsson - atNorth", "How AI impacts digital infrastructure and how atNorth is shaping a sustainable future with its 60MW data center campus plans."], ["Women in Construction and Why It Matters: CyrusOne Hosts Inaugural Event in Madrid", "New 90 megawatt campus places emphasis on biodiversity, sustainability and giving back to the local community. CyrusOne plans to build the campus in phases."], ["Cassava Technologies Announces Leadership Changes To Accelerate Growth", "Cassava Technologies announces new strategic appointments to the leadership team as the group plans a 6MW data centre expansion in Nairobi."], ] as Array<[string, string]>) { const a = x(t, body); expect(a.nonProjectTitle, t).toBe(true); expect(qualifiesAsProject(a), t).toBe(false); expect(a.eventType, t).toBe("news"); } }); it("partnerships, hosting agreements, POP deployments, financing and market reports are not projects", () => { for (const [t, body] of [ ["CyrusOne and E.ON Announce Strategic Partnership to Overcome Data Center Grid Capacity Constraints for Customers in Europe", "Local power generation system designed to deliver an additional 61 megawatts of electricity to CyrusOne's FRA7 data center by 2029, expanding the campus' total capacity to 126MW."], ["Duos Technologies Signs 55 MW AI Hosting Agreements with Axe Compute", "Five-year hosting agreements cover 55 MW of AI facility capacity. Agreements represent more than $500 million in base payments."], ["China Telecom Deploys POP At Africa Data Centres Johannesburg Facility", "Africa Data Centres has extended its partnership with China Telecom, which has deployed a point of presence at the 14MW Johannesburg data centre."], ["AirTrunk gears up for Asia-Pacific expansion with AUD $850 million financing", "AirTrunk has successfully completed an AUD $850 million financing process to fund a major expansion of its 90MW hyperscale data centre platform."], ["Data Center Chillers Market to Surpass $6.4 Billion by 2035", "The global data center chillers market is projected to grow from USD 2.8 billion in 2026 to USD 6.4 billion by 2035 at a 9.6% CAGR, propelled by escalating hyperscale data center construction."], ["Starcloud Raises $250m Series A Extension At $2.3bn Valuation For Orbital AI Data Centers", "Orbital data center company Starcloud has raised $250 million in a Series A extension, planning 20GW of orbital compute."], ["House Bill Would Put Federal Electricity Tax on Data Centers", "U.S. bill proposes 1¢/kWh tax on data center electricity over 1 MW, funding five federal programs."], ["Schneider Electric's $2.3 Billion in AI Power and Cooling Deals Sends Message to Data Center Sector", "Twin supply-capacity agreements by Schneider Electric with Switch and Digital Realty show how AI data centers are starting to lock up power and thermal infrastructure. Switch plans a 2MW pilot in Las Vegas."], ["Data Centre Developer Sues New Jersey Town for $300m", "Data centre developer Hexa Builders is seeking $300 million in damages from Monroe Township, New Jersey, after officials rejected its proposed 1 million sq ft data center."], ] as Array<[string, string]>) { const a = x(t, body); expect(qualifiesAsProject(a), t).toBe(false); } }); it("a build headline overrides deal vocabulary: 'Vantage secures approval for 300MW campus' still qualifies", () => { const a = x("Vantage Data Centers secures planning approval for 300MW campus in Cardiff, Wales", "Vantage Data Centers has secured planning approval for a new 300MW data center campus in Cardiff. Construction of the first 48MW building begins in 2027."); expect(a.nonProjectTitle).toBe(false); expect(a.status).toBe("approved"); expect(qualifiesAsProject(a)).toBe(true); }); it("openings and 'we are online' headlines describe existing facilities, not pipeline projects", () => { for (const [t, body] of [ ["AirTrunk opens Melbourne's largest hyperscale data centre campus", "A specialist in hyperscale data centres, AirTrunk today announced the opening of its second facility in the Asia-Pacific region, the 50MW MEL1 campus."], ["Utah County, We Are Online! - Meta Data Centers", "Today, we are excited to announce that the Eagle Mountain Data Center in Utah is now serving traffic. The 800 MW campus was announced in 2018 and construction began soon after."], ["DataBank Announces Opening of \"SLC5\" Salt Lake City Data Center", "DataBank announces the opening of its fifth Salt Lake City data center (SLC), a 66MW facility and the 20th data center the company has opened."], ["2MW Delivered in Serverfarm's Chicago Data Center", "Serverfarm has delivered an additional 2MW of capacity in its Chicago data center for a hyperscale customer."], ["AirTrunk opens AI-ready data centre in Malaysia, accelerating innovation and the energy transition", "JHB1 official opening ceremony attended by Malaysian government officials. AirTrunk has commenced operations at the 1.4GW-capable Johor campus, with plans to expand."], ] as Array<[string, string]>) { const a = x(t, body); expect(a.status, t).toBe("operational"); expect(qualifiesAsProject(a), t).toBe(false); } // a future opening remains a plan expect(x("Equinix to open 20MW PA11 data center in Paris in 2027", "Equinix will open PA11, a 20MW facility, in Q2 2027.").status).toBe("announced"); expect(x("Equinix opens 20MW PA11 data center in Paris", "Equinix has opened PA11.").status).toBe("operational"); }); it("portfolio totals are not the site figure: TOK2 (410MW in Japan, 1.2GW across APJ) and OSK1 (20MW)", () => { const a = x("AirTrunk scales up in Japan with announcement of second Tokyo hyperscale data centre", "TOK2 increases AirTrunk's capacity to over 410MW in Japan and 1.2GW across Asia Pacific & Japan (APJ). AirTrunk today announced TOK2, a new 110MW hyperscale data centre in Inzai, Tokyo."); expect(a.headlineMw).toBe(110); const b = x("AirTrunk breaks ground in Osaka", "Construction begins on 20+MW OSK1 in West Osaka. Asia-Pacific & Japan hyperscale data centre specialist, AirTrunk, has begun the construction of its 20 megawatt OSK1 data centre, bringing its capacity across the region to 1.4GW."); expect(b.headlineMw).toBe(20); expect(b.status).toBe("under_construction"); expect(qualifiesAsProject(b)).toBe(true); // when the lead only quotes company totals, no lead figure is used expect(x("AirTrunk expands in Japan with new data centre development in Osaka", "OSK1 will be AirTrunk's third data centre in Japan. The company now operates over 1.4GW across Asia Pacific.").headlineMw).toBeNull(); }); it("names never start with a unit: '1.5 GW Texas Data Center' → generated name; '8,000 Acre AI Campus' → generated name", () => { const a = x("Prometheus' 1.5 GW Texas Data Center Plan Tests Private Power", "Prometheus Hyperscale plans an off-grid 1.5 GW Texas Data Center campus in Pecos, Texas. The 1.5 GW Texas Data Center would come online in 2027."); expect(a.explicitName).toBeNull(); expect(a.projectName).not.toMatch(/^GW /); const b = x("Amazon Explores Grid Connection for 8,000 Acre AI Campus", "Amazon is exploring a grid connection for an 8,000 Acre AI Campus in Louisiana that would combine a private-generation complex with an AI data center. The 8,000 Acre AI Campus has drawn scrutiny."); expect(b.explicitName).toBeNull(); expect(b.projectName).not.toMatch(/^Acre /); }); it("an unknown headline subject keeps body operators out: Cerebras/G42, Greenfield/Google, JV/Dallas", () => { const a = x("Cerebras Begins Construction Of 165MW Data Center In Mikkeli, Finland", "Cerebras has begun construction on a 165MW data center campus in Mikkeli, Finland, with the first 50MW phase now underway. The campus is being developed with G42 as anchor customer."); expect(a.operator).toBeNull(); expect(a.location?.country).toBe("FI"); // Mikkeli is not in the city lexicon: country only, never a guessed city expect(a.headlineMw).toBe(165); const b = x("Greenfield And Finsbury Infrastructure To Invest €360M In Milan Data Center", "UK infrastructure developer Greenfield and Finsbury Infrastructure plan to invest up to €360 million ($418m) to develop a 36MW data center east of Milan, Italy, near Google's existing campus."); expect(b.operator).toBeNull(); expect(b.headlineMw).toBe(36); const c = x("JV Plans 54MW Data Center In Dallas, Texas", "A new 54MW data center is planned for the North Dallas Corridor, with Northampton Capital Partners and Provident Data Centers targeting a late 2027 launch."); expect(c.location?.city).toBe("Dallas"); expect(c.projectName).toBe("Dallas data center project"); // a known operator in the title is unaffected expect(x("Microsoft plans 300MW campus in Mount Pleasant, Wisconsin", "Microsoft plans a 300MW campus in Mount Pleasant, Wisconsin.").operator?.name).toBe("Microsoft"); }); }); it("parseAllMoney keeps the largest first and ignores small figures", () => { expect(parseAllMoney("a $2 billion project with a $150 million first phase and $25/MWh power")).toEqual([{ amount: 2_000_000_000, currency: "USD" }, { amount: 150_000_000, currency: "USD" }]); }); it("parsePhaseCount", () => { expect(parsePhaseCount("delivered in three phases")).toBe(3); expect(parsePhaseCount("phase 2 of 5")).toBe(5); expect(parsePhaseCount("a two-phase development")).toBe(2); expect(parsePhaseCount("the first phase")).toBeNull(); }); it("parseExpectedOpening prefers opening sentences and honours year bounds", () => { expect(parseExpectedOpening("Construction will begin in 2026. The campus is expected to open in the second half of 2027.", { minYear: 2026, maxYear: 2041 }).value).toBe("2027-H2"); expect(parseExpectedOpening("The company was founded in 2010 and expects to complete the build in 2009.", { minYear: 2026, maxYear: 2041 }).value).toBeNull(); }); it("operator lexicon has ≥ 100 operators and does not match ordinary words", () => { expect(OPERATORS.length).toBeGreaterThanOrEqual(100); expect(detectOperators("Please switch the meta description to apple pie")).toEqual([]); expect(detectOperators("Switch to build 1GW campus").map((o) => o.name)).toEqual(["Switch"]); }); it("location lexicon: City, ST pattern, Georgia is the US state, Latin America is not the US", () => { expect(detectLocation("a site in Pryor, OK")).toMatchObject({ city: "Pryor", region: "Oklahoma", country: "US" }); expect(detectLocation("Meta's campus in Georgia")).toMatchObject({ region: "Georgia", country: "US" }); expect(detectLocation("expansion across Latin America")).toBeNull(); expect(detectLocation("Dublin, Ohio campus")).toMatchObject({ city: "Dublin", region: "Ohio", country: "US" }); expect(detectLocation("a campus in Dublin")).toMatchObject({ city: "Dublin", country: "IE" }); }); }); // ─── parser-level checks with a synthetic HTML article ───────────────────────────────────────────── function ctx(connectorId = "test-news"): ConnectorContext { return { connectorId, sourceId: "src_test", runId: "run_test", dryRun: true, env: {}, now: () => NOW.toISOString(), fetch: async () => { throw new Error("no network in tests"); }, getState: async () => null, setState: async () => {}, log: () => {}, isKnownUnchanged: async () => false, provenance: (url) => ({ sourceId: "src_test", connectorId, url, firstObserved: NOW.toISOString(), lastObserved: NOW.toISOString(), retrievedAt: NOW.toISOString(), confidence: "moderate" }), }; } function htmlDoc(url: string, html: string, extra: Partial = {}): RawDocument { const body = Buffer.from(html); return { url, finalUrl: url, fetchedAt: NOW.toISOString(), status: 200, contentType: "text/html; charset=utf-8", body, text: html, headers: {}, etag: null, lastModified: null, notModified: false, fetcher: "direct", level: 1, durationMs: 1, credits: 0, group: "newsroom", pageType: "press_release", ...extra }; } const ARTICLE = `Vantage Data Centers announces 192MW campus in Frederick | DCD

Vantage Data Centers announces 192MW campus in Frederick, Maryland

Vantage Data Centers today announced plans for a new 192MW data center campus in Frederick, Maryland, representing an investment of more than $2 billion. The 150-acre site will be developed in three phases; the first phase is slated for Q2 2027. Vantage said the campus would serve hyperscale customers in the Mid-Atlantic region and create 200 permanent jobs.

The company operates campuses in Ashburn, Phoenix and Frankfurt.

`; describe("news_article_v1", () => { it("emits a news_event without body text and a project with facts and methods", async () => { const recs = await newsArticleParser.parse(htmlDoc("https://example.com/news/vantage-frederick", ARTICLE), ctx(), { keepText: false }); expect(recs.map((r) => r.kind)).toEqual(["news_event", "project"]); const [ev, pr] = recs; expect(ev!.key).toMatch(/^test-news:news:/); expect(ev!.data.title).toBe("Vantage Data Centers announces 192MW campus in Frederick, Maryland"); expect(ev!.data.publishedAt).toBe("2026-09-10"); expect(ev!.data.text).toBeNull(); expect(String(ev!.data.summary).length).toBeLessThanOrEqual(400); expect(ev!.data.mw).toEqual([192]); expect(ev!.data.status).toBeNull(); // status travels with the project record, not the event expect(ev!.data.operators).toEqual(["Vantage Data Centers"]); expect(ev!.data.countries).toEqual(["US"]); expect(ev!.data.cities).toEqual(["Frederick"]); expect(pr!.key).toMatch(/^test-news:project:/); expect(pr!.data).toMatchObject({ name: "Vantage Data Centers Frederick campus", operatorName: "Vantage Data Centers", city: "Frederick", regionName: "Maryland", countryIso2: "US", status: "announced", announcedOn: "2026-09-10", expectedOpening: "2027-Q2", plannedMw: 192, investmentUsd: 2_000_000_000, acreage: 150, phaseCount: 3, sourceUrl: "https://example.com/news/vantage-frederick" }); expect(pr!.methods).toMatchObject({ plannedMw: "regex:mw_v1:title", status: "regex:status_v1:title", operatorName: "lexicon:operator" }); expect(pr!.certainty).toBeGreaterThanOrEqual(0.5); expect(pr!.certainty).toBeLessThanOrEqual(0.8); }); it("keeps the text for public-sector sources when asked", async () => { const recs = await newsArticleParser.parse(htmlDoc("https://county.gov/news/vantage", ARTICLE), ctx("gov"), { keepText: true }); expect(String(recs[0]!.data.text)).toContain("192MW"); }); it("returns a nameless sentinel for index pages (dropped by the normalizer) and nothing for irrelevant articles", async () => { const idx = await newsArticleParser.parse(htmlDoc("https://example.com/news", ARTICLE, { group: "seed", pageType: "news_index" }), ctx()); expect(idx).toHaveLength(1); expect(idx[0]).toMatchObject({ kind: "project", certainty: 0 }); expect(idx[0]!.data.name).toBeUndefined(); const off = ARTICLE.replace(/data center|Data Centers|192MW|hyperscale|campus/g, "bakery"); expect(await newsArticleParser.parse(htmlDoc("https://example.com/news/bakery", off), ctx())).toEqual([]); }); it("an operator named only in related-articles / footer teasers never becomes the project's operator", async () => { // the story is about an unknown developer; Microsoft, Google, Equinix and AWS appear only in teaser blocks (DCD "More in …" shape) const html = `Riverside Estates to build 30MW data center in Leesburg | Trade Press

Riverside Estates to build 30MW data center in Leesburg

Property developer Riverside Estates has secured planning permission for a 30MW data center in Leesburg, Virginia. Named ‘Aire Park One,’ the facility is expected to open in 2028 and will offer 4,000 sqm of white space to cloud providers and financial institutions.

Founded in 1998, Riverside Estates manages an estate of 600,000 sqm across the region and a total investment volume of £2.1 billion ($2.7bn). The Leesburg site is its first data center.

`; const recs = await newsArticleParser.parse(htmlDoc("https://example.com/news/riverside-leesburg", html), ctx(), { keepText: false }); expect(recs.map((r) => r.kind)).toEqual(["news_event", "project"]); const [ev, pr] = recs; expect(ev!.data.operators).toEqual([]); expect(pr!.data).toMatchObject({ operatorName: null, name: "Aire Park One", plannedMw: 30, city: "Leesburg", countryIso2: "US", status: "announced", investmentUsd: null }); expect(pr!.methods?.operatorName).toBe("none"); // the same article with the developer in the lexicon keeps its operator (the teasers still count for nothing) const known = html.replace(/Riverside Estates/g, "Vantage Data Centers"); const a = extractAnnouncement("Vantage Data Centers to build 30MW data center in Leesburg", (await articleContentOf(known)).text, { publishedAt: "2026-09-10", now: NOW }); expect(a.operator?.name).toBe("Vantage Data Centers"); expect(a.operators.map((o) => o.name)).toEqual(["Vantage Data Centers"]); }); it("company-background money (portfolio volume, revenue) is never the project's investment", () => { const text = "S+B Gruppe manages an estate of 414,000 sqm across central and eastern Europe and a total investment volume of €8.1 billion ($9.4bn). The 12MW facility will cost $60 million."; expect(parseAllMoney(text)).toHaveLength(3); expect(projectMoneyFigures(text)).toEqual([{ amount: 60_000_000, currency: "USD" }]); expect(projectMoneyFigures("The company reported revenue of $4.2 billion last year.")).toEqual([]); expect(projectMoneyFigures("Vantage will invest $2 billion in the Frederick campus.")).toEqual([{ amount: 2_000_000_000, currency: "USD" }]); const a = x("S+B Gruppe to build data center in Bucharest, Romania", "Real estate developer S+B Gruppe has secured planning permission to build a 12MW data center in Bucharest. Named ‘NIMB,’ the facility is expected to open in 2028. Founded in 1986 in Vienna, S+B Gruppe manages an estate of more than 414,000 sqm and a total investment volume of €8.1 billion ($9.4bn)."); expect(a.money).toBeNull(); expect(a.investmentUsd).toBeNull(); expect(a.explicitName).toBe("NIMB"); expect(a.operator).toBeNull(); expect(a.classification.mayCreateProject).toBe(true); }); }); async function articleContentOf(html: string) { const { articleContent } = await import("./article-parser.js"); return articleContent(htmlDoc("https://example.com/news/x", html)); } describe("news_planning_pdf_v1", () => { const REPORT = `Staff Report — Rezoning Application REZ 2026-0017

Planning Commission Staff Report

Application: REZ 2026-0017. Applicant: Compass Datacenters LLC. Date of meeting: 8 September 2026.

Proposal: Rezoning of 212 acres at 41500 Lovettsville Road, Leesburg, Virginia from AR-1 to PD-IP to permit the development of a data center campus of up to 400 MW with associated electrical substation.

Recommendation: Approve with conditions. The Planning Commission recommends that the Board of Supervisors approve the application subject to the proffers dated August 2026.

`; it("extracts applicant, decision, MW, acreage, address and emits an approved project", async () => { const recs = await planningPdfParser.parse(htmlDoc("https://county.gov/planning/rez-2026-0017", REPORT, { pageType: "planning_document" }), ctx("loudoun")); expect(recs.map((r) => r.kind)).toEqual(["news_event", "project"]); const [ev, pr] = recs; expect(ev!.data).toMatchObject({ decision: "approved", applicant: "Compass Datacenters", eventType: "planning_approved", pageType: "planning_document", reference: "REZ 2026-0017" }); expect(ev!.data.publishedAt).toBe("2026-09-08"); expect(ev!.data.text).not.toBeNull(); expect(pr!.data).toMatchObject({ status: "approved", operatorName: "Compass Datacenters", plannedMw: 400, acreage: 212, city: "Leesburg", regionName: "Virginia", countryIso2: "US", address: "41500 Lovettsville Road" }); }); it("a refused application yields the event only", async () => { const refused = REPORT.replace("Recommendation: Approve with conditions.", "Decision: Refused.").replace("approve the application", "refuse the application"); const recs = await planningPdfParser.parse(htmlDoc("https://county.gov/planning/rez-refused", refused, { pageType: "planning_document" }), ctx("loudoun")); expect(recs.map((r) => r.kind)).toEqual(["news_event"]); expect(recs[0]!.data.decision).toBe("refused"); }); it("detectDecision precedence", () => { expect(detectDecision("Decision: Approved").decision).toBe("approved"); expect(detectDecision("The application was refused on 3 grounds; the applicant may appeal.").decision).toBe("refused"); expect(detectDecision("Application registered and validated; consultation open until 1 October.").decision).toBe("pending"); }); }); describe("news_edgar_fts_v1", () => { it("turns full-text hits into one news_event per filing, preferring the exhibit", async () => { const json = JSON.stringify({ hits: { total: { value: 2 }, hits: [ { _id: "0001104659-26-093406:riot-20260810x8k.htm", _source: { ciks: ["0001167419"], display_names: ["Riot Platforms, Inc. (RIOT) (CIK 0001167419)"], file_date: "2026-08-10", root_forms: ["8-K"], form: "8-K", file_type: "8-K", file_description: "FORM 8-K", adsh: "0001104659-26-093406", items: ["7.01", "9.01"], biz_locations: ["Castle Rock, CO"], biz_states: ["CO"] } }, { _id: "0001104659-26-093406:riot-20260810xex99d2.htm", _source: { ciks: ["0001167419"], display_names: ["Riot Platforms, Inc. (RIOT) (CIK 0001167419)"], file_date: "2026-08-10", root_forms: ["8-K"], form: "8-K", file_type: "EX-99.2", file_description: "EXHIBIT 99.2", adsh: "0001104659-26-093406", items: ["7.01", "9.01"], biz_locations: ["Castle Rock, CO"], biz_states: ["CO"] } }, ] } }); const doc = htmlDoc('https://efts.sec.gov/LATEST/search-index?q=%22data%20center%22%20%22MW%22&forms=8-K', json, { contentType: "application/json", group: "filings", pageType: "financial_disclosure", meta: { query: '"data center" "MW"' } }); const recs = await edgarFtsParser.parse(doc, ctx("sec-edgar"), {}); expect(recs).toHaveLength(1); const r = recs[0]!; expect(r.key).toBe("sec-edgar:news:0001104659-26-093406"); expect(r.url).toBe("https://www.sec.gov/Archives/edgar/data/1167419/000110465926093406/riot-20260810xex99d2.htm"); expect(r.data).toMatchObject({ title: "Riot Platforms, Inc.: Form 8-K (EX-99.2)", publishedAt: "2026-08-10", operators: ["Riot Platforms"], countries: ["US"], cities: ["Castle Rock"], text: null }); }); }); describe("announcement classifier veto (2026-09 upgrade)", () => { const body = (extra: string) => `${extra} The company operates more than 13 GW of capacity across its global portfolio, with campuses in Northern Virginia, Dallas and Phoenix. Its newest Lancaster campus will deliver 500 MW at full build-out.`; it("never turns an executive appointment into a project, whatever MW the body quotes", () => { const a = extractAnnouncement("STACK Infrastructure Appoints Matt VanderZanden as Chief Executive Officer, STACK Americas", body("STACK Infrastructure today announced the appointment of Matt VanderZanden as CEO of STACK Americas."), { publishedAt: "2025-12-12" }); expect(a.classification.class).toBe("EXECUTIVE_APPOINTMENT"); expect(qualifiesAsProject(a)).toBe(false); }); it("keeps portfolio totals out of the headline figure and scopes the site figure", () => { const a = extractAnnouncement("STACK breaks ground on new Lancaster data center campus", body("STACK Infrastructure broke ground today on its Lancaster, Texas campus."), { publishedAt: "2026-05-01" }); expect(a.classification.class).toBe("CONSTRUCTION_START"); expect(a.headlineMw).toBe(500); expect(a.capacityScope).toBe("campus"); expect(a.evidence.plannedMw?.text).toMatch(/500 MW/); expect(qualifiesAsProject(a)).toBe(true); }); it("does not locate a project at the company's headquarters", () => { const a = extractAnnouncement("Denver-based Vantage plans 192 MW data center campus in Abilene, Texas", "Denver-based Vantage Data Centers said it will build a 192 MW campus in Abilene, Texas, with the first building expected in 2027.", { publishedAt: "2026-03-01" }); expect(a.location?.city).toBe("Abilene"); expect(a.hqGuarded).toBe(true); }); it("classifies PPA, financing and market-research headlines as non-physical", () => { for (const [title, cls] of [ ["Ormat Technologies Signs 20-Year PPA with Switch for ~13 MW of Carbon-Free Geothermal Capacity to Power Data Centers", "POWER_AGREEMENT"], ["STACK Secures $1.3B Financing for Development", "FINANCING"], ["Hyperscale Data Center Market to Surpass USD 624.2 Billion by 2035", "GENERAL_COMPANY_NEWS"], ] as Array<[string, string]>) { const a = extractAnnouncement(title, `${title}. Data center capacity of 300 MW is mentioned in passing.`, { publishedAt: "2026-01-02" }); expect(a.classification.class).toBe(cls); expect(qualifiesAsProject(a)).toBe(false); } }); it("grades AI evidence from explicit wording only", () => { const a = extractAnnouncement("Crusoe to build 1.2 GW AI factory campus in Abilene, Texas", "Crusoe will develop a purpose-built AI campus in Abilene, Texas with NVIDIA GB200 systems.", { publishedAt: "2026-01-02" }); expect(a.aiEvidence).toBe("confirmed"); const b = extractAnnouncement("Equinix opens DA11 colocation data center in Dallas", "Equinix opened DA11, a colocation facility in Dallas, Texas.", { publishedAt: "2026-01-02" }); expect(b.aiEvidence).toBe("unknown"); }); });