mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 14:35:45 +00:00
refactor(cli): project reconstruction and source-to-bundle documents from their contracts (#10697)
* refactor(cli): project reconstruction ledger and coverage commands from their contracts * refactor(cli): project compare-source-to-bundle from its contract and refuse omitted document fields * fix(cli): advertise caller paths in JSON documents as the CLI admits them * fix(cli): advertise that JSON document caller paths exclude URLs * refactor(cli): narrow omitted document field refusal to object documents * test(cli): give the coverage document fixture the current evidence_format
This commit is contained in:
1 parent
fd2eabb12a
commit
9be6a96fd6
12 files changed
+456
-182
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { requireAuthenticationHeadroom } from "../JsonAuthenticationHeadroom.js";
|
||||
import { setImmediate } from "node:timers/promises";
|
||||
import type { z } from "zod";
|
||||
import type { compareSourceToBundleCliInputSchema } from "../../contracts/javascript/applicationWorkflowInputContracts.js";
|
||||
import type { compareSourceToBundleRequestSchema } from "../../contracts/javascript/applicationWorkflowInputContracts.js";
|
||||
import {
|
||||
historicalSourceGraphSchema,
|
||||
type HistoricalSourceGraph,
|
||||
@@ -25,9 +25,11 @@ export type ResolvedSourceToBundleReference = {
|
||||
|
||||
/** Resolve one caller-selected historical graph using the shared bounded regular-file reader. No file cache. */
|
||||
export const resolveSourceToBundleReference = async (
|
||||
reference: z.output<typeof compareSourceToBundleCliInputSchema>["reference"],
|
||||
reference: z.output<typeof compareSourceToBundleRequestSchema>["reference"],
|
||||
signal?: AbortSignal,
|
||||
resources?: ArtifactResourceScope,
|
||||
/** The file path as the caller spelled it, when an adapter resolved it. */
|
||||
requestedPath?: string,
|
||||
): Promise<Result<ResolvedSourceToBundleReference, AnalysisError>> => {
|
||||
if (isAborted(signal))
|
||||
return err(cancelledBy("compare_source_to_bundle", signal));
|
||||
@@ -71,7 +73,7 @@ export const resolveSourceToBundleReference = async (
|
||||
reference_source: {
|
||||
kind: "file",
|
||||
path: read.value.path,
|
||||
requested_path: reference.path,
|
||||
requested_path: requestedPath ?? reference.path,
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user