Shift work: clock in
shiftwork_clock_inValidates the checkpoint and returns one ready unit’s brief to hand verbatim to the agent you spawn; call once per unit before spawning.
Instructions
Shift-work clock-in: validate the checkpoint against the checkpoint schema and return the brief of ONE unit — {unit, role, invariants, handoff, do_not, files} — to hand to the agent you spawn, verbatim. Call it once per unit, right before spawning; use shiftwork_plan first to see the ready batch when several units are to run at once, and shiftwork_clock_out, not this tool, when a unit finishes. The unit briefed is plan.cursor, or unit_id when given; either way it must be in shiftwork_plan's ready — a done or dropped cursor, a cursor whose dependencies have not run, or a unit_id naming no unit answers {"result": "error", "reason": "unit is not ready; ready is <a, b>"}, and the batch view's own refusals (cycle, unknown dependency, unreadable checkpoint) pass through verbatim. A ready unit whose touches shares a path with a unit briefed and not yet clocked out is refused too, before any brief: unit <id> touches <path>, which <other> holds until its clock-out. A checkpoint whose reviews break review independence is refused with shiftwork_plan's sentence. With job.budget declared, a brief that does not fit is refused: budget <dim> spent: <n> of <limit>; raise job.budget or stop the job. The other outcomes, never exceptions: escalate when handoff.open_questions is non-empty (stop and ask the user) or when the cursor names no unit, success when every unit is done or dropped, error when the checkpoint fails validation. It never moves plan.cursor; clock_out does. What it WRITES: on result=brief, and only then, one line {event: brief, ts, unit, role} appended to .log.jsonl — best-effort, so a log it cannot write costs the brief nothing. That line is what later lets clock_out accept the unit while the cursor is elsewhere and sets briefed on its accounting line. The checkpoint file itself is never modified. See docs/shiftwork.md.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit_id | No | The unit to brief instead of plan.cursor; it must be in shiftwork_plan's `ready` for this checkpoint. Omit it, or pass null, to brief the cursor unit. | |
| checkpoint | Yes | Path to the shift-work checkpoint JSON file (by convention .shiftwork/checkpoint.json in the repo the job works on), absolute or relative to the server's working directory. The same file shiftwork_plan, shiftwork_clock_in and shiftwork_clock_out take; it must validate against assets/schemas/shiftwork-checkpoint.json. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | The unit's role, the key job.roles may bind models to. | |
| unit | No | The plan.units entry briefed: id, role, status, depends_on and its own fields. | |
| files | No | state.artifacts: the files the job has produced so far. | |
| do_not | No | handoff.do_not: near-mistakes past sessions made. | |
| reason | No | With result `escalate`, `success` or `error`: one sentence saying why. | |
| result | Yes | `brief` (the unit is yours to spawn), `escalate` (stop and ask: see `reason` and `open_questions`), `success` (every unit done or dropped), or `error` with `reason`. | |
| handoff | No | The checkpoint's handoff block: next_action, open_questions, do_not, notes. | |
| upstream | No | One {unit, title, status, last} per depends_on id, in depends_on order: last is that unit's newest attempt (status, outcome, notes?, produced?) or null. Always present with a brief. | |
| agreements | No | job.agreements: the working agreements adopted so far through clock_out, carried on every brief; [] when none. | |
| invariants | No | job.constraints: what every unit must keep true. | |
| open_questions | No | With result `escalate`: the questions the orchestrator must put to the user before any unit runs. An irreversible unit whose verb job.authorized does not grant also escalates (#225), with no open_questions. | |
| prior_attempts | No | This unit's own attempts, oldest first, at most 3; [] when none. A unit clocked out todo and briefed again is a rework, and this is what it found. |