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
+21
-20
@@ -13,11 +13,13 @@ import type {
|
||||
import {
|
||||
hopperStartupFailure,
|
||||
type HopperStartupDiagnostic,
|
||||
type HopperStartupFailureDiagnostic,
|
||||
type HopperStartupFailureCode,
|
||||
} from "./hopperStartupFailure.js";
|
||||
export {
|
||||
hopperStartupFailure,
|
||||
type HopperStartupDiagnostic,
|
||||
type HopperStartupFailureDiagnostic,
|
||||
type HopperStartupFailureCode,
|
||||
};
|
||||
export { projectAnalysisError } from "./analysisErrorProjection.js";
|
||||
@@ -454,7 +456,7 @@ export class HopperProcessError extends HopperError {
|
||||
|
||||
constructor(
|
||||
readonly exitCode: number | null,
|
||||
readonly diagnostic?: HopperStartupDiagnostic,
|
||||
readonly diagnostic?: HopperStartupFailureDiagnostic,
|
||||
) {
|
||||
super(`Hopper bridge stopped unexpectedly with code ${String(exitCode)}`);
|
||||
const failure = hopperStartupFailure(exitCode);
|
||||
@@ -541,32 +543,31 @@ export interface AnalysisErrorProjection
|
||||
readonly details?: Readonly<Record<string, JsonValue>>;
|
||||
}
|
||||
|
||||
/** One legal recovery path for a denied permission request. */
|
||||
export type PermissionRemediation = "configure" | "elicit" | "restart";
|
||||
|
||||
/** Exact denied authority and its legal recovery path. */
|
||||
export interface PermissionRequiredContext {
|
||||
readonly requested: PermissionRequest;
|
||||
readonly missing: MissingPermissionScope;
|
||||
readonly ceiling: PermissionScope | null;
|
||||
readonly remediation: PermissionRemediation;
|
||||
}
|
||||
|
||||
/** Exact denied authority used by both CLI and MCP remediation. */
|
||||
export class PermissionRequiredError extends AnalysisError {
|
||||
readonly _tag = "PermissionRequiredError" as const;
|
||||
readonly requested: PermissionRequest;
|
||||
readonly missing: MissingPermissionScope;
|
||||
readonly ceiling: PermissionScope | null;
|
||||
readonly elicitationSupported: boolean;
|
||||
readonly restartRequired: boolean;
|
||||
readonly remediation: PermissionRemediation;
|
||||
|
||||
constructor(
|
||||
...args: readonly [
|
||||
requested: PermissionRequest,
|
||||
missing: MissingPermissionScope,
|
||||
ceiling: PermissionScope | null,
|
||||
elicitationSupported: boolean,
|
||||
restartRequired: boolean,
|
||||
]
|
||||
) {
|
||||
const [requested, missing, ceiling, elicitationSupported, restartRequired] =
|
||||
args;
|
||||
super(`Permission required for ${requested.capability}`);
|
||||
this.requested = requested;
|
||||
this.missing = missing;
|
||||
this.ceiling = ceiling;
|
||||
this.elicitationSupported = elicitationSupported;
|
||||
this.restartRequired = restartRequired;
|
||||
constructor(context: PermissionRequiredContext) {
|
||||
super(`Permission required for ${context.requested.capability}`);
|
||||
this.requested = context.requested;
|
||||
this.missing = context.missing;
|
||||
this.ceiling = context.ceiling;
|
||||
this.remediation = context.remediation;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user