@agent-tasks/mcp-server 0.18.0 → 0.19.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/README.md CHANGED
@@ -28,7 +28,7 @@ Three environment variables:
28
28
  | `AGENT_TASKS_BASE_URL` | no | `https://agent-tasks.opentriologue.ai` |
29
29
  | `AGENT_TASKS_MCP_LEGACY` | no | unset (default tool set only) |
30
30
 
31
- Obtain a token from the agent-tasks UI under **Settings → API Tokens**.
31
+ Obtain a token from the agent-tasks UI under **Team settings → API Tokens**.
32
32
  The token scope determines which tools succeed at runtime; tools that require
33
33
  missing scopes return an API error describing the missing scope.
34
34
 
@@ -48,14 +48,14 @@ Drop `--scope user` if you want it project-local instead. See
48
48
 
49
49
  ## Tools
50
50
 
51
- **26 tools registered by default.** rc-v1-C007 pruned 14 still-deprecated v1
51
+ **27 tools registered by default.** rc-v1-C007 pruned 14 still-deprecated v1
52
52
  verbs out of the default registration (`projects_list`, `projects_get`,
53
53
  `tasks_list`, `tasks_instructions`, `tasks_create`, `tasks_claim`,
54
54
  `tasks_release`, `tasks_transition`, `tasks_update`, `review_approve`,
55
55
  `review_request_changes`, `review_claim`, `review_release`,
56
56
  `pull_requests_comment`); handler code for all 14 is untouched, only their
57
57
  registration is gated. Set `AGENT_TASKS_MCP_LEGACY=1` in the server
58
- process's environment to register all 40 tools (the full pre-rc-v1-C007 set
58
+ process's environment to register all 41 tools (the full pre-rc-v1-C007 set
59
59
  plus every verb added since) for a client still depending on one of the
60
60
  pruned names. Two of the pruned verbs, `tasks_list` and `projects_list`, are
61
61
  known to have had active workflow users as of this pruning:
@@ -66,11 +66,12 @@ the third-highest MCP token consumer in the audited window, and
66
66
  those callers to the v2 replacements in the table below, or set the flag
67
67
  while migrating.
68
68
 
69
- The 9 converted v2 write verbs (`task_create`, `task_respec`, `task_finish`,
70
- `task_submit_pr`, `task_note`, `task_merge`, `task_abandon`,
69
+ The 10 converted v2 write verbs (`task_create`, `task_respec`, `task_finish`,
70
+ `task_advance`, `task_submit_pr`, `task_note`, `task_merge`, `task_abandon`,
71
71
  `task_creator_abandon`, and the
72
72
  `tasks_comment` alias) return a small receipt by default
73
- (`{ ok, task: { id, status? }, ... }`, per `docs/response-contract-v1.md`)
73
+ (`{ ok, task: { id, status? }, ... }`, per `docs/response-contract-v1.md`;
74
+ `task_advance`'s receipt also carries the `transition` it made)
74
75
  instead of the raw backend body; pass `include: ["task"]` on any of them to
75
76
  get the full, pre-contract object back for that call. `tasks_get` returns a
76
77
  summary projection with its own `include` vocabulary, and `project_tasks`
@@ -127,6 +128,22 @@ table.
127
128
 
128
129
  The canonical agent surface. Prefer these for all new integrations.
129
130
 
131
+ `task_advance` is for workflows with several work stages (such as the
132
+ `coding-agent` template: open, spec, plan, implement, test, review, done).
133
+ It moves a task the caller holds the work claim on along one forward edge,
134
+ meaning the target is listed later in the workflow's states, to the next
135
+ work stage and keeps the claim. Without `to` it takes the single forward
136
+ edge; several answer `409 advance_ambiguous` with the choices. A review or
137
+ terminal target is `task_finish`'s move (`409 advance_use_finish`). Gates on
138
+ the edge are evaluated like `task_finish`'s. The operation key always
139
+ dedupes: a same-key retry replays the stored response instead of advancing
140
+ again. On the built-in four-state workflow there is nothing to advance. A
141
+ Grounding-provisioned task advances the same way through the Grounding
142
+ mutation protocol; there a failed gate is `409 precondition_failed` whose
143
+ message names the edge and the rules that failed, and the teaching error recommends
144
+ `task_submit_pr` for a branch or PR gate. Pass `branchName` to `task_start`
145
+ when a later stage's gate needs a branch.
146
+
130
147
  Note on the claim boundary: agents claim tasks in `open` status only.
131
148
  `task_create` routes agent-created tasks to `backlog` status, where they are
132
149
  invisible to `task_pickup` and rejected by `task_start` with
@@ -140,6 +157,7 @@ in-session).
140
157
  | `task_start` | `POST /api/tasks/:id/start` |
141
158
  | `task_note` | `POST /api/tasks/:id/comments` |
142
159
  | `task_finish` | `POST /api/tasks/:id/finish` |
160
+ | `task_advance` | `POST /api/tasks/:id/advance` |
143
161
  | `task_grounding_attempt_create` | `POST /api/tasks/:id/grounding-attempts` |
144
162
  | `task_grounding_receipt_upload` | `POST /api/tasks/:id/grounding-attempts/:attemptId/receipt` |
145
163
  | `task_create` | `POST /api/projects/:projectId/tasks` |
@@ -256,7 +274,7 @@ no running server to maintain, no network hop.
256
274
 
257
275
  Remote MCP clients that speak HTTP + JSON-RPC (e.g. Triologue's
258
276
  `mcpBridge.ts`) cannot drive a stdio child process across a network
259
- boundary. For those, the agent-tasks backend exposes **26 tools**
277
+ boundary. For those, the agent-tasks backend exposes **27 tools**
260
278
  over HTTP at `POST /api/mcp`:
261
279
 
262
280
  ```bash
@@ -270,11 +288,11 @@ curl -X POST https://agent-tasks.opentriologue.ai/api/mcp \
270
288
  - Stateless Streamable HTTP (no session ID, one round-trip per
271
289
  request)
272
290
  - Same Bearer auth as the rest of the agent-tasks REST API
273
- - The HTTP endpoint is a **hand-maintained subset** of the 40 tools this
274
- stdio package can expose (26 registered by default, plus 14 legacy-only
291
+ - The HTTP endpoint is a **hand-maintained subset** of the 41 tools this
292
+ stdio package can expose (27 registered by default, plus 14 legacy-only
275
293
  under `AGENT_TASKS_MCP_LEGACY=1`, see "Tools" above). Alongside its v1
276
- compatibility aliases, HTTP includes `task_finish`, `task_merge`,
277
- `task_abandon`, `task_grounding_attempt_create`, and
294
+ compatibility aliases, HTTP includes `task_finish`, `task_advance`,
295
+ `task_merge`, `task_abandon`, `task_grounding_attempt_create`, and
278
296
  `task_grounding_receipt_upload`. It does **not** include `task_pickup`,
279
297
  `task_start`, `task_create`, `task_respec`, `task_submit_pr`,
280
298
  `task_creator_abandon`, the local-only `workflow_primer`, artifact tools,
package/dist/client.d.ts CHANGED
@@ -142,6 +142,9 @@ export declare class AgentTasksClient {
142
142
  autoMerge?: boolean;
143
143
  mergeMethod?: "squash" | "merge" | "rebase";
144
144
  }, operationKey?: string): Promise<unknown>;
145
+ advanceTask(taskId: string, input: {
146
+ to?: string;
147
+ }, operationKey?: string): Promise<unknown>;
145
148
  abandonTask(taskId: string, operationKey?: string): Promise<unknown>;
146
149
  creatorAbandonTask(taskId: string, input?: {
147
150
  reason?: string;
package/dist/client.js CHANGED
@@ -330,6 +330,13 @@ export class AgentTasksClient {
330
330
  finishTask(taskId, input, operationKey) {
331
331
  return this.request("POST", `/api/tasks/${taskId}/finish`, input, operationKey === undefined ? undefined : { "Idempotency-Key": operationKey });
332
332
  }
333
+ // task_advance: moves a work-claimed task along one forward edge to the
334
+ // next work stage. The operation key rides the Idempotency-Key header, which
335
+ // the advance route always dedupes on (a same-key retry replays the stored
336
+ // 2xx response).
337
+ advanceTask(taskId, input, operationKey) {
338
+ return this.request("POST", `/api/tasks/${taskId}/advance`, input, operationKey === undefined ? undefined : { "Idempotency-Key": operationKey });
339
+ }
333
340
  abandonTask(taskId, operationKey) {
334
341
  return this.request("POST", `/api/tasks/${taskId}/abandon`, operationKey === undefined ? undefined : {}, operationKey === undefined ? undefined : { "Idempotency-Key": operationKey });
335
342
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAElC;IACA;IAFT,YACS,MAAc,EACd,IAAa,EACpB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAS;QAIpB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,gEAAgE;AAChE,wEAAwE;AACxE,0EAA0E;AAC1E,sEAAsE;AACtE,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,wEAAwE;AACxE,yEAAyE;AACzE,oEAAoE;AACpE,sDAAsD;AACtD,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACrB;IAA5B,YAA4B,IAAY;QACtC,KAAK,CAAC,8BAA8B,IAAI,GAAG,CAAC,CAAC;QADnB,SAAI,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AAC,KASjB;QACC,OAAO,IAAI,CAAC,OAAO,CAAU,MAAM,EAAE,2BAA2B,EAAE,KAAK,EACrE,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;IAClG,CAAC;IAED,gBAAgB,CAAC,KAOhB;QACC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CACjB,MAAM,EACN,6BAA6B,QAAQ,QAAQ,EAC7C,IAAI,EACJ,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,cAAc,EAAE,CAC3F,CAAC;IACJ,CAAC;IAED,oBAAoB,CAAC,KAOpB;QACC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CACjB,MAAM,EACN,6BAA6B,QAAQ,WAAW,EAChD,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
package/dist/errors.d.ts CHANGED
@@ -93,7 +93,7 @@ export declare function enforceErrorBudget(err: TeachingError): TeachingError;
93
93
  /**
94
94
  * Maps a backend AgentTasksApiError's (status, body) to the teaching-error
95
95
  * shape. `verbContext`, when supplied, is the calling tool's own registered
96
- * name — see the precondition_failed catalog entry above for the one place
97
- * it changes the output.
96
+ * name; it changes the output only in precondition_failed, cross_repo_pr_
97
+ * rejected, github_error and the grounding forbidden table (see the header).
98
98
  */
99
99
  export declare function mapBackendError(status: number, rawBody: unknown, verbContext?: string): TeachingError;
package/dist/errors.js CHANGED
@@ -29,14 +29,15 @@
29
29
  // mapBackendError(status, body, verbContext?) is the single entry point:
30
30
  // tools.ts's wrap() is its only call site (mirrors receipt.ts's relationship
31
31
  // to the receipt-projection helpers). `verbContext`, when supplied, is the
32
- // calling tool's own registered name (e.g. "task_finish") — used only where
33
- // the correct recipe genuinely depends on which verb was called (today:
34
- // `precondition_failed`, which the live backend can raise from task_start,
35
- // task_finish, and two deprecated v1 routes with different correct retry
36
- // targets; and `cross_repo_pr_rejected`, whose pull_requests_create emit
37
- // site sends owner/repo rather than a prUrl, so the default task_submit_pr
38
- // recipe would misdirect it). Every other catalog entry is verb-independent
39
- // by construction.
32
+ // calling tool's own registered name (e.g. "task_finish"). Four catalog
33
+ // entries branch on it: `precondition_failed` (raised from task_start,
34
+ // task_finish and deprecated v1 routes with different correct retry
35
+ // targets), `cross_repo_pr_rejected` (pull_requests_create's emit site sends
36
+ // owner/repo rather than a prUrl, so the default task_submit_pr recipe would
37
+ // misdirect it, and pull_requests_comment has its own branch),
38
+ // `github_error` (pull_requests_create only) and the grounding
39
+ // forbidden table (one precondition list per verb, see 7e). Every other
40
+ // catalog entry is verb-independent by construction.
40
41
  //
41
42
  // Catalog seed (docs/response-contract-v1.md's "Catalog seed" list, plus
42
43
  // pr_author_mismatch from the read_first context on backend/src/routes/
@@ -56,7 +57,16 @@
56
57
  // alias), the v1 backlog-routing pair -- see backlogRoutingEnforcedError and
57
58
  // backlogNotPromotedError below. Plus merge_in_progress (409, a claim or
58
59
  // status write refused while a pull request merge holds the task) -- see
59
- // mergeInProgressError below. Every other backend error degrades to the
60
+ // mergeInProgressError below. Plus advance_use_finish, advance_ambiguous and
61
+ // advance_target_invalid (409, task_advance could not pick a forward edge to
62
+ // a work stage) -- see advanceUseFinishError and its siblings below -- and
63
+ // grounding_advance_unsupported (409, task_advance on a Grounding-provisioned task; legacy, only an older backend sends it) -- see groundingAdvanceUnsupportedError,
64
+ // and a 409 precondition_failed from task_advance (that route's gate refusal) -- see groundedAdvancePreconditionError. Plus recipe branches for the grounding write
65
+ // verbs' (pull_requests_create, pull_requests_merge, task_merge,
66
+ // task_finish, task_abandon, task_grounding_attempt_create) 403 `forbidden`:
67
+ // re-mint guidance for a message naming a missing `github:*` scope, that
68
+ // verb's own precondition list when the backend sent no message, both under
69
+ // the backend's own `forbidden` code -- see groundingForbiddenError below. Every other backend error degrades to the
60
70
  // generic shape (status-derived code, message passthrough, recipe ->
61
71
  // workflow_primer, and now also a clamped passthrough of any structured
62
72
  // body.details — see genericDegrade) rather than being forwarded as raw
@@ -558,16 +568,27 @@ function preconditionFailedError(body, verbContext) {
558
568
  });
559
569
  const needsSubmitPr = rules.includes("branchPresent") || rules.includes("prPresent");
560
570
  // task_finish is the contract's own documented context for this trap
561
- // ("blocks task_finish with 422 precondition_failed") and the correct
562
- // fallback for every call site this module does not thread verbContext
563
- // through today (only task_start, task_finish, tasks_claim, tasks_update,
564
- // and tasks_transition can actually raise this error; see tools.ts's
565
- // wrap() call sites for those five).
571
+ // ("blocks task_finish with 422 precondition_failed") and the fallback
572
+ // for a call without a verbContext. Only task_start, task_finish,
573
+ // task_advance, tasks_claim, tasks_update and tasks_transition can raise this error,
574
+ // and each passes its own name to wrap() (tools.ts; wrap()'s comment
575
+ // there lists every call site that passes one).
566
576
  const retryVerb = verbContext ?? "task_finish";
567
- const recipe = needsSubmitPr
568
- ? `run \`gh pr create\`, call task_submit_pr with the branch/PR metadata, then retry ${retryVerb}`
569
- : `wait for the remaining precondition(s) to clear (see error.detail.failed), then retry ${retryVerb}`;
570
- const allowedNext = needsSubmitPr ? ["task_submit_pr", retryVerb] : [retryVerb];
577
+ // task_advance with only branchPresent failing (plan -> implement in the
578
+ // coding-agent template): the generic recipe sends the caller to open a PR
579
+ // first, which needs a commit, and the branch-only path of task_start
580
+ // (branchName) closes once the task is claimed. Name both ways out.
581
+ const branchOnlyOnAdvance = verbContext === "task_advance" && rules.length > 0 && rules.every((r) => r === "branchPresent");
582
+ const recipe = branchOnlyOnAdvance
583
+ ? "push a commit on your branch and open a draft PR (`gh pr create --draft`), call task_submit_pr with the branch/PR metadata, then retry task_advance; or task_abandon and task_start again with branchName"
584
+ : needsSubmitPr
585
+ ? `run \`gh pr create\`, call task_submit_pr with the branch/PR metadata, then retry ${retryVerb}`
586
+ : `wait for the remaining precondition(s) to clear (see error.detail.failed), then retry ${retryVerb}`;
587
+ const allowedNext = branchOnlyOnAdvance
588
+ ? ["task_submit_pr", "task_advance", "task_abandon", "task_start"]
589
+ : needsSubmitPr
590
+ ? ["task_submit_pr", retryVerb]
591
+ : [retryVerb];
571
592
  return buildTeachingError({
572
593
  code: "precondition_failed",
573
594
  message: rules.length > 0
@@ -600,6 +621,18 @@ function crossRepoRejectedError(message, verbContext) {
600
621
  allowedNext: ["pull_requests_create"],
601
622
  });
602
623
  }
624
+ if (verbContext === "pull_requests_comment") {
625
+ // The comment's owner/repo must be the task's effective deliverable repo
626
+ // (deliverableRepo when set, else the project's own repo). The verb is
627
+ // legacy-gated and sends no prUrl, so neither the task_submit_pr recipe
628
+ // nor a retry of the verb itself is an immediately callable fix.
629
+ return buildTeachingError({
630
+ code: "cross_repo_pr_rejected",
631
+ message,
632
+ recipe: "the comment targets a PR outside the task's effective repo (its deliverableRepo when set, otherwise the project's own repo); comment on a PR in that repo instead, or leave the note on the task with task_note",
633
+ allowedNext: ["task_note"],
634
+ });
635
+ }
603
636
  return buildTeachingError({
604
637
  code: "cross_repo_pr_rejected",
605
638
  message,
@@ -726,6 +759,213 @@ function mergeInProgressError(message) {
726
759
  allowedNext: ["tasks_get"],
727
760
  });
728
761
  }
762
+ // 7d2. task_advance refusals. POST /tasks/:id/advance (backend/src/routes/
763
+ // tasks.ts) answers 409 with its own code when it cannot pick a forward edge
764
+ // to another work stage, and carries the choices it had: `from` (the current
765
+ // state), `choices` (the states task_advance can reach from it), optionally
766
+ // `requested` (the caller's `to`) and, on advance_use_finish, `finishTarget`
767
+ // (the state a task_finish from `from` reaches, null when that finish is
768
+ // refused too). Three codes are cataloged, each with a recipe that depends on
769
+ // those fields; the rare advance_no_forward_edge (no forward edge and no
770
+ // finish edge either) degrades generically, the backend message names the
771
+ // dead end. Every field is untrusted response data and clamped.
772
+ function advanceDetail(body) {
773
+ const rawChoices = Array.isArray(body.choices) ? body.choices.filter((c) => typeof c === "string") : [];
774
+ const choices = rawChoices.slice(0, DETAIL_CLAMP).map((c) => clamp(c, DETAIL_ENTRY_CHAR_BUDGET));
775
+ const finishTarget = typeof body.finishTarget === "string" ? clamp(body.finishTarget, DETAIL_ENTRY_CHAR_BUDGET) : body.finishTarget === null ? null : undefined;
776
+ const detail = {
777
+ ...(typeof body.from === "string" ? { from: clamp(body.from, DETAIL_ENTRY_CHAR_BUDGET) } : {}),
778
+ ...(typeof body.requested === "string" ? { requested: clamp(body.requested, DETAIL_ENTRY_CHAR_BUDGET) } : {}),
779
+ ...(finishTarget !== undefined ? { finishTarget } : {}),
780
+ choices,
781
+ totalChoices: rawChoices.length,
782
+ };
783
+ return { detail, choices, finishTarget };
784
+ }
785
+ // advance_use_finish: the target (requested, or the only forward one) is a
786
+ // review-like or terminal state, or the task already sits in a review state.
787
+ // Those moves belong to task_finish. With a reachable finishTarget the recipe
788
+ // is task_finish; without one, it is an advance to a listed stage first, or,
789
+ // with no stage listed either (the review-state case), the review decided by
790
+ // task_finish with an outcome.
791
+ function advanceUseFinishError(body, message) {
792
+ const { detail, choices, finishTarget } = advanceDetail(body);
793
+ if (typeof finishTarget === "string") {
794
+ return buildTeachingError({
795
+ code: "advance_use_finish",
796
+ message,
797
+ recipe: "call task_finish, which moves the task into the state error.detail.finishTarget names; this verb only moves a task between work stages",
798
+ allowedNext: ["task_finish"],
799
+ detail,
800
+ });
801
+ }
802
+ if (choices.length > 0) {
803
+ return buildTeachingError({
804
+ code: "advance_use_finish",
805
+ message,
806
+ recipe: "call task_advance with to set to one of error.detail.choices first; review and terminal states are reached by a finish from a later stage",
807
+ allowedNext: ["task_advance"],
808
+ detail,
809
+ });
810
+ }
811
+ return buildTeachingError({
812
+ code: "advance_use_finish",
813
+ message,
814
+ recipe: "decide the review with task_finish and an outcome when the task is in a review state, or call tasks_get to check where it stands",
815
+ allowedNext: ["task_finish", "tasks_get"],
816
+ detail,
817
+ });
818
+ }
819
+ // advance_ambiguous: several forward edges and no `to`.
820
+ function advanceAmbiguousError(body, message) {
821
+ const { detail } = advanceDetail(body);
822
+ return buildTeachingError({
823
+ code: "advance_ambiguous",
824
+ message,
825
+ recipe: "call task_advance again with to set to one of error.detail.choices",
826
+ allowedNext: ["task_advance"],
827
+ detail,
828
+ });
829
+ }
830
+ // advance_target_invalid: the requested `to` is not a forward edge to a work
831
+ // stage from the current state.
832
+ function advanceTargetInvalidError(body, message) {
833
+ const { detail, choices } = advanceDetail(body);
834
+ if (choices.length > 0) {
835
+ return buildTeachingError({
836
+ code: "advance_target_invalid",
837
+ message,
838
+ recipe: "call task_advance with to set to one of error.detail.choices, or without to when there is only one",
839
+ allowedNext: ["task_advance"],
840
+ detail,
841
+ });
842
+ }
843
+ return buildTeachingError({
844
+ code: "advance_target_invalid",
845
+ message,
846
+ recipe: "the current state has no forward work stage: call task_finish when it leads into review or done from here, or tasks_get to check the task",
847
+ allowedNext: ["task_finish", "tasks_get"],
848
+ detail,
849
+ });
850
+ }
851
+ // grounding_advance_unsupported (legacy): task_advance on a Grounding-
852
+ // provisioned task, refused by a backend older than the one whose Grounding
853
+ // direct route serves the advance. A current backend never sends it; the entry
854
+ // stays for an mcp-server that talks to such an older backend, where no MCP
855
+ // verb on the default surface moves the task between stages, so the honest
856
+ // recipe is to read the task, have the operator move the stage, or give the
857
+ // claim up.
858
+ function groundingAdvanceUnsupportedError(message) {
859
+ return buildTeachingError({
860
+ code: "grounding_advance_unsupported",
861
+ message,
862
+ recipe: "an older backend refuses to advance a Grounding-provisioned task: call tasks_get for its stage, ask the operator to move it through the Grounding direct transition route, or call task_abandon to release it",
863
+ allowedNext: ["tasks_get", "task_abandon"],
864
+ });
865
+ }
866
+ // precondition_failed (409) from task_advance: a Grounding-provisioned task's
867
+ // advance runs through the Grounding direct route, whose gate refusal is a 409
868
+ // that names the edge and the rules that failed in `message` but carries no
869
+ // `failed[]` (the REST route's 422 does, see preconditionFailedError). The
870
+ // failing rules are only in free text here, so the recipe covers the gates the
871
+ // coding-agent template puts on its edges: the branch and PR gates, which
872
+ // task_submit_pr satisfies, and the GitHub gates, which only time clears.
873
+ function groundedAdvancePreconditionError(body) {
874
+ return buildTeachingError({
875
+ code: "precondition_failed",
876
+ // A backend that sent no message gets this module's own wording rather
877
+ // than the generic "request failed with status 409".
878
+ message: typeof body.message === "string" && body.message.length > 0 ? body.message : "a workflow gate on this edge is not yet satisfied",
879
+ recipe: "a gate on this edge is not met: for branchPresent or prPresent, push a commit, open a draft PR (`gh pr create --draft`) and call task_submit_pr, then retry task_advance; for ciGreen or prMerged wait for CI or the merge",
880
+ allowedNext: ["task_submit_pr", "task_advance", "tasks_get"],
881
+ });
882
+ }
883
+ // 7e. Grounding write precondition 403s. The Grounding routes behind
884
+ // pull_requests_create, pull_requests_merge, task_merge, task_finish,
885
+ // task_abandon and task_grounding_attempt_create answer 403 `forbidden`
886
+ // when one of their preconditions is unmet (backend/src/routes/
887
+ // grounding-github.ts, grounding-task-completion.ts, grounding.ts and the
888
+ // services behind them). A current backend names the failed precondition in
889
+ // the body's `message` on every reachable refusal except the documented
890
+ // no-access answers; the ordinary message passthrough (generic degrade)
891
+ // carries that message unchanged, and this entry adds only what passthrough
892
+ // alone cannot give:
893
+ // - A message naming a missing `github:*` scope (the backend's own
894
+ // "Token missing scope: ..." wording) has no self-service corrective:
895
+ // an existing token never gains a new scope, so only a team admin can
896
+ // re-mint one carrying it -- an admin wall, so `allowedNext` is empty
897
+ // by the same convention as force_admin_only above. This applies to
898
+ // every verb.
899
+ // - A body with NO message (a backend predating the precondition messages,
900
+ // or a deliberately bare no-access answer) gets that verb's own list of
901
+ // possible preconditions as the recipe, from GROUNDING_FORBIDDEN_
902
+ // PRECONDITIONS. The table is keyed by the verbContext the tool passes
903
+ // to wrap(); its keys are the seven verbs whose Grounding routes answer
904
+ // this 403 (task_merge, pull_requests_merge, task_finish, task_abandon,
905
+ // pull_requests_create, task_grounding_attempt_create, task_advance),
906
+ // each of which passes its own name. Each list names only the preconditions that
907
+ // verb's route can refuse on. A verbContext outside the table (such as
908
+ // task_grounding_receipt_upload), or none, makes no causal claim: the
909
+ // result falls through to the generic degrade.
910
+ // Precedence: a present non-empty message wins (the list never applies to
911
+ // it); an empty message counts as absent. A message without a `github:*`
912
+ // scope returns undefined: it falls through to the generic degrade path
913
+ // unchanged, which is the required "backend message is passed through"
914
+ // behavior (same code `forbidden`, message verbatim, recipe ->
915
+ // workflow_primer).
916
+ const TOKEN_MISSING_SCOPE_PATTERN = /^Token missing scope: (.*)/;
917
+ // A token without github:pr_merge is often met by an agent whose PR was
918
+ // already merged outside agent-tasks (a human on GitHub, another tool) while
919
+ // the task did not move. A retried task_merge cannot help that agent: the
920
+ // merge itself is refused for the missing scope, and a task that is only
921
+ // waiting for the webhook is closed by the operator in the UI. The pointer to
922
+ // docs/webhook-setup.md (troubleshooting) lives in WORKFLOW_PRIMER; the
923
+ // 240-char recipe budget leaves no room for it here.
924
+ //
925
+ // The hint is 113 of the recipe's characters and its wording is pinned by its
926
+ // own test, so the re-mint sentence in front of it is what stays short: a
927
+ // backend that refused for TWO scopes (the message `Token missing scope:
928
+ // tasks:transition, github:pr_merge`) names 33 characters, and the recipe is
929
+ // then 239 characters, one under RECIPE_CHAR_BUDGET. Lengthen that sentence
930
+ // without shortening this hint and the two-scope recipe is clamped, losing the
931
+ // tail of the hint. Three or more missing scopes still exceed the budget and
932
+ // clamp the end of the hint.
933
+ const MERGED_OUTSIDE_HINT = ". PR merged outside agent-tasks, task not moved? Do not retry task_merge; ask the operator to close it in the UI.";
934
+ const GROUNDING_FORBIDDEN_PRECONDITIONS = {
935
+ task_merge: "the github:pr_merge scope, write access to the project of every task linked to the PR, the self-merge, approval and role gates, or allowAgentPrMerge consent",
936
+ pull_requests_merge: "the tasks:transition or github:pr_merge scope, write access to the project of every task linked to the PR, the self-merge, approval and role gates, or allowAgentPrMerge consent",
937
+ task_finish: "a missing tasks:transition scope, write access, a work or review claim, review approval, the transition role (autoMerge: github:pr_merge, self-merge gate, allowAgentPrMerge)",
938
+ task_abandon: "a missing tasks:claim scope, project write access, or holding neither the work claim nor the review claim",
939
+ pull_requests_create: "a missing tasks:update or github:pr_create scope, project access, or no allowAgentPrCreate consent from a team member with a connected GitHub account",
940
+ task_grounding_attempt_create: "a missing tasks:transition scope, project write access, neither work nor review claim held, or (intent merge) the merge gates",
941
+ task_advance: "the edge's requiredRole (a Grounding-provisioned task names no role), write access lost under the task lock, or an Idempotency-Key another caller already used on this task",
942
+ };
943
+ function groundingForbiddenError(body, message, verbContext) {
944
+ if (typeof body.message === "string" && body.message.length > 0) {
945
+ const missing = TOKEN_MISSING_SCOPE_PATTERN.exec(body.message)?.[1];
946
+ return missing?.includes("github:")
947
+ ? buildTeachingError({
948
+ code: "forbidden",
949
+ message,
950
+ recipe: `a team admin must re-mint the token with the scopes (${missing}); existing tokens never gain new scopes${missing.includes("github:pr_merge") ? MERGED_OUTSIDE_HINT : ""}`,
951
+ allowedNext: [],
952
+ })
953
+ : undefined;
954
+ }
955
+ const preconditions = verbContext === undefined
956
+ ? undefined
957
+ : Object.prototype.hasOwnProperty.call(GROUNDING_FORBIDDEN_PRECONDITIONS, verbContext)
958
+ ? GROUNDING_FORBIDDEN_PRECONDITIONS[verbContext]
959
+ : undefined;
960
+ if (preconditions === undefined)
961
+ return undefined;
962
+ return buildTeachingError({
963
+ code: "forbidden",
964
+ message,
965
+ recipe: `no detail sent; this verb is refused for: ${preconditions} (see workflow_primer)`,
966
+ allowedNext: ["workflow_primer"],
967
+ });
968
+ }
729
969
  // 8. task_finish `result` (and the deprecated tasks_update's) as plain
730
970
  // string. Unlike the other catalog entries, the backend performs NO
731
971
  // validation of this today (`result` is stored verbatim as free text) —
@@ -1434,8 +1674,8 @@ function genericDegrade(status, message, details, bodyError) {
1434
1674
  /**
1435
1675
  * Maps a backend AgentTasksApiError's (status, body) to the teaching-error
1436
1676
  * shape. `verbContext`, when supplied, is the calling tool's own registered
1437
- * name — see the precondition_failed catalog entry above for the one place
1438
- * it changes the output.
1677
+ * name; it changes the output only in precondition_failed, cross_repo_pr_
1678
+ * rejected, github_error and the grounding forbidden table (see the header).
1439
1679
  */
1440
1680
  export function mapBackendError(status, rawBody, verbContext) {
1441
1681
  const body = asBackendBody(rawBody);
@@ -1447,12 +1687,23 @@ export function mapBackendError(status, rawBody, verbContext) {
1447
1687
  if (status === 403 && code === "forbidden" && FORCE_ADMIN_ONLY_PATTERN.test(message)) {
1448
1688
  return forceAdminOnlyError(message);
1449
1689
  }
1690
+ if (status === 403 && code === "forbidden") {
1691
+ // not_claimed and force_admin_only above are the earlier, more specific
1692
+ // pattern matches of this same status/code pair; this entry adds the
1693
+ // grounding write precondition teachings (see groundingForbiddenError).
1694
+ const groundingForbidden = groundingForbiddenError(body, message, verbContext);
1695
+ if (groundingForbidden)
1696
+ return groundingForbidden;
1697
+ }
1450
1698
  if (status === 409 && code === "already_claimed") {
1451
1699
  return alreadyClaimedError(body, message);
1452
1700
  }
1453
1701
  if (status === 422 && code === "precondition_failed") {
1454
1702
  return preconditionFailedError(body, verbContext);
1455
1703
  }
1704
+ if (status === 409 && code === "precondition_failed" && verbContext === "task_advance") {
1705
+ return groundedAdvancePreconditionError(body);
1706
+ }
1456
1707
  if (status === 422 && code === "low_confidence") {
1457
1708
  return lowConfidenceError(body, message);
1458
1709
  }
@@ -1477,6 +1728,18 @@ export function mapBackendError(status, rawBody, verbContext) {
1477
1728
  if (status === 409 && code === "merge_in_progress") {
1478
1729
  return mergeInProgressError(message);
1479
1730
  }
1731
+ if (status === 409 && code === "advance_use_finish") {
1732
+ return advanceUseFinishError(body, message);
1733
+ }
1734
+ if (status === 409 && code === "advance_ambiguous") {
1735
+ return advanceAmbiguousError(body, message);
1736
+ }
1737
+ if (status === 409 && code === "advance_target_invalid") {
1738
+ return advanceTargetInvalidError(body, message);
1739
+ }
1740
+ if (status === 409 && code === "grounding_advance_unsupported") {
1741
+ return groundingAdvanceUnsupportedError(message);
1742
+ }
1480
1743
  if (verbContext === "pull_requests_create" && code === "github_error") {
1481
1744
  return githubCreateError(status, body, message);
1482
1745
  }