mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 16:26:36 +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>
118 lines
4.3 KiB
TypeScript
118 lines
4.3 KiB
TypeScript
import { withCommandCancellation } from "./cli/commandCancellation.js";
|
|
import { parseCliJsonInput } from "./cliJsonInput.js";
|
|
import { analysisInputErrorFromIssues } from "./domain/inputIssueProjection.js";
|
|
import { bundleComparisonInputSchema } from "./domain/bundleComparison.js";
|
|
import { Cli, z } from "incur";
|
|
|
|
import {
|
|
compareEvidenceBundlesCommand,
|
|
exportEvidenceBundleCommand,
|
|
importEvidenceBundleCommand,
|
|
} from "./application/EvidenceBundleCommands.js";
|
|
import { logCliCommand } from "./cliLogging.js";
|
|
import type { Logger } from "pino";
|
|
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
|
import type { JsonValue } from "./domain/jsonValue.js";
|
|
import { projectAnalysisError } from "./domain/analysisErrorProjection.js";
|
|
import type { AnalysisError } from "./domain/analysisErrorBase.js";
|
|
import { localPathStringSchema } from "./domain/localPath.js";
|
|
|
|
/** Register caller-path Evidence commands. */
|
|
export const registerEvidenceCommands = (
|
|
cli: ReturnType<typeof Cli.create>,
|
|
logger: Logger,
|
|
): void => {
|
|
cli.command(CLI_COMMANDS.evidenceImport, {
|
|
description:
|
|
"Validate a standalone Evidence bundle and count records and Unknown revisions; does not retain them in an MCP session",
|
|
args: z.object({
|
|
path: localPathStringSchema.describe("Evidence bundle JSON path"),
|
|
}),
|
|
run: ({ args }) =>
|
|
withCommandCancellation((signal) =>
|
|
logCliCommand(logger, "evidence-import", async () => {
|
|
const imported = await importEvidenceBundleCommand(args.path, signal);
|
|
return imported.ok ? imported.value : cliError(imported.error);
|
|
}),
|
|
),
|
|
});
|
|
cli.command(CLI_COMMANDS.evidenceExport, {
|
|
description: "Validate and atomically export canonical Evidence JSON",
|
|
args: z.object({
|
|
source: localPathStringSchema.describe(
|
|
"Existing evidence bundle JSON path",
|
|
),
|
|
output: localPathStringSchema.describe("Canonical output JSON path"),
|
|
}),
|
|
options: z.object({
|
|
overwrite: z.boolean().default(false).describe("Replace output file"),
|
|
}),
|
|
run: ({ args, options }) =>
|
|
withCommandCancellation((signal) =>
|
|
logCliCommand(logger, "evidence-export", async () => {
|
|
const exported = await exportEvidenceBundleCommand(
|
|
args.source,
|
|
args.output,
|
|
options.overwrite,
|
|
signal,
|
|
);
|
|
return exported.ok ? exported.value : cliError(exported.error);
|
|
}),
|
|
),
|
|
});
|
|
cli.command(CLI_COMMANDS.compare, {
|
|
description:
|
|
"Compare two canonical Evidence bundles by record identity; use compare-artifacts for artifact inventory contents",
|
|
args: z.object({
|
|
left: localPathStringSchema.describe("Left Evidence bundle JSON path"),
|
|
right: localPathStringSchema.describe("Right Evidence bundle JSON path"),
|
|
}),
|
|
options: z.object({
|
|
record_pairs: z
|
|
.string()
|
|
.optional()
|
|
.describe(
|
|
"Inline JSON array or local JSON file of left_evidence_id/right_evidence_id pairs",
|
|
),
|
|
}),
|
|
run: ({ args, options }) =>
|
|
withCommandCancellation((signal) =>
|
|
logCliCommand(logger, "compare", async () => {
|
|
const decoded =
|
|
options.record_pairs === undefined
|
|
? { ok: true as const, value: [] }
|
|
: await parseCliJsonInput(
|
|
options.record_pairs,
|
|
"compare_bundles",
|
|
signal,
|
|
);
|
|
if (!decoded.ok) return decoded.error;
|
|
const input = { record_pairs: decoded.value };
|
|
const selected = bundleComparisonInputSchema
|
|
.pick({ record_pairs: true })
|
|
.safeParse(input);
|
|
if (!selected.success)
|
|
return cliError(
|
|
analysisInputErrorFromIssues(
|
|
"compare_bundles",
|
|
selected.error.issues,
|
|
input,
|
|
),
|
|
);
|
|
const compared = await compareEvidenceBundlesCommand({
|
|
leftPath: args.left,
|
|
rightPath: args.right,
|
|
recordPairs: selected.data.record_pairs,
|
|
signal,
|
|
});
|
|
return compared.ok ? compared.value : cliError(compared.error);
|
|
}),
|
|
),
|
|
});
|
|
};
|
|
|
|
const cliError = (error: AnalysisError): JsonValue => ({
|
|
error: "Analysis failed",
|
|
...projectAnalysisError(error),
|
|
});
|