Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
519ebaa
feat(diagnostics): report a byte entropy profile for one local file
mvanhorn Oct 12, 2026
b82e190
fix(diagnostics): flag zero-size files as not shown empty
mvanhorn Oct 13, 2026
b87f511
fix(diagnostics): merge main and preserve entropy boundary failures
morluto Oct 13, 2026
7a67707
fix(mcp): reject unsupported diagnostic summaries before inspection
morluto Oct 13, 2026
eccc741
Merge remote-tracking branch 'origin/main' into fix/byte-entropy-profile
morluto Oct 13, 2026
a156b1d
fix(ci): repair integrated checks and Hopper test baseline
morluto Oct 13, 2026
a2f6136
test(entropy): use shared MCP schema verification after merge
morluto Oct 13, 2026
4df3682
chore: merge current main into PR #2331
morluto Oct 13, 2026
f54b2ae
Merge branch 'main' into fix/byte-entropy-profile
morluto Oct 13, 2026
3a794e9
Merge branch 'main' into fix/byte-entropy-profile
mvanhorn Oct 14, 2026
27c6fd9
fix(catalog): list inspect_byte_entropy under its own provider
mvanhorn Oct 15, 2026
f7367fc
fix(cli): resolve the byte-entropy path with absoluteCallerPath
mvanhorn Oct 19, 2026
4e6600d
Merge remote-tracking branch 'upstream/main' into fix/byte-entropy-pr…
mvanhorn Oct 19, 2026
e3e5891
Merge origin/main into fix/byte-entropy-profile
kaoru0822-kitauji Oct 21, 2026
1eef8d6
fix(diagnostics): retain entropy read cleanup ownership
morluto Oct 21, 2026
da99090
docs(diagnostics): explain entropy output capacity
morluto Oct 21, 2026
9be3d92
fix(diagnostics): preserve entropy cancellation outcomes
morluto Oct 21, 2026
cc585b5
fix(diagnostics): close the entropy input and warn on large reports
cursoragent Oct 21, 2026
2489602
fix(diagnostics): keep byte-entropy registration mergeable with main
cursoragent Oct 22, 2026
9d37354
fix(diagnostics): register byte entropy with the shared tool options
cursoragent Oct 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(cli): resolve the byte-entropy path with absoluteCallerPath
main replaced the node:path resolve import in binaryDiagnosticsCommands.ts
with absoluteCallerPath (#4067), so the byte-entropy command's
resolve(args.path) no longer type-checks once the PR is merged with main.
Use absoluteCallerPath like the other commands, and add
src/filesystem/callerPath.ts matching main so the branch builds on its own.
  • Loading branch information
mvanhorn committed Oct 19, 2026
commit f7367fccd9b49b9bc05f740f19772ba516023fef
3 changes: 2 additions & 1 deletion src/cli/binaryDiagnosticsCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { withCommandCancellation } from "./commandCancellation.js";
import { inspectPeResourcesInputSchema } from "../domain/native/peResources.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import { finishAnalysisCommand } from "./finishAnalysisCommand.js";
import { absoluteCallerPath } from "../filesystem/callerPath.js";

/** Inspect operator-selected files through the same shared workflow as MCP. */
export const registerBinaryDiagnosticsCommands = (
Expand Down Expand Up @@ -43,7 +44,7 @@ export const registerBinaryDiagnosticsCommands = (
logCliCommand(logger, CLI_COMMANDS.inspectByteEntropy, async () => {
const result = await entropy.inspect(
{
path: resolve(args.path),
path: absoluteCallerPath(args.path),
block_size: options.blockSize,
offset: options.offset,
length: options.length,
Expand Down
32 changes: 32 additions & 0 deletions src/filesystem/callerPath.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { posix, win32 } from "node:path";

/**
* Make a caller-selected local path absolute without changing which file it
* names. POSIX resolves `..` after following the preceding symlink, so lexical
* normalization of `link/../file` can select a different file. On POSIX, only
* interior `.` segments and repeated separators are removed, which never
* change the named file; every `..` is kept for the filesystem to resolve, and
* a trailing `/` or `/.` keeps its directory requirement as one trailing `/`.
* A relative `cwd` is made absolute the same way. Win32 resolves `..`
* lexically, so normalizing there is exact.
*/
export const absoluteCallerPath = (
path: string,
{
cwd = process.cwd(),
platform = process.platform,
}: { readonly cwd?: string; readonly platform?: NodeJS.Platform } = {},
): string => {
if (platform === "win32") return win32.resolve(cwd, path);
if (!posix.isAbsolute(path)) {
const base = posix.isAbsolute(cwd)
? cwd
: absoluteCallerPath(cwd, { platform });
return absoluteCallerPath(`${base}/${path}`, { platform });
}
const segments = path
.split("/")
.filter((segment) => segment !== "" && segment !== ".");
const directory = /\/\.?$/u.test(path) && segments.length > 0;
return `/${segments.join("/")}${directory ? "/" : ""}`;
};
Loading