refactor(javascript): share the reconstruction input contract

Remove the reconstruction-only request schema and consume the canonical parsed
JavaScript application input. Production already owns parsing at the service
boundary; direct test seams now use that same schema instead of a weaker path
contract. Preserve format, filesystem, source selection and lifecycle validation.

Add a NUL-path regression for canonical admission and typed input-error
projection. Verified 63 focused cases plus static, build, docs, discovery and
duplication checks; no target execution or real-provider claims.
This commit is contained in:
morluto
2026-10-24 15:02:26 +08:00
parent d68d03e88f
commit bdf15b9bd5
5 changed files with 49 additions and 31 deletions
+7 -2
View File
@@ -1,10 +1,10 @@
import { withArtifactResourceScope } from "../fixtures/artifactInventory.js";
import type { ExecutionOptions } from "../../src/application/AnalysisProvider.js";
import {
analyzeJavaScriptApplication as analyzeOwned,
type JavaScriptApplicationOptions,
} from "../../src/application/javascript/JavaScriptApplicationService.js";
import { reconstructJavaScriptArtifact as reconstructOwned } from "../../src/application/javascript/JavaScriptArtifactReconstruction.js";
import { analyzeJavaScriptApplicationInputSchema } from "../../src/domain/javascript/javascriptApplicationAnalysis.js";
import type { ProgressReporter } from "../../src/application/ProgressReporter.js";
import { readJavaScriptArtifactFiles as readOwned } from "../../src/artifacts/javascript/JavaScriptArtifactFiles.js";
import type { ArtifactReader } from "../../src/artifacts/ArtifactReader.js";
@@ -34,5 +34,10 @@ export const reconstructJavaScriptArtifact = (
progress?: ProgressReporter,
) =>
withArtifactResourceScope((scope) =>
reconstructOwned(rawInput, scope, signal, progress),
reconstructOwned(
analyzeJavaScriptApplicationInputSchema.parse(rawInput),
scope,
signal,
progress,
),
);