fix(apple): report unusable dylib-resolution roots as invalid input
trace_dylib_resolution blamed the artifact for the caller's root selection. A missing root, a directory, or a symlink leading outside the bundle got "Artifact contains an unsafe or conflicting internal path ... correct the artifact". A non-Mach-O file such as Contents/Info.plist got "Artifact is invalid or has changed. Get a fresh copy". Any schema failure, including a bad architecture, was reported as "roots must be normalized paths". Report a caller-selected root that cannot be traced as an invalid_request issue on roots[i] with the failed constraint, and project schema failures through their real issues. The normalized-path rule now carries a readable message. Roots REA derives itself (bundle executables or the active target) keep reporting artifact failures. This matches what #1070 did for inspect_keyed_archive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b620e2a2bd
commit
24a30fd91c
@@ -22,7 +22,13 @@ import {
|
||||
/** Normalized path below the analyzed root: no `.`/`..` or empty segments. */
|
||||
const ROOT_RELATIVE_PATH =
|
||||
/^(?!\/)(?!(?:.*\/)?\.{1,2}(?:\/|$))(?!.*\/\/)(?!.*\/$)[^\\\0]+$/u;
|
||||
const rootRelativePathSchema = z.string().min(1).regex(ROOT_RELATIVE_PATH);
|
||||
const rootRelativePathSchema = z
|
||||
.string()
|
||||
.min(1)
|
||||
.regex(
|
||||
ROOT_RELATIVE_PATH,
|
||||
"Use a normalized path relative to the analyzed root, without a leading or trailing '/', '//', or '.' and '..' segments",
|
||||
);
|
||||
|
||||
/** Caller selection of process roots and one CPU slice. */
|
||||
export const dylibResolutionInputSchema = z.strictObject({
|
||||
|
||||
Reference in New Issue
Block a user