muse-crew 0.17.2 → 0.17.3

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 (70) hide show
  1. package/API.md +11 -0
  2. package/docs/decisions/composition-machinery.md +180 -0
  3. package/docs/decisions/publish-path.md +6 -0
  4. package/docs/decisions/workflow-core.md +5 -4
  5. package/lib/AGENTS.md +2 -1
  6. package/lib/bugfix/phases/build.js +168 -0
  7. package/lib/bugfix/phases/capture.js +170 -0
  8. package/lib/bugfix/phases/integrate.js +165 -0
  9. package/lib/bugfix/phases/map.js +129 -0
  10. package/lib/bugfix/phases/publish.js +592 -0
  11. package/lib/bugfix/phases/qa.js +356 -0
  12. package/lib/bugfix/phases/reproduce.js +254 -0
  13. package/lib/bugfix/phases/review.js +292 -0
  14. package/lib/bugfix/phases/triage.js +69 -0
  15. package/lib/chore/CONTRACT.md +181 -0
  16. package/lib/chore/DISPOSITION.md +98 -0
  17. package/lib/chore/extract.js +204 -0
  18. package/lib/chore/phase-lib.js +885 -0
  19. package/lib/chore/phases/build.js +110 -0
  20. package/lib/chore/phases/capture.js +82 -0
  21. package/lib/chore/phases/integrate.js +109 -0
  22. package/lib/chore/phases/map.js +81 -0
  23. package/lib/chore/phases/publish.js +543 -0
  24. package/lib/chore/phases/review.js +255 -0
  25. package/lib/chore/phases/triage.js +57 -0
  26. package/lib/chore/prompts/evidence-gatherer.js +41 -0
  27. package/lib/chore/prompts/evidence-gatherer.schema.json +1 -0
  28. package/lib/chore/prompts/tool-check.js +15 -0
  29. package/lib/chore/prompts/trailers.js +56 -0
  30. package/lib/chore/prompts/verdict-reask.js +28 -0
  31. package/lib/chore/prompts/verdict-reask.schema.json +1 -0
  32. package/lib/chore/prompts/work-agent.js +52 -0
  33. package/lib/chore/prompts/work-agent.schema.json +1 -0
  34. package/lib/chore/spawn-keys.js +44 -0
  35. package/lib/chore/spawn-vocab.js +87 -0
  36. package/lib/chore-run.js +538 -0
  37. package/lib/chore-tick.js +289 -0
  38. package/lib/crew-api.js +273 -0
  39. package/lib/crew-dispatch-worker.js +27 -7
  40. package/lib/crew-release.sh +7 -2
  41. package/lib/extract.js +252 -0
  42. package/lib/prompts/tool-check.js +18 -0
  43. package/lib/prompts/trailers.js +59 -0
  44. package/lib/prompts/verdict-reask.js +31 -0
  45. package/lib/prompts/verdict-reask.schema.json +1 -0
  46. package/lib/prompts/work-agent.js +56 -0
  47. package/lib/prompts/work-agent.schema.json +1 -0
  48. package/lib/reap-spawns.js +407 -0
  49. package/lib/schema.sql +12 -1
  50. package/lib/spawn-keys.js +47 -0
  51. package/lib/spawn-step.js +572 -0
  52. package/lib/standard/phases/build.js +120 -0
  53. package/lib/standard/phases/capture.js +163 -0
  54. package/lib/standard/phases/integrate.js +172 -0
  55. package/lib/standard/phases/map.js +119 -0
  56. package/lib/standard/phases/publish.js +565 -0
  57. package/lib/standard/phases/qa.js +399 -0
  58. package/lib/standard/phases/review.js +281 -0
  59. package/lib/standard/phases/triage.js +64 -0
  60. package/lib/test-detached-integrate.sh +47 -0
  61. package/lib/workflow-driver.js +605 -0
  62. package/lib/workflow-lib.js +1012 -0
  63. package/lib/workflow-spec.js +187 -0
  64. package/lib/worktree-lifecycle.sh +55 -3
  65. package/package.json +1 -1
  66. package/seed/cron-body-template.md +61 -9
  67. package/workflows/bugfix.js +17 -17
  68. package/workflows/chore.js +16 -16
  69. package/workflows/docs.js +14 -11
  70. package/workflows/standard.js +16 -16
@@ -308,13 +308,17 @@ var TOOL_CHECK_PREAMBLE =
308
308
  "Then do the assignment below.\n\n";
309
309
  function buildTransportRetryTrailer(stepName, repoPath, taskId, attempt, reason) {
310
310
  // reason: "discarded" (the runtime threw the output away — the JSON-candidate
311
- // scan found {...}-shaped fragments it could not parse), "empty" (agent() returned without throwing but produced
312
- // nothing usable), "no-tools" (the worker's TOOL CHECK reported
313
- // artifact_tools: missing), or "no-transport" (the worker's TOOL CHECK
314
- // reported shell_transport: unavailable).
311
+ // scan found {...}-shaped fragments it could not parse), "errored" (the
312
+ // attempt errored — not a brace discard), "empty" (agent() returned
313
+ // without throwing but produced nothing usable), "no-tools" (the
314
+ // worker's TOOL CHECK reported artifact_tools: missing), or
315
+ // "no-transport" (the worker's TOOL CHECK reported shell_transport:
316
+ // unavailable).
315
317
  // The trailer tells the retry what to expect, not just to try again.
316
318
  var why = reason === "empty"
317
319
  ? "your previous attempt returned no usable output"
320
+ : reason === "errored"
321
+ ? "your previous attempt errored before producing a usable report (not a brace discard — diagnose the error and report the true state in plain prose)"
318
322
  : reason === "no-tools"
319
323
  ? "your previous attempt's TOOL CHECK reported artifact_tools: missing (this is a fresh launch, so run the TOOL CHECK's load step again before the work)"
320
324
  : reason === "no-transport"
@@ -482,12 +486,11 @@ function describeWorkAgentFailure(stepName, identity, attempts) {
482
486
  // Honest classification of a work-agent call that yielded no usable
483
487
  // report, with the per-attempt evidence preserved in the session notes.
484
488
  // Two distinct cases:
485
- // - agent() THREW: the runtime discarded output it could not machine-read
486
- // (e.g. prose tripping the JSON-candidate heuristic). The raw output is
487
- // gone — the workflow never received it — so the surviving error text is
488
- // recorded here instead. (An earlier comment claimed the raw output was
489
- // "preserved in the run record"; that was false — nothing preserved it —
490
- // and the claim is removed.)
489
+ // - agent() THREW: either the runtime discarded output it could not
490
+ // machine-read (prose tripping the JSON-candidate heuristic), or the
491
+ // agent errored before producing a report. The raw output is gone —
492
+ // the workflow never received it — so the surviving error text is
493
+ // recorded here instead.
491
494
  // - agent() RETURNED EMPTY without throwing: the child produced nothing
492
495
  // usable. Each attempt's outcome is the evidence.
493
496
  // attempts: [{threw, error, outcome}, ...], in order.
@@ -1928,13 +1931,10 @@ while (i < STEPS.length) {
1928
1931
  // state agent steps were deleted — their outputs fed only the
1929
1932
  // retired content-verdict/receipt-attribution machinery, and the
1930
1933
  // toolcheck ran in a workflow child that cannot reach artifact_edit.
1931
- // Issuance belongs to the session-carrying tick worker, which
1932
- // handles tool-unavailability as inconclusive per the tick protocol.)
1933
- // Publish at intent. Everything above — preflight, provenance base,
1934
- // checksummed diff, toolcheck, pre-trigger baselines — is read-only.
1935
1934
  // Issuance belongs to the session-carrying tick worker
1936
1935
  // (scan-publish-intent's intent bucket), the only caller class that
1937
- // can reach artifact_edit. This entry is issuer-written BY THE
1936
+ // can reach artifact_edit; it handles tool-unavailability as
1937
+ // inconclusive per the tick protocol. This entry is issuer-written BY THE
1938
1938
  // WORKFLOW and names the intent: outcome "publish-intent", never
1939
1939
  // "submitted" — the workflow issued nothing. The worker claims it
1940
1940
  // via the park note below.
@@ -2218,7 +2218,7 @@ while (i < STEPS.length) {
2218
2218
  for (var workAttempt = 0; workAttempt <= 2 && !mechanicalReviewFail; workAttempt++) {
2219
2219
  var workKey = workAttempt === 0 ? workKeyBase : workRetryKey(step.name, (totalReworkCount > 0 ? "-r" + totalReworkCount : ""), workAttempt);
2220
2220
  var prevAttempt = workAttempt === 0 ? null : workAttempts[workAttempt - 1];
2221
- var retryReason = workAttempt === 0 ? null : (prevAttempt.threw ? "discarded" : (prevAttempt.outcome === "missing-artifact-tools" ? "no-tools" : (prevAttempt.outcome === "unavailable-shell-transport" ? "no-transport" : "empty")));
2221
+ var retryReason = workAttempt === 0 ? null : (prevAttempt.threw ? (/output was not JSON/.test(prevAttempt.error || "") ? "discarded" : "errored") : (prevAttempt.outcome === "missing-artifact-tools" ? "no-tools" : (prevAttempt.outcome === "unavailable-shell-transport" ? "no-transport" : "empty")));
2222
2222
  try {
2223
2223
  workerResult = await agent(
2224
2224
  workPromptBase + (workAttempt === 0 ? "" : buildTransportRetryTrailer(step.name, REPO_PATH, taskId, workAttempt, retryReason)),