Remove em and en dashes from comments, logs, docs and CI
Security / JS Security (npm audit) (push) Failing after 15s
Lint / JS (eslint) (push) Successful in 16s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 13s
Lint / Notify on failure (pull_request) Skipped
Test / JS Tests (jest) (push) Successful in 15s
Lint / Deploy (pull_request) Skipped
Test / JS Tests (jest) (pull_request) Successful in 17s
Security / JS Security (npm audit) (pull_request) Failing after 20s

Replace every em dash and en dash outside user-visible UI text with a
colon, comma, hyphen or "to". The UI strings and the vendored
web_template are handled separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-22 01:50:37 -05:00
1 parent 8e77c1af0a
commit 66d5240be0
21 files changed
+73 -73

No files matched your search

+18 -18
View File
@@ -38,7 +38,7 @@ const DEV_READONLY = process.env.PULSE_DEV_READONLY === '1' || process.env.DISAB
// Middleware
// CSP nonce — must run before helmet so the directive can read it.
// CSP nonce: must run before helmet so the directive can read it.
app.use((req, res, next) => {
res.locals.nonce = crypto.randomBytes(16).toString('base64');
next();
@@ -94,11 +94,11 @@ const executionLimiter = rateLimit({
});
// Named constants for timeouts and limits
const PROMPT_TIMEOUT_MS = 60 * 60 * 1000; // 60 min — how long a prompt waits for user input
const COMMAND_TIMEOUT_MS = 120_000; // 2 min — workflow step command timeout
const QUICK_CMD_TIMEOUT_MS = 60_000; // 1 min — quick/direct/gandalf command timeout
const WEBHOOK_TIMEOUT_MS = 10_000; // 10 s — outbound webhook HTTP timeout
const WAIT_STEP_MAX_MS = 24 * 60 * 60_000; // 24 h — cap on workflow wait step
const PROMPT_TIMEOUT_MS = 60 * 60 * 1000; // 60 min: how long a prompt waits for user input
const COMMAND_TIMEOUT_MS = 120_000; // 2 min: workflow step command timeout
const QUICK_CMD_TIMEOUT_MS = 60_000; // 1 min: quick/direct/gandalf command timeout
const WEBHOOK_TIMEOUT_MS = 10_000; // 10 s: outbound webhook HTTP timeout
const WAIT_STEP_MAX_MS = 24 * 60 * 60_000; // 24 h: cap on workflow wait step
const GOTO_MAX_VISITS = 100; // max times a step may be revisited via goto
const WORKER_STALE_MINUTES = 5; // minutes before a worker is marked offline
const SERVER_VERSION = '1.0.0';
@@ -124,7 +124,7 @@ app.post('/csp-report',
res.status(204).end();
});
// Static assets — the old root mount of public/ is gone on purpose.
// Static assets: the old root mount of public/ is gone on purpose.
app.use('/web_template', express.static(path.join(__dirname, 'public/web_template'), { maxAge: '1h' }));
app.use('/assets', express.static(path.join(__dirname, 'public/assets'), { maxAge: '1h' }));
@@ -334,7 +334,7 @@ async function processScheduledCommands() {
? JSON.parse(schedule.worker_ids)
: schedule.worker_ids;
} catch {
console.error(`[Scheduler] Invalid worker_ids JSON for "${schedule.name}" — skipping`);
console.error(`[Scheduler] Invalid worker_ids JSON for "${schedule.name}": skipping`);
continue;
}
@@ -747,7 +747,7 @@ wss.on('connection', (ws, req) => {
// Broadcast to browser clients only (NOT worker agents)
function broadcast(data) {
// Snapshot the Set before iterating — a close event during iteration would
// Snapshot the Set before iterating: a close event during iteration would
// otherwise modify the Set in-place, causing skipped or double-visited entries.
const snapshot = Array.from(browserClients);
snapshot.forEach(client => {
@@ -757,7 +757,7 @@ function broadcast(data) {
});
}
// Helper function to add log entry to execution (atomic — no read-modify-write race condition)
// Helper function to add log entry to execution (atomic: no read-modify-write race condition)
async function addExecutionLog(executionId, logEntry) {
try {
await pool.query(
@@ -907,7 +907,7 @@ function authenticateGandalf(req, res, next) {
// Survives across step boundaries; cleaned up when execution ends.
const _executionState = new Map(); // executionId → { params, state }
// Pending prompt resolvers — set when a prompt step is waiting for user input.
// Pending prompt resolvers: set when a prompt step is waiting for user input.
const _executionPrompts = new Map(); // executionId → resolve fn
const _commandResolvers = new Map(); // commandId → resolve fn (event-driven result delivery)
@@ -956,7 +956,7 @@ async function executeWorkflowSteps(executionId, workflowId, definition, usernam
const step = steps[currentIndex];
const execState = _executionState.get(executionId);
if (!execState) {
// State was lost (server restart or bug) — fail cleanly rather than throwing TypeError
// State was lost (server restart or bug): fail cleanly rather than throwing TypeError
await addExecutionLog(executionId, {
action: 'workflow_error',
error: 'Execution state lost unexpectedly; aborting.',
@@ -966,7 +966,7 @@ async function executeWorkflowSteps(executionId, workflowId, definition, usernam
return;
}
const stepLabel = step.name || step.id || `Step ${currentIndex + 1}`;
console.log(`[Workflow] ${executionId} — step ${currentIndex + 1}: ${stepLabel}`);
console.log(`[Workflow] ${executionId} step ${currentIndex + 1}: ${stepLabel}`);
await addExecutionLog(executionId, {
step: currentIndex + 1, step_name: stepLabel, action: 'step_started',
@@ -1303,7 +1303,7 @@ async function executeCommandStep(executionId, step, stepNumber, params = {}) {
// Wait for a command result using event-driven promise resolution.
// The resolver is stored in _commandResolvers and called immediately when
// command_result arrives via WebSocket — no DB polling required.
// command_result arrives via WebSocket: no DB polling required.
async function waitForCommandResult(executionId, commandId, timeout) {
return new Promise((resolve) => {
const timer = setTimeout(() => {
@@ -1366,7 +1366,7 @@ app.get('/api/workflows/:id', authenticateSSO, async (req, res) => {
definition = typeof wf.definition === 'string'
? JSON.parse(wf.definition || '{}')
: (wf.definition || {});
} catch { /* corrupt definition — return empty */ }
} catch { /* corrupt definition: return empty */ }
res.json({ ...wf, definition });
} catch (error) {
console.error('[API] GET /api/workflows/:id error:', error);
@@ -1427,7 +1427,7 @@ app.post('/api/workers/heartbeat', async (req, res) => {
const { worker_id, name, metadata } = req.body;
const apiKey = req.headers['x-api-key'];
// Verify API key — reject missing or wrong keys
// Verify API key: reject missing or wrong keys
if (!checkWorkerKey(apiKey)) {
return res.status(401).json({ error: 'Invalid API key' });
}
@@ -1992,7 +1992,7 @@ app.post('/api/workers/:id/command', authenticateSSO, requireJSON, async (req, r
}
});
// 404 — JSON under /api/, themed HTML elsewhere
// 404: JSON under /api/, themed HTML elsewhere
app.use((req, res) => {
if (req.path.startsWith('/api/')) {
return res.status(404).json({ error: 'Not found' });
@@ -2033,7 +2033,7 @@ initDatabase().then(() => {
console.log(`Worker auth enforcement: ${workerAuthEnforced() ? 'ON (keyless workers refused)' : 'OFF (keyless workers allowed with a warning; set WORKER_AUTH_ENFORCE=1 once all workers send their key)'}`);
if (DEV_READONLY) {
console.warn('************************************************************');
console.warn('* PULSE_DEV_READONLY IS ON — background jobs are disabled *');
console.warn('* PULSE_DEV_READONLY IS ON - background jobs are disabled *');
console.warn('* No cleanup, scheduler, stale-worker or recovery writes. *');
console.warn('************************************************************');
}