{"record":{"id":"275ff2962d3006a8","repo":"Hmbown/CodeWhale","slug":"message-gt-site","errorCode":null,"errorMessage":"message","messagePattern":"message","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/scripts/gt-site.mjs","lineNumber":57,"sourceCode":"  \"docs-fleet\": { exportName: \"docsFleet\", typeName: \"DocsFleetDict\" },\n  \"docs-mcp\": { exportName: \"docsMcp\", typeName: \"DocsMcpDict\" },\n  \"docs-modes\": { exportName: \"docsModes\", typeName: \"DocsModesDict\" },\n  \"docs-runtime-api\": { exportName: \"docsRuntimeApi\", typeName: \"DocsRuntimeApiDict\" },\n  \"docs-sandbox\": { exportName: \"docsSandbox\", typeName: \"DocsSandboxDict\" },\n  \"docs-subagents\": { exportName: \"docsSubagents\", typeName: \"DocsSubagentsDict\" },\n  \"docs-web\": { exportName: \"docsWeb\", typeName: \"DocsWebDict\" },\n  \"docs-computers\": { exportName: \"docsComputers\", typeName: \"DocsComputersDict\" },\n  \"docs-auth\": { exportName: \"docsAuth\", typeName: \"DocsAuthDict\" },\n  \"docs-trust\": { exportName: \"docsTrust\", typeName: \"DocsTrustDict\" },\n  states: { exportName: \"states\", typeName: \"StatesDict\" },\n  changelog: { exportName: \"changelog\", typeName: \"ChangelogDict\" },\n  \"computer-use\": { exportName: \"computerUse\", typeName: \"ComputerUseDict\" },\n};\n\nconst REQUIRED_STEMS = [\"chrome\", \"home\"];\n\nfunction fail(message) {\n  throw new Error(message);\n}\n\nfunction assertExactKeys(value, expected, label) {\n  if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n    fail(`${label} must be an object`);\n  }\n  const actual = Object.keys(value).sort();\n  const wanted = [...expected].sort();\n  if (JSON.stringify(actual) !== JSON.stringify(wanted)) {\n    fail(`${label} keys must be exactly: ${wanted.join(\", \")} (found: ${actual.join(\", \")})`);\n  }\n}\n\nfunction stableStringify(value) {\n  return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction deepEqual(left, right) {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/web/scripts/gt-site.mjs#L39-L75","documentation":"fail() is a generic helper in gt-site.mjs that throws an Error with whatever message is passed. The bare \"message\" string here is the parameter name; every concrete validation failure in the site-generation checks (assertExactKeys, required stems, etc.) funnels through this thrower.","triggerScenarios":"Any structural validation failure during site generation: a dict/export missing expected keys, REQUIRED_STEMS (chrome, home) absent from generated data, or a value that is not a plain object where one is required.","commonSituations":"A generated dictionary file renamed or dropped an export (e.g. computerUse/ComputerUseDict missing), a new stem added without updating REQUIRED_STEMS, or a tool JSON schema drift.","solutions":["Read the full error output above the throw site to see which labeled assertion failed","Ensure the generated dicts export exactly the expected keys (exportName/typeName table)","Confirm REQUIRED_STEMS (chrome, home) are all present in the input data","Update the expected-keys table in gt-site.mjs if the schema intentionally changed"],"exampleFix":"// before\n// dict missing 'home' stem\n// after\n// regenerate data so chrome and home stems both exist, then rerun\nnode web/scripts/gt-site.mjs","handlingStrategy":"try-catch","validationCode":"const EXPECTED = { computerUse: \"ComputerUseDict\" };\nfor (const stem of [\"chrome\", \"home\"]) {\n  if (!(stem in data)) throw new Error(`missing stem: ${stem}`);\n}\nif (!data || typeof data !== \"object\" || Array.isArray(data)) throw new Error(\"data must be an object\");","typeGuard":"function isPlainObject(v) {\n  return v !== null && typeof v === \"object\" && !Array.isArray(v);\n}","tryCatchPattern":"try {\n  await generateSite();\n} catch (e) {\n  if (e instanceof Error && /must be an object|missing|REQUIRED/.test(e.message)) {\n    console.error(\"Site data failed structural validation:\", e.message);\n  }\n}","preventionTips":["Keep generated dicts in sync with the expected export table in gt-site.mjs","Run gt-site.mjs in CI to catch schema drift early","Update REQUIRED_STEMS when adding a new stem","Validate generated JSON shape before invoking the script"],"tags":["validation","site-generation","assertion"],"backgroundTag":"schema-validation-failed","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}