spb/datacenterindex
Public
HTML 53.9%
TypeScript 44.5%
JavaScript 0.6%
SQL 0.5%
1import type { TraceResult } from "@/lib/admin-api";23/**4 * DEV-ONLY sample TraceResult used to lay out the extraction debugger when the maintenance worker is not5 * reachable (`/admin/documents/<id>?fixture=1`, NODE_ENV !== production). Every figure below is made up for6 * layout purposes and is labelled "FIXTURE — not real data" in the UI. Never used in production builds.7 */8export function traceFixture(id: string): TraceResult {9 const text =10 "Example Operator today announced plans for a new 96 MW data center campus in Sample City, Ohio. The first building will deliver 24 MW of critical IT load in 2027, with the campus scaling up to 96 MW at full build-out. The company said the project represents an investment of $1.2 billion. Example Operator now operates more than 400 MW across its portfolio.";11 return {12 document: { id, connectorId: "fixture-connector", url: "https://example.invalid/news/sample-announcement", pageType: "project_announcement", classifier: "text:\\b(announces?|plans)\\b", contentHash: "0000000000000000fixture", extractorVersion: "v1", extractOk: true, extractCount: 1, error: null, lastFetched: "2026-09-12T00:00:00.000Z", lastChanged: "2026-09-12T00:00:00.000Z", fetchLevel: 1, storageKey: "raw/fixture/doc/0000.html.zst", title: "FIXTURE — Example Operator announces sample campus", entityRefs: [], quarantined: false },13 fetch: { source: "archive", status: 200, contentType: "text/html; charset=utf-8", bytes: 48213, storageKey: "raw/fixture/doc/0000.html.zst", level: 1, fetcher: "direct" },14 text: { title: "FIXTURE — Example Operator announces sample campus", length: text.length, excerpt: text, classification: { pageType: "project_announcement", rule: "text:announce", eventType: "project_announced", mw: [96, 24, 96, 400] } },15 announcement: { class: "NEW_BUILD", confidence: 0.82, location: { city: "Sample City", regionName: "Ohio", countryIso2: "US" }, figures: [{ raw: "96 MW", value: 96, unit: "MW", start: text.indexOf("96 MW"), end: text.indexOf("96 MW") + 5 }, { raw: "24 MW", value: 24, unit: "MW", start: text.indexOf("24 MW"), end: text.indexOf("24 MW") + 5 }, { raw: "$1.2 billion", value: 1.2e9, unit: "USD", start: text.indexOf("$1.2 billion"), end: text.indexOf("$1.2 billion") + 12 }, { raw: "400 MW", value: 400, unit: "MW", start: text.indexOf("400 MW"), end: text.indexOf("400 MW") + 6 }] },16 records: [{ kind: "project", key: "fixture-connector:news:sample-announcement", certainty: 0.82, pageType: "project_announcement", data: { name: "Example Operator Sample City campus", operatorName: "Example Operator", city: "Sample City", regionName: "Ohio", countryIso2: "US", status: "announced", plannedMw: 96, investmentUsd: 1.2e9 }, methods: { name: "parser", plannedMw: "regex", investmentUsd: "regex", status: "classifier" } }],17 entities: [{ type: "project", key: "fixture-connector:news:sample-announcement", name: "Example Operator Sample City campus", operatorName: "Example Operator", city: "Sample City", regionName: "Ohio", countryIso2: "US", status: "announced", plannedMw: 96, investmentUsd: 1.2e9, expectedOpening: "2027", projectClass: "NEW_BUILD", aiEvidence: "unknown", geo: { lat: 40.0, lng: -82.9, precision: "city" } }],18 validation: { total: 1, valid: 1, rejected: 0, issues: [] },19 claims: [20 { entityKey: "fixture-connector:news:sample-announcement", field: "planned_power_mw", value: 96, unit: "MW", scope: "campus", scopeReason: "regex:campus", semantics: "ultimate_campus_mw", evidence: { text: "Example Operator today announced plans for a new 96 MW data center campus in Sample City, Ohio.", start: 0, end: 93 } },21 { entityKey: "fixture-connector:news:sample-announcement", field: "phase_mw", value: 24, unit: "MW", scope: "building", scopeReason: "regex:building", semantics: "it_capacity_mw", evidence: { text: "The first building will deliver 24 MW of critical IT load in 2027, with the campus scaling up to 96 MW at full build-out.", start: 94, end: 215 } },22 { entityKey: "fixture-connector:news:sample-announcement", field: "project_investment_usd", value: 1.2e9, unit: "USD", scope: "facility", scopeReason: "regex:facility", semantics: "project_investment_usd", evidence: { text: "The company said the project represents an investment of $1.2 billion.", start: 216, end: 286 } },23 { entityKey: "fixture-connector:news:sample-announcement", field: "current_power_mw", value: 400, unit: "MW", scope: "portfolio", scopeReason: "regex:portfolio", semantics: "current_power_mw", evidence: { text: "Example Operator now operates more than 400 MW across its portfolio.", start: 287, end: text.length } },24 ],25 matches: [{ entityKey: "fixture-connector:news:sample-announcement", how: "scored", matchedId: null, candidates: [{ id: "fac_fixture000001", name: "Sample City DC1 (fixture)", operatorName: "Example Operator", city: "Sample City", score: 0.58, reasons: ["name:0.42", "operator:same", "distance:3.1km/15km"], distanceKm: 3.1 }] }],26 reconciliation: { created: 1, updated: 0, unchanged: 0, merged: 0, pendingMatches: 0, rejected: 0, events: 1, provenanceRows: 9, claims: 4, qualityFlags: 0, unscopedClaims: 1, projectsVetoed: 0, changes: [{ op: "create", type: "project", name: "Example Operator Sample City campus", plannedMw: 96, capacityScope: "campus" }, { op: "event", eventType: "project_announced", significance: 62 }], refs: [] },27 logs: ["info FIXTURE trace — no worker call was made", "debug classifyProjectEvent → NEW_BUILD (0.82)", "debug 4 figures, 4 claims, 1 unscoped (portfolio)", "info dry-run ingest: 1 created, 1 event"],28 error: null,29 };30}31