fix(lint): remove redundant artifact-loader suppression

Load the Doctor artifact through the existing typed public-surface loader.
Restore the optional channel adapter's object contract for its remaining
callers instead of retaining a second return-only generic exception.
Preserve the missing-artifact and initialization-error behavior from #162645.

Explicitly allowlist the worker fixture's Node BroadcastChannel exception:
its postMessage API has no browser targetOrigin argument. Keep the fixture
and the suppression scanner unchanged.

Fixes the production suppression guard from hourly run 36969503477.
Validation: suppression guard plus 21 channel tests, touched-file and
boundary lint, check-changed, full architecture checks, build, and P2 review.
Checks ran locally after the Testbox request was canceled while queued;
full owning Vitest suites were not run. Compatibility records are untouched.
This commit is contained in:
Peter Steinberger 2026-10-02 00:12:16 -07:00
parent 2d4422fe70
commit f8821e0209
No known key found for this signature in database
3 changed files with 12 additions and 9 deletions

View file

@ -1,6 +1,6 @@
import type { LegacyConfigRule } from "../../config/legacy.shared.js";
import type { OpenClawConfig } from "../../config/types.js";
import { loadOptionalBundledChannelPublicArtifact } from "./optional-public-artifact.js";
import { loadBundledPluginPublicArtifactModuleFromCandidatesSync } from "../../plugins/public-surface-loader.js";
/**
* Config returned after a bundled channel normalizes legacy compatibility state.
@ -29,8 +29,10 @@ type BundledChannelDoctorContractApi = {
export function loadBundledChannelDoctorContractApi(
channelId: string,
): BundledChannelDoctorContractApi | undefined {
return loadOptionalBundledChannelPublicArtifact<BundledChannelDoctorContractApi>({
channelId,
artifactBasename: "doctor-contract-api.js",
});
return (
loadBundledPluginPublicArtifactModuleFromCandidatesSync<BundledChannelDoctorContractApi>({
dirName: channelId.trim(),
artifactCandidates: ["doctor-contract-api.js"],
}) ?? undefined
);
}

View file

@ -1,13 +1,12 @@
import { loadBundledPluginPublicArtifactModuleFromCandidatesSync } from "../../plugins/public-surface-loader.js";
// Missing artifacts are optional; errors from resolved artifacts must propagate.
// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Callers supply the artifact's own public module surface type.
export function loadOptionalBundledChannelPublicArtifact<T extends object = object>(params: {
export function loadOptionalBundledChannelPublicArtifact(params: {
channelId: string;
artifactBasename: string;
}): T | undefined {
}): object | undefined {
return (
loadBundledPluginPublicArtifactModuleFromCandidatesSync<T>({
loadBundledPluginPublicArtifactModuleFromCandidatesSync({
dirName: params.channelId.trim(),
artifactCandidates: [params.artifactBasename],
}) ?? undefined

View file

@ -260,6 +260,8 @@ describe("production lint suppressions", () => {
"src/secrets/private-plan-file.ts|preserve-caught-error|1",
"src/state/config-machine-state.ts|typescript/no-unnecessary-type-parameters|2",
"src/state/openclaw-agent-db-admission.ts|typescript/prefer-promise-reject-errors|1",
// Node worker BroadcastChannel.postMessage accepts only a message, not a browser targetOrigin.
"src/state/openclaw-agent-worker-store.test-support.ts|unicorn/require-post-message-target-origin|1",
"src/system-agent/setup-inference-activate.ts|preserve-caught-error|1",
"src/test-utils/vitest-mock-fn.ts|typescript/no-explicit-any|1",
"src/utils.ts|typescript/no-unnecessary-type-parameters|1",