workspace-links
The built-in Policy workspace-links, against a checkout that loads another checkout’s packages, a stale worktree, a full disk: its defaults, its options and a configuration that writes it.
To learn what it guards against and see it at work, read the guide: Session start.
Defaults
| Default | Value |
|---|---|
| On by default | no: an entry turns it on |
| Fail mode | open |
| Timeout | 9000 ms |
| Events | SessionStart, PreToolUse |
| Tools | Bash, Edit, MultiEdit, NotebookEdit, Write |
| Agent types | every agent, or as its options set |
Options
| Option | Type | Default | Description |
|---|---|---|---|
deadlineMillis | integer | — | How long the check may take, in milliseconds, before it says why it could not finish (6000 when absent). |
installCommand | string | — | The command the context tells the agent to run in the checkout; the project's package manager's when absent. |
manifests | string | — | The glob, relative to the checkout, of its workspace packages' manifests; when absent, the manifests of the folders the workspaces of the checkout's root package.json names (an array of globs, or Yarn's { packages }), none without one. |
scope | string | — | The prefix of the workspace package names the check reads, such as @acme/; every workspace package when absent. |
Example
A configuration that writes every option, a comment above each:
import { defineConfig } from '@microeinhundert/harness-kit';
export default defineConfig({
// The Policy entries, in the order their Decisions merge in.
policies: [
{
// The Policy's name, unique in the configuration; messages and logs name the Policy by it.
id: 'workspace-links',
// The constructor's options, which it decodes.
options: {
// How long the check may take, in milliseconds, before it says why it could not finish
// (6000 when absent).
deadlineMillis: 1,
// The command the context tells the agent to run in the checkout; the project's package
// manager's when absent.
installCommand: 'npm ci',
// The glob, relative to the checkout, of its workspace packages' manifests; when absent,
// the manifests of the folders the `workspaces` of the checkout's root `package.json` names
// (an array of globs, or Yarn's `{ packages }`), none without one.
manifests: 'packages/*/package.json',
// The prefix of the workspace package names the check reads, such as `@acme/`; every
// workspace package when absent.
scope: '@acme/',
},
// The name of the kit's Policy constructor that builds the Policy.
use: 'workspace-links',
},
],
});codegraph
The built-in Policy codegraph, against a checkout that loads another checkout’s packages, a stale worktree, a full disk: its defaults, its options and a configuration that writes it.
worktree-health
The built-in Policy worktree-health, against a checkout that loads another checkout’s packages, a stale worktree, a full disk: its defaults, its options and a configuration that writes it.