@markjaquith/agency 2.51.0 → 2.52.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markjaquith/agency",
3
- "version": "2.51.0",
3
+ "version": "2.52.0",
4
4
  "description": "Manage agentic work across repositories with durable workbases",
5
5
  "keywords": [
6
6
  "agents",
@@ -3,6 +3,7 @@ import { Effect } from "effect"
3
3
  import { lstat, mkdir } from "node:fs/promises"
4
4
  import { join } from "node:path"
5
5
  import { cleanupTempDir, createTempDir, runTestEffect } from "../test-utils"
6
+ import { ClaimService } from "./ClaimService"
6
7
  import { TaskService } from "./TaskService"
7
8
  import { VcsMigrationService } from "./VcsMigrationService"
8
9
  import { WorktreeService } from "./WorktreeService"
@@ -149,7 +150,7 @@ describe("VcsMigrationService", () => {
149
150
  ).toEqual([])
150
151
  })
151
152
 
152
- test("blocks active and dirty workspaces", async () => {
153
+ test("allows clean unclaimed working workspaces", async () => {
153
154
  if (!Bun.which("jj")) return
154
155
  await runTestEffect(
155
156
  TaskService.pipe(
@@ -158,6 +159,41 @@ describe("VcsMigrationService", () => {
158
159
  ),
159
160
  ),
160
161
  )
162
+ const migrated = await runTestEffect(
163
+ VcsMigrationService.pipe(
164
+ Effect.flatMap((service) =>
165
+ service.migrate("jj", root, { apply: true }),
166
+ ),
167
+ ),
168
+ )
169
+ expect(migrated.mode).toBe("apply")
170
+ })
171
+
172
+ test("blocks active claims", async () => {
173
+ if (!Bun.which("jj")) return
174
+ const inspected = await runTestEffect(
175
+ ClaimService.pipe(
176
+ Effect.flatMap((service) =>
177
+ service.inspect("example", undefined, root),
178
+ ),
179
+ ),
180
+ )
181
+ await runTestEffect(
182
+ ClaimService.pipe(
183
+ Effect.flatMap((service) =>
184
+ service.claim(
185
+ {
186
+ taskId: "example",
187
+ claimant: "orchestrator",
188
+ runner: "agent",
189
+ sessionId: "session-1",
190
+ revision: inspected.revision,
191
+ },
192
+ root,
193
+ ),
194
+ ),
195
+ ),
196
+ )
161
197
  await expect(
162
198
  runTestEffect(
163
199
  VcsMigrationService.pipe(
@@ -167,12 +203,10 @@ describe("VcsMigrationService", () => {
167
203
  ),
168
204
  ),
169
205
  ).rejects.toThrow("is active")
206
+ })
170
207
 
171
- await runTestEffect(
172
- TaskService.pipe(
173
- Effect.flatMap((service) => service.setStatus("example", "open", root)),
174
- ),
175
- )
208
+ test("blocks dirty workspaces", async () => {
209
+ if (!Bun.which("jj")) return
176
210
  await Bun.write(join(root, "tasks/example/code/agency/DIRTY.md"), "dirty\n")
177
211
  await expect(
178
212
  runTestEffect(
@@ -243,11 +243,7 @@ const inspectMigration = (startPath: string, requestedTarget?: VcsKind) =>
243
243
 
244
244
  const records = yield* executionRecords(root)
245
245
  for (const record of records) {
246
- if (
247
- record.status === "working" ||
248
- record.status === "delegated" ||
249
- record.claimActive
250
- ) {
246
+ if (record.claimActive) {
251
247
  const label = record.phaseId
252
248
  ? `phase:${record.taskId}/${record.phaseId}`
253
249
  : `task:${record.taskId}`