taskchef 6.1.3 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,279 @@
1
+ # FirstMate and TaskChef: architecture and fit
2
+
3
+ > **Research, not contract.** This document compares two version-scoped
4
+ > implementations. It does not define TaskChef behavior; the normative source
5
+ > is the [TaskChef specification](spec.md). Recheck the linked sources before relying on these
6
+ > conclusions after the access date.
7
+
8
+ For TaskChef installation and everyday use, start with the
9
+ [README](../README.md). For its current implementation flow, see
10
+ [TaskChef workflows](workflows.md).
11
+
12
+ ## Scope and sources
13
+
14
+ **Access date:** 2026-08-25
15
+
16
+ **TaskChef scope:** the TaskChef 7 contract in this repository revision.
17
+ Current behavior was verified against the [specification](spec.md),
18
+ [workflows](workflows.md), packaged skills,
19
+ [MCP implementation](https://github.com/favoyang/taskchef/blob/main/src/mcp.js),
20
+ [workspace implementation](https://github.com/favoyang/taskchef/blob/main/src/workspace.js),
21
+ CLI, dashboard, and tests.
22
+
23
+ **FirstMate scope:**
24
+ [`kunchenguid/firstmate`](https://github.com/kunchenguid/firstmate) at commit
25
+ [`038d0f7`](https://github.com/kunchenguid/firstmate/tree/038d0f7ec6ba7238a151722931434dcf06ff37c4),
26
+ the tip of its official `main` branch when accessed. Repository history already
27
+ identified Kunchenguid's project as the intended FirstMate; no competing local
28
+ reference pointed to another project.
29
+
30
+ Primary FirstMate sources:
31
+
32
+ - [README](https://github.com/kunchenguid/firstmate/blob/038d0f7ec6ba7238a151722931434dcf06ff37c4/README.md)
33
+ for product goals, installation, features, and supported harnesses;
34
+ - [AGENTS.md](https://github.com/kunchenguid/firstmate/blob/038d0f7ec6ba7238a151722931434dcf06ff37c4/AGENTS.md)
35
+ for the coordinator's operating contract, authority, delegation, supervision,
36
+ and delivery rules;
37
+ - [Architecture](https://github.com/kunchenguid/firstmate/blob/038d0f7ec6ba7238a151722931434dcf06ff37c4/docs/architecture.md)
38
+ for watcher, session backend, worktree, state, and recovery mechanics;
39
+ - [Configuration](https://github.com/kunchenguid/firstmate/blob/038d0f7ec6ba7238a151722931434dcf06ff37c4/docs/configuration.md)
40
+ for operational-home state, project modes, profiles, and extension settings;
41
+ - [Codex App boundary](https://github.com/kunchenguid/firstmate/blob/038d0f7ec6ba7238a151722931434dcf06ff37c4/docs/codex-app-backend.md)
42
+ for the current limit that Codex desktop is not a selectable FirstMate runtime
43
+ backend;
44
+ - [Vision](https://github.com/kunchenguid/firstmate/blob/038d0f7ec6ba7238a151722931434dcf06ff37c4/VISION.md)
45
+ for the intended single-liaison, durable-fleet experience.
46
+
47
+ Unless labeled **Inference** or **Recommendation**, statements below are facts
48
+ supported by those version-scoped sources or the TaskChef 7 codebase.
49
+
50
+ ## Executive comparison
51
+
52
+ **Fact:** TaskChef is a Codex-native dispatch and task-index layer. It routes a
53
+ request to visible Codex tasks, returns immediately, and lets the user work with
54
+ each executor directly. It stores one latest task snapshot and offers read-only
55
+ reports and a local dashboard.
56
+
57
+ **Fact:** FirstMate is an agent distribution for running a supervised crew. The
58
+ user talks to one primary coordinator, which dispatches workers into isolated
59
+ worktrees and visible session backends, watches meaningful state, escalates
60
+ decisions, follows configured delivery modes, and reconciles durable fleet state
61
+ after restart.
62
+
63
+ **Inference:** The products overlap at intake, project routing, parallel task
64
+ creation, and observability. Their central responsibility boundary differs:
65
+ TaskChef hands control to native Codex tasks; FirstMate retains coordination
66
+ responsibility until an outcome is landed, transferred, or safely preserved.
67
+
68
+ ## Architecture at a glance
69
+
70
+ | Dimension | TaskChef 7 | FirstMate at `038d0f7` |
71
+ | --- | --- | --- |
72
+ | Primary goal | Put multi-project work into the right visible Codex task and make it findable later. | Let one person direct a supervised crew across projects through one liaison. |
73
+ | Product form | Codex plugin: three skills, local MCP server, data CLI, and loopback dashboard. | Cloneable agent distribution: instructions, internal skills, scripts, policies, and private on-disk state. |
74
+ | Runtime | Native Codex desktop tasks are the executors and live source of truth. | Harness-driven workers in tmux by default, with documented alternative session backends; Codex can be a harness, but Codex desktop is not a runtime backend. |
75
+ | Coordinator lifetime | Dispatcher returns immediately and does not supervise. | First mate remains active and uses watcher/guard mechanisms to supervise meaningful events. |
76
+ | Project isolation | Delegates to the configured Codex project; isolation follows native Codex/project behavior. | Ship and scout workers require separate Treehouse- or backend-managed worktrees. |
77
+ | Durable state | `taskchef.json` plus latest snapshots in `tasks.jsonl`. | Backlog, briefs, reports, task metadata, status-event logs, decisions, endpoint records, and configuration under an operational home. |
78
+
79
+ ## Goals and user experience
80
+
81
+ ### TaskChef
82
+
83
+ **Fact:** The user submits work in the dispatcher or explicitly invokes
84
+ `$taskchef-delegate` elsewhere. TaskChef creates independently openable Codex
85
+ tasks and returns links. The user opens those tasks for questions, approvals,
86
+ follow-ups, and delivery.
87
+
88
+ **Strength:** This preserves the familiar Codex task model and makes delegation
89
+ transparent. There is little new runtime or policy to learn.
90
+
91
+ **Limitation:** Several active executors still mean several conversations. A
92
+ dispatcher report reduces search cost but does not own supervision or recovery.
93
+
94
+ ### FirstMate
95
+
96
+ **Fact:** The user talks to the first mate as the single liaison. Crewmates do
97
+ project work; the first mate reads projects, supervises the fleet, reconciles
98
+ direct user intervention, brings forward decisions, and reports outcomes.
99
+
100
+ **Strength:** The user can look away while one coordinator retains context and
101
+ responsibility across a larger fleet.
102
+
103
+ **Limitation:** The experience requires more local tooling, state, policy, and
104
+ operational machinery than a simple dispatcher. The coordinator's summaries
105
+ also insert an interpretation layer between user and worker.
106
+
107
+ ## Task identity and persistence
108
+
109
+ ### TaskChef
110
+
111
+ **Fact:** `prepare_dispatch` allocates a TaskChef UUID and exact first-line
112
+ marker. `record_task` persists the marked instruction before native task
113
+ creation. The executor then reads its own `CODEX_THREAD_ID` and calls
114
+ `link_task`; the dispatcher neither searches recent tasks nor repairs identity.
115
+ The task record keeps one immutable intent/project snapshot plus the latest
116
+ identity and semantic result fields.
117
+
118
+ **Fact:** Schema 4 linking accepts one atomic null-to-canonical-Codex-UUIDv7
119
+ transition. Exact retries are idempotent, conflicts fail, and link interruption
120
+ remains visibly pending. Follow-up semantic results require a newer exact
121
+ native turn ID.
122
+
123
+ ### FirstMate
124
+
125
+ **Fact:** FirstMate assigns a task identity used across backlog entries, briefs,
126
+ worker endpoint metadata, worktrees, status events, reports, and delivery
127
+ artifacts. Durable disk records plus live backend state allow session-start and
128
+ watcher reconciliation.
129
+
130
+ **Inference:** TaskChef's identity model is narrower and easier to audit because
131
+ it binds one record to one native executor. FirstMate's richer identity graph is
132
+ necessary for supervision and recovery, but creates more reconciliation paths
133
+ and invariants.
134
+
135
+ ## Delegation and concurrency
136
+
137
+ ### TaskChef
138
+
139
+ **Fact:** The delegation skill splits only independently useful outcomes,
140
+ routes each to exactly one configured project, records before one native
141
+ creation call, and returns immediately. Multiple dispatchers and executors may
142
+ share the workspace; locking and atomic JSONL replacement serialize mutations.
143
+
144
+ **Fact:** TaskChef itself does not allocate worktrees, choose worker models,
145
+ schedule dependencies, retry failed execution, or enforce a repository delivery
146
+ mode. Those belong to Codex and each target project's instructions.
147
+
148
+ ### FirstMate
149
+
150
+ **Fact:** FirstMate distinguishes ship work from scout investigation, prepares
151
+ durable task material, selects a configured harness/profile, and spawns workers
152
+ in isolated worktrees. Independent work may run concurrently; dependencies and
153
+ unsafe shared state can hold work back.
154
+
155
+ **Fact:** Supported runtime backends and harness adapters are explicit
156
+ extension surfaces. The reference path uses tmux, while other documented
157
+ backends have different verification or experimental status.
158
+
159
+ ## Status and results
160
+
161
+ ### TaskChef
162
+
163
+ **Fact:** Persisted statuses are `working`, `needs_input`, `completed`, and
164
+ `failed`. Executors report
165
+ `working` at turn start and a semantic state before ending. Schema 5 preserves
166
+ the last concise semantic result separately while a newer turn is working.
167
+ `needs_input` is reserved for a real semantic decision, not a native approval
168
+ prompt.
169
+
170
+ **Fact:** The report skill treats cached results as evidence, takes one recent
171
+ Codex metadata snapshot, and performs targeted exact-thread reads only for
172
+ selected anomalies or freshness checks. It never polls or writes inferred
173
+ state.
174
+
175
+ ### FirstMate
176
+
177
+ **Fact:** FirstMate combines durable task/backlog state, append-only status
178
+ events, live backend evidence, validation/delivery artifacts, and watcher wake
179
+ records. Its supervision path distinguishes historical event logs from current
180
+ worker state and escalates meaningful decisions, failures, stalls, and delivery
181
+ milestones.
182
+
183
+ **Inference:** TaskChef optimizes for a small truthful cache and bounded reads;
184
+ FirstMate optimizes for continuity and active coordination. Neither data model
185
+ can be substituted for the other without changing product responsibility.
186
+
187
+ ## UI and observability
188
+
189
+ ### TaskChef
190
+
191
+ **Fact:** The loopback dashboard watches `tasks.jsonl`, streams stable validated
192
+ snapshots, filters and orders tasks, shows notifications and details, and opens
193
+ a task directly in Codex when its stored thread ID has a supported UUID shape.
194
+ This navigation check does not prove schema 4 or 5 self-link provenance. The
195
+ dashboard does not refresh native task state, submit replies, or show
196
+ transcripts or token usage.
197
+
198
+ **Fact:** The user can also ask for a live TaskChef report or inspect the data
199
+ CLI. Executor work remains visible in normal Codex desktop tasks.
200
+
201
+ ### FirstMate
202
+
203
+ **Fact:** Workers run in visible session backends that the user can inspect or
204
+ intervene in, while the first mate remains the primary interface. Fleet views,
205
+ durable status/decision records, and watcher-driven wakes provide the
206
+ coordinator's operational observability.
207
+
208
+ **Fact:** FirstMate currently documents Codex desktop as an integration
209
+ boundary, not a selectable worker backend. Codex CLI can participate through a
210
+ harness adapter.
211
+
212
+ ## Integrations and extension model
213
+
214
+ | Area | TaskChef | FirstMate |
215
+ | --- | --- | --- |
216
+ | Codex | Built around native Codex projects, tasks, thread reads, and desktop deep links. | Codex is one verified harness; desktop tasks are not its worker runtime. |
217
+ | GitHub | Configured repository URLs aid routing; delivery remains the executor project's concern. | GitHub CLI, PR state, and configured delivery modes are part of supervised shipping workflows. |
218
+ | Skills | Three plugin skills with narrow bootstrap, delegate, and report responsibilities. | Internal firstmate-only skills plus standalone public skills; AGENTS.md routes conditional procedures. |
219
+ | MCP | Four primary local TaskChef tools plus one deprecated compatibility alias own deterministic identity and state writes. | FirstMate describes itself as an agent distribution rather than an MCP product; deterministic behavior lives largely in scripts. |
220
+ | Runtime extensions | Extend plugin skills/MCP/CLI/dashboard or compose native Codex capabilities. | Add or verify harness adapters, session backends, dispatch profiles, operational scripts, and optional integrations. |
221
+
222
+ ## Trust and security boundaries
223
+
224
+ ### TaskChef
225
+
226
+ **Fact:** The MCP server is local and does not receive transport-authenticated
227
+ Codex caller identity. Executor thread and turn IDs are cooperative assertions.
228
+ Validation prevents accidental parent/provisional identity capture, duplicate
229
+ identity use, stale-turn replacement, and malformed record mutation; it does
230
+ not resist a deliberately forged local MCP caller.
231
+
232
+ **Fact:** The dashboard binds to loopback, has no browser authentication, and
233
+ uses Host/Origin checks for open-in-Codex actions. It must not be exposed
234
+ through a proxy or tunnel. Workspace mutation uses one lock and atomic writes.
235
+
236
+ ### FirstMate
237
+
238
+ **Fact:** The first mate is normally read-only over project clones; crewmates
239
+ make project changes in isolated worktrees. Merge, destructive action, and
240
+ standing autonomy are governed by explicit captain authority and per-project
241
+ delivery modes. Scripts validate task endpoints, homes, worktrees, and state
242
+ before sensitive lifecycle actions.
243
+
244
+ **Inference:** TaskChef has a smaller local attack and failure surface but
245
+ delegates repository safety to Codex and project policy. FirstMate explicitly
246
+ owns more delivery and process safety, which improves centralized control while
247
+ expanding the trusted script, state, backend, and credential surface.
248
+
249
+ ## Strengths, limitations, and best fit
250
+
251
+ | Product | Strongest when | Less suitable when |
252
+ | --- | --- | --- |
253
+ | TaskChef | You already use Codex desktop; want one multi-project inbox; prefer direct executor conversations; value a small inspectable history; want minimal runtime machinery. | You want one liaison to supervise, recover, coordinate decisions, enforce delivery modes, or return only consolidated outcomes. |
254
+ | FirstMate | You want one coordinator to run many visible workers; need isolated worktrees, durable fleet recovery, proactive supervision, and consistent delivery policy across projects. | You want native Codex desktop tasks as the core UI; prefer minimal setup and state; or want to interact directly with every executor without a coordinator layer. |
255
+
256
+ ## Recommendations
257
+
258
+ **Recommendation:** Choose TaskChef when the problem is routing and task
259
+ findability. Choose FirstMate when the problem is sustained supervisory
260
+ attention and delivery coordination.
261
+
262
+ **Recommendation:** Do not casually nest the systems. A FirstMate coordinator
263
+ behind every TaskChef executor, or TaskChef dispatch inside every FirstMate
264
+ worker, adds identity, authority, and recovery boundaries without a clear owner.
265
+ If composition is necessary, define exactly one supervisory layer and treat the
266
+ other as a leaf runtime or intake adapter.
267
+
268
+ **Recommendation:** TaskChef can borrow outcome-oriented reporting ideas
269
+ without becoming a supervisory runtime. Useful candidates are clearer
270
+ completion summaries and an explicit user-approved result-to-follow-up handoff.
271
+ They should preserve native Codex task ownership, bounded reads, and the absence
272
+ of background supervision.
273
+
274
+ **Inference:** Reproducing FirstMate's restart-proof crew management inside
275
+ TaskChef would not be a small feature. It would require new durable state,
276
+ worker liveness contracts, worktree ownership, decision queues, delivery
277
+ authority, retry/recovery policy, and a continuously supervised runtime. That
278
+ would change TaskChef's product category and should be evaluated as a separate
279
+ architecture rather than an incremental dashboard enhancement.
package/docs/spec.md ADDED
@@ -0,0 +1,265 @@
1
+ # TaskChef specification
2
+
3
+ This is TaskChef's normative agent-facing contract. **MUST**, **MUST NOT**,
4
+ **SHOULD**, and **MAY** are requirements in the RFC 2119 sense. The
5
+ [README](../README.md) owns user setup and operation; [workflows](workflows.md)
6
+ owns implementation walkthroughs; the [FirstMate comparison](firstmate-taskchef-comparison.md)
7
+ is dated research, not contract.
8
+
9
+ ## Terminology
10
+
11
+ | Term | Definition |
12
+ | --- | --- |
13
+ | **TaskChef** | The plugin, skills, MCP server, CLI, dashboard, and current workspace formats defined here. |
14
+ | **Dispatcher workspace** | The per-user local data project selected by `--workspace`, then `TASKCHEF_WORKSPACE`, then `~/.agents/taskchef`. |
15
+ | **Dispatcher** | The Codex task that accepts a request, routes it, records it, creates executors, and returns without supervising them. |
16
+ | **Configured project** | One routing target in `taskchef.json`, identified by canonical local path and described by `name`, optional `description`, `isGitRepository`, and `githubRepos`. |
17
+ | **Routing** | Selecting exactly one configured project and exactly one matching native Codex project for an outcome. |
18
+ | **Delegated task** | One independently useful outcome represented by one TaskChef task UUID and snapshot. |
19
+ | **Executor** | The native Codex task created to own and perform one delegated task. |
20
+ | **Task record** | One complete JSON object in `tasks.jsonl`; it contains immutable intent/project fields and mutable identity/result fields. |
21
+ | **Marker** | The exact first instruction line `<!-- taskchef_id=<lowercase full UUID> -->`, followed by a blank line. |
22
+ | **Record-before-create** | Persisting a link-pending task before asking Codex to create its executor. |
23
+ | **Self-linking** | The executor's one-way registration of its own canonical Codex UUIDv7 from `CODEX_THREAD_ID`. |
24
+ | **Link-pending** | A working task whose `threadId` is null and `updatedBy` is `dispatcher`. |
25
+ | **Current execution state** | The latest reported executor turn and its `working`, `needs_input`, `completed`, or `failed` status. |
26
+ | **Last semantic result** | The most recent `completed`, `needs_input`, or `failed` outcome, preserved separately while a newer turn is working. |
27
+ | **Current turn ID** | The canonical Codex UUIDv7 returned by an exact native read of the linked executor for the turn being reported. |
28
+ | **Dashboard** | The loopback, read-only UI derived from validated workspace snapshots and bounded native actions. |
29
+ | **Skill** | One packaged agent procedure: `taskchef-bootstrap`, `taskchef-delegate`, or `taskchef-report`. |
30
+
31
+ ## Components and ownership
32
+
33
+ - `taskchef-bootstrap` MUST own initialization, project configuration, and
34
+ diagnostics. It MUST NOT dispatch or report unless separately requested.
35
+ - `taskchef-delegate` MUST own routing and record-before-create delegation.
36
+ It MUST return after creation and MUST NOT poll, supervise, or infer identity.
37
+ - `taskchef-report` MUST own on-demand reporting. It MUST NOT poll or persist
38
+ inferred state.
39
+ - The MCP server MUST expose four primary lifecycle tools plus the deprecated
40
+ `report_result` compatibility alias specified below.
41
+ - The CLI MAY administer and inspect the workspace, but MUST NOT provide a
42
+ second agent lifecycle protocol.
43
+ - The dashboard MUST be read-only with respect to dispatcher files.
44
+ - `docs/spec.md` is the single normative behavior source. Other documents
45
+ MUST link here rather than redefine the contract.
46
+
47
+ ## Workspace contract
48
+
49
+ TaskChef MUST manage only `AGENTS.md`, `taskchef.json`, and `tasks.jsonl`
50
+ inside the dispatcher workspace. It MUST preserve unrelated paths.
51
+
52
+ `taskchef.json` MUST have schema version 2 and exactly:
53
+
54
+ ```json
55
+ {
56
+ "schemaVersion": 2,
57
+ "projects": []
58
+ }
59
+ ```
60
+
61
+ Each project MUST contain `name`, normalized absolute `path`, boolean
62
+ `isGitRepository`, and array `githubRepos`; `description` is optional.
63
+ Names and paths MUST be unique. Git projects MUST be exact Git roots.
64
+ Repository URLs MUST canonicalize to `https://github.com/<owner>/<repository>`
65
+ and be case-insensitively deduplicated.
66
+
67
+ `tasks.jsonl` MUST contain zero or more newline-terminated schema-4 or schema-5
68
+ records, one per line. Schema 4 is read compatibility for the previously
69
+ released format; every new record and state mutation MUST write schema 5.
70
+ Other schemas or unsupported fields MUST be rejected without conversion.
71
+ Reads and writes MUST reject symlinked managed files. Mutations
72
+ MUST hold the shared workspace lock and replace state atomically; read-only
73
+ operations MUST NOT require write permission.
74
+
75
+ ## Task schema
76
+
77
+ Every record MUST contain exactly these fields:
78
+
79
+ | Field | Contract |
80
+ | --- | --- |
81
+ | `schemaVersion` | Integer `5`; schema-4 records remain readable until their next mutation. |
82
+ | `id` | Unique safe TaskChef ID; delegation uses a lowercase full UUID. |
83
+ | `project` | Immutable configured-project snapshot. |
84
+ | `title` | Non-empty display title. |
85
+ | `instruction` | Non-empty executor instruction; link-pending records MUST contain the exact marker for `id`. |
86
+ | `threadId` | Null while link-pending; after self-link, canonical Codex UUIDv7. Low-level current-schema direct records may hold another durable non-provisional ID but are outside the MCP delegation journey. |
87
+ | `createdAt` | ISO 8601 creation timestamp. |
88
+ | `status` | `working`, `needs_input`, `completed`, or `failed`. |
89
+ | `summary` | Null while working; otherwise the current semantic state's non-empty summary of at most 2,000 characters. |
90
+ | `turnId` | Null before turn reporting; otherwise the current reported turn. Linked MCP journeys use a canonical Codex UUIDv7. |
91
+ | `updatedAt` | ISO 8601 timestamp not earlier than `createdAt` or the prior `updatedAt`; clock rollback cannot backdate a transition. |
92
+ | `updatedBy` | `dispatcher` or `mcp`. |
93
+ | `lastResult` | Null before a semantic result; otherwise `{status, summary, turnId, updatedAt}` preserving the latest semantic result. |
94
+
95
+ Task IDs and non-null thread identities MUST be unique. The immutable intent
96
+ fields MUST NOT change after recording.
97
+
98
+ ## Required lifecycle
99
+
100
+ 1. The dispatcher MUST call `prepare_dispatch` once per outcome.
101
+ 2. It MUST choose exactly one configured project and exact native-project path.
102
+ 3. It MUST build the instruction from the returned marker, a blank line, the
103
+ packaged executor contract paragraphs, and the user's outcome.
104
+ 4. It MUST call `record_task` with `threadId: null` before native creation.
105
+ 5. It MUST create exactly one native Codex executor and return immediately.
106
+ 6. The executor MUST read its own `CODEX_THREAD_ID` and call `link_task`
107
+ before substantive work. It MUST NOT use parent/session identity or guess.
108
+ 7. After initial linking, the executor MUST exactly read its linked task and
109
+ call `report_state` with that turn ID, `working`, and no summary before work.
110
+ 8. Before ending, it MUST call `report_state` for the same working turn with a
111
+ semantic status and concise summary.
112
+ 9. A follow-up MUST report `working` with its new current turn ID before work.
113
+ It MUST NOT reuse a prior turn.
114
+
115
+ If native creation fails after recording, the dispatcher MUST call
116
+ `report_state` with `failed`, null thread/turn IDs, and a bounded summary.
117
+ A link failure MUST remain visible and retryable; the executor MUST report it
118
+ visibly and MUST NOT continue substantive work.
119
+
120
+ `needs_input` MUST mean a semantic user decision or missing fact. A native
121
+ approval prompt MUST remain live Codex state and MUST NOT be stored as
122
+ `needs_input`.
123
+
124
+ ## MCP interface
125
+
126
+ All tools resolve the workspace internally. Callers MUST NOT supply a workspace
127
+ path. Success returns both one text content item and the stated structured
128
+ object. Validation, marker, identity, uniqueness, freshness, or filesystem
129
+ failures are surfaced as tool errors and MUST NOT partially mutate the log.
130
+
131
+ ### `prepare_dispatch`
132
+
133
+ **Caller:** dispatcher. **Mutation:** none.
134
+
135
+ **Input:** empty object.
136
+
137
+ **Structured output:**
138
+
139
+ ```text
140
+ { preparation: {
141
+ schemaVersion: 1,
142
+ workspace: string,
143
+ taskId: string,
144
+ preparedAt: string,
145
+ marker: string,
146
+ projectCount: number,
147
+ projects: Project[]
148
+ } }
149
+ ```
150
+
151
+ The tool generates a fresh task UUID and exact marker and returns current
152
+ routing targets. An invocation is not idempotent: each successful call creates
153
+ new preparation values, though it writes no state.
154
+
155
+ **Annotations:** `readOnlyHint: true`, `destructiveHint: false`,
156
+ `openWorldHint: false`.
157
+
158
+ ### `record_task`
159
+
160
+ **Caller:** dispatcher. **Mutation:** atomically appends one task.
161
+
162
+ **Input:**
163
+
164
+ | Field | Type and rule |
165
+ | --- | --- |
166
+ | `id` | Non-empty string; MUST equal the instruction marker. |
167
+ | `project` | Non-empty configured project path. |
168
+ | `title` | Non-empty string. |
169
+ | `instruction` | Non-empty string beginning with the exact marker and blank line. |
170
+ | `threadId` | Literal null. |
171
+
172
+ **Structured output:** `{ task: Task }`.
173
+
174
+ The returned task has schema 5, `working`, null summary/turn/thread/lastResult,
175
+ `updatedBy: dispatcher`, and equal creation/update timestamps. Duplicate IDs,
176
+ unknown projects, malformed markers, and invalid input fail. Repeating a
177
+ successful call is not idempotent; it fails as a duplicate.
178
+
179
+ **Annotations:** `readOnlyHint: false`, `destructiveHint: false`,
180
+ `openWorldHint: false`.
181
+
182
+ ### `link_task`
183
+
184
+ **Caller:** executor. **Mutation:** one atomic identity transition.
185
+
186
+ **Input:** `{ taskId: non-empty string, threadId: non-empty string }`.
187
+ The workspace layer requires `threadId` to be a canonical Codex UUIDv7.
188
+
189
+ **Structured output:** `{ task: Task }`.
190
+
191
+ The eligible record MUST be link-pending, working, dispatcher-written, and have
192
+ the exact marker. The thread ID MUST be unused. Success sets `threadId`,
193
+ refreshes `updatedAt`, and sets `updatedBy: mcp`. An exact successful retry
194
+ is idempotent. A different identity, terminal record, reused identity, missing
195
+ marker, or ineligible state fails.
196
+
197
+ **Annotations:** `readOnlyHint: false`, `destructiveHint: false`,
198
+ `openWorldHint: false`.
199
+
200
+ ### `report_state`
201
+
202
+ **Caller:** executor, or dispatcher only for native creation failure.
203
+ **Mutation:** replaces the current state atomically and preserves `lastResult`.
204
+
205
+ **Input:**
206
+
207
+ | Field | Type and rule |
208
+ | --- | --- |
209
+ | `taskId` | Non-empty string. |
210
+ | `threadId` | Matching non-empty ID for a linked task; null only for creation failure. |
211
+ | `turnId` | Current canonical Codex UUIDv7 for a linked MCP journey; null only for creation failure. Maximum 256 characters at the MCP boundary. |
212
+ | `status` | `working`, `needs_input`, `completed`, or `failed`. |
213
+ | `summary` | Omitted or null for `working`; required non-empty string of at most 2,000 characters otherwise. |
214
+
215
+ **Structured output:** `{ task: Task }`.
216
+
217
+ For a linked self-linking journey, `working` MUST identify a turn newer than
218
+ the current turn and last semantic result. A semantic state MUST match the
219
+ current working turn. Repeating an identical state is idempotent; conflicting
220
+ or older state fails. A null-identity record accepts only a fresh executor
221
+ creation `failed` state with both IDs null. Success sets the current state and
222
+ preserves the semantic state in `lastResult`; starting newer work does not erase
223
+ that result.
224
+
225
+ **Annotations:** `readOnlyHint: false`, `destructiveHint: true`,
226
+ `openWorldHint: false`.
227
+
228
+ ### `report_result` (deprecated)
229
+
230
+ `report_result` retains the prior semantic-only input shape and statuses as a
231
+ temporary compatibility alias. It implicitly accepts a fresh supplied turn and
232
+ stores its semantic result, including for supported schema-4 records and
233
+ low-level opaque direct records. It does not accept `working`. New executor
234
+ instructions MUST use `report_state`. Successful mutation upgrades schema 4 to
235
+ schema 5; unsupported schemas remain rejected.
236
+
237
+ ## Reporting and dashboard
238
+
239
+ A semantic result is cached evidence, not permanent live truth. Reports SHOULD
240
+ use one bounded native metadata snapshot. Active or approval-waiting native
241
+ state overrides cache. An inactive task does not prove completion. Focused
242
+ reports MAY read a selected task once when metadata is newer or evidence is
243
+ uncertain. Reports MUST NOT poll or classify assistant prose.
244
+
245
+ The dashboard MUST bind only to loopback, validate the current workspace
246
+ snapshot, and avoid sessions or shared client state. Direct thread navigation
247
+ MUST require a canonical Codex UUIDv7. Otherwise it MAY open the revalidated
248
+ configured project. Project paths from task history MUST be matched against
249
+ current configuration before use.
250
+
251
+ ## Concurrency and trust
252
+
253
+ All task and configuration writers MUST share one workspace lock. Duplicate ID,
254
+ duplicate thread, link, and result freshness checks MUST occur while holding
255
+ that lock. Atomic replacement MUST preserve valid unrelated records.
256
+
257
+ TaskChef is designed for a local, single-user boundary. Executor self-linking is
258
+ a cooperative assertion, not transport-authenticated proof. Task instructions,
259
+ stored project snapshots, and dashboard requests are untrusted input.
260
+ Implementations MUST validate exact shapes, canonical paths, safe IDs, markers,
261
+ loopback origin, and current configuration before acting.
262
+
263
+ TaskChef MUST NOT use lifecycle hooks, schedules, polling, recent-thread search,
264
+ transcript search, title matching, hidden reasoning, or token usage to discover
265
+ identity or infer semantic results.