taskchef 6.1.2 → 7.0.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.
- package/.codex-plugin/plugin.json +1 -1
- package/BACKLOG.md +1 -1
- package/README.md +96 -454
- package/docs/firstmate-taskchef-comparison.md +277 -0
- package/docs/spec.md +246 -0
- package/docs/workflows.md +236 -0
- package/index.js +0 -2
- package/package.json +4 -3
- package/scripts/benchmark-dispatch-prepare.js +7 -7
- package/skills/taskchef-bootstrap/SKILL.md +7 -8
- package/skills/taskchef-delegate/SKILL.md +2 -9
- package/skills/taskchef-report/SKILL.md +4 -8
- package/src/cli.js +0 -21
- package/src/dashboard/app.js +6 -1
- package/src/dashboard/index.html +4 -1
- package/src/dashboard/styles.css +4 -1
- package/src/dashboard.js +1 -1
- package/src/delegation.js +4 -8
- package/src/github.js +0 -4
- package/src/mcp.js +5 -5
- package/src/workspace.js +26 -233
- package/SPEC.md +0 -107
- package/docs/delegation-design.md +0 -227
|
@@ -0,0 +1,277 @@
|
|
|
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 one
|
|
165
|
+
latest semantic result with a concise summary. `needs_input` is reserved for a
|
|
166
|
+
real semantic decision, not a native approval prompt.
|
|
167
|
+
|
|
168
|
+
**Fact:** The report skill treats cached results as evidence, takes one recent
|
|
169
|
+
Codex metadata snapshot, and performs targeted exact-thread reads only for
|
|
170
|
+
selected anomalies or freshness checks. It never polls or writes inferred
|
|
171
|
+
state.
|
|
172
|
+
|
|
173
|
+
### FirstMate
|
|
174
|
+
|
|
175
|
+
**Fact:** FirstMate combines durable task/backlog state, append-only status
|
|
176
|
+
events, live backend evidence, validation/delivery artifacts, and watcher wake
|
|
177
|
+
records. Its supervision path distinguishes historical event logs from current
|
|
178
|
+
worker state and escalates meaningful decisions, failures, stalls, and delivery
|
|
179
|
+
milestones.
|
|
180
|
+
|
|
181
|
+
**Inference:** TaskChef optimizes for a small truthful cache and bounded reads;
|
|
182
|
+
FirstMate optimizes for continuity and active coordination. Neither data model
|
|
183
|
+
can be substituted for the other without changing product responsibility.
|
|
184
|
+
|
|
185
|
+
## UI and observability
|
|
186
|
+
|
|
187
|
+
### TaskChef
|
|
188
|
+
|
|
189
|
+
**Fact:** The loopback dashboard watches `tasks.jsonl`, streams stable validated
|
|
190
|
+
snapshots, filters and orders tasks, shows notifications and details, and opens
|
|
191
|
+
a task directly in Codex when its stored thread ID has a supported UUID shape.
|
|
192
|
+
This navigation check does not prove schema 4 self-link provenance. The
|
|
193
|
+
dashboard does not refresh native task state, submit replies, or show
|
|
194
|
+
transcripts or token usage.
|
|
195
|
+
|
|
196
|
+
**Fact:** The user can also ask for a live TaskChef report or inspect the data
|
|
197
|
+
CLI. Executor work remains visible in normal Codex desktop tasks.
|
|
198
|
+
|
|
199
|
+
### FirstMate
|
|
200
|
+
|
|
201
|
+
**Fact:** Workers run in visible session backends that the user can inspect or
|
|
202
|
+
intervene in, while the first mate remains the primary interface. Fleet views,
|
|
203
|
+
durable status/decision records, and watcher-driven wakes provide the
|
|
204
|
+
coordinator's operational observability.
|
|
205
|
+
|
|
206
|
+
**Fact:** FirstMate currently documents Codex desktop as an integration
|
|
207
|
+
boundary, not a selectable worker backend. Codex CLI can participate through a
|
|
208
|
+
harness adapter.
|
|
209
|
+
|
|
210
|
+
## Integrations and extension model
|
|
211
|
+
|
|
212
|
+
| Area | TaskChef | FirstMate |
|
|
213
|
+
| --- | --- | --- |
|
|
214
|
+
| 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. |
|
|
215
|
+
| 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. |
|
|
216
|
+
| Skills | Three plugin skills with narrow bootstrap, delegate, and report responsibilities. | Internal firstmate-only skills plus standalone public skills; AGENTS.md routes conditional procedures. |
|
|
217
|
+
| MCP | Four focused local TaskChef tools own deterministic identity and result writes. | FirstMate describes itself as an agent distribution rather than an MCP product; deterministic behavior lives largely in scripts. |
|
|
218
|
+
| 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. |
|
|
219
|
+
|
|
220
|
+
## Trust and security boundaries
|
|
221
|
+
|
|
222
|
+
### TaskChef
|
|
223
|
+
|
|
224
|
+
**Fact:** The MCP server is local and does not receive transport-authenticated
|
|
225
|
+
Codex caller identity. Executor thread and turn IDs are cooperative assertions.
|
|
226
|
+
Validation prevents accidental parent/provisional identity capture, duplicate
|
|
227
|
+
identity use, stale-turn replacement, and malformed record mutation; it does
|
|
228
|
+
not resist a deliberately forged local MCP caller.
|
|
229
|
+
|
|
230
|
+
**Fact:** The dashboard binds to loopback, has no browser authentication, and
|
|
231
|
+
uses Host/Origin checks for open-in-Codex actions. It must not be exposed
|
|
232
|
+
through a proxy or tunnel. Workspace mutation uses one lock and atomic writes.
|
|
233
|
+
|
|
234
|
+
### FirstMate
|
|
235
|
+
|
|
236
|
+
**Fact:** The first mate is normally read-only over project clones; crewmates
|
|
237
|
+
make project changes in isolated worktrees. Merge, destructive action, and
|
|
238
|
+
standing autonomy are governed by explicit captain authority and per-project
|
|
239
|
+
delivery modes. Scripts validate task endpoints, homes, worktrees, and state
|
|
240
|
+
before sensitive lifecycle actions.
|
|
241
|
+
|
|
242
|
+
**Inference:** TaskChef has a smaller local attack and failure surface but
|
|
243
|
+
delegates repository safety to Codex and project policy. FirstMate explicitly
|
|
244
|
+
owns more delivery and process safety, which improves centralized control while
|
|
245
|
+
expanding the trusted script, state, backend, and credential surface.
|
|
246
|
+
|
|
247
|
+
## Strengths, limitations, and best fit
|
|
248
|
+
|
|
249
|
+
| Product | Strongest when | Less suitable when |
|
|
250
|
+
| --- | --- | --- |
|
|
251
|
+
| 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. |
|
|
252
|
+
| 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. |
|
|
253
|
+
|
|
254
|
+
## Recommendations
|
|
255
|
+
|
|
256
|
+
**Recommendation:** Choose TaskChef when the problem is routing and task
|
|
257
|
+
findability. Choose FirstMate when the problem is sustained supervisory
|
|
258
|
+
attention and delivery coordination.
|
|
259
|
+
|
|
260
|
+
**Recommendation:** Do not casually nest the systems. A FirstMate coordinator
|
|
261
|
+
behind every TaskChef executor, or TaskChef dispatch inside every FirstMate
|
|
262
|
+
worker, adds identity, authority, and recovery boundaries without a clear owner.
|
|
263
|
+
If composition is necessary, define exactly one supervisory layer and treat the
|
|
264
|
+
other as a leaf runtime or intake adapter.
|
|
265
|
+
|
|
266
|
+
**Recommendation:** TaskChef can borrow outcome-oriented reporting ideas
|
|
267
|
+
without becoming a supervisory runtime. Useful candidates are clearer
|
|
268
|
+
completion summaries and an explicit user-approved result-to-follow-up handoff.
|
|
269
|
+
They should preserve native Codex task ownership, bounded reads, and the absence
|
|
270
|
+
of background supervision.
|
|
271
|
+
|
|
272
|
+
**Inference:** Reproducing FirstMate's restart-proof crew management inside
|
|
273
|
+
TaskChef would not be a small feature. It would require new durable state,
|
|
274
|
+
worker liveness contracts, worktree ownership, decision queues, delivery
|
|
275
|
+
authority, retry/recovery policy, and a continuously supervised runtime. That
|
|
276
|
+
would change TaskChef's product category and should be evaluated as a separate
|
|
277
|
+
architecture rather than an incremental dashboard enhancement.
|
package/docs/spec.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
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
|
+
| **Semantic result** | The executor's latest `completed`, `needs_input`, or `failed` outcome with a concise summary and current turn identity. |
|
|
26
|
+
| **Current turn ID** | The canonical Codex UUIDv7 returned by an exact native read of the linked executor for the turn being reported. |
|
|
27
|
+
| **Dashboard** | The loopback, read-only UI derived from validated workspace snapshots and bounded native actions. |
|
|
28
|
+
| **Skill** | One packaged agent procedure: `taskchef-bootstrap`, `taskchef-delegate`, or `taskchef-report`. |
|
|
29
|
+
|
|
30
|
+
## Components and ownership
|
|
31
|
+
|
|
32
|
+
- `taskchef-bootstrap` MUST own initialization, project configuration, and
|
|
33
|
+
diagnostics. It MUST NOT dispatch or report unless separately requested.
|
|
34
|
+
- `taskchef-delegate` MUST own routing and record-before-create delegation.
|
|
35
|
+
It MUST return after creation and MUST NOT poll, supervise, or infer identity.
|
|
36
|
+
- `taskchef-report` MUST own on-demand reporting. It MUST NOT poll or persist
|
|
37
|
+
inferred state.
|
|
38
|
+
- The MCP server MUST expose exactly the four lifecycle tools specified below.
|
|
39
|
+
- The CLI MAY administer and inspect the workspace, but MUST NOT provide a
|
|
40
|
+
second agent lifecycle protocol.
|
|
41
|
+
- The dashboard MUST be read-only with respect to dispatcher files.
|
|
42
|
+
- `docs/spec.md` is the single normative behavior source. Other documents
|
|
43
|
+
MUST link here rather than redefine the contract.
|
|
44
|
+
|
|
45
|
+
## Workspace contract
|
|
46
|
+
|
|
47
|
+
TaskChef MUST manage only `AGENTS.md`, `taskchef.json`, and `tasks.jsonl`
|
|
48
|
+
inside the dispatcher workspace. It MUST preserve unrelated paths.
|
|
49
|
+
|
|
50
|
+
`taskchef.json` MUST have schema version 2 and exactly:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"schemaVersion": 2,
|
|
55
|
+
"projects": []
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Each project MUST contain `name`, normalized absolute `path`, boolean
|
|
60
|
+
`isGitRepository`, and array `githubRepos`; `description` is optional.
|
|
61
|
+
Names and paths MUST be unique. Git projects MUST be exact Git roots.
|
|
62
|
+
Repository URLs MUST canonicalize to `https://github.com/<owner>/<repository>`
|
|
63
|
+
and be case-insensitively deduplicated.
|
|
64
|
+
|
|
65
|
+
`tasks.jsonl` MUST contain zero or more newline-terminated schema-4 records,
|
|
66
|
+
one per line. Unsupported schemas or fields MUST be rejected without
|
|
67
|
+
conversion. Reads and writes MUST reject symlinked managed files. Mutations
|
|
68
|
+
MUST hold the shared workspace lock and replace state atomically; read-only
|
|
69
|
+
operations MUST NOT require write permission.
|
|
70
|
+
|
|
71
|
+
## Task schema
|
|
72
|
+
|
|
73
|
+
Every record MUST contain exactly these fields:
|
|
74
|
+
|
|
75
|
+
| Field | Contract |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `schemaVersion` | Integer `4`. |
|
|
78
|
+
| `id` | Unique safe TaskChef ID; delegation uses a lowercase full UUID. |
|
|
79
|
+
| `project` | Immutable configured-project snapshot. |
|
|
80
|
+
| `title` | Non-empty display title. |
|
|
81
|
+
| `instruction` | Non-empty executor instruction; link-pending records MUST contain the exact marker for `id`. |
|
|
82
|
+
| `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. |
|
|
83
|
+
| `createdAt` | ISO 8601 creation timestamp. |
|
|
84
|
+
| `status` | `working`, `needs_input`, `completed`, or `failed`. |
|
|
85
|
+
| `summary` | Null while working; non-empty and at most 2,000 characters for a semantic result. |
|
|
86
|
+
| `turnId` | Null before a result; linked MCP journeys use a canonical Codex UUIDv7 for the reporting turn. |
|
|
87
|
+
| `updatedAt` | ISO 8601 timestamp not earlier than `createdAt`. |
|
|
88
|
+
| `updatedBy` | `dispatcher` or `mcp`. |
|
|
89
|
+
|
|
90
|
+
Task IDs and non-null thread identities MUST be unique. The immutable intent
|
|
91
|
+
fields MUST NOT change after recording.
|
|
92
|
+
|
|
93
|
+
## Required lifecycle
|
|
94
|
+
|
|
95
|
+
1. The dispatcher MUST call `prepare_dispatch` once per outcome.
|
|
96
|
+
2. It MUST choose exactly one configured project and exact native-project path.
|
|
97
|
+
3. It MUST build the instruction from the returned marker, a blank line, the
|
|
98
|
+
packaged executor contract paragraphs, and the user's outcome.
|
|
99
|
+
4. It MUST call `record_task` with `threadId: null` before native creation.
|
|
100
|
+
5. It MUST create exactly one native Codex executor and return immediately.
|
|
101
|
+
6. The executor MUST read its own `CODEX_THREAD_ID` and call `link_task`
|
|
102
|
+
before substantive work. It MUST NOT use parent/session identity or guess.
|
|
103
|
+
7. Before ending a semantic turn, the executor MUST exactly read its linked
|
|
104
|
+
task, use that turn's ID, and call `report_result`.
|
|
105
|
+
8. A follow-up MUST use its new current turn ID. It MUST NOT reuse a prior turn.
|
|
106
|
+
|
|
107
|
+
If native creation fails after recording, the dispatcher MUST call
|
|
108
|
+
`report_result` with `failed`, null thread/turn IDs, and a bounded summary.
|
|
109
|
+
A link failure MUST remain visible and retryable; the executor MUST report it
|
|
110
|
+
visibly and MUST NOT continue substantive work.
|
|
111
|
+
|
|
112
|
+
`needs_input` MUST mean a semantic user decision or missing fact. A native
|
|
113
|
+
approval prompt MUST remain live Codex state and MUST NOT be stored as
|
|
114
|
+
`needs_input`.
|
|
115
|
+
|
|
116
|
+
## MCP interface
|
|
117
|
+
|
|
118
|
+
All tools resolve the workspace internally. Callers MUST NOT supply a workspace
|
|
119
|
+
path. Success returns both one text content item and the stated structured
|
|
120
|
+
object. Validation, marker, identity, uniqueness, freshness, or filesystem
|
|
121
|
+
failures are surfaced as tool errors and MUST NOT partially mutate the log.
|
|
122
|
+
|
|
123
|
+
### `prepare_dispatch`
|
|
124
|
+
|
|
125
|
+
**Caller:** dispatcher. **Mutation:** none.
|
|
126
|
+
|
|
127
|
+
**Input:** empty object.
|
|
128
|
+
|
|
129
|
+
**Structured output:**
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
{ preparation: {
|
|
133
|
+
schemaVersion: 1,
|
|
134
|
+
workspace: string,
|
|
135
|
+
taskId: string,
|
|
136
|
+
preparedAt: string,
|
|
137
|
+
marker: string,
|
|
138
|
+
projectCount: number,
|
|
139
|
+
projects: Project[]
|
|
140
|
+
} }
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The tool generates a fresh task UUID and exact marker and returns current
|
|
144
|
+
routing targets. An invocation is not idempotent: each successful call creates
|
|
145
|
+
new preparation values, though it writes no state.
|
|
146
|
+
|
|
147
|
+
**Annotations:** `readOnlyHint: true`, `destructiveHint: false`,
|
|
148
|
+
`openWorldHint: false`.
|
|
149
|
+
|
|
150
|
+
### `record_task`
|
|
151
|
+
|
|
152
|
+
**Caller:** dispatcher. **Mutation:** atomically appends one task.
|
|
153
|
+
|
|
154
|
+
**Input:**
|
|
155
|
+
|
|
156
|
+
| Field | Type and rule |
|
|
157
|
+
| --- | --- |
|
|
158
|
+
| `id` | Non-empty string; MUST equal the instruction marker. |
|
|
159
|
+
| `project` | Non-empty configured project path. |
|
|
160
|
+
| `title` | Non-empty string. |
|
|
161
|
+
| `instruction` | Non-empty string beginning with the exact marker and blank line. |
|
|
162
|
+
| `threadId` | Literal null. |
|
|
163
|
+
|
|
164
|
+
**Structured output:** `{ task: Task }`.
|
|
165
|
+
|
|
166
|
+
The returned task has schema 4, `working`, null summary/turn/thread,
|
|
167
|
+
`updatedBy: dispatcher`, and equal creation/update timestamps. Duplicate IDs,
|
|
168
|
+
unknown projects, malformed markers, and invalid input fail. Repeating a
|
|
169
|
+
successful call is not idempotent; it fails as a duplicate.
|
|
170
|
+
|
|
171
|
+
**Annotations:** `readOnlyHint: false`, `destructiveHint: false`,
|
|
172
|
+
`openWorldHint: false`.
|
|
173
|
+
|
|
174
|
+
### `link_task`
|
|
175
|
+
|
|
176
|
+
**Caller:** executor. **Mutation:** one atomic identity transition.
|
|
177
|
+
|
|
178
|
+
**Input:** `{ taskId: non-empty string, threadId: non-empty string }`.
|
|
179
|
+
The workspace layer requires `threadId` to be a canonical Codex UUIDv7.
|
|
180
|
+
|
|
181
|
+
**Structured output:** `{ task: Task }`.
|
|
182
|
+
|
|
183
|
+
The eligible record MUST be link-pending, working, dispatcher-written, and have
|
|
184
|
+
the exact marker. The thread ID MUST be unused. Success sets `threadId`,
|
|
185
|
+
refreshes `updatedAt`, and sets `updatedBy: mcp`. An exact successful retry
|
|
186
|
+
is idempotent. A different identity, terminal record, reused identity, missing
|
|
187
|
+
marker, or ineligible state fails.
|
|
188
|
+
|
|
189
|
+
**Annotations:** `readOnlyHint: false`, `destructiveHint: false`,
|
|
190
|
+
`openWorldHint: false`.
|
|
191
|
+
|
|
192
|
+
### `report_result`
|
|
193
|
+
|
|
194
|
+
**Caller:** executor, or dispatcher only for native creation failure.
|
|
195
|
+
**Mutation:** replaces the latest semantic-result fields atomically.
|
|
196
|
+
|
|
197
|
+
**Input:**
|
|
198
|
+
|
|
199
|
+
| Field | Type and rule |
|
|
200
|
+
| --- | --- |
|
|
201
|
+
| `taskId` | Non-empty string. |
|
|
202
|
+
| `threadId` | Matching non-empty ID for a linked task; null only for creation failure. |
|
|
203
|
+
| `turnId` | Current canonical Codex UUIDv7 for a linked MCP journey; null only for creation failure. Maximum 256 characters at the MCP boundary. |
|
|
204
|
+
| `status` | `needs_input`, `completed`, or `failed`. |
|
|
205
|
+
| `summary` | Non-empty string, at most 2,000 characters. |
|
|
206
|
+
|
|
207
|
+
**Structured output:** `{ task: Task }`.
|
|
208
|
+
|
|
209
|
+
For a linked self-linking journey, the stored identity MUST match and the turn
|
|
210
|
+
MUST be newer than the stored turn. Repeating the same turn with the same
|
|
211
|
+
status and summary is idempotent; changing the result for that turn fails.
|
|
212
|
+
A null-identity record accepts only `failed` with both IDs null. Success sets
|
|
213
|
+
status, summary, turn, `updatedAt`, and `updatedBy: mcp`.
|
|
214
|
+
|
|
215
|
+
**Annotations:** `readOnlyHint: false`, `destructiveHint: true`,
|
|
216
|
+
`openWorldHint: false`.
|
|
217
|
+
|
|
218
|
+
## Reporting and dashboard
|
|
219
|
+
|
|
220
|
+
A semantic result is cached evidence, not permanent live truth. Reports SHOULD
|
|
221
|
+
use one bounded native metadata snapshot. Active or approval-waiting native
|
|
222
|
+
state overrides cache. An inactive task does not prove completion. Focused
|
|
223
|
+
reports MAY read a selected task once when metadata is newer or evidence is
|
|
224
|
+
uncertain. Reports MUST NOT poll or classify assistant prose.
|
|
225
|
+
|
|
226
|
+
The dashboard MUST bind only to loopback, validate the current workspace
|
|
227
|
+
snapshot, and avoid sessions or shared client state. Direct thread navigation
|
|
228
|
+
MUST require a canonical Codex UUIDv7. Otherwise it MAY open the revalidated
|
|
229
|
+
configured project. Project paths from task history MUST be matched against
|
|
230
|
+
current configuration before use.
|
|
231
|
+
|
|
232
|
+
## Concurrency and trust
|
|
233
|
+
|
|
234
|
+
All task and configuration writers MUST share one workspace lock. Duplicate ID,
|
|
235
|
+
duplicate thread, link, and result freshness checks MUST occur while holding
|
|
236
|
+
that lock. Atomic replacement MUST preserve valid unrelated records.
|
|
237
|
+
|
|
238
|
+
TaskChef is designed for a local, single-user boundary. Executor self-linking is
|
|
239
|
+
a cooperative assertion, not transport-authenticated proof. Task instructions,
|
|
240
|
+
stored project snapshots, and dashboard requests are untrusted input.
|
|
241
|
+
Implementations MUST validate exact shapes, canonical paths, safe IDs, markers,
|
|
242
|
+
loopback origin, and current configuration before acting.
|
|
243
|
+
|
|
244
|
+
TaskChef MUST NOT use lifecycle hooks, schedules, polling, recent-thread search,
|
|
245
|
+
transcript search, title matching, hidden reasoning, or token usage to discover
|
|
246
|
+
identity or infer semantic results.
|