mirror of
https://github.com/morluto/rea.git
synced 2026-10-18 20:10:13 -05:00
Preserve applicable artifact processing phases and entered/unvisited status after interruption. Centralize JavaScript semantic applicability for full and incremental builders; retain native byte identity, actual JavaScript unknowns and structured-file provenance. Fixes #3948. Part of #4027. Validation:78 distinct focused cases across10files, full static/docs, and real Joplin timeout/default public CLI/MCP controls passed. Source pins, every attempt/outlier and compact resource/token projections are retained. No target/native provider execution or speedup claim. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
29 lines
937 B
JavaScript
29 lines
937 B
JavaScript
import { z } from "zod";
|
|
|
|
/** Independent expected outcomes supplied by the verification scenario. */
|
|
export const structuredScopeExpectationsSchema = z.record(
|
|
z.string().min(1),
|
|
z.strictObject({
|
|
operation: z.enum([
|
|
"parse-package-json",
|
|
"parse-json-module",
|
|
"parse-html-script-references",
|
|
"parse-local-source-map",
|
|
]),
|
|
analysis_status: z.enum(["interrupted", "not-started"]),
|
|
}),
|
|
);
|
|
|
|
/** Every retained gap must match the named phase and its unavailable status. */
|
|
export const matchesStructuredScopeExpectation = (scopes, expected) =>
|
|
expected !== undefined &&
|
|
scopes.length > 0 &&
|
|
scopes.every(
|
|
({ evidence, properties }) =>
|
|
evidence.authority === "artifact-bytes" &&
|
|
evidence.state === "unavailable" &&
|
|
evidence.confidence === "unknown" &&
|
|
properties.operation === expected.operation &&
|
|
properties.analysis_status === expected.analysis_status,
|
|
);
|