@riddledc/riddle-proof 0.5.48 → 0.5.49
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/dist/{chunk-2RS4PBYK.js → chunk-722PW3X3.js} +105 -9
- package/dist/{chunk-PLSGW2GI.js → chunk-CI2F66EE.js} +63 -0
- package/dist/{chunk-JOXTKWX6.js → chunk-U7Q3RB5D.js} +1 -1
- package/dist/{chunk-N3ZNBRIG.js → chunk-YJPQOAZG.js} +1 -1
- package/dist/{chunk-NOBFZDZG.js → chunk-YW77WDTR.js} +104 -10
- package/dist/cli.cjs +266 -17
- package/dist/cli.js +4 -4
- package/dist/codex-exec-agent.cjs +107 -10
- package/dist/codex-exec-agent.d.cts +1 -0
- package/dist/codex-exec-agent.d.ts +1 -0
- package/dist/codex-exec-agent.js +2 -1
- package/dist/engine-harness.cjs +166 -7
- package/dist/engine-harness.js +3 -3
- package/dist/index.cjs +268 -19
- package/dist/index.js +5 -5
- package/dist/local-agent.cjs +107 -10
- package/dist/local-agent.js +2 -1
- package/dist/openclaw.js +2 -2
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/dist/run-card.cjs +63 -0
- package/dist/run-card.js +1 -1
- package/dist/runner.js +3 -3
- package/dist/state.cjs +63 -0
- package/dist/state.js +2 -2
- package/dist/types.d.cts +12 -0
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -3650,6 +3650,68 @@ function compactText2(value, limit = 600) {
|
|
|
3650
3650
|
if (!text) return void 0;
|
|
3651
3651
|
return text.length <= limit ? text : `${text.slice(0, limit - 20).trimEnd()}...`;
|
|
3652
3652
|
}
|
|
3653
|
+
function numericValue(value) {
|
|
3654
|
+
const number = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
3655
|
+
return Number.isFinite(number) ? number : void 0;
|
|
3656
|
+
}
|
|
3657
|
+
function eventDetails(event) {
|
|
3658
|
+
return recordValue(recordValue(event)?.details) || {};
|
|
3659
|
+
}
|
|
3660
|
+
function collectRunnerMetrics(details) {
|
|
3661
|
+
const metrics = [];
|
|
3662
|
+
const adapterDetails = recordValue(details.adapter_details);
|
|
3663
|
+
const direct = recordValue(adapterDetails?.runner_metrics);
|
|
3664
|
+
if (direct) metrics.push(direct);
|
|
3665
|
+
const attempts = Array.isArray(adapterDetails?.attempt_summaries) ? adapterDetails.attempt_summaries : [];
|
|
3666
|
+
for (const attempt of attempts) {
|
|
3667
|
+
const attemptMetrics = recordValue(recordValue(attempt)?.runner_metrics);
|
|
3668
|
+
if (attemptMetrics) metrics.push(attemptMetrics);
|
|
3669
|
+
}
|
|
3670
|
+
return metrics;
|
|
3671
|
+
}
|
|
3672
|
+
function observabilityFrom(state) {
|
|
3673
|
+
const engineEvents = state.events.filter((event) => event.kind === "engine.result").map((event) => ({ event, details: eventDetails(event) }));
|
|
3674
|
+
const agentEvents = state.events.filter((event) => event.kind.startsWith("agent.")).map((event) => ({ event, details: eventDetails(event) })).filter(({ details }) => numericValue(details.duration_ms) !== void 0);
|
|
3675
|
+
const retryEvents = state.events.filter((event) => /retry|recovery/i.test(event.kind) || /retry|recovery/i.test(event.summary || "")).slice(-8);
|
|
3676
|
+
const runnerMetrics2 = agentEvents.flatMap(({ details }) => collectRunnerMetrics(details));
|
|
3677
|
+
const promptChars = runnerMetrics2.map((metrics) => numericValue(metrics.prompt_chars)).filter((value) => value !== void 0);
|
|
3678
|
+
const sum = (values) => values.reduce((total, value) => total + (value ?? 0), 0);
|
|
3679
|
+
const recentEngineTimings = engineEvents.slice(-8).map(({ event, details }) => compactRecord({
|
|
3680
|
+
checkpoint: event.checkpoint || null,
|
|
3681
|
+
stage: event.stage || null,
|
|
3682
|
+
duration_ms: numericValue(details.duration_ms),
|
|
3683
|
+
ok: details.ok ?? null
|
|
3684
|
+
}));
|
|
3685
|
+
const recentAgentTimings = agentEvents.slice(-8).map(({ event, details }) => {
|
|
3686
|
+
const metrics = collectRunnerMetrics(details);
|
|
3687
|
+
const localPromptChars = metrics.map((item) => numericValue(item.prompt_chars)).filter((value) => value !== void 0);
|
|
3688
|
+
return compactRecord({
|
|
3689
|
+
kind: event.kind,
|
|
3690
|
+
checkpoint: event.checkpoint || null,
|
|
3691
|
+
stage: event.stage || null,
|
|
3692
|
+
duration_ms: numericValue(details.duration_ms),
|
|
3693
|
+
prompt_chars: localPromptChars.length ? Math.max(...localPromptChars) : void 0,
|
|
3694
|
+
attempt_count: numericValue(recordValue(details.adapter_details)?.attempt_count)
|
|
3695
|
+
});
|
|
3696
|
+
});
|
|
3697
|
+
return compactRecord({
|
|
3698
|
+
engine_call_count: engineEvents.length,
|
|
3699
|
+
agent_call_count: agentEvents.length,
|
|
3700
|
+
engine_total_ms: sum(engineEvents.map(({ details }) => numericValue(details.duration_ms))),
|
|
3701
|
+
agent_total_ms: sum(agentEvents.map(({ details }) => numericValue(details.duration_ms))),
|
|
3702
|
+
max_agent_prompt_chars: promptChars.length ? Math.max(...promptChars) : void 0,
|
|
3703
|
+
total_agent_prompt_chars: promptChars.length ? sum(promptChars) : void 0,
|
|
3704
|
+
recent_engine_timings: recentEngineTimings.length ? recentEngineTimings : void 0,
|
|
3705
|
+
recent_agent_timings: recentAgentTimings.length ? recentAgentTimings : void 0,
|
|
3706
|
+
retry_event_count: retryEvents.length,
|
|
3707
|
+
recent_retry_reasons: retryEvents.length ? retryEvents.map((event) => compactRecord({
|
|
3708
|
+
kind: event.kind,
|
|
3709
|
+
checkpoint: event.checkpoint || null,
|
|
3710
|
+
stage: event.stage || null,
|
|
3711
|
+
summary: compactText2(event.summary, 240)
|
|
3712
|
+
})) : void 0
|
|
3713
|
+
});
|
|
3714
|
+
}
|
|
3653
3715
|
function visualDeltaFrom(input) {
|
|
3654
3716
|
const fullState = input.fullRiddleState || {};
|
|
3655
3717
|
const bundle = recordValue(fullState.evidence_bundle);
|
|
@@ -3762,6 +3824,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
3762
3824
|
proof_evidence_present: fullState.proof_evidence_present === true || Boolean(bundle?.proof_evidence || bundle?.proof_evidence_sample),
|
|
3763
3825
|
artifacts
|
|
3764
3826
|
}),
|
|
3827
|
+
observability: observabilityFrom(state),
|
|
3765
3828
|
stop_condition: compactRecord({
|
|
3766
3829
|
status: state.status,
|
|
3767
3830
|
terminal: isTerminalStatus(state.status),
|
|
@@ -4816,7 +4879,10 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
4816
4879
|
worktree_path: workdir || null
|
|
4817
4880
|
}
|
|
4818
4881
|
});
|
|
4882
|
+
const implementationStartedAt = timestamp3();
|
|
4883
|
+
const implementationStartedMs = Date.now();
|
|
4819
4884
|
const implementation = await agent.implementChange({ ...context, workdir });
|
|
4885
|
+
const implementationDurationMs = Date.now() - implementationStartedMs;
|
|
4820
4886
|
if (implementation.blocker || implementation.ok === false) {
|
|
4821
4887
|
recordEvent(state, {
|
|
4822
4888
|
kind: "agent.implementation.blocked",
|
|
@@ -4825,6 +4891,8 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
4825
4891
|
summary: implementation.summary || implementation.blocker?.message || "Implementation adapter reported a blocker.",
|
|
4826
4892
|
details: compactRecord({
|
|
4827
4893
|
worktree_path: workdir || null,
|
|
4894
|
+
started_at: implementationStartedAt,
|
|
4895
|
+
duration_ms: implementationDurationMs,
|
|
4828
4896
|
changed_files: implementation.changedFiles || [],
|
|
4829
4897
|
tests_run: implementation.testsRun || [],
|
|
4830
4898
|
implementation_notes: implementation.implementationNotes || null,
|
|
@@ -4850,6 +4918,8 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
4850
4918
|
summary: implementation.summary || "Implementation adapter returned without leaving a detectable git diff.",
|
|
4851
4919
|
details: compactRecord({
|
|
4852
4920
|
worktree_path: workdir || null,
|
|
4921
|
+
started_at: implementationStartedAt,
|
|
4922
|
+
duration_ms: implementationDurationMs,
|
|
4853
4923
|
changed_files: implementation.changedFiles || [],
|
|
4854
4924
|
tests_run: implementation.testsRun || [],
|
|
4855
4925
|
implementation_notes: implementation.implementationNotes || null,
|
|
@@ -4864,7 +4934,8 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
4864
4934
|
details: compactRecord({
|
|
4865
4935
|
worktree_path: workdir || null,
|
|
4866
4936
|
checkpoint: result.checkpoint || null,
|
|
4867
|
-
next_stage: "implement"
|
|
4937
|
+
next_stage: "implement",
|
|
4938
|
+
previous_duration_ms: implementationDurationMs
|
|
4868
4939
|
})
|
|
4869
4940
|
});
|
|
4870
4941
|
return {
|
|
@@ -4883,6 +4954,8 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
4883
4954
|
summary: implementation.summary || "Implementation adapter reported code changes.",
|
|
4884
4955
|
details: {
|
|
4885
4956
|
worktree_path: workdir || null,
|
|
4957
|
+
started_at: implementationStartedAt,
|
|
4958
|
+
duration_ms: implementationDurationMs,
|
|
4886
4959
|
diffDetected,
|
|
4887
4960
|
changed_files: implementation.changedFiles || [],
|
|
4888
4961
|
tests_run: implementation.testsRun || [],
|
|
@@ -4999,15 +5072,44 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
4999
5072
|
if (input.checkpoint_mode === "yield") {
|
|
5000
5073
|
return { terminal: checkpointAwaitingResult(state, result, input.checkpoint_visibility) };
|
|
5001
5074
|
}
|
|
5075
|
+
const startedAt = timestamp3();
|
|
5076
|
+
const startedMs = Date.now();
|
|
5077
|
+
recordEvent(state, {
|
|
5078
|
+
kind: "agent.recon_assessment.started",
|
|
5079
|
+
checkpoint,
|
|
5080
|
+
stage: "recon",
|
|
5081
|
+
summary: "Recon assessment agent started.",
|
|
5082
|
+
details: { started_at: startedAt }
|
|
5083
|
+
});
|
|
5002
5084
|
const assessment = await agent.assessRecon(context);
|
|
5085
|
+
const durationMs = Date.now() - startedMs;
|
|
5003
5086
|
const blocker = requirePayload("recon_assessment", assessment, state, result);
|
|
5004
|
-
if (blocker)
|
|
5087
|
+
if (blocker) {
|
|
5088
|
+
recordEvent(state, {
|
|
5089
|
+
kind: "agent.recon_assessment.blocked",
|
|
5090
|
+
checkpoint,
|
|
5091
|
+
stage: "recon",
|
|
5092
|
+
summary: blocker.message,
|
|
5093
|
+
details: compactRecord({
|
|
5094
|
+
started_at: startedAt,
|
|
5095
|
+
duration_ms: durationMs,
|
|
5096
|
+
blocker,
|
|
5097
|
+
adapter_details: assessment.details || null
|
|
5098
|
+
})
|
|
5099
|
+
});
|
|
5100
|
+
return { blocker };
|
|
5101
|
+
}
|
|
5005
5102
|
recordEvent(state, {
|
|
5006
5103
|
kind: "agent.recon_assessment.completed",
|
|
5007
5104
|
checkpoint,
|
|
5008
5105
|
stage: "recon",
|
|
5009
5106
|
summary: assessment.summary,
|
|
5010
|
-
details: {
|
|
5107
|
+
details: compactRecord({
|
|
5108
|
+
payload: assessment.payload,
|
|
5109
|
+
started_at: startedAt,
|
|
5110
|
+
duration_ms: durationMs,
|
|
5111
|
+
adapter_details: assessment.details || null
|
|
5112
|
+
})
|
|
5011
5113
|
});
|
|
5012
5114
|
return {
|
|
5013
5115
|
next: { ...baseContinuation(result), recon_assessment_json: jsonParam(assessment.payload) }
|
|
@@ -5019,15 +5121,44 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5019
5121
|
if (input.checkpoint_mode === "yield") {
|
|
5020
5122
|
return { terminal: checkpointAwaitingResult(state, result, input.checkpoint_visibility) };
|
|
5021
5123
|
}
|
|
5124
|
+
const startedAt = timestamp3();
|
|
5125
|
+
const startedMs = Date.now();
|
|
5126
|
+
recordEvent(state, {
|
|
5127
|
+
kind: "agent.author_packet.started",
|
|
5128
|
+
checkpoint,
|
|
5129
|
+
stage: "author",
|
|
5130
|
+
summary: "Proof authoring agent started.",
|
|
5131
|
+
details: { started_at: startedAt }
|
|
5132
|
+
});
|
|
5022
5133
|
const packet = await agent.authorProofPacket(context);
|
|
5134
|
+
const durationMs = Date.now() - startedMs;
|
|
5023
5135
|
const blocker = requirePayload("author_packet", packet, state, result);
|
|
5024
|
-
if (blocker)
|
|
5136
|
+
if (blocker) {
|
|
5137
|
+
recordEvent(state, {
|
|
5138
|
+
kind: "agent.author_packet.blocked",
|
|
5139
|
+
checkpoint,
|
|
5140
|
+
stage: "author",
|
|
5141
|
+
summary: blocker.message,
|
|
5142
|
+
details: compactRecord({
|
|
5143
|
+
started_at: startedAt,
|
|
5144
|
+
duration_ms: durationMs,
|
|
5145
|
+
blocker,
|
|
5146
|
+
adapter_details: packet.details || null
|
|
5147
|
+
})
|
|
5148
|
+
});
|
|
5149
|
+
return { blocker };
|
|
5150
|
+
}
|
|
5025
5151
|
recordEvent(state, {
|
|
5026
5152
|
kind: "agent.author_packet.completed",
|
|
5027
5153
|
checkpoint,
|
|
5028
5154
|
stage: "author",
|
|
5029
5155
|
summary: packet.summary,
|
|
5030
|
-
details: {
|
|
5156
|
+
details: compactRecord({
|
|
5157
|
+
payload: packet.payload,
|
|
5158
|
+
started_at: startedAt,
|
|
5159
|
+
duration_ms: durationMs,
|
|
5160
|
+
adapter_details: packet.details || null
|
|
5161
|
+
})
|
|
5031
5162
|
});
|
|
5032
5163
|
return {
|
|
5033
5164
|
next: { ...baseContinuation(result), author_packet_json: jsonParam(packet.payload) }
|
|
@@ -5050,9 +5181,31 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5050
5181
|
if (input.checkpoint_mode === "yield") {
|
|
5051
5182
|
return { terminal: checkpointAwaitingResult(state, result, input.checkpoint_visibility) };
|
|
5052
5183
|
}
|
|
5184
|
+
const startedAt = timestamp3();
|
|
5185
|
+
const startedMs = Date.now();
|
|
5186
|
+
recordEvent(state, {
|
|
5187
|
+
kind: "agent.proof_assessment.started",
|
|
5188
|
+
checkpoint,
|
|
5189
|
+
stage: "verify",
|
|
5190
|
+
summary: "Proof assessment agent started.",
|
|
5191
|
+
details: { started_at: startedAt }
|
|
5192
|
+
});
|
|
5053
5193
|
const assessment = await agent.assessProof(context);
|
|
5194
|
+
const durationMs = Date.now() - startedMs;
|
|
5054
5195
|
const blocker = requirePayload("proof_assessment", assessment, state, result);
|
|
5055
5196
|
if (blocker) {
|
|
5197
|
+
recordEvent(state, {
|
|
5198
|
+
kind: "agent.proof_assessment.blocked",
|
|
5199
|
+
checkpoint,
|
|
5200
|
+
stage: "verify",
|
|
5201
|
+
summary: blocker.message,
|
|
5202
|
+
details: compactRecord({
|
|
5203
|
+
started_at: startedAt,
|
|
5204
|
+
duration_ms: durationMs,
|
|
5205
|
+
blocker,
|
|
5206
|
+
adapter_details: assessment.details || null
|
|
5207
|
+
})
|
|
5208
|
+
});
|
|
5056
5209
|
if (blocker.code === "main_agent_proof_review_required") {
|
|
5057
5210
|
recordEvent(state, {
|
|
5058
5211
|
kind: "checkpoint.packet.requested",
|
|
@@ -5071,7 +5224,12 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5071
5224
|
checkpoint,
|
|
5072
5225
|
stage: "verify",
|
|
5073
5226
|
summary: assessment.summary,
|
|
5074
|
-
details: {
|
|
5227
|
+
details: compactRecord({
|
|
5228
|
+
payload,
|
|
5229
|
+
started_at: startedAt,
|
|
5230
|
+
duration_ms: durationMs,
|
|
5231
|
+
adapter_details: assessment.details || null
|
|
5232
|
+
})
|
|
5075
5233
|
});
|
|
5076
5234
|
const visualBlocker = proofAssessmentVisualBlocker({
|
|
5077
5235
|
...context.fullRiddleState || {},
|
|
@@ -5092,7 +5250,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5092
5250
|
recovery_stage: "verify",
|
|
5093
5251
|
evidence_issue_code: recoveryAssessment.evidence_issue_code || null,
|
|
5094
5252
|
visual_delta: recoveryAssessment.visual_delta || null,
|
|
5095
|
-
proof_assessment: recoveryAssessment
|
|
5253
|
+
proof_assessment: recoveryAssessment,
|
|
5254
|
+
agent_duration_ms: durationMs
|
|
5096
5255
|
})
|
|
5097
5256
|
});
|
|
5098
5257
|
return { next: proofAssessmentContinuation(result, recoveryAssessment) };
|
|
@@ -5450,10 +5609,10 @@ var PROOF_SCHEMA = {
|
|
|
5450
5609
|
source: { type: "string", enum: ["supervising_agent"] }
|
|
5451
5610
|
}
|
|
5452
5611
|
};
|
|
5453
|
-
var PROMPT_STRING_LIMIT =
|
|
5454
|
-
var PROMPT_ARRAY_LIMIT =
|
|
5455
|
-
var PROMPT_OBJECT_KEY_LIMIT =
|
|
5456
|
-
var PROMPT_BLOCK_LIMIT =
|
|
5612
|
+
var PROMPT_STRING_LIMIT = 1400;
|
|
5613
|
+
var PROMPT_ARRAY_LIMIT = 8;
|
|
5614
|
+
var PROMPT_OBJECT_KEY_LIMIT = 50;
|
|
5615
|
+
var PROMPT_BLOCK_LIMIT = 7e4;
|
|
5457
5616
|
var PROMPT_KEY_PRIORITY = [
|
|
5458
5617
|
"ok",
|
|
5459
5618
|
"status",
|
|
@@ -5475,6 +5634,16 @@ var PROMPT_KEY_PRIORITY = [
|
|
|
5475
5634
|
"after_cdn",
|
|
5476
5635
|
"before_baseline",
|
|
5477
5636
|
"prod_baseline",
|
|
5637
|
+
"route_hints",
|
|
5638
|
+
"route_candidates",
|
|
5639
|
+
"keyword_hits",
|
|
5640
|
+
"observations",
|
|
5641
|
+
"latest_attempt",
|
|
5642
|
+
"attempt_history",
|
|
5643
|
+
"current_plan",
|
|
5644
|
+
"plan_history",
|
|
5645
|
+
"decision_history",
|
|
5646
|
+
"refined_inputs",
|
|
5478
5647
|
"recon_assessment",
|
|
5479
5648
|
"baseline_understanding",
|
|
5480
5649
|
"supervisor_author_packet",
|
|
@@ -5498,6 +5667,7 @@ var PROMPT_KEY_PRIORITY = [
|
|
|
5498
5667
|
"shipGate",
|
|
5499
5668
|
"last_error",
|
|
5500
5669
|
"errors",
|
|
5670
|
+
"runtime_events",
|
|
5501
5671
|
"events"
|
|
5502
5672
|
];
|
|
5503
5673
|
var PROMPT_PRIORITY_INDEX = new Map(PROMPT_KEY_PRIORITY.map((key, index) => [key, index]));
|
|
@@ -5514,7 +5684,7 @@ function compactPromptValue(value, depth = 0, key = "") {
|
|
|
5514
5684
|
if (!looksLikeUrl && (lowerKey.includes("base64") || lowerKey.includes("data_url") || lowerKey.includes("screenshot_blob"))) {
|
|
5515
5685
|
return `[omitted ${value.length} chars from ${key || "large artifact"}]`;
|
|
5516
5686
|
}
|
|
5517
|
-
const limit = looksLikeUrl ? 1e3 : depth <= 1 ? PROMPT_STRING_LIMIT :
|
|
5687
|
+
const limit = looksLikeUrl ? 1e3 : depth <= 1 ? PROMPT_STRING_LIMIT : 900;
|
|
5518
5688
|
return truncatePromptString(value, limit);
|
|
5519
5689
|
}
|
|
5520
5690
|
if (Array.isArray(value)) {
|
|
@@ -5645,11 +5815,39 @@ function isHarnessVerificationOnlyBlocker(blocker) {
|
|
|
5645
5815
|
const text = blocker.toLowerCase();
|
|
5646
5816
|
return (text.includes("erofs") || text.includes("read-only file system")) && text.includes("node_modules") && (text.includes(".vite-temp") || text.includes("vite.config"));
|
|
5647
5817
|
}
|
|
5818
|
+
function runnerMetrics(input) {
|
|
5819
|
+
const schemaText = JSON.stringify(input.request.schema);
|
|
5820
|
+
const finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5821
|
+
return compactRecord({
|
|
5822
|
+
purpose: input.request.purpose,
|
|
5823
|
+
workdir: input.request.workdir,
|
|
5824
|
+
started_at: input.startedAt,
|
|
5825
|
+
finished_at: finishedAt,
|
|
5826
|
+
duration_ms: Date.now() - input.startedMs,
|
|
5827
|
+
prompt_chars: input.request.prompt.length,
|
|
5828
|
+
prompt_lines: input.request.prompt.split(/\r?\n/).length,
|
|
5829
|
+
schema_chars: schemaText.length,
|
|
5830
|
+
stdout_chars: (input.stdout || "").length,
|
|
5831
|
+
stderr_chars: (input.stderr || "").length,
|
|
5832
|
+
final_message_chars: (input.finalText || "").length,
|
|
5833
|
+
exit_status: input.status ?? null,
|
|
5834
|
+
timed_out: input.timedOut || false,
|
|
5835
|
+
error_code: input.errorCode,
|
|
5836
|
+
codex_command: input.config.codexCommand || "codex",
|
|
5837
|
+
codex_model: input.config.codexModel,
|
|
5838
|
+
codex_sandbox: input.config.codexSandbox || "workspace-write",
|
|
5839
|
+
codex_full_auto: input.config.codexFullAuto !== false,
|
|
5840
|
+
timeout_ms: Number(input.config.codexTimeoutMs || 6e5)
|
|
5841
|
+
});
|
|
5842
|
+
}
|
|
5648
5843
|
function createCodexExecJsonRunner(config = {}) {
|
|
5649
5844
|
return (request) => {
|
|
5845
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5846
|
+
const startedMs = Date.now();
|
|
5650
5847
|
if (!request.workdir || !(0, import_node_fs4.existsSync)(request.workdir)) {
|
|
5651
5848
|
return {
|
|
5652
5849
|
ok: false,
|
|
5850
|
+
metrics: runnerMetrics({ request, config, startedAt, startedMs, errorCode: "workdir_missing" }),
|
|
5653
5851
|
blocker: {
|
|
5654
5852
|
code: "codex_workdir_missing",
|
|
5655
5853
|
message: `Codex workdir does not exist for ${request.purpose}.`,
|
|
@@ -5694,6 +5892,17 @@ function createCodexExecJsonRunner(config = {}) {
|
|
|
5694
5892
|
ok: false,
|
|
5695
5893
|
stdout: proc.stdout || "",
|
|
5696
5894
|
stderr: proc.stderr || "",
|
|
5895
|
+
metrics: runnerMetrics({
|
|
5896
|
+
request,
|
|
5897
|
+
config,
|
|
5898
|
+
startedAt,
|
|
5899
|
+
startedMs,
|
|
5900
|
+
stdout: proc.stdout || "",
|
|
5901
|
+
stderr: proc.stderr || "",
|
|
5902
|
+
status: proc.status,
|
|
5903
|
+
timedOut,
|
|
5904
|
+
errorCode: proc.error.code || "spawn_error"
|
|
5905
|
+
}),
|
|
5697
5906
|
blocker: {
|
|
5698
5907
|
code: timedOut ? "codex_timeout" : "codex_exec_error",
|
|
5699
5908
|
message: timedOut ? `Codex timed out during ${request.purpose}.` : `Codex failed to start or complete ${request.purpose}.`,
|
|
@@ -5706,6 +5915,16 @@ function createCodexExecJsonRunner(config = {}) {
|
|
|
5706
5915
|
ok: false,
|
|
5707
5916
|
stdout: proc.stdout || "",
|
|
5708
5917
|
stderr: proc.stderr || "",
|
|
5918
|
+
metrics: runnerMetrics({
|
|
5919
|
+
request,
|
|
5920
|
+
config,
|
|
5921
|
+
startedAt,
|
|
5922
|
+
startedMs,
|
|
5923
|
+
stdout: proc.stdout || "",
|
|
5924
|
+
stderr: proc.stderr || "",
|
|
5925
|
+
status: proc.status,
|
|
5926
|
+
errorCode: "nonzero_exit"
|
|
5927
|
+
}),
|
|
5709
5928
|
blocker: {
|
|
5710
5929
|
code: "codex_nonzero_exit",
|
|
5711
5930
|
message: `Codex exited with status ${proc.status} during ${request.purpose}.`,
|
|
@@ -5720,6 +5939,17 @@ function createCodexExecJsonRunner(config = {}) {
|
|
|
5720
5939
|
ok: false,
|
|
5721
5940
|
stdout: proc.stdout || "",
|
|
5722
5941
|
stderr: proc.stderr || "",
|
|
5942
|
+
metrics: runnerMetrics({
|
|
5943
|
+
request,
|
|
5944
|
+
config,
|
|
5945
|
+
startedAt,
|
|
5946
|
+
startedMs,
|
|
5947
|
+
stdout: proc.stdout || "",
|
|
5948
|
+
stderr: proc.stderr || "",
|
|
5949
|
+
finalText,
|
|
5950
|
+
status: proc.status,
|
|
5951
|
+
errorCode: "invalid_json"
|
|
5952
|
+
}),
|
|
5723
5953
|
blocker: {
|
|
5724
5954
|
code: "codex_invalid_json",
|
|
5725
5955
|
message: `Codex completed ${request.purpose}, but did not return valid JSON.`,
|
|
@@ -5731,7 +5961,17 @@ function createCodexExecJsonRunner(config = {}) {
|
|
|
5731
5961
|
ok: true,
|
|
5732
5962
|
json: parsed,
|
|
5733
5963
|
stdout: proc.stdout || "",
|
|
5734
|
-
stderr: proc.stderr || ""
|
|
5964
|
+
stderr: proc.stderr || "",
|
|
5965
|
+
metrics: runnerMetrics({
|
|
5966
|
+
request,
|
|
5967
|
+
config,
|
|
5968
|
+
startedAt,
|
|
5969
|
+
startedMs,
|
|
5970
|
+
stdout: proc.stdout || "",
|
|
5971
|
+
stderr: proc.stderr || "",
|
|
5972
|
+
finalText,
|
|
5973
|
+
status: proc.status
|
|
5974
|
+
})
|
|
5735
5975
|
};
|
|
5736
5976
|
} finally {
|
|
5737
5977
|
(0, import_node_fs4.rmSync)(tmpDir, { recursive: true, force: true });
|
|
@@ -5752,14 +5992,21 @@ function payloadOrBlocker(raw, checkpoint) {
|
|
|
5752
5992
|
ok: false,
|
|
5753
5993
|
blocker: {
|
|
5754
5994
|
...blocker,
|
|
5755
|
-
checkpoint
|
|
5995
|
+
checkpoint,
|
|
5996
|
+
details: {
|
|
5997
|
+
...blocker.details || {},
|
|
5998
|
+
runner_metrics: raw.metrics || null
|
|
5999
|
+
}
|
|
5756
6000
|
}
|
|
5757
6001
|
};
|
|
5758
6002
|
}
|
|
5759
6003
|
return {
|
|
5760
6004
|
ok: true,
|
|
5761
6005
|
payload: raw.json,
|
|
5762
|
-
summary: typeof raw.json.summary === "string" ? raw.json.summary : void 0
|
|
6006
|
+
summary: typeof raw.json.summary === "string" ? raw.json.summary : void 0,
|
|
6007
|
+
details: compactRecord({
|
|
6008
|
+
runner_metrics: raw.metrics || null
|
|
6009
|
+
})
|
|
5763
6010
|
};
|
|
5764
6011
|
}
|
|
5765
6012
|
function stringArray(value) {
|
|
@@ -5895,14 +6142,16 @@ function createCodexExecAgentAdapter(config = {}, runner = createCodexExecJsonRu
|
|
|
5895
6142
|
agent_summary: summary,
|
|
5896
6143
|
agent_changed_files: changedFiles,
|
|
5897
6144
|
agent_tests_run: testsRun,
|
|
5898
|
-
agent_blockers: blockers
|
|
6145
|
+
agent_blockers: blockers,
|
|
6146
|
+
runner_metrics: raw.metrics || null
|
|
5899
6147
|
};
|
|
5900
6148
|
attemptSummaries.push({
|
|
5901
6149
|
purpose,
|
|
5902
6150
|
summary,
|
|
5903
6151
|
changed_files: changedFiles,
|
|
5904
6152
|
tests_run: testsRun,
|
|
5905
|
-
blockers
|
|
6153
|
+
blockers,
|
|
6154
|
+
runner_metrics: raw.metrics || null
|
|
5906
6155
|
});
|
|
5907
6156
|
if (hardBlockers.length) {
|
|
5908
6157
|
return {
|
package/dist/cli.js
CHANGED
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
createDisabledRiddleProofAgentAdapter,
|
|
4
4
|
readRiddleProofRunStatus,
|
|
5
5
|
runRiddleProofEngineHarness
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-722PW3X3.js";
|
|
7
7
|
import "./chunk-4ASMX4R6.js";
|
|
8
8
|
import "./chunk-JFQXAJH2.js";
|
|
9
9
|
import {
|
|
10
10
|
createCodexExecAgentAdapter,
|
|
11
11
|
runCodexExecAgentDoctor
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-YW77WDTR.js";
|
|
13
|
+
import "./chunk-U7Q3RB5D.js";
|
|
14
|
+
import "./chunk-CI2F66EE.js";
|
|
15
15
|
import "./chunk-R6SCWJCI.js";
|
|
16
16
|
import "./chunk-DUFDZJOF.js";
|
|
17
17
|
|