Read where derived state disagrees with its source.
API version mission-status unreleased
Scans the Missions of the project, or the one named by missionId, and reports each place where a derived file disagrees with the record that decides it. Three kinds are reported: the status snapshot disagrees with the status event log, one of the two status files is missing, and an expected lane branch, or the Mission branch (the coordination branch that meta.json names, else the Mission branch of the lane manifest), has no local branch. A scan reads and never repairs; Rescan is a second call, and scannedAt is the time of this scan. Findings are sorted and at most 1000, with truncated true only when MORE than 1000 existed (exactly 1000 is false), and findings: [] means the scan ran and found none. A Mission whose declared coordination branch no longer exists is scanned from its own directory, which can lag the coordination surface. The stock coordination resolver may query remotes, so the outcome depends on the network. An unreachable remote leaves the Mission read from its own directory, and the answer is still a 200; a reachable remote that lacks the declared branch is likewise read from its own directory; any other resolver error is a 500 drift_scan_unreadable. The scan is refused as a whole, never partly answered: a missionId that names no Mission is a 404, and a Mission the scan cannot read is a 500.
Parameters
Query Parameters
The canonical machine identity of a Mission: a 26-character Crockford ULID minted when the Mission is created and never changed. Never confuse it with displayNumber, which is display-only and repeats.
Restricts the scan to one Mission, by its 26-character ULID. Without it every Mission of the project is scanned. A value that is not a ULID is refused with 400, and a ULID that names no Mission with 404. The display number is never accepted.
Responses
200
The drift report. It is never cached.
The result of one scan of the Missions of the project for drift: where a derived file disagrees with the record that decides it. At most 1000 findings are returned, sorted by Mission identity, kind and artifact path in the byte order of the UTF-8 encoding, and truncated is true only when more than 1000 existed (exactly 1000 is not truncated). findings is empty when the scan ran and found none. The scan reads and never repairs, and the 200 answer is sent with Cache-Control no-store, so a rescan is a second call. A Mission whose declared coordination branch no longer exists is scanned from its own directory, which can lag the coordination surface. The stock coordination resolver may query remotes, so the outcome depends on the network. An unreachable remote leaves the Mission read from its own directory, and the answer is still a 200; a reachable remote that lacks the declared branch is likewise read from its own directory; any other resolver error is a 500 drift_scan_unreadable.
object
The findings of the scan, sorted by missionId, kind and artifactPath in byte order, at most 1000. The key is unique, because a Mission has at most one finding of a kind for a file, so the order is total. The list is empty when the scan ran and found none.
One place where a derived file of a Mission disagrees with the record that decides it. A Mission has at most one finding of a kind for a file. For the kind snapshot_disagrees_with_event_log the disagreement is with the reducer replay of the event log at the snapshot’s own generation, not with the true event log: events appended after that generation are not part of the comparison. A finding never carries a host path, a branch name, an exception text or the text of a doctor message; its summary is one of six fixed sentences. missionId and artifactPath are never null, because every shipped kind belongs to one Mission and names one file.
object
The file of the Mission directory the finding is about, relative to it: status.json, status.events.jsonl or lanes.json. Never null.
Which record decides the finding. Fixed by the kind.
Which derived file holds the value that disagrees. Fixed by the kind.
What kind of drift the finding reports. This property is provisional, like the schema that carries it.
One row for each work package whose status lane differs between the status snapshot and the replay of the event log, sorted by wpId in byte order. A work package on one side only has the other side null. Empty unless the kind is snapshot_disagrees_with_event_log and the files differ in a lane, and empty for a status.json that is not a valid JSON object. This property is provisional.
One work package whose status lane differs between the status snapshot and the replay of the status event log. Both sides are status lanes, never a code lane. A work package on one side only has the other side null, and a lane outside the nine display lanes (genesis, uninitialized) reads as null.
object
The display state of a work package in the status model. Exactly nine values. The runtime enum also carries genesis and uninitialized, which are not display values: a work package with no events reads as a null status lane, never as one of those two. This is the status lane, not a code lane or the repo-root lane; the contract never groups these values into board columns.
The display state of a work package in the status model. Exactly nine values. The runtime enum also carries genesis and uninitialized, which are not display values: a work package with no events reads as a null status lane, never as one of those two. This is the status lane, not a code lane or the repo-root lane; the contract never groups these values into board columns.
The identifier of the work package inside the Mission of the finding.
The canonical machine identity of the Mission the finding belongs to. Never null.
The one action that repairs a finding, as a name and not as text. materialize_status stands for the command spec-kitty agent status materialize --mission <slug> (not spec-kitty materialize, which writes only derived views). The client builds the text and takes the slug from MissionHead.slug of the finding’s missionId. The service never runs it: a scan reads and never repairs. This enum is provisional.
How serious the finding is: error for SNAPSHOT_DRIFT and CORRUPT_JSON, warning for the two variants of the disagreement (SNAPSHOT_DRIFT_PROVENANCE, SNAPSHOT_DRIFT_TERMINAL), for a missing status file and for a missing lane branch.
The audit code behind a snapshot_disagrees_with_event_log finding: SNAPSHOT_DRIFT, SNAPSHOT_DRIFT_PROVENANCE, SNAPSHOT_DRIFT_TERMINAL or CORRUPT_JSON. Null for the two other kinds, which the audit has no code for. A string of capital letters, digits and underscores, never free text.
Fixed text, one sentence for each pair of kind and sourceCode, and no other text. The six sentences are: “The status snapshot disagrees with the event log.” for snapshot_disagrees_with_event_log with SNAPSHOT_DRIFT; “The status snapshot differs from the event log only in provenance fields.” for that kind with SNAPSHOT_DRIFT_PROVENANCE; “The status snapshot differs from the event log and every work package is done.” for that kind with SNAPSHOT_DRIFT_TERMINAL; “The status snapshot is not a valid JSON object.” for that kind with CORRUPT_JSON; “One of the status snapshot and the event log is missing.” for snapshot_or_event_log_missing with a null sourceCode; and “An expected lane or Mission branch has no local branch.” for lane_branch_missing with a null sourceCode. A pair outside this set is never produced.
The time of this scan, as an RFC 3339 date-time. Every call reads again, so a second call has a later value.
True when more than 1000 findings existed and the list holds the first 1000 of them; false for exactly 1000.
Headers
Always no-store, because every call scans again and the report is only as old as its scan.
404
The missionId names no Mission, refused with 404. The body is a problem details object whose code is mission_not_found.
The problem details body of a refused drift read. It is a Problem whose code is one of two values, and the status follows from the code: 404 for mission_not_found and 500 for drift_scan_unreadable. The body carries no host path, no Mission directory and no file content. Consumers branch on code, never on title.
object
A stable machine-readable code for the problem, such as the name of a refusal reason. Consumers branch on it, never on the title.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies this occurrence of the problem.
The HTTP status code of this occurrence.
A short, human-readable summary of the kind of problem. It does not change between occurrences.
A URI reference that identifies the kind of problem. Absent means about:blank.
The reason of the refusal. The status is fixed by it: 404 and 500 in the order of the values.
500
The scan could not read a Mission it had to read, refused with 500 and never answered as a partial report. The body is a problem details object whose code is drift_scan_unreadable.
The problem details body of a refused drift read. It is a Problem whose code is one of two values, and the status follows from the code: 404 for mission_not_found and 500 for drift_scan_unreadable. The body carries no host path, no Mission directory and no file content. Consumers branch on code, never on title.
object
A stable machine-readable code for the problem, such as the name of a refusal reason. Consumers branch on it, never on the title.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies this occurrence of the problem.
The HTTP status code of this occurrence.
A short, human-readable summary of the kind of problem. It does not change between occurrences.
A URI reference that identifies the kind of problem. Absent means about:blank.
The reason of the refusal. The status is fixed by it: 404 and 500 in the order of the values.
default
The request failed. The body is a problem details object.
The only non-2xx body of any module. A problem details object in the sense of RFC 9457, served as application/problem+json.
object
A stable machine-readable code for the problem, such as the name of a refusal reason. Consumers branch on it, never on the title.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies this occurrence of the problem.
The HTTP status code of this occurrence.
A short, human-readable summary of the kind of problem. It does not change between occurrences.
A URI reference that identifies the kind of problem. Absent means about:blank.