@aiwg/cli 2026.11.1 → 2026.11.2
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/agentic/code/addons/aiwg-hooks/canonical/aiwg-prompt-discovery.yaml +9 -0
- package/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs +136 -0
- package/agentic/code/providers/model-capabilities.v1.json +27 -23
- package/agentic/code/providers/model-catalog.v1.json +3 -3
- package/dist/src/artifacts/cli.js +10 -11
- package/dist/src/artifacts/discover-cli-help.js +25 -0
- package/dist/src/artifacts/discover-session-facets.js +2 -1
- package/dist/src/artifacts/fortemi-core-prebuilt-freshness.js +28 -0
- package/dist/src/artifacts/fortemi-core-sync.js +3 -0
- package/dist/src/artifacts/framework-capabilities.js +4 -0
- package/dist/src/artifacts/framework-source-digest.js +1 -1
- package/dist/src/artifacts/index-builder.js +10 -10
- package/dist/src/artifacts/index-dependencies.js +72 -0
- package/dist/src/artifacts/query-engine-discover-output.js +13 -5
- package/dist/src/artifacts/query-engine-discover.js +49 -21
- package/dist/src/artifacts/query-engine-entries.js +56 -2
- package/dist/src/artifacts/query-engine-options.js +14 -1
- package/dist/src/artifacts/query-engine-scoring.js +8 -4
- package/dist/src/artifacts/query-engine-show-card.js +2 -0
- package/dist/src/artifacts/query-engine-show-load.js +1 -1
- package/dist/src/artifacts/query-engine-show.js +3 -1
- package/dist/src/artifacts/query-engine-templates.js +33 -0
- package/dist/src/artifacts/query-engine-verbose.js +25 -0
- package/dist/src/artifacts/relations-builder.js +49 -4
- package/dist/src/artifacts/relations.js +9 -0
- package/dist/src/artifacts/template-references.js +42 -0
- package/dist/src/artifacts/types.js +1 -1
- package/dist/src/cli/handlers/bundle-reconciliation.js +7 -3
- package/dist/src/cli/handlers/checkpoint-handoff.js +48 -0
- package/dist/src/cli/handlers/checkpoint-record.js +20 -0
- package/dist/src/cli/handlers/checkpoint.js +50 -17
- package/dist/src/cli/handlers/decision.js +1 -1
- package/dist/src/cli/handlers/doctor-args.js +3 -1
- package/dist/src/cli/handlers/doctor-help.js +2 -1
- package/dist/src/cli/handlers/help.js +1 -1
- package/dist/src/cli/handlers/refresh-bundles.js +2 -1
- package/dist/src/cli/handlers/refresh-managed-deployment.js +196 -0
- package/dist/src/cli/handlers/refresh.js +10 -2
- package/dist/src/cli/handlers/subcommands-discovery.js +8 -1
- package/dist/src/cli/handlers/use.js +10 -3
- package/dist/src/cli/services/deployment-verification.js +11 -7
- package/dist/src/config/worker-write.js +4 -10
- package/dist/src/decision/ledger.js +15 -15
- package/dist/src/decision/offload.js +6 -7
- package/dist/src/delivery/pr.js +2 -0
- package/dist/src/delivery/template-sections.js +56 -0
- package/dist/src/extensions/claude-hooks-installer.js +61 -53
- package/dist/src/extensions/managed-hook-script-state.js +48 -0
- package/dist/src/extensions/muse-managed-hooks.js +49 -0
- package/dist/src/issues/cli.js +3 -0
- package/dist/src/issues/external-cli.js +4 -1
- package/dist/src/issues/live.js +9 -2
- package/dist/src/issues/local.js +5 -1
- package/dist/src/issues/tracker-policy.js +11 -1
- package/dist/src/mcp/json-document.d.mts +2 -0
- package/dist/src/models/model-capabilities.v1.json +27 -23
- package/dist/src/models/model-catalog.v1.json +3 -3
- package/dist/src/models/provider-policy.js +8 -0
- package/dist/src/models/worker-health-readiness.js +20 -4
- package/dist/src/models/worker-health-snapshot.js +29 -0
- package/dist/src/models/worker-installation.d.mts +5 -1
- package/dist/src/models/worker-installation.mjs +11 -5
- package/dist/src/models/worker-qualification-policy.js +54 -0
- package/dist/src/providers/skill-ownership.d.mts +1 -0
- package/dist/src/providers/transformation-receipt-integration.js +4 -2
- package/dist/src/providers/transformation-receipt.js +4 -2
- package/dist/src/serve/worker-invocation.js +4 -2
- package/dist/src/smiths/context-pipeline/workspace-audit.js +34 -17
- package/dist/src/smiths/context-pipeline/workspace-context-shared.js +12 -6
- package/dist/src/smiths/context-pipeline/workspace-doctor.js +44 -4
- package/dist/src/smiths/context-pipeline/workspace-document.js +5 -2
- package/dist/src/smiths/context-pipeline/workspace-migration.js +2 -1
- package/dist/src/smiths/hook-bridge/codex-translator.js +150 -94
- package/dist/src/smiths/hook-bridge/codex-trust.js +50 -0
- package/dist/src/smiths/hook-bridge/factory-hook-config.js +132 -0
- package/dist/src/smiths/hook-bridge/factory-translator.js +88 -33
- package/dist/src/smiths/hook-bridge/index.js +3 -3
- package/dist/src/smiths/hook-bridge/loader.js +10 -2
- package/dist/src/smiths/hook-bridge/prompt-discovery-gaps.js +0 -1
- package/dist/src/storage/workspace-permissions-health.js +64 -0
- package/dist/src/storage/workspace-permissions.js +51 -0
- package/package.json +6 -1
- package/tools/agents/providers/base-files.mjs +2 -1
- package/tools/agents/providers/base-flat-artifacts.mjs +6 -3
- package/tools/agents/providers/base-models-platforms.mjs +3 -3
- package/tools/agents/providers/base-skill-copy.mjs +2 -0
- package/tools/agents/providers/bound-rules-pointer.mjs +21 -0
- package/tools/agents/providers/claude-post-deploy.mjs +9 -5
- package/tools/agents/providers/codex-post-deploy.mjs +10 -0
- package/tools/agents/providers/factory-hooks.mjs +43 -0
- package/tools/agents/providers/factory.mjs +4 -91
- package/tools/agents/providers/muse-hooks.mjs +4 -43
- package/tools/agents/providers/muse-prompt-discovery.mjs +3 -7
- package/tools/agents/providers/packaged-codex-agents.mjs +48 -0
- package/tools/agents/providers/rule-delivery-surface.mjs +4 -4
- package/tools/agents/providers/rule-presentation.mjs +6 -5
- package/tools/agents/providers/rule-projection.mjs +10 -2
- package/tools/agents/providers/rule-startup.mjs +8 -1
- package/tools/cli/decision-offload-report.mjs +7 -2
- package/tools/plugin/issue-template-copies.mjs +24 -0
- package/tools/plugin/package-plugins.mjs +11 -3
- package/tools/ralph-external/lib/factory-adapter.mjs +7 -8
- package/tools/ralph-external/lib/worker-artifacts.mjs +4 -2
- package/tools/ralph-external/lib/worker-final.mjs +43 -8
- package/tools/ralph-external/lib/worker-launch-cli.mjs +10 -1
- package/tools/ralph-external/lib/worker-prompt.mjs +35 -0
- package/tools/ralph-external/lib/worker-run-directory-refusal.mjs +8 -0
- package/tools/ralph-external/session-launcher.mjs +10 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Collect workerClaims candidates only after schema and on-disk artifact validation.
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { constants } from 'node:fs';
|
|
4
|
-
import { lstat, open } from 'node:fs/promises';
|
|
5
|
-
import { isAbsolute, relative, resolve } from 'node:path';
|
|
4
|
+
import { lstat, open, opendir } from 'node:fs/promises';
|
|
5
|
+
import { basename, isAbsolute, join, relative, resolve } from 'node:path';
|
|
6
6
|
import { importImpl } from '../../_resolve-impl.mjs';
|
|
7
7
|
import { boundedPrivateRead, withWorkerPath } from './worker-inputs.mjs';
|
|
8
8
|
import { parseStrictWorkerJson } from './strict-worker-json.mjs';
|
|
@@ -17,6 +17,29 @@ function schemaDiagnostic(error) {
|
|
|
17
17
|
return match ? `${match[1] === '/' ? '' : match[1]}/${escapePointer(match[3])} ${match[2]}` : error;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
// Names only: bounded, nonrecursive discovery never reads or accepts worker candidates.
|
|
21
|
+
async function rootCandidates(workdir, finalPath) {
|
|
22
|
+
const candidates = [];
|
|
23
|
+
let truncated = false, scanError = null;
|
|
24
|
+
try {
|
|
25
|
+
await withWorkerPath(workdir, async target => {
|
|
26
|
+
const root = await open(target, constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
27
|
+
try {
|
|
28
|
+
const entries = await opendir(`/proc/self/fd/${root.fd}`);
|
|
29
|
+
let scanned = 0;
|
|
30
|
+
for await (const entry of entries) {
|
|
31
|
+
if (++scanned > 256 || candidates.length === 32) { truncated = true; break; }
|
|
32
|
+
const path = join(workdir, entry.name);
|
|
33
|
+
if (entry.isFile() && path !== finalPath && /\.(json|jsonl|txt|md|ya?ml|csv)$/i.test(entry.name)) {
|
|
34
|
+
candidates.push({ path, location: 'worker-tree-root', candidate: true, verified: false });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} finally { await root.close(); }
|
|
38
|
+
});
|
|
39
|
+
} catch (error) { scanError = error.message; }
|
|
40
|
+
return { candidates: candidates.sort((a, b) => a.path.localeCompare(b.path)), truncated, scanError };
|
|
41
|
+
}
|
|
42
|
+
|
|
20
43
|
async function artifactErrors(claims, workdir) {
|
|
21
44
|
const errors = [];
|
|
22
45
|
for (const [index, artifact] of claims.artifacts.entries()) {
|
|
@@ -56,7 +79,7 @@ export async function collectWorkerFinal({ path, workdir, driver, output, invoca
|
|
|
56
79
|
await importImpl(import.meta.url, 'mission-protocol/index.js');
|
|
57
80
|
const scan = bytes => parseStrictWorkerJson(
|
|
58
81
|
new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(bytes), WORKER_MAX_NESTING_DEPTH);
|
|
59
|
-
let finalBytes, extracted = false, parsedClaims, parseError;
|
|
82
|
+
let finalBytes, extracted = false, parsedClaims, parseError, failureKind = 'invalid-file';
|
|
60
83
|
const evidence = () => ({ invocationId, path, digest: finalBytes ? digest(finalBytes) : null,
|
|
61
84
|
source: extracted ? 'adapter-extraction' : 'worker-output', candidate: true, verified: false });
|
|
62
85
|
try {
|
|
@@ -65,6 +88,7 @@ export async function collectWorkerFinal({ path, workdir, driver, output, invoca
|
|
|
65
88
|
await inspect(path, 'file');
|
|
66
89
|
let claims;
|
|
67
90
|
if (stat.size === 0 && driver.extractFinal) {
|
|
91
|
+
failureKind = output.length ? 'wrong-shape' : 'missing-file';
|
|
68
92
|
claims = driver.extractFinal(output.toString('utf8'));
|
|
69
93
|
if (claims === null || claims === undefined || claims.success === false) throw new Error('Missing or unsuccessful final extraction');
|
|
70
94
|
const bytes = JSON.stringify({ invocationId, source: 'adapter-extraction', candidate: true, verified: false, result: claims });
|
|
@@ -72,7 +96,8 @@ export async function collectWorkerFinal({ path, workdir, driver, output, invoca
|
|
|
72
96
|
await handle.writeFile(bytes); extracted = true;
|
|
73
97
|
}
|
|
74
98
|
finalBytes = await boundedPrivateRead(path, WORKER_MAX_JSON_BYTES, inspect, true);
|
|
75
|
-
if (!finalBytes.length) throw new Error('Missing final output');
|
|
99
|
+
if (!finalBytes.length) { failureKind = 'missing-file'; throw new Error('Missing final output'); }
|
|
100
|
+
failureKind = 'wrong-shape';
|
|
76
101
|
if (extracted) {
|
|
77
102
|
if (driver.parseWorkerFinal) {
|
|
78
103
|
try {
|
|
@@ -110,7 +135,10 @@ export async function collectWorkerFinal({ path, workdir, driver, output, invoca
|
|
|
110
135
|
if (!parseError) {
|
|
111
136
|
const validation = validateWorkerPayload('workerClaims', claims);
|
|
112
137
|
const errors = validation.errors.map(schemaDiagnostic);
|
|
113
|
-
if (validation.valid)
|
|
138
|
+
if (validation.valid) {
|
|
139
|
+
failureKind = 'invalid-artifact';
|
|
140
|
+
errors.push(...await artifactErrors(claims, workdir));
|
|
141
|
+
}
|
|
114
142
|
if (errors.length) {
|
|
115
143
|
result.finalOutputErrors = errors;
|
|
116
144
|
throw new Error('Invalid workerClaims');
|
|
@@ -118,13 +146,20 @@ export async function collectWorkerFinal({ path, workdir, driver, output, invoca
|
|
|
118
146
|
}
|
|
119
147
|
} catch (error) {
|
|
120
148
|
result.errorCode ??= 'FINAL_OUTPUT_INVALID';
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (
|
|
149
|
+
const found = await rootCandidates(workdir, path);
|
|
150
|
+
if (error.code === 'ENOENT') failureKind = 'missing-file';
|
|
151
|
+
if (failureKind === 'missing-file' && found.candidates.some(candidate => basename(candidate.path) === basename(path))) {
|
|
152
|
+
failureKind = 'wrong-location';
|
|
153
|
+
}
|
|
154
|
+
result.finalOutputFailure = { kind: failureKind, expectedPath: path,
|
|
155
|
+
message: `${failureKind}: final output at ${JSON.stringify(path)}: ${error.message}`,
|
|
156
|
+
...found };
|
|
124
157
|
// Adapter decoding uses assertValidWorkerPayload's existing rendered
|
|
125
158
|
// diagnostics; retain its pointers when validation fails inside it.
|
|
126
159
|
const schemaErrors = /^Invalid workerClaims: (.*)\.$/.exec(error.message)?.[1];
|
|
127
160
|
result.finalOutputErrors ??= schemaErrors ? schemaErrors.split('; ').map(schemaDiagnostic) : [`/ ${error.message}`];
|
|
161
|
+
// No candidate document exists for a missing/empty final; retain diagnostics in exit.json.
|
|
162
|
+
if (!finalBytes?.length) throw error;
|
|
128
163
|
await publish('final-evidence.json', { ...evidence(), terminalSuccess: false,
|
|
129
164
|
errorCode: 'FINAL_OUTPUT_INVALID', errors: result.finalOutputErrors });
|
|
130
165
|
throw error;
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
import { join, isAbsolute } from 'node:path';
|
|
3
3
|
import { boundedPrivateRead } from './worker-inputs.mjs';
|
|
4
4
|
|
|
5
|
+
export function workerFinalFailureMessage(result) {
|
|
6
|
+
const failure = result.finalOutputFailure;
|
|
7
|
+
if (!failure) return null;
|
|
8
|
+
const candidates = failure.candidates.map(candidate => JSON.stringify(candidate.path)).join(', ') || '(none)';
|
|
9
|
+
return `FINAL_OUTPUT_INVALID: ${failure.message}. Unverified candidate artifacts: ${candidates}`
|
|
10
|
+
+ (failure.truncated ? ' (scan truncated)' : '')
|
|
11
|
+
+ (failure.scanError ? ` (scan failed: ${failure.scanError})` : '');
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
export function parseWorkerLaunchArgs(args) {
|
|
6
15
|
const result = {};
|
|
7
16
|
const seen = new Set();
|
|
@@ -18,7 +27,7 @@ export function parseWorkerLaunchArgs(args) {
|
|
|
18
27
|
// A run directory declares a retry; its launcher ID is derived before validation.
|
|
19
28
|
const key = { '--invocation': 'invocationPath', '--run-dir': 'runDir',
|
|
20
29
|
'--retry-of': '__retryOfInvocationId', '--retry-of-run-dir': '__retryOfRunDir' }[flag];
|
|
21
|
-
if (!key) throw new Error(`Unsupported worker launch option: ${flag}
|
|
30
|
+
if (!key) throw new Error(`Unsupported worker launch option: ${flag}. Worker launch already emits JSON; for JSON status use aiwg ralph-external --status --workers --run-dir DIR --json separately. Run the resolved command unchanged.`);
|
|
22
31
|
const value = args[++i];
|
|
23
32
|
if (!value || value.startsWith('--')) throw new Error(`${flag} requires a value`);
|
|
24
33
|
if (key === '__retryOfInvocationId') retryOfInvocationId = value;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Add the final-output contract to launch-time briefs without changing the bound source brief.
|
|
2
|
+
export function workerPromptBrief(brief, finalPath) {
|
|
3
|
+
const text = Buffer.isBuffer(brief) ? new TextDecoder('utf-8', { fatal: true }).decode(brief) : brief;
|
|
4
|
+
return Buffer.from(`[Worker final-output contract]
|
|
5
|
+
Write one strict workerClaims JSON object to this exact absolute path: ${JSON.stringify(finalPath)}
|
|
6
|
+
The task's answer alone (for example {"facts":[],"warning":""}) is not the final-output wrapper.
|
|
7
|
+
Required minimal wrapper example (replace the summary and report your actual status):
|
|
8
|
+
{"version":1,"status":"completed","summary":"Task result","claims":[],"artifacts":[],"checks":[],"limitations":[]}
|
|
9
|
+
Allowed status: completed, partial, blocked, failed. Keep all seven fields; add no other top-level fields.
|
|
10
|
+
Put the answer in summary or a separate task artifact. For each listed artifact use
|
|
11
|
+
{"path":"answer.json","digest":"sha256:<64 lowercase hex characters>","change":"created"}
|
|
12
|
+
with a real digest and a file beneath the worker tree. Empty collections are allowed.
|
|
13
|
+
Keep this JSON separate from stdout, stderr and last-message captures. A file at the worker-tree root
|
|
14
|
+
does not satisfy a different declared final-output path. Worker claims remain unverified.
|
|
15
|
+
|
|
16
|
+
[Task]
|
|
17
|
+
${text}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// File-based profiles receive a private derived brief through the existing artifact lifecycle.
|
|
21
|
+
export function workerPromptArtifacts(invocation, { brief, invocationId } = {}) {
|
|
22
|
+
if (brief === undefined || invocation.stdin !== 'closed') return invocation;
|
|
23
|
+
const text = Buffer.isBuffer(brief) ? brief.toString('utf8') : brief;
|
|
24
|
+
const prompt = workerPromptBrief(brief, invocation.finalPath).toString('utf8');
|
|
25
|
+
if (invocation.argv.includes(invocation.briefPath)) {
|
|
26
|
+
const name = 'launcher-worker-brief', prefix = '.handoff/worker-brief-';
|
|
27
|
+
return { ...invocation, invocationId,
|
|
28
|
+
argv: invocation.argv.map(token => token === invocation.briefPath ? `\${artifact:${name}}` : token),
|
|
29
|
+
artifacts: [...(invocation.artifacts ?? []), { name, content: prompt, location: 'workspace-relative',
|
|
30
|
+
prefix, relativePath: `${prefix}${invocationId}/brief.md` }] };
|
|
31
|
+
}
|
|
32
|
+
// Skill-file profiles embed the brief after frontmatter. Preserve their framing.
|
|
33
|
+
return { ...invocation, artifacts: invocation.artifacts?.map(artifact => ({ ...artifact,
|
|
34
|
+
content: text && artifact.content.includes(text) ? artifact.content.replace(text, () => prompt) : artifact.content })) };
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Format bounded, actionable diagnostics for a refused worker run directory.
|
|
2
|
+
export function workerRunDirectoryRefusal(entries) {
|
|
3
|
+
const reason = 'Worker run directory must be fresh, empty, private and owned';
|
|
4
|
+
if (!entries.length) return reason;
|
|
5
|
+
const names = entries.toSorted().slice(0, 5).map(name => JSON.stringify(name)).join(', ');
|
|
6
|
+
const remaining = entries.length > 5 ? ` (+${entries.length - 5} more)` : '';
|
|
7
|
+
return `${reason}. Unexpected entries: ${names}${remaining}. Keep the plan and other files outside the run dir, or pass a new run dir.`;
|
|
8
|
+
}
|
|
@@ -51,6 +51,8 @@ export { assertManagedWorkerLaunch } from './lib/managed-worker-attempt.mjs';
|
|
|
51
51
|
import { buildSessionEnvironment } from './lib/session-environment.mjs';
|
|
52
52
|
import { withWorkerPath, boundedPrivateRead } from './lib/worker-inputs.mjs';
|
|
53
53
|
import { collectWorkerFinal } from './lib/worker-final.mjs';
|
|
54
|
+
import { workerRunDirectoryRefusal } from './lib/worker-run-directory-refusal.mjs';
|
|
55
|
+
import { workerPromptBrief } from './lib/worker-prompt.mjs';
|
|
54
56
|
import { prepareWorkerRetry, workerRetryRecordFields } from './lib/worker-retry-evidence.mjs';
|
|
55
57
|
import { settleWorkerTermination, terminationRemedy } from './lib/worker-termination.mjs';
|
|
56
58
|
import { WorkerCaptureOwner, assertWorkerCapturePathsAvailable } from './lib/worker-capture.mjs';
|
|
@@ -406,8 +408,9 @@ async function launchOneWorker(owner, options) {
|
|
|
406
408
|
const runExists = await inspect(runDir, 'directory');
|
|
407
409
|
if (runExists) {
|
|
408
410
|
const stat = await lstat(runDir);
|
|
409
|
-
|
|
410
|
-
|
|
411
|
+
const entries = stat.uid === process.getuid() && !(stat.mode & 0o077) ? await readdir(runDir) : [];
|
|
412
|
+
if (stat.uid !== process.getuid() || (stat.mode & 0o077) || entries.length) {
|
|
413
|
+
throw new Error(workerRunDirectoryRefusal(entries));
|
|
411
414
|
}
|
|
412
415
|
}
|
|
413
416
|
const writableRoots = inputs.drivers[invocation.selected.cli].qualification.installation?.workerWritableRoots ?? [invocation.cwd];
|
|
@@ -446,7 +449,7 @@ async function launchOneWorker(owner, options) {
|
|
|
446
449
|
// Frame stdin before any spawn: brief-json delivers a conductor-built params
|
|
447
450
|
// document on the stdin pipe, never brief text in argv (#2911).
|
|
448
451
|
const { workerStdinBytes } = await importImpl(import.meta.url, 'serve/worker-stdin-frame.mjs');
|
|
449
|
-
const stdinBytes = workerStdinBytes(invocation, brief, inputs.drivers[invocation.selected.cli]);
|
|
452
|
+
const stdinBytes = workerStdinBytes(invocation, workerPromptBrief(brief, paths.final), inputs.drivers[invocation.selected.cli]);
|
|
450
453
|
let gate = (options.checkDispatch ?? checkWorkerDispatch)({ config: inputs.snapshot.config,
|
|
451
454
|
paths: await Promise.all([invocation.cwd, runDir].map(workerDispatchPath)) });
|
|
452
455
|
if (!gate.ok) throw workerDispatchRefusal(gate);
|
|
@@ -666,7 +669,7 @@ async function launchOneWorker(owner, options) {
|
|
|
666
669
|
let outcome;
|
|
667
670
|
let artifacts;
|
|
668
671
|
try {
|
|
669
|
-
artifacts = await materializeWorkerArtifacts(invocation, runDir);
|
|
672
|
+
artifacts = await materializeWorkerArtifacts(invocation, runDir, { brief, invocationId });
|
|
670
673
|
const displayArgv = artifacts.argv.map((token, i) => i === 0 ? token : `<argument:${bytesDigest(token)}>`);
|
|
671
674
|
// #2915 review 4 (finding 4): a STABLE task-chain identity, never the
|
|
672
675
|
// raw request object — `qualificationDigest(saved.request)` included
|
|
@@ -692,7 +695,7 @@ async function launchOneWorker(owner, options) {
|
|
|
692
695
|
// Retain the legacy digest binding while naming both argv stages explicitly.
|
|
693
696
|
argvDigest: qualificationDigest(invocation.argv), placeholderArgvDigest: qualificationDigest(invocation.argv),
|
|
694
697
|
executedArgvDigest: qualificationDigest(artifacts.argv),
|
|
695
|
-
artifacts:
|
|
698
|
+
artifacts: artifacts.declarations.map(artifact => ({ name: artifact.name,
|
|
696
699
|
byteLength: Buffer.byteLength(artifact.content), sha256: bytesDigest(artifact.content) })),
|
|
697
700
|
envNames: buildWorkerInvocationEnvironment(invocation.envNames, invocationId, {}, invocation).envNames, stdin: invocation.stdin,
|
|
698
701
|
prompt: { path: invocation.briefPath, digest: invocation.briefDigest }, cwd: invocation.cwd,
|
|
@@ -1566,7 +1569,7 @@ async function launchOneWorkerBaseline(owner, options, ctx) {
|
|
|
1566
1569
|
let artifacts;
|
|
1567
1570
|
let managedSpawnAttempted = false;
|
|
1568
1571
|
try {
|
|
1569
|
-
artifacts = await materializeWorkerArtifacts(invocation, runDir);
|
|
1572
|
+
artifacts = await materializeWorkerArtifacts(invocation, runDir, { brief: ctx.brief, invocationId });
|
|
1570
1573
|
const displayArgv = artifacts.argv.map((token, i) => i === 0 ? token : `<argument:${bytesDigest(token)}>`);
|
|
1571
1574
|
await publish('invocation.json', { version: 1, origin: 'launcher', invocationId, attemptId: invocationId,
|
|
1572
1575
|
previousAttemptId: verifiedPreviousAttemptId ?? null, requestId: options.managedAdmission?.requestId ?? invocationId, taskDigest: options.retryEvidence?.taskDigest ?? qualificationDigest(saved.request), role: saved.request.role,
|
|
@@ -1578,7 +1581,7 @@ async function launchOneWorkerBaseline(owner, options, ctx) {
|
|
|
1578
1581
|
// Retain the legacy digest binding while naming both argv stages explicitly.
|
|
1579
1582
|
argvDigest: qualificationDigest(invocation.argv), placeholderArgvDigest: qualificationDigest(invocation.argv),
|
|
1580
1583
|
executedArgvDigest: qualificationDigest(artifacts.argv),
|
|
1581
|
-
artifacts:
|
|
1584
|
+
artifacts: artifacts.declarations.map(artifact => ({ name: artifact.name,
|
|
1582
1585
|
byteLength: Buffer.byteLength(artifact.content), sha256: bytesDigest(artifact.content) })),
|
|
1583
1586
|
envNames: buildWorkerInvocationEnvironment(invocation.envNames, invocationId, {}, invocation).envNames, stdin: invocation.stdin,
|
|
1584
1587
|
prompt: { path: invocation.briefPath, digest: invocation.briefDigest }, cwd: invocation.cwd,
|