{"record":{"id":"147fb9c860d044e2","repo":"deepseek-ai/deepseek-harness","slug":"invariants-field-entries-must-be-non-blank-and","errorCode":null,"errorMessage":"invariants: ${field} entries must be non-blank and have no surrounding whitespace","messagePattern":"invariants: (.+?) entries must be non-blank and have no surrounding whitespace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/runtime-diagnostics/invariants/src/index.ts","lineNumber":79,"sourceCode":"  constructor(packageName: string, message: string) {\n    super(`invariant violated by \"${packageName}\": ${message}`)\n    this.name = 'InvariantError'\n    this.packageName = packageName\n  }\n}\n\ndeclare module '@deepseek-ai/cordis' {\n  interface Context {\n    invariants: InvariantRegistry\n  }\n}\n\n/** Compile and validate one package-filter list. */\nfunction compilePatterns(field: 'package_allowlist' | 'package_blocklist', values: readonly string[]): RegExp[] {\n  const seen = new Set<string>()\n  return values.map((value) => {\n    if (value.length === 0 || value.trim() !== value) {\n      throw new Error(`invariants: ${field} entries must be non-blank and have no surrounding whitespace`)\n    }\n    if (seen.has(value)) {\n      throw new Error(`invariants: ${field} contains duplicate regex ${JSON.stringify(value)}`)\n    }\n    seen.add(value)\n    try {\n      return new RegExp(value)\n    } catch (cause) {\n      throw new Error(`invariants: ${field} contains invalid regex ${JSON.stringify(value)}`, { cause })\n    }\n  })\n}\n\n/** Package-owned invariant registry with global and regex-based selection. */\nexport class InvariantRegistry extends Service {\n  static Config: Schema<Config> = z.object({\n    enabled: z.boolean().default(true),\n    package_allowlist: z.array(z.string()).default([]),","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/runtime-diagnostics/invariants/src/index.ts#L61-L97","documentation":"Error \"invariants: ${field} entries must be non-blank and have no surrounding whitespace\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/runtime-diagnostics/invariants/src/index.ts:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make every entry non-blank with no surrounding whitespace."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}