taskchef 7.28.1 → 8.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.28.1",
3
+ "version": "8.0.0",
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
@@ -85,6 +85,21 @@ requested, opens the canonical path with the validated Codex Desktop CLI's
85
85
  exact match before indexing it. An open request without a verified native
86
86
  project is reported as partial setup, not delegation-ready.
87
87
 
88
+ Update one indexed project with taskchef project update; repeated
89
+ --github-repo values replace that entry's complete repository list while
90
+ leaving every other project untouched. project list --json returns stable
91
+ configuration and project-set hashes for postcondition checks.
92
+
93
+ Whole-index replacement, project removal, and restore are preview-bound. Run
94
+ them with --dry-run, inspect the exact diff, then apply with the returned
95
+ hashes, counts, plan hash, and exact removed-name confirmation after the user
96
+ approves every removed project. TaskChef creates private snapshots under
97
+ backups/ before mutations and actual dashboard startup. Use taskchef backup
98
+ list, create, verify, restore, and prune; restore never runs automatically and
99
+ creates a pre-restore safety snapshot. If the live configuration is missing or
100
+ malformed, preview an explicit config or state restore, then bind the apply to
101
+ the preview's raw-state hash and plan with --confirm-unreadable-current.
102
+
88
103
  Reindexing catches TaskChef up with newly saved Codex projects by comparing
89
104
  exact canonical paths and indexing missing requested projects. It preserves
90
105
  existing curated entries and does not silently remove projects or overwrite
@@ -342,7 +357,10 @@ server path also rejects requests before discovering or invoking the CLI.
342
357
  Task details also show whole-task and per-turn token usage when `ccusage` can
343
358
  map the linked Codex thread. A completed turn briefly shows “Calculating token
344
359
  usage…” while TaskChef performs bounded deferred reconciliation, because
345
- the terminal lifecycle callback precedes Codex's final output write. Historical
360
+ the terminal lifecycle callback precedes Codex's final output write. The
361
+ dashboard also preloads missing, interrupted, and retry-eligible usage in a
362
+ bounded background queue at startup, after task changes, and on a periodic
363
+ recovery pass; opening task details is not required to start collection. Historical
346
364
  tasks may show a trustworthy task total while older turns remain “Token usage
347
365
  unavailable” when no cumulative turn boundaries were recorded. Input, cached
348
366
  input, output, reasoning, and total counts retain ccusage's categories. Dollar
@@ -361,6 +379,8 @@ wall-clock elapsed time, not model compute time, and malformed or reversed
361
379
  timestamp ranges are shown as unavailable.
362
380
  The header shows the running TaskChef package version reported by the same
363
381
  bounded health identity used for compatible-listener checks.
382
+ The Settings page shows the ccusage version reported by the executable that
383
+ TaskChef resolves at runtime.
364
384
  The canonical port is owned by a dashboard session process initialized by the
365
385
  TaskChef MCP before its tool transport connects. Health identity records a
366
386
  `session` launcher, and MCP recovery reuses only another exact-compatible,
package/bin/taskchef.js CHANGED
@@ -5,6 +5,16 @@ import { runCli } from "../src/cli.js";
5
5
  try {
6
6
  process.exitCode = await runCli(process.argv.slice(2));
7
7
  } catch (error) {
8
- process.stderr.write(`taskchef: ${error.message}\n`);
8
+ if (process.argv.includes("--json")) {
9
+ process.stdout.write(`${JSON.stringify({
10
+ error: {
11
+ code: error.code ?? "ERROR",
12
+ message: error.message,
13
+ ...(error.details ? { details: error.details } : {}),
14
+ },
15
+ })}\n`);
16
+ } else {
17
+ process.stderr.write(`taskchef: ${error.message}\n`);
18
+ }
9
19
  process.exitCode = 1;
10
20
  }
@@ -33,6 +33,13 @@ the token total and API-equivalent USD estimate. Task cards keep the latest
33
33
  cumulative value visible during a newer active turn and label it as updating;
34
34
  pending is reserved for tasks that do not have a usage snapshot yet.
35
35
 
36
+ The dashboard owns a small background recovery queue for derived usage. It
37
+ deduplicates tasks, limits concurrent ccusage reads, preserves successful cache
38
+ records, and revisits missing, interrupted, or cooldown-expired records without
39
+ requiring a detail request. The queue starts with the dashboard, reacts to task
40
+ log revisions, performs periodic recovery passes, and stops with the dashboard.
41
+ Settings reports the version returned by the resolved ccusage executable.
42
+
36
43
  ![Pending token usage in the task detail view](images/dashboard-token-pending.jpg)
37
44
 
38
45
  ## Reported work presentation
@@ -60,6 +67,16 @@ elapsed time, not model compute time.
60
67
 
61
68
  ## Start and reuse
62
69
 
70
+ An actual new dashboard server creates or deduplicates a verified private state
71
+ snapshot before monitors or derived-state writers start. Reusing an existing
72
+ listener does not create another startup snapshot. Snapshot failure aborts the
73
+ new server start and does not weaken MCP reporting isolation.
74
+
75
+ The dashboard watches both task history and the project index. It warns when
76
+ historical task snapshots reference paths absent from the current index, and
77
+ offers recovery-oriented read-only commands. It never mutates or restores
78
+ configuration.
79
+
63
80
  Unless `dashboard.autostart` is explicitly `false`, MCP activation runs the
64
81
  same serialized ensure operation exposed by `ensure_dashboard` before the MCP
65
82
  transport connects. An explicit ensure remains available when autostart is
package/docs/spec.md CHANGED
@@ -14,6 +14,8 @@ is dated research, not contract.
14
14
  | **Dispatcher workspace** | The per-user local data project selected by `--workspace`, then `TASKCHEF_WORKSPACE`, then `~/.agents/taskchef`. |
15
15
  | **Dispatcher** | The Codex task that accepts a request, routes it, records it, creates executors, and returns without supervising them. |
16
16
  | **Configured project** | One routing target in `taskchef.json`, identified by canonical local path and described by `name`, optional `description`, `isGitRepository`, and `githubRepos`. |
17
+ | **Mutation preview** | A read-only, hash-bound exact before/after project-index diff required before destructive replacement, removal, or restore. |
18
+ | **State backup** | A private, verified snapshot under the dispatcher workspace's `backups/` directory. It never restores automatically. |
17
19
  | **Routing** | Selecting exactly one configured project and exactly one matching native Codex project for an outcome. |
18
20
  | **Delegated task** | One independently useful outcome represented by one TaskChef task UUID and snapshot. |
19
21
  | **Executor** | The native Codex task created to own and perform one delegated task. |
@@ -124,6 +126,32 @@ from the final derived semantic result. Interrupted outcomes MUST be excluded.
124
126
  These projections MUST NOT be persisted in schema 10 and remain compatibility
125
127
  aliases for existing callers.
126
128
 
129
+ ## Project-index mutation and recovery
130
+
131
+ TaskChef MUST provide a targeted update that preserves every unrelated project
132
+ and replaces an explicitly supplied repository list in full. Project list JSON
133
+ MUST expose stable semantic hashes. Whole-index replacement, project removal,
134
+ and restore MUST first return an exact diff and MUST reject stale hashes,
135
+ incomplete removed-name confirmation, mismatched counts, and unconfirmed large
136
+ count collapse. Agents MUST obtain explicit user permission for every removed
137
+ project entry and verify the complete post-state.
138
+
139
+ Every actual configuration mutation and actual dashboard-server start MUST
140
+ create or deduplicate a mode-private, manifest-and-hash-verified state snapshot
141
+ before writing. Mutations MUST append bounded attribution-free prepared and
142
+ terminal audit records. Backup list, create, and verify are read-only except for
143
+ explicit creation. Restore MUST default to projects only, show a diff, require
144
+ explicit approval, and create a pre-restore safety snapshot. TaskChef MUST NOT
145
+ restore automatically. State restore authorization MUST bind the selected
146
+ backup and every selected live/source payload hash. Missing or malformed live
147
+ configuration requires config or state scope plus exact raw-state and explicit
148
+ unreadable-current confirmation; a forensic safety snapshot remains eligible
149
+ for rollback when its own integrity verifies.
150
+
151
+ The dashboard MUST distinguish an unreadable index from missing historical
152
+ project paths, warn without rewriting state, and expose recovery guidance
153
+ without backup payload contents.
154
+
127
155
  ## Optional usage projection
128
156
 
129
157
  TaskChef MUST pin one tested `ccusage` version as an optional dependency. It
@@ -162,6 +190,13 @@ into totals a second time.
162
190
 
163
191
  After a terminal report, TaskChef MUST mark the turn `calculating` and perform
164
192
  bounded deferred reconciliation without delaying the lifecycle response.
193
+ The dashboard MUST also preload eligible derived usage in its existing service
194
+ lifecycle without requiring a task-detail request. Startup, task-log changes,
195
+ and periodic recovery passes MUST consider missing, interrupted, and
196
+ cooldown-expired records; successful current-generation records MUST remain
197
+ cached. Background work MUST be deduplicated, MUST enforce a small global
198
+ concurrency limit, MUST use bounded delayed retries, and MUST stop when the
199
+ dashboard closes.
165
200
  Per-turn usage MUST be a non-negative delta between adjacent reliable cumulative
166
201
  boundaries. A first recorded turn MAY use zero as its baseline. Historical
167
202
  turns without boundaries and decreasing or ambiguous snapshots MUST be labeled
@@ -183,6 +218,8 @@ cumulative boundaries use different analyzer versions, requested pricing modes,
183
218
  or declared cost coverage. For GPT-5.6 with ccusage 20.0.20, provenance MUST
184
219
  disclose unverified cache-write coverage and TaskChef MUST NOT claim that the
185
220
  estimate includes those charges.
221
+ The dashboard Settings response MUST report the provider version returned by
222
+ the executable resolved for runtime use, not merely copy the dependency pin.
186
223
 
187
224
  Task IDs and non-null thread identities MUST be unique. The immutable intent
188
225
  fields MUST NOT change after recording.
package/docs/workflows.md CHANGED
@@ -19,6 +19,9 @@ start, upgrade, shutdown, and security rationale.
19
19
  | `src/mcp.js` | Dashboard ensure, four primary lifecycle tools, one deprecated alias, MCP cleanup, and annotations. |
20
20
  | `src/delegation.js` | UUID marker, concise executor-skill invocation shape, and creation-failure handling. |
21
21
  | `src/workspace.js` | Current schemas, validation, locking, atomic JSONL writes, linking, and result freshness. |
22
+ | `src/config-mutations.js` | Canonical hashes and exact field-level project diffs. |
23
+ | `src/backups.js` | Private snapshot creation, verification, retention, and restore inputs. |
24
+ | `src/config-audit.js` | Durable prepared/terminal configuration-mutation journal. |
22
25
  | `src/cli.js` | Administration, normalized cached briefs, inspection, diagnostics, and dashboard startup. |
23
26
  | `src/dashboard.js` | Versioned health identity, validated compact snapshots, SSE fan-out, on-demand details, and bounded open actions. |
24
27
  | `src/dashboard-manager.js` | Concurrent session ensure, authenticated reuse and upgrade handoff, and safe conflicts. |
@@ -428,7 +431,8 @@ after a later filesystem failure, the reported backup is the recovery source.
428
431
  Configuration and task mutations use the same `proper-lockfile` lock. ID and
429
432
  identity uniqueness checks, link eligibility, and result freshness occur
430
433
  inside the critical section. Writes use temporary files/hard links and atomic
431
- rename so readers see complete snapshots.
434
+ rename so readers see complete snapshots. Configuration replacement syncs the
435
+ new file and workspace directory before its audit transaction is committed.
432
436
 
433
437
  The dispatcher controls routing and immutable intent. The executor controls its
434
438
  cooperatively asserted identity and semantic result. Neither identity nor
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export {
2
2
  buildCopilotBrief,
3
3
  addProject,
4
+ createWorkspaceBackup,
4
5
  buildTaskSummary,
5
6
  canonicalDirectory,
6
7
  canonicalGitRoot,
@@ -12,6 +13,10 @@ export {
12
13
  initializeWorkspace,
13
14
  linkTask,
14
15
  listProjects,
16
+ listWorkspaceBackups,
17
+ pruneWorkspaceBackups,
18
+ readProjectIndex,
19
+ readWorkspaceMaintenance,
15
20
  manuallyTransitionTask,
16
21
  migrateTaskLog,
17
22
  prepareDispatch,
@@ -23,9 +28,18 @@ export {
23
28
  reportTaskResult,
24
29
  requireSafeId,
25
30
  removeProject,
31
+ restoreWorkspaceBackup,
26
32
  validateConfig,
33
+ updateProject,
34
+ verifyWorkspaceBackup,
27
35
  } from "./src/workspace.js";
28
36
 
37
+ export {
38
+ configHash,
39
+ projectDiff,
40
+ projectSetHash,
41
+ } from "./src/config-mutations.js";
42
+
29
43
  export {
30
44
  canonicalGithubRepository,
31
45
  matchProjectForGithubUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskchef",
3
- "version": "7.28.1",
3
+ "version": "8.0.0",
4
4
  "description": "A non-blocking interactive dispatcher for visible Codex tasks.",
5
5
  "license": "MIT",
6
6
  "author": "Favo Yang",
@@ -15,8 +15,9 @@ all deterministic workspace operations.
15
15
  ## Boundaries
16
16
 
17
17
  - Keep implementation, tests, and reports in the TaskChef source repository.
18
- - Create and manage only `AGENTS.md`, `taskchef.json`, and `tasks.jsonl` in a
19
- dispatcher workspace. Preserve unrelated user-owned paths.
18
+ - Create and manage only AGENTS.md, taskchef.json, tasks.jsonl,
19
+ config-audit.jsonl, and TaskChef's private backups and maintenance artifacts
20
+ in a dispatcher workspace. Preserve unrelated user-owned paths.
20
21
  - Do not dispatch tasks or report on executor threads during bootstrap unless
21
22
  the user separately requests those actions.
22
23
  - Never create hooks, schedules, polling, daemons, login items, or system
@@ -55,7 +56,10 @@ all deterministic workspace operations.
55
56
  For adding, importing, removing, listing, or reindexing projects, read
56
57
  [project index](references/project-index.md). Preserve exact canonical local
57
58
  Codex project identity and existing curated entries; opening a folder is not
58
- proof of registration. Completion requires verifying the intended index entry.
59
+ proof of registration. Completion requires verifying the intended index entry
60
+ and the complete project set. Any operation that removes a project entry
61
+ requires the user's explicit permission for the exact removed names; removing a
62
+ repository URL from an entry does not authorize removing the entry.
59
63
 
60
64
  ## Optional model roles
61
65
 
@@ -85,6 +85,18 @@ requires an explicit user request and the project-management workflows below.
85
85
 
86
86
  ## Manage the project index
87
87
 
88
+ Before every mutation, run project list --json and retain the complete
89
+ normalized project set, count, and configHash. Use project update for changes
90
+ to one existing entry, including replacing its complete githubRepos list.
91
+ Never use whole-index replacement to edit one entry.
92
+
93
+ Run destructive replacement or removal first with --dry-run. Present the
94
+ complete diff and exact removed project names to the user and obtain explicit
95
+ permission for those removals. Apply only with the preview's config hash,
96
+ before/after counts, plan hash, exact removed-name JSON file, and count-collapse
97
+ confirmation when requested. A request to remove a repository URL is not
98
+ permission to remove a project entry. Do not use a generic force or yes flag.
99
+
88
100
  1. Bulk import with `project import <file|-> --json`. Input is a JSON array of
89
101
  objects containing `path` plus optional `name`, `description`, and
90
102
  `githubRepos`, which is always a JSON array of GitHub repository URLs. Before
@@ -94,9 +106,15 @@ requires an explicit user request and the project-management workflows below.
94
106
  canonical path, preserves an existing name or description when omitted, and
95
107
  unions existing and imported repository lists without duplicates. Use
96
108
  `--replace` only when the user explicitly requests replacement. Run
97
- `project list --json` afterward and verify every imported entry.
98
- 2. Inspect indexed projects with `project list --json`. Remove by name with
99
- `project remove`. Existing task entries keep their project snapshots.
109
+ `project list --json` afterward and compare the complete project set with the
110
+ expected post-state. Verify every imported entry and prove all unrelated
111
+ entries are unchanged; matching counts alone are insufficient.
112
+ 2. Inspect indexed projects with project list --json. Update one entry with
113
+ project update; explicit repository arguments are the complete replacement
114
+ list. Remove by name only through the preview-bound workflow. Existing task
115
+ entries keep their project snapshots.
116
+ 3. On any postcondition mismatch, stop, report the failure, and offer backup
117
+ list plus a restore dry-run. Never restore automatically.
100
118
 
101
119
  Example managed-workspace import entry:
102
120
 
@@ -58,6 +58,8 @@ cached brief.
58
58
  preserve its durable identity.
59
59
  - Never automatically retry a failure, interrupt a working task, or redelegate
60
60
  an existing executor as a new task.
61
+ - Explain project-index warnings and suggest read-only backup list, verify, or
62
+ restore-preview commands. Never restore state without explicit user approval.
61
63
  - A missing executor link calls for passive waiting or identity inspection,
62
64
  not a retry, continuation, or reason to create another executor.
63
65
  - Keep same-assignment follow-up in the existing executor task. Independent new
@@ -16,5 +16,9 @@ Maintain only the canonical TaskChef dashboard.
16
16
  navigate to it. Browser absence, refusal, or blocked localhost navigation is
17
17
  non-fatal: still return the clickable URL and the ensure result.
18
18
 
19
+ “Recover the dashboard” means restore server availability. Data recovery uses
20
+ the explicit taskchef backup restore --dry-run workflow, shows a diff, requires
21
+ user approval, and never runs automatically.
22
+
19
23
  Do not dispatch project work, read task briefs, inspect executor outcomes, poll,
20
24
  start a separate foreground CLI server, or modify TaskChef workspace files.
@@ -30,8 +30,9 @@ stop and report that the TaskChef plugin must be reloaded or installed.
30
30
 
31
31
  ## Boundaries
32
32
 
33
- - Treat only `AGENTS.md`, `taskchef.json`, and `tasks.jsonl` as TaskChef-managed
34
- dispatcher files. Preserve unrelated user-owned paths.
33
+ - Treat only AGENTS.md, taskchef.json, tasks.jsonl, config-audit.jsonl, and
34
+ TaskChef's private backups and maintenance artifacts as managed dispatcher
35
+ state. Preserve unrelated user-owned paths.
35
36
  - Use real Codex tasks, never collaboration or subagent tools.
36
37
  - Never use hooks, schedules, daemons, background monitors, recent-task
37
38
  searches, transcripts, hidden reasoning, or polling for identity.