mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
* refactor(errors): read cleanup completion from dependencies instead of pushing it to dependents AnalysisError.cleanupIncomplete becomes a getter over the error's own unresolved state and its bound dependencies. The WeakRef dependents graph and resolveCleanup's push propagation are removed, and subclasses mark their initial state through markCleanupIncomplete instead of overriding a public mutable field. * fix(errors): settle bound dependencies before binding more A composite whose dependencies had released but whose status was never read stayed incomplete when a later dependency was bound. * refactor(errors): let errors read a lease group's release instead of resolving them (#10759) AnalysisCleanupLeaseGroup no longer calls resolveCleanup() on its error. The error holds the group as a release claim and reads cleanupReleased when asked, so completion follows the lease owner without a push. * chore(verify): count resolveCleanup and bindCleanupDependencies calls so they only shrink (#10763) * refactor(errors): let errors read a lease group's release instead of resolving them AnalysisCleanupLeaseGroup no longer calls resolveCleanup() on its error. The error holds the group as a release claim and reads cleanupReleased when asked, so completion follows the lease owner without a push. * chore(verify): count resolveCleanup and bindCleanupDependencies calls so they only shrink
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import type { JsonValue } from "./jsonValue.js";
|
|
import { ProviderAdapterError } from "./providerAdapterError.js";
|
|
import type {
|
|
AnalysisErrorOptions,
|
|
AnalysisPartialObservation,
|
|
} from "./analysisErrorBase.js";
|
|
|
|
/** Provider resources could not be proven closed after bounded cleanup. */
|
|
export class ProviderCleanupError extends ProviderAdapterError {
|
|
override readonly userMessage =
|
|
"Provider cleanup could not be fully confirmed. Review the reported local resources before opening another target.";
|
|
|
|
/** Producer-attested completed output; ordinary partial observations cannot recover success. */
|
|
readonly completedObservation: AnalysisPartialObservation | undefined;
|
|
|
|
constructor(
|
|
providerId: string,
|
|
resources: readonly string[],
|
|
diagnostics: Readonly<Record<string, JsonValue>>,
|
|
/** Identify the operation owning these resources; binary callers retain their default. */
|
|
options?: Omit<AnalysisErrorOptions, "diagnostics"> & {
|
|
readonly operation?: string;
|
|
readonly remediationAction?: string;
|
|
readonly completedObservation?: AnalysisPartialObservation;
|
|
},
|
|
) {
|
|
const {
|
|
operation = "close_binary",
|
|
completedObservation,
|
|
...errorOptions
|
|
} = options ?? {};
|
|
super(providerId, operation, {
|
|
...errorOptions,
|
|
diagnostics,
|
|
});
|
|
this.completedObservation = completedObservation;
|
|
this.markCleanupIncomplete(true);
|
|
this.setCleanupResources(resources);
|
|
}
|
|
}
|