dsh-auth-remote 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/CHANGELOG.zh-CN.md +32 -0
- package/CONTRIBUTING.md +3 -1
- package/CONTRIBUTING.zh-CN.md +3 -1
- package/README.md +49 -23
- package/README.zh-CN.md +37 -11
- package/cordis.patch.yml +4 -3
- package/dist/cli.js +91 -46
- package/dist/cli.js.map +2 -2
- package/dist/client.js +2880 -581
- package/dist/client.js.map +4 -4
- package/dist/index.js +201 -36
- package/dist/index.js.map +4 -4
- package/dist/login.css +2 -8
- package/dist/login.css.map +2 -2
- package/dist/login.js +80 -42
- package/dist/login.js.map +2 -2
- package/dist/types/adapters/dsh/account-callback.d.ts +3 -0
- package/dist/types/adapters/dsh/account-callback.d.ts.map +1 -1
- package/dist/types/adapters/dsh/hmr-context.d.ts +10 -0
- package/dist/types/adapters/dsh/hmr-context.d.ts.map +1 -0
- package/dist/types/auth/service.d.ts +2 -0
- package/dist/types/auth/service.d.ts.map +1 -1
- package/dist/types/auth/sessions.d.ts +2 -0
- package/dist/types/auth/sessions.d.ts.map +1 -1
- package/dist/types/config.d.ts +9 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/http/account-login.d.ts +5 -3
- package/dist/types/http/account-login.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shared/account-login.d.ts +2 -1
- package/dist/types/shared/account-login.d.ts.map +1 -1
- package/dist/types/shared/auth-contract.d.ts +2 -0
- package/dist/types/shared/auth-contract.d.ts.map +1 -1
- package/dist/types/shared/dsh-support.d.ts +38 -0
- package/dist/types/shared/dsh-support.d.ts.map +1 -0
- package/dist/types/shared/i18n.d.ts +78 -40
- package/dist/types/shared/i18n.d.ts.map +1 -1
- package/dist/types/shared/locales/en.d.ts +39 -20
- package/dist/types/shared/locales/en.d.ts.map +1 -1
- package/dist/types/shared/locales/zh.d.ts +39 -20
- package/dist/types/shared/locales/zh.d.ts.map +1 -1
- package/docs/deployment.md +26 -21
- package/docs/deployment.zh-CN.md +26 -21
- package/docs/development.md +74 -8
- package/docs/development.zh-CN.md +74 -8
- package/docs/legacy-compatibility.md +96 -64
- package/docs/legacy-compatibility.zh-CN.md +96 -64
- package/docs/releasing.md +40 -10
- package/docs/releasing.zh-CN.md +40 -10
- package/docs/support-history.md +97 -0
- package/docs/support-history.zh-CN.md +97 -0
- package/docs/support-policy.md +87 -0
- package/docs/support-policy.zh-CN.md +87 -0
- package/examples/web-profile-auth-remote.patch.yml +6 -3
- package/package.json +28 -17
package/docs/development.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](development.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This guide describes the eleven exact verification targets for plugin `0.2.0`. RC additions do not extend npm `0.1.10` historical support; final same-archive results are recorded separately.
|
|
6
|
+
|
|
7
|
+
Development and the full test suite use Linux (`/proc` is required for the profile lock), Node.js 24+, pnpm 12.5.1, and DSH `0.2.1-rc.2`. Browser tests use Playwright-managed Chromium and a Node HTTP/HTTPS forwarder.
|
|
6
8
|
|
|
7
9
|
## Set up and check a checkout
|
|
8
10
|
|
|
@@ -14,7 +16,7 @@ pnpm pack:local
|
|
|
14
16
|
pnpm smoke
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
`pnpm check` runs type checking, formatting, build, package/deployment/document checks, then unit, integration, CLI, and browser tests. `pnpm pack:local` writes `artifacts/dsh-auth-remote-0.
|
|
19
|
+
`pnpm check` runs type checking, formatting, build, package/deployment/document checks, then unit, integration, CLI, and browser tests. `pnpm pack:local` writes `artifacts/dsh-auth-remote-0.2.0.tgz` after static checks; it does not publish. `pnpm smoke` installs that archive into an isolated DSH home, starts the pinned DSH runtime briefly, checks readiness, anonymous redirection/denial and an online CLI status, then stops it.
|
|
18
20
|
|
|
19
21
|
## Use the isolated development profile
|
|
20
22
|
|
|
@@ -29,16 +31,16 @@ The scripts manage only `.dev/runtime-<version>` and `.dev/dsh-home` under this
|
|
|
29
31
|
For direct inspection, use the same isolated home explicitly:
|
|
30
32
|
|
|
31
33
|
```sh
|
|
32
|
-
DSH_HOME="$PWD/.dev/dsh-home" "$PWD/.dev/runtime-0.2.1-
|
|
34
|
+
DSH_HOME="$PWD/.dev/dsh-home" "$PWD/.dev/runtime-0.2.1-rc.2/node_modules/.bin/dsh" plugin --profile web exec dsh-auth-remote status --json
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
The development home contains test account data. Keep it private and do not commit or copy it into a deployment profile.
|
|
36
38
|
|
|
37
39
|
## Test boundaries
|
|
38
40
|
|
|
39
|
-
`pnpm test:unit` covers the auth state machine, TOTP, backup codes, origin policy, translations, storage durability and lock recovery. `pnpm test:integration` exercises real HTTP/WebSocket sockets, native readiness, cookies, origin decisions and revocation. `pnpm test:cli` builds the real archive and tests interactive and noninteractive commands against isolated profiles and Unix sockets. `pnpm test:browser` boots the selected DSH version with temporary profiles and verifies the login and Security UI, native settings, workspace, upload/preview, SSE, WebSocket and an HTTPS forwarding chain.
|
|
41
|
+
`pnpm test:unit` covers the auth state machine, TOTP, backup codes, origin policy, translations, storage durability and lock recovery. `pnpm test:integration` exercises real HTTP/WebSocket sockets, native readiness, cookies, origin decisions and revocation. `pnpm test:cli` builds the real archive and tests interactive and noninteractive commands against isolated profiles and Unix sockets. `pnpm test:browser` boots the selected DSH version with temporary profiles and verifies the login and Security & sign-in UI, native settings, workspace, upload/preview, SSE, WebSocket and an HTTPS forwarding chain.
|
|
40
42
|
|
|
41
|
-
Browser network traffic uses a Node HTTP/HTTPS forwarder. The dedicated self-signed certificate and key under `tests/fixtures/tls/` are test fixtures only; they are never packaged or deployment credentials. Chat uses a local model stub. No real third-party authorization or paid model request is exercised. The default browser is Playwright Chromium; `DSH_TEST_BROWSER` can select a local browser executable, and `DSH_TEST_BIN` can select another binary only if it reports the exact selected version (default `0.2.1-
|
|
43
|
+
Browser network traffic uses a Node HTTP/HTTPS forwarder. The dedicated self-signed certificate and key under `tests/fixtures/tls/` are test fixtures only; they are never packaged or deployment credentials. Chat uses a local model stub. No real third-party authorization or paid model request is exercised. The default browser is Playwright Chromium; `DSH_TEST_BROWSER` can select a local browser executable, and `DSH_TEST_BIN` can select another binary only if it reports the exact selected version (default `0.2.1-rc.2`).
|
|
42
44
|
|
|
43
45
|
The DSH test runtime lives in `.cache/test-runtime/<version>` and is pinned separately from the source dependencies. Host services and React remain external to the client bundle. The [deployment guide](deployment.md) describes profile and backup rules.
|
|
44
46
|
|
|
@@ -46,9 +48,11 @@ Before changing compatibility declarations or adaptations, read the [legacy comp
|
|
|
46
48
|
|
|
47
49
|
Isolated verification installs use pnpm file copies so shared package hardlink metadata changes cannot trigger client hot reloads in another profile.
|
|
48
50
|
|
|
51
|
+
Support decisions live in the [policy](support-policy.md), release facts in the [bidirectional history](support-history.md), and adaptation evidence in the inventory. Update all three with README in both languages; do not derive old release claims from the current candidate manifest.
|
|
52
|
+
|
|
49
53
|
## Cross-version verification
|
|
50
54
|
|
|
51
|
-
The default test target is DSH `0.2.1-
|
|
55
|
+
The default test target is DSH `0.2.1-rc.2`. Set `DSH_TEST_VERSION` to `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.2`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.1`, or `0.2.1-rc.2`; test runtimes live separately under `.cache/test-runtime/<version>` and development runtimes under `.dev/runtime-<version>`. `DSH_TEST_BIN` must report the exact selected version. CI retains CLI and installation smoke for all eleven releases. Full verification runs every browser target; ordinary verification uses the fixed boundary selection below. Development types and integration tests use the pinned DSH `0.2.1-rc.2` packages. The source checkout test guide (`tests/README.md`) describes real Loader/model URL checks and native IPv6/TLS positive or unsupported-capability assertions; unavailable native test transport fails instead of skipping.
|
|
52
56
|
|
|
53
57
|
```sh
|
|
54
58
|
DSH_TEST_VERSION=0.1.7-rc.1 pnpm test:cli
|
|
@@ -63,14 +67,76 @@ DSH_TEST_VERSION=0.2.1-alpha.1 pnpm test:cli
|
|
|
63
67
|
DSH_TEST_VERSION=0.2.1-alpha.1 pnpm test:browser
|
|
64
68
|
DSH_TEST_VERSION=0.2.1-alpha.2 pnpm test:cli
|
|
65
69
|
DSH_TEST_VERSION=0.2.1-alpha.2 pnpm test:browser
|
|
70
|
+
DSH_TEST_VERSION=0.2.1-alpha.3 pnpm test:cli
|
|
71
|
+
DSH_TEST_VERSION=0.2.1-alpha.3 pnpm test:browser
|
|
72
|
+
DSH_TEST_VERSION=0.2.1-alpha.4 pnpm test:cli
|
|
73
|
+
DSH_TEST_VERSION=0.2.1-alpha.4 pnpm test:browser
|
|
66
74
|
pnpm test:cli
|
|
67
75
|
pnpm test:browser
|
|
68
76
|
```
|
|
69
77
|
|
|
70
78
|
Browser tests save light/dark, desktop/narrow-screen screenshots under `.cache/ui-review/<version>` for visual review. Security CSS is installed and removed with the plugin, scopes its selectors to the plugin page, and reads the host's live `--dsw-*` tokens. The standalone login uses a subset of DSH 0.2.0-rc.1 theme tokens and the system color scheme without reading host preferences before authentication.
|
|
71
79
|
|
|
72
|
-
Official-account tests use a local Platform stand-in with the actual DSH `0.2.1-
|
|
80
|
+
Official-account tests use a local Platform stand-in with the actual DSH `0.2.1-rc.2` account provider. They check the original redirect URI and PKCE verifier during exchange, rejected state/URL/session combinations, duplicate submissions, cancellation, expiry and retries. Browser coverage checks the instruction-first menu and onboarding dialog, failed loopback navigation followed by paste/confirm, blocked popups, live locale and responsive light/dark layout. These tests do not establish a real official-account authorization session.
|
|
73
81
|
|
|
74
82
|
Core account tests load the exact provider from locked development dependencies, so they do not require a pre-existing CLI runtime cache. Browser tests still exercise the provider installed into each isolated DSH profile.
|
|
75
83
|
|
|
76
|
-
This temporary adapter
|
|
84
|
+
This temporary adapter uses `>=0.2.1-alpha.3` including prereleases, required capabilities and live configuration. Full manual-feature regression covers `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.1` and `0.2.1-rc.2`. DSH `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.2` verify base authentication, complete Security & sign-in interactions, live configuration persistence and unavailable manual-feature feedback. Future admission is not verification. Support or shared host-adapter changes require the same final tgz across all eleven CLI, browser and smoke runs. Use the fixed-archive consumer with `--suite cli --suite browser --suite smoke` for each exact release, as shown below and in the release guide. It restores the verified dist, checks SHA-256 per suite and isolates smoke from development profiles; do not use repacking wrappers in the loop. See `DSH-ACCOUNT-001` for public-callback evidence, migration and retirement conditions.
|
|
85
|
+
|
|
86
|
+
`live-config.spec.ts` observes the real Loader reference/fiber, auth/store identity, lock, listener and SSE/WebSocket continuity, checks the loaded dependency chain and restarts to verify the profile override. It does not fabricate services. Dialog regression covers cancellation/errors, focus/keyboard, optional/enforced TOTP, one-time code copying and redirect holds after revocation. Task documents, test credentials, profiles, screenshots and generated directories must remain outside the npm archive.
|
|
87
|
+
|
|
88
|
+
`account-login.spec.ts` also exercises real native configuration HMR on every declared release: changing ordinary `sessionHours` rebuilds the listener, then an external Settings write must wait for an existing native transaction while genuine nesting is rejected. On `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.1` and `0.2.1-rc.2`, modifying the isolated installed plugin additionally verifies native module replacement followed by re-enabling manual sign-in. The test-only transaction probe calls the real HMR service; it replaces no service and never enters the npm archive. The narrow listener-context adaptation is documented in `DSH-HMR-001`. Protected remote deployments require the independent profile-level native-listener disable in the deployment guide. The two RC startup regressions damage only isolated plugin copies: an incompatible `engines.dsh` must make the real Loader skip the bundle, while an injected plugin-side admission range must reach its own runtime rejection. Both must fail startup with no TCP, HTTP, readiness or WebSocket fallback; upstream code, versions and Loader auditing remain unchanged.
|
|
89
|
+
|
|
90
|
+
The account preference binding recovers an initial failed read through the native describe mirror’s `ensure()` API. Recovery of an already held namespace uses the explicitly injected `remote.settings` transport and folds the accepted namespace back into that mirror. A sign-in click while the preference is loading waits for the shared read, then uses the latest accepted true/false value; loading does not select the native flow. Browser regression covers initial failure, a temporarily missing namespace and delayed reads for both routing choices.
|
|
91
|
+
|
|
92
|
+
The `0.2.1-rc.2` native Search/Fetch settings regression uses an isolated remote Host and the actual three settings namespaces plus the credentials domain. It covers provider selection, validation/save errors, refresh/restart persistence and anonymous/revoked-session refusal. All configured endpoints are local test endpoints, and their request counter must remain zero; no paid Search/Fetch or official account operation is performed. The source test guide details this boundary.
|
|
93
|
+
|
|
94
|
+
Startup maintenance diagnostics use the installed plugin's exact declarations and explicit lifecycle records. Each exact-version/state warning appears once per process, including configuration or module HMR; a new process warns again. Legacy logs include announced dates and migration guidance. Unverified or explicitly retired inputs warn about the missing current support commitment, while normal support stays quiet. Dates never stop service, and required API, package identity and security failures still refuse it. `dsh-support.test.ts` crosses both eligibility dates with a mocked clock; the account HMR regression also checks real legacy and normal startup output. A separate legacy module case uses the same candidate's manifest/dist in an isolated, explicitly watchable directory through public Loader insertion and HMR `base/root`; the default node_modules exclusion remains in effect. No real version is recorded as retired.
|
|
95
|
+
|
|
96
|
+
`browser/host-release.spec.ts` fixes four real round trips: `0.2.1-alpha.4` ↔ `0.2.1-alpha.3`, `0.2.1-alpha.5` ↔ `0.2.1-alpha.4`, `0.2.1-rc.1` ↔ `0.2.1-alpha.5`, and `0.2.1-rc.2` ↔ `0.2.1-rc.1`. Each keeps the page in one temporary profile/port, checks the native release prompt, reloads to verify authentication, the original session and persisted settings, then restores the starting release. Only `0.2.1-alpha.3` lacks release metadata and reads unknown; every other destination must show its actual full version. No upstream source, version or dependency-graph metadata is changed.
|
|
97
|
+
|
|
98
|
+
## Consume a fixed archive
|
|
99
|
+
|
|
100
|
+
`pnpm verify:packed` consumes an existing tgz without building or packing. Record its SHA-256 first, then pass the archive, that digest, an exact declared DSH release and one or more suites:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
sha256sum artifacts/dsh-auth-remote-0.2.0.tgz
|
|
104
|
+
pnpm verify:packed --archive artifacts/dsh-auth-remote-0.2.0.tgz --sha256 <recorded-sha256> --dsh-version 0.2.1-rc.2 --suite cli --suite browser --suite smoke
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The consumer validates the package name/version and selected release declaration, stages those exact bytes at the fixed artifact path and restores only the archive's dist. CLI execution and installation comparisons therefore use that dist. It rejects unsafe tar entries, a changed digest, unknown selections, zero actual tests and skipped/cancelled/todo tests. Node's passing placeholder for a test file with no matching cases does not count as a real test. `--test-name-pattern` optionally filters one `cli` or `browser` suite; its report is explicitly partial and includes the files, pattern and actual commands. Fixed specialized suites cannot override their filter/count requirements; every required file must register tests.
|
|
108
|
+
|
|
109
|
+
| Suite | Selection |
|
|
110
|
+
| ------------------- | ----------------------------------------------------------------------------------- |
|
|
111
|
+
| `cli` | All CLI test files |
|
|
112
|
+
| `browser` | All browser test files |
|
|
113
|
+
| `smoke` | Install and briefly boot the archive in a new marked home |
|
|
114
|
+
| `theme` | The exact login/security theme and narrow-screen case (one real test) |
|
|
115
|
+
| `startup-transport` | startup-compatibility and native-transport on `0.2.1-alpha.1`, `0.2.1-alpha.2` |
|
|
116
|
+
| `account` | startup-compatibility, account-login and live-config on `0.2.1-alpha.3` |
|
|
117
|
+
| `host-release` | One real round trip on `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.1`, `0.2.1-rc.2` |
|
|
118
|
+
| `rc-bootstrap` | host-release and dsh-bootstrap on `0.2.1-rc.1` (two real tests) |
|
|
119
|
+
|
|
120
|
+
Consumption is serial within a checkout, enforced by a consumer lock. Each suite checks the input archive, fixed consumer archive and restored dist again. JSON reports and test logs remain under `.cache/verify-packed/`. Smoke creates its marked temporary root directly under `.cache/v-*` to keep the management socket within Linux's pathname limit in the default GitHub checkout. It uses its own runtime/home and `--port 0`; it reads only that child process's announced actual loopback address and checks online CLI status in the same profile. Existing `.dev/dsh-home` and services on 13090 are independent. Only the newly created verification root is removed. `DSH_VERIFY_ROOT` is internal and rejects unmarked, symlinked or external paths; ordinary development commands retain their existing profile and port.
|
|
121
|
+
|
|
122
|
+
## Ordinary and full CI plans
|
|
123
|
+
|
|
124
|
+
`scripts/ci-plan.mjs` selects ordinary verification only when every changed path is one of `CHANGELOG.md`, `CHANGELOG.zh-CN.md`, `CONTRIBUTING.md`, `CONTRIBUTING.zh-CN.md`, `LICENSE` or `tests/unit/i18n.test.ts`. Any other path selects full verification, including source, shared tests/helpers, package/lock/build scripts, workflows, README, support policies and compatibility inventories. Renames/copies, unknown statuses, empty or incomplete differences and an unexpected/dirty checkout also select full. PR comparison uses the actual event base/head and verifies merge parents; push comparison uses before/after. Missing commit evidence falls back to full.
|
|
125
|
+
|
|
126
|
+
Manual dispatch, unknown events, every release and the Monday 00:00 UTC schedule always use full verification. Ordinary reduction is enabled only after the first eleven-release, same-archive full validation succeeds. Every plan retains CLI/smoke on all eleven releases; the ordinary browser matrix is fixed:
|
|
127
|
+
|
|
128
|
+
| Exact DSH release | Ordinary browser selection |
|
|
129
|
+
| ----------------- | ----------------------------------------------- |
|
|
130
|
+
| `0.1.7-rc.1` | `browser` (complete) |
|
|
131
|
+
| `0.1.7-rc.2` | `theme` |
|
|
132
|
+
| `0.2.0-rc.1` | No separate browser job; CLI/smoke retained |
|
|
133
|
+
| `0.2.0-rc.2` | `browser` (complete) |
|
|
134
|
+
| `0.2.1-alpha.1` | `startup-transport` |
|
|
135
|
+
| `0.2.1-alpha.2` | `startup-transport` |
|
|
136
|
+
| `0.2.1-alpha.3` | `account` |
|
|
137
|
+
| `0.2.1-alpha.4` | `host-release` |
|
|
138
|
+
| `0.2.1-alpha.5` | `host-release` |
|
|
139
|
+
| `0.2.1-rc.1` | `rc-bootstrap` |
|
|
140
|
+
| `0.2.1-rc.2` | `browser` (complete, including search settings) |
|
|
141
|
+
|
|
142
|
+
The shared workflow validates the exact chosen matrix before consumption. A combination omitted by this explicit plan has no job; an unexpected skipped/cancelled job or zero required test file fails the aggregate. `CI Verify` requires the plan, producer and reusable verification to succeed. All high-risk changes and releases still require every browser target on the same archive. Keep fixed-port tests serial in one checkout; local concurrent jobs require separate source/dist/artifacts/runtime/profile trees, an independent copy of node_modules, and network namespaces. pnpm exec can refresh command shims, so workers must use their own writable dependency copy. Keep any shared source dependency directory read-only as a guard, and use copy-mode installation to avoid shared HMR inode changes.
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[English](development.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
本指南描述插件 `0.2.0` 的十一版精确验证目标;新增 RC 尚不能视为 npm `0.1.10` 的历史支持。最终同包运行证据另记执行记录。
|
|
6
|
+
|
|
7
|
+
开发和完整测试需要 Linux(profile 锁依赖 `/proc`)、Node.js 24+、pnpm 12.5.1,以及 DSH `0.2.1-rc.2`。浏览器测试使用 Playwright 管理的 Chromium 和 Node HTTP/HTTPS 转发器。
|
|
6
8
|
|
|
7
9
|
兼容声明或适配变更前,先阅读 [Legacy 兼容维护清单](legacy-compatibility.zh-CN.md)。共同复核运行时准入、测试目标、CI 和用户声明;适用版本退出支持集合时同次清理专属运行时代码及测试。旧插件配置按自身迁移策略退役,保留共享安全逻辑,并用完整版本号与精确版本证据同步更新中英文清单及两个维度的矩阵。
|
|
8
10
|
|
|
@@ -16,7 +18,7 @@ pnpm pack:local
|
|
|
16
18
|
pnpm smoke
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
`pnpm check` 依次执行类型、格式、构建、包/部署/文档检查,以及单元、集成、CLI 和浏览器测试。`pnpm pack:local` 在静态检查后写出 `artifacts/dsh-auth-remote-0.
|
|
21
|
+
`pnpm check` 依次执行类型、格式、构建、包/部署/文档检查,以及单元、集成、CLI 和浏览器测试。`pnpm pack:local` 在静态检查后写出 `artifacts/dsh-auth-remote-0.2.0.tgz`,不会发布。`pnpm smoke` 将包安装到隔离 DSH_HOME,短暂启动固定版本的 DSH,验证就绪、匿名重定向/拒绝和在线 CLI 状态,然后停止。
|
|
20
22
|
|
|
21
23
|
## 使用隔离开发 profile
|
|
22
24
|
|
|
@@ -31,24 +33,26 @@ pnpm dev:start
|
|
|
31
33
|
直接查看状态时显式使用同一隔离 home:
|
|
32
34
|
|
|
33
35
|
```sh
|
|
34
|
-
DSH_HOME="$PWD/.dev/dsh-home" "$PWD/.dev/runtime-0.2.1-
|
|
36
|
+
DSH_HOME="$PWD/.dev/dsh-home" "$PWD/.dev/runtime-0.2.1-rc.2/node_modules/.bin/dsh" plugin --profile web exec dsh-auth-remote status --json
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
开发 home 可能含测试账号数据,须保持私有,不要提交或复制到部署 profile。
|
|
38
40
|
|
|
39
41
|
## 测试边界
|
|
40
42
|
|
|
41
|
-
`pnpm test:unit` 覆盖认证状态机、TOTP、备用码、来源策略、翻译、存储持久性和锁恢复。`pnpm test:integration` 使用真实 HTTP/WebSocket socket 验证原生就绪、Cookie、来源判定与撤销。`pnpm test:cli` 构建真实压缩包,并用隔离 profile/Unix socket 验证交互与非交互命令。`pnpm test:browser` 用临时 profile 启动所选的 DSH
|
|
43
|
+
`pnpm test:unit` 覆盖认证状态机、TOTP、备用码、来源策略、翻译、存储持久性和锁恢复。`pnpm test:integration` 使用真实 HTTP/WebSocket socket 验证原生就绪、Cookie、来源判定与撤销。`pnpm test:cli` 构建真实压缩包,并用隔离 profile/Unix socket 验证交互与非交互命令。`pnpm test:browser` 用临时 profile 启动所选的 DSH 版本,验证登录、安全与登录页、原生设置、工作区、上传/预览、SSE、WebSocket 和 HTTPS 转发链。
|
|
42
44
|
|
|
43
|
-
浏览器网络链路使用 Node HTTP/HTTPS 转发器。`tests/fixtures/tls/` 下的专用自签证书与私钥仅为测试夹具,不进入安装包,也不是部署凭证。聊天使用本地模型替身;不执行真实第三方授权或付费模型请求。默认浏览器为 Playwright Chromium;`DSH_TEST_BROWSER` 可选择本地浏览器程序,`DSH_TEST_BIN` 仅在报告所选精确版本(默认 `0.2.1-
|
|
45
|
+
浏览器网络链路使用 Node HTTP/HTTPS 转发器。`tests/fixtures/tls/` 下的专用自签证书与私钥仅为测试夹具,不进入安装包,也不是部署凭证。聊天使用本地模型替身;不执行真实第三方授权或付费模型请求。默认浏览器为 Playwright Chromium;`DSH_TEST_BROWSER` 可选择本地浏览器程序,`DSH_TEST_BIN` 仅在报告所选精确版本(默认 `0.2.1-rc.2`)时可替换 DSH 二进制。
|
|
44
46
|
|
|
45
47
|
DSH 测试运行时位于 `.cache/test-runtime/<version>`,与源码依赖分别固定。宿主服务和 React 不打入客户端 bundle。[部署指南](deployment.zh-CN.md)说明 profile 与备份规则。
|
|
46
48
|
|
|
47
49
|
隔离验证安装使用 pnpm 的文件复制模式,避免不同 profile 共享包文件的硬链接元数据变化触发 DSH 客户端热重载。
|
|
48
50
|
|
|
51
|
+
支持决策见[规范](support-policy.zh-CN.md),发布事实见[双向历史](support-history.zh-CN.md),适配证据见库存。三层与 README 同时维护两种语言,不能用当前候选 manifest 推导旧发布声明。
|
|
52
|
+
|
|
49
53
|
## 跨版本验证
|
|
50
54
|
|
|
51
|
-
默认测试 DSH `0.2.1-
|
|
55
|
+
默认测试 DSH `0.2.1-rc.2`;`DSH_TEST_VERSION` 可选择 `0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.2`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.1` 或 `0.2.1-rc.2`,测试运行时分别位于 `.cache/test-runtime/<version>`,开发运行时位于 `.dev/runtime-<version>`。`DSH_TEST_BIN` 必须报告所选的精确版本。CI 对十一版分别保留 CLI 和安装冒烟。全量验证执行全部 browser 目标,普通验证使用下文固定的边界选择。开发类型和集成测试使用锁定的 DSH `0.2.1-rc.2` 包。源码检出目录的测试指南(`tests/README.zh-CN.md`)说明真实 Loader/模型地址核对,以及原生 IPv6/TLS 正向或不支持能力的断言;原生测试传输不可用时失败,不跳过。
|
|
52
56
|
|
|
53
57
|
```sh
|
|
54
58
|
DSH_TEST_VERSION=0.1.7-rc.1 pnpm test:cli
|
|
@@ -63,14 +67,76 @@ DSH_TEST_VERSION=0.2.1-alpha.1 pnpm test:cli
|
|
|
63
67
|
DSH_TEST_VERSION=0.2.1-alpha.1 pnpm test:browser
|
|
64
68
|
DSH_TEST_VERSION=0.2.1-alpha.2 pnpm test:cli
|
|
65
69
|
DSH_TEST_VERSION=0.2.1-alpha.2 pnpm test:browser
|
|
70
|
+
DSH_TEST_VERSION=0.2.1-alpha.3 pnpm test:cli
|
|
71
|
+
DSH_TEST_VERSION=0.2.1-alpha.3 pnpm test:browser
|
|
72
|
+
DSH_TEST_VERSION=0.2.1-alpha.4 pnpm test:cli
|
|
73
|
+
DSH_TEST_VERSION=0.2.1-alpha.4 pnpm test:browser
|
|
66
74
|
pnpm test:cli
|
|
67
75
|
pnpm test:browser
|
|
68
76
|
```
|
|
69
77
|
|
|
70
78
|
浏览器测试把浅色/深色、桌面/窄屏截图保存在 `.cache/ui-review/<version>`,供人工检查。安全页的 CSS 在插件生效时注入、销毁时移除,所有选择器只作用于插件页面,并直接引用宿主 `--dsw-*` 主题变量。独立登录页使用 dsh 0.2.0-rc.1 的主题变量子集并跟随系统配色,不读取登录前不可用的宿主设置。
|
|
71
79
|
|
|
72
|
-
官方账号专项测试使用本地平台替身与真实 DSH `0.2.1-
|
|
80
|
+
官方账号专项测试使用本地平台替身与真实 DSH `0.2.1-rc.2` 账号提供者,验证兑换保留原始 redirect URI 和 PKCE verifier,以及错误 state/URL/会话、重复提交、取消、过期和重试。浏览器覆盖账号菜单与引导中的先说明弹窗、回环导航失败后粘贴确认、弹窗拦截、动态语言与浅深色响应式布局。这些测试不会建立真实官方账号授权。
|
|
73
81
|
|
|
74
82
|
账号核心测试从锁定的开发依赖加载精确版本提供者,无需预先存在 CLI 运行时缓存;浏览器测试仍使用隔离 DSH profile 中实际安装的提供者。
|
|
75
83
|
|
|
76
|
-
|
|
84
|
+
此临时适配按 `>=0.2.1-alpha.3`(包含预发布)加必要能力与动态配置准入;完整手动功能回归覆盖 `0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.1`、`0.2.1-rc.2`。DSH `0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.2` 验证基础认证、完整安全与登录交互、动态配置持久化及手动能力不可用反馈。未来准入不构成已验证声明。支持范围或共享宿主适配变更须以同一最终 tgz 完整运行十一版 CLI、浏览器及 smoke;按下文及发布指南,对每个精确版本使用固定归档运行器的 `--suite cli --suite browser --suite smoke`。运行器恢复已验证 dist、逐 suite 核对 SHA-256,并隔离 smoke 与开发 profile;循环内不能调用重新打包的包装命令。公网回调证据、迁移及退役条件见兼容维护清单的 `DSH-ACCOUNT-001`。
|
|
85
|
+
|
|
86
|
+
`live-config.spec.ts` 仅观察真实 Loader 的配置引用/fiber、认证/存储实例、锁、监听器及 SSE/WebSocket 连续性,核对实际依赖链并重启验证 profile override;不伪造服务。安全弹窗回归覆盖取消/错误、焦点/键盘、默认及强制 TOTP、一次性备用码复制与会话撤销后跳转保持。任务文档、测试凭证、profile、截图及生成目录不得进入 npm 包。
|
|
87
|
+
|
|
88
|
+
`account-login.spec.ts` 还在每个声明版本验证真实原生配置 HMR:修改普通字段 `sessionHours` 重建监听器,之后独立 Settings 写入必须等待已有原生事务,而真正嵌套仍被拒绝。在 `0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.1`、`0.2.1-rc.2` 额外修改隔离安装的插件代码,验证原生模块替换后可以重新开启手动登录。测试专用事务探针调用真实 HMR,不替代服务且不进入 npm 包。监听器上下文的最小适配见 `DSH-HMR-001`。受保护远程部署必须按部署指南在 profile 级独立禁用原生监听。两个 RC 的启动回归只破坏隔离插件副本:不兼容的 `engines.dsh` 须使真实 Loader 跳过 bundle,注入插件侧准入范围则须触发其自身运行拒绝。两种情况均须启动失败,且无 TCP、HTTP、readiness 或 WebSocket 回退;不改上游代码、版本或 Loader 审计。
|
|
89
|
+
|
|
90
|
+
账号配置绑定通过原生 describe 镜像的 `ensure()` API 恢复首次读取失败;已有镜像中的命名空间恢复使用明确注入的 `remote.settings` 传输,并将已接纳值回填到同一镜像。偏好加载期间点击登录会等待共享读取,再按最新接纳的 true/false 值选择入口;加载中不等同于关闭。浏览器回归覆盖首次读取失败、命名空间暂缺,以及两种路由选择的延迟读取。
|
|
91
|
+
|
|
92
|
+
`0.2.1-rc.2` 原生 Search/Fetch 设置回归使用隔离远程 Host、实际三个设置命名空间和凭据域,覆盖提供者选择、校验/保存错误、刷新/重启持久化以及匿名/撤销会话拒绝。配置地址全部为本地测试地址,提供者请求计数必须为零,不执行付费 Search/Fetch 或真实官方账号操作。源码测试指南说明该验证边界。
|
|
93
|
+
|
|
94
|
+
启动维护诊断读取已安装插件的精确声明与显式生命周期记录。同一进程每个精确版本/状态仅提示一次,配置及模块 HMR 不重置,新进程重新提示。Legacy 日志包含公告日期与迁移建议;未验证/显式退役输入提示缺少当前支持承诺,正常支持版不增加提示。日期不停止服务,必要 API、包身份或安全失败仍拒绝服务。`dsh-support.test.ts` 使用模拟时钟跨过两个资格日期,账号 HMR 回归还检查真实 legacy 和正常版启动输出。独立 legacy 模块用例将同一候选的 manifest/dist 放入隔离的显式监听目录,使用公开 Loader 插入与 HMR `base/root`;原生默认的 node_modules 排除规则仍保留;没有真实版本登记为已退役。
|
|
95
|
+
|
|
96
|
+
`browser/host-release.spec.ts` 固定四组真实宿主往返切换:`0.2.1-alpha.4` ↔ `0.2.1-alpha.3`、`0.2.1-alpha.5` ↔ `0.2.1-alpha.4`、`0.2.1-rc.1` ↔ `0.2.1-alpha.5`、`0.2.1-rc.2` ↔ `0.2.1-rc.1`。同一临时 profile/端口保留页面,检查原生版本提示,刷新后核对认证、原会话和持久设置,再恢复起始版本。只有 `0.2.1-alpha.3` 无 release 元数据并显示未解析;其余目的宿主必须显示真实完整版本。不修改上游源码、版本或依赖图元数据。
|
|
97
|
+
|
|
98
|
+
## 消费固定归档
|
|
99
|
+
|
|
100
|
+
`pnpm verify:packed` 消费已有 tgz,不构建或打包。先记录 SHA-256,再传入归档、该摘要、精确声明的 DSH 版本及一个或多个 suite:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
sha256sum artifacts/dsh-auth-remote-0.2.0.tgz
|
|
104
|
+
pnpm verify:packed --archive artifacts/dsh-auth-remote-0.2.0.tgz --sha256 <recorded-sha256> --dsh-version 0.2.1-rc.2 --suite cli --suite browser --suite smoke
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
运行器验证包名/版本及所选宿主声明,将相同字节放到固定制品路径,仅恢复归档中的 dist,因此 CLI 执行与安装比较都使用这份 dist。不安全 tar 条目、摘要变化、未知选择、零真实用例及 skipped/cancelled/todo 用例均失败。Node 对无匹配用例文件产生的通过占位项不计作真实测试。`--test-name-pattern` 可筛选单个 `cli` 或 `browser` suite,报告明确标记为局部,并包含文件、筛选表达式与实际命令。固定专项不能覆盖其筛选/数量要求,每个必需文件均须注册测试。
|
|
108
|
+
|
|
109
|
+
| Suite | 选择范围 |
|
|
110
|
+
| ------------------- | ------------------------------------------------------------------------------------------- |
|
|
111
|
+
| `cli` | 全部 CLI 测试文件 |
|
|
112
|
+
| `browser` | 全部浏览器测试文件 |
|
|
113
|
+
| `smoke` | 在新建且带标记的 home 中安装并短暂启动归档 |
|
|
114
|
+
| `theme` | 精确登录/安全主题与窄屏用例(1 个真实测试) |
|
|
115
|
+
| `startup-transport` | `0.2.1-alpha.1`、`0.2.1-alpha.2` 的 startup-compatibility 与 native-transport |
|
|
116
|
+
| `account` | `0.2.1-alpha.3` 的 startup-compatibility、account-login 与 live-config |
|
|
117
|
+
| `host-release` | `0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.1`、`0.2.1-rc.2` 的真实往返切换(1 个真实测试) |
|
|
118
|
+
| `rc-bootstrap` | `0.2.1-rc.1` 的 host-release 与 dsh-bootstrap(2 个真实测试) |
|
|
119
|
+
|
|
120
|
+
同一 checkout 的消费以锁保证串行。每个 suite 结束均重新校验输入归档、固定消费归档及恢复的 dist。JSON 报告和测试日志保留在 `.cache/verify-packed/`。smoke 直接在 `.cache/v-*` 新建带内部标记的短目录,确保默认 GitHub 检出路径下的管理 socket 不超过 Linux 路径上限;使用独立 runtime/home,以 `--port 0` 启动,仅读取该子进程公布的实际回环地址,并在相同 profile 检查在线 CLI 状态。既有 `.dev/dsh-home` 和 13090 上的服务保持独立,只清理本次新建的验证根目录。`DSH_VERIFY_ROOT` 是内部入口,拒绝无标记、符号链接及外部路径;普通开发命令保留原有 profile 和端口。
|
|
121
|
+
|
|
122
|
+
## 普通与全量 CI 计划
|
|
123
|
+
|
|
124
|
+
`scripts/ci-plan.mjs` 仅在全部变更路径均为 `CHANGELOG.md`、`CHANGELOG.zh-CN.md`、`CONTRIBUTING.md`、`CONTRIBUTING.zh-CN.md`、`LICENSE` 或 `tests/unit/i18n.test.ts` 时选择普通计划。其他任何路径均全量,包括源码、共享测试/helper、package/lock/构建脚本、工作流、README、支持规范与兼容库存。重命名/复制、未知状态、空或不完整差异、异常/有未提交变更的检出也全量。PR 比较真实事件 base/head 并核对合并父提交,push 比较 before/after;缺少提交证据回退全量。
|
|
125
|
+
|
|
126
|
+
手动运行、未知事件、每次发布及 UTC 周一 00:00 的定时检查固定全量。首次十一版同包全量成功后才启用普通缩减。所有计划保留全部十一版 CLI/smoke;普通 browser 矩阵固定如下:
|
|
127
|
+
|
|
128
|
+
| 精确 DSH 版本 | 普通 browser 选择 |
|
|
129
|
+
| --------------- | ---------------------------------- |
|
|
130
|
+
| `0.1.7-rc.1` | `browser`(完整) |
|
|
131
|
+
| `0.1.7-rc.2` | `theme` |
|
|
132
|
+
| `0.2.0-rc.1` | 不单列 browser job,保留 CLI/smoke |
|
|
133
|
+
| `0.2.0-rc.2` | `browser`(完整) |
|
|
134
|
+
| `0.2.1-alpha.1` | `startup-transport` |
|
|
135
|
+
| `0.2.1-alpha.2` | `startup-transport` |
|
|
136
|
+
| `0.2.1-alpha.3` | `account` |
|
|
137
|
+
| `0.2.1-alpha.4` | `host-release` |
|
|
138
|
+
| `0.2.1-alpha.5` | `host-release` |
|
|
139
|
+
| `0.2.1-rc.1` | `rc-bootstrap` |
|
|
140
|
+
| `0.2.1-rc.2` | `browser`(完整,含搜索设置) |
|
|
141
|
+
|
|
142
|
+
共享工作流先验证所选矩阵的精确内容。显式计划未安排的组合不生成 job;意外 skipped/cancelled 或必需文件零用例使聚合失败。`CI Verify` 要求 plan、producer 和共用验证全部成功。高风险变更及每次发布仍须对同包执行全部 browser。单个 checkout 的固定端口测试保持串行;本地并发 job 须具备独立源码/dist/制品/runtime/profile 树、各自复制的 node_modules 与网络命名空间。pnpm exec 会刷新命令入口,因此 worker 须使用自己的可写依赖副本。共享的源依赖目录只读保护,并使用复制安装避免共享 HMR inode 变化。
|