Files
openclaw/test/scripts/changed-lanes-generated-extension-lint.test.ts
Peter Steinberger fada067277 feat(browser): add zero-click Chrome extension bootstrap (#121586)
* feat(browser): add zero-click extension bootstrap

Pre-register deterministic path-derived extension IDs and install a strict native messaging host.

Keep the popup and options UI minimal while removing the obsolete copilot and page-share flows.

* fix(browser): satisfy native bootstrap CI guards

* test(browser): isolate native bootstrap Chrome roots

* test(browser): flush native bootstrap profile before status

* test(browser): seed Linux native bootstrap identity

* fix(browser): preserve native bootstrap upgrade safety

Allow immutable root-owned package inputs while keeping mutable state, manifests, and launchers user-owned. Preserve all retired copilot keys whenever active or unrecognized recovery custody remains.

* fix(browser): preserve pending copilot custody

Retired cleanup now removes copilot state only when the durable registry is exactly empty. Any session, archive, malformed value, future shape, or read failure preserves every retired key.

* fix(browser): guard native bootstrap upgrades

Fail closed while retired copilot custody remains and make discard durable across partial failures.

Require exact launcher-embedded origins and repair full launcher drift without accepting mismatched registrations.

* fix(browser): remove stale layout export

* chore(release): leave changelog to release flow
2026-08-10 19:31:13 -07:00

51 lines
1.9 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { detectChangedLanes } from "../../scripts/changed-lanes.mts";
import { createChangedCheckPlan } from "../../scripts/check-changed.mts";
describe("generated extension asset lint planning", () => {
it("still lints extension tests alongside a generated browser asset", () => {
const generatedAsset = "extensions/canvas/src/host/a2ui/a2ui.bundle.js";
const extensionTest = "extensions/canvas/scripts/bundle-a2ui.test.ts";
const result = detectChangedLanes([generatedAsset, extensionTest]);
const plan = createChangedCheckPlan(result, { env: { PATH: "/usr/bin" } });
expect(result.lanes.extensionTests).toBe(true);
expect(plan.commands).toContainEqual(
expect.objectContaining({
name: "lint extension changed file",
args: [
"scripts/run-oxlint.mjs",
"--tsconfig",
"config/tsconfig/oxlint.extensions.json",
extensionTest,
],
}),
);
expect(
plan.commands
.filter((command) => command.args[0] === "scripts/run-oxlint.mjs")
.flatMap((command) => command.args),
).not.toContain(generatedAsset);
});
it("keeps fallback extension lint for a manifest beside a generated browser asset", () => {
const generatedAsset = "extensions/canvas/src/host/a2ui/a2ui.bundle.js";
const manifest = "extensions/canvas/openclaw.plugin.json";
const result = detectChangedLanes([generatedAsset, manifest]);
const plan = createChangedCheckPlan(result, { env: { PATH: "/usr/bin" } });
expect(result.lanes.extensions).toBe(true);
expect(plan.commands).toContainEqual(
expect.objectContaining({
name: "lint extensions",
args: ["lint:extensions"],
}),
);
expect(
plan.commands
.filter((command) => command.args[0] === "scripts/run-oxlint.mjs")
.flatMap((command) => command.args),
).not.toContain(generatedAsset);
});
});