claude-code-session-manager 0.79.0 → 0.81.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.
Files changed (82) hide show
  1. package/dist/assets/{AgentLibrary-COtVRqBR.js → AgentLibrary-psZYVM2w.js} +1 -1
  2. package/dist/assets/{DataModel-CSEKw_OR.js → DataModel-BMied5pg.js} +1 -1
  3. package/dist/assets/{History-CHHovrAO.js → History-BFC0oaKc.js} +1 -1
  4. package/dist/assets/{Hooks-BZU6C3x6.js → Hooks-CTLfO9G8.js} +1 -1
  5. package/dist/assets/{HostBilko-CqTUoq37.js → HostBilko-D4I0Cpwn.js} +1 -1
  6. package/dist/assets/{Library-BtxdyTLz.js → Library-BTzS8KsS.js} +1 -1
  7. package/dist/assets/{ListDetail-qZc7Zm-6.js → ListDetail-CuRmT008.js} +1 -1
  8. package/dist/assets/{MarkdownEditor-BHe_4fJR.js → MarkdownEditor-BgQGtvWo.js} +1 -1
  9. package/dist/assets/{McpServers-7Z98HLNo.js → McpServers-DiVQUK57.js} +1 -1
  10. package/dist/assets/{Memory-CR72KoyP.js → Memory-DSu15JmL.js} +1 -1
  11. package/dist/assets/{Panel-pL6H3dpQ.js → Panel-CD5wxGSR.js} +1 -1
  12. package/dist/assets/{Permissions-CWSWjyXM.js → Permissions-C_tAE6yJ.js} +1 -1
  13. package/dist/assets/{Plugins-CN6lX2lt.js → Plugins-kwI7W-eK.js} +2 -2
  14. package/dist/assets/{ProvenanceBadge-BXSXwIsk.js → ProvenanceBadge-CQceOgsH.js} +1 -1
  15. package/dist/assets/{SaveBar-BlB5TGpR.js → SaveBar-BDk5e3Pp.js} +1 -1
  16. package/dist/assets/{Scheduler-DRciWUmR.js → Scheduler-DRnvEYzv.js} +7 -7
  17. package/dist/assets/{ScopeSwitcher-kFrXtjpr.js → ScopeSwitcher-CeifaOlq.js} +1 -1
  18. package/dist/assets/{Settings-BXuyf4lJ.js → Settings-BWQ1Utop.js} +1 -1
  19. package/dist/assets/{SkillReferenceGraph-Dfacb0PE.js → SkillReferenceGraph-CW6e1SW1.js} +1 -1
  20. package/dist/assets/{Skills-CHqcpiyt.js → Skills-BLwFB0E4.js} +1 -1
  21. package/dist/assets/{SystemPrompt-fxXm0BZr.js → SystemPrompt-DC4ZTArJ.js} +1 -1
  22. package/dist/assets/{TagLibrary-DOz65ZTz.js → TagLibrary-pMeGfjUb.js} +1 -1
  23. package/dist/assets/{TiptapBody-D0bWx_9o.js → TiptapBody-BHFid2pZ.js} +1 -1
  24. package/dist/assets/{Toggle-C9jBwGSx.js → Toggle-D9eYoZh4.js} +1 -1
  25. package/dist/assets/{index-DPYa6jbM.js → index-CuyM9vAP.js} +5 -5
  26. package/dist/assets/{settingsSchema-BTPw1bR3.js → settingsSchema-DrxC67uZ.js} +1 -1
  27. package/dist/index.html +1 -1
  28. package/package.json +1 -1
  29. package/plugins/session-manager-dev/skills/builder/3-publish/SKILL.md +10 -0
  30. package/plugins/session-manager-dev/skills/develop/standards.md +1 -0
  31. package/src/main/__tests__/computeDepHistorySatisfaction.test.cjs +66 -0
  32. package/src/main/__tests__/prdCreate.test.cjs +133 -8
  33. package/src/main/__tests__/prdFrontmatterDependsOn.test.cjs +136 -0
  34. package/src/main/__tests__/prdUpdateDependsOn.test.cjs +160 -0
  35. package/src/main/__tests__/queueHistory.test.cjs +33 -0
  36. package/src/main/__tests__/rcaReport.test.cjs +24 -0
  37. package/src/main/__tests__/runVerify-blocked-by-foreign-wip.test.cjs +58 -0
  38. package/src/main/__tests__/runVerify-policy-denial.test.cjs +89 -0
  39. package/src/main/__tests__/scheduleJobTransitions.test.cjs +1 -0
  40. package/src/main/__tests__/scheduler-already-satisfied-on-main.test.cjs +105 -0
  41. package/src/main/__tests__/scheduler-autofix-outcome.test.cjs +73 -1
  42. package/src/main/__tests__/scheduler-autofix-select.test.cjs +17 -0
  43. package/src/main/__tests__/scheduler-blocked-by-foreign-wip.test.cjs +107 -0
  44. package/src/main/__tests__/scheduler-commit-guard-noop.test.cjs +20 -0
  45. package/src/main/__tests__/scheduler-finalize-dispatch-guards.test.cjs +229 -0
  46. package/src/main/__tests__/scheduler-leftover-quarantine.test.cjs +199 -0
  47. package/src/main/__tests__/scheduler-looks-done.test.cjs +141 -1
  48. package/src/main/__tests__/scheduler-mechanical-recovery.test.cjs +222 -0
  49. package/src/main/__tests__/scheduler-rate-limit-pause.test.cjs +81 -0
  50. package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +205 -2
  51. package/src/main/__tests__/scheduler-reconcile-quarantine.test.cjs +51 -0
  52. package/src/main/__tests__/scheduler-resume-recovery.test.cjs +254 -0
  53. package/src/main/__tests__/schedulerBatchRootBlocker.test.cjs +117 -0
  54. package/src/main/__tests__/uniquePrdNumbers.test.cjs +14 -2
  55. package/src/main/ipcSchemas.cjs +15 -1
  56. package/src/main/lib/__tests__/branchSweep.test.cjs +164 -0
  57. package/src/main/lib/__tests__/fixtures/204-mercury-steam-horse.log.txt +13 -0
  58. package/src/main/lib/__tests__/gitWorktree.test.cjs +129 -10
  59. package/src/main/lib/__tests__/landedSinceRun.test.cjs +61 -1
  60. package/src/main/lib/__tests__/rateLimitWindow.test.cjs +88 -0
  61. package/src/main/lib/__tests__/reaperHelpers.test.cjs +120 -1
  62. package/src/main/lib/__tests__/schedulerBatchDepends.test.cjs +59 -7
  63. package/src/main/lib/branchSweep.cjs +127 -0
  64. package/src/main/lib/depSlugResolve.cjs +72 -0
  65. package/src/main/lib/epicWorktreeMerge.cjs +3 -3
  66. package/src/main/lib/epicWorktreeMint.cjs +17 -5
  67. package/src/main/lib/fixPlanSlug.cjs +62 -0
  68. package/src/main/lib/gitWorktree.cjs +117 -12
  69. package/src/main/lib/landedSinceRun.cjs +41 -1
  70. package/src/main/lib/mcpToolCatalog.cjs +4 -1
  71. package/src/main/lib/prdCreate.cjs +84 -5
  72. package/src/main/lib/prdFrontmatter.cjs +56 -8
  73. package/src/main/lib/queueHistory.cjs +50 -5
  74. package/src/main/lib/rateLimitWindow.cjs +62 -0
  75. package/src/main/lib/rcaReport.cjs +18 -3
  76. package/src/main/lib/reaperHelpers.cjs +169 -3
  77. package/src/main/lib/scheduleJobTransitions.cjs +28 -5
  78. package/src/main/lib/schedulerBatch.cjs +181 -23
  79. package/src/main/runVerify.cjs +71 -3
  80. package/src/main/scheduler/prdParser.cjs +7 -0
  81. package/src/main/scheduler.cjs +1554 -71
  82. package/src/preload/api.d.ts +8 -0
@@ -70,6 +70,19 @@ function isHarnessToolError(content) {
70
70
  || /\bNo such tool available\b/.test(content);
71
71
  }
72
72
 
73
+ /**
74
+ * A PreToolUse hook denial (`guard-destructive-git.cjs`, `guard-prd-writes.cjs`,
75
+ * `guard-inline-implementation.cjs`, or the harness's own `Blocked: sleep N
76
+ * followed by: ...` form) never executed the tool it names — it says nothing
77
+ * about whether the task succeeded, and the model is expected to adapt and
78
+ * retry. (Incident: PRD 1106, 2026-09-02 — four guard-destructive-git denials
79
+ * in a fully-implemented, correctly-isolated run.)
80
+ */
81
+ function isPolicyDenial(content) {
82
+ if (typeof content !== 'string' || !content) return false;
83
+ return /^(?:Error:\s*)?Blocked:/.test(content);
84
+ }
85
+
73
86
  function detectPattern(content) {
74
87
  if (typeof content !== 'string' || !content) return null;
75
88
 
@@ -506,16 +519,17 @@ function checkDeps(queueEntry, allJobs, prdBody) {
506
519
  // ─── sentinel scanner ─────────────────────────────────────────────────────────
507
520
 
508
521
  /**
509
- * Scan for a `SCHEDULER_VERDICT: PASS|FAIL` sentinel line in the run output.
522
+ * Scan for a `SCHEDULER_VERDICT: PASS|FAIL|BLOCKED_BY_FOREIGN_WIP` sentinel
523
+ * line in the run output.
510
524
  *
511
525
  * Checks `resultEvent.resultText` first (the agent's final message), then the
512
526
  * last tool_result content. Anchored to line-start so prose mentioning the
513
527
  * string in mid-sentence does not match.
514
528
  *
515
- * Returns 'pass', 'fail', or null.
529
+ * Returns 'pass', 'fail', 'blocked_by_foreign_wip', or null.
516
530
  */
517
531
  function scanSentinel(resultEvent, events) {
518
- const RE = /^SCHEDULER_VERDICT:\s*(PASS|FAIL)\b/m;
532
+ const RE = /^SCHEDULER_VERDICT:\s*(PASS|FAIL|BLOCKED_BY_FOREIGN_WIP)\b/m;
519
533
 
520
534
  if (resultEvent) {
521
535
  const m = resultEvent.resultText.match(RE);
@@ -534,6 +548,44 @@ function scanSentinel(resultEvent, events) {
534
548
  return null;
535
549
  }
536
550
 
551
+ /**
552
+ * Scan for a `FOREIGN_WIP_PATHS: <comma-separated paths>` evidence line —
553
+ * the mandatory companion to a `SCHEDULER_VERDICT: BLOCKED_BY_FOREIGN_WIP`
554
+ * sentinel (see FINISH_PROTOCOL in scheduler.cjs). Same two-source scan order
555
+ * as scanSentinel (resultEvent.resultText, then the last tool_result) so the
556
+ * two scanners always agree on which "final say" they're reading from.
557
+ *
558
+ * Returns a deduplicated array of trimmed path strings (possibly empty — an
559
+ * executor that emits the verdict with no paths line, or an empty one, gives
560
+ * the caller nothing to validate, which the caller must treat as an invalid
561
+ * claim, not an empty-but-valid one).
562
+ */
563
+ function scanForeignWipPathsClaim(resultEvent, events) {
564
+ const RE = /^FOREIGN_WIP_PATHS:\s*(.+)$/m;
565
+
566
+ const parse = (text) => {
567
+ const m = typeof text === 'string' ? text.match(RE) : null;
568
+ if (!m) return null;
569
+ return [...new Set(m[1].split(',').map((p) => p.trim()).filter(Boolean))];
570
+ };
571
+
572
+ if (resultEvent) {
573
+ const paths = parse(resultEvent.resultText);
574
+ if (paths) return paths;
575
+ }
576
+
577
+ let lastToolResult = null;
578
+ for (const ev of events) {
579
+ if (ev.kind === 'tool_result') lastToolResult = ev;
580
+ }
581
+ if (lastToolResult) {
582
+ const paths = parse(lastToolResult.content);
583
+ if (paths) return paths;
584
+ }
585
+
586
+ return [];
587
+ }
588
+
537
589
  // ─── merge-main postcondition exemption ──────────────────────────────────────
538
590
 
539
591
  /**
@@ -853,6 +905,20 @@ async function verifyRun({ runDir, prdPath, queueEntry, allJobs = [], committedD
853
905
  // seen in 58-web-remote-correctness-batch, 2026-06-10).
854
906
  if (isHarnessToolError(ev.content)) continue;
855
907
 
908
+ // A PreToolUse policy denial (a guard hook blocked the call before it
909
+ // ran) is exempt from both the is_error scan and the content-pattern
910
+ // scan for the same reason as a harness tool error above — the denied
911
+ // call never executed. Unlike a harness tool error, record it as an
912
+ // annotation so the denial stays visible in the verdict record instead
913
+ // of vanishing silently.
914
+ if (isPolicyDenial(ev.content)) {
915
+ annotations.push({
916
+ verdict: 'policy_denial',
917
+ reason: `PreToolUse policy denial at event ${i}: ${ev.content.slice(0, 200)}`,
918
+ });
919
+ continue;
920
+ }
921
+
856
922
  // A tool_result carrying a non-null parent_tool_use_id happened INSIDE a Task
857
923
  // subagent's own execution, not in the main agent's. Subagents do ordinary
858
924
  // exploratory work (greps that exit 1 on no-match, ls on a path that may not
@@ -1147,6 +1213,7 @@ module.exports = {
1147
1213
  // Exposed for unit tests.
1148
1214
  detectPattern,
1149
1215
  isHarnessToolError,
1216
+ isPolicyDenial,
1150
1217
  isSelfRecovered,
1151
1218
  normalizeDescForRecovery,
1152
1219
  toolUseName,
@@ -1155,6 +1222,7 @@ module.exports = {
1155
1222
  checkDeps,
1156
1223
  parseLog,
1157
1224
  scanSentinel,
1225
+ scanForeignWipPathsClaim,
1158
1226
  isMergeMainSlug,
1159
1227
  extractMergeMainPrNumber,
1160
1228
  checkMergeablePr,
@@ -107,6 +107,13 @@ async function parsePrdRaw(filePath) {
107
107
  // quarantines it instead of queuing it to run.
108
108
  createdVia: fm.createdVia || null,
109
109
  issuedAt: fm.issuedAt || null,
110
+ // Explicit fix-plan provenance stamp (PRD 1131) — written only by
111
+ // spawnInvestigation's own prompt template (see scheduler.cjs's
112
+ // buildInvestigationPrompt). Only a literal `true` opts in, matching
113
+ // quietMachine's parse semantics below; reconcile() is the sole reader
114
+ // that turns this (plus createdVia's absence) into a fix-plan verdict —
115
+ // see lib/fixPlanSlug.cjs's classifyDiscoveredFixPlan.
116
+ isFixPlan: fm.isFixPlan === 'true',
110
117
  // WHO executes this PRD (persona name) — distinct from `tag` (work
111
118
  // type). Absent on every PRD authored before this field existed; the
112
119
  // dependent follow-up PRD (scheduler-launch-as-persona) resolves this