Files
deepseek-harness/website/zh-CN/api/harness/invariants.md
2026-07-20 02:00:40 +08:00

1.5 KiB

ctx.invariants

InvariantService — provided by @deepseek-ai/dsh-invariants.

Package-owned invariant registry with global and regex-based selection.

Source

ctx.invariants.register(packageName, installer)

/**
 * Register one package's invariant installer. The package name is reserved
 * even when filtering disables its checks. Enabled installers run in a child
 * fiber; failure disposes that fiber and releases the reservation.
 * @param packageName - full npm package name that owns the contribution.
 * @param installer - listener or startup-check installer for the child context.
 * @returns an effect-scoped disposer for the registration.
 */
register(packageName: string, installer: InvariantInstaller): () => void

Register one package's invariant installer. The package name is reserved even when filtering disables its checks. Enabled installers run in a child fiber; failure disposes that fiber and releases the reservation.

  • packageName — full npm package name that owns the contribution.
  • installer — listener or startup-check installer for the child context.

Returns an effect-scoped disposer for the registration.

Source