claude-code-session-manager 0.86.0 → 0.88.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 +26 -53
- package/dist/assets/AgentLibrary-BZ6IY2g1.js +3 -0
- package/dist/assets/{DataModel-Q4jhl24R.js → DataModel-dAoGAODX.js} +1 -1
- package/dist/assets/{History-Cj2FejEo.js → History-CF157HyX.js} +2 -2
- package/dist/assets/{Hooks-CaelQI6t.js → Hooks-CCPPipBk.js} +3 -3
- package/dist/assets/{HostBilko--v7cMR8I.js → HostBilko-Dlmz2m06.js} +1 -1
- package/dist/assets/{Library-DgI9oCCZ.js → Library-BaXcboWX.js} +1 -1
- package/dist/assets/{ListDetail-DYUZN-x-.js → ListDetail-CoUCzG5S.js} +1 -1
- package/dist/assets/MarkdownEditor-DTg3JlOT.js +1 -0
- package/dist/assets/{McpServers-ypCYURh3.js → McpServers-DdjY1sA3.js} +2 -2
- package/dist/assets/{Memory-C2qYp-3M.js → Memory-BJ3Jlw0C.js} +4 -4
- package/dist/assets/{Panel-Cj2kw-Zv.js → Panel-ygRSgc41.js} +1 -1
- package/dist/assets/Permissions-m0KAnccF.js +3 -0
- package/dist/assets/{Plugins-C1Vj8_dU.js → Plugins-CJRl6B3Q.js} +2 -2
- package/dist/assets/{ProvenanceBadge-DczPNM5U.js → ProvenanceBadge-w8cnlVvW.js} +1 -1
- package/dist/assets/{SaveBar-Cd_7U6Gb.js → SaveBar-BpyPcUIk.js} +1 -1
- package/dist/assets/Scheduler-D2ppxSfy.js +14 -0
- package/dist/assets/{ScopeSwitcher-DVSyI44-.js → ScopeSwitcher-EyuIwt-j.js} +1 -1
- package/dist/assets/Settings-BHSGGFEc.js +3 -0
- package/dist/assets/{SkillReferenceGraph-CUv1_Q2c.js → SkillReferenceGraph-BNaZ2JCF.js} +1 -1
- package/dist/assets/{Skills-C_YHkAy-.js → Skills-Dl3q75QV.js} +2 -2
- package/dist/assets/{SystemPrompt-B8R7T9xn.js → SystemPrompt-Bg6F-Cyp.js} +1 -1
- package/dist/assets/{TagLibrary-dj9YHWyy.js → TagLibrary-BSutflCy.js} +1 -1
- package/dist/assets/{TiptapBody-DnSBUjHE.js → TiptapBody-CXih4xrc.js} +1 -1
- package/dist/assets/{Toggle-CjV_BJn6.js → Toggle-2qtUHhA9.js} +1 -1
- package/dist/assets/{index-CXFQIPhO.js → index-B3emy2oI.js} +583 -583
- package/dist/assets/{index-CDo9xBR9.css → index-BHTX4OTc.css} +1 -1
- package/dist/assets/settingsSchema-CdzxaqwM.js +3 -0
- package/dist/assets/{whisperWorker-Dbia1OpC.js → whisperWorker-C7ZGQwKg.js} +7 -7
- package/dist/index.html +2 -2
- package/dist/vad/ort-wasm-simd-threaded.asyncify.mjs +106 -110
- package/dist/vad/ort-wasm-simd-threaded.asyncify.wasm +0 -0
- package/dist/vad/ort-wasm-simd-threaded.jsep.mjs +98 -98
- package/dist/vad/ort-wasm-simd-threaded.jsep.wasm +0 -0
- package/dist/vad/ort-wasm-simd-threaded.jspi.mjs +99 -102
- package/dist/vad/ort-wasm-simd-threaded.jspi.wasm +0 -0
- package/dist/vad/ort-wasm-simd-threaded.mjs +46 -46
- package/dist/vad/ort-wasm-simd-threaded.wasm +0 -0
- package/package.json +14 -17
- package/plugins/CLAUDE.md +61 -0
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/4-manual/SKILL.md +1 -1
- package/plugins/session-manager-dev/skills/ops-sweep/SKILL.md +1 -1
- package/scripts/README.md +59 -0
- package/scripts/audit-ops-hygiene.cjs +350 -0
- package/scripts/hooks/guard-destructive-git.cjs +10 -34
- package/scripts/hooks/guard-inline-implementation.cjs +14 -8
- package/scripts/hooks/guard-prd-writes.cjs +7 -36
- package/scripts/hooks/guard-self-schedule.cjs +175 -0
- package/scripts/ops-sweep.cjs +355 -0
- package/scripts/scheduler-mcp-server.cjs +35 -71
- package/src/main/__tests__/agentModelResolve.test.cjs +100 -9
- package/src/main/__tests__/bilkoHost-integration.test.cjs +3 -3
- package/src/main/__tests__/broadcastCoalescer.test.cjs +18 -0
- package/src/main/__tests__/chat-cancel-terminal.test.cjs +6 -9
- package/src/main/__tests__/chat-exit-close-race.test.cjs +3 -3
- package/src/main/__tests__/chat-mcp-consent-notice.test.cjs +4 -5
- package/src/main/__tests__/chat-queue.test.cjs +2 -2
- package/src/main/__tests__/chat-stop-signal.test.cjs +2 -2
- package/src/main/__tests__/dep-orphan-archive-health.test.cjs +77 -0
- package/src/main/__tests__/dod-batchkey.test.cjs +2 -2
- package/src/main/__tests__/dod-drain-hook.test.cjs +2 -2
- package/src/main/__tests__/dod-report.test.cjs +2 -2
- package/src/main/__tests__/dod-reverify.test.cjs +2 -2
- package/src/main/__tests__/epicMint.test.cjs +4 -4
- package/src/main/__tests__/exchanges.test.cjs +2 -2
- package/src/main/__tests__/extractJson.test.cjs +2 -2
- package/src/main/__tests__/files-reject-credentials.test.cjs +1 -1
- package/src/main/__tests__/fixtures/1218-fo-01-move-scripts-lib-into-src-main-lib.log +556 -0
- package/src/main/__tests__/health-build-freshness.test.cjs +39 -0
- package/src/main/__tests__/health-delegation-chain.test.cjs +17 -2
- package/src/main/__tests__/health-queue-dispatch.test.cjs +58 -7
- package/src/main/__tests__/health-tick-liveness.test.cjs +11 -3
- package/src/main/__tests__/health-usage-poller.test.cjs +70 -23
- package/src/main/__tests__/historyRollup.test.cjs +2 -2
- package/src/main/__tests__/kg-augment.test.cjs +2 -2
- package/src/main/__tests__/mcpStatus.test.cjs +2 -2
- package/src/main/__tests__/memoryAggregate.test.cjs +1 -1
- package/src/main/__tests__/memoryStale.test.cjs +1 -1
- package/src/main/__tests__/needsReviewLedger.test.cjs +162 -0
- package/src/main/__tests__/opsErrorLogTelemetryTap.test.cjs +28 -4
- package/src/main/__tests__/pollLoop-dispatch-on-failure.test.cjs +48 -4
- package/src/main/__tests__/prd-group-allocator.test.cjs +2 -2
- package/src/main/__tests__/prdAdminRouteParity.test.cjs +2 -0
- package/src/main/__tests__/prdAdminRoutes.test.cjs +14 -2
- package/src/main/__tests__/prdAuthoringSeed.test.cjs +39 -0
- package/src/main/__tests__/prdCreateDisposition.test.cjs +201 -0
- package/src/main/__tests__/prdFrontmatterDisposition.test.cjs +125 -0
- package/src/main/__tests__/prdLocations.test.cjs +100 -2
- package/src/main/__tests__/prdLocationsArchived.test.cjs +50 -1
- package/src/main/__tests__/prdSetDisposition.test.cjs +222 -0
- package/src/main/__tests__/proc-role-env.test.cjs +125 -0
- package/src/main/__tests__/procname-claude-spawn-sites.test.cjs +304 -0
- package/src/main/__tests__/procname-sm-processes.test.cjs +127 -0
- package/src/main/__tests__/projectHomeAdminRoutes.test.cjs +81 -401
- package/src/main/__tests__/projectPages.test.cjs +63 -149
- package/src/main/__tests__/queue-health-verdict.test.cjs +170 -0
- package/src/main/__tests__/queue-starvation-dispatch-driver.test.cjs +117 -20
- package/src/main/__tests__/queue-starvation-per-project.test.cjs +14 -2
- package/src/main/__tests__/queueHistory.test.cjs +65 -2
- package/src/main/__tests__/rateLimitPollerStreak.test.cjs +38 -3
- package/src/main/__tests__/reconcileTiming.test.cjs +135 -0
- package/src/main/__tests__/runVerify-landed-commit-outranks.test.cjs +181 -0
- package/src/main/__tests__/runVerify.test.cjs +5 -5
- package/src/main/__tests__/scheduleJobStatusDrift.test.cjs +3 -3
- package/src/main/__tests__/scheduleJobTransitions.test.cjs +103 -3
- package/src/main/__tests__/scheduler-adopted-run-supervision.test.cjs +143 -0
- package/src/main/__tests__/scheduler-autofix-select.test.cjs +2 -2
- package/src/main/__tests__/scheduler-autopromote.test.cjs +2 -2
- package/src/main/__tests__/scheduler-bash-timeout-env.test.cjs +3 -5
- package/src/main/__tests__/scheduler-boot-orphans.test.cjs +79 -98
- package/src/main/__tests__/scheduler-broadcast-reconcile.test.cjs +121 -0
- package/src/main/__tests__/scheduler-cross-project-batch.test.cjs +43 -0
- package/src/main/__tests__/scheduler-default-eligible-heal.test.cjs +161 -0
- package/src/main/__tests__/scheduler-dispatch-loop.test.cjs +58 -0
- package/src/main/__tests__/scheduler-epic-digest.test.cjs +3 -5
- package/src/main/__tests__/scheduler-force-tick-outcome.test.cjs +2 -2
- package/src/main/__tests__/scheduler-gate-shadow.test.cjs +119 -0
- package/src/main/__tests__/scheduler-guard-verdict-autoresolve.test.cjs +390 -0
- package/src/main/__tests__/scheduler-heartbeat-payload.test.cjs +80 -0
- package/src/main/__tests__/scheduler-inplace-salvage.test.cjs +25 -18
- package/src/main/__tests__/scheduler-investigation-prompt.test.cjs +4 -4
- package/src/main/__tests__/scheduler-job-budget.test.cjs +172 -0
- package/src/main/__tests__/scheduler-launch-failure.test.cjs +3 -5
- package/src/main/__tests__/scheduler-looks-done.test.cjs +119 -10
- package/src/main/__tests__/scheduler-manual-pause.test.cjs +118 -0
- package/src/main/__tests__/scheduler-meta-code-sha.test.cjs +26 -3
- package/src/main/__tests__/scheduler-porcelain-rename.test.cjs +164 -0
- package/src/main/__tests__/scheduler-prd-missing-skip.test.cjs +17 -2
- package/src/main/__tests__/scheduler-prd-persona-spawn.test.cjs +3 -5
- package/src/main/__tests__/scheduler-quiet-machine-lease.test.cjs +41 -6
- package/src/main/__tests__/scheduler-rate-limit-pause.test.cjs +62 -6
- package/src/main/__tests__/scheduler-rate-limit-spin-guard.test.cjs +3 -5
- package/src/main/__tests__/scheduler-reap-dead-running-jobs.test.cjs +182 -3
- package/src/main/__tests__/scheduler-reaper-helpers-basics.test.cjs +87 -0
- package/src/main/__tests__/scheduler-reconcile-cwd-preserve.test.cjs +100 -0
- package/src/main/__tests__/scheduler-reconcile-invalid-repair.test.cjs +3 -3
- package/src/main/__tests__/scheduler-reconcile-quarantine.test.cjs +4 -4
- package/src/main/__tests__/scheduler-shard-quarantine.test.cjs +110 -0
- package/src/main/__tests__/scheduler-shared-tree-guard.test.cjs +168 -0
- package/src/main/__tests__/scheduler-starve-escalation.test.cjs +18 -8
- package/src/main/__tests__/scheduler-stranded-autofix-park.test.cjs +245 -0
- package/src/main/__tests__/scheduler-supervisor-record.test.cjs +81 -0
- package/src/main/__tests__/scheduler-tick-cancel-token.test.cjs +2 -2
- package/src/main/__tests__/scheduler-tick-wedge.test.cjs +172 -0
- package/src/main/__tests__/scheduler-transient-failure.test.cjs +2 -2
- package/src/main/__tests__/scheduler-worktree-cap-defer.test.cjs +51 -11
- package/src/main/__tests__/scheduler-worktree-exec-cwd.test.cjs +3 -5
- package/src/main/__tests__/usageSingleFlight.test.cjs +157 -0
- package/src/main/__tests__/workTypeLibrary.test.cjs +1 -1
- package/src/main/bilkoHost.cjs +16 -7
- package/src/main/build-info.json +8 -0
- package/src/main/chatRunner.cjs +12 -7
- package/src/main/config.cjs +2 -3
- package/src/main/docEdit.cjs +4 -2
- package/src/main/health.cjs +268 -52
- package/src/main/heapSnapshot.cjs +2 -2
- package/src/main/historyAggregator.cjs +6 -1
- package/src/main/index.cjs +152 -50
- package/src/main/ipcSchemas.cjs +53 -17
- package/src/main/lib/__tests__/active-sessions.test.cjs +251 -0
- package/src/main/lib/__tests__/auditLog.test.cjs +38 -0
- package/src/main/lib/__tests__/bootSelfHeal.test.cjs +107 -0
- package/src/main/lib/__tests__/buildIdentity.test.cjs +121 -0
- package/src/main/lib/__tests__/cwdClassify.test.cjs +111 -0
- package/src/main/lib/__tests__/definitionOfDoneSequence.test.cjs +95 -0
- package/src/main/lib/__tests__/delegationReadiness.test.cjs +323 -44
- package/src/main/lib/__tests__/dispatchLoop.test.cjs +63 -0
- package/src/main/lib/__tests__/effectiveModelInfo.test.cjs +239 -0
- package/src/main/lib/__tests__/gateFixtures.json +20 -0
- package/src/main/lib/__tests__/gitWorktree.test.cjs +97 -1
- package/src/main/lib/__tests__/guardShims.test.cjs +151 -0
- package/src/main/lib/__tests__/instanceLock.test.cjs +93 -7
- package/src/main/lib/__tests__/jobSupervisorRecord.test.cjs +78 -0
- package/src/main/lib/__tests__/jobWorktreeBootLive.test.cjs +11 -0
- package/src/main/lib/__tests__/localAdminHttp.test.cjs +1 -1
- package/src/main/lib/__tests__/mcpToolCatalog.test.cjs +6 -1
- package/src/main/lib/__tests__/opsRootAbsoluteCwd.test.cjs +5 -5
- package/src/main/lib/__tests__/prdDisposition.test.cjs +224 -0
- package/src/main/lib/__tests__/procIdentity.test.cjs +119 -0
- package/src/main/lib/__tests__/procName.test.cjs +92 -0
- package/src/main/lib/__tests__/queueStoreMachineStateRecovery.test.cjs +67 -0
- package/src/main/lib/__tests__/reaperHelpers.test.cjs +179 -1
- package/src/main/lib/__tests__/schedulerMcpServerHelp.test.cjs +6 -7
- package/src/main/lib/__tests__/schedulerMcpServerProjectHome.test.cjs +37 -204
- package/src/main/lib/__tests__/schedulerPaths.test.cjs +226 -0
- package/src/main/lib/__tests__/schedulerPathsWorktree.test.cjs +94 -0
- package/src/main/lib/__tests__/schedulerRuntimeState.test.cjs +56 -0
- package/src/main/lib/__tests__/sessionSlots.test.cjs +45 -0
- package/src/main/lib/__tests__/telemetryBacklog.test.cjs +1 -1
- package/src/main/lib/__tests__/upgradeDrain.test.cjs +130 -0
- package/src/main/lib/__tests__/usageCircuit.test.cjs +285 -0
- package/src/main/lib/__tests__/watchdog-helpers.test.cjs +375 -0
- package/src/main/lib/__tests__/watchdog-relaunch.test.cjs +266 -0
- package/src/main/lib/activeIndexRebuild.cjs +1 -3
- package/{scripts → src/main}/lib/activeSessions.cjs +67 -89
- package/src/main/lib/adoptedRunSupervisor.cjs +136 -0
- package/src/main/lib/agentModelResolve.cjs +94 -24
- package/src/main/lib/agentPersonaSchema.cjs +2 -2
- package/src/main/lib/auditLog.cjs +30 -5
- package/src/main/lib/bootSelfHeal.cjs +88 -0
- package/src/main/lib/buildIdentity.cjs +113 -0
- package/src/main/lib/classifyPromptTicket.cjs +3 -2
- package/src/main/lib/claudeBin.cjs +37 -2
- package/src/main/lib/cleanEnv.cjs +27 -1
- package/src/main/lib/credentials.cjs +4 -2
- package/src/main/lib/cwdClassify.cjs +185 -0
- package/src/main/lib/definitionOfDone.cjs +296 -52
- package/src/main/lib/delegationReadiness.cjs +290 -225
- package/src/main/lib/dispatchLoop.cjs +40 -0
- package/src/main/lib/effectiveModelInfo.cjs +332 -0
- package/src/main/lib/ephemeralCwd.cjs +7 -28
- package/src/main/lib/epicMint.cjs +3 -3
- package/src/main/lib/gitWorktree.cjs +136 -19
- package/src/main/lib/guardShims.cjs +156 -0
- package/src/main/lib/historyRollup.cjs +6 -7
- package/src/main/lib/instanceLock.cjs +32 -5
- package/src/main/lib/jobDirtFilter.cjs +7 -2
- package/src/main/lib/jobSupervisorRecord.cjs +147 -0
- package/src/main/lib/jobWorktreeBootLive.cjs +9 -5
- package/src/main/lib/launchFailure.cjs +2 -1
- package/src/main/lib/localAdminHttp.cjs +9 -27
- package/src/main/lib/mcpToolCatalog.cjs +33 -78
- package/src/main/lib/needsReviewLedger.cjs +205 -0
- package/src/main/lib/opsErrorLog.cjs +1 -1
- package/src/main/lib/opsOwnership.cjs +27 -19
- package/src/main/lib/prdAuthoringSeed.cjs +36 -0
- package/src/main/lib/prdCreate.cjs +56 -1
- package/src/main/lib/prdDisposition.cjs +199 -0
- package/src/main/lib/prdFrontmatter.cjs +8 -2
- package/src/main/lib/prdLocations.cjs +214 -45
- package/src/main/lib/procIdentity.cjs +126 -0
- package/src/main/lib/procName.cjs +98 -0
- package/src/main/lib/projectHomeAdminRoutes.cjs +56 -327
- package/src/main/lib/projectRootResolve.cjs +1 -1
- package/src/main/lib/queueHistory.cjs +27 -8
- package/src/main/lib/queueStore.cjs +63 -38
- package/src/main/lib/quietMachineLease.cjs +19 -2
- package/src/main/lib/reaperHelpers.cjs +181 -15
- package/src/main/lib/reservationExpiry.cjs +30 -0
- package/src/main/lib/runClaudeP.cjs +4 -2
- package/src/main/lib/runLogRetention.cjs +3 -2
- package/src/main/lib/scheduleJobSchema.cjs +10 -2
- package/src/main/lib/scheduleJobTransitions.cjs +60 -0
- package/src/main/lib/schedulerBatch.cjs +27 -2
- package/src/main/lib/schedulerConfig.cjs +24 -0
- package/src/main/lib/schedulerPaths.cjs +175 -0
- package/src/main/lib/schedulerRuntimeState.cjs +59 -0
- package/src/main/lib/sessionSlots.cjs +47 -9
- package/src/main/lib/smProcNames.cjs +51 -0
- package/src/main/lib/upgradeDrain.cjs +188 -0
- package/src/main/lib/usageCircuit.cjs +206 -0
- package/{scripts → src/main}/lib/watchdogHelpers.cjs +71 -38
- package/src/main/lib/withTimeout.cjs +33 -0
- package/src/main/mcpStatus.cjs +4 -2
- package/src/main/pluginInstall.cjs +6 -2
- package/src/main/projectPages.cjs +41 -145
- package/src/main/pty.cjs +8 -1
- package/src/main/queueOps.cjs +10 -10
- package/src/main/runVerify.cjs +69 -3
- package/src/main/scheduler/prdParser.cjs +13 -0
- package/src/main/scheduler.cjs +2841 -482
- package/src/main/seedAgentPersonas.cjs +1 -1
- package/src/main/seedDevPlugin.cjs +1 -1
- package/src/main/seedSchedulerMcp.cjs +7 -6
- package/src/main/seedStatus.cjs +1 -1
- package/src/main/supervisor.cjs +5 -3
- package/src/main/templates/PRD_AUTHORING.md +50 -0
- package/src/main/usage.cjs +140 -58
- package/src/preload/api.d.ts +110 -65
- package/src/preload/index.cjs +12 -4
- package/src/seed/agents/project-home-builder.md +31 -48
- package/dist/assets/AgentLibrary-DTFL7y8G.js +0 -3
- package/dist/assets/MarkdownEditor-DCIubYWf.js +0 -1
- package/dist/assets/Permissions-BiYZNGYW.js +0 -3
- package/dist/assets/Scheduler-DcLBiJBq.js +0 -14
- package/dist/assets/Settings-Cv-pRyms.js +0 -3
- package/dist/assets/settingsSchema-BJVciriw.js +0 -3
- package/screenshots/.gitkeep +0 -0
- package/screenshots/README-screenshots.md +0 -13
- package/scripts/project-pages-logic/dist/logic.cjs +0 -4709
- package/scripts/render-project-pages/dist/renderer.cjs +0 -18900
- package/scripts/render-project-pages.cjs +0 -70
- package/scripts/validate-project-pages-summary.cjs +0 -62
- package/src/main/lib/projectPageSummarySchema.cjs +0 -181
- package/src/main/teams.cjs +0 -95
- package/src/main/templates/project-pages-catalog.json +0 -741
- package/src/main/templates/project-pages-default-home.html +0 -123
- package/src/main/templates/project-pages-pipeline.md +0 -417
- package/src/seed/prompts/code-review/ac-coverage-check.md +0 -8
- package/src/seed/prompts/code-review/correctness-only.md +0 -8
- package/src/seed/prompts/code-review/full-spectrum-high.md +0 -8
- package/src/seed/prompts/code-review/hallucination-check.md +0 -8
- package/src/seed/prompts/code-review/public-api-compat.md +0 -8
- package/src/seed/prompts/code-review/readability-naming.md +0 -8
- package/src/seed/prompts/debugging/bug-as-failing-test.md +0 -8
- package/src/seed/prompts/debugging/git-bisect-regression.md +0 -8
- package/src/seed/prompts/debugging/instrument-intermittent-bug.md +0 -8
- package/src/seed/prompts/debugging/localize-pipeline-failure.md +0 -8
- package/src/seed/prompts/debugging/reproduce-then-diagnose.md +0 -8
- package/src/seed/prompts/documentation/adr-from-change.md +0 -8
- package/src/seed/prompts/documentation/module-readme.md +0 -8
- package/src/seed/prompts/documentation/onboarding-plan.md +0 -8
- package/src/seed/prompts/documentation/refresh-claude-md.md +0 -8
- package/src/seed/prompts/documentation/tsdoc-public-exports.md +0 -8
- package/src/seed/prompts/git-pr/conventional-commit.md +0 -8
- package/src/seed/prompts/git-pr/draft-pr-title-body.md +0 -8
- package/src/seed/prompts/git-pr/pre-commit-safety-sweep.md +0 -8
- package/src/seed/prompts/git-pr/release-notes-block.md +0 -8
- package/src/seed/prompts/git-pr/split-large-pr.md +0 -8
- package/src/seed/prompts/performance/bundle-startup-audit.md +0 -8
- package/src/seed/prompts/performance/complexity-audit.md +0 -8
- package/src/seed/prompts/performance/cpu-profile-hot-path.md +0 -8
- package/src/seed/prompts/performance/db-query-plan-review.md +0 -8
- package/src/seed/prompts/performance/memory-leak-hunt.md +0 -8
- package/src/seed/prompts/qa/api-contract-tests.md +0 -8
- package/src/seed/prompts/qa/e2e-critical-path.md +0 -8
- package/src/seed/prompts/qa/failing-test-for-bug.md +0 -8
- package/src/seed/prompts/qa/find-missing-test-coverage.md +0 -8
- package/src/seed/prompts/qa/stabilize-flaky-test.md +0 -8
- package/src/seed/prompts/qa/tdd-red-first.md +0 -8
- package/src/seed/prompts/qa/visual-regression-review.md +0 -8
- package/src/seed/prompts/qa/wcag-axe-scan.md +0 -8
- package/src/seed/prompts/refactoring/dead-code-sweep.md +0 -8
- package/src/seed/prompts/refactoring/extract-duplicated-pattern.md +0 -8
- package/src/seed/prompts/refactoring/modernize-legacy-file.md +0 -8
- package/src/seed/prompts/refactoring/reduce-cyclomatic-complexity.md +0 -8
- package/src/seed/prompts/refactoring/tighten-module-boundaries.md +0 -8
- package/src/seed/prompts/security/authz-audit.md +0 -8
- package/src/seed/prompts/security/crypto-correctness.md +0 -8
- package/src/seed/prompts/security/cwe-top-25-hunt.md +0 -8
- package/src/seed/prompts/security/dependency-audit.md +0 -8
- package/src/seed/prompts/security/ipc-boundary-hardening.md +0 -8
- package/src/seed/prompts/security/owasp-top-10-staged-diff.md +0 -8
- package/src/seed/prompts/security/secret-credential-scan.md +0 -8
package/src/main/index.cjs
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
const { PROC_NAMES, setProcessTitle, inhibitHolderShell } = require('./lib/smProcNames.cjs');
|
|
2
|
+
// Self-describing `comm` in System Monitor (pn-03). process.argv is a JS copy
|
|
3
|
+
// made at startup, so the argv-memory overwrite below never affects the
|
|
4
|
+
// `process.argv.includes('--simple')` read further down.
|
|
5
|
+
setProcessTitle(PROC_NAMES.main);
|
|
1
6
|
const { app, BrowserWindow, ipcMain, dialog, Menu, session, systemPreferences, globalShortcut, shell, clipboard, powerSaveBlocker, protocol } = require('electron');
|
|
2
7
|
const { spawn, execFile, execFileSync } = require('node:child_process');
|
|
3
8
|
const path = require('node:path');
|
|
@@ -37,7 +42,12 @@ const epicWorktreeMint = require('./lib/epicWorktreeMint.cjs');
|
|
|
37
42
|
const epicWorktreeMerge = require('./lib/epicWorktreeMerge.cjs');
|
|
38
43
|
const epicWorktreeProjectConfig = require('./lib/epicWorktreeProjectConfig.cjs');
|
|
39
44
|
const agentLibrary = require('./agentLibrary.cjs');
|
|
40
|
-
const
|
|
45
|
+
const agentModelResolve = require('./lib/agentModelResolve.cjs');
|
|
46
|
+
const { resolveEffectiveModelInfo } = require('./lib/effectiveModelInfo.cjs');
|
|
47
|
+
const { checkDelegationReadiness, ensureGuardsInstalled, installPrdWriteGuard, installDestructiveGitGuard, installInlineImplementationGuard, installSelfScheduleGuard } = require('./lib/delegationReadiness.cjs');
|
|
48
|
+
const { resolveProjectContext } = require('./lib/projectRootResolve.cjs');
|
|
49
|
+
const upgradeDrain = require('./lib/upgradeDrain.cjs');
|
|
50
|
+
const { writeGuardShims } = require('./lib/guardShims.cjs');
|
|
41
51
|
const { MCP_TOOL_CATALOG, MCP_RECIPES } = require('./lib/mcpToolCatalog.cjs');
|
|
42
52
|
const { sendIfAlive } = require('./lib/sendToRenderer.cjs');
|
|
43
53
|
const { resolveBuildTarget } = require('./lib/buildTarget.cjs');
|
|
@@ -54,7 +64,6 @@ chatRunner.registerAdminRoute(adminHttp);
|
|
|
54
64
|
crossProjectFeedback.registerAdminRoute(adminHttp);
|
|
55
65
|
const supervisor = require('./supervisor.cjs');
|
|
56
66
|
const watchers = require('./watchers.cjs');
|
|
57
|
-
const teams = require('./teams.cjs');
|
|
58
67
|
const queueOps = require('./queueOps.cjs');
|
|
59
68
|
const pluginInstall = require('./pluginInstall.cjs');
|
|
60
69
|
const { seedDevPlugin } = require('./seedDevPlugin.cjs');
|
|
@@ -70,7 +79,7 @@ const telemetryConsent = require('./lib/telemetryConsent.cjs');
|
|
|
70
79
|
const { registerHistoryAggregatorHandlers, finalizeClosedDays, refreshIntradayToday } = require('./historyAggregator.cjs');
|
|
71
80
|
const runLogRetention = require('./lib/runLogRetention.cjs');
|
|
72
81
|
const { registerHistoryDashboardHandlers } = require('./historyDashboard.cjs');
|
|
73
|
-
const { tryAcquireLock, releaseLock, DEFAULT_LOCK_PATH } = require('
|
|
82
|
+
const { tryAcquireLock, releaseLock, DEFAULT_LOCK_PATH } = require('./lib/watchdogHelpers.cjs');
|
|
74
83
|
const schedulerConfig = require('./lib/schedulerConfig.cjs');
|
|
75
84
|
const memoryTool = require('./memoryTool.cjs');
|
|
76
85
|
const { registerMemoryAggregateIpc } = require('./memoryAggregate.cjs');
|
|
@@ -90,7 +99,8 @@ const { checkInsideHome, assertInsideHome } = require('./lib/insideHome.cjs');
|
|
|
90
99
|
const { openInEditor, openFileInEditor, openInFinder, openInTerminal } = require('./lib/openExternalApp.cjs');
|
|
91
100
|
const { rebuildActiveIndex } = require('./lib/activeIndexRebuild.cjs');
|
|
92
101
|
const { activeIndexPath: promptSessionsActiveIndexPath } = require('./lib/epicMint.cjs');
|
|
93
|
-
const { allProjectCwds } = require('
|
|
102
|
+
const { allProjectCwds } = require('./lib/activeSessions.cjs');
|
|
103
|
+
const { scheduleBootSelfHeal } = require('./lib/bootSelfHeal.cjs');
|
|
94
104
|
|
|
95
105
|
let mainWindow = null;
|
|
96
106
|
let rebooting = false;
|
|
@@ -130,7 +140,10 @@ function startSystemdInhibit() {
|
|
|
130
140
|
'--who=Claude Session Manager',
|
|
131
141
|
'--why=Scheduler polling and claude -p jobs must survive idle',
|
|
132
142
|
'--mode=block',
|
|
133
|
-
|
|
143
|
+
// sm-inhibit-hold: aliased shell so the permanent holder is attributable
|
|
144
|
+
// in System Monitor (its `sleep 5` child stays a bare `sleep`, parented
|
|
145
|
+
// under it). Falls back to plain /bin/sh if the alias can't be made.
|
|
146
|
+
inhibitHolderShell(), '-c', `while kill -0 ${process.pid} 2>/dev/null; do sleep 5; done`,
|
|
134
147
|
], { stdio: 'ignore', detached: false });
|
|
135
148
|
child.on('error', (e) => {
|
|
136
149
|
logs.writeLine({ scope: 'main', level: 'warn', message: 'systemd-inhibit spawn failed', meta: { error: e?.message } });
|
|
@@ -303,7 +316,26 @@ function relaunchViaNpx() {
|
|
|
303
316
|
return child;
|
|
304
317
|
}
|
|
305
318
|
|
|
306
|
-
|
|
319
|
+
/**
|
|
320
|
+
* rebootApp({force}) — restart is a REQUEST that drains first and never kills
|
|
321
|
+
* (lib/upgradeDrain.cjs): dispatch pauses, running jobs finish, then the
|
|
322
|
+
* scheduler's heartbeat-driven drain calls performReboot(). `force: true`
|
|
323
|
+
* keeps the old immediate behaviour (kills running executors) for humans who
|
|
324
|
+
* accept the cost.
|
|
325
|
+
*/
|
|
326
|
+
async function rebootApp({ force = false } = {}) {
|
|
327
|
+
if (force) {
|
|
328
|
+
logReboot('force reboot requested — immediate, not draining');
|
|
329
|
+
return performReboot();
|
|
330
|
+
}
|
|
331
|
+
const request = upgradeDrain.requestRestart({ reason: 'user-reboot', requestedBy: 'user' });
|
|
332
|
+
logReboot(`restart requested (drain first): ${request.requestedAt}`);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Registered as the scheduler's drain-complete exit path (zero running jobs).
|
|
336
|
+
scheduler.setRestartHandler(() => performReboot());
|
|
337
|
+
|
|
338
|
+
async function performReboot() {
|
|
307
339
|
ptyManager.killAll();
|
|
308
340
|
configMgr.closeAllWatchers();
|
|
309
341
|
closeAllProjectPagesWatchers();
|
|
@@ -338,6 +370,9 @@ async function rebootApp() {
|
|
|
338
370
|
return;
|
|
339
371
|
}
|
|
340
372
|
|
|
373
|
+
// Bounded-lifetime marker: the watchdog must not relaunch a second instance
|
|
374
|
+
// during this deliberate exit window (single-instance-lock race).
|
|
375
|
+
upgradeDrain.markRestarting();
|
|
341
376
|
let childOk = false;
|
|
342
377
|
try {
|
|
343
378
|
const child = relaunchViaNpx();
|
|
@@ -520,12 +555,88 @@ ipcMain.handle('agents:remove-override', async (_e, payload) => {
|
|
|
520
555
|
ipcMain.handle('agents:get-persona-body', validated(schemas.agentsGetPersonaBody, (payload) =>
|
|
521
556
|
agentLibrary.getPersonaBody(payload)));
|
|
522
557
|
|
|
558
|
+
// "What will this Epic's launch actually use for --model?" — the SAME
|
|
559
|
+
// resolver chatRunner.cjs's Chat-view launch calls in-process
|
|
560
|
+
// (agentModelResolve.cjs's resolveEpicModel), reached here so Terminal's
|
|
561
|
+
// launch (EpicTerminalPane.tsx, a renderer module with no fs access) agrees
|
|
562
|
+
// with Chat by calling the identical function rather than a second one that
|
|
563
|
+
// is merely supposed to. Never throws (resolveEpicModel's own contract).
|
|
564
|
+
ipcMain.handle('agents:resolve-epic-model', validated(schemas.agentsResolveEpicModel, (payload) =>
|
|
565
|
+
agentModelResolve.resolveEpicModel(payload)));
|
|
566
|
+
|
|
567
|
+
// "What will this Epic actually run as?" (PRD: effective-model-resolver) —
|
|
568
|
+
// persona alias + evidence-based concrete model id + provenance, for a given
|
|
569
|
+
// (cwd, agentType). Read-only observer; never affects what a launch resolves.
|
|
570
|
+
ipcMain.handle('agents:resolve-model-info', validated(schemas.agentsResolveModelInfo, (payload) =>
|
|
571
|
+
resolveEffectiveModelInfo(payload)));
|
|
572
|
+
|
|
523
573
|
// "Can this project actually delegate?" probe (PRD: delegation-readiness).
|
|
524
574
|
// Structured data over the preconditions for scheduler_create_prd being in an
|
|
525
575
|
// agent's tool list at all — surfacing it in the UI is a sibling PRD.
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
576
|
+
//
|
|
577
|
+
// Self-heals BEFORE computing the checks (PRD: guards-auto-install) — Fix It
|
|
578
|
+
// used to be the only call site for the three guard installers, so every
|
|
579
|
+
// project the human opened started red and demanded three manual clicks.
|
|
580
|
+
// ensureGuardsInstalled never rejects on its own, but it is still awaited
|
|
581
|
+
// inside a try/catch here so a future change to it can never turn this into
|
|
582
|
+
// a rejected IPC handler.
|
|
583
|
+
//
|
|
584
|
+
// `cwd` is normalized to its real project root via the SAME resolver
|
|
585
|
+
// prdAdminRoutes.cjs's session_manager_help readiness route already uses
|
|
586
|
+
// (projectRootResolve.cjs's resolveProjectContext) before either the install
|
|
587
|
+
// or the read-back check runs, so a worktree/ops-internal cwd can't install
|
|
588
|
+
// into one path while the banner reads another.
|
|
589
|
+
ipcMain.handle('app:delegation-readiness', validated(schemas.delegationReadinessCwd, async (payload) => {
|
|
590
|
+
const resolved = resolveProjectContext({ cwd: payload.cwd });
|
|
591
|
+
const cwd = resolved.cwd || payload.cwd;
|
|
592
|
+
try {
|
|
593
|
+
await ensureGuardsInstalled(cwd);
|
|
594
|
+
} catch { /* auto-install must never block the readiness probe itself */ }
|
|
595
|
+
return checkDelegationReadiness({ ...payload, cwd });
|
|
596
|
+
}));
|
|
597
|
+
|
|
598
|
+
// Every guard-install attempt is logged from MAIN, not the renderer — a
|
|
599
|
+
// press that never reaches this process (e.g. a renderer talking to an
|
|
600
|
+
// older main with no handler for the channel, Electron's own "No handler
|
|
601
|
+
// registered for ..." rejection) leaves no line here, which is exactly what
|
|
602
|
+
// makes it distinguishable from a press that reached main and failed. Uses
|
|
603
|
+
// opsErrorLog.appendError (the sole writer of the `logs` ops namespace) so
|
|
604
|
+
// the record lands in the project's own
|
|
605
|
+
// session-manager-operations/logs/errors-<date>.jsonl, same shape as every
|
|
606
|
+
// other structured error line.
|
|
607
|
+
function logGuardInstallAttempt(guard, cwd, outcome) {
|
|
608
|
+
const opsErrorLog = require('./lib/opsErrorLog.cjs');
|
|
609
|
+
opsErrorLog.appendError({
|
|
610
|
+
cwd,
|
|
611
|
+
scope: 'delegationReadinessGuardInstall',
|
|
612
|
+
level: outcome.ok ? 'info' : 'error',
|
|
613
|
+
message: outcome.ok
|
|
614
|
+
? `${guard} install ${outcome.action}`
|
|
615
|
+
: `${guard} install failed: ${outcome.error || 'unknown error'}`,
|
|
616
|
+
meta: { guard, ...outcome },
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
async function handleGuardInstall(guard, installFn, payload) {
|
|
621
|
+
// Normalized the SAME way the sibling app:delegation-readiness handler
|
|
622
|
+
// above normalizes cwd, before either installing or logging — without
|
|
623
|
+
// this, a worktree/ops-internal cwd installs the guard into an ephemeral
|
|
624
|
+
// `.claude/settings.json` that vanishes with the worktree (this repo's
|
|
625
|
+
// "Worktree cwd ops-root hazard" incident class), diverging from the
|
|
626
|
+
// main-tree root the readiness banner (and its own auto-heal path,
|
|
627
|
+
// ensureGuardsInstalled) actually reads.
|
|
628
|
+
const resolved = resolveProjectContext({ cwd: payload.cwd });
|
|
629
|
+
const cwd = resolved.cwd || payload.cwd;
|
|
630
|
+
const normalizedPayload = { ...payload, cwd };
|
|
631
|
+
try {
|
|
632
|
+
const result = await installFn(normalizedPayload);
|
|
633
|
+
logGuardInstallAttempt(guard, cwd, result);
|
|
634
|
+
return result;
|
|
635
|
+
} catch (err) {
|
|
636
|
+
logGuardInstallAttempt(guard, cwd, { ok: false, action: 'error', error: err?.message ?? String(err) });
|
|
637
|
+
throw err;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
529
640
|
|
|
530
641
|
// The three readiness checks with a sanctioned one-press install. Session
|
|
531
642
|
// Manager standardizes on the REFERENCE approach (absolute path to this
|
|
@@ -536,13 +647,16 @@ ipcMain.handle('app:delegation-readiness', validated(schemas.delegationReadiness
|
|
|
536
647
|
// header. inline-implementation-guard shares prd-write-guard's matcher, so
|
|
537
648
|
// its installer appends into that SAME matcher's `hooks` array instead.
|
|
538
649
|
ipcMain.handle('app:install-prd-write-guard', validated(schemas.delegationReadinessCwd, (payload) =>
|
|
539
|
-
installPrdWriteGuard
|
|
650
|
+
handleGuardInstall('prd-write-guard', installPrdWriteGuard, payload)
|
|
540
651
|
));
|
|
541
652
|
ipcMain.handle('app:install-destructive-git-guard', validated(schemas.delegationReadinessCwd, (payload) =>
|
|
542
|
-
installDestructiveGitGuard
|
|
653
|
+
handleGuardInstall('destructive-git-guard', installDestructiveGitGuard, payload)
|
|
543
654
|
));
|
|
544
655
|
ipcMain.handle('app:install-inline-implementation-guard', validated(schemas.delegationReadinessCwd, (payload) =>
|
|
545
|
-
installInlineImplementationGuard
|
|
656
|
+
handleGuardInstall('inline-implementation-guard', installInlineImplementationGuard, payload)
|
|
657
|
+
));
|
|
658
|
+
ipcMain.handle('app:install-self-schedule-guard', validated(schemas.delegationReadinessCwd, (payload) =>
|
|
659
|
+
handleGuardInstall('self-schedule-guard', installSelfScheduleGuard, payload)
|
|
546
660
|
));
|
|
547
661
|
|
|
548
662
|
ipcMain.handle('app:engage-rules-path', () => process.env.SESSION_MANAGER_ENGAGE_RULES || null);
|
|
@@ -570,7 +684,7 @@ ipcMain.handle('app:pick-directory', async () => {
|
|
|
570
684
|
return result.filePaths[0];
|
|
571
685
|
});
|
|
572
686
|
|
|
573
|
-
ipcMain.on('app:reboot-app', () => rebootApp());
|
|
687
|
+
ipcMain.on('app:reboot-app', (_e, opts) => { rebootApp({ force: opts?.force === true }).catch((e) => logReboot(`reboot failed: ${e?.message}`)); });
|
|
574
688
|
|
|
575
689
|
// Image paste — Ctrl+V in the Terminal pane. Reads the OS clipboard via
|
|
576
690
|
// Electron's native API (renderer's navigator.clipboard.read() doesn't expose
|
|
@@ -845,7 +959,6 @@ voiceHotkey.registerHotkeyHandlers();
|
|
|
845
959
|
voiceWizard.registerWizardHandlers();
|
|
846
960
|
scheduler.registerScheduleHandlers();
|
|
847
961
|
watchers.registerWatcherHandlers();
|
|
848
|
-
teams.registerTeamsHandlers();
|
|
849
962
|
queueOps.registerQueueOpsHandlers({ retireCompletedSlugs: scheduler.retireCompletedSlugs });
|
|
850
963
|
registerHistoryAggregatorHandlers();
|
|
851
964
|
registerHistoryDashboardHandlers();
|
|
@@ -1164,6 +1277,7 @@ app.whenReady().then(async () => {
|
|
|
1164
1277
|
|
|
1165
1278
|
const heapSnapshotMenuItem = heapSnapshot.buildMenuItem(() => mainWindow);
|
|
1166
1279
|
|
|
1280
|
+
// Application menu rules + rationale: session-manager-operations/architecture/application-menu.md
|
|
1167
1281
|
const template = [
|
|
1168
1282
|
{
|
|
1169
1283
|
label: 'Session Manager',
|
|
@@ -1180,7 +1294,7 @@ app.whenReady().then(async () => {
|
|
|
1180
1294
|
{
|
|
1181
1295
|
label: 'Restart Session Manager App',
|
|
1182
1296
|
accelerator: 'CmdOrCtrl+Shift+R',
|
|
1183
|
-
click: rebootApp,
|
|
1297
|
+
click: () => { rebootApp().catch((e) => logReboot(`reboot failed: ${e?.message}`)); },
|
|
1184
1298
|
},
|
|
1185
1299
|
{
|
|
1186
1300
|
label: 'Restart Terminal in Active Tab',
|
|
@@ -1274,42 +1388,22 @@ app.whenReady().then(async () => {
|
|
|
1274
1388
|
seedSchedulerMcp({ logger: console, writeLog: logs.writeLine }).catch((e) => {
|
|
1275
1389
|
logs.writeLine({ scope: 'seed-scheduler-mcp', level: 'error', message: 'seed failed', meta: { error: e?.message } });
|
|
1276
1390
|
});
|
|
1391
|
+
// Rewrite the stable guard-hook shims (~/.claude/session-manager/hooks/) to
|
|
1392
|
+
// point at THIS running app's root, on every boot. An already-installed
|
|
1393
|
+
// project hook resolves through the shim at invocation time, so an app
|
|
1394
|
+
// upgrade (a new npx hash dir) just follows along with no re-install — see
|
|
1395
|
+
// guardShims.cjs's header.
|
|
1396
|
+
writeGuardShims().catch((e) => {
|
|
1397
|
+
logs.writeLine({ scope: 'guard-shims', level: 'error', message: 'writeGuardShims failed', meta: { error: e?.message } });
|
|
1398
|
+
});
|
|
1277
1399
|
// Epic index self-heal: a project whose active-index.json is MISSING or
|
|
1278
1400
|
// fails to parse has lost every open Epic's status unless the per-Epic
|
|
1279
|
-
// status mirror (epicStatusMirror.cjs) can rebuild it. Runs once per boot
|
|
1280
|
-
//
|
|
1281
|
-
//
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
let unclean = false;
|
|
1286
|
-
let parseError = null;
|
|
1287
|
-
if (!fs.existsSync(indexPath)) {
|
|
1288
|
-
unclean = true;
|
|
1289
|
-
} else {
|
|
1290
|
-
try {
|
|
1291
|
-
JSON.parse(fs.readFileSync(indexPath, 'utf8'));
|
|
1292
|
-
} catch (e) {
|
|
1293
|
-
unclean = true;
|
|
1294
|
-
parseError = e.message;
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
if (!unclean) continue;
|
|
1298
|
-
try {
|
|
1299
|
-
const { rows, skipped } = rebuildActiveIndex(projectCwd);
|
|
1300
|
-
logs.writeLine({
|
|
1301
|
-
scope: 'active-index-rebuild',
|
|
1302
|
-
level: 'info',
|
|
1303
|
-
message: 'rebuilt active-index.json from status mirrors',
|
|
1304
|
-
meta: { cwd: projectCwd, parseError, restored: rows.length, skipped: skipped.length },
|
|
1305
|
-
});
|
|
1306
|
-
} catch (e) {
|
|
1307
|
-
logs.writeLine({ scope: 'active-index-rebuild', level: 'error', message: 'rebuild failed', meta: { cwd: projectCwd, error: e?.message } });
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
} catch (e) {
|
|
1311
|
-
logs.writeLine({ scope: 'active-index-rebuild', level: 'error', message: 'boot sweep failed', meta: { error: e?.message } });
|
|
1312
|
-
}
|
|
1401
|
+
// status mirror (epicStatusMirror.cjs) can rebuild it. Runs once per boot
|
|
1402
|
+
// and only touches a project whose index reads unclean — a clean index is
|
|
1403
|
+
// never rewritten. Deferred until the window paints (did-finish-load) so
|
|
1404
|
+
// the ~270ms allProjectCwds() scan doesn't compete with the renderer's
|
|
1405
|
+
// first IPC round trips for the event loop — see bootSelfHeal.cjs.
|
|
1406
|
+
scheduleBootSelfHeal(mainWindow, { fs, allProjectCwds, promptSessionsActiveIndexPath, rebuildActiveIndex, logs });
|
|
1313
1407
|
// History rollup finalize pass: deferred 30s past boot so it never competes
|
|
1314
1408
|
// with first-paint, fire-and-forget (cron/offline refresh is PRD 651 — this
|
|
1315
1409
|
// is just the one-shot in-app pass).
|
|
@@ -1340,7 +1434,7 @@ app.whenReady().then(async () => {
|
|
|
1340
1434
|
}, 30_000);
|
|
1341
1435
|
// Keep TODAY's rollup line current so the History dashboard never needs to
|
|
1342
1436
|
// fall back to a live transcript scan. Shares the same O_EXCL lock file as
|
|
1343
|
-
// the external watchdog's finalize pass (
|
|
1437
|
+
// the external watchdog's finalize pass (src/main/lib/watchdogHelpers.cjs)
|
|
1344
1438
|
// so the two never interleave writes to the rollup; a contended lock just
|
|
1345
1439
|
// means this tick's refresh is skipped (harmless — the next tick retries).
|
|
1346
1440
|
const intradayTimer = setInterval(runIntradayRefresh, schedulerConfig.HISTORY_INTRADAY_REFRESH_MS);
|
|
@@ -1392,6 +1486,14 @@ function runShutdownCleanup() {
|
|
|
1392
1486
|
// Mark a clean exit so the next boot can distinguish a graceful quit from an
|
|
1393
1487
|
// OOM-kill / native crash (which leaves the sentinel `open`).
|
|
1394
1488
|
crashDiagnostics.markCleanShutdown();
|
|
1489
|
+
// Release scheduler ownership on every teardown path, not just before-quit
|
|
1490
|
+
// — the app.exit() sites (in-app reboot, dist-missing abort) bypass
|
|
1491
|
+
// before-quit entirely and previously left a stale lock behind (fail-closed
|
|
1492
|
+
// proc-identity recovery covers a hard crash, but a clean app.exit() should
|
|
1493
|
+
// never need it). Pid-scoped and idempotent, so a redundant call from a
|
|
1494
|
+
// later before-quit/will-quit firing is a safe no-op.
|
|
1495
|
+
releaseSchedulerOwnership();
|
|
1496
|
+
try { scheduler.stop(); } catch { /* */ }
|
|
1395
1497
|
// PRD F1 v2 §IPC plumbing: must unregisterAll on will-quit.
|
|
1396
1498
|
try { globalShortcut.unregisterAll(); } catch { /* */ }
|
|
1397
1499
|
voiceHotkey.disposeOnQuit();
|
package/src/main/ipcSchemas.cjs
CHANGED
|
@@ -320,6 +320,11 @@ const PrdAgentTypeSchema = z.string().regex(PERSONA_NAME_RE, 'agent name must be
|
|
|
320
320
|
// call site since update also allows an explicit empty array to CLEAR the
|
|
321
321
|
// dependency, which create has no reason to accept.
|
|
322
322
|
const DepSlugSchema = z.string().min(1).max(160).regex(/^[A-Za-z0-9][\w.-]*$/);
|
|
323
|
+
// Wave-authoring decision (scheduler wave-disposition PRD), shared between
|
|
324
|
+
// schedulerCreatePrd (authoring time) and adminPrdFrontmatterPatch (the
|
|
325
|
+
// after-the-fact change path) so both can never disagree on what a valid
|
|
326
|
+
// disposition value is.
|
|
327
|
+
const PrdDispositionSchema = z.enum(['append', 'new-head']);
|
|
323
328
|
const schedulerCreatePrd = z.object({
|
|
324
329
|
title: z.string().min(1).max(200).regex(NO_NEWLINE_RE, 'must not contain newlines'),
|
|
325
330
|
// Optional (PRD: worktree-cwd Epic-lookup hazard) — when omitted, prdCreate.cjs's
|
|
@@ -340,6 +345,12 @@ const schedulerCreatePrd = z.object({
|
|
|
340
345
|
// Explicit ordering (PRD 832): slugs that must complete before this PRD
|
|
341
346
|
// becomes eligible. Written to frontmatter as `dependsOn: [a, b]`.
|
|
342
347
|
dependsOn: z.array(DepSlugSchema).max(20).optional(),
|
|
348
|
+
// Explicit wave-authoring decision (scheduler wave-disposition PRD) — only
|
|
349
|
+
// meaningful (and only stamped) when this PRD joins an Epic that already
|
|
350
|
+
// has incomplete PRDs and lands as a wave root (no dependsOn of its own);
|
|
351
|
+
// createPrd() requires it in that situation for an interactive caller and
|
|
352
|
+
// defaults to 'append' (logged as a default) for a non-interactive one.
|
|
353
|
+
disposition: PrdDispositionSchema.optional(),
|
|
343
354
|
// An EXISTING Epic's promptSessionId (PRD 748) — NOT a PromptTicket.id.
|
|
344
355
|
// ensureEpic() (epicMint.cjs) joins the Epic whose active-index.json
|
|
345
356
|
// sessions key literally equals this value; the renderer only ever sends
|
|
@@ -387,6 +398,19 @@ const schedulerCreatePrd = z.object({
|
|
|
387
398
|
quietMachine: z.boolean().optional(),
|
|
388
399
|
});
|
|
389
400
|
|
|
401
|
+
// Renderer-facing counterpart to adminPrdFrontmatterPatch's dependsOn/
|
|
402
|
+
// disposition patch (scheduler wave-disposition PRD) — backs the Scheduler
|
|
403
|
+
// UI's "change disposition" action. `dependsOn` is the caller's already-
|
|
404
|
+
// computed target (from the SAME backlog tree the UI renders — see
|
|
405
|
+
// lib/backlogTree.ts); the main-process handler only validates the rewrite
|
|
406
|
+
// is safe (prdDisposition.cjs), never re-derives "the" terminal itself.
|
|
407
|
+
const scheduleSetPrdDisposition = z.object({
|
|
408
|
+
slug: z.string().regex(SCHEDULE_SLUG_RE),
|
|
409
|
+
cwd: z.string().min(1).max(4096).optional(),
|
|
410
|
+
disposition: PrdDispositionSchema,
|
|
411
|
+
dependsOn: z.array(DepSlugSchema).max(20).optional(),
|
|
412
|
+
});
|
|
413
|
+
|
|
390
414
|
// Bulk archive: slug list, capped to limit unbounded retag/archive payloads.
|
|
391
415
|
// Optional cwd narrows every slug's directory search to one project (same
|
|
392
416
|
// role as scheduler_get_prd/scheduler_update_prd's cwd hint) — omitted, the
|
|
@@ -469,6 +493,11 @@ const adminPrdFrontmatterPatch = z.object({
|
|
|
469
493
|
// (depSlugResolve.cjs) scheduler_create_prd uses, so update and create
|
|
470
494
|
// can never disagree about what a dependsOn entry resolves to.
|
|
471
495
|
dependsOn: z.array(DepSlugSchema).max(20).optional(),
|
|
496
|
+
// Patchable after creation too — the Scheduler UI's "change disposition"
|
|
497
|
+
// action (promote a wave to its own head, or attach it behind another
|
|
498
|
+
// chain) rewrites this alongside dependsOn via the same
|
|
499
|
+
// schedule:set-prd-disposition path (see prdDisposition.cjs).
|
|
500
|
+
disposition: PrdDispositionSchema.optional(),
|
|
472
501
|
});
|
|
473
502
|
|
|
474
503
|
const adminUpdatePrd = z.object({
|
|
@@ -623,28 +652,34 @@ const agentsGetPersonaBody = z.object({
|
|
|
623
652
|
name: z.string().min(1).max(200),
|
|
624
653
|
}).strict();
|
|
625
654
|
|
|
626
|
-
// ────────────────────────────────────────────
|
|
627
|
-
|
|
628
|
-
// config.cjs's validatePath at first fs access in projectPages.cjs.
|
|
629
|
-
const projectPagesCwd = z.object({
|
|
655
|
+
// ──────────────────────────────────────────── Effective model info (PRD: what-will-this-run-as)
|
|
656
|
+
const agentsResolveModelInfo = z.object({
|
|
630
657
|
cwd: z.string().min(1).max(4096),
|
|
658
|
+
agentType: z.string().min(1).max(200),
|
|
631
659
|
}).strict();
|
|
632
660
|
|
|
633
|
-
// ────────────────────────────────────────────
|
|
634
|
-
// (
|
|
635
|
-
//
|
|
636
|
-
//
|
|
637
|
-
const
|
|
661
|
+
// ──────────────────────────────────────────── Epic launch model (PRD: unify-epic-model-resolution)
|
|
662
|
+
// Terminal's (EpicTerminalPane.tsx) call into agentModelResolve.cjs's
|
|
663
|
+
// resolveEpicModel — the same launch-model authority chatRunner.cjs's Chat
|
|
664
|
+
// path calls in-process, reached here over IPC since the renderer has no fs.
|
|
665
|
+
const agentsResolveEpicModel = z.object({
|
|
638
666
|
cwd: z.string().min(1).max(4096),
|
|
667
|
+
claudeSessionId: z.string().min(1).max(200),
|
|
639
668
|
}).strict();
|
|
640
|
-
|
|
669
|
+
|
|
670
|
+
// ──────────────────────────────────────────── Project Pages (PRD 932)
|
|
671
|
+
// Same validation split as projectBriefCwd above: real path validation is
|
|
672
|
+
// config.cjs's validatePath at first fs access in projectPages.cjs.
|
|
673
|
+
const projectPagesCwd = z.object({
|
|
641
674
|
cwd: z.string().min(1).max(4096),
|
|
642
|
-
summary: z.unknown(),
|
|
643
675
|
}).strict();
|
|
644
|
-
|
|
676
|
+
|
|
677
|
+
// ──────────────────────────────────────────── Project Home admin route
|
|
678
|
+
// Real path validation is projectRootResolve.cjs + config.cjs's validatePath;
|
|
679
|
+
// html content limits live in projectHomeAdminRoutes.cjs's validateHomeHtml.
|
|
680
|
+
const projectHomeAdminWriteBody = z.object({
|
|
645
681
|
cwd: z.string().min(1).max(4096),
|
|
646
|
-
|
|
647
|
-
picks: z.unknown(),
|
|
682
|
+
html: z.string(),
|
|
648
683
|
}).strict();
|
|
649
684
|
|
|
650
685
|
// ──────────────────────────────────────────── Host on Bilko.run
|
|
@@ -1037,6 +1072,7 @@ module.exports = {
|
|
|
1037
1072
|
scheduleReadLog,
|
|
1038
1073
|
scheduleWritePrd,
|
|
1039
1074
|
schedulerCreatePrd,
|
|
1075
|
+
scheduleSetPrdDisposition,
|
|
1040
1076
|
scheduleArchivePrd,
|
|
1041
1077
|
scheduleRetagPrd,
|
|
1042
1078
|
adminListPrdsQuery,
|
|
@@ -1070,9 +1106,7 @@ module.exports = {
|
|
|
1070
1106
|
memoryStale,
|
|
1071
1107
|
projectBriefCwd,
|
|
1072
1108
|
projectPagesCwd,
|
|
1073
|
-
|
|
1074
|
-
projectHomeAdminValidateSummaryBody,
|
|
1075
|
-
projectHomeAdminRenderBody,
|
|
1109
|
+
projectHomeAdminWriteBody,
|
|
1076
1110
|
bilkoHostCwd,
|
|
1077
1111
|
bilkoHostPrepareBundle,
|
|
1078
1112
|
bilkoHostAddDocument,
|
|
@@ -1108,6 +1142,8 @@ module.exports = {
|
|
|
1108
1142
|
exchangesList,
|
|
1109
1143
|
agentsSavePersona,
|
|
1110
1144
|
agentsGetPersonaBody,
|
|
1145
|
+
agentsResolveModelInfo,
|
|
1146
|
+
agentsResolveEpicModel,
|
|
1111
1147
|
delegationReadinessCwd,
|
|
1112
1148
|
telemetrySetConfig,
|
|
1113
1149
|
},
|