mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
refactor(cli)!: name a failure's per-call control flag at the CLI boundary (#11413)
* refactor(cli)!: name a failure's per-call control flag at the CLI boundary Services name the contract field a deadline failure reports in details.limit.parameter; a contract command's output projection adds details.limit.cli_flag from the command's own field-to-flag binding. BREAKING CHANGE: MCP failures no longer carry details.limit.cli_flag, and native deadline remediation text no longer names the CLI flag. CLI output still reports cli_flag for the command that ran. * fix(cli): key nested flattened members by their dotted path; restore the test's exit status * refactor(reverse): bind command_timeout_ms as the per-call control of an objdump or Rizin deadline (#11442) * refactor(reverse): bind command_timeout_ms as the per-call control of an objdump or Rizin deadline The deadline failure now comes from nativeDeadlineRecovery: it names command_timeout_ms and carries limit {control_kind: "parameter"}, so the CLI projection adds --command-timeout-ms and MCP output names the field only. The service no longer writes CLI flag text. * refactor(wasm): bind max_artifact_paths as the per-call control of an auxiliary path admission refusal (#11444)
This commit is contained in:
1 parent
23eee86bd5
commit
49d4991a18
18 files changed
+321
-45
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { HOST_PLATFORM } from "../../platform/HostPlatform.js";
|
||||
import { MAX_NODE_TIMER_DELAY_MS } from "../../domain/analysisResourceLimits.js";
|
||||
import { nativeDeadlineRecovery } from "../../domain/native/nativeDeadlines.js";
|
||||
import { Budget } from "../../domain/budget.js";
|
||||
import {
|
||||
ArtifactResourceScope,
|
||||
@@ -1459,17 +1459,20 @@ const runtimeControlPreparationError = (
|
||||
return windowsNativeSpawnControlError(cause);
|
||||
};
|
||||
|
||||
const reverseCommandTimeoutGuidance = (
|
||||
provider: string,
|
||||
timeoutMs: number,
|
||||
): { readonly userMessage: string; readonly remediationAction: string } => ({
|
||||
userMessage: `This ${provider} command reached its ${String(timeoutMs)} ms server/provider deadline (command_timeout_ms) during target preflight or the one-shot command (deadlineExpired). This is not a Ghidra or Hopper startup deadline and not a debugger session deadline.`,
|
||||
remediationAction: `${
|
||||
timeoutMs < MAX_NODE_TIMER_DELAY_MS
|
||||
? `Increase command_timeout_ms above ${String(timeoutMs)} (integer milliseconds from 1 to ${String(MAX_NODE_TIMER_DELAY_MS)}; omitted means ${String(DEFAULT_REVERSE_COMMAND_TIMEOUT_MS)}), or use --command-timeout-ms on the CLI.`
|
||||
: `command_timeout_ms is already at the maximum ${String(MAX_NODE_TIMER_DELAY_MS)} ms; no higher deadline is supported.`
|
||||
} The new value applies on the next call; no restart is required. The combined output allowance is separately selected by max_output_bytes (default ${String(DEFAULT_REVERSE_COMMAND_OUTPUT_BYTES)} bytes). Allow execution, cleanup and delivery headroom in the outer MCP client deadline. Confirm outstanding work and cleanup before retrying.`,
|
||||
});
|
||||
/**
|
||||
* The deadline failure names `command_timeout_ms` and binds it as the
|
||||
* per-call control; each adapter names the option that sets it.
|
||||
*/
|
||||
const reverseCommandTimeoutGuidance = (provider: string, timeoutMs: number) =>
|
||||
nativeDeadlineRecovery({
|
||||
timeoutMs,
|
||||
parameter: "command_timeout_ms",
|
||||
defaultMs: DEFAULT_REVERSE_COMMAND_TIMEOUT_MS,
|
||||
phase: `${provider} command deadline`,
|
||||
unchanged: `No restart is required. The combined output allowance is separately selected by max_output_bytes (default ${String(DEFAULT_REVERSE_COMMAND_OUTPUT_BYTES)} bytes).`,
|
||||
detail:
|
||||
" It covers target preflight and the one-shot command (deadlineExpired); it is not a Ghidra or Hopper startup deadline or a debugger session deadline.",
|
||||
});
|
||||
|
||||
export const digestFile = async (
|
||||
path: string,
|
||||
|
||||
@@ -74,7 +74,17 @@ export class WasmArtifactService {
|
||||
},
|
||||
{
|
||||
retryable: false,
|
||||
remediationAction: `Raise max_artifact_paths to at least ${String(input.value[field].length)} (maximum ${String(MAX_WASM_ARTIFACT_PATHS)}), or use --max-artifact-paths on the CLI; then retry the same selection. The value applies on the next inspection without restart. File and command byte budgets remain independent.`,
|
||||
remediationAction: `Raise max_artifact_paths to at least ${String(input.value[field].length)} (maximum ${String(MAX_WASM_ARTIFACT_PATHS)}); then retry the same selection. The value applies on the next inspection without restart. File and command byte budgets remain independent.`,
|
||||
limit: {
|
||||
control_kind: "parameter",
|
||||
parameter: "max_artifact_paths",
|
||||
effective_value: maximumPaths,
|
||||
unit: "count",
|
||||
minimum: 1,
|
||||
maximum: MAX_WASM_ARTIFACT_PATHS,
|
||||
default_value: DEFAULT_WASM_ARTIFACT_PATHS,
|
||||
applies_at: "next_call",
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user