@ours.network/fleet 2.4.0-nightly.1 → 2.4.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.
Files changed (46) hide show
  1. package/dist/application/model-catalog.d.ts +1 -1
  2. package/dist/application/model-catalog.js +2 -2
  3. package/dist/application/task-room-service.d.ts +8 -0
  4. package/dist/application/task-room-service.js +15 -0
  5. package/dist/build-info.json +5 -5
  6. package/dist/docs.d.ts +1 -1
  7. package/dist/docs.js +22 -0
  8. package/dist/doctor.js +2 -2
  9. package/dist/harness/codex-runtime.d.ts +2 -0
  10. package/dist/harness/codex-runtime.js +7 -1
  11. package/dist/harness/codex.js +2 -3
  12. package/dist/ops.js +6 -0
  13. package/dist/rooms-tasks/cli.js +24 -0
  14. package/dist/rooms-tasks/deletion.js +4 -0
  15. package/dist/rooms-tasks/task-contributions.d.ts +50 -0
  16. package/dist/rooms-tasks/task-contributions.js +169 -0
  17. package/dist/rooms-tasks/task-review.js +2 -0
  18. package/dist/rooms-tasks/task-state.d.ts +18 -1
  19. package/dist/rooms-tasks/task-state.js +56 -1
  20. package/dist/rooms-tasks/types.d.ts +17 -0
  21. package/dist/rooms-tasks/workspace-removal.d.ts +85 -0
  22. package/dist/rooms-tasks/workspace-removal.js +633 -0
  23. package/dist/rooms-tasks/workspace.d.ts +9 -1
  24. package/dist/rooms-tasks/workspace.js +13 -1
  25. package/dist/spawn.js +2 -0
  26. package/dist/web/resource-views.d.ts +1 -1
  27. package/dist/web/resource-views.js +1 -7
  28. package/dist/web/runtime.js +0 -13
  29. package/dist/web/server.d.ts +0 -3
  30. package/dist/web/server.js +44 -24
  31. package/docs/task-progress-review.md +2 -0
  32. package/docs/task-workspaces.md +51 -1
  33. package/package.json +7 -7
  34. package/presets/brain-catalog.json +5 -2
  35. package/dist/channels/identity-reads.d.ts +0 -69
  36. package/dist/channels/identity-reads.js +0 -47
  37. package/dist/channels/indexer.d.ts +0 -55
  38. package/dist/channels/indexer.js +0 -214
  39. package/dist/channels/runtime.d.ts +0 -30
  40. package/dist/channels/runtime.js +0 -125
  41. package/dist/channels/service.d.ts +0 -61
  42. package/dist/channels/service.js +0 -88
  43. package/dist/channels/sources.d.ts +0 -46
  44. package/dist/channels/sources.js +0 -68
  45. package/dist/channels/store.d.ts +0 -103
  46. package/dist/channels/store.js +0 -204
package/dist/spawn.js CHANGED
@@ -2,6 +2,7 @@ import { taskSupervisorMayRun } from './task-supervision.js';
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { storeRoomSecret, storeTemporaryLaunch, preparePermanentAssignment } from './agent-ours/service.js';
4
4
  import { ensureWorkspace } from './rooms-tasks/workspace.js';
5
+ import { assertCwdNotInRemovedTaskFolder } from './rooms-tasks/workspace-removal.js';
5
6
  import { spawn as spawnChild } from 'node:child_process';
6
7
  import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
7
8
  import { join } from 'node:path';
@@ -324,6 +325,7 @@ export async function spawnTemp(o, binPath, launch = independentSupervisor, crea
324
325
  if (o.isolationFile)
325
326
  readIsolationFile(o.isolationFile); // fail before reserving
326
327
  const prepared = resolvedSpawn(o); // canonical validation before mutation
328
+ assertCwdNotInRemovedTaskFolder(prepared.role.cwd);
327
329
  if ((o.taskOwner || o.roomMemberStartup?.task_id) && !getAdapter(prepared.role.harness).supportsResume)
328
330
  throw Error('TASK_HARNESS_RESUME_UNSUPPORTED: task agents require a resumable harness');
329
331
  if (o.roomMemberStartup?.workspace) {
@@ -80,7 +80,7 @@ export declare class ResourceOutput {
80
80
  }
81
81
  export interface ResourceDescriptor {
82
82
  viewId: string;
83
- resource: 'directory' | 'roles' | 'tasks' | 'task-lists' | 'configuration' | 'previews' | 'task-layout' | 'creation-action' | 'action' | 'member-addition' | 'login' | 'onboarding-health' | 'subscriptions' | 'channels';
83
+ resource: 'directory' | 'roles' | 'tasks' | 'task-lists' | 'configuration' | 'previews' | 'task-layout' | 'creation-action' | 'action' | 'member-addition' | 'login' | 'onboarding-health' | 'subscriptions';
84
84
  entityId?: string;
85
85
  receiptId?: string;
86
86
  provider?: 'claude' | 'codex';
@@ -155,7 +155,7 @@ export function canonicalResourceDescriptor(input) {
155
155
  if (!input || typeof input !== 'object' || Array.isArray(input))
156
156
  throw Error('invalid resource descriptor');
157
157
  const value = input;
158
- if (!/^[A-Za-z0-9_-]{1,128}$/.test(value.viewId) || !['directory', 'roles', 'tasks', 'task-lists', 'configuration', 'previews', 'task-layout', 'creation-action', 'action', 'member-addition', 'login', 'onboarding-health', 'subscriptions', 'channels'].includes(value.resource)
158
+ if (!/^[A-Za-z0-9_-]{1,128}$/.test(value.viewId) || !['directory', 'roles', 'tasks', 'task-lists', 'configuration', 'previews', 'task-layout', 'creation-action', 'action', 'member-addition', 'login', 'onboarding-health', 'subscriptions'].includes(value.resource)
159
159
  || Object.keys(value).some(key => !['viewId', 'resource', 'includeTemporary', 'includeDefinitions', 'ids', 'state', 'list', 'groupByList', 'includeDeleting', 'entityId', 'receiptId', 'provider', 'activityOnly'].includes(key)))
160
160
  throw Error('invalid resource descriptor');
161
161
  if (value.activityOnly !== undefined && value.resource !== 'previews')
@@ -381,12 +381,6 @@ export class FleetResourceViews {
381
381
  || this.configurationInputs().some(input => within(resolve(input), changed));
382
382
  }
383
383
  affects(descriptor, path, structural = false) {
384
- // The Channels projection commits only its own private database; no other view reads it.
385
- const channelsRoot = resolve(stateRoot(), 'private-channels'), channelsPath = path === channelsRoot || path.startsWith(channelsRoot + sep);
386
- if (descriptor.resource === 'channels')
387
- return channelsPath || channelsRoot.startsWith(resolve(path) + sep);
388
- if (channelsPath)
389
- return false;
390
384
  if (descriptor.resource === 'configuration')
391
385
  return this.configurationDependency(path);
392
386
  // An explicitly selected manifest may use any pathname, including one
@@ -1,4 +1,3 @@
1
- import { createChannels } from '../channels/runtime.js';
2
1
  import { ConversationRoleObserver } from '../application/conversation-role-observer.js';
3
2
  import { replaceFileAtomically } from '../atomic-file.js';
4
3
  import { validateAccountOrigin } from '../account-origin.js';
@@ -197,15 +196,6 @@ export async function startWebConsole(options) {
197
196
  const taskRooms = new TaskRoomApplicationService(options.configPath, { binPath: () => options.binPath });
198
197
  // One-time, lock-guarded mission key migration before serving; failure leaves it to the next mutation.
199
198
  await taskRooms.prepareMissionKeys().catch(error => console.warn(`mission key migration deferred: ${error.message}`));
200
- // Ours Channels runs only where a daemon client profile exists.
201
- let channels;
202
- try {
203
- channels = createChannels({ configPath: configuration.path, repository });
204
- }
205
- catch (error) {
206
- console.warn(`Ours Channels unavailable: ${error.message}`);
207
- channels = undefined;
208
- }
209
199
  let server;
210
200
  try {
211
201
  server = await buildWebServer({
@@ -229,7 +219,6 @@ export async function startWebConsole(options) {
229
219
  });
230
220
  },
231
221
  codexModels: createCodexModelDiscovery(),
232
- ...(channels ? { channels: channels.service } : {}),
233
222
  subscriptions: new SubscriptionService({
234
223
  agents: async () => (await query.list(true)).map(({ role, status }) => ({
235
224
  roleId: role.id, stateDir: repository.stateDir(role), running: status.supervisor.liveness === 'running',
@@ -252,7 +241,6 @@ export async function startWebConsole(options) {
252
241
  }, { origin: `http://127.0.0.1:${requestedPort}`, host: `127.0.0.1:${requestedPort}` }, { auth });
253
242
  }
254
243
  catch (error) {
255
- channels?.close();
256
244
  lock.release();
257
245
  throw error;
258
246
  }
@@ -348,7 +336,6 @@ export async function startWebConsole(options) {
348
336
  await control?.close();
349
337
  await gateway?.close();
350
338
  await server.close();
351
- channels?.close();
352
339
  }
353
340
  finally {
354
341
  lock.release();
@@ -24,7 +24,6 @@ import type { PresetProvenance } from '../application/preset-provenance.js';
24
24
  import type { OfferedModels } from '../subscriptions/cli.js';
25
25
  import type { SubscriptionService } from '../subscriptions/service.js';
26
26
  import type { LayoutBindingGrants } from '../rooms-tasks/layout-binding-grants.js';
27
- import type { ChannelsService } from '../channels/service.js';
28
27
  export interface WebServices {
29
28
  resourceScope?: FleetResourceScope;
30
29
  invalidateResourceCaches?(): void;
@@ -49,8 +48,6 @@ export interface WebServices {
49
48
  presetProvenance?: PresetProvenance;
50
49
  oursTools?: Pick<SupervisorOursTools, 'list' | 'call'>;
51
50
  subscriptions?: SubscriptionService;
52
- /** Ours Channels: Owner-only cross-identity external contacts. Absent: not configured. */
53
- channels?: ChannelsService;
54
51
  /** First-time setup from the packaged presets; the account App supplies only the model choices. */
55
52
  onboardingSetup?(answers: InitAnswers): Promise<void>;
56
53
  /** The Codex models the runtime that sessions will use offers the active account. Absent: this server cannot tell, and filters nothing. */
@@ -23,8 +23,10 @@ import { AuditSink } from './audit.js';
23
23
  import { WebAuth } from './auth.js';
24
24
  import { FleetEventBus } from './events.js';
25
25
  import { ROLE_NAME_RE } from '../config.js';
26
+ import { workingFilesSummary } from '../rooms-tasks/workspace-removal.js';
26
27
  import { TaskListError } from '../rooms-tasks/task-lists.js';
27
28
  import { acknowledgeTaskProgress, acknowledgeTaskReview, contributionUnread, resolveTaskRef, TaskStateError } from '../rooms-tasks/task-state.js';
29
+ import { CONTRIBUTION_CUTOFF_MAX, CONTRIBUTION_PAGE_MAX, listTaskContributions, readTaskContributions } from '../rooms-tasks/task-contributions.js';
28
30
  import { MissionKeyError } from '../rooms-tasks/mission-keys.js';
29
31
  import { appendTaskProgress, getTaskReview, taskProgressSnapshot, publicProgressEntry, publicReview, readTaskReviewArtifact, setTaskReviewMarkdown, taskContributionSummary, TaskReviewError, } from '../rooms-tasks/task-review.js';
30
32
  import { isProvider } from '../subscriptions/store.js';
@@ -389,7 +391,7 @@ export async function buildWebServer(services, boundary, options = {}) {
389
391
  /** Browser task payloads carry Progress/To review counts; bodies have their own routes. */
390
392
  const wireTask = (task) => {
391
393
  const { progress: _progress, review: _review, member_naming: _naming, ...rest } = task;
392
- return { ...rest, ...taskContributionSummary(task) };
394
+ return { ...rest, ...taskContributionSummary(task), working_files: workingFilesSummary(task) };
393
395
  };
394
396
  const wireTaskResult = (result) => {
395
397
  const value = result;
@@ -459,10 +461,6 @@ export async function buildWebServer(services, boundary, options = {}) {
459
461
  throw error;
460
462
  }
461
463
  case 'subscriptions': return { providers: await subscriptions().list(true) };
462
- case 'channels':
463
- if (!services.channels)
464
- throw new FleetError('capability_unavailable', 'Ours Channels is not configured on this server');
465
- return services.channels.snapshot();
466
464
  case 'onboarding-health': {
467
465
  const revision = services.configuration?.read().revision;
468
466
  if (onboardingObserved && onboardingObserved.revision !== revision)
@@ -559,25 +557,6 @@ export async function buildWebServer(services, boundary, options = {}) {
559
557
  });
560
558
  for (const resource of ['task-layout', 'creation-action', 'action', 'member-addition', 'login', 'onboarding-health'])
561
559
  app.get('/api/v1/' + resource, async () => { throw new ResourceBindingError(409, 'resource binding required'); });
562
- const channels = () => { if (!services.channels)
563
- throw new FleetError('capability_unavailable', 'Ours Channels is not configured on this server'); return services.channels; };
564
- const channelCid = (value) => { const cid = String(value ?? ''); if (!/^[0-9A-Fa-f]{64}$/.test(cid))
565
- throw new FleetError('invalid_request', 'a 64-hex container id is required'); return cid.toUpperCase(); };
566
- const optionalInt = (value, name, max = Number.MAX_SAFE_INTEGER) => { if (value === undefined || value === '')
567
- return undefined; const n = Number(value); if (!Number.isSafeInteger(n) || n < 1 || n > max)
568
- throw new FleetError('invalid_request', `${name} must be an integer from 1 to ${max}`); return n; };
569
- app.get('/api/v1/channels', async (request) => {
570
- auth.authenticate(request);
571
- const query = request.query;
572
- return channels().list({ ...(query.cursor ? { cursor: String(query.cursor) } : {}), ...(query.q ? { q: String(query.q).slice(0, 200) } : {}), ...(query.root ? { root: channelCid(query.root) } : {}), ...(query.limit ? { limit: optionalInt(query.limit, 'limit', 200) } : {}) });
573
- });
574
- app.get('/api/v1/channels-status', async (request) => { auth.authenticate(request); return channels().status(); });
575
- app.get('/api/v1/channels/:cid', async (request) => { auth.authenticate(request); return channels().get(channelCid(request.params.cid)); });
576
- app.get('/api/v1/channels/:cid/perspectives/:source/messages', async (request) => {
577
- auth.authenticate(request);
578
- const before = optionalInt(request.query.before_seq, 'before_seq'), limit = optionalInt(request.query.limit, 'limit', 200);
579
- return channels().history(channelCid(request.params.cid), channelCid(request.params.source), { ...(before !== undefined ? { before_seq: before } : {}), ...(limit !== undefined ? { limit } : {}) });
580
- });
581
560
  app.get('/api/v1/directory', async (request) => { auth.authenticate(request); return project({ viewId: 'read', resource: 'directory' }, new AbortController().signal); });
582
561
  app.get('/api/v1/previews', async (request) => { auth.authenticate(request); const query = request.query, ids = String(query.ids ?? '').split(',').filter(Boolean); return project(canonicalResourceDescriptor({ viewId: 'read', resource: 'previews', ids, ...(query.activityOnly === 'true' ? { activityOnly: true } : {}) }), new AbortController().signal); });
583
562
  app.get('/api/v1/task-lists', async (request) => {
@@ -647,6 +626,14 @@ export async function buildWebServer(services, boundary, options = {}) {
647
626
  recovery: `Repeat DELETE /api/v1/tasks/${submitted}?confirm=${submitted}.`,
648
627
  };
649
628
  });
629
+ // Removes only the Done task's own working folder; the task, Progress, To review files and chat history stay.
630
+ app.post('/api/v1/tasks/:id/working-files/remove', async (request) => {
631
+ auth.authenticate(request, true);
632
+ const result = await taskApi(() => requireTaskRooms().removeTaskWorkingFiles({
633
+ actor: { kind: 'local_control', surface: 'web' }, taskId: taskRef(request),
634
+ }));
635
+ return { task: wireTask(result.task), result: result.result, mentions: result.mentions };
636
+ });
650
637
  app.post('/api/v1/tasks', async (request, reply) => {
651
638
  auth.authenticate(request, true);
652
639
  const body = request.body;
@@ -709,6 +696,39 @@ export async function buildWebServer(services, boundary, options = {}) {
709
696
  reply.code(201);
710
697
  return { entry: publicProgressEntry(result.entry), replayed: result.replayed };
711
698
  });
699
+ /**
700
+ * Progress and To review of every task, newest first, for the notification list. The first page
701
+ * (no `before`) also carries the cutoff a bulk read may acknowledge up to: each task with unread
702
+ * items as it was read, one task at a time (per task, not one atomic instant across tasks).
703
+ */
704
+ app.get('/api/v1/contributions', async (request) => {
705
+ auth.authenticate(request);
706
+ const query = request.query;
707
+ if (query.unread !== undefined && !['true', 'false'].includes(query.unread))
708
+ throw new FleetError('invalid_request', 'unread must be true or false');
709
+ if (query.limit !== undefined && !/^\d{1,3}$/.test(query.limit))
710
+ throw new FleetError('invalid_request', `limit must be 1-${CONTRIBUTION_PAGE_MAX}`);
711
+ const page = await reviewApi(() => listTaskContributions({
712
+ ...(query.before !== undefined ? { before: query.before } : {}),
713
+ ...(query.limit !== undefined ? { limit: Number(query.limit) } : {}),
714
+ unread: query.unread === 'true',
715
+ }));
716
+ const { cutoff, ...rest } = page;
717
+ return query.before === undefined ? page : rest;
718
+ });
719
+ /** Bulk read up to a captured cutoff, at most `CONTRIBUTION_CUTOFF_MAX` tasks per request, with a result per task. */
720
+ app.post('/api/v1/contributions/read', async (request) => {
721
+ auth.authenticate(request, true);
722
+ const cutoff = request.body?.cutoff;
723
+ const valid = (item) => !!item && typeof item === 'object' && Object.keys(item).length === 4
724
+ && typeof item.task_id === 'string' && /^[0-9a-z]{9}[0-9a-f]{8}$/.test(item.task_id) && Number.isSafeInteger(item.progress) && item.progress >= 0
725
+ && (item.progress_last === null || (typeof item.progress_last === 'string' && item.progress_last.length <= 64))
726
+ && Number.isSafeInteger(item.review) && item.review >= 0;
727
+ if (!Array.isArray(cutoff) || cutoff.length > CONTRIBUTION_CUTOFF_MAX || !cutoff.every(valid)
728
+ || new Set(cutoff.map(item => item.task_id)).size !== cutoff.length)
729
+ throw new FleetError('invalid_request', `cutoff must list at most ${CONTRIBUTION_CUTOFF_MAX} distinct tasks as captured`);
730
+ return { results: await reviewApi(() => readTaskContributions(cutoff)) };
731
+ });
712
732
  /** Acknowledge Progress entries the browser actually showed; returns the task's remaining unread. */
713
733
  app.post('/api/v1/tasks/:id/progress/read', async (request) => {
714
734
  auth.authenticate(request, true);
@@ -155,6 +155,8 @@ workspace-device bearer. `GET /api/v1/meta` reports API minor version 1.
155
155
  | `GET /tasks/:id/review` | `{review: {revision, markdown, updated_at, updated_by, artifacts: [{id, name, mime, size, sha256, added_at, added_by}]}}` or `{review: null}`. |
156
156
  | `PUT /tasks/:id/review` | `{markdown, expectedMarkdown}`; 409 when the Markdown changed meanwhile. |
157
157
  | `GET /tasks/:id/review/artifacts/:artifactId` | The retained bytes as `application/octet-stream` attachment with `Content-Security-Policy: default-src 'none'; sandbox`, `nosniff` and `no-store`. Another task's artifact ID is 404. |
158
+ | `GET /contributions?limit=1-100&before=&unread=true` | Every task's Progress entries and current To review revision for the notification list, newest first: `{items: [{id, kind, task_id, mission_key?, task_title, task_state, at, excerpt, unread, entry_id? \| revision?}], next_cursor, unread_total, unavailable}`. The cursor is a position, valid after its item is read or deleted. Tasks pending deletion are left out; `unavailable` counts unreadable task records. The first page also has `cutoff: [{task_id, progress, progress_last, review}]` for every task with unread items, each captured from that task's own read (per task, not one instant across tasks). |
159
+ | `POST /contributions/read` | `{cutoff}` with at most 200 distinct tasks from a first page: reads each task's first `progress` entries and review revision `review`, never later ones, one task change each. `{results: [{task_id, status}]}` in request order, `status` `read` (with `read`: items that were unread and are read now), `changed` (the task no longer matches its cutoff; nothing written), `gone`, `deleting` or `failed`. |
158
160
 
159
161
  The HTTP API has no upload route: the browser never submits a file path.
160
162
 
@@ -30,6 +30,7 @@ complete internal worktree registries, including dirty and stale owned entries.
30
30
  | Operation | Workspace and execution artifacts | Member runtime evidence |
31
31
  | --- | --- | --- |
32
32
  | Complete, fail, cancel | Retained while Task is recorded | Retained in Fleet recovery archives |
33
+ | Explicit working-files removal (Done Task only) | Task workspace removed; Task, Progress and To review files retained | Retained in Fleet recovery archives |
33
34
  | Linked Room retirement or deletion | Task workspace retained | Retained |
34
35
  | Internal standalone Room retirement | Room workspace retained | Retained |
35
36
  | Explicit Task deletion | Removed after member retirement, with the task's retained To review files | All proven owned retired launches removed |
@@ -39,7 +40,8 @@ Internal room close means retirement, not destructive Task deletion.
39
40
  The existing CLI `room close ID ID` remains a deprecated alias for explicit
40
41
  `room delete ID ID`: it deletes standalone room-owned artifacts, but always
41
42
  retains a linked Task workspace. Its repeated-ID confirmation is unchanged. To remove a Task's
42
- artifacts, explicitly delete the Task. Cancellation is not deletion. Automatic
43
+ artifacts, explicitly delete the Task, or, for a Done Task, remove only its working files
44
+ (`task remove-files ID`, below). Cancellation is not deletion. Automatic
43
45
  compatibility cleanup of legacy closed Rooms skips records with owned workspaces.
44
46
  These choices reconcile close/remove wording with the requirement that completed,
45
47
  recorded Tasks retain all artifacts.
@@ -223,3 +225,51 @@ requires a supported Home Screen installation and granted device/browser permiss
223
225
  reopen the workspace to reconcile an expired subscription and explicitly re-enable
224
226
  permission if it was revoked. Every received push must display a notification to
225
227
  honor Safari's user-visible push requirement.
228
+
229
+ ## Removing a Done Task's working files
230
+
231
+ `ours-fleet task remove-files ID` (API `POST /api/v1/tasks/ID/working-files/remove`)
232
+ frees disk space without deleting the Task. It removes only the recorded owned
233
+ workspace through the same guarded deletion as Task deletion (marker, Git
234
+ registration, symlink and mount checks, token tombstone). It never collects or
235
+ erases recovery archives, member artifacts or the To review store, and never
236
+ closes rooms or stops agents. It runs under the task operation lock and refuses
237
+ with the reason unless all of these hold:
238
+
239
+ - the Task is Done with its completion settled, and is not being deleted;
240
+ - no room record names the Task or its workspace, and every room record is readable;
241
+ - a layout run exists, is closed, is not uncertain, and has retired every owned participant;
242
+ - no supervisor registration belongs to the Task;
243
+ - no unarchived temporary agent state belongs to the Task or works in the
244
+ folder (cwd or startup workspace, literally or through symlinks), and all
245
+ such state is readable;
246
+ - no permanent agent's recorded `.cwd` or configured cwd is in the folder.
247
+
248
+ The intent is recorded before a final in-use scan. Agent state that names a
249
+ task folder is created under that folder's use lock and refuses a folder
250
+ whose removal began, so a concurrent launch is either seen by the scan or
251
+ refused. After the folder is renamed to its tombstone and before anything
252
+ is removed, every process's cwd, root and open files are checked (Linux
253
+ `/proc`). A process that entered the folder earlier restores the folder and
254
+ refuses the removal. Platforms without this check refuse the removal.
255
+ A same-user process whose cwd and descriptors are unreadable (for example
256
+ non-dumpable, or in a container) refuses the removal unless it is a zombie.
257
+ Nothing readable proves such a process holds nothing in the folder: a
258
+ retained cwd or descriptor survives namespace and chroot changes, and a user
259
+ service manager may keep descriptors in its store. The refusal names each
260
+ such process by pid and kernel name (never its command line), with
261
+ read-only context such as "own mount namespace without the folder".
262
+ Another user's unreadable process is skipped when a private ancestor closes
263
+ the folder to it. Superuser processes are outside the check. On hosts that
264
+ run rootless containers or a user service manager, this strict check can
265
+ make removal unavailable while those processes run. Only a folder
266
+ that this run renamed intact is restored. A partly removed tombstone from an
267
+ earlier run stays in place with the refusal recorded, so a later retry can
268
+ finish it.
269
+
270
+ The Task records `workspace_removal` (started, completed, error), shown as
271
+ `working_files` in API payloads. A retry resumes an unfinished tombstone, and
272
+ repeating a finished removal changes nothing. A folder already missing on the
273
+ first run is recorded as such. A create replay never recreates the folder, and
274
+ To review files can no longer be attached from it. Explicit Task deletion
275
+ still works and first finishes an interrupted removal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/fleet",
3
- "version": "2.4.0-nightly.1",
3
+ "version": "2.4.0",
4
4
  "description": "Harness-agnostic fleet of persistent, identity-bound AI agents. Declarative fleet.yaml, managed native/ACP sessions, supervision, and ours.network messaging.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",
@@ -49,9 +49,9 @@
49
49
  "dependencies": {
50
50
  "@agentclientprotocol/sdk": "^1.3.0",
51
51
  "@fastify/websocket": "^11.2.0",
52
- "@ours.network/cli": "4.2.1-nightly.1",
53
- "@ours.network/mcp": "2.1.0-nightly.1",
54
- "@ours.network/sdk": "5.2.1-nightly.1",
52
+ "@ours.network/cli": "4.2.0",
53
+ "@ours.network/mcp": "2.0.4",
54
+ "@ours.network/sdk": "5.2.0",
55
55
  "commander": "^12.1.0",
56
56
  "fastify": "^5.4.0",
57
57
  "qrcode": "1.5.4",
@@ -61,11 +61,11 @@
61
61
  "zod": "^4.4.3"
62
62
  },
63
63
  "optionalDependencies": {
64
- "@agentclientprotocol/claude-agent-acp": "^0.63.0",
65
- "@agentclientprotocol/codex-acp": "1.10.0"
64
+ "@agentclientprotocol/claude-agent-acp": "0.103.0",
65
+ "@agentclientprotocol/codex-acp": "2.7.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@ours.network/daemon": "5.2.1-nightly.1",
68
+ "@ours.network/daemon": "5.2.0",
69
69
  "@types/node": "^22.20.4",
70
70
  "@types/qrcode": "^1.5.6",
71
71
  "@types/ws": "^8.18.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema_version": 2,
3
- "catalog_revision": 5,
3
+ "catalog_revision": 6,
4
4
  "models": [
5
5
  { "harness": "codex", "session": "acp", "model": "gpt-6-astra", "label": "GPT-6 Astra", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
6
6
  { "harness": "codex", "session": "acp", "model": "gpt-5.6-sol", "label": "GPT-5.6 Sol", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
@@ -18,6 +18,9 @@
18
18
  { "harness": "codex", "session": "acp", "model": "gpt-6-luna", "label": "GPT-6 Luna", "efforts": ["low", "medium", "high", "xhigh", "max"] },
19
19
  { "harness": "claude-code", "session": "acp", "model": "claude-fable-5-1", "label": "Claude Fable 5.1", "efforts": ["low", "medium", "high", "xhigh", "max"] },
20
20
  { "harness": "claude-code", "session": "acp", "model": "claude-opus-5-5", "label": "Claude Opus 5.5", "efforts": ["low", "medium", "high", "xhigh", "max"] },
21
- { "harness": "claude-code", "session": "acp", "model": "claude-haiku-4-5-20251001", "label": "Claude Haiku 4.5", "efforts": [] }
21
+ { "harness": "claude-code", "session": "acp", "model": "claude-haiku-4-5-20251001", "label": "Claude Haiku 4.5", "efforts": [] },
22
+ { "harness": "codex", "session": "acp", "model": "gpt-6.2-astra", "label": "GPT-6.2 Astra", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
23
+ { "harness": "codex", "session": "acp", "model": "gpt-6.2-sol", "label": "GPT-6.2 Sol", "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"] },
24
+ { "harness": "claude-code", "session": "acp", "model": "claude-fable-5-2", "label": "Claude Fable 5.2", "efforts": ["low", "medium", "high", "xhigh", "max"] }
22
25
  ]
23
26
  }
@@ -1,69 +0,0 @@
1
- /**
2
- * Minimal HTTP adapter for the daemon's lease-free identity reads
3
- * (`GET /identities/<name>/contacts-activity|history`, ours-sdk
4
- * docs/identity-reads.md). Kept local so Fleet does not need a newer SDK client;
5
- * the shapes are the daemon contract verbatim. The ordinary workspace client
6
- * credential is reread on every request. No identity is ever bound.
7
- */
8
- export interface IdentityRef {
9
- identity: string;
10
- expectedCid: string;
11
- expectedProducerGeneration?: string;
12
- }
13
- export interface SourcePosition {
14
- protocolVersion: 1;
15
- producerGeneration: string;
16
- position: number;
17
- }
18
- export interface ContactRootClaim {
19
- root_cid: string;
20
- root_name: string;
21
- role_id: string;
22
- }
23
- export interface ContactsActivity {
24
- identity: {
25
- name: string;
26
- cid: string;
27
- };
28
- source: SourcePosition;
29
- contacts: Array<{
30
- name: string;
31
- container_id: string;
32
- }>;
33
- roots: Record<string, ContactRootClaim>;
34
- activity: Record<string, {
35
- at: string;
36
- } | {
37
- unavailable: true;
38
- }>;
39
- }
40
- export interface IdentityHistoryPage {
41
- identity: {
42
- name: string;
43
- cid: string;
44
- };
45
- source: SourcePosition;
46
- items: Array<Record<string, unknown> & {
47
- seq: number;
48
- wire_id: string;
49
- }>;
50
- next_cursor: number | null;
51
- }
52
- export declare class IdentityReadError extends Error {
53
- readonly status: number;
54
- readonly code: string | undefined;
55
- constructor(status: number, code: string | undefined, message: string);
56
- }
57
- export interface IdentityReader {
58
- contactsActivity(ref: IdentityRef, signal?: AbortSignal): Promise<ContactsActivity>;
59
- history(ref: IdentityRef & {
60
- peer_cid: string;
61
- before_seq?: number;
62
- limit?: number;
63
- }, signal?: AbortSignal): Promise<IdentityHistoryPage>;
64
- }
65
- export declare function createIdentityReader(options: {
66
- endpoint: string;
67
- credentialPath: string;
68
- fetchImpl?: typeof fetch;
69
- }): IdentityReader;
@@ -1,47 +0,0 @@
1
- import { readPrivateFile } from '@ours.network/sdk/connector';
2
- export class IdentityReadError extends Error {
3
- status;
4
- code;
5
- constructor(status, code, message) {
6
- super(message);
7
- this.status = status;
8
- this.code = code;
9
- }
10
- }
11
- export function createIdentityReader(options) {
12
- const fetchImpl = options.fetchImpl ?? fetch;
13
- const base = options.endpoint.replace(/\/+$/, '');
14
- async function get(name, kind, query, signal) {
15
- const params = new URLSearchParams();
16
- for (const [key, value] of Object.entries(query))
17
- if (value !== undefined)
18
- params.set(key, String(value));
19
- const response = await fetchImpl(`${base}/identities/${encodeURIComponent(name)}/${kind}?${params}`, {
20
- redirect: 'error',
21
- signal: signal ?? AbortSignal.timeout(15_000),
22
- headers: { 'x-ours-api-token': readPrivateFile(options.credentialPath, 4096).toString('utf8').trim() },
23
- });
24
- let json;
25
- try {
26
- json = await response.json();
27
- }
28
- catch {
29
- throw new IdentityReadError(response.status, undefined, `${kind}: non-JSON response (HTTP ${response.status})`);
30
- }
31
- if (response.ok)
32
- return json;
33
- const error = json?.error;
34
- if (error && typeof error === 'object') {
35
- const { code, message } = error;
36
- throw new IdentityReadError(response.status, typeof code === 'string' ? code : undefined, `${kind}: ${String(message ?? code)}`);
37
- }
38
- throw new IdentityReadError(response.status, undefined, `${kind}: ${String(error ?? `HTTP ${response.status}`)}`);
39
- }
40
- return {
41
- contactsActivity: (ref, signal) => get(ref.identity, 'contacts-activity', { expectedCid: ref.expectedCid, expectedProducerGeneration: ref.expectedProducerGeneration }, signal),
42
- history: (ref, signal) => get(ref.identity, 'history', {
43
- peer_cid: ref.peer_cid, before_seq: ref.before_seq, limit: ref.limit,
44
- expectedCid: ref.expectedCid, expectedProducerGeneration: ref.expectedProducerGeneration,
45
- }, signal),
46
- };
47
- }
@@ -1,55 +0,0 @@
1
- import { type ContactsActivity, type IdentityReader } from './identity-reads.js';
2
- import { type ChannelSources } from './sources.js';
3
- import type { ChannelEdge, ChannelsStore } from './store.js';
4
- export interface ResourceFrame {
5
- kind: string;
6
- producerGeneration: string;
7
- position: number;
8
- }
9
- export interface ResourceEventSource {
10
- resourceEvents(identity: string, options: {
11
- signal: AbortSignal;
12
- expectedGeneration?: string;
13
- after?: number;
14
- }): AsyncIterable<ResourceFrame>;
15
- }
16
- export interface ChannelsIndexerDeps {
17
- store: ChannelsStore;
18
- reader: IdentityReader;
19
- events: ResourceEventSource;
20
- discover(): Promise<ChannelSources>;
21
- onChange(): void;
22
- log(message: string): void;
23
- debounceMs?: number;
24
- }
25
- /**
26
- * Event-driven Channels projection. One passive resource-event stream per live
27
- * perspective source; idle coverage frames are ignored and a committed frame
28
- * only schedules work when the source position advanced. Work is debounced,
29
- * at most one observation runs per source, and each observation reads only
30
- * that source's contacts and activity (one lease-free daemon read), never other sources.
31
- */
32
- export declare class ChannelsIndexer {
33
- private readonly deps;
34
- private readonly watches;
35
- private internal;
36
- private syncing?;
37
- private resync;
38
- private stopped;
39
- private readonly debounceMs;
40
- constructor(deps: ChannelsIndexerDeps);
41
- /** Re-derive sources and the exclusion set; start/stop streams accordingly. */
42
- sync(): Promise<void>;
43
- stop(): void;
44
- private syncOnce;
45
- /** The daemon source of `sourceCid` changed under a caller: drop its pin and observe again. */
46
- invalidate(sourceCid: string): void;
47
- private retire;
48
- private follow;
49
- private retired;
50
- private schedule;
51
- private run;
52
- private observe;
53
- }
54
- /** Contacts of one observation, minus internal identities, as metadata-only edges. */
55
- export declare function edgesFrom(observation: ContactsActivity, internal: Set<string>): ChannelEdge[];