{"record":{"id":"97f8849e8048cb16","repo":"affaan-m/ECC","slug":"cannot-adapt-antigravity-agent-label-frontmatt","errorCode":null,"errorMessage":"Cannot adapt Antigravity agent ${label}: frontmatter must be an object","messagePattern":"Cannot adapt Antigravity agent (.+?): frontmatter must be an object","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install/antigravity-agent.js","lineNumber":31,"sourceCode":"\nconst MODEL_NAMES = Object.freeze({\n  haiku: 'flash',\n  sonnet: 'pro',\n  opus: 'pro',\n});\n\nfunction splitFrontmatter(source, label) {\n  const match = String(source || '').match(/^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n/);\n  if (!match) {\n    throw new Error(`Cannot adapt Antigravity agent ${label}: missing YAML frontmatter`);\n  }\n\n  // Keep YAML loading behind the transform boundary. Public help commands load\n  // the installer graph without executing a transform, including in hermetic\n  // packed-artifact checks where runtime dependencies are intentionally absent.\n  const frontmatter = require('js-yaml').load(match[1]);\n  if (!frontmatter || typeof frontmatter !== 'object' || Array.isArray(frontmatter)) {\n    throw new Error(`Cannot adapt Antigravity agent ${label}: frontmatter must be an object`);\n  }\n\n  return {\n    frontmatter,\n    body: source.slice(match[0].length),\n  };\n}\n\nfunction normalizeToolNames(value) {\n  const names = Array.isArray(value) ? value : String(value || '').split(',');\n  return [...new Set(names\n    .map(name => String(name).trim())\n    .filter(name => Object.hasOwn(TOOL_NAMES, name))\n    .map(name => TOOL_NAMES[name]))];\n}\n\nfunction adaptAntigravityAgent(source, label = '<unknown>') {\n  const { frontmatter, body } = splitFrontmatter(source, label);","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/lib/install/antigravity-agent.js#L13-L49","documentation":"The Antigravity agent file had frontmatter, but js-yaml loaded it into a non-object (e.g. a plain string or null, such as when the block contains only a scalar). The adapter needs a mapping of metadata keys to transform the agent.","triggerScenarios":"Thrown at scripts/lib/install/antigravity-agent.js:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the frontmatter a YAML mapping (key: value pairs), not a list or scalar.","Fix indentation so the frontmatter parses as an object."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}