claude-code-session-manager 0.76.0 → 0.77.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 (123) hide show
  1. package/dist/assets/{AgentLibrary-CBx9l4zN.js → AgentLibrary-B2ie8bbw.js} +2 -2
  2. package/dist/assets/{DataModel-Bf0EIE_t.js → DataModel-BIJPYw32.js} +1 -1
  3. package/dist/assets/{History-CpdtWhC8.js → History-CeY6dk9S.js} +2 -2
  4. package/dist/assets/{Hooks-DyUbMDmg.js → Hooks-BFH2ocKg.js} +2 -2
  5. package/dist/assets/{HostBilko-By-wIpry.js → HostBilko-36gj9wLz.js} +1 -1
  6. package/dist/assets/{Library-CQmo4QVC.js → Library-C-hBct39.js} +1 -1
  7. package/dist/assets/{ListDetail-BQMd6NOm.js → ListDetail-CNq64VWV.js} +1 -1
  8. package/dist/assets/{MarkdownEditor-DEp43FXX.js → MarkdownEditor-Bh3qt5-1.js} +1 -1
  9. package/dist/assets/{McpServers-CLarzwqA.js → McpServers-DpGN0oyz.js} +1 -1
  10. package/dist/assets/{Memory-B0sCdIy1.js → Memory-D59hUjC4.js} +6 -6
  11. package/dist/assets/{Panel-BhWPVOCD.js → Panel-DCgbaoci.js} +1 -1
  12. package/dist/assets/{Permissions-Ddlq8T_O.js → Permissions-DAmQ0DYV.js} +2 -2
  13. package/dist/assets/{Plugins-D2oA_2Jl.js → Plugins-Dyfgn6Is.js} +2 -2
  14. package/dist/assets/{ProvenanceBadge-DgAgavUM.js → ProvenanceBadge-BiYhPO1U.js} +1 -1
  15. package/dist/assets/SaveBar-RV7B6sOh.js +1 -0
  16. package/dist/assets/Scheduler-BPaNqx1b.js +14 -0
  17. package/dist/assets/{ScopeSwitcher-C_zWEtIl.js → ScopeSwitcher-P4mdLGNU.js} +1 -1
  18. package/dist/assets/{Settings-2Vx3X5SI.js → Settings-BL4vf5aX.js} +1 -1
  19. package/dist/assets/{SkillReferenceGraph-BDEUjlTQ.js → SkillReferenceGraph-BRBDyi1_.js} +1 -1
  20. package/dist/assets/{Skills-Cmrz_LeN.js → Skills-BV08gDUH.js} +2 -2
  21. package/dist/assets/{SystemPrompt-DVA1eYDP.js → SystemPrompt-CLftSsDw.js} +1 -1
  22. package/dist/assets/TagLibrary-Bp8jGsd5.js +1 -0
  23. package/dist/assets/{TiptapBody-DmPc3amD.js → TiptapBody-jCpuB6E5.js} +1 -1
  24. package/dist/assets/{Toggle-zfd5LJkK.js → Toggle-D2paA1xf.js} +1 -1
  25. package/dist/assets/{index-B_4PNh9T.js → index-BDRSqBl3.js} +175 -175
  26. package/dist/assets/{index-DIjnPkRN.css → index-CYhdtisq.css} +1 -1
  27. package/dist/assets/{settingsSchema-B9es6fdA.js → settingsSchema-6IOLjZZN.js} +1 -1
  28. package/dist/index.html +2 -2
  29. package/package.json +8 -2
  30. package/plugins/session-manager-dev/skills/develop/standards.md +1 -1
  31. package/scripts/project-pages-logic/dist/logic.cjs +4709 -0
  32. package/scripts/render-project-pages/dist/renderer.cjs +18900 -0
  33. package/scripts/render-project-pages.cjs +70 -0
  34. package/scripts/scheduler-mcp-server.cjs +115 -1
  35. package/scripts/validate-project-pages-summary.cjs +62 -0
  36. package/src/main/__tests__/agentModelResolve.test.cjs +66 -0
  37. package/src/main/__tests__/health-delegation-chain.test.cjs +2 -1
  38. package/src/main/__tests__/prdAgentType.test.cjs +103 -0
  39. package/src/main/__tests__/prdCreate.test.cjs +138 -0
  40. package/src/main/__tests__/prdFrontmatterAgentType.test.cjs +117 -0
  41. package/src/main/__tests__/prdFrontmatterQuietMachine.test.cjs +108 -0
  42. package/src/main/__tests__/projectHomeAdminRoutes.test.cjs +485 -0
  43. package/src/main/__tests__/projectPages.test.cjs +73 -1
  44. package/src/main/__tests__/rcaReport.test.cjs +54 -0
  45. package/src/main/__tests__/runVerify.test.cjs +94 -0
  46. package/src/main/__tests__/scheduler-autofix-select.test.cjs +43 -0
  47. package/src/main/__tests__/scheduler-bash-timeout-env.test.cjs +103 -0
  48. package/src/main/__tests__/scheduler-effective-concurrency.test.cjs +10 -0
  49. package/src/main/__tests__/scheduler-foreign-wip-manifest.test.cjs +78 -0
  50. package/src/main/__tests__/scheduler-inplace-salvage.test.cjs +242 -0
  51. package/src/main/__tests__/scheduler-investigation-prompt.test.cjs +31 -0
  52. package/src/main/__tests__/scheduler-launch-failure.test.cjs +201 -0
  53. package/src/main/__tests__/scheduler-leftover-fields.test.cjs +52 -0
  54. package/src/main/__tests__/scheduler-looks-done.test.cjs +241 -0
  55. package/src/main/__tests__/scheduler-prd-persona-spawn.test.cjs +135 -0
  56. package/src/main/__tests__/scheduler-quiet-machine-lease.test.cjs +222 -0
  57. package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +147 -0
  58. package/src/main/__tests__/scheduler-shared-tree-guard.test.cjs +212 -0
  59. package/src/main/__tests__/scheduler-worktree-cap-defer.test.cjs +194 -0
  60. package/src/main/__tests__/seedAgentPersonas.test.cjs +75 -14
  61. package/src/main/config.cjs +4 -1
  62. package/src/main/index.cjs +8 -1
  63. package/src/main/ipcSchemas.cjs +51 -0
  64. package/src/main/lib/__tests__/childWithLog.test.cjs +78 -0
  65. package/src/main/lib/__tests__/delegationReadiness.test.cjs +152 -2
  66. package/src/main/lib/__tests__/epicWorktreeMint.test.cjs +4 -2
  67. package/src/main/lib/__tests__/fixChainDepth.test.cjs +40 -0
  68. package/src/main/lib/__tests__/gitWorktree.test.cjs +277 -4
  69. package/src/main/lib/__tests__/gitWorktreeSalvageDelta.test.cjs +153 -0
  70. package/src/main/lib/__tests__/jobWorktree.test.cjs +5 -3
  71. package/src/main/lib/__tests__/landedSinceRun.test.cjs +73 -0
  72. package/src/main/lib/__tests__/launchFailure.test.cjs +220 -0
  73. package/src/main/lib/__tests__/mcpToolCatalog.test.cjs +1 -0
  74. package/src/main/lib/__tests__/opsOwnership.test.cjs +7 -0
  75. package/src/main/lib/__tests__/prdDeclaredPaths.test.cjs +82 -0
  76. package/src/main/lib/__tests__/queueHealth.test.cjs +58 -0
  77. package/src/main/lib/__tests__/quietMachineLease.test.cjs +39 -0
  78. package/src/main/lib/__tests__/reaperHelpers.test.cjs +22 -1
  79. package/src/main/lib/__tests__/schedulerBatchLaunchHold.test.cjs +125 -0
  80. package/src/main/lib/__tests__/schedulerBatchQuietMachine.test.cjs +109 -0
  81. package/src/main/lib/__tests__/schedulerMcpServerHeadlessRefusal.test.cjs +71 -0
  82. package/src/main/lib/__tests__/schedulerMcpServerProjectHome.test.cjs +350 -0
  83. package/src/main/lib/agentModelResolve.cjs +58 -0
  84. package/src/main/lib/childWithLog.cjs +40 -5
  85. package/src/main/lib/claudeBin.cjs +54 -1
  86. package/src/main/lib/definitionOfDone.cjs +3 -2
  87. package/src/main/lib/delegationReadiness.cjs +115 -9
  88. package/src/main/lib/epicWorktreeMint.cjs +5 -2
  89. package/src/main/lib/fixChainDepth.cjs +45 -0
  90. package/src/main/lib/gitWorktree.cjs +464 -19
  91. package/src/main/lib/jobWorktree.cjs +1 -0
  92. package/src/main/lib/landedSinceRun.cjs +55 -0
  93. package/src/main/lib/launchFailure.cjs +357 -0
  94. package/src/main/lib/mcpToolCatalog.cjs +87 -2
  95. package/src/main/lib/opsOwnership.cjs +12 -0
  96. package/src/main/lib/prdAgentType.cjs +84 -0
  97. package/src/main/lib/prdCreate.cjs +57 -1
  98. package/src/main/lib/prdDeclaredPaths.cjs +70 -0
  99. package/src/main/lib/prdFrontmatter.cjs +17 -3
  100. package/src/main/lib/projectHomeAdminRoutes.cjs +402 -0
  101. package/src/main/lib/projectPageSummarySchema.cjs +181 -0
  102. package/src/main/lib/queueHealth.cjs +38 -0
  103. package/src/main/lib/queueStore.cjs +9 -2
  104. package/src/main/lib/quietMachineLease.cjs +48 -0
  105. package/src/main/lib/rcaReport.cjs +53 -3
  106. package/src/main/lib/reaperHelpers.cjs +18 -1
  107. package/src/main/lib/scheduleJobSchema.cjs +31 -0
  108. package/src/main/lib/scheduleJobTransitions.cjs +6 -2
  109. package/src/main/lib/schedulerBatch.cjs +133 -29
  110. package/src/main/lib/schedulerConfig.cjs +19 -0
  111. package/src/main/projectPages.cjs +160 -2
  112. package/src/main/runVerify.cjs +50 -9
  113. package/src/main/scheduler/prdParser.cjs +18 -1
  114. package/src/main/scheduler.cjs +1371 -97
  115. package/src/main/seedAgentPersonas.cjs +62 -21
  116. package/src/main/templates/project-pages-catalog.json +741 -0
  117. package/src/main/templates/project-pages-pipeline.md +417 -0
  118. package/src/preload/api.d.ts +118 -2
  119. package/src/preload/index.cjs +7 -0
  120. package/src/seed/agents/project-home-builder.md +59 -0
  121. package/dist/assets/SaveBar-Qvc4Ek-H.js +0 -1
  122. package/dist/assets/Scheduler-BmYJvNzK.js +0 -14
  123. package/dist/assets/TagLibrary-DYJGAKZu.js +0 -1
@@ -0,0 +1,117 @@
1
+ /**
2
+ * prdFrontmatterAgentType.test.cjs — PRD 1114: `agentType` (WHO executes a
3
+ * PRD, distinct from `tag` — the WORK TYPE) is a recognized PRD frontmatter
4
+ * key, round-tripped byte-identically by prdFrontmatter.cjs's
5
+ * parsePrdFile/serializePrdFile pair, and surfaced (with read-time tolerance
6
+ * for a dangling persona) by scheduler/prdParser.cjs's parsePrdRaw.
7
+ *
8
+ * Run: timeout 120 npx vitest run src/main/__tests__/prdFrontmatterAgentType.test.cjs
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ import { test, expect } from 'vitest';
14
+
15
+ const fs = require('node:fs');
16
+ const fsp = require('node:fs/promises');
17
+ const os = require('node:os');
18
+ const path = require('node:path');
19
+
20
+ const { parsePrdFile, serializePrdFile } = require('../lib/prdFrontmatter.cjs');
21
+ const { parsePrdRaw, _resetCache } = require('../scheduler/prdParser.cjs');
22
+ const { todayFile } = require('../lib/opsErrorLog.cjs');
23
+
24
+ function mkTmpPrdsDir() {
25
+ return fsp.mkdtemp(path.join(os.tmpdir(), 'sm-prd-agenttype-fm-'));
26
+ }
27
+
28
+ test('parsePrdFile recognizes agentType and serializePrdFile round-trips it byte-identically', () => {
29
+ const raw = [
30
+ '---',
31
+ 'title: A PRD with a persona',
32
+ 'cwd: ~/Projects/session-manager',
33
+ 'estimateMinutes: 30',
34
+ 'tag: bug',
35
+ 'agentType: dev-lead',
36
+ '---',
37
+ '# Goal',
38
+ '',
39
+ 'Fix the thing.',
40
+ '',
41
+ ].join('\n');
42
+
43
+ const { frontmatter, body } = parsePrdFile(raw);
44
+ expect(frontmatter.agentType).toBe('dev-lead');
45
+ expect(serializePrdFile(frontmatter, body)).toBe(raw);
46
+ });
47
+
48
+ test('parsePrdFile leaves agentType undefined when omitted — additive-only, no regression for old PRDs', () => {
49
+ const raw = [
50
+ '---',
51
+ 'title: An older PRD authored before this field existed',
52
+ 'cwd: ~/Projects/session-manager',
53
+ 'estimateMinutes: 30',
54
+ '---',
55
+ 'body',
56
+ '',
57
+ ].join('\n');
58
+ const { frontmatter } = parsePrdFile(raw);
59
+ expect(frontmatter.agentType).toBeUndefined();
60
+ });
61
+
62
+ // Real opsErrorLog write path (not a mock) — see prdAgentType.test.cjs's
63
+ // header for why a plain mkdtemp() cwd is safe to use here (not "ephemeral").
64
+ test('scheduler/prdParser.cjs parsePrdRaw exposes agentType, and tolerates a dangling persona by logging once instead of throwing', async () => {
65
+ const dir = await mkTmpPrdsDir();
66
+ _resetCache();
67
+
68
+ const danglingPath = path.join(dir, '1-dangling.md');
69
+ await fsp.writeFile(danglingPath, [
70
+ '---',
71
+ 'title: A PRD whose persona was later deleted',
72
+ `cwd: ${dir}`,
73
+ 'estimateMinutes: 10',
74
+ 'agentType: ghost-persona-that-does-not-exist-anywhere',
75
+ '---',
76
+ '# Goal',
77
+ '',
78
+ 'Still loads.',
79
+ '',
80
+ ].join('\n'));
81
+
82
+ const parsed = await parsePrdRaw(danglingPath);
83
+ expect(parsed.agentType).toBe('ghost-persona-that-does-not-exist-anywhere');
84
+
85
+ const lines = fs.readFileSync(todayFile(dir), 'utf8').split('\n').filter(Boolean).map((l) => JSON.parse(l));
86
+ const matches = lines.filter((l) => l.message.includes('ghost-persona-that-does-not-exist-anywhere'));
87
+ expect(matches).toHaveLength(1);
88
+ expect(matches[0].scope).toBe('prdAgentType');
89
+ expect(matches[0].level).toBe('warn');
90
+
91
+ // A second parse of the SAME (cwd, agentType) pair must not log again.
92
+ _resetCache();
93
+ await parsePrdRaw(danglingPath);
94
+ const linesAfter = fs.readFileSync(todayFile(dir), 'utf8').split('\n').filter(Boolean);
95
+ expect(linesAfter).toHaveLength(1);
96
+ });
97
+
98
+ test('scheduler/prdParser.cjs parsePrdRaw leaves agentType null when omitted', async () => {
99
+ const dir = await mkTmpPrdsDir();
100
+ _resetCache();
101
+
102
+ const ordinaryPath = path.join(dir, '2-ordinary.md');
103
+ await fsp.writeFile(ordinaryPath, [
104
+ '---',
105
+ 'title: Ordinary job',
106
+ `cwd: ${dir}`,
107
+ 'estimateMinutes: 10',
108
+ '---',
109
+ '# Goal',
110
+ '',
111
+ 'Do the thing.',
112
+ '',
113
+ ].join('\n'));
114
+
115
+ const parsed = await parsePrdRaw(ordinaryPath);
116
+ expect(parsed.agentType).toBeNull();
117
+ });
@@ -0,0 +1,108 @@
1
+ /**
2
+ * prdFrontmatterQuietMachine.test.cjs — PRD 1107: `quietMachine: true` is an
3
+ * optional PRD frontmatter field, recognized by prdFrontmatter.cjs's
4
+ * parsePrdFile/serializePrdFile round-trip AND by scheduler/prdParser.cjs's
5
+ * dispatch-time parsePrdRaw. Only a literal `true` opts in; omitted or any
6
+ * other value behaves exactly like today (additive-only, no required-field
7
+ * regression for the thousands of PRDs written before this field existed).
8
+ *
9
+ * Run: timeout 120 npx vitest run src/main/__tests__/prdFrontmatterQuietMachine.test.cjs
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ import { test, expect } from 'vitest';
15
+ const fsp = require('node:fs/promises');
16
+ const os = require('node:os');
17
+ const path = require('node:path');
18
+
19
+ const { parsePrdFile, serializePrdFile } = require('../lib/prdFrontmatter.cjs');
20
+ const { parsePrdRaw, _resetCache } = require('../scheduler/prdParser.cjs');
21
+
22
+ function mkTmpPrdsDir() {
23
+ return fsp.mkdtemp(path.join(os.tmpdir(), 'sm-prd-quietmachine-'));
24
+ }
25
+
26
+ test('parsePrdFile recognizes quietMachine: true and serializePrdFile round-trips it byte-identically', () => {
27
+ const raw = [
28
+ '---',
29
+ 'title: A timing-sensitive PRD',
30
+ 'cwd: ~/Projects/session-manager',
31
+ 'estimateMinutes: 30',
32
+ 'quietMachine: true',
33
+ '---',
34
+ '# Goal',
35
+ '',
36
+ 'Measure frame time without contention.',
37
+ '',
38
+ ].join('\n');
39
+
40
+ const { frontmatter, body } = parsePrdFile(raw);
41
+ expect(frontmatter.quietMachine).toBe(true);
42
+ expect(serializePrdFile(frontmatter, body)).toBe(raw);
43
+ });
44
+
45
+ test('parsePrdFile ignores quietMachine: false — only a literal true opts in', () => {
46
+ const raw = [
47
+ '---',
48
+ 'title: Not opted in',
49
+ 'cwd: ~/Projects/session-manager',
50
+ 'estimateMinutes: 30',
51
+ 'quietMachine: false',
52
+ '---',
53
+ 'body',
54
+ '',
55
+ ].join('\n');
56
+ const { frontmatter } = parsePrdFile(raw);
57
+ expect(frontmatter.quietMachine).toBeUndefined();
58
+ });
59
+
60
+ test('parsePrdFile leaves quietMachine undefined when omitted — additive-only, no regression for old PRDs', () => {
61
+ const raw = [
62
+ '---',
63
+ 'title: An older PRD authored before this field existed',
64
+ 'cwd: ~/Projects/session-manager',
65
+ 'estimateMinutes: 30',
66
+ '---',
67
+ 'body',
68
+ '',
69
+ ].join('\n');
70
+ const { frontmatter } = parsePrdFile(raw);
71
+ expect(frontmatter.quietMachine).toBeUndefined();
72
+ });
73
+
74
+ test('scheduler/prdParser.cjs parsePrdRaw exposes quietMachine as a typed boolean, true only when the frontmatter literally says true', async () => {
75
+ const dir = await mkTmpPrdsDir();
76
+ _resetCache();
77
+
78
+ const quietPath = path.join(dir, '1-quiet.md');
79
+ await fsp.writeFile(quietPath, [
80
+ '---',
81
+ 'title: Quiet job',
82
+ 'cwd: ~/Projects/session-manager',
83
+ 'estimateMinutes: 10',
84
+ 'quietMachine: true',
85
+ '---',
86
+ '# Goal',
87
+ '',
88
+ 'Do the thing quietly.',
89
+ '',
90
+ ].join('\n'));
91
+ const quiet = await parsePrdRaw(quietPath);
92
+ expect(quiet.quietMachine).toBe(true);
93
+
94
+ const ordinaryPath = path.join(dir, '2-ordinary.md');
95
+ await fsp.writeFile(ordinaryPath, [
96
+ '---',
97
+ 'title: Ordinary job',
98
+ 'cwd: ~/Projects/session-manager',
99
+ 'estimateMinutes: 10',
100
+ '---',
101
+ '# Goal',
102
+ '',
103
+ 'Do the thing.',
104
+ '',
105
+ ].join('\n'));
106
+ const ordinary = await parsePrdRaw(ordinaryPath);
107
+ expect(ordinary.quietMachine).toBe(false);
108
+ });