{"record":{"id":"b8526b5d4386b2bc","repo":"Fission-AI/OpenSpec","slug":"ignoring-context-field","errorCode":null,"errorMessage":"Ignoring context field","messagePattern":"Ignoring context field","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/project-config.ts","lineNumber":304,"sourceCode":"    const schemaResult = schemaField.safeParse(raw.schema);\n    if (schemaResult.success) {\n      config.schema = schemaResult.data;\n    } else if (raw.schema !== undefined) {\n      console.warn(`Invalid 'schema' field in config (must be non-empty string)`);\n    }\n\n    // Parse context field with size limit\n    if (raw.context !== undefined) {\n      const contextField = z.string();\n      const contextResult = contextField.safeParse(raw.context);\n\n      if (contextResult.success) {\n        const contextSize = Buffer.byteLength(contextResult.data, 'utf-8');\n        if (contextSize > MAX_CONTEXT_SIZE) {\n          console.warn(\n            `Context too large (${(contextSize / 1024).toFixed(1)}KB, limit: ${MAX_CONTEXT_SIZE / 1024}KB)`\n          );\n          console.warn(`Ignoring context field`);\n        } else {\n          config.context = contextResult.data;\n        }\n      } else {\n        console.warn(`Invalid 'context' field in config (must be string)`);\n      }\n    }\n\n    // Parse rules field using Zod\n    if (raw.rules !== undefined) {\n      const rulesField = z.record(z.string(), z.array(z.string()));\n\n      // First check if it's an object structure (guard against null since typeof null === 'object')\n      if (typeof raw.rules === 'object' && raw.rules !== null && !Array.isArray(raw.rules)) {\n        // Artifact ids are intentionally not restricted to the built-in naming\n        // convention, so keys such as \"constructor\" remain valid for custom\n        // schemas. A null-prototype map preserves those keys as data without\n        // letting \"__proto__\" mutate the lookup object's prototype.","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/project-config.ts#L286-L322","documentation":"Companion warning from readProjectConfig confirming that an oversized 'context' field was discarded rather than truncated. It always follows the 'Context too large' warning and means prompts will run without the project context block.","triggerScenarios":"Thrown at src/core/project-config.ts:304 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shrink the context field under the limit so it is honored","Split context into per-operation guidance entries if it is inherently large"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}