{"record":{"id":"6b0d88d257aef20c","repo":"JuliusBrussee/caveman","slug":"caveman-build-dataresidency-is-not-enforced-yet","errorCode":null,"errorMessage":"caveman build: dataResidency is not enforced yet; refusing to ignore residency policy","messagePattern":"caveman build: dataResidency is not enforced yet; refusing to ignore residency policy","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/agent/src/build.ts","lineNumber":28,"sourceCode":"export interface BuildConfig {\n  entry: string;\n  evals: string;\n  efficiency: \"max\";\n  requiredFixturePassRate: number;\n  qualityRetention: number;\n  maxSearchCostUsd: number;\n  lock: \"strict\";\n  sandbox: \"required\";\n  allowedModels?: string[];\n  deniedModels?: string[];\n  maxP95LatencyMs?: number;\n  forbiddenSafetyClasses?: string[];\n  dataResidency?: string;\n}\n\nexport function defineBuild(options: Partial<BuildConfig> & Pick<BuildConfig, \"entry\" | \"evals\">): BuildConfig {\n  if (options.dataResidency !== undefined) {\n    throw new Error(\n      \"caveman build: dataResidency is not enforced yet; refusing to ignore residency policy\",\n    );\n  }\n  const config: BuildConfig = {\n    entry: options.entry,\n    evals: options.evals,\n    efficiency: options.efficiency ?? \"max\",\n    requiredFixturePassRate: options.requiredFixturePassRate ?? 1,\n    qualityRetention: options.qualityRetention ?? 0.98,\n    maxSearchCostUsd: options.maxSearchCostUsd ?? 2,\n    lock: options.lock ?? \"strict\",\n    sandbox: options.sandbox ?? \"required\",\n    ...(options.allowedModels === undefined ? {} : { allowedModels: [...options.allowedModels] }),\n    ...(options.deniedModels === undefined ? {} : { deniedModels: [...options.deniedModels] }),\n    ...(options.maxP95LatencyMs === undefined ? {} : { maxP95LatencyMs: options.maxP95LatencyMs }),\n    ...(options.forbiddenSafetyClasses === undefined ? {} : { forbiddenSafetyClasses: [...options.forbiddenSafetyClasses] }),\n  };\n  if (!(config.requiredFixturePassRate > 0 && config.requiredFixturePassRate <= 1)) {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/agent/src/build.ts#L10-L46","documentation":"defineBuild accepts a BuildConfig where dataResidency is a declared-but-unenforced field. The library throws rather than silently accepting a residency policy it cannot guarantee, because ignoring a compliance directive is dangerous. This is a deliberate guard against false compliance.","triggerScenarios":"Passing dataResidency (any string, e.g. \"eu\" or \"us\") in the options object to defineBuild, even alongside otherwise valid entry/evals.","commonSituations":"Porting an existing config that sets residency for another toolchain; a compliance checklist requiring the field be filled in; copying a config template that includes dataResidency before the feature ships.","solutions":["Remove the dataResidency key from the defineBuild options until the library enforces it","If residency is a hard requirement, gate usage at the application level (model allowlists per region) instead of relying on this field","Track the library's support for dataResidency and re-add the field only when enforcement lands","Centralize build definitions so removing the field is a one-place change"],"exampleFix":"// before\ndefineBuild({ entry, evals, dataResidency: \"eu\" });\n// after\ndefineBuild({ entry, evals });","handlingStrategy":"validation","validationCode":"if (\"dataResidency\" in options && options.dataResidency !== undefined) {\n  throw new Error(\"dataResidency not supported by this caveman build version\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Strip unsupported compliance fields from config templates","Keep residency enforcement at the application layer until supported","Pin and review library versions before relying on dataResidency"],"tags":["config","compliance","unsupported-feature"],"backgroundTag":"unsupported-config-value","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}