-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathharness.cjs
More file actions
31 lines (25 loc) · 862 Bytes
/
Copy pathharness.cjs
File metadata and controls
31 lines (25 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env node
/**
* Riverbraid Harness
* Purpose: Protecting the internal frequency during external interaction.
*/
const { evaluateSafety } = require("./safety-gate.cjs");
const { reportMetrics } = require("./profiler.cjs");
const { logProof } = require("./proof-scaffold.cjs");
async function execute(taskName, logic) {
console.log(`--- Harness: Initiating [${taskName}] ---`);
// 1. Safety Check
evaluateSafety(taskName);
try {
// 2. Execution
const result = await logic();
// 3. Telemetry
reportMetrics(taskName);
logProof('HARNESS_EXECUTION_SUCCESS', true, { taskName });
return result;
} catch (error) {
logProof('HARNESS_EXECUTION_FAILURE', false, { taskName, error: error.message });
throw error;
}
}
module.exports = { execute };