status-sync
The built-in Policy status-sync, against a turn that ends with failing lint, unsaved work or an incomplete hand-off: its defaults, its options and a configuration that writes it.
To learn what it guards against and see it at work, read the guide: Stop checks and hand-off.
Defaults
| Default | Value |
|---|---|
| On by default | no: an entry turns it on |
| Fail mode | open |
| Timeout | 30000 ms |
| Events | set by its options |
| Tools | every tool, or as its options set |
| Agent types | every agent, or as its options set |
Options
| Option | Type | Default | Description |
|---|---|---|---|
branchKey | string | "^[^/]+/([a-z]+-[0-9]+)" | The pattern whose first group is the branch's issue key, read in capitals. |
copies | object | {"multiTargetSuffix":"-onto-","worktreeSuffix":"-[0-9]+$"} | How a worktree's copy of a branch is named, so feature/t-1-x-2 answers for feature/t-1-x. |
map | object[] | [{"pr":"draft","role":"in_flight"},{"pr":"ready","role":"first_review"},{"pr":"merged_into_default","role":"deploy_queue"}] | The role each pull request stage asks of its issue. |
projects | object | {} | Roles of their own for single tracker projects, by key prefix ({ "OPS": { "roles": [] } } holds a project to nothing). |
regressFrom | object | {"in_flight":["first_review"]} | The roles an issue moves back from when its pull request moves back, by the role asked. |
roles | object[] | required | The board's roles in workflow order, each { role, status }, such as { "role": "in_flight", "status": "In Progress" }. |
skipBranches | string[] | ["^epic/"] | Patterns of branches never judged. |
transitionHint | string | "harness-kit tracker transition {key} \"{status}\"" | The fix that moves an issue, with {key} and {status} in place. |
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: 'status-sync',
// The constructor's options, which it decodes.
options: {
// The pattern whose first group is the branch's issue key, read in capitals.
branchKey: '^[^/]+/([a-z]+-[0-9]+)',
// How a worktree's copy of a branch is named, so `feature/t-1-x-2` answers for
// `feature/t-1-x`.
copies: {
// The text that opens the suffix of a branch's copy made for one target, such as `-onto-`
// in `feat-x-onto-release-3`.
multiTargetSuffix: '-onto-',
// The pattern of the suffix a worktree's copy of a branch adds, such as `-[0-9]+$` for
// `feat-x-2`, a copy of `feat-x`.
worktreeSuffix: '-[0-9]+$',
},
// The role each pull request stage asks of its issue.
map: [
{
// The state of the pull request: `draft`, `ready`, or `merged_into_default`.
pr: 'draft',
// The role the issue of a pull request in that state is asked to have.
role: 'in_flight',
},
{
// The state of the pull request: `draft`, `ready`, or `merged_into_default`.
pr: 'ready',
// The role the issue of a pull request in that state is asked to have.
role: 'first_review',
},
{
// The state of the pull request: `draft`, `ready`, or `merged_into_default`.
pr: 'merged_into_default',
// The role the issue of a pull request in that state is asked to have.
role: 'deploy_queue',
},
],
// Roles of their own for single tracker projects, by key prefix
// (`{ "OPS": { "roles": [] } }` holds a project to nothing).
projects: {
OPS: {
// The project's roles in workflow order, each `{ role, status }`; an empty list holds
// the project to nothing.
roles: [
{
// The role's name, which `map` and `regressFrom` refer to.
role: 'in_flight',
// The status name the role reads on the board; `null` switches the role off.
status: 'In Progress',
},
],
},
},
// The roles an issue moves back from when its pull request moves back, by the role asked.
regressFrom: {
in_flight: ['first_review'],
},
// The board's roles in workflow order, each `{ role, status }`, such as
// `{ "role": "in_flight", "status": "In Progress" }`.
roles: [
{
// The role's name, which `map` and `regressFrom` refer to.
role: 'in_flight',
// The status name the role reads on the board; `null` switches the role off.
status: 'In Progress',
},
],
// Patterns of branches never judged.
skipBranches: ['^epic/'],
// The fix that moves an issue, with `{key}` and `{status}` in place.
transitionHint: 'harness-kit tracker transition {key} "{status}"',
},
// The name of the kit's Policy constructor that builds the Policy.
use: 'status-sync',
},
],
});references
The built-in Policy references, against a turn that ends with failing lint, unsaved work or an incomplete hand-off: its defaults, its options and a configuration that writes it.
tracker-fields
The built-in Policy tracker-fields, against a turn that ends with failing lint, unsaved work or an incomplete hand-off: its defaults, its options and a configuration that writes it.