{"record":{"id":"10d2f4e06d99c006","repo":"deepseek-ai/deepseek-harness","slug":"binname-user-patch-layer-watching-requires-the-10d2f4","errorCode":null,"errorMessage":"${binName}: user patch-layer watching requires the root Include entry","messagePattern":"(.+?): user patch-layer watching requires the root Include entry","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/boot/app-boot/src/index.ts","lineNumber":240,"sourceCode":"  compose?: (userPatches: PatchOptions[]) => PatchOptions[]\n}\n\n/**\n * Watch the user patch layer through Cordis HMR and transactionally reapply it to the boot include.\n * @param ctx - settled app context containing the root Include and an active HMR service.\n * @param options - diagnostic, file, and patch-composition inputs.\n * @returns an asynchronous disposer after the exact-path watcher is ready.\n * @throws when HMR or the root Include is absent, watcher setup fails, or initial path resolution fails.\n */\nexport async function watchUserPatches(\n  ctx: Context,\n  options: UserPatchWatchOptions,\n): Promise<() => Promise<void>> {\n  const { binName, filename, compose = (patches: PatchOptions[]) => patches } = options\n  const hmr = ctx.get('hmr')\n  if (hmr === undefined) throw new Error(`${binName}: user patch-layer watching requires the Cordis HMR service`)\n  const entry = bootstrapIncludes.get(ctx)\n  if (entry === undefined) throw new Error(`${binName}: user patch-layer watching requires the root Include entry`)\n  const register = hmr.registerConfig(filename, async () => {\n    // Re-read the include's non-patch options per refresh: a writer that\n    // updates the root Include's other options between refreshes (none exists\n    // today) must not have them silently reverted by a user-layer reload.\n    const { patches: _previousPatches, ...includeConfig } = entry.options.config as Include.Config\n    const userPatches = loadOptionalPatches(binName, filename) ?? []\n    const patches = compose(userPatches)\n    await entry.update({\n      config: {\n        ...includeConfig,\n        patches,\n      },\n    })\n  })\n  try {\n    return await register\n  } catch (error) {\n    // A surface can dispose the whole tree while the watcher is still opening;","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/boot/app-boot/src/index.ts#L222-L258","documentation":"Error \"${binName}: user patch-layer watching requires the root Include entry\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/boot/app-boot/src/index.ts:240 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the root Include entry required for watching, or disable patch-layer watching."],"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"}