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:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
344b9b6dff
commit
e91c8c39c2
@@ -18,9 +18,11 @@ import {
|
||||
} from "./javascriptStaticAnalysisHelpers.js";
|
||||
import {
|
||||
reachSemanticValueLimit,
|
||||
semanticAmbiguousProvenance,
|
||||
semanticLimitProvenance,
|
||||
semanticLocalProvenance,
|
||||
semanticOriginsProvenance,
|
||||
semanticProvenance,
|
||||
semanticUnresolvedProvenance,
|
||||
uniqueSemanticOrigins,
|
||||
} from "./javascriptSemanticProvenance.js";
|
||||
import {
|
||||
@@ -196,12 +198,19 @@ const evaluateObject = (
|
||||
});
|
||||
}
|
||||
properties.sort((left, right) => compareCodePoints(left.name, right.name));
|
||||
return {
|
||||
status: "object",
|
||||
properties,
|
||||
unknownProperties,
|
||||
omittedProperties,
|
||||
};
|
||||
return unknownProperties
|
||||
? {
|
||||
status: "object",
|
||||
properties,
|
||||
unknownProperties: true,
|
||||
omittedProperties,
|
||||
}
|
||||
: {
|
||||
status: "object",
|
||||
properties,
|
||||
unknownProperties: false,
|
||||
omittedProperties: 0,
|
||||
};
|
||||
};
|
||||
|
||||
const evaluateArray = (
|
||||
@@ -230,7 +239,9 @@ const evaluateArray = (
|
||||
}
|
||||
items.push(evaluateExpression(element, nestedContext(context)));
|
||||
}
|
||||
return { status: "array", items, unknownItems, omittedItems };
|
||||
return unknownItems
|
||||
? { status: "array", items, unknownItems: true, omittedItems }
|
||||
: { status: "array", items, unknownItems: false, omittedItems: 0 };
|
||||
};
|
||||
|
||||
const evaluateMember = (
|
||||
@@ -337,24 +348,31 @@ const provenanceForBinding = (
|
||||
context: EvaluationContext,
|
||||
): JavaScriptBindingProvenance => {
|
||||
if (context.bindings.has(binding.bindingId))
|
||||
return semanticProvenance("cycle", [], `Alias cycle at ${binding.name}.`);
|
||||
return semanticUnresolvedProvenance(
|
||||
"cycle",
|
||||
`Alias cycle at ${binding.name}.`,
|
||||
);
|
||||
if (context.depth >= context.state.limits.maxValueDepth)
|
||||
return semanticLimitProvenance(context.state, "maxValueDepth");
|
||||
if (binding.directOrigins.length > 0)
|
||||
return semanticOriginsProvenance(binding.directOrigins, context.state);
|
||||
if (binding.initializers.length === 0)
|
||||
return semanticProvenance("local", [], null);
|
||||
if (binding.initializers.length === 0) return semanticLocalProvenance();
|
||||
if (binding.initializers.length > 1)
|
||||
return semanticProvenance(
|
||||
"ambiguous",
|
||||
return semanticAmbiguousProvenance(
|
||||
[],
|
||||
`Binding ${binding.name} has multiple possible assignments.`,
|
||||
);
|
||||
const initializer = binding.initializers[0];
|
||||
if (initializer === undefined)
|
||||
return semanticProvenance("unknown", [], "Missing binding initializer.");
|
||||
return semanticUnresolvedProvenance(
|
||||
"unknown",
|
||||
"Missing binding initializer.",
|
||||
);
|
||||
if (initializer.projection.includes(null))
|
||||
return semanticProvenance("unknown", [], "Dynamic provenance projection.");
|
||||
return semanticUnresolvedProvenance(
|
||||
"unknown",
|
||||
"Dynamic provenance projection.",
|
||||
);
|
||||
const resolved = provenanceForExpression(
|
||||
initializer.node,
|
||||
nestedContext(context, binding.bindingId),
|
||||
@@ -383,15 +401,24 @@ const provenanceForExpression = (
|
||||
if (t.isIdentifier(node)) {
|
||||
const binding = resolveSemanticBindingState(context.state, node, node.name);
|
||||
return binding === undefined
|
||||
? semanticProvenance("unknown", [], `Unbound identifier ${node.name}.`)
|
||||
? semanticUnresolvedProvenance(
|
||||
"unknown",
|
||||
`Unbound identifier ${node.name}.`,
|
||||
)
|
||||
: provenanceForBinding(binding, nestedContext(context));
|
||||
}
|
||||
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
|
||||
if (!t.isNode(node.object))
|
||||
return semanticProvenance("unknown", [], "Unsupported member base.");
|
||||
return semanticUnresolvedProvenance(
|
||||
"unknown",
|
||||
"Unsupported member base.",
|
||||
);
|
||||
const member = memberKey(node);
|
||||
if (typeof member !== "string")
|
||||
return semanticProvenance("unknown", [], "Dynamic provenance member.");
|
||||
return semanticUnresolvedProvenance(
|
||||
"unknown",
|
||||
"Dynamic provenance member.",
|
||||
);
|
||||
const base = provenanceForExpression(node.object, nestedContext(context));
|
||||
return base.status !== "module"
|
||||
? base
|
||||
@@ -412,18 +439,16 @@ const provenanceForExpression = (
|
||||
];
|
||||
const origins = candidates.flatMap((candidate) => candidate.origins);
|
||||
return origins.length > 0
|
||||
? semanticProvenance(
|
||||
"ambiguous",
|
||||
? semanticAmbiguousProvenance(
|
||||
uniqueSemanticOrigins(origins),
|
||||
"Multiple module origins.",
|
||||
)
|
||||
: semanticProvenance(
|
||||
: semanticUnresolvedProvenance(
|
||||
"unknown",
|
||||
[],
|
||||
"Conditional provenance is unresolved.",
|
||||
);
|
||||
}
|
||||
return semanticProvenance("local", [], null);
|
||||
return semanticLocalProvenance();
|
||||
};
|
||||
|
||||
const requireOrigin = (node: t.Node): JavaScriptModuleOrigin | undefined => {
|
||||
|
||||
Reference in New Issue
Block a user