{"record":{"id":"0cf45429aab0002d","repo":"affaan-m/ECC","slug":"invalid-canonical-install-state-required-projecti","errorCode":null,"errorMessage":"Invalid canonical install-state: required projection fields are missing","messagePattern":"Invalid canonical install-state: required projection fields are missing","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/state-store/install-state-projection.js","lineNumber":21,"sourceCode":"const path = require('path');\n\nconst MANAGED_FILE_HEALTH_CODES = new Set([\n  'missing-target-root',\n  'unsafe-managed-destination',\n  'unsafe-repair-source',\n  'missing-managed-files',\n  'drifted-managed-files',\n  'missing-source-files',\n  'unverified-managed-operations',\n]);\n\nfunction cloneJsonValue(value) {\n  return value === undefined ? undefined : JSON.parse(JSON.stringify(value));\n}\n\nfunction buildInstallStateStoreRecord(state) {\n  if (!state || !state.target || !state.request || !state.resolution || !state.source) {\n    throw new Error('Invalid canonical install-state: required projection fields are missing');\n  }\n\n  return {\n    targetId: state.target.id,\n    targetRoot: state.target.root,\n    profile: state.request.profile ?? null,\n    modules: Array.isArray(state.resolution.selectedModules)\n      ? [...state.resolution.selectedModules]\n      : [],\n    operations: Array.isArray(state.operations)\n      ? state.operations.map(operation => cloneJsonValue(operation))\n      : [],\n    installedAt: state.installedAt,\n    sourceVersion: state.source.repoVersion ?? null,\n  };\n}\n\nfunction warningFor(record, code, message) {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/lib/state-store/install-state-projection.js#L3-L39","documentation":"buildInstallStateStoreRecord received a canonical install-state object missing one of the required projection fields: target, request, resolution, or source. The state-store projection flattens all four; an incomplete canonical state means the installer pipeline produced or loaded a truncated record.","triggerScenarios":"Thrown at scripts/lib/state-store/install-state-projection.js:21 when the library encounters an invalid state.","commonSituations":"Raised when input validation fails because: Invalid canonical install-state: required projection fields are missing. Typically caused by a missing, malformed, or out-of-range argument or configuration value.","solutions":["Provide a value that satisfies the validation: Invalid canonical install-state: required projection fields are missing","Check the calling command or configuration for the reported field and correct it, then retry.","Run the command with --help to review the expected input shape and allowed values."],"exampleFix":"Correct the invalid input so that the following holds: Invalid canonical install-state: required projection fields are missing","handlingStrategy":"type-guard","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-14T05:17:10.506Z"}