I reproduced a bundle advertising a lower minEngineVersion than one of its own provider documents.
A provider webhook raises the provider's floor to the resource/webhook capability version, but bundle assembly considers only endpoint and resource documents. A webhook provider without resource documents therefore produces a bundle compatibility gate that understates the requirements of its contents. This also happens when it has ordinary endpoints whose own floors are lower.
Reproduction
Save this as repro-provider-version.ts at the repository root, then run:
deno run --check --allow-read --allow-env repro-provider-version.tsIt compiles an in-memory provider without making network calls.
import { compileBundle } from "@shared/compiler";
import { defineProvider } from "@shared/core";
const options = {
compilerVersion: "0.1.0", builtWithEngineVersion: "0.5.0",
catalogVersion: "0.0.0-test", generatedAt: "1970-01-01T00:00:00.000Z",
leafCategories: [{ id: "demo-cat", displayName: "Demo" }],
};
const provider = defineProvider({
name: "hooks", meta: { displayName: "Hooks", summary: "Webhook provider." },
webhooks: { events: {
verify: { scheme: "hmac-sha256", signatureHeader: "x-signature",
timestampHeader: "x-timestamp", payload: "${timestamp}.${rawBody}", toleranceMs: 300000 },
route: () => ({ who: { kind: "unhandled", event: "test" }, what: { action: "ignore" } }),
} },
});
const bundle = await compileBundle([{ provider, endpoints: [] }], options);
console.log("provider floor:", bundle.providers.hooks.minEngineVersion);
console.log("bundle floor:", bundle.minEngineVersion);Observed:
provider floor: 0.5.0
bundle floor: 0.3.0Expected: the bundle's floor is at least the provider's floor (0.5.0 in this example), matching the documented maximum-over-all-documents rule. Consumers relying on the bundle gate should not accept a bundle whose provider docs require a newer engine.
Root cause and proposed resolution
shared/compiler/compile.ts correctly includes resourcesSince in a provider doc's minimum when it declares webhooks. The final bundle's semverMax, however, includes only allDocs (endpoints) and allResourceDocs, omitting providers.
Include provider document minima in that final maximum and add regressions for a provider webhook with no endpoints and with an ordinary endpoint. This restores the existing minimum-version derivation contract without changing the document format or hook ABI.
Activity
0No activity yet.