claude-code-session-manager 0.87.0 → 0.88.1
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-DyLWzZDf.js → AgentLibrary-kQF8_wAw.js} +1 -1
- package/dist/assets/{DataModel--mISIJ6h.js → DataModel-CY_mMnsr.js} +1 -1
- package/dist/assets/{History-C2ahUXTg.js → History-Sji2brb0.js} +1 -1
- package/dist/assets/{Hooks-BiC6oyR2.js → Hooks-CtqpO-p5.js} +1 -1
- package/dist/assets/{HostBilko-BPleEOld.js → HostBilko-DN0ydOCr.js} +1 -1
- package/dist/assets/{Library-Dc8Qst1R.js → Library-CoiLZTKh.js} +1 -1
- package/dist/assets/{ListDetail-DIXh-OLX.js → ListDetail-CmqiQ_io.js} +1 -1
- package/dist/assets/{MarkdownEditor-C90bkLXK.js → MarkdownEditor-HPoNeKhT.js} +1 -1
- package/dist/assets/{McpServers-DqcbLOLZ.js → McpServers-Bj1X3_NT.js} +1 -1
- package/dist/assets/{Memory-CW62MXlh.js → Memory-1PKjsM3b.js} +1 -1
- package/dist/assets/{Panel-Bw1FhRuF.js → Panel-I1s6ghPo.js} +1 -1
- package/dist/assets/{Permissions-BcUC-5y8.js → Permissions-BhiiZjHQ.js} +1 -1
- package/dist/assets/{Plugins-BnKx9flD.js → Plugins-gv3_fkPX.js} +2 -2
- package/dist/assets/{ProvenanceBadge-Bw5vNVPT.js → ProvenanceBadge-BGcgBd8V.js} +1 -1
- package/dist/assets/{SaveBar-CWr0O_w-.js → SaveBar-BGr9eZ4g.js} +1 -1
- package/dist/assets/{Scheduler-DYdLuUqq.js → Scheduler-Bdo_awPq.js} +7 -7
- package/dist/assets/{ScopeSwitcher-CrBLbg8s.js → ScopeSwitcher-ukl0qWaA.js} +1 -1
- package/dist/assets/{Settings-DluB-vN1.js → Settings-DJkFj22G.js} +1 -1
- package/dist/assets/{SkillReferenceGraph-CHLSseay.js → SkillReferenceGraph-0t1Qblp6.js} +1 -1
- package/dist/assets/{Skills-gNdo_HNK.js → Skills-CeVdBGE-.js} +1 -1
- package/dist/assets/{SystemPrompt-Cru05-Ia.js → SystemPrompt-CfKvNHi3.js} +1 -1
- package/dist/assets/{TagLibrary-DNHY0xou.js → TagLibrary-DAzNaUPd.js} +1 -1
- package/dist/assets/{TiptapBody-I4lmbCgP.js → TiptapBody--S_rGXoA.js} +1 -1
- package/dist/assets/{Toggle-bWMHjmRh.js → Toggle-Dszm0xnp.js} +1 -1
- package/dist/assets/{index-DV3PorRY.css → index-BHTX4OTc.css} +1 -1
- package/dist/assets/{index-fc_JjdxL.js → index-Dp4Rc--q.js} +356 -356
- package/dist/assets/{settingsSchema-BfhtZnGD.js → settingsSchema-BLbssMYo.js} +1 -1
- 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 +10 -13
- 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 +28 -71
- package/src/main/__tests__/bilkoHost-integration.test.cjs +3 -3
- 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 +2 -2
- 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 +15 -1
- package/src/main/__tests__/health-queue-dispatch.test.cjs +58 -7
- package/src/main/__tests__/health-tick-liveness.test.cjs +27 -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__/opsErrorLogTelemetryTap.test.cjs +25 -1
- package/src/main/__tests__/pollLoop-dispatch-on-failure.test.cjs +33 -3
- 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__/prdLocationsArchived.test.cjs +20 -13
- 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 +9 -9
- package/src/main/__tests__/queue-starvation-dispatch-driver.test.cjs +117 -20
- package/src/main/__tests__/queueHistory.test.cjs +2 -2
- package/src/main/__tests__/rateLimitPollerStreak.test.cjs +38 -3
- 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 +2 -2
- 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 +78 -97
- 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 +46 -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-launch-failure.test.cjs +3 -5
- package/src/main/__tests__/scheduler-looks-done.test.cjs +26 -7
- 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-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 +23 -4
- 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 +81 -1
- package/src/main/__tests__/scheduler-stall-per-project.test.cjs +14 -0
- package/src/main/__tests__/scheduler-starve-escalation.test.cjs +4 -4
- 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 +37 -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 +4 -2
- package/src/main/config.cjs +2 -3
- package/src/main/docEdit.cjs +4 -2
- package/src/main/health.cjs +276 -52
- package/src/main/heapSnapshot.cjs +2 -2
- package/src/main/historyAggregator.cjs +1 -1
- package/src/main/index.cjs +61 -10
- package/src/main/ipcSchemas.cjs +6 -17
- package/src/main/lib/__tests__/auditLog.test.cjs +38 -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 +1 -1
- package/src/main/lib/__tests__/dispatchLoop.test.cjs +63 -0
- package/src/main/lib/__tests__/gateFixtures.json +20 -0
- package/src/main/lib/__tests__/gitWorktree.test.cjs +8 -1
- 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__/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__/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 +61 -0
- package/src/main/lib/__tests__/watchdog-helpers.test.cjs +63 -0
- package/src/main/lib/__tests__/watchdog-relaunch.test.cjs +73 -0
- package/src/main/lib/activeIndexRebuild.cjs +1 -3
- package/src/main/lib/activeSessions.cjs +20 -88
- package/src/main/lib/adoptedRunSupervisor.cjs +136 -0
- package/src/main/lib/agentModelResolve.cjs +33 -1
- package/src/main/lib/agentPersonaSchema.cjs +2 -2
- package/src/main/lib/auditLog.cjs +30 -5
- 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/dispatchLoop.cjs +40 -0
- package/src/main/lib/effectiveModelInfo.cjs +9 -10
- package/src/main/lib/ephemeralCwd.cjs +7 -28
- package/src/main/lib/gitWorktree.cjs +95 -8
- package/src/main/lib/guardShims.cjs +3 -3
- package/src/main/lib/historyRollup.cjs +6 -7
- package/src/main/lib/instanceLock.cjs +32 -5
- package/src/main/lib/jobSupervisorRecord.cjs +147 -0
- package/src/main/lib/jobWorktreeBootLive.cjs +9 -5
- package/src/main/lib/localAdminHttp.cjs +9 -27
- package/src/main/lib/mcpToolCatalog.cjs +29 -77
- package/src/main/lib/opsOwnership.cjs +27 -19
- package/src/main/lib/prdAuthoringSeed.cjs +36 -0
- package/src/main/lib/prdLocations.cjs +48 -1
- 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/queueHistory.cjs +8 -7
- package/src/main/lib/queueStore.cjs +57 -37
- package/src/main/lib/quietMachineLease.cjs +19 -2
- 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 +2 -2
- package/src/main/lib/scheduleJobTransitions.cjs +29 -2
- package/src/main/lib/schedulerBatch.cjs +27 -2
- 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 +53 -6
- package/src/main/lib/watchdogHelpers.cjs +70 -37
- 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.cjs +1607 -383
- 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/usage.cjs +126 -62
- package/src/preload/api.d.ts +18 -64
- package/src/preload/index.cjs +2 -4
- package/src/seed/agents/project-home-builder.md +31 -48
- package/screenshots/.gitkeep +0 -0
- package/screenshots/README-screenshots.md +0 -13
- 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/web/README.md +0 -41
- package/web/project-pages/logic/dist/logic.cjs +0 -4709
- package/web/project-pages/render.cjs +0 -70
- package/web/project-pages/renderer/dist/renderer.cjs +0 -18900
- package/web/project-pages/validate-summary.cjs +0 -62
|
@@ -11,10 +11,7 @@
|
|
|
11
11
|
* feedback_list_projects() -> GET /admin/feedback/targets
|
|
12
12
|
* feedback_open_session({ ... }) -> POST /admin/feedback/open-session
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* project_home_validate_summary({ cwd?, summary }) -> POST /admin/project-home/validate-summary
|
|
16
|
-
* project_home_render({ cwd?, summary, picks }) -> POST /admin/project-home/render
|
|
17
|
-
* project_home_status({ cwd? }) -> GET /admin/project-home/status
|
|
14
|
+
* project_home_write({ cwd?, html }) -> POST /admin/project-home/write
|
|
18
15
|
*
|
|
19
16
|
* This is a separate process from the Electron app — it only ever reaches
|
|
20
17
|
* it over the token-authed loopback HTTP API in admin-api.json, never by
|
|
@@ -24,7 +21,9 @@
|
|
|
24
21
|
|
|
25
22
|
'use strict';
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
// Name this process first (pn-03): otherwise it shows as a bare `node`.
|
|
25
|
+
const { PROC_NAMES, setProcessTitle } = require('../src/main/lib/smProcNames.cjs');
|
|
26
|
+
setProcessTitle(PROC_NAMES.mcpServer);
|
|
28
27
|
const path = require('node:path');
|
|
29
28
|
const fsp = require('node:fs/promises');
|
|
30
29
|
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
@@ -44,7 +43,7 @@ function descriptionFor(toolName) {
|
|
|
44
43
|
return composeDescription(entry);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
const
|
|
46
|
+
const { adminTokenPath } = require('../src/main/lib/schedulerPaths.cjs');
|
|
48
47
|
|
|
49
48
|
// Defined once so every failure path points to the same next call, verbatim
|
|
50
49
|
// — never paste this sentence at each return site (PRD: session_manager_help).
|
|
@@ -71,7 +70,7 @@ function resolveCwdArg(args) {
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
async function readAdminConfig() {
|
|
74
|
-
const raw = await fsp.readFile(
|
|
73
|
+
const raw = await fsp.readFile(adminTokenPath(), 'utf8');
|
|
75
74
|
const parsed = JSON.parse(raw);
|
|
76
75
|
if (!parsed || typeof parsed.port !== 'number' || typeof parsed.token !== 'string') {
|
|
77
76
|
throw new Error(NOT_RUNNING_ERROR);
|
|
@@ -140,6 +139,16 @@ const TOOLS = [
|
|
|
140
139
|
required: ['slug'],
|
|
141
140
|
},
|
|
142
141
|
},
|
|
142
|
+
{
|
|
143
|
+
name: 'scheduler_pause',
|
|
144
|
+
description: descriptionFor('scheduler_pause'),
|
|
145
|
+
inputSchema: { type: 'object', properties: {} },
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'scheduler_resume',
|
|
149
|
+
description: descriptionFor('scheduler_resume'),
|
|
150
|
+
inputSchema: { type: 'object', properties: {} },
|
|
151
|
+
},
|
|
143
152
|
{
|
|
144
153
|
name: 'scheduler_list_jobs',
|
|
145
154
|
description: descriptionFor('scheduler_list_jobs'),
|
|
@@ -347,48 +356,15 @@ const TOOLS = [
|
|
|
347
356
|
},
|
|
348
357
|
},
|
|
349
358
|
{
|
|
350
|
-
name: '
|
|
351
|
-
description: descriptionFor('
|
|
359
|
+
name: 'project_home_write',
|
|
360
|
+
description: descriptionFor('project_home_write'),
|
|
352
361
|
inputSchema: {
|
|
353
362
|
type: 'object',
|
|
354
363
|
properties: {
|
|
355
364
|
cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root (SM_PROJECT_ROOT or process.cwd()) when omitted." },
|
|
365
|
+
html: { type: 'string', description: 'The complete self-contained HTML document (<= 1MB; no <script src>, <link href=http*>, @import, or url(http*)).' },
|
|
356
366
|
},
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
name: 'project_home_validate_summary',
|
|
361
|
-
description: descriptionFor('project_home_validate_summary'),
|
|
362
|
-
inputSchema: {
|
|
363
|
-
type: 'object',
|
|
364
|
-
properties: {
|
|
365
|
-
cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root when omitted." },
|
|
366
|
-
summary: { type: 'object', description: 'ProjectPageSummary object matching the summarySchema from project_home_get_contract' },
|
|
367
|
-
},
|
|
368
|
-
required: ['summary'],
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
name: 'project_home_render',
|
|
373
|
-
description: descriptionFor('project_home_render'),
|
|
374
|
-
inputSchema: {
|
|
375
|
-
type: 'object',
|
|
376
|
-
properties: {
|
|
377
|
-
cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root when omitted." },
|
|
378
|
-
summary: { type: 'object', description: 'ProjectPageSummary object matching the summarySchema from project_home_get_contract' },
|
|
379
|
-
picks: { type: 'object', description: 'ProjectPagePicks object (lensId -> slotId -> variantId) matching the picksSchema from project_home_get_contract' },
|
|
380
|
-
},
|
|
381
|
-
required: ['summary', 'picks'],
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
name: 'project_home_status',
|
|
386
|
-
description: descriptionFor('project_home_status'),
|
|
387
|
-
inputSchema: {
|
|
388
|
-
type: 'object',
|
|
389
|
-
properties: {
|
|
390
|
-
cwd: { type: 'string', description: "Optional: absolute path to the target project. Defaults to the calling session's own project root when omitted." },
|
|
391
|
-
},
|
|
367
|
+
required: ['html'],
|
|
392
368
|
},
|
|
393
369
|
},
|
|
394
370
|
{
|
|
@@ -428,6 +404,10 @@ async function handleCallTool(request) {
|
|
|
428
404
|
const result = await adminRequest('POST', '/admin/scheduler/reset-job', { slug, force, cwd });
|
|
429
405
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
430
406
|
}
|
|
407
|
+
if (name === 'scheduler_pause' || name === 'scheduler_resume') {
|
|
408
|
+
const result = await adminRequest('POST', `/admin/scheduler/${name === 'scheduler_pause' ? 'pause' : 'resume'}`, {});
|
|
409
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
410
|
+
}
|
|
431
411
|
if (name === 'scheduler_list_jobs') {
|
|
432
412
|
const result = await adminRequest('GET', '/admin/scheduler/jobs');
|
|
433
413
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
@@ -575,35 +555,12 @@ async function handleCallTool(request) {
|
|
|
575
555
|
const result = await adminRequest('POST', '/admin/chat/send-prompt', { tabId, prompt });
|
|
576
556
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
577
557
|
}
|
|
578
|
-
if (name === '
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
const result = await adminRequest('GET', `/admin/project-home/contract?${qs.toString()}`);
|
|
582
|
-
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
583
|
-
}
|
|
584
|
-
if (name === 'project_home_validate_summary') {
|
|
585
|
-
if (!args || typeof args.summary !== 'object' || args.summary === null) {
|
|
586
|
-
return errorResult('missing required argument: summary');
|
|
587
|
-
}
|
|
588
|
-
const cwd = resolveCwdArg(args);
|
|
589
|
-
const result = await adminRequest('POST', '/admin/project-home/validate-summary', { cwd, summary: args.summary });
|
|
590
|
-
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
591
|
-
}
|
|
592
|
-
if (name === 'project_home_render') {
|
|
593
|
-
if (!args || typeof args.summary !== 'object' || args.summary === null) {
|
|
594
|
-
return errorResult('missing required argument: summary');
|
|
595
|
-
}
|
|
596
|
-
if (typeof args.picks !== 'object' || args.picks === null) {
|
|
597
|
-
return errorResult('missing required argument: picks');
|
|
558
|
+
if (name === 'project_home_write') {
|
|
559
|
+
if (!args || typeof args.html !== 'string' || args.html.length === 0) {
|
|
560
|
+
return errorResult('missing required argument: html');
|
|
598
561
|
}
|
|
599
562
|
const cwd = resolveCwdArg(args);
|
|
600
|
-
const result = await adminRequest('POST', '/admin/project-home/
|
|
601
|
-
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
602
|
-
}
|
|
603
|
-
if (name === 'project_home_status') {
|
|
604
|
-
const cwd = resolveCwdArg(args);
|
|
605
|
-
const qs = new URLSearchParams({ cwd });
|
|
606
|
-
const result = await adminRequest('GET', `/admin/project-home/status?${qs.toString()}`);
|
|
563
|
+
const result = await adminRequest('POST', '/admin/project-home/write', { cwd, html: args.html });
|
|
607
564
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
608
565
|
}
|
|
609
566
|
if (name === 'session_manager_help') {
|
|
@@ -14,8 +14,8 @@ function makeProject() {
|
|
|
14
14
|
config.addAllowedRoot(root);
|
|
15
15
|
fs.mkdirSync(path.join(root, 'session-manager-operations', 'project-pages', 'output'), { recursive: true });
|
|
16
16
|
fs.writeFileSync(
|
|
17
|
-
path.join(root, 'session-manager-operations', 'project-pages', '
|
|
18
|
-
'<html><title>Demo</title>
|
|
17
|
+
path.join(root, 'session-manager-operations', 'project-pages', 'home.html'),
|
|
18
|
+
'<html><title>Demo</title>Home</html>',
|
|
19
19
|
);
|
|
20
20
|
fs.writeFileSync(
|
|
21
21
|
path.join(root, 'session-manager-operations', 'project-pages', 'output', 'feature.html'),
|
|
@@ -29,7 +29,7 @@ test('prepareBundle seeds a root document and writes dist/index.html + manifest.
|
|
|
29
29
|
const root = makeProject();
|
|
30
30
|
const result = await bilkoHost.prepareBundle({ cwd: root, slug: 'demo-app' });
|
|
31
31
|
assert.equal(fs.existsSync(path.join(result.distPath, 'index.html')), true);
|
|
32
|
-
assert.equal(fs.readFileSync(path.join(result.distPath, 'index.html'), 'utf8'), '<html><title>Demo</title>
|
|
32
|
+
assert.equal(fs.readFileSync(path.join(result.distPath, 'index.html'), 'utf8'), '<html><title>Demo</title>Home</html>');
|
|
33
33
|
assert.equal(result.manifest.slug, 'demo-app');
|
|
34
34
|
assert.equal(result.manifest.bundle.fileCount, 1);
|
|
35
35
|
fs.rmSync(root, { recursive: true, force: true });
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
* path (via SM_CLAUDE_BIN pointing at a stub process) and asserts a terminal
|
|
14
14
|
* event is broadcast on cancel.
|
|
15
15
|
*
|
|
16
|
-
* Run: timeout
|
|
16
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/chat-cancel-terminal.test.cjs
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
'use strict';
|
|
20
20
|
|
|
21
21
|
delete process.env.SM_CHAT_CONCURRENCY;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
import { test, afterAll } from 'vitest';
|
|
24
24
|
const assert = require('node:assert/strict');
|
|
25
25
|
const fs = require('node:fs');
|
|
26
26
|
const os = require('node:os');
|
|
@@ -30,12 +30,9 @@ const path = require('node:path');
|
|
|
30
30
|
// mimics a long-running headless run so cancel() has something to SIGTERM.
|
|
31
31
|
// Shebang + chmod makes it directly spawnable as a single executable (spawn
|
|
32
32
|
// does not split a path on spaces, so SM_CLAUDE_BIN must be one binary).
|
|
33
|
-
const stubPath =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`#!${process.execPath}\nsetInterval(() => {}, 1000);\n`,
|
|
37
|
-
{ mode: 0o755 },
|
|
38
|
-
);
|
|
33
|
+
const stubPath = require('../../../tests/helpers/claudeStub.cjs').writeClaudeStub({
|
|
34
|
+
body: 'setInterval(() => {}, 1000);',
|
|
35
|
+
});
|
|
39
36
|
process.env.SM_CLAUDE_BIN = stubPath;
|
|
40
37
|
|
|
41
38
|
const cr = require('../chatRunner.cjs');
|
|
@@ -114,7 +111,7 @@ function isTerminal(channel) {
|
|
|
114
111
|
);
|
|
115
112
|
}
|
|
116
113
|
|
|
117
|
-
|
|
114
|
+
afterAll(() => {
|
|
118
115
|
try { fs.unlinkSync(stubPath); } catch { /* already gone */ }
|
|
119
116
|
delete process.env.SM_CLAUDE_BIN;
|
|
120
117
|
});
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
* arrives, THEN close fires) rather than relying on real OS/pipe timing,
|
|
22
22
|
* which is not reliably reproducible from a real child process.
|
|
23
23
|
*
|
|
24
|
-
* Run: timeout
|
|
24
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/chat-exit-close-race.test.cjs
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
'use strict';
|
|
28
28
|
|
|
29
29
|
delete process.env.SM_CHAT_CONCURRENCY;
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
import { test, afterAll } from 'vitest';
|
|
32
32
|
const assert = require('node:assert/strict');
|
|
33
33
|
const EventEmitter = require('node:events');
|
|
34
34
|
const cp = require('node:child_process');
|
|
@@ -134,7 +134,7 @@ function isTerminal(channel) {
|
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
afterAll(() => {
|
|
138
138
|
cp.spawn = originalSpawn;
|
|
139
139
|
delete process.env.SM_CHAT_CONCURRENCY;
|
|
140
140
|
});
|
|
@@ -6,24 +6,23 @@
|
|
|
6
6
|
* asserts a `chat:run:notice` event is broadcast — informational, not a
|
|
7
7
|
* terminal event.
|
|
8
8
|
*
|
|
9
|
-
* Run: timeout
|
|
9
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/chat-mcp-consent-notice.test.cjs
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
delete process.env.SM_CHAT_CONCURRENCY;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
import { test } from 'vitest';
|
|
17
17
|
const assert = require('node:assert/strict');
|
|
18
18
|
const fs = require('node:fs');
|
|
19
19
|
const os = require('node:os');
|
|
20
20
|
const path = require('node:path');
|
|
21
|
+
const claudeStub = require('../../../tests/helpers/claudeStub.cjs');
|
|
21
22
|
|
|
22
23
|
function writeStub(lines) {
|
|
23
|
-
const stubPath = path.join(os.tmpdir(), `sm-claude-stub-${process.pid}-${Math.floor(Math.random() * 1e9)}.cjs`);
|
|
24
24
|
const body = lines.map((l) => `process.stdout.write(${JSON.stringify(JSON.stringify(l))} + "\\n");`).join('\n');
|
|
25
|
-
|
|
26
|
-
return stubPath;
|
|
25
|
+
return claudeStub.writeClaudeStub({ body: `${body}\nprocess.exit(0);` });
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
function isTerminal(channel) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* this cap/FIFO governs silent runs only — manual runs bypass it entirely
|
|
7
7
|
* (see chatRunner.spec.ts's "manual runs are uncapped" tests).
|
|
8
8
|
*
|
|
9
|
-
* Run: timeout
|
|
9
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/chat-queue.test.cjs
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// Force the default cap (2) regardless of the developer's shell env.
|
|
15
15
|
delete process.env.SM_CHAT_CONCURRENCY;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
import { test } from 'vitest';
|
|
18
18
|
const assert = require('node:assert/strict');
|
|
19
19
|
const cr = require('../chatRunner.cjs');
|
|
20
20
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* chat-stop-signal.test.cjs — unit tests for chatRunner.parseStopSignal, the
|
|
3
3
|
* single source of truth for the terminal-chat stop-signal protocol (PRD 318).
|
|
4
4
|
*
|
|
5
|
-
* Run: timeout
|
|
5
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/chat-stop-signal.test.cjs
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { test } from 'vitest';
|
|
11
11
|
const assert = require('node:assert/strict');
|
|
12
12
|
const { parseStopSignal, STOP_SENTINEL } = require('../chatRunner.cjs');
|
|
13
13
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRD 1286 — archiving a row must never orphan its dependents, and a fully
|
|
3
|
+
* blocked queue must never read healthy.
|
|
4
|
+
*
|
|
5
|
+
* Option (b): the depends-gate (computeDepHistorySatisfaction) treats a dep
|
|
6
|
+
* whose PRD file was archived — including the manual-archive layout
|
|
7
|
+
* prds-archived/<ISO-ts>/<slug>.md — as satisfied. A dep with no row, no
|
|
8
|
+
* history and no archived file still HOLDS.
|
|
9
|
+
*
|
|
10
|
+
* Run: timeout 120 npx vitest run src/main/__tests__/dep-orphan-archive-health.test.cjs
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
import { test, expect } from 'vitest';
|
|
16
|
+
import fs from 'node:fs';
|
|
17
|
+
import os from 'node:os';
|
|
18
|
+
import path from 'node:path';
|
|
19
|
+
|
|
20
|
+
const tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), 'sm-1286-home-'));
|
|
21
|
+
process.env.HOME = tmpHome;
|
|
22
|
+
|
|
23
|
+
const scheduler = require('../scheduler.cjs');
|
|
24
|
+
const { pickNextBatch } = require('../lib/schedulerBatch.cjs');
|
|
25
|
+
const { evaluateUnresolvableDepHealth } = require('../health.cjs');
|
|
26
|
+
|
|
27
|
+
function projectWithDependent(dep) {
|
|
28
|
+
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'sm-1286-proj-'));
|
|
29
|
+
const jobs = [{ slug: '902-next', status: 'pending', cwd, dependsOn: [dep] }];
|
|
30
|
+
return { cwd, jobs };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function eligible(jobs) {
|
|
34
|
+
const satisfiedSlugsByCwd = await scheduler.computeDepHistorySatisfaction({ jobs });
|
|
35
|
+
const { batch: picked } = pickNextBatch(jobs, new Set(), 3, { satisfiedSlugsByCwd });
|
|
36
|
+
return { batch: picked.map((j) => j.slug ?? j.job?.slug ?? j), satisfiedSlugsByCwd };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
test('a dep archived via the manual-archive layout (prds-archived/<ts>/) leaves its dependent eligible', async () => {
|
|
40
|
+
const { cwd, jobs } = projectWithDependent('fo-01-base'); // bare slug, as authored
|
|
41
|
+
const dir = path.join(cwd, 'session-manager-operations', 'scheduler', 'epics', 'e1', 'prds-archived', '2026-09-18T01-00-00-000Z');
|
|
42
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
43
|
+
fs.writeFileSync(path.join(dir, '900-fo-01-base.md'), '# Goal\n');
|
|
44
|
+
const { batch } = await eligible(jobs);
|
|
45
|
+
expect(batch).toContain('902-next');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('a dep that never ran (no row, history or archived file) keeps its dependent held', async () => {
|
|
49
|
+
const { jobs } = projectWithDependent('fo-01-base');
|
|
50
|
+
const { batch } = await eligible(jobs);
|
|
51
|
+
expect(batch).not.toContain('902-next');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('health: every pending row held behind one unresolvable root is non-GREEN and names the root', async () => {
|
|
55
|
+
const { cwd } = projectWithDependent('fo-01-base');
|
|
56
|
+
const jobs = [
|
|
57
|
+
{ slug: '902-a', status: 'pending', cwd, dependsOn: ['fo-01-base'] },
|
|
58
|
+
{ slug: '903-b', status: 'pending', cwd, dependsOn: ['a'] }, // transitive, bare
|
|
59
|
+
];
|
|
60
|
+
const satisfied = await scheduler.computeDepHistorySatisfaction({ jobs });
|
|
61
|
+
const res = evaluateUnresolvableDepHealth(jobs, satisfied);
|
|
62
|
+
expect(res.ok).toBe(false);
|
|
63
|
+
expect(res.projects[0].roots).toEqual(['fo-01-base']);
|
|
64
|
+
expect(res.message).toContain('fo-01-base');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('health: a project with any dispatchable pending row, or a satisfied root, stays GREEN', async () => {
|
|
68
|
+
const { cwd } = projectWithDependent('x');
|
|
69
|
+
const mixed = [
|
|
70
|
+
{ slug: '902-a', status: 'pending', cwd, dependsOn: ['fo-01-base'] },
|
|
71
|
+
{ slug: '903-free', status: 'pending', cwd, dependsOn: [] },
|
|
72
|
+
];
|
|
73
|
+
const satisfied = await scheduler.computeDepHistorySatisfaction({ jobs: mixed });
|
|
74
|
+
expect(evaluateUnresolvableDepHealth(mixed, satisfied).ok).toBe(true);
|
|
75
|
+
const satisfiedRoot = new Map([[cwd, new Set(['900-fo-01-base'])]]);
|
|
76
|
+
expect(evaluateUnresolvableDepHealth([mixed[0]], satisfiedRoot).ok).toBe(true);
|
|
77
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dod-batchkey.test.cjs — unit tests for definitionOfDone.cjs helpers.
|
|
3
3
|
*
|
|
4
|
-
* Run: timeout
|
|
4
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/dod-batchkey.test.cjs
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { test } from 'vitest';
|
|
10
10
|
const assert = require('node:assert/strict');
|
|
11
11
|
const os = require('node:os');
|
|
12
12
|
const fs = require('node:fs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dod-drain-hook.test.cjs — drives the DoD drain handler.
|
|
3
3
|
*
|
|
4
|
-
* Run: timeout
|
|
4
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/dod-drain-hook.test.cjs
|
|
5
5
|
*
|
|
6
6
|
* Scenarios:
|
|
7
7
|
* 1. Drain with completed jobs → writes report once.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
import { test, beforeEach, afterEach } from 'vitest';
|
|
17
17
|
const assert = require('node:assert/strict');
|
|
18
18
|
const os = require('node:os');
|
|
19
19
|
const fs = require('node:fs');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dod-report.test.cjs — unit tests for flagRiskySurfaces + writeReport.
|
|
3
3
|
*
|
|
4
|
-
* Run: timeout
|
|
4
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/dod-report.test.cjs
|
|
5
5
|
*
|
|
6
6
|
* Fixtures: os.tmpdir() only — never writes into real runs/.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { test } from 'vitest';
|
|
12
12
|
const assert = require('node:assert/strict');
|
|
13
13
|
const os = require('node:os');
|
|
14
14
|
const fs = require('node:fs');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dod-reverify.test.cjs — unit tests for extractAcCommand / reverifyAc / reverifyBatch.
|
|
3
3
|
*
|
|
4
|
-
* Run: timeout
|
|
4
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/dod-reverify.test.cjs
|
|
5
5
|
*
|
|
6
6
|
* Fixtures: os.tmpdir() only — never touches the real prds dir or scheduler queue.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { test } from 'vitest';
|
|
12
12
|
const assert = require('node:assert/strict');
|
|
13
13
|
const os = require('node:os');
|
|
14
14
|
const fs = require('node:fs');
|
|
@@ -42,8 +42,8 @@ function writeIndex(cwd, index) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function readAuditRecordsForCwd(auditLog, cwd) {
|
|
45
|
-
if (!fs.existsSync(auditLog.
|
|
46
|
-
return fs.readFileSync(auditLog.
|
|
45
|
+
if (!fs.existsSync(auditLog.auditLogPath())) return [];
|
|
46
|
+
return fs.readFileSync(auditLog.auditLogPath(), 'utf8')
|
|
47
47
|
.split('\n')
|
|
48
48
|
.filter(Boolean)
|
|
49
49
|
.map((line) => {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* Runs against a tmp HOME so no real files are touched.
|
|
7
7
|
* Stubs summarize.cjs to avoid any network calls.
|
|
8
8
|
*
|
|
9
|
-
* Run: timeout
|
|
9
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/exchanges.test.cjs
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import { test, describe, beforeAll as before, afterAll as after } from 'vitest';
|
|
13
13
|
const assert = require('node:assert/strict');
|
|
14
14
|
const fs = require('node:fs');
|
|
15
15
|
const fsp = require('node:fs/promises');
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* brace-matching JSON extractor used by memoryAggregate.cjs and
|
|
4
4
|
* chatRunner.cjs's parseStopSignal.
|
|
5
5
|
*
|
|
6
|
-
* Run: timeout
|
|
6
|
+
* Run: timeout 300 npx vitest run src/main/__tests__/extractJson.test.cjs
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { test } from 'vitest';
|
|
12
12
|
const assert = require('node:assert/strict');
|
|
13
13
|
const { extractJson } = require('../lib/extractJson.cjs');
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// rejectCredentials — write-side denylist for files:* mutations (write/create/
|
|
4
4
|
// rename/delete all call it). Pure path logic; no fs touched.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { test } from 'vitest';
|
|
7
7
|
const assert = require('node:assert/strict');
|
|
8
8
|
const os = require('node:os');
|
|
9
9
|
const path = require('node:path');
|