mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 18:35:53 +00:00
refactor(test): colocate pure-domain tests and reduce test debt (#471)
* refactor(test): colocate pure-domain tests and reduce test debt Move focused immutable domain/contracts/adapter tests from tests/composition/** beside their production owners under src/** as colocated *.test.ts/*.fixture.ts, and relocate persistence-shaped composition tests under tests/boundary/filesystem/**. Update import paths, the Vitest project topology (shared worker context for pure domain/contracts and recording-port service projects), the test migration ledger, testing docs, and AGENTS.md to match. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: remove test migration ledger The cutover is complete and the ledger is no longer referenced anywhere in source, scripts, or the docs gate. Drop the standalone artifact. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: clean up stale migration artifacts Remove empty directories left by the test migration and replace the "final cutover" language in docs/testing.md with standing PR guidance that no longer references the completed migration. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: repair CI failures from schema, knip, and stale generated artifacts Three root causes fixed: 1. catalog-schemas.mjs: valuesAt only traversed anyOf from Zod's toJSONSchema, not oneOf. The webScreenshotDiffSchema change to a discriminated union produces oneOf, so the product catalog generator could not derive the web_screenshot_diff schema version. Add oneOf traversal. 2. conformancePackage.ts: the test rewrite removed the only imports of ScenarioManifest, ReplayPlan, ShimPlan, and ExpectedEvidence, making them unused exports that knip flags. Remove the dead type aliases. 3. Regenerate stale artifacts (product catalog, MCP tool catalog, skill metadata, conformance manifest) that drifted from the source changes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
344b9b6dff
commit
e91c8c39c2
302 files changed
+6822
-5781
No files matched your search
@@ -1,6 +1,11 @@
|
||||
import { posix } from "node:path";
|
||||
|
||||
import type { ApplicationNode } from "../domain/javascriptApplicationGraph.js";
|
||||
import {
|
||||
completeApplicationCoverage,
|
||||
partialApplicationCoverage,
|
||||
truncatedApplicationCoverage,
|
||||
} from "../domain/javascriptApplicationEvidenceSchemas.js";
|
||||
import type {
|
||||
JavaScriptModuleOrigin,
|
||||
JavaScriptSemanticIr,
|
||||
@@ -16,11 +21,12 @@ import {
|
||||
} from "./JavaScriptArtifactGraphContext.js";
|
||||
import {
|
||||
astObservationEvidence,
|
||||
completeReconstructionCoverage,
|
||||
partialReconstructionCoverage,
|
||||
staticInferenceEvidence,
|
||||
} from "./JavaScriptArtifactGraphEvidence.js";
|
||||
import { resolveArtifactPathByContext } from "./JavaScriptArtifactPathResolution.js";
|
||||
import {
|
||||
resolveArtifactPathByContext,
|
||||
type ArtifactPathResolution,
|
||||
} from "./JavaScriptArtifactPathResolution.js";
|
||||
import { projectJavaScriptExportReturnShapes } from "./JavaScriptReturnShapeProjection.js";
|
||||
|
||||
interface SemanticAnalysis {
|
||||
@@ -36,18 +42,24 @@ interface RelationshipInput {
|
||||
readonly link: JavaScriptSemanticModuleLink;
|
||||
}
|
||||
|
||||
interface ResolvedModuleTarget {
|
||||
type ResolvedModuleTarget = {
|
||||
readonly node: ApplicationNode;
|
||||
readonly path: string | null;
|
||||
readonly file: JavaScriptArtifactFile | null;
|
||||
readonly status:
|
||||
| "resolved"
|
||||
| "not-found"
|
||||
| "unavailable"
|
||||
| "external"
|
||||
| "rejected";
|
||||
readonly limitations: readonly string[];
|
||||
}
|
||||
} & (
|
||||
| {
|
||||
readonly path: string;
|
||||
readonly file: JavaScriptArtifactFile;
|
||||
readonly status: "resolved";
|
||||
}
|
||||
| {
|
||||
readonly path: null;
|
||||
readonly file: null;
|
||||
readonly status: Exclude<
|
||||
ArtifactPathResolution["resolution_status"],
|
||||
"resolved"
|
||||
>;
|
||||
}
|
||||
);
|
||||
|
||||
/** Create one path-scoped source-module identity for every analyzed source file. */
|
||||
export const addJavaScriptSourceModules = (
|
||||
@@ -239,26 +251,32 @@ const resolveModuleTarget = (
|
||||
? "require"
|
||||
: "import",
|
||||
});
|
||||
const path = resolution.resolved_path;
|
||||
const file = path === null ? undefined : input.context.filesByPath.get(path);
|
||||
const node =
|
||||
path === null
|
||||
? undefined
|
||||
: (input.context.sourceModuleNodes.get(path) ??
|
||||
input.context.fileNodes.get(path));
|
||||
if (path !== null && file !== undefined && node !== undefined)
|
||||
if (resolution.resolution_status !== "resolved")
|
||||
return {
|
||||
node,
|
||||
path,
|
||||
file,
|
||||
status: "resolved",
|
||||
node: unresolvedModuleNode(
|
||||
input,
|
||||
specifier,
|
||||
resolution.resolution_status,
|
||||
),
|
||||
path: null,
|
||||
file: null,
|
||||
status: resolution.resolution_status,
|
||||
limitations: resolution.limitations,
|
||||
};
|
||||
const path = resolution.resolved_path;
|
||||
const file = input.context.filesByPath.get(path);
|
||||
const node =
|
||||
input.context.sourceModuleNodes.get(path) ??
|
||||
input.context.fileNodes.get(path);
|
||||
if (file === undefined || node === undefined)
|
||||
throw new TypeError(
|
||||
`Resolved artifact path ${path} is absent from its graph context.`,
|
||||
);
|
||||
return {
|
||||
node: unresolvedModuleNode(input, specifier, resolution.resolution_status),
|
||||
path: null,
|
||||
file: null,
|
||||
status: resolution.resolution_status,
|
||||
node,
|
||||
path,
|
||||
file,
|
||||
status: "resolved",
|
||||
limitations: resolution.limitations,
|
||||
};
|
||||
};
|
||||
@@ -266,7 +284,7 @@ const resolveModuleTarget = (
|
||||
const unresolvedModuleNode = (
|
||||
input: RelationshipInput,
|
||||
specifier: string,
|
||||
status: ResolvedModuleTarget["status"],
|
||||
status: Exclude<ResolvedModuleTarget["status"], "resolved">,
|
||||
): ApplicationNode =>
|
||||
input.context.accumulator.addNode({
|
||||
kind: "javascript-module",
|
||||
@@ -360,12 +378,10 @@ const semanticCoverage = (
|
||||
unit: "items" as const,
|
||||
}));
|
||||
if (semantic.ir.coverage.status === "complete")
|
||||
return completeReconstructionCoverage(limits);
|
||||
return partialReconstructionCoverage(
|
||||
limits,
|
||||
semantic.ir.coverage.omittedCount,
|
||||
semantic.ir.coverage.status === "truncated",
|
||||
);
|
||||
return completeApplicationCoverage(limits);
|
||||
return semantic.ir.coverage.status === "truncated"
|
||||
? truncatedApplicationCoverage(limits, semantic.ir.coverage.omittedCount)
|
||||
: partialApplicationCoverage(limits, semantic.ir.coverage.omittedCount);
|
||||
};
|
||||
|
||||
const moduleFormat = (
|
||||
|
||||
Reference in new issue
Block a user