mirror of
https://github.com/morluto/rea.git
synced 2026-11-08 07:46:28 +00:00
* docs: organize canonical documentation layout (URGENTE) Group all existing authored guides by domain and ownership, expose complete navigation, and preserve their public routes. Update physical path consumers and release configuration while retaining historical records. Document domain-based specs and ADR slugs without global numbering. Co-Authored-By: Codex <noreply@openai.com> * fix(docs): honor home layout in all-page route verification * style: format reviewed source changes * fix(docs): preserve routes and navigation cache inputs * fix: repair the static-check failures on the default branch (#2895) * fix: repair the static-check failures on the default branch The default branch fails its own required `Static checks` job three ways, so every pull request reports that job as failed regardless of its own change. - `npm run format:check` reports `src/domain/functionComparison.test.ts` and `src/ida/IdaOperationRunner.ts`. - `npm run lint` reports a duplicate `import { join } from "node:path"` in `tests/boundary/mcp/ghidraInventoryMcp.test.ts` (lines 4 and 17). - `npm run typecheck` reports `format: "devin"` missing from the client format union in `src/application/SupportedClients.ts`, and an unchecked index in `tests/boundary/cli/clientProfileLifecycle.test.ts`, whose pair array is inferred as `string[][]`. Apply the pinned formatter, drop the duplicate import, list the `"devin"` format that its own definition already uses, and mark the pair array `as const`. Validation: `npm run check:fast` and `npm run format:check` pass. * fix(setup): keep Devin on the JSON configuration dialect --------- Co-authored-by: 吴佳浩 <wujiahao@supremind.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> * fix(docs): update links after guide relocation * docs: correct verified documentation route counts * fix(docs): update browser capture guide link after move (#2820) Refresh gettext protected-link comments alongside the authored href. Co-authored-by: Codex <noreply@openai.com> * fix(docs): include http3 lab in stable routes * fix(docs): preserve historical release evidence and links * fix(ghidra): restore Windows verifier identity import * docs(wakaru): preserve pinned upstream policy link * docs(index): retain recently added guide links * docs(mcp): preserve parent retention clarification * fix(cli): preserve standalone import guidance * fix(test): preserve translated guide link drift coverage --------- Co-authored-by: Matheus Breguêz <matbrgz@gmail.com> Co-authored-by: Codex <noreply@openai.com> Co-authored-by: morluto <17176810+morluto@users.noreply.github.com> Co-authored-by: 吴佳浩Alben <35291372+XiaoBinGan@users.noreply.github.com> Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
133 lines
4.3 KiB
TypeScript
133 lines
4.3 KiB
TypeScript
import { Cli } from "incur";
|
|
import { expect, it, vi } from "vitest";
|
|
import { registerArtifactCommands } from "../../../src/cli/artifactCommands.js";
|
|
import { registerCoreBinaryCommands } from "../../../src/cli/coreBinaryCommands.js";
|
|
import { registerCoreNativeCommands } from "../../../src/cli/coreNativeCommands.js";
|
|
import { registerManagedCommands } from "../../../src/cli/managedCommands.js";
|
|
import { registerUtilityCommands } from "../../../src/cli/utilityCommands.js";
|
|
import { silentLogger } from "../../../src/logger.js";
|
|
|
|
const registry = () => {
|
|
const failure = {
|
|
ok: false as const,
|
|
error: { code: "invalid_request", message: "Admitted target control" },
|
|
};
|
|
const run = () =>
|
|
vi.fn(async (_path: string, ..._rest: unknown[]) => failure);
|
|
const runDirectAnalysis = run();
|
|
const runProviderAnalysis = run();
|
|
const cli = Cli.create("empty-target-admission", { sync: false });
|
|
registerArtifactCommands(cli, silentLogger, runProviderAnalysis);
|
|
registerCoreBinaryCommands(cli, silentLogger, runDirectAnalysis, {});
|
|
registerCoreNativeCommands(cli, silentLogger, runDirectAnalysis);
|
|
registerManagedCommands(cli, silentLogger, runProviderAnalysis);
|
|
registerUtilityCommands(
|
|
cli,
|
|
silentLogger,
|
|
{},
|
|
{
|
|
runProviderAnalysis,
|
|
runSessionStatus: async () => ({ ok: false, error: null }),
|
|
},
|
|
);
|
|
const serve = async (argv: readonly string[]): Promise<unknown> => {
|
|
let stdout = "";
|
|
await cli.serve([...argv, "--json"], {
|
|
env: {},
|
|
stdout: (text) => {
|
|
stdout += text;
|
|
},
|
|
exit: () => undefined,
|
|
});
|
|
return JSON.parse(stdout);
|
|
};
|
|
return { serve, runs: [runDirectAnalysis, runProviderAnalysis] };
|
|
};
|
|
|
|
// Each command with its other required arguments; the target comes first.
|
|
const commands: readonly (readonly string[])[] = [
|
|
["inspect-artifact"],
|
|
["extract-artifact"],
|
|
["inspect-keyed-archive"],
|
|
["trace-dylib-resolution"],
|
|
["inspect-asset-catalog"],
|
|
["decode-interface-builder"],
|
|
["inspect"],
|
|
["decompile", "main"],
|
|
["xrefs", "0x1000"],
|
|
["trace", "feature"],
|
|
["function", "0x1000"],
|
|
["instructions", "0x1000"],
|
|
["search", "name"],
|
|
["search-bytes", "00"],
|
|
["inspect-native-load-image"],
|
|
["read-bytes", "0x1000"],
|
|
["address-to-file-offset", "0x1000"],
|
|
["trace-native-values", "main"],
|
|
["inspect-native-instruction", "0x1000"],
|
|
["resolve-native-call-targets", "0x1000"],
|
|
["inspect-native-dispatch-metadata"],
|
|
["trace-native-ui-action", "openDocument:"],
|
|
["inspect-native-api", "0x1000"],
|
|
["annotate-native-function", "main", "--name", "entry"],
|
|
["inspect-managed-artifact"],
|
|
["inspect-managed-members"],
|
|
["inspect-managed-native-boundaries"],
|
|
["observe-native-ui", "--pid", "1", "--window-id", "1"],
|
|
[
|
|
"capture-native-ui-scenario",
|
|
"--pid",
|
|
"1",
|
|
"--window-id",
|
|
"1",
|
|
"--steps",
|
|
'[{"kind":"wait","milliseconds":0}]',
|
|
],
|
|
["inspect-macho"],
|
|
["inspect-signature"],
|
|
["list-architectures"],
|
|
["inspect-plist"],
|
|
["demangle-swift", "$s4main"],
|
|
];
|
|
|
|
it.each(commands)(
|
|
"rejects an empty or NUL %s target before resolution and admits explicit .",
|
|
async (command, ...rest) => {
|
|
const { serve, runs } = registry();
|
|
// docs/getting-started/cli.md: an empty string never selects the working directory.
|
|
expect(await serve([command, "", ...rest])).toMatchObject({
|
|
code: "VALIDATION_ERROR",
|
|
fieldErrors: [
|
|
expect.objectContaining({ path: "path", code: "too_small" }),
|
|
],
|
|
});
|
|
expect(await serve([command, "target\x00name", ...rest])).toMatchObject({
|
|
code: "VALIDATION_ERROR",
|
|
fieldErrors: [
|
|
expect.objectContaining({ path: "path", code: "invalid_format" }),
|
|
],
|
|
});
|
|
for (const run of runs) expect(run).not.toHaveBeenCalled();
|
|
await serve([command, ".", ...rest]);
|
|
expect(runs.flatMap((run) => run.mock.calls.map(([path]) => path))).toEqual(
|
|
["."],
|
|
);
|
|
},
|
|
);
|
|
|
|
it.each([
|
|
{ argv: ["", "."], field: "leftPath" },
|
|
{ argv: [".", ""], field: "rightPath" },
|
|
])(
|
|
"rejects an empty compare-managed-members $field before reading either input",
|
|
async ({ argv, field }) => {
|
|
const { serve } = registry();
|
|
expect(await serve(["compare-managed-members", ...argv])).toMatchObject({
|
|
code: "VALIDATION_ERROR",
|
|
fieldErrors: [
|
|
expect.objectContaining({ path: field, code: "too_small" }),
|
|
],
|
|
});
|
|
},
|
|
);
|