taskchef 5.7.0 → 5.7.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "5.7.0",
3
+ "version": "5.7.2",
4
4
  "description": "Dispatch work from a data-only workspace to visible Codex project tasks.",
5
5
  "author": {
6
6
  "name": "Favo Yang",
package/README.md CHANGED
@@ -129,8 +129,9 @@ when it sent it, which project it selected, and which Codex task received the
129
129
  work.
130
130
 
131
131
  Every delegated instruction begins with a unique
132
- `<!-- taskchef_id=<UUID> -->` marker followed by a blank line. The valid HTML
133
- comment stays invisible in rendered Markdown.
132
+ `<!-- taskchef_id=<UUID> -->` marker followed by a blank line, an
133
+ executor-ownership paragraph, another blank line, and the assignment. The
134
+ valid HTML comment stays invisible in rendered Markdown.
134
135
  If worktree creation does not return a thread ID immediately, TaskChef records
135
136
  the marked delegation as unresolved, then makes at most two exact-marker checks
136
137
  during a short bounded window. Candidate reads use one programmatic batch per
@@ -352,7 +353,7 @@ task lines remain readable without an eager rewrite of the append-only history.
352
353
  `project` value is the exact configured project path:
353
354
 
354
355
  ```sh
355
- printf '%s\n' '{"id":"c0f010ff-84f2-4838-a69d-0ff1f5d721d7","project":"/workspace/payments","title":"Add retry logs","instruction":"<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nAdd structured logs for failed retries and test them.","threadId":"019f..."}' |
356
+ printf '%s\n' '{"id":"c0f010ff-84f2-4838-a69d-0ff1f5d721d7","project":"/workspace/payments","title":"Add retry logs","instruction":"<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nThis task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.\n\nAdd structured logs for failed retries and test them.","threadId":"019f..."}' |
356
357
  taskchef task record --json
357
358
  ```
358
359
 
@@ -393,8 +394,9 @@ ID printed by the default human-readable list. A short ID must identify exactly
393
394
  one recorded task; use `task list --full-id` when a short ID is missing or
394
395
  ambiguous. Its default output labels the title, project name and path, creation
395
396
  time, full task and thread IDs, and instruction. A null thread ID appears as
396
- `-`, and multiline instructions retain their original line breaks and
397
- indentation. Pass `--json` to receive the unchanged complete task object.
397
+ `-`. Line breaks in labeled values are escaped as `\\r` and `\\n`, while
398
+ multiline instructions retain their original line breaks and indentation. Pass
399
+ `--json` to receive the unchanged complete task object.
398
400
 
399
401
  ```text
400
402
  Title: Add retry logs
@@ -406,6 +408,8 @@ Thread ID: 019f9d46-f42c-7482-9707-3c107bf241ee
406
408
  Instruction:
407
409
  <!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->
408
410
 
411
+ This task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.
412
+
409
413
  Add structured logs for failed payment retries and test them.
410
414
  ```
411
415
 
package/SPEC.md CHANGED
@@ -13,18 +13,27 @@ not maintain a second lifecycle database.
13
13
  ## Core behavior
14
14
 
15
15
  1. The user submits a request in the dispatcher workspace or explicitly invokes
16
- the delegation skill from another Codex project.
16
+ the delegation skill from another Codex project. Work merely concerning the
17
+ TaskChef source code does not implicitly invoke delegation outside the
18
+ dispatcher workspace.
17
19
  2. TaskChef separates only outcomes that can proceed independently.
18
20
  3. It selects each target using configured project metadata and validates the
19
21
  selected local path.
20
22
  4. It creates an independently openable Codex task in that project.
21
23
  5. It embeds a generated TaskChef UUID marker in the initial instruction before
22
- creation. It appends one task entry as soon as creation returns, using
23
- `threadId: null` while a provisional client ID is briefly resolved.
24
+ creation, followed by an executor-ownership sentence and the assignment. It
25
+ appends one task entry as soon as creation returns, using `threadId: null`
26
+ while a provisional client ID is briefly resolved.
24
27
  6. It returns without waiting for executor work to complete.
25
28
  7. When requested, TaskChef can read task entries, query the relevant Codex
26
29
  tasks once, and present a live report without persisting the fetched state.
27
30
 
31
+ A task created by TaskChef owns its delegated initial assignment. It executes
32
+ that assignment in the current task and does not re-dispatch it merely because
33
+ the subject is TaskChef or another configured project. The task may still use
34
+ TaskChef when the initial assignment explicitly requests delegation of separate
35
+ work or when the user later explicitly requests a new delegation.
36
+
28
37
  Several active executors may target the same project.
29
38
 
30
39
  ## Workspace layout
@@ -134,7 +143,7 @@ schedules, task status, results, host information, or the workspace path.
134
143
  `tasks.jsonl` contains one compact JSON object per line, in append order:
135
144
 
136
145
  ```json
137
- {"schemaVersion":2,"id":"c0f010ff-84f2-4838-a69d-0ff1f5d721d7","project":{"name":"payments-api","path":"/workspace/payments-api","isGitRepository":true,"githubRepos":["https://github.com/example/payments-api","https://github.com/example/payments-sdk"],"description":"Owns payment authorization, capture, refunds, and provider integrations."},"title":"Add payment retry logs","instruction":"<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nAdd structured logs for failed payment retries and test them.","threadId":"019f9d46-f42c-7482-9707-3c107bf241ee","createdAt":"2026-08-08T10:00:00.000Z"}
146
+ {"schemaVersion":2,"id":"c0f010ff-84f2-4838-a69d-0ff1f5d721d7","project":{"name":"payments-api","path":"/workspace/payments-api","isGitRepository":true,"githubRepos":["https://github.com/example/payments-api","https://github.com/example/payments-sdk"],"description":"Owns payment authorization, capture, refunds, and provider integrations."},"title":"Add payment retry logs","instruction":"<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nThis task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.\n\nAdd structured logs for failed payment retries and test them.","threadId":"019f9d46-f42c-7482-9707-3c107bf241ee","createdAt":"2026-08-08T10:00:00.000Z"}
138
147
  ```
139
148
 
140
149
  - `schemaVersion` identifies the task entry format.
@@ -142,8 +151,8 @@ schedules, task status, results, host information, or the workspace path.
142
151
  - `project` is the complete configured project snapshot used for routing.
143
152
  - `title` is a short task name.
144
153
  - `instruction` is the complete executor instruction, including its first-line
145
- `<!-- taskchef_id=<full UUID> -->` correlation marker and the blank line that
146
- follows it.
154
+ `<!-- taskchef_id=<full UUID> -->` correlation marker, executor-ownership
155
+ paragraph, and assignment body.
147
156
  - `threadId` identifies the created Codex task, or is `null` when creation was
148
157
  accepted but bounded marker resolution did not find one durable task ID.
149
158
  - `createdAt` is the dispatch time as an ISO 8601 timestamp.
@@ -188,7 +197,8 @@ For each assignment, `$taskchef-delegate`:
188
197
  the already-loaded native projects
189
198
  3. prefixes the instruction with the prepared exact
190
199
  `<!-- taskchef_id=<UUID> -->` marker as the first line, followed by a blank
191
- line
200
+ line, the executor-ownership sentence, another blank line, and the
201
+ assignment body
192
202
  4. creates a real Codex task at the exact configured path
193
203
  5. appends a task entry immediately through the structured `record_task` tool
194
204
  when creation returns a durable thread ID; it never opens a shell, parses
@@ -299,9 +309,10 @@ The CLI reads persisted history without contacting Codex:
299
309
  - `task show <id-or-8-character-prefix>` returns one entry. By default it emits
300
310
  labeled human-readable lines for title, project name and path, creation time,
301
311
  full task ID, thread ID, and instruction. A null thread ID renders as `-`.
302
- The instruction starts on the line after `Instruction:` and retains its
303
- stored line breaks and indentation. `--json` returns the unchanged complete
304
- task object. The short form is the exact ID text printed by the default
312
+ Carriage returns and newlines in labeled values render as `\\r` and `\\n`.
313
+ The instruction starts on the line after `Instruction:` and retains its stored
314
+ line breaks and indentation. `--json` returns the unchanged complete task
315
+ object. The short form is the exact ID text printed by the default
305
316
  human-readable `task list` output and succeeds only when it identifies
306
317
  exactly one recorded task. Missing, ambiguous, malformed, shorter, and
307
318
  wrong-case prefixes fail without selecting a task.
@@ -130,6 +130,8 @@ The exact executor instruction becomes:
130
130
  ```text
131
131
  <!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->
132
132
 
133
+ This task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.
134
+
133
135
  Return exactly the integers 1 through 10, one per line.
134
136
  Do not modify files.
135
137
  ```
@@ -184,7 +186,7 @@ with `threadId: null`:
184
186
  "id": "c0f010ff-84f2-4838-a69d-0ff1f5d721d7",
185
187
  "project": "/projects/t2",
186
188
  "title": "Count from 1 to 10",
187
- "instruction": "<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nReturn exactly the integers 1 through 10, one per line.\nDo not modify files.",
189
+ "instruction": "<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nThis task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.\n\nReturn exactly the integers 1 through 10, one per line.\nDo not modify files.",
188
190
  "threadId": null
189
191
  }
190
192
  ```
@@ -197,7 +199,7 @@ A later candidate read might contain this structured delegated input:
197
199
  "content": [
198
200
  {
199
201
  "codexDelegation": {
200
- "input": "<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nReturn exactly the integers 1 through 10, one per line.\nDo not modify files."
202
+ "input": "<!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->\n\nThis task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.\n\nReturn exactly the integers 1 through 10, one per line.\nDo not modify files."
201
203
  }
202
204
  }
203
205
  ]
package/index.js CHANGED
@@ -28,6 +28,7 @@ export {
28
28
  } from "./src/github.js";
29
29
 
30
30
  export {
31
+ EXECUTOR_OWNERSHIP_PARAGRAPH,
31
32
  THREAD_RESOLUTION_CHECKPOINTS_MS,
32
33
  THREAD_RESOLUTION_CLOCK_SKEW_MS,
33
34
  THREAD_RESOLUTION_RECENT_LIMIT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "5.7.0",
3
+ "version": "5.7.2",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: taskchef-delegate
3
- description: "Dispatch actionable requests through the per-user TaskChef workspace into independently openable Codex project tasks. Use for ordinary work requests in the TaskChef project, explicit delegation from any project, or splitting independent work across projects. Preserve unresolved delegations for later marker-based recovery, and never use subagents, hooks, schedules, daemons, or executor-completion waiting."
3
+ description: "Dispatch actionable requests through the per-user TaskChef workspace into independently openable Codex project tasks. Use automatically for actionable work received in the canonical TaskChef dispatcher workspace. From any other project, use only when the user explicitly asks to delegate or split separate work into Codex tasks; TaskChef-related subject matter alone is not delegation intent. Preserve unresolved delegations for later marker-based recovery, and never use subagents, hooks, schedules, daemons, or executor-completion waiting."
4
4
  ---
5
5
 
6
6
  # TaskChef Delegate
@@ -8,6 +8,17 @@ description: "Dispatch actionable requests through the per-user TaskChef workspa
8
8
  Create real Codex tasks through the canonical per-user TaskChef data workspace
9
9
  and return immediately.
10
10
 
11
+ ## Invocation boundary
12
+
13
+ A task whose initial structured `codexDelegation.input` starts with an exact
14
+ `<!-- taskchef_id=<full UUID> -->` marker already owns that delegated
15
+ assignment. Execute the assignment in the current task. Do not re-dispatch it
16
+ merely because it concerns TaskChef or a configured project.
17
+
18
+ This does not prevent the task from using TaskChef later. Use this skill
19
+ normally when the initial assignment explicitly asks to delegate separate
20
+ work, or when the user later explicitly requests a new delegation.
21
+
11
22
  Use the bundled TaskChef `prepare_dispatch`, `record_task`, and `resolve_task`
12
23
  tools for deterministic workspace and task-record operations. Call them
13
24
  directly; never probe for them or fall back to shell CLI writes. If a required
@@ -57,7 +68,12 @@ explicitly requested benchmark artifact.
57
68
  tool.
58
69
  Prefix the complete executor instruction with
59
70
  exactly `<!-- taskchef_id=<full UUID> -->` as the first line, followed by a
60
- blank line and the instruction body. Preserve this
71
+ blank line, this executor-role paragraph, another blank line, and the
72
+ instruction body. Add the paragraph as one line in the created input:
73
+
74
+ > This task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.
75
+
76
+ Preserve this
61
77
  marked instruction for recording, and note the creation time. The exact
62
78
  random marker is the sole correlation proof.
63
79
  6. Create one real Codex task using the exact configured project, a local
package/src/cli.js CHANGED
@@ -161,14 +161,18 @@ function displayId(value, fullId) {
161
161
  return uuidSection ? uuidSection[0] : value;
162
162
  }
163
163
 
164
+ function singleLineDetail(value) {
165
+ return String(value).replaceAll("\r", "\\r").replaceAll("\n", "\\n");
166
+ }
167
+
164
168
  function taskDetails(task) {
165
169
  return [
166
- `Title: ${task.title}`,
167
- `Project: ${task.project.name}`,
168
- `Project path: ${task.project.path}`,
169
- `Created: ${task.createdAt}`,
170
- `Task ID: ${task.id}`,
171
- `Thread ID: ${task.threadId ?? "-"}`,
170
+ `Title: ${singleLineDetail(task.title)}`,
171
+ `Project: ${singleLineDetail(task.project.name)}`,
172
+ `Project path: ${singleLineDetail(task.project.path)}`,
173
+ `Created: ${singleLineDetail(task.createdAt)}`,
174
+ `Task ID: ${singleLineDetail(task.id)}`,
175
+ `Thread ID: ${singleLineDetail(task.threadId ?? "-")}`,
172
176
  "Instruction:",
173
177
  task.instruction,
174
178
  ].join("\n");
package/src/delegation.js CHANGED
@@ -4,6 +4,7 @@ export const THREAD_RESOLUTION_CHECKPOINTS_MS = Object.freeze([10_000, 30_000]);
4
4
  export const THREAD_RESOLUTION_TIMEOUT_MS = 30_000;
5
5
  export const THREAD_RESOLUTION_RECENT_LIMIT = 50;
6
6
  export const THREAD_RESOLUTION_CLOCK_SKEW_MS = 5_000;
7
+ export const EXECUTOR_OWNERSHIP_PARAGRAPH = "This task owns the delegated assignment. Execute it in this task; do not re-dispatch it merely because it concerns TaskChef or a configured project. Explicit requests to delegate separate work remain valid.";
7
8
 
8
9
  const UUID_SOURCE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
9
10
  const UUID_PATTERN = new RegExp(`^${UUID_SOURCE}$`);
@@ -93,7 +94,7 @@ export function prepareDelegation(instruction, { taskId = randomUUID() } = {}) {
93
94
  const id = requireUuid(taskId);
94
95
  return {
95
96
  id,
96
- instruction: `${taskChefMarker(id)}\n\n${instruction}`,
97
+ instruction: `${taskChefMarker(id)}\n\n${EXECUTOR_OWNERSHIP_PARAGRAPH}\n\n${instruction}`,
97
98
  };
98
99
  }
99
100