@volter/supercode-orchestrator 0.5.50 → 0.5.51
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/gates.mjs +5 -3
- package/loop.mjs +1 -1
- package/package.json +1 -1
package/gates.mjs
CHANGED
|
@@ -81,7 +81,7 @@ function scriptEnv() {
|
|
|
81
81
|
* else with python3; the cwd is the job's workdir, else the scripts folder.
|
|
82
82
|
* Returns `{ok, output}`; a failure's output is the reason, in Hermes's words.
|
|
83
83
|
*/
|
|
84
|
-
export async function runJobScript(profile, scriptPath, workdir = null, { env = process.env, signal = null, secrets = [], automation = null } = {}) {
|
|
84
|
+
export async function runJobScript(profile, scriptPath, workdir = null, { env = process.env, signal = null, secrets = [], automation = null, fire = null } = {}) {
|
|
85
85
|
const raw = String(scriptPath ?? '');
|
|
86
86
|
if (raw.includes('\0')) return { ok: false, output: `Blocked: script path contains a NUL byte: ${JSON.stringify(raw)}` };
|
|
87
87
|
const scriptsDir = join(profile.dir, 'scripts');
|
|
@@ -103,8 +103,10 @@ export async function runJobScript(profile, scriptPath, workdir = null, { env =
|
|
|
103
103
|
const out = { stdout: [], stderr: [] };
|
|
104
104
|
const size = { stdout: 0, stderr: 0 };
|
|
105
105
|
let finished = false;
|
|
106
|
-
// A scheduled script is an automation: what it files names the automation, never an agent or the OS user (C4)
|
|
107
|
-
|
|
106
|
+
// A scheduled script is an automation: what it files names the automation, never an agent or the OS user (C4).
|
|
107
|
+
// SUPERCODE_FIRE_ID names the fire it runs for, so what it files can be keyed to that fire (a retried run of the
|
|
108
|
+
// same fire files nothing new), not to the wall clock an interval schedule drifts against.
|
|
109
|
+
const child = spawn(argv[0], argv[1], { cwd, env: { ...scriptEnv(), HERMES_HOME: profile.dir, ...(automation ? { SUPERCODE_AUTOMATION: automation } : {}), ...(fire ? { SUPERCODE_FIRE_ID: String(fire) } : {}) }, detached: true, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
108
110
|
const kill = () => { try { process.kill(-child.pid, 'SIGKILL'); } catch { /* already gone */ } };
|
|
109
111
|
const end = (result) => {
|
|
110
112
|
if (finished) return;
|
package/loop.mjs
CHANGED
|
@@ -385,7 +385,7 @@ export class Orchestrator {
|
|
|
385
385
|
}
|
|
386
386
|
// Hermes runs a no_agent script in the job's workdir, and an agent job's
|
|
387
387
|
// pre-run script from the scripts folder
|
|
388
|
-
const script = gate.script ? await runJobScript(profile, gate.script, gate.no_agent ? workdir : null, { signal, secrets, automation: `cron:${profile.name}/${job.id}
|
|
388
|
+
const script = gate.script ? await runJobScript(profile, gate.script, gate.no_agent ? workdir : null, { signal, secrets, automation: `cron:${profile.name}/${job.id}`, fire: fire_id }) : null;
|
|
389
389
|
return { monitor, script };
|
|
390
390
|
})()
|
|
391
391
|
.catch((error) => ({ script: { ok: false, output: `Script execution failed: ${error.message}` } }))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.51",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
|
|
6
6
|
"exports": {
|