name: plugin
on:
push:
# The two root READMEs are here because a release commit moves all four
# install pins together, and readme-pins.test.ts is the guard for exactly
# that. Without them, a commit fixing only a root README triggers neither
# workflow: daily.yml filters on the catalog's inputs under registry/
# and the ROOT package.json.
paths: &plugin-inputs
- 'packages/dsh-plugin-shop/**'
- 'packages/dsh-typert-protocol/**'
- 'pnpm-workspace.yaml'
- 'README.md'
- 'README.zh.md'
# This file, because its own action pins are part of what runs the
# tests. Without it a workflow-only PR never runs this workflow: #8, #11
# and #16 each moved a pin here and were covered only because their
# diffs still carried packages/** files from a base that had not merged
# yet — a property of the base, not of the change.
- '.github/workflows/plugin.yml'
pull_request:
paths: *plugin-inputs
workflow_dispatch:
concurrency:
group: plugin-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
# Both platforms, because the e2e has PLATFORM-DEPENDENT expectations and
# only one of them was ever executed. `shop/restart` is POSIX-only, so a
# restart-required install offers the restart gate on Linux and the
# blocked-reason notice on Windows; `web-full-flow.e2e.ts` branches on
# that, and until this matrix the win32 arm was asserted by nothing
# automated. It was found the only way it could be — by hand, on Windows
# 11, as an opaque 10s timeout on a host behaving exactly as designed.
#
# A matrix on this job rather than a second Windows-only job: the harness
# pin below is a single figure with a census attached, and the guard in
# repo-guards.test.ts reads it from `jobs.test.steps`. A second job means a
# second copy of that pin, which is the drift this repository keeps
# writing guards against.
#
# The `dsh` axis, added 2026-09-27, is that pin. Each version is a
# harness the e2e was RUN against before it was listed here, and each leg
# installs exactly its own entry. A leg is a harness BEHAVIOUR, not every
# patch of it: 0.2.2-rc.2 (npm's `next` since 2026-11-12) took the place
# of 0.2.2-rc.1 (`latest` since 2026-11-04) because the two are the same
# harness to this shop — the same exports, the same profile table, and
# rc.2 only adds `pinnedGitOrigin` and three git-update methods (design
# 2026-11-12-dsh-022-rc2.md). 0.2.1-rc.5 held both tags from 2026-10-30,
# 0.2.0-rc.2 from 2026-09-29. 0.1.5-rc.3, `latest` before that, is the
# only leg whose fresh installs still use the CLI. 0.1.7-rc.2, 0.2.0-rc.2
# and 0.2.1-rc.5 run the half of the suite 0.1.5 never reaches (the
# refusal branch, the 0.1.7 UI fixes, the harness-package badge), each on
# its own version of dsh's settings UI.
# repo-guards.test.ts reads this list, holds it equal to the e2e contract
# header's, and fails when the shop's own harness peers refuse an entry.
#
# `fail-fast: false` because the legs answer different questions.
# Cancelling Windows the moment Linux goes red, or every other harness the
# moment one goes red, throws away the signal this matrix was added to
# produce.
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
dsh: ['0.1.5-rc.3', '0.1.7-rc.2', '0.2.0-rc.2', '0.2.1-rc.5', '0.2.2-rc.2']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with: { node-version: 24, cache: pnpm }
- run: pnpm install --frozen-lockfile
# The root suite — 733 tests, about ten seconds, measured 2026-09-04 — for
# one test in it: readme-pins.test.ts guards the four install pins a
# release commit must move together, and it had never run on a release
# commit. plugin.yml ran only the package suite, and daily.yml's path
# filter names the ROOT package.json, not the package's. 0.5.0 through
# 0.5.2 shipped with a README three releases behind because of it.
# Root vitest includes only registry/scripts/tests/**, so this step never
# reaches the package e2e that the two steps below exist to set up.
- run: pnpm test
# Pinned to the harness the e2e's DOM contract is written against, NOT to
# the workspace's own lockfile (which still resolves the harness dev deps
# at 0.1.1-rc.2 — a separate, deliberate pin). This global install is what
# serves the web UI the e2e drives, and the versions render mutually
# exclusive contracts. Raw grep hits over
# @deepseek-ai/dsh-client-ui-settings-plugin-inventory's lib/client.js,
# inlined CSS included — so a count is not a count of JSX sites and only
# the zero/non-zero split is load-bearing. Each row carries the date it
# was taken, because an undated census cannot be aged out:
# 0.1.1-rc.2 data-enabled x2, data-kind x0, no 全局插件 section
# (measured 2026-09-04)
# 0.1.2-rc.1 data-enabled x0, data-kind x5, 插件列表 split in two with
# the Loader plane COLLAPSED when a preset roster exists
# (measured 2026-09-04)
# 0.1.5-rc.1 data-kind x0 AND data-phase x0 — the enabled tag and the
# phase dot moved onto shared primitives that the web
# frontend BUNDLES rather than installing as a package, so
# a census of this package alone reads "the instrument was
# deleted" while the DOM still carries it. The
entry
# card's own four attributes — data-plugin-entry,
# data-plugin-module, data-failed, data-open — are unchanged
# from 0.1.2-rc.1. Its CHILDREN are not, and that is the
# half that cost two debugging rounds (measured 2026-09-10)
# Names, not counts, are what a selector suite can satisfy one version of
# at a time. The census is what makes this pin auditable; what the e2e
# actually READS is not restated here, because it is no longer these
# attributes at all — web-full-flow.e2e.ts's contract header owns that,
# and repo-guards.test.ts fails the build if this pin and that header
# name different harness versions.
#
# The other half of this arrangement is the workspace lockfile the first
# line above says this pin is NOT. It resolves the harness dev deps at
# 0.1.1-rc.2, and that is a FLOOR rather than a pin nobody got round to
# moving. semver admits a prerelease only against a comparator carrying
# its own [major.minor.patch], and every version the harness has published
# on the 0.1 line is a prerelease, so `^0.1.1-rc.2` is satisfied by
# 0.1.1-rc.2 and by nothing else — a range in spelling, a hard pin in
# effect. The build therefore compiles against the OLDEST harness the
# shipped peer range claims to support, which is what keeps it from
# reaching for an API that only a newer one has.
#
# So these two are a pair, and neither is the claim by itself: compile at
# the floor, run the e2e at the ceiling. At the ceiling only, nothing
# stops the package from requiring a version it never declared. At the
# floor only, a green typecheck says nothing about the harness users
# actually install — which is precisely how 0.1.5-rc.1 removed two
# attributes out from under this suite with `tsc --noEmit` green the whole
# way. That is also why the reads that replaced them moved onto the a11y
# contract instead of onto the next private attribute: a name the harness
# needs for its own screen readers is one it cannot rename silently.
#
# Recorded for the next reader: the floor is COMPILED against but no
# longer RUN against. The only harnesses the e2e ever sees are the `dsh`
# axis's entries, and every one of them is above the floor, so the lower
# end of the peer range is asserted by the build rather than observed.
# That is a known gap, not an oversight — closing it means a second e2e
# job on the floor, which is a decision, not a comment.
# 0.1.5-rc.3 SINCE 2026-09-23, and the reason is not a feature: rc.1 and
# rc.2 no longer BOOT from a global install. On 2026-09-22 the harness
# published 0.1.5-rc.3 of dsh and of its plugin packages together
# (dsh-sandbox-local, dsh-util-values, dsh-sandbox-windows-acl). A core
# at rc.1 declares `^0.1.5-rc.1` for those, and semver admits a higher
# PRERELEASE of the same [major.minor.patch] — so a fresh install now
# pairs an rc.1 core with rc.3 plugins, and Cordis cannot resolve them:
# `dsh: plugin(s) failed to load: @deepseek-ai/dsh-sandbox-local`.
#
# Measured 2026-09-23 by installing each version into an isolated prefix
# and booting `dsh --profile web`: rc.1 fails, rc.2 (the current `latest`)
# fails, rc.3 boots. The same rc.1 installed NON-globally boots, because
# npm lays its tree out differently — which is why this surfaced only in
# CI. Reverting individual packages to rc.2 in place does not fix it: the
# whole closure moved, not one package.
#
# This is a pinned CEILING as the block above says, so it must not be
# bumped on availability alone. It moved here because the suite was RUN
# against rc.3 first: all six web-full-flow cases pass under
# DSH_SHOP_REQUIRE_E2E=1, which is what the e2e's contract header
# attests and what repo-guards.test.ts checks this line against.
#
# 0.1.7-rc.2 JOINED IT 2026-09-27 as a second ceiling, on the same terms:
# the whole package suite, both exit criteria included, was run against
# it before it was listed, with the version each test launched read from
# inside the run. The version now comes from the `dsh` matrix axis above,
# one per leg, and is the list the guard compares with the header.
#
# 0.2.0-rc.2 JOINED THEM 2026-10-05 as a third, on the same terms, and
# it could not have joined unchanged. That dsh refuses the shop itself
# unless the shop's harness peers admit 0.2, and its first-run notice
# (预览版说明) compares a new acknowledgement version that a seed written
# for 0.1 does not carry. The run behind this entry passed after both
# changes (design 2026-10-05-dsh-020-readiness).
#
# 0.2.1-rc.2 JOINED THEM 2026-10-19 as a fourth, on the same terms, and
# it too could not have joined unchanged. Its sidebar foot has no
# Settings button, only the Account menu whose first item opens the
# dialog; its plugin manager refuses to update an installed package in
# place, so an update continues through dsh's CLI; and its refusals list
# `requirements` where 0.2.0's listed `peers`. The run behind this entry
# passed after those changes (design 2026-10-19-dsh-021-readiness).
#
# 0.2.1-rc.5 REPLACED rc.2 AS THE 0.2.1 LEG ON 2026-10-31, on the same
# terms. Nothing in the shop changed for it: diffing the installed rc.2
# and rc.5 closures, every contract the shop reads is byte-identical
# (`dsh-app-boot`, `dsh-plugin-manager`, `dsh-client-hmr`, the slot and
# layout packages, `dsh-typert-protocol`, `dsh-home-paths`, and the CLI
# itself), and the differences are UI, telemetry, and a new sidebar
# panel-customization package. The whole package suite was run against
# rc.5 first (55 files, 1,875 tests, `DSH_SHOP_REQUIRE_E2E=1`), and the
# published 0.9.0 loaded the live catalogue on it. What changed for a
# listed plugin is API, not UI: `sidebar.panellist.actions` registrations
# now receive `entries`, `onOpen` and `onPinnedChange` for customizing
# panel rows, but the shipped More menu lists no panel rows and offers
# no pin control, so the shop's row stays pinned in the default
# composition.
- run: npm install -g @deepseek-ai/dsh@${{ matrix.dsh }}
- run: dsh --version
# The web full-flow e2e (P2 exit criterion) needs a playwright browser;
# without --with-deps for now — the ubuntu-latest image already carries
# chromium's system libraries, and Windows has no such dependency at all.
# Add it only if a runner proves otherwise.
- run: pnpm -C packages/dsh-plugin-shop exec playwright install chromium
- run: pnpm -C packages/dsh-plugin-shop test
env:
# These two files ARE the P1 and P2 exit criteria, and both skip when
# they cannot find a working `dsh`. That is right on a developer's
# machine and wrong here, where the two steps above exist precisely to
# install the harness and the browser. Reproduced 2026-09-05: with
# `dsh` hidden from PATH the suite reported `1 skipped` and exited 0,
# so a green run was not evidence either criterion had executed.
DSH_SHOP_REQUIRE_E2E: '1'
# And each criterion must boot THIS leg's harness. Both launch the
# first `dsh` on PATH, and on 2026-09-26 a run from a /tmp checkout
# booted a stray 0.1.5-rc.1 in place of the harness it had installed,
# green throughout. With this set, a launched `dsh --version` that
# answers anything else fails the run.
DSH_SHOP_EXPECT_DSH: ${{ matrix.dsh }}
# What a failed e2e case saw: a screenshot and the visible text of each
# page it had open, and dsh's own output (web-full-flow.e2e.ts,
# E2E_EVIDENCE_DIR). Only a failed case writes it and only a failed leg
# uploads it. A Windows or 0.1.7 leg is a runner no one can open, and a
# locator timeout alone says nothing about what the page showed.
- if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: e2e-evidence-${{ matrix.os }}-${{ matrix.dsh }}
path: packages/dsh-plugin-shop/test-results/
if-no-files-found: ignore
retention-days: 14
- run: pnpm -C packages/dsh-plugin-shop typecheck
- run: pnpm -C packages/dsh-plugin-shop build