qwen-code/integration-tests
易良 11e629b3a1
perf(export): split the transcript renderer's embedded CSS into a versioned asset (#11485)
* perf(export): split the transcript renderer's embedded CSS into a versioned asset

The export renderer carried the web-shell component stylesheet as a ~2.3 MB
string literal, so every reader parsed and compiled 4.1 MB of JS (56% of it dead
CSS) before a transcript could render. Lift that literal out at export build
time into a version-pinned, SRI-protected export-transcript-document.css served
from unpkg and loaded via a nonce-bearing <link>, dropping the renderer JS to
~1.83 MB.

The transform is an esbuild onLoad plugin in the web-templates export build that
strips the injected CSS constant from web-shell's dist/transcript.js; web-shell
source and runtime behavior are untouched. The document's fail-closed load-error
path is extended to the stylesheet so a missing CSS asset fails the same way as
a missing renderer.

* fix(export): match the transcript CSS entry on Windows paths too

esbuild hands plugin callbacks the platform-native absolute path, so the
extract-transcript-css `onLoad` filter never matched on Windows: the callback
did not run, `extractedTranscriptCss.css` stayed undefined, and the mandatory
extraction guard below aborted the build. That build is not platform-gated —
`scripts/prepare.js` runs it from `prepare`, so `npm ci` itself would fail on
every Windows contributor and on the windows-latest legs of test_windows and
desktop-release.

Widen the separator to `[\\/]`, keeping the `transcript\.js$` tail so the
barred `web-shell/dist/index.js` package root still does not match. The filter
moves to transcript-css-entry.mjs because build.mjs is a top-level-await script
with no harness — the same reason scripts/sdk-node-exporter-stub.js exists — so
scripts/tests/transcript-css-entry-filter.test.js can pin both separators.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtufhms2u4

* fix(export): latch a stylesheet failure ahead of the parser block

The `<link id="transcript-stylesheet">` sits in `<head>` while the `window`
error listener that catches its failure is registered by an inline script in
`<body>`. Chromium parser-blocks that script on the pending stylesheet, so when
the CSS failure settles first the error event is dispatched with no listener to
receive it: nothing marks the render as failed, both renderComplete guards in
document-main.tsx pass, React mounts the transcript without any of the
component CSS, and the requestAnimationFrame stamps
`data-render-complete="true"`. The reviewer measured this fail-open above
roughly 2.1 MB of document HTML (272 of the 1,000 permitted blocks) for a 404,
an SRI rejection, a truncated body and a destroyed socket alike, and fail-closed
for a *late* failure — so size, not failure kind, decides it.

Latch the failure in `<head>` before the `<link>` is parsed and act on the latch
from the existing body IIFE. The head script only records: `showLoadError()`
writes `document.body.dataset` and `#app`, neither of which exists while the
parser is still in `<head>`. It carries `nonce="__EXPORT_NONCE__"` because the
document CSP allows no inline script, which is safe — `formatters/html.ts:53`
replaces every occurrence. The listener is capture-phase because resource error
events do not bubble.

Not the `link.sheet === null` variant: the reviewer measured `sheet` non-null
for a 404, a truncated body and a destroyed socket, so it only detects SRI
rejection.

scripts/tests/export-transcript-document-template.test.js pins the position,
the nonce, the capture phase and the record-only shape; all five cases go red
against the unpatched template. The behavioural witness (real Chromium, large
document, instant CSS abort) belongs to the playwright transcript gate, which
is out of budget on this host.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtufhms2u4

* fix(scripts): name the missing export renderer assets, pin the CSS gate

The bundle copy became all-or-nothing over two artifacts but its `else` warning
still named only the renderer, so the one new way to reach that branch — a tree
built before the split, then `npm run bundle`d without rebuilding web-templates,
which has the JS and no CSS — told the operator to go looking for a
`export-transcript-document.js` that was sitting right there, and silently
discarded it. List the paths that are actually absent, matching the sibling Web
Shell warning twenty lines above. Stays warn-and-skip: prepare-package.js is the
release gate.

Also pin that release gate. Every fixture that reached `preparePackage` staged
`dist/export-transcript-document.css` unconditionally, so deleting the new
required-path entry left the whole test:scripts lane green; a release built with
`npm ci --ignore-scripts` would then publish documents whose stylesheet 404s on
unpkg for that version. `verifyBundleArtifacts` reports through console.error +
process.exit(1) rather than a throw, so the new case stubs exit instead of
copying the audio-capture sibling's `toThrow` idiom.

Both cases were flip-checked: restoring the old warning text, and deleting the
CSS line from prepare-package.js, each turn their case red.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtufhms2u4

* fix(export): pin the stylesheet-failure id contract and sync the design docs

The <head> latch, the body listener and the <link> each spell
'transcript-stylesheet' independently and nothing compared them, so renaming
either listener's id left the whole suite green while the latch recorded
nothing - reinstating the fail-open the latch was added to close. Derive the id
from the <link> and assert both listeners compare against it. Verified red under
both mutations: latch id -> 'transcript-renderer' (1 failed | 5 passed), and the
mirror with the body listener's id wrong and the latch intact (same).

Both design docs still specified the two shapes the previous round replaced: the
forward-slash-only onLoad filter that never matches on Windows, and the
body-listener-only fail-closed extension. Section 1 now quotes the shipped
TRANSCRIPT_CSS_ENTRY_FILTER and names transcript-css-entry.mjs, section 2
describes the <head> latch (position, nonce, capture phase, record-only),
section 3 names the module-level render guard, and "Files affected" lists the
three omitted files. EN and zh-CN are updated in the same commit.

Also correct the shape-guard comment in build.mjs: the document nonces every
<style> created through document.createElement, so the CSP would not block an
un-stripped duplicate, and a 367-byte regrowth stays inside both byte budgets.
That throw is the only guard on the duplicate-injection path.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-closeout/jmtuo29vduf

* fix(export): close out transcript CSS review comments

* fix(export): tighten transcript CSS closeout

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-09-10 07:15:32 +00:00
..
baselines test(perf): add daemon baseline harness (#4175 Wave 1 PR 1) (#4205) 2026-05-17 00:41:26 +08:00
cli feat(web-shell): make the product name and logo configurable (#11244) 2026-09-10 04:54:45 +00:00
concurrent-runner chore: restore regression coverage after WebUI retirement (#11101) 2026-09-08 08:15:03 +00:00
fixtures feat: chat transcript mr2a html export (#10076) 2026-09-04 14:36:35 +00:00
helpers feat: chat transcript mr2a html export (#10076) 2026-09-04 14:36:35 +00:00
hook-integration fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
interactive feat(cli): OpenTUI parity closeout (dialogs, composer, shell mode) (#11152) 2026-09-08 11:31:00 +00:00
sdk-typescript fix(core): decouple permissions.allow from tool registration via tools.eager (#10075) (#10098) 2026-08-28 15:27:34 +00:00
terminal-bench fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
terminal-capture feat: delegate a subagent turn to an external agent over ACP (Claude Code first) (#11003) 2026-09-10 03:13:05 +00:00
channel-plugin.test.ts fix(integration-tests): make the project typecheckable and fix what that found (#8693) 2026-08-08 16:32:31 +00:00
chat-transcript-contract.test.ts feat: chat transcript mr2a html export (#10076) 2026-09-04 14:36:35 +00:00
chat-transcript-document.test.ts perf(export): split the transcript renderer's embedded CSS into a versioned asset (#11485) 2026-09-10 07:15:32 +00:00
fake-dashscope-server.ts feat(qwen-live): ACP backend adaptor and multi-backend routing — M4 (#10617) 2026-09-02 02:50:03 +00:00
fake-openai-server.test.ts fix(cli): Align OpenTUI mid-turn submit and exit with ink (#10883) 2026-09-03 09:31:05 +00:00
fake-openai-server.ts fix(cli): Align OpenTUI mid-turn submit and exit with ink (#10883) 2026-09-03 09:31:05 +00:00
globalSetup.test.ts test(e2e): isolate protocol checks and ACP test state (#11286) 2026-09-08 05:05:36 +00:00
globalSetup.ts test(e2e): isolate protocol checks and ACP test state (#11286) 2026-09-08 05:05:36 +00:00
qwen-live-harness.ts feat(qwen-live): protocol v7 playback receipts and interactive init — M5 (#10769) 2026-09-02 11:13:04 +00:00
qwen-live-m1-call.test.ts feat(qwen-live): protocol v7 playback receipts and interactive init — M5 (#10769) 2026-09-02 11:13:04 +00:00
qwen-live-m2-inject.test.ts feat(qwen-live): standalone voice daemon package — M1 + M2 (#10367) 2026-09-01 06:37:23 +00:00
qwen-live-m2-permission.test.ts feat(qwen-live): standalone voice daemon package — M1 + M2 (#10367) 2026-09-01 06:37:23 +00:00
qwen-live-m2-steering.test.ts feat(qwen-live): standalone voice daemon package — M1 + M2 (#10367) 2026-09-01 06:37:23 +00:00
qwen-live-m4-acp-call.test.ts feat(qwen-live): ACP backend adaptor and multi-backend routing — M4 (#10617) 2026-09-02 02:50:03 +00:00
qwen-live-m4-acp-multibackend.test.ts feat(qwen-live): ACP backend adaptor and multi-backend routing — M4 (#10617) 2026-09-02 02:50:03 +00:00
qwen-live-m4-acp-permission.test.ts feat(qwen-live): ACP backend adaptor and multi-backend routing — M4 (#10617) 2026-09-02 02:50:03 +00:00
qwen-live-m4-acp-steering.test.ts feat(qwen-live): ACP backend adaptor and multi-backend routing — M4 (#10617) 2026-09-02 02:50:03 +00:00
renderer-matrix.test.ts feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
renderer-matrix.ts feat(opentui): bundle assets, CI matrix and parity tooling (Batch 7) (#10770) 2026-09-02 08:36:20 +00:00
scratch-dir.test.ts test(e2e): isolate protocol checks and ACP test state (#11286) 2026-09-08 05:05:36 +00:00
scratch-dir.ts test(e2e): isolate protocol checks and ACP test state (#11286) 2026-09-08 05:05:36 +00:00
skill-hooks-invocation-parity.test.ts fix(skills): register frontmatter hooks on the /<skill-name> path (#11068) 2026-09-06 17:11:57 +00:00
test-helper.test.ts fix(test): end interactive PTY sessions a test never closed (#10969) (#10971) 2026-09-04 00:04:07 +00:00
test-helper.ts fix(ci): isolate E2E fork test directories (#11312) 2026-09-07 16:14:24 +00:00
test-mcp-server.ts # 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483) 2025-09-01 14:48:55 +08:00
tsconfig.json feat: delegate a subagent turn to an external agent over ACP (Claude Code first) (#11003) 2026-09-10 03:13:05 +00:00
vitest.config.ts ci: serialize integration tests on shared ECS runners (#10567) 2026-08-31 01:20:35 +00:00
vitest.firstoutput.config.ts fix(test): Restore first-output benchmark measurement validity and correct its artifact schema (#7820) 2026-07-28 06:51:03 +00:00
vitest.loadtest.config.ts feat(daemon): merge daemon-mode feature batch into main (#4490) 2026-06-12 00:34:49 +08:00
vitest.terminal-bench.config.ts Fix E2E caused by Terminal Bench test (#529) 2025-09-08 10:51:14 +08:00