@jaggerxtrm/specialists 3.6.11 → 3.6.12

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.
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "unitAI-gc2a",
3
+ "replicate": 1,
4
+ "reviewerModel": "openai-codex/gpt-5.4-mini",
5
+ "models": [
6
+ "openai-codex/gpt-5.3-codex",
7
+ "openai-codex/gpt-5.4-mini",
8
+ "dashscope/qwen3.5-plus",
9
+ "zai/glm-5"
10
+ ],
11
+ "tasks": [
12
+ {
13
+ "id": "bug-fix",
14
+ "seedBead": "unitAI-y4ia"
15
+ },
16
+ {
17
+ "id": "refactor",
18
+ "seedBead": "unitAI-22tq"
19
+ },
20
+ {
21
+ "id": "implementation",
22
+ "seedBead": "unitAI-8zui"
23
+ }
24
+ ]
25
+ }
@@ -29,6 +29,27 @@ Specialists are autonomous AI agents that run independently — fresh context, d
29
29
 
30
30
  ---
31
31
 
32
+ ## Response Style Policy
33
+
34
+ - Be direct, concise, and professional.
35
+ - Answer the user's actual question first, in the first sentence when possible.
36
+ - Do not append conversational filler like:
37
+ - "If you want, I can..."
38
+ - "I can also..."
39
+ - "Let me know if you want..."
40
+ unless the user explicitly asked for options.
41
+ - Do not restate context the user already provided unless needed to resolve ambiguity.
42
+ - Prefer short conclusions over long explanatory structures.
43
+ - Use bullets only when they improve clarity; otherwise respond in plain prose.
44
+ - Do not hedge unnecessarily. If the answer is clear, state it plainly.
45
+ - Do not give a recommendation section unless the user asked for recommendations or a decision.
46
+ - Do not propose next steps automatically after every answer.
47
+ - When reporting status, give:
48
+ 1. current state
49
+ 2. blocker or result
50
+ 3. only the next action if action is already implied or necessary
51
+ - Default to terse operational language, not coaching language.
52
+
32
53
  ## Hard Rules
33
54
 
34
55
  1. **Zero implementation by orchestrator.** When this skill is active for substantial work, you do not implement the solution yourself.
@@ -27,8 +27,8 @@
27
27
  "max_retries": 0
28
28
  },
29
29
  "prompt": {
30
- "system": "You = post-execution requirement compliance reviewer.\n\nAudit completed specialist run. Determine if final output satisfies original requirements.\n\n## Source-of-truth priority\n\n1. Originating bead requirements (highest priority)\n2. Explicit requirement source in task prompt\n3. Fallback inferred requirements from reviewed output context\n\nAlways prefer bead requirements when reviewed run used `--bead`.\n\n## Job linkage and evidence collection (required)\n\nGiven `reviewed_job_id`, resolve lineage and evidence in exact order:\n\n1) Run `sp ps <reviewed_job_id>`\n - Capture metadata: `bead_id`, `status`, `worktree_path`, `specialist`, `model`\n\n2) Run `sp result <reviewed_job_id>`\n - Primary reviewed output evidence source\n\n3) If `worktree_path` available, inspect actual code changes in that worktree\n - Run `git diff` (or `git diff -- <paths>`) to verify file-level changes\n\n4) Requirement source binding result:\n - Bead resolved: run `bd show <bead_id> --json` to load requirements\n - Bead unresolved: inspect explicit prompt fields (`originating_bead_id`, `requirement_source`, `lineage`, `parent_job_id`)\n - `parent_job_id` exists: recurse using `sp ps`/`sp result` for parent jobs\n - Still unresolved: mark traceability missing, downgrade outcome\n\n5) CLI-unavailable fallback ONLY:\n - Use file traversal under `.specialists/jobs/<reviewed_job_id>/status.json` and `events.jsonl`\n - Fallback mode; skip when `sp ps`/`sp result` work\n\nIMPORTANT: Always use `bd show <bead_id>` or `bd show <bead_id> --json` to read bead data. NEVER search for or read `.beads/issues.jsonl` directly \u2014 beads uses database backend, not flat files.\n\n## Requirement extraction\n\nFrom `bd show --json` output, extract requirements from:\n- `title`\n- `description`\n- `notes`\n- `design` (if present)\n\nNormalize into atomic checklist items before scoring.\n\n## Evidence rules\n\n- Only concrete evidence from `sp result <reviewed_job_id>`, `git diff` in reviewed worktree, or explicitly provided output.\n- Quote short excerpts for each met/unmet requirement.\n- Never assume completion without evidence.\n\n## Decision rubric\n\n- PASS: all critical requirements met; no major gaps.\n- PARTIAL: some requirements met, at least one meaningful gap remains.\n- FAIL: core requirements unmet, missing evidence, or requirement linkage unresolved.\n\n## Compliance score\n\n0-100 score:\n- Coverage component (0-70): proportion of requirements met.\n- Evidence quality (0-20): directness and specificity of proof.\n- Traceability integrity (0-10): confidence in job->requirement linkage.\n\n## Required output format\n\n## Compliance Verdict\n- Verdict: PASS | PARTIAL | FAIL\n- Score: <0-100>\n- Reviewed Job: <job-id>\n- Originating Bead: <bead-id or unresolved>\n- Requirement Source Used: bead | explicit_prompt | inferred\n\n## Requirement Coverage Matrix\nFor each requirement:\n- Requirement\n- Status: met | partial | unmet\n- Evidence\n- Gap\n\n## Coverage Gaps\n- Bullet list of missing or weakly evidenced requirements\n\n## Lineage / Traceability Notes\n- What files/fields used to resolve job -> requirement source\n- Any ambiguity or unresolved linkage\n\n## Recommended Next Actions\n- Concrete follow-ups to reach PASS",
31
- "task_template": "Audit the completed specialist run for requirement compliance.\n\n$prompt\n\nWorking directory: $cwd\n\nResolved lineage input:\n- reviewed_job_id: $reviewed_job_id\n\nPreferred input:\n- reviewed_job_id: <job-id>\nOptional input:\n- reviewed_output: <inline output>\n- requirement_source: <explicit requirements>\n- originating_bead_id: <bead-id>\n- parent_job_id or lineage chain if available\n\nResolve lineage first, then evaluate compliance using the required output format.\n\nWhen reviewing code changes, use `gitnexus_impact` to verify the specialist checked blast radius before edits. Flag missing impact analysis as a compliance gap.\n"
30
+ "system": "You = post-execution requirement compliance reviewer.\n\nAudit completed specialist run. Determine if final output satisfies original requirements.\n\n## Source-of-truth priority\n\n1. Originating bead requirements (highest priority)\n2. Explicit requirement source in task prompt\n3. Fallback inferred requirements from reviewed output context\n\nAlways prefer bead requirements when reviewed run used `--bead`.\n\n## AUTHORITATIVE REVIEW CONTEXT\n\nWhen these fields are injected, treat them as primary truth for review setup and traceability:\n- `reviewed_job_id`\n- `reviewed_output`\n- `requirement_source`\n- `originating_bead_id`\n- `parent_job_id`\n- lineage chain / worktree chain fields\n- auto-injected git diff context\n\nEvidence precedence, highest to lowest:\n1. Injected lineage / reviewed result / diff context\n2. Repo state inside reviewed worktree\n3. Local artifact lookup (`.specialists/jobs`, job history files, filesystem traces)\n4. Heuristics or guesses\n\nDecision rules:\n- If injected lineage/result/diff exists, trust it over missing local artifacts.\n- Missing local artifacts MUST NOT trigger FAIL by itself.\n- FAIL only for direct contradiction, internal inconsistency, or missing required injected fields.\n- If injected context exists but local lookup fails, continue review and emit limitation note.\n- Required injected fields for authoritative traceability:\n - `reviewed_job_id` (required)\n - at least one evidence anchor: `reviewed_output` or auto-injected git diff context\n - at least one requirement anchor: `requirement_source` or `originating_bead_id` or `parent_job_id`/lineage chain\n- Compute `missing_required_injected_fields` from that required set before assigning FAIL for missing inputs.\n- If required injected fields are absent, FAIL is allowed.\n- If injected context contradicts reviewed output or diff, FAIL is allowed.\n- If local artifact lookup fails but injected context is consistent, keep reviewing.\n\nStructured evidence fields to report:\n- authoritative_lineage_present: yes|no\n- authoritative_result_present: yes|no\n- authoritative_diff_present: yes|no\n- local_lookup_status: success|partial|missing|not_attempted\n- contradiction_detected: yes|no\n- missing_required_injected_fields: list\n- limitation_note: short explanation when local lookup fails but injected context remains usable\n\n## Job linkage and evidence collection (required)\n\nGiven `reviewed_job_id`, resolve lineage and evidence in exact order:\n\n1) Prefer injected lineage/result/diff context if present\n - Use injected fields before any filesystem or job-history lookup\n\n2) Run `sp ps <reviewed_job_id>` only as supporting lookup\n - Capture metadata: `bead_id`, `status`, `worktree_path`, `specialist`, `model`\n - If unavailable or stale, do not fail solely for that\n\n3) Run `sp result <reviewed_job_id>` as primary reviewed output evidence source when injected result absent\n\n4) If `worktree_path` available, inspect actual code changes in that worktree\n - Run `git diff` (or `git diff -- <paths>`) to verify file-level changes when needed\n\n5) Requirement source binding result:\n - Bead resolved: run `bd show <bead_id> --json` to load requirements\n - Bead unresolved: inspect explicit prompt fields (`originating_bead_id`, `requirement_source`, `lineage`, `parent_job_id`)\n - `parent_job_id` exists: recurse using `sp ps`/`sp result` for parent jobs\n - Still unresolved: mark traceability missing, but do not FAIL if injected context already supplies sufficient evidence\n\n6) CLI-unavailable fallback ONLY:\n - Use file traversal under `.specialists/jobs/<reviewed_job_id>/status.json` and `events.jsonl`\n - Fallback mode; skip when injected context or `sp ps`/`sp result` work\n\nIMPORTANT: Always use `bd show <bead_id>` or `bd show <bead_id> --json` to read bead data. NEVER search for or read `.beads/issues.jsonl` directly \u2014 beads uses database backend, not flat files.\n\n## Requirement extraction\n\nFrom `bd show --json` output, extract requirements from:\n- `title`\n- `description`\n- `notes`\n- `design` (if present)\n\nNormalize into atomic checklist items before scoring.\n\n## Evidence rules\n\n- Concrete evidence order: injected reviewed result/diff/lineage, then `sp result <reviewed_job_id>`, then `git diff` in reviewed worktree, then explicitly provided output.\n- Local artifact lookup failure alone is not a failure condition.\n- Quote short excerpts for each met/unmet requirement.\n- Never assume completion without evidence.\n\n## Decision rubric\n\n- PASS: all critical requirements met; no major gaps.\n- PARTIAL: some requirements met, at least one meaningful gap remains.\n- FAIL: core requirements unmet, injected evidence contradicts itself or reviewed output, or required injected fields missing.\n- Local lookup failure with valid injected context => PARTIAL or PASS, never FAIL by itself.\n\n## Compliance score\n\n0-100 score:\n- Coverage component (0-70): proportion of requirements met.\n- Evidence quality (0-20): directness and specificity of proof.\n- Traceability integrity (0-10): confidence in job->requirement linkage.\n\n## Required output format\n\n## Compliance Verdict\n- Verdict: PASS | PARTIAL | FAIL\n- Score: <0-100>\n- Reviewed Job: <job-id>\n- Originating Bead: <bead-id or unresolved>\n- Requirement Source Used: bead | explicit_prompt | inferred\n\n## Evidence Summary\n- authoritative_lineage_present: yes|no\n- authoritative_result_present: yes|no\n- authoritative_diff_present: yes|no\n- local_lookup_status: success|partial|missing|not_attempted\n- contradiction_detected: yes|no\n- missing_required_injected_fields: []|[list]\n- limitation_note: <short note or none>\n\n## Requirement Coverage Matrix\nFor each requirement:\n- Requirement\n- Status: met | partial | unmet\n- Evidence\n- Gap\n\n## Coverage Gaps\n- Bullet list of missing or weakly evidenced requirements\n\n## Lineage / Traceability Notes\n- What files/fields used to resolve job -> requirement source\n- Any ambiguity or unresolved linkage\n\n## Recommended Next Actions\n- Concrete follow-ups to reach PASS",
31
+ "task_template": "Audit the completed specialist run for requirement compliance.\n\n$prompt\n\nWorking directory: $cwd\n\nResolved lineage input:\n- reviewed_job_id: $reviewed_job_id\n\nPreferred input:\n- reviewed_job_id: <job-id>\nOptional input:\n- reviewed_output: <inline output>\n- requirement_source: <explicit requirements>\n- originating_bead_id: <bead-id>\n- parent_job_id or lineage chain if available\n\nResolve lineage first, then evaluate compliance using the required output format.\n\nWhen reviewing code changes, use `gitnexus_impact` to verify the specialist checked blast radius before edits. Flag missing impact analysis as a compliance gap."
32
32
  },
33
33
  "skills": {
34
34
  "paths": [
package/dist/index.js CHANGED
@@ -17907,6 +17907,49 @@ function findTokenUsage(payload) {
17907
17907
  }
17908
17908
  return normalizeTokenUsage(record3);
17909
17909
  }
17910
+ function findApiErrorMessage(payload) {
17911
+ if (!payload || typeof payload !== "object")
17912
+ return;
17913
+ const record3 = payload;
17914
+ const direct = [record3.errorMessage, record3.error_message, record3.error, record3.message].find((value) => typeof value === "string" && value.trim().length > 0);
17915
+ if (typeof direct === "string")
17916
+ return direct.trim();
17917
+ const nestedError = record3.error;
17918
+ if (nestedError && typeof nestedError === "object") {
17919
+ const nested = nestedError;
17920
+ const nestedMessage = [nested.message, nested.errorMessage, nested.error_message].find((value) => typeof value === "string" && value.trim().length > 0);
17921
+ if (typeof nestedMessage === "string")
17922
+ return nestedMessage.trim();
17923
+ }
17924
+ const message = record3.assistantMessageEvent;
17925
+ if (message && typeof message === "object") {
17926
+ const nested = message;
17927
+ const nestedMessage = [nested.errorMessage, nested.error_message, nested.error, nested.message].find((value) => typeof value === "string" && value.trim().length > 0);
17928
+ if (typeof nestedMessage === "string")
17929
+ return nestedMessage.trim();
17930
+ }
17931
+ return;
17932
+ }
17933
+ function extractApiErrorFromStderr(stderr) {
17934
+ const compact = stderr.trim();
17935
+ if (!compact)
17936
+ return;
17937
+ const patterns = [
17938
+ /You have hit your ChatGPT usage limit[^\n]*/i,
17939
+ /rate limit[^\n]*/i,
17940
+ /quota[^\n]*/i,
17941
+ /auth(?:entication)?[^\n]*/i,
17942
+ /unauthori[sz]ed[^\n]*/i,
17943
+ /forbidden[^\n]*/i,
17944
+ /overloaded[^\n]*/i
17945
+ ];
17946
+ for (const pattern of patterns) {
17947
+ const match = compact.match(pattern);
17948
+ if (match)
17949
+ return match[0].trim();
17950
+ }
17951
+ return;
17952
+ }
17910
17953
  function normalizeToolResultPart(contentPart) {
17911
17954
  if (!contentPart || typeof contentPart !== "object")
17912
17955
  return;
@@ -18049,6 +18092,7 @@ class PiAgentSession {
18049
18092
  _pendingRequests = new Map;
18050
18093
  _nextRequestId = 1;
18051
18094
  _stderrBuffer = "";
18095
+ _apiError;
18052
18096
  _stallTimer;
18053
18097
  _stallError;
18054
18098
  _testWindowToolCallIds = new Set;
@@ -18147,7 +18191,9 @@ class PiAgentSession {
18147
18191
  donePromise.catch(() => {});
18148
18192
  this._donePromise = donePromise;
18149
18193
  this.proc.stderr?.on("data", (chunk) => {
18150
- this._stderrBuffer += chunk.toString();
18194
+ const text = chunk.toString();
18195
+ this._stderrBuffer += text;
18196
+ this._apiError ??= extractApiErrorFromStderr(this._stderrBuffer) ?? extractApiErrorFromStderr(text);
18151
18197
  });
18152
18198
  this.proc.stdout?.on("data", (chunk) => {
18153
18199
  this._lineBuffer += chunk.toString();
@@ -18308,6 +18354,12 @@ class PiAgentSession {
18308
18354
  }
18309
18355
  this._updateTokenUsage(findTokenUsage(event), "agent_end");
18310
18356
  this._updateFinishReason(findFinishReason(event), "agent_end");
18357
+ const apiError = findApiErrorMessage(event) ?? this._apiError ?? extractApiErrorFromStderr(this._stderrBuffer);
18358
+ if (apiError) {
18359
+ this._apiError = apiError;
18360
+ this._metrics.api_error = apiError;
18361
+ this.options.onMetric?.({ type: "api_error", source: "stderr", errorMessage: apiError });
18362
+ }
18311
18363
  this._agentEndReceived = true;
18312
18364
  this._clearStallTimer();
18313
18365
  this.options.onEvent?.("agent_end");
@@ -18434,6 +18486,16 @@ class PiAgentSession {
18434
18486
  this.options.onEvent?.("message_done");
18435
18487
  break;
18436
18488
  }
18489
+ case "error": {
18490
+ const apiError = findApiErrorMessage(ae) ?? findApiErrorMessage(event);
18491
+ if (apiError) {
18492
+ this._apiError = apiError;
18493
+ this._metrics.api_error = apiError;
18494
+ this.options.onMetric?.({ type: "api_error", source: "rpc", errorMessage: apiError });
18495
+ }
18496
+ this.options.onEvent?.("message_error");
18497
+ break;
18498
+ }
18437
18499
  }
18438
18500
  }
18439
18501
  }
@@ -20083,6 +20145,19 @@ class SqliteClient {
20083
20145
  return this.db.query("SELECT chain_id, epic_id, chain_root_bead_id, chain_root_job_id, updated_at_ms FROM epic_chain_membership WHERE epic_id = ? ORDER BY updated_at_ms DESC").all(epicId);
20084
20146
  }, "listEpicChains");
20085
20147
  }
20148
+ deleteEpicChainMembership(epicId, chainIds) {
20149
+ if (chainIds.length === 0)
20150
+ return [];
20151
+ return withRetry(() => {
20152
+ const existing = new Set(this.db.query("SELECT chain_id FROM epic_chain_membership WHERE epic_id = ?").all(epicId).map((row) => row.chain_id));
20153
+ const removable = chainIds.filter((chainId) => existing.has(chainId));
20154
+ if (removable.length === 0)
20155
+ return [];
20156
+ const placeholders = removable.map(() => "?").join(", ");
20157
+ this.db.query(`DELETE FROM epic_chain_membership WHERE epic_id = ? AND chain_id IN (${placeholders})`).run(epicId, ...removable);
20158
+ return removable;
20159
+ }, "deleteEpicChainMembership");
20160
+ }
20086
20161
  listEpicChainsWithLatestJob(epicId) {
20087
20162
  return withRetry(() => {
20088
20163
  const rows = this.db.query(`
@@ -20995,6 +21070,9 @@ function resolveOutputContractSchema(responseFormat, outputType, outputSchema) {
20995
21070
  }
20996
21071
  return mergedSchema;
20997
21072
  }
21073
+ function shellQuote(value) {
21074
+ return `'${value.replace(/'/g, `'''`)}'`;
21075
+ }
20998
21076
  function buildOutputContractInstruction(responseFormat, outputType, outputSchema) {
20999
21077
  if (responseFormat === "text")
21000
21078
  return "";
@@ -21019,6 +21097,58 @@ function buildOutputContractInstruction(responseFormat, outputType, outputSchema
21019
21097
  ${lines.join(`
21020
21098
  `)}`;
21021
21099
  }
21100
+ function buildReviewerDiffContext(cwd, maxFiles = 20) {
21101
+ const stat2 = execSync2("git diff --stat", {
21102
+ cwd,
21103
+ encoding: "utf8",
21104
+ timeout: 1e4,
21105
+ stdio: ["ignore", "pipe", "pipe"]
21106
+ }).trim();
21107
+ const files = execSync2("git diff --name-only", {
21108
+ cwd,
21109
+ encoding: "utf8",
21110
+ timeout: 1e4,
21111
+ stdio: ["ignore", "pipe", "pipe"]
21112
+ }).split(`
21113
+ `).map((line) => line.trim()).filter(Boolean).slice(0, maxFiles);
21114
+ if (files.length === 0) {
21115
+ throw new Error("Reviewer startup blocked: git diff is empty. No patch context to review.");
21116
+ }
21117
+ const hunks = files.map((file) => {
21118
+ const diff = execSync2(`git diff -- ${shellQuote(file)}`, {
21119
+ cwd,
21120
+ encoding: "utf8",
21121
+ timeout: 1e4,
21122
+ stdio: ["ignore", "pipe", "pipe"]
21123
+ }).trim();
21124
+ return diff ? `### ${file}
21125
+ ${diff}` : `### ${file}
21126
+ (no hunks)`;
21127
+ }).join(`
21128
+
21129
+ `);
21130
+ return { stat: stat2, files, hunks };
21131
+ }
21132
+ function buildReviewerDiffInstruction(context) {
21133
+ return `
21134
+
21135
+ ---
21136
+ ## Reviewer Diff Context
21137
+ Review only patch below. Ignore unrelated files, repo-wide exploration, and filesystem hunting.
21138
+ If patch context is empty, stop and fail fast.
21139
+
21140
+ Diff stat:
21141
+ ${context.stat || "(no stat)"}
21142
+
21143
+ Changed files:
21144
+ ${context.files.map((file) => `- ${file}`).join(`
21145
+ `)}
21146
+
21147
+ Diff hunks:
21148
+ ${context.hunks}
21149
+ ---
21150
+ `;
21151
+ }
21022
21152
  function tryParseJson(input) {
21023
21153
  try {
21024
21154
  return { value: JSON.parse(input) };
@@ -21340,6 +21470,10 @@ ${summaries.join(`
21340
21470
  }
21341
21471
  })
21342
21472
  });
21473
+ if (metadata.name === "reviewer" && options.reusedFromJobId) {
21474
+ const reviewerDiffContext = buildReviewerDiffContext(runCwd);
21475
+ agentsMd += buildReviewerDiffInstruction(reviewerDiffContext);
21476
+ }
21343
21477
  const responseFormat = execution.response_format ?? "text";
21344
21478
  const outputType = execution.output_type ?? "custom";
21345
21479
  const specialistOutputSchema = prompt.output_schema;
@@ -21939,6 +22073,13 @@ function mapCallbackEventToTimelineEvent(callbackEvent, context) {
21939
22073
  ...context.extensionError?.extension ? { extension: context.extensionError.extension } : {},
21940
22074
  ...context.extensionError?.errorMessage ? { error_message: context.extensionError.errorMessage } : {}
21941
22075
  };
22076
+ case "api_error":
22077
+ return {
22078
+ t,
22079
+ type: TIMELINE_EVENT_TYPES.ERROR,
22080
+ source: context.apiError?.source ?? "rpc",
22081
+ error_message: context.apiError?.errorMessage ?? "Unknown API error"
22082
+ };
21942
22083
  case "memory_injection":
21943
22084
  return {
21944
22085
  t,
@@ -22124,6 +22265,7 @@ var init_timeline_events = __esm(() => {
22124
22265
  RETRY: "retry",
22125
22266
  MODEL_CHANGE: "model_change",
22126
22267
  EXTENSION_ERROR: "extension_error",
22268
+ ERROR: "error",
22127
22269
  AUTO_COMMIT_SUCCESS: "auto_commit_success",
22128
22270
  AUTO_COMMIT_SKIPPED: "auto_commit_skipped",
22129
22271
  AUTO_COMMIT_FAILED: "auto_commit_failed",
@@ -23725,6 +23867,16 @@ ${appendError}
23725
23867
  appendTimelineEvent(createFinishReasonEvent(metricEvent.finish_reason, metricEvent.source));
23726
23868
  return;
23727
23869
  }
23870
+ if (metricEvent.type === "api_error") {
23871
+ mergeRunMetrics({ api_error: metricEvent.errorMessage });
23872
+ appendTimelineEvent({
23873
+ t: Date.now(),
23874
+ type: TIMELINE_EVENT_TYPES.ERROR,
23875
+ source: metricEvent.source,
23876
+ error_message: metricEvent.errorMessage
23877
+ });
23878
+ return;
23879
+ }
23728
23880
  if (metricEvent.type === "turn_summary") {
23729
23881
  mergeRunMetrics({
23730
23882
  turns: metricEvent.turn_index,
@@ -27579,6 +27731,9 @@ function formatEventLine(event, options) {
27579
27731
  detailParts.push(`backend=${event.backend}`);
27580
27732
  } else if (event.type === "tool") {
27581
27733
  detail = formatToolDetail(event);
27734
+ } else if (event.type === "error") {
27735
+ detailParts.push(`source=${event.source}`);
27736
+ detailParts.push(`error=${event.error_message}`);
27582
27737
  } else if (event.type === "run_complete") {
27583
27738
  detailParts.push(`status=${event.status}`);
27584
27739
  detailParts.push(`elapsed=${formatElapsed(event.elapsed_s)}`);
@@ -27668,6 +27823,8 @@ function formatEventInline(event) {
27668
27823
  }
27669
27824
  case "stale_warning":
27670
27825
  return yellow10(`[warning] ${event.reason}: ${Math.round(event.silence_ms / 1000)}s silent`);
27826
+ case "error":
27827
+ return red2(`[error] ${event.source}: ${event.error_message}`);
27671
27828
  default:
27672
27829
  return null;
27673
27830
  }
@@ -27701,7 +27858,7 @@ var init_format_helpers = __esm(() => {
27701
27858
  turn_summary: "TURN+",
27702
27859
  compaction: "CMPCT",
27703
27860
  retry: "RETRY",
27704
- error: "ERR"
27861
+ error: "ERROR"
27705
27862
  };
27706
27863
  });
27707
27864
 
@@ -28046,7 +28203,7 @@ function formatFooterModel(backend, model) {
28046
28203
  return model;
28047
28204
  return model.startsWith(`${backend}/`) ? model : `${backend}/${model}`;
28048
28205
  }
28049
- function shellQuote(value) {
28206
+ function shellQuote2(value) {
28050
28207
  return `'${value.replace(/'/g, `'\\''`)}'`;
28051
28208
  }
28052
28209
  function extractReviewedJobIdOverride(prompt) {
@@ -28098,7 +28255,7 @@ async function run13() {
28098
28255
  })();
28099
28256
  const cwd = process.cwd();
28100
28257
  const innerArgs = process.argv.slice(2).filter((a) => a !== "--background");
28101
- const cmd = `${process.execPath} ${process.argv[1]} ${innerArgs.map(shellQuote).join(" ")}`;
28258
+ const cmd = `${process.execPath} ${process.argv[1]} ${innerArgs.map(shellQuote2).join(" ")}`;
28102
28259
  let childPid;
28103
28260
  if (isTmuxAvailable()) {
28104
28261
  const suffix = randomBytes(3).toString("hex");
@@ -31505,12 +31662,16 @@ function syncEpicState(sqlite, epicId, apply) {
31505
31662
  stale_redirect_markers: epicRun && hasRedirectMarkers(epicRun.status_json) ? [epicId] : []
31506
31663
  };
31507
31664
  let deadJobsMarkedError = [];
31665
+ let staleChainRefsPruned = [];
31508
31666
  let readinessResynced = false;
31509
31667
  let redirectMarkersCleared = false;
31510
31668
  if (apply) {
31511
31669
  if (drift.dead_jobs_blocking_readiness.length > 0) {
31512
31670
  deadJobsMarkedError = markDeadJobsAsError(sqlite, jobs);
31513
31671
  }
31672
+ if (drift.stale_chain_refs.length > 0) {
31673
+ staleChainRefsPruned = sqlite.deleteEpicChainMembership(epicId, drift.stale_chain_refs);
31674
+ }
31514
31675
  const readinessNext = loadEpicReadinessSummary(sqlite, epicId);
31515
31676
  const synced = syncEpicStateFromReadiness(sqlite, readinessNext);
31516
31677
  readinessResynced = synced.status !== readinessNext.persisted_state;
@@ -31533,6 +31694,7 @@ function syncEpicState(sqlite, epicId, apply) {
31533
31694
  drift,
31534
31695
  repairs: {
31535
31696
  dead_jobs_marked_error: deadJobsMarkedError,
31697
+ stale_chain_refs_pruned: staleChainRefsPruned,
31536
31698
  readiness_resynced: readinessResynced,
31537
31699
  redirect_markers_cleared: redirectMarkersCleared
31538
31700
  },
@@ -31732,7 +31894,7 @@ function parseSyncOptions(argv) {
31732
31894
  return { epicId, apply, json };
31733
31895
  }
31734
31896
  function parseAbandonOptions(argv) {
31735
- const epicId = parseEpicId(argv);
31897
+ let epicId = "";
31736
31898
  let reason = "";
31737
31899
  let force = false;
31738
31900
  let json = false;
@@ -31755,9 +31917,16 @@ function parseAbandonOptions(argv) {
31755
31917
  index += 1;
31756
31918
  continue;
31757
31919
  }
31758
- if (argument.startsWith("-") && argument !== "--force" && argument !== "--json") {
31920
+ if (argument.startsWith("-")) {
31759
31921
  throw new Error(`Unknown option: ${argument}`);
31760
31922
  }
31923
+ if (epicId.length > 0) {
31924
+ throw new Error("Only one epic ID is supported");
31925
+ }
31926
+ epicId = argument;
31927
+ }
31928
+ if (!epicId) {
31929
+ throw new Error("Missing epic ID");
31761
31930
  }
31762
31931
  if (reason.length === 0) {
31763
31932
  throw new Error("Missing required --reason <text>");
@@ -32161,6 +32330,7 @@ async function handleEpicSyncCommand(argv) {
32161
32330
  console.log(` stale_redirect_markers: ${result.drift.stale_redirect_markers.length}`);
32162
32331
  if (result.apply) {
32163
32332
  console.log(` repaired_dead_jobs: ${result.repairs.dead_jobs_marked_error.length}`);
32333
+ console.log(` stale_chain_refs_pruned: ${result.repairs.stale_chain_refs_pruned.length}`);
32164
32334
  console.log(` readiness_resynced: ${result.repairs.readiness_resynced}`);
32165
32335
  console.log(` redirect_markers_cleared: ${result.repairs.redirect_markers_cleared}`);
32166
32336
  }
@@ -33709,6 +33879,10 @@ function deriveStartupSnapshot(status, events) {
33709
33879
  merged.branch = status.branch;
33710
33880
  return Object.keys(merged).length > 0 ? merged : null;
33711
33881
  }
33882
+ function deriveApiError(events) {
33883
+ const errorEvent = [...events].reverse().find((event) => event.type === "error");
33884
+ return errorEvent?.error_message ?? null;
33885
+ }
33712
33886
  function formatStartupSnapshot(snapshot) {
33713
33887
  if (!snapshot)
33714
33888
  return null;
@@ -33829,20 +34003,25 @@ async function run16() {
33829
34003
  process.exit(1);
33830
34004
  }
33831
34005
  if (status2.status === "done") {
33832
- const startupContext2 = deriveStartupSnapshot(status2, readTimelineEventsForResult(sqliteClient, jobsDir, jobId));
34006
+ const events2 = readTimelineEventsForResult(sqliteClient, jobsDir, jobId);
34007
+ const startupContext2 = deriveStartupSnapshot(status2, events2);
34008
+ const apiError2 = status2.error ?? deriveApiError(events2);
33833
34009
  const output3 = readResultOutput();
33834
34010
  if (!output3) {
34011
+ const message = apiError2 ? `Job ${jobId} failed: ${apiError2}` : `Result not found for job ${jobId}`;
33835
34012
  if (args.json) {
33836
- emitJson(status2, null, `Result not found for job ${jobId}`);
34013
+ emitJson(status2, null, message, startupContext2);
33837
34014
  } else {
33838
- console.error(`Result not found for job ${jobId}`);
34015
+ process.stderr.write(`${red3(message)}
34016
+ `);
33839
34017
  }
33840
34018
  process.exit(1);
33841
34019
  }
34020
+ const enrichedStatus2 = apiError2 && !status2.error ? { ...status2, error: apiError2 } : status2;
33842
34021
  if (args.json) {
33843
- emitJson(status2, output3, null, startupContext2);
34022
+ emitJson(enrichedStatus2, output3, null, startupContext2);
33844
34023
  } else {
33845
- emitHumanResult(output3, status2, startupContext2);
34024
+ emitHumanResult(output3, enrichedStatus2, startupContext2);
33846
34025
  }
33847
34026
  return;
33848
34027
  }
@@ -33929,31 +34108,37 @@ async function run16() {
33929
34108
  return;
33930
34109
  }
33931
34110
  if (status.status === "error") {
33932
- const startupContext2 = deriveStartupSnapshot(status, readTimelineEventsForResult(sqliteClient, jobsDir, jobId));
33933
- const message = `Job ${jobId} failed: ${status.error ?? "unknown error"}`;
34111
+ const events2 = readTimelineEventsForResult(sqliteClient, jobsDir, jobId);
34112
+ const startupContext2 = deriveStartupSnapshot(status, events2);
34113
+ const message = `Job ${jobId} failed: ${status.error ?? deriveApiError(events2) ?? "unknown error"}`;
33934
34114
  if (args.json) {
33935
34115
  emitJson(status, null, message, startupContext2);
33936
34116
  } else {
33937
- process.stderr.write(`${red3(`Job ${jobId} failed:`)} ${status.error ?? "unknown error"}
34117
+ process.stderr.write(`${red3(`Job ${jobId} failed:`)} ${status.error ?? deriveApiError(events2) ?? "unknown error"}
33938
34118
  `);
33939
34119
  }
33940
34120
  process.exit(1);
33941
34121
  }
34122
+ const events = readTimelineEventsForResult(sqliteClient, jobsDir, jobId);
34123
+ const apiError = status.error ?? deriveApiError(events);
33942
34124
  const output2 = readResultOutput();
33943
34125
  if (!output2) {
34126
+ const message = apiError ? `Job ${jobId} failed: ${apiError}` : `Result not found for job ${jobId}`;
33944
34127
  if (args.json) {
33945
- emitJson(status, null, `Result not found for job ${jobId}`);
34128
+ emitJson(status, null, message);
33946
34129
  } else {
33947
- console.error(`Result not found for job ${jobId}`);
34130
+ process.stderr.write(`${red3(message)}
34131
+ `);
33948
34132
  }
33949
34133
  process.exit(1);
33950
34134
  }
33951
- const startupContext = deriveStartupSnapshot(status, readTimelineEventsForResult(sqliteClient, jobsDir, jobId));
34135
+ const startupContext = deriveStartupSnapshot(status, events);
34136
+ const enrichedStatus = apiError && !status.error ? { ...status, error: apiError } : status;
33952
34137
  if (args.json) {
33953
- emitJson(status, output2, null, startupContext);
34138
+ emitJson(enrichedStatus, output2, null, startupContext);
33954
34139
  return;
33955
34140
  }
33956
- emitHumanResult(output2, status, startupContext);
34141
+ emitHumanResult(output2, enrichedStatus, startupContext);
33957
34142
  } catch (error2) {
33958
34143
  const message = error2 instanceof Error ? error2.message : String(error2);
33959
34144
  if (args.json) {
@@ -34150,6 +34335,8 @@ function getHumanEventKey(event) {
34150
34335
  return `run_start:${event.specialist}:${event.bead_id ?? ""}`;
34151
34336
  case "run_complete":
34152
34337
  return `run_complete:${event.status}:${event.error ?? ""}`;
34338
+ case "error":
34339
+ return `error:${event.source}:${event.error_message}`;
34153
34340
  case "token_usage":
34154
34341
  return `token_usage:${event.token_usage.total_tokens ?? ""}:${event.source}`;
34155
34342
  case "finish_reason":
@@ -40305,7 +40492,7 @@ var AssertObjectSchema = custom2((v) => v !== null && (typeof v === "object" ||
40305
40492
  var ProgressTokenSchema = union([string2(), number2().int()]);
40306
40493
  var CursorSchema = string2();
40307
40494
  var TaskCreationParamsSchema = looseObject({
40308
- ttl: union([number2(), _null3()]).optional(),
40495
+ ttl: number2().optional(),
40309
40496
  pollInterval: number2().optional()
40310
40497
  });
40311
40498
  var TaskMetadataSchema = object2({
@@ -40459,7 +40646,8 @@ var ClientCapabilitiesSchema = object2({
40459
40646
  roots: object2({
40460
40647
  listChanged: boolean2().optional()
40461
40648
  }).optional(),
40462
- tasks: ClientTasksCapabilitySchema.optional()
40649
+ tasks: ClientTasksCapabilitySchema.optional(),
40650
+ extensions: record(string2(), AssertObjectSchema).optional()
40463
40651
  });
40464
40652
  var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
40465
40653
  protocolVersion: string2(),
@@ -40484,7 +40672,8 @@ var ServerCapabilitiesSchema = object2({
40484
40672
  tools: object2({
40485
40673
  listChanged: boolean2().optional()
40486
40674
  }).optional(),
40487
- tasks: ServerTasksCapabilitySchema.optional()
40675
+ tasks: ServerTasksCapabilitySchema.optional(),
40676
+ extensions: record(string2(), AssertObjectSchema).optional()
40488
40677
  });
40489
40678
  var InitializeResultSchema = ResultSchema.extend({
40490
40679
  protocolVersion: string2(),
@@ -40599,6 +40788,7 @@ var ResourceSchema = object2({
40599
40788
  uri: string2(),
40600
40789
  description: optional(string2()),
40601
40790
  mimeType: optional(string2()),
40791
+ size: optional(number2()),
40602
40792
  annotations: AnnotationsSchema.optional(),
40603
40793
  _meta: optional(looseObject({}))
40604
40794
  });
@@ -42594,6 +42784,10 @@ class Protocol {
42594
42784
  this._progressHandlers.clear();
42595
42785
  this._taskProgressTokens.clear();
42596
42786
  this._pendingDebouncedNotifications.clear();
42787
+ for (const info of this._timeoutInfo.values()) {
42788
+ clearTimeout(info.timeoutId);
42789
+ }
42790
+ this._timeoutInfo.clear();
42597
42791
  for (const controller of this._requestHandlerAbortControllers.values()) {
42598
42792
  controller.abort();
42599
42793
  }
@@ -42724,7 +42918,9 @@ class Protocol {
42724
42918
  await capturedTransport?.send(errorResponse);
42725
42919
  }
42726
42920
  }).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
42727
- this._requestHandlerAbortControllers.delete(request.id);
42921
+ if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
42922
+ this._requestHandlerAbortControllers.delete(request.id);
42923
+ }
42728
42924
  });
42729
42925
  }
42730
42926
  _onprogress(notification) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaggerxtrm/specialists",
3
- "version": "3.6.11",
3
+ "version": "3.6.12",
4
4
  "description": "OmniSpecialist — 7-tool MCP orchestration layer powered by the Specialist System. Discover and execute .specialist.yaml files across project/user/system scopes via pi.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -24,7 +24,8 @@
24
24
  "test:bun": "bun test tests/unit/specialist/observability-sqlite.test.ts tests/unit/specialist/observability-db.test.ts tests/unit/cli/db.test.ts",
25
25
  "test:watch": "bun --bun vitest",
26
26
  "test:coverage": "bun --bun vitest run --coverage",
27
- "test:supervisor": "bun --bun vitest run tests/unit/specialist/supervisor.test.ts --no-file-parallelism"
27
+ "test:supervisor": "bun --bun vitest run tests/unit/specialist/supervisor.test.ts --no-file-parallelism",
28
+ "benchmark:executor": "node scripts/run-executor-benchmark.mjs"
28
29
  },
29
30
  "keywords": [
30
31
  "omnispecialist",
@@ -1,151 +0,0 @@
1
- # the name by which the project can be referenced within Serena
2
- project_name: "specialists"
3
-
4
-
5
- # list of languages for which language servers are started; choose from:
6
- # al bash clojure cpp csharp
7
- # csharp_omnisharp dart elixir elm erlang
8
- # fortran fsharp go groovy haskell
9
- # java julia kotlin lua markdown
10
- # matlab nix pascal perl php
11
- # php_phpactor powershell python python_jedi r
12
- # rego ruby ruby_solargraph rust scala
13
- # swift terraform toml typescript typescript_vts
14
- # vue yaml zig
15
- # (This list may be outdated. For the current list, see values of Language enum here:
16
- # https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
17
- # For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
18
- # Note:
19
- # - For C, use cpp
20
- # - For JavaScript, use typescript
21
- # - For Free Pascal/Lazarus, use pascal
22
- # Special requirements:
23
- # Some languages require additional setup/installations.
24
- # See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
25
- # When using multiple languages, the first language server that supports a given file will be used for that file.
26
- # The first language is the default language and the respective language server will be used as a fallback.
27
- # Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
28
- languages: []
29
-
30
- # the encoding used by text files in the project
31
- # For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
32
- encoding: "utf-8"
33
-
34
- # line ending convention to use when writing source files.
35
- # Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
36
- # This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
37
- line_ending:
38
-
39
- # The language backend to use for this project.
40
- # If not set, the global setting from serena_config.yml is used.
41
- # Valid values: LSP, JetBrains
42
- # Note: the backend is fixed at startup. If a project with a different backend
43
- # is activated post-init, an error will be returned.
44
- language_backend:
45
-
46
- # whether to use project's .gitignore files to ignore files
47
- ignore_all_files_in_gitignore: true
48
-
49
- # advanced configuration option allowing to configure language server-specific options.
50
- # Maps the language key to the options.
51
- # Have a look at the docstring of the constructors of the LS implementations within solidlsp (e.g., for C# or PHP) to see which options are available.
52
- # No documentation on options means no options are available.
53
- ls_specific_settings: {}
54
-
55
- # list of additional paths to ignore in this project.
56
- # Same syntax as gitignore, so you can use * and **.
57
- # Note: global ignored_paths from serena_config.yml are also applied additively.
58
- ignored_paths: []
59
-
60
- # whether the project is in read-only mode
61
- # If set to true, all editing tools will be disabled and attempts to use them will result in an error
62
- # Added on 2025-04-18
63
- read_only: false
64
-
65
- # list of tool names to exclude.
66
- # This extends the existing exclusions (e.g. from the global configuration)
67
- #
68
- # Below is the complete list of tools for convenience.
69
- # To make sure you have the latest list of tools, and to view their descriptions,
70
- # execute `uv run scripts/print_tool_overview.py`.
71
- #
72
- # * `activate_project`: Activates a project by name.
73
- # * `check_onboarding_performed`: Checks whether project onboarding was already performed.
74
- # * `create_text_file`: Creates/overwrites a file in the project directory.
75
- # * `delete_lines`: Deletes a range of lines within a file.
76
- # * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
77
- # * `execute_shell_command`: Executes a shell command.
78
- # * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
79
- # * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
80
- # * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
81
- # * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
82
- # * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
83
- # * `initial_instructions`: Gets the initial instructions for the current project.
84
- # Should only be used in settings where the system prompt cannot be set,
85
- # e.g. in clients you have no control over, like Claude Desktop.
86
- # * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
87
- # * `insert_at_line`: Inserts content at a given line in a file.
88
- # * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
89
- # * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
90
- # * `list_memories`: Lists memories in Serena's project-specific memory store.
91
- # * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
92
- # * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
93
- # * `read_file`: Reads a file within the project directory.
94
- # * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
95
- # * `remove_project`: Removes a project from the Serena configuration.
96
- # * `replace_lines`: Replaces a range of lines within a file with new content.
97
- # * `replace_symbol_body`: Replaces the full definition of a symbol.
98
- # * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
99
- # * `search_for_pattern`: Performs a search for a pattern in the project.
100
- # * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
101
- # * `switch_modes`: Activates modes by providing a list of their names
102
- # * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
103
- # * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
104
- # * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
105
- # * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
106
- excluded_tools: []
107
-
108
- # list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default).
109
- # This extends the existing inclusions (e.g. from the global configuration).
110
- included_optional_tools: []
111
-
112
- # fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
113
- # This cannot be combined with non-empty excluded_tools or included_optional_tools.
114
- fixed_tools: []
115
-
116
- # list of mode names to that are always to be included in the set of active modes
117
- # The full set of modes to be activated is base_modes + default_modes.
118
- # If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
119
- # Otherwise, this setting overrides the global configuration.
120
- # Set this to [] to disable base modes for this project.
121
- # Set this to a list of mode names to always include the respective modes for this project.
122
- base_modes:
123
-
124
- # list of mode names that are to be activated by default.
125
- # The full set of modes to be activated is base_modes + default_modes.
126
- # If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
127
- # Otherwise, this overrides the setting from the global configuration (serena_config.yml).
128
- # This setting can, in turn, be overridden by CLI parameters (--mode).
129
- default_modes:
130
-
131
- # initial prompt for the project. It will always be given to the LLM upon activating the project
132
- # (contrary to the memories, which are loaded on demand).
133
- initial_prompt: ""
134
-
135
- # time budget (seconds) per tool call for the retrieval of additional symbol information
136
- # such as docstrings or parameter information.
137
- # This overrides the corresponding setting in the global configuration; see the documentation there.
138
- # If null or missing, use the setting from the global configuration.
139
- symbol_info_budget:
140
-
141
- # list of regex patterns which, when matched, mark a memory entry as read‑only.
142
- # Extends the list from the global configuration, merging the two lists.
143
- read_only_memory_patterns: []
144
-
145
- # list of regex patterns for memories to completely ignore.
146
- # Matching memories will not appear in list_memories or activate_project output
147
- # and cannot be accessed via read_memory or write_memory.
148
- # To access ignored memory files, use the read_file tool on the raw file path.
149
- # Extends the list from the global configuration, merging the two lists.
150
- # Example: ["_archive/.*", "_episodes/.*"]
151
- ignored_memory_patterns: []