@markjaquith/agency 2.71.21 → 2.71.22

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.71.21",
3
+ "version": "2.71.22",
4
4
  "description": "Manage agentic work across repositories with durable workbases",
5
5
  "keywords": [
6
6
  "agents",
@@ -87,6 +87,7 @@
87
87
  "benchmark:task": "bun scripts/benchmark-task.ts",
88
88
  "benchmark:validate": "bun scripts/benchmark-validate.ts",
89
89
  "benchmark:worktree": "bun scripts/benchmark-worktree.ts",
90
+ "benchmark:review": "bun scripts/benchmark-review.ts",
90
91
  "test": "find src \\( -name '*.test.ts' -o -name '*.test.tsx' \\) -print0 | xargs -0 -n 1 -P 4 bun test",
91
92
  "test:opencode": "AGENCY_TEST_OPENCODE=1 bun test src/cli.test.ts --test-name-pattern 'provides effective whole-workbase OpenCode access'",
92
93
  "format": "oxfmt",
@@ -23,7 +23,10 @@ import {
23
23
  runLifecycleTransaction,
24
24
  type TransactionStep,
25
25
  } from "./LifecycleTransaction"
26
- import { RevisionConflictError } from "../workbase/document-revision"
26
+ import {
27
+ documentRevision,
28
+ RevisionConflictError,
29
+ } from "../workbase/document-revision"
27
30
  import {
28
31
  formatMarkdownDocument,
29
32
  parseFrontmatter,
@@ -359,24 +362,33 @@ export class ReviewService extends Effect.Service<ReviewService>()(
359
362
  message: `Cannot refresh review task '${taskId}'; its checkout is dirty or structurally unexpected`,
360
363
  })
361
364
  }
362
- const latest = yield* service.resolve(
365
+ const repository = yield* repositories.show(
363
366
  task.data.review.repo,
364
- task.data.review.source.kind === "pull-request"
365
- ? { pullRequest: task.data.review.source.url }
366
- : { ref: task.data.review.source.ref },
367
367
  root,
368
368
  )
369
+ if (!repository.remote || repository.states.includes("missing")) {
370
+ return yield* new ReviewError({
371
+ message: `Repository alias '${task.data.review.repo}' must be materialized with an origin remote`,
372
+ })
373
+ }
374
+ const versionControl = yield* VersionControlService
375
+ const backend = yield* versionControl.forWorkbase(root)
376
+ const latest = {
377
+ ...task.data.review,
378
+ commit: yield* fetchCommit(
379
+ repository.path,
380
+ task.data.review.source.kind === "pull-request"
381
+ ? task.data.review.source.fetchRef
382
+ : task.data.review.source.ref,
383
+ backend,
384
+ ),
385
+ refreshedAt: new Date().toISOString(),
386
+ } satisfies ReviewRecord
369
387
  const parsed = yield* parseFrontmatter(task.content, task.path)
370
388
  const content = formatMarkdownDocument(
371
389
  { ...task.data, review: latest },
372
390
  parsed.body,
373
391
  )
374
- const repository = yield* repositories.show(
375
- task.data.review.repo,
376
- root,
377
- )
378
- const versionControl = yield* VersionControlService
379
- const backend = yield* versionControl.forWorkbase(root)
380
392
  const gitEnvironment = yield* backend.gitEnvironment(
381
393
  repository.path,
382
394
  )
@@ -456,7 +468,7 @@ export class ReviewService extends Effect.Service<ReviewService>()(
456
468
  commit: latest.commit,
457
469
  changed: latest.commit !== task.data.review.commit,
458
470
  refreshedAt: latest.refreshedAt,
459
- revision: (yield* tasks.show(taskId, root)).revision,
471
+ revision: documentRevision(content),
460
472
  }
461
473
  }),
462
474
  )
@@ -594,12 +594,13 @@ export class TaskService extends Effect.Service<TaskService>()("TaskService", {
594
594
  }
595
595
  const content = yield* fs.readFile(path)
596
596
  const parsed = yield* parseFrontmatter(content, path)
597
+ const data: TaskData = yield* decodeTask(parsed.data)
597
598
  return {
598
599
  id: validId,
599
600
  path,
600
601
  content,
601
602
  revision: documentRevision(content),
602
- data: yield* decodeTask(parsed.data),
603
+ data,
603
604
  } satisfies TaskRecord
604
605
  }),
605
606