taskchef 7.9.0 → 7.9.1

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": "7.9.0",
3
+ "version": "7.9.1",
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
@@ -104,7 +104,6 @@ For example, TaskChef generates this shape:
104
104
 
105
105
  ```text
106
106
  Fix duplicate charges after a retry and add a regression test.
107
-
108
107
  <!-- taskchef_id=c0f010ff-84f2-4838-a69d-0ff1f5d721d7 -->
109
108
  Use $taskchef-executor to execute and report this delegated TaskChef assignment.
110
109
  ```
package/docs/spec.md CHANGED
@@ -116,10 +116,10 @@ the final link, preserving the delegate skill's immediate-return contract.
116
116
  1. The dispatcher MUST call `prepare_dispatch` once per outcome.
117
117
  2. It MUST choose exactly one configured project and exact native-project path.
118
118
  3. It MUST build the instruction with the user's outcome beginning on line 1
119
- and remaining uninterrupted, followed by one blank line, the returned
120
- marker, and exactly one concise explicit `$taskchef-executor` invocation on
121
- the final line. It MUST NOT inline the executor protocol into a new
122
- instruction.
119
+ and remaining uninterrupted, followed by exactly one newline, the returned
120
+ marker, one newline, and exactly one concise explicit `$taskchef-executor`
121
+ invocation on the final line. It MUST NOT place a blank line before or after
122
+ the marker or inline the executor protocol into a new instruction.
123
123
  4. It MUST call `record_task` with `threadId: null` before native creation.
124
124
  5. It MUST create exactly one native Codex executor and return immediately.
125
125
  6. The executor MUST read its own `CODEX_THREAD_ID` and call `link_task`
@@ -136,9 +136,10 @@ If native creation fails after recording, the dispatcher MUST call
136
136
  A link failure MUST remain visible and retryable; the executor MUST report it
137
137
  visibly and MUST NOT continue substantive work.
138
138
 
139
- Previously recorded instructions with a first-line HTML marker, the older
140
- first-line `# taskchef_id=<full UUID>` heading, or the former blank line and
141
- inline executor protocol MUST remain marker-readable and executable. Their
139
+ Previously recorded instructions with the former blank line before a trailing
140
+ marker, a first-line HTML marker, the older first-line
141
+ `# taskchef_id=<full UUID>` heading, or the former blank line and inline
142
+ executor protocol MUST remain marker-readable and executable. Their
142
143
  `report_result` calls MUST remain supported by the deprecated alias. New
143
144
  instructions MUST use the trailing marker and explicit executor skill contract
144
145
  above. A historical first-line instruction with an executor-skill invocation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.9.0",
3
+ "version": "7.9.1",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -52,8 +52,9 @@ stop and report that the TaskChef plugin must be reloaded or installed.
52
52
 
53
53
  - Begin with the actual assignment on the first line and keep its complete
54
54
  body uninterrupted.
55
- - After the assignment, add one blank line and the preparation's exact
56
- marker on its own line.
55
+ - After the assignment's final character, add exactly one newline and the
56
+ preparation's exact marker on its own line. Do not add a blank line before
57
+ or after the marker.
57
58
  - Immediately after the marker, end the instruction with exactly:
58
59
  `Use $taskchef-executor to execute and report this delegated TaskChef assignment.`
59
60
  - Include exactly one marker and exactly one executor-skill invocation.
@@ -9,12 +9,13 @@ Own and execute the delegated assignment in the current Codex task. Do not
9
9
  re-dispatch it merely because it concerns TaskChef or a configured project.
10
10
  Explicit requests to delegate separate work remain valid.
11
11
 
12
- New instructions present the complete assignment first, followed by one blank
13
- line, the exact `<!-- taskchef_id=<full UUID> -->` marker, and the final
14
- explicit skill invocation. Treat that UUID as the TaskChef task ID. The
15
- assignment is everything before the blank line that precedes the marker; the
16
- marker and invocation are lifecycle scaffolding, not part of the deliverable.
17
- Require exactly one marker and do not infer an ID from similar prose.
12
+ New instructions present the complete assignment first, followed by exactly one
13
+ newline, the exact `<!-- taskchef_id=<full UUID> -->` marker, one newline, and
14
+ the final explicit skill invocation. There is no blank line before or after the
15
+ marker. Treat that UUID as the TaskChef task ID. The assignment is everything
16
+ before the marker; the marker and invocation are lifecycle scaffolding, not
17
+ part of the deliverable. Require exactly one marker and do not infer an ID from
18
+ similar prose.
18
19
 
19
20
  ## Start every execution turn
20
21
 
@@ -69,12 +70,13 @@ Existing delegated tasks may include the former inline ownership, linking, and
69
70
  re-dispatching. Prefer `report_state` when available. If an older installed
70
71
  TaskChef exposes only `report_result`, follow its inline protocol; after an
71
72
  upgrade, the deprecated `report_result` alias remains available for exact
72
- legacy retries. Also accept historical instructions whose exact HTML marker is
73
- the first line, with or without the former blank line, and the older exact
74
- first-line `# taskchef_id=<full UUID>` heading. These compatibility forms do
75
- not change the identity or lifecycle rules above. For either first-line form,
76
- the assignment follows the marker. Ignore the final executor invocation and
77
- any recognizable former inline ownership, linking, working-state, or
73
+ legacy retries. Also accept historical instructions with the former blank line
74
+ before a trailing marker, an exact HTML marker on the first line with or
75
+ without the former blank line, or the older exact
76
+ first-line `# taskchef_id=<full UUID>` heading. These compatibility forms do not
77
+ change the identity or lifecycle rules above. For either first-line form, the
78
+ assignment follows the marker. Ignore the final executor invocation and any
79
+ recognizable former inline ownership, linking, working-state, or
78
80
  result-reporting paragraphs as lifecycle scaffolding; execute the remaining
79
81
  task-specific body. Require non-whitespace task-specific content and never
80
82
  treat an invocation by itself as an assignment.
package/src/delegation.js CHANGED
@@ -162,14 +162,18 @@ export function parseTaskChefMarker(instruction) {
162
162
  return hasHistoricalAssignment() ? id : null;
163
163
  }
164
164
  const executorSkillReferences = instruction.match(/\$taskchef-executor\b/gi) ?? [];
165
+ const hasCompactBoundary = index >= 1
166
+ && lines.at(index - 1).trim().length > 0;
167
+ const hasHistoricalBlankBoundary = index >= 2
168
+ && lines.at(index - 1) === ""
169
+ && lines.at(index - 2).trim().length > 0;
170
+ const assignmentEnd = hasCompactBoundary ? index : index - 1;
165
171
  const isTrailingScaffold = index === lines.length - 2
166
- && index >= 2
172
+ && (hasCompactBoundary || hasHistoricalBlankBoundary)
167
173
  && lines[0].trim().length > 0
168
- && lines.at(-3) === ""
169
- && lines.at(-4).trim().length > 0
170
174
  && lines.at(-1) === EXECUTOR_SKILL_INVOCATION
171
- && hasTaskSpecificContent(lines.slice(0, index - 1))
172
- && !lines.slice(0, index - 1).some((line) => HISTORICAL_EXECUTOR_SCAFFOLD_LINES.has(line))
175
+ && hasTaskSpecificContent(lines.slice(0, assignmentEnd))
176
+ && !lines.slice(0, assignmentEnd).some((line) => HISTORICAL_EXECUTOR_SCAFFOLD_LINES.has(line))
173
177
  && executorSkillReferences.length === 1;
174
178
  return isTrailingScaffold ? id : null;
175
179
  }
@@ -198,7 +202,7 @@ export function prepareDelegation(instruction, { taskId = randomUUID() } = {}) {
198
202
  const id = requireUuid(taskId);
199
203
  return {
200
204
  id,
201
- instruction: `${body}\n\n${taskChefMarker(id)}\n${EXECUTOR_SKILL_INVOCATION}`,
205
+ instruction: `${body}\n${taskChefMarker(id)}\n${EXECUTOR_SKILL_INVOCATION}`,
202
206
  };
203
207
  }
204
208