Skip to content
Closed
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion src/cli/coreBinaryCommands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { z } from "incur";

const localPath = z
.string()
.min(1)
.regex(/^[^\x00]*$/u, "Local path cannot contain NUL");
Comment on lines +3 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reuse the shared local-path schema

The shared boundary already exports localPathStringSchema from src/domain/localPath.ts with these exact nonempty/NUL-free constraints, and src/cli/firmwareCommands.ts already uses it directly with Incur. Introducing an independent copy here means changes to the shared path contract must also be maintained separately for analyze. AGENTS.md requires directly related cleanup of duplicated interpretations when fixing a boundary bug; import and use the existing schema instead of defining another owner for the same validation rule.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

import { stat } from "node:fs/promises";
import { resolve } from "node:path";

Expand Down Expand Up @@ -48,7 +53,7 @@ const registerOverviewCommands = (
cli.command(CLI_COMMANDS.analyze, {
description: "Get an overview of an app",
args: z.object({
path: z.string().describe("App, program, or analysis database path"),
path: localPath.describe("App, program, or analysis database path"),
}),
options: overviewOptions.extend({
integrityPolicy: javascriptApplicationOptions.shape.integrityPolicy,
Expand Down
Loading