dsh-standards 0.0.3 → 1.0.1

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.
Files changed (139) hide show
  1. package/40-checker/README.md +251 -0
  2. package/40-checker/bin/dsh-levels.mjs +15 -0
  3. package/40-checker/bin/dsh-plugin-verify.mjs +8 -0
  4. package/40-checker/fixtures/bad/index.mjs +12 -0
  5. package/40-checker/fixtures/bad/package.json +15 -0
  6. package/40-checker/fixtures/bad-manifest/index.js +1 -0
  7. package/40-checker/fixtures/bad-manifest/package.json +5 -0
  8. package/40-checker/fixtures/bundle/cordis.patch.yml +3 -0
  9. package/40-checker/fixtures/bundle/package.json +15 -0
  10. package/40-checker/fixtures/bundle/server.mjs +7 -0
  11. package/40-checker/fixtures/bundle-v0/cordis.patch.yml +3 -0
  12. package/40-checker/fixtures/bundle-v0/package.json +21 -0
  13. package/40-checker/fixtures/bundle-v0/server.mjs +7 -0
  14. package/40-checker/fixtures/client-missing/client.js +1 -0
  15. package/40-checker/fixtures/client-missing/index.js +1 -0
  16. package/40-checker/fixtures/client-missing/package.json +6 -0
  17. package/40-checker/fixtures/flow-config/index.js +9 -0
  18. package/40-checker/fixtures/flow-config/package.json +10 -0
  19. package/40-checker/fixtures/fs-write/index.mjs +7 -0
  20. package/40-checker/fixtures/fs-write/package.json +10 -0
  21. package/40-checker/fixtures/good/index.mjs +10 -0
  22. package/40-checker/fixtures/good/package.json +19 -0
  23. package/40-checker/fixtures/hang/index.mjs +5 -0
  24. package/40-checker/fixtures/hang/package.json +10 -0
  25. package/40-checker/fixtures/known-answer/expected.json +18 -0
  26. package/40-checker/fixtures/market-index-real.json +18 -0
  27. package/40-checker/fixtures/market-index.json +18 -0
  28. package/40-checker/fixtures/negative/bad-entry/package.json +1 -0
  29. package/40-checker/fixtures/negative/no-entry/package.json +1 -0
  30. package/40-checker/fixtures/negative/no-patch/package.json +1 -0
  31. package/40-checker/fixtures/negative/root-missing/cordis.patch.yml +2 -0
  32. package/40-checker/fixtures/negative/root-missing/package.json +1 -0
  33. package/40-checker/fixtures/negative/workspace/package.json +1 -0
  34. package/40-checker/package.json +22 -0
  35. package/40-checker/samples/README.md +8 -0
  36. package/40-checker/samples/entry18.json +139 -0
  37. package/40-checker/samples/frame.json +485 -0
  38. package/40-checker/scripts/apply-overlay.mjs +59 -0
  39. package/40-checker/scripts/attestation-check.mjs +151 -0
  40. package/40-checker/scripts/bundle-smoke.mjs +126 -0
  41. package/40-checker/scripts/claim-check.mjs +145 -0
  42. package/40-checker/scripts/clause-map.mjs +94 -0
  43. package/40-checker/scripts/collect-fixtures.mjs +44 -0
  44. package/40-checker/scripts/dashboard.mjs +85 -0
  45. package/40-checker/scripts/dco-check.mjs +147 -0
  46. package/40-checker/scripts/dependabot-check.mjs +40 -0
  47. package/40-checker/scripts/doc-commands-check.mjs +92 -0
  48. package/40-checker/scripts/entry-scan.mjs +190 -0
  49. package/40-checker/scripts/entry-validate.mjs +291 -0
  50. package/40-checker/scripts/entry18-attribution.mjs +66 -0
  51. package/40-checker/scripts/entry18-ci.mjs +685 -0
  52. package/40-checker/scripts/entry18-realweb-summary.mjs +71 -0
  53. package/40-checker/scripts/entry18-web.mjs +307 -0
  54. package/40-checker/scripts/evidence-chain.mjs +100 -0
  55. package/40-checker/scripts/flow-index.mjs +82 -0
  56. package/40-checker/scripts/flow-sample-ci.mjs +529 -0
  57. package/40-checker/scripts/governance-check.mjs +210 -0
  58. package/40-checker/scripts/host-farm.mjs +165 -0
  59. package/40-checker/scripts/journey-config-observe.mjs +109 -0
  60. package/40-checker/scripts/journey-disclosure-shape.mjs +83 -0
  61. package/40-checker/scripts/journey-runtime.mjs +178 -0
  62. package/40-checker/scripts/journey.mjs +76 -0
  63. package/40-checker/scripts/label-drift.mjs +74 -0
  64. package/40-checker/scripts/label-sync.mjs +87 -0
  65. package/40-checker/scripts/label-verify.mjs +90 -0
  66. package/40-checker/scripts/landlock-exec.c +101 -0
  67. package/40-checker/scripts/level-audit.mjs +336 -0
  68. package/40-checker/scripts/m1-sidecar.mjs +126 -0
  69. package/40-checker/scripts/m2-runner.mjs +213 -0
  70. package/40-checker/scripts/round-robin.mjs +88 -0
  71. package/40-checker/scripts/sample-frame.mjs +72 -0
  72. package/40-checker/scripts/sample20-ci.mjs +25 -0
  73. package/40-checker/scripts/sample60-ci.mjs +25 -0
  74. package/40-checker/scripts/stale-check.mjs +59 -0
  75. package/40-checker/scripts/surveillance.mjs +88 -0
  76. package/40-checker/scripts/web-probe.mjs +504 -0
  77. package/40-checker/src/cli.mjs +300 -0
  78. package/40-checker/src/client-shape.mjs +37 -0
  79. package/40-checker/src/declarations.mjs +242 -0
  80. package/40-checker/src/index.mjs +8 -0
  81. package/40-checker/src/install-spec.mjs +67 -0
  82. package/40-checker/src/label.mjs +130 -0
  83. package/40-checker/src/manifest.mjs +381 -0
  84. package/40-checker/src/permissions.mjs +60 -0
  85. package/40-checker/src/report.mjs +204 -0
  86. package/40-checker/src/result.mjs +60 -0
  87. package/40-checker/src/runtime.mjs +299 -0
  88. package/40-checker/src/semver.mjs +194 -0
  89. package/40-checker/src/util.mjs +148 -0
  90. package/40-checker/test/attestation.test.mjs +59 -0
  91. package/40-checker/test/checks.test.mjs +172 -0
  92. package/40-checker/test/claim.test.mjs +28 -0
  93. package/40-checker/test/client-shape.test.mjs +35 -0
  94. package/40-checker/test/dco.test.mjs +51 -0
  95. package/40-checker/test/entry-validate.test.mjs +172 -0
  96. package/40-checker/test/governance.test.mjs +76 -0
  97. package/40-checker/test/label.test.mjs +97 -0
  98. package/40-checker/test/level-audit.test.mjs +99 -0
  99. package/40-checker/test/levels.test.mjs +31 -0
  100. package/40-checker/test/ops.test.mjs +117 -0
  101. package/40-checker/test/permissions.test.mjs +40 -0
  102. package/40-checker/test/semver.test.mjs +32 -0
  103. package/40-checker/test/verify.test.mjs +57 -0
  104. package/CHANGELOG.md +24 -0
  105. package/LICENSE +28 -0
  106. package/LICENSE-APACHE +190 -0
  107. package/LICENSE-CC-BY +23 -0
  108. package/NOTICE +14 -0
  109. package/NOTICE.md +11 -0
  110. package/README.md +146 -3
  111. package/bin/dsh-levels.mjs +4 -0
  112. package/bin/dsh-standards.mjs +19 -0
  113. package/docs/BOOST-FIXTURES-2026-11-02.md +38 -0
  114. package/docs/DEVELOPER-JOURNEY.md +40 -0
  115. package/docs/HOST-J3-BUG-REPORT-DRAFT.md +27 -0
  116. package/docs/HOST-J3-CONFIG-REPRO-2026-11-02.md +36 -0
  117. package/docs/NAMING-FALLBACK.md +11 -0
  118. package/docs/fork-policy.md +12 -0
  119. package/docs/full-test-plan-2026-11-02.md +207 -0
  120. package/docs/incident.md +37 -0
  121. package/docs/onboarding.md +27 -0
  122. package/docs/privacy.md +12 -0
  123. package/docs/release.md +16 -0
  124. package/docs/scope-security.md +62 -0
  125. package/docs/status-taxonomy.md +54 -0
  126. package/docs/sunset.md +44 -0
  127. package/docs/translating.md +12 -0
  128. package/package.json +58 -12
  129. package/spec/README.md +27 -0
  130. package/spec/boost/README.md +8 -0
  131. package/spec/clauses.json +253 -0
  132. package/spec/entry/README.md +9 -0
  133. package/spec/flow/README.md +8 -0
  134. package/spec/levels.json +371 -0
  135. package/spec/levels.schema.json +45 -0
  136. package/spec/reference-suite.json +35 -0
  137. package/spec/schemas/attestation.schema.json +284 -0
  138. package/spec/schemas/evidence.schema.json +331 -0
  139. package/spec/schemas/report.schema.json +64 -0
@@ -0,0 +1,40 @@
1
+ import test from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+ import { checkCredentials } from '../src/declarations.mjs'
4
+ import { validateCommitments, validateDisclosure, COMMITMENT_IDS } from '../src/permissions.mjs'
5
+
6
+ const manifest = {
7
+ dsh: {
8
+ commitmentsVersion: 1,
9
+ commitments: Object.fromEntries(COMMITMENT_IDS.map(id => [id, true])),
10
+ disclosure: {
11
+ endpoints: ['https://api.example.com'],
12
+ retention: 'none',
13
+ systemPrompt: 'unchanged',
14
+ },
15
+ capabilities: ['network:egress'],
16
+ },
17
+ }
18
+
19
+ test('all 9 commitments validate as booleans', () => {
20
+ const details = validateCommitments(manifest)
21
+ assert.equal(details.length, 1)
22
+ assert.equal(details[0].result, 'PASS')
23
+ })
24
+
25
+ test('missing commitment is a warning, not a failure', () => {
26
+ const details = validateCommitments({ dsh: { commitments: { 'no-session-upload': true } } })
27
+ assert.ok(details.some(item => item.result === 'WARN' && item.reason.includes('missing commitment')))
28
+ })
29
+
30
+ test('disclosure endpoints must be https URLs', () => {
31
+ const details = validateDisclosure({ dsh: { disclosure: { endpoints: ['http://insecure.example.com'] } } })
32
+ assert.ok(details.some(item => item.result === 'WARN'))
33
+ })
34
+
35
+ test('checkCredentials reads both declaration fields', () => {
36
+ const check = checkCredentials(manifest, [])
37
+ assert.equal(check.result, 'PASS')
38
+ assert.ok(check.details.some(item => item.item === 'C-12.6' && item.result === 'PASS'))
39
+ assert.ok(check.details.some(item => item.item === 'C-12.7' && item.result === 'PASS'))
40
+ })
@@ -0,0 +1,32 @@
1
+ import test from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+ import { compareVersions, parseVersion, satisfies, validRange } from '../src/semver.mjs'
4
+
5
+ test('parseVersion accepts exact semver and prerelease', () => {
6
+ assert.deepEqual(parseVersion('0.2.2-alpha.2'), { major: 0, minor: 2, patch: 2, prerelease: ['alpha', '2'] })
7
+ assert.equal(parseVersion('^0.2.2'), null)
8
+ })
9
+
10
+ test('compareVersions orders release above prerelease', () => {
11
+ assert.equal(compareVersions(parseVersion('0.2.2'), parseVersion('0.2.2-alpha.2')), 1)
12
+ assert.equal(compareVersions(parseVersion('0.2.2-alpha.2'), parseVersion('0.2.2-alpha.1')), 1)
13
+ assert.equal(compareVersions(parseVersion('0.2.0-rc.2'), parseVersion('0.2.0-0')), 1)
14
+ })
15
+
16
+ test('satisfies handles the ranges used by real plugins', () => {
17
+ assert.equal(satisfies('0.2.2-alpha.2', '>=0.2.2-alpha.2 <0.3.0'), true)
18
+ assert.equal(satisfies('0.2.2-alpha.2', '>=0.1.5-rc.1 <0.2.0-0 || >=0.2.0-rc.2 <0.3.0-0'), true)
19
+ assert.equal(satisfies('0.2.2-alpha.2', '^0.2.2-alpha.2'), true)
20
+ assert.equal(satisfies('0.2.2-alpha.2', '~0.2.2'), false)
21
+ assert.equal(satisfies('0.2.2-alpha.2', '^0.2.2'), false)
22
+ assert.equal(satisfies('0.2.2-alpha.2', '>=0.3.0'), false)
23
+ assert.equal(satisfies('0.2.2-alpha.2', 'workspace:^'), false)
24
+ assert.equal(satisfies('24.0.0', '^22.19.0 || >=24.0.0'), true)
25
+ })
26
+
27
+ test('validRange rejects empty and malformed ranges', () => {
28
+ assert.equal(validRange('>=0.2.2 <0.3.0'), true)
29
+ assert.equal(validRange(''), false)
30
+ assert.equal(validRange('workspace:^'), false)
31
+ assert.equal(validRange('not-a-range'), false)
32
+ })
@@ -0,0 +1,57 @@
1
+ import test from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+ import fs from 'node:fs'
4
+ import os from 'node:os'
5
+ import path from 'node:path'
6
+ import { fileURLToPath } from 'node:url'
7
+ import { buildIndex, findAttestation, effectiveStatus, summarize, verify } from '../../publish/verify.mjs'
8
+
9
+ const HERE = path.dirname(fileURLToPath(import.meta.url))
10
+ const ROOT = path.resolve(HERE, '..', '..')
11
+
12
+ test('verify: the index contains the example record', () => {
13
+ const index = buildIndex(path.join(ROOT, 'publish/attestations'))
14
+ assert.equal(index.schema, 'dsh-attestation-index/1')
15
+ const entry = findAttestation(index, 'DSH-ATT-2026-001')
16
+ assert.ok(entry)
17
+ assert.equal(entry.grade, 'A')
18
+ assert.equal(entry.claimLevel, 'self-reported')
19
+ })
20
+
21
+ test('verify: an unknown ID is not found', () => {
22
+ const index = buildIndex(path.join(ROOT, 'publish/attestations'))
23
+ assert.equal(findAttestation(index, 'DSH-ATT-1999-999'), null)
24
+ })
25
+
26
+ test('verify: an expired active record is reported expired', () => {
27
+ const cert = { status: 'active', expiresAt: '2020-01-01' }
28
+ assert.equal(effectiveStatus(cert, new Date('2026-11-01T00:00:00Z')), 'expired')
29
+ })
30
+
31
+ test('verify: a non-active status is preserved', () => {
32
+ assert.equal(effectiveStatus({ status: 'withdrawn', expiresAt: '2030-01-01' }), 'withdrawn')
33
+ })
34
+
35
+ test('verify: the example record validates', async () => {
36
+ const result = await verify({ root: ROOT, id: 'DSH-ATT-2026-001' })
37
+ assert.equal(result.ok, true)
38
+ assert.equal(result.attestation.claimLevel, 'self-reported')
39
+ assert.equal(result.attestation.selfAssessed, true)
40
+ })
41
+
42
+ test('verify: an invalid file fails', async () => {
43
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'dsh-verify-cert-'))
44
+ const file = path.join(dir, 'bad.json')
45
+ fs.writeFileSync(file, JSON.stringify({ schema: 'dsh-attestation/1', attestationId: 'bad' }))
46
+ const result = await verify({ root: ROOT, file })
47
+ assert.equal(result.ok, false)
48
+ assert.ok(result.errors.length > 0)
49
+ fs.rmSync(dir, { recursive: true, force: true })
50
+ })
51
+
52
+ test('verify: summarize keeps the disclaimer and evidence', () => {
53
+ const cert = JSON.parse(fs.readFileSync(path.join(ROOT, 'publish/attestations/DSH-ATT-2026-001.json'), 'utf8'))
54
+ const s = summarize(cert)
55
+ assert.match(s.disclaimer, /非官方/)
56
+ assert.equal(s.evidence.length, 5)
57
+ })
package/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ ## 1.0.1 — 2026-11-03
2
+
3
+ - 打包:`files` 收窄,不再把 `40-checker/results/` 打进 npm 包(此前包含第三方插件结果、截图与本机路径)。
4
+ - 文档:`npx dsh-levels` 会装到第三方包,改为 `npx -p dsh-standards dsh-levels`;修正不存在的 `bin/` 路径;测试数 73→98。
5
+ - CLI:`dsh-standards --help` 首行显示自己的包名与版本。
6
+ - 检查器:`exports["."]` 指向缺失文件时不再回退到 `main`。
7
+
8
+ # Changelog
9
+
10
+ ## 2026-11-03 — Node 24.9 baseline
11
+ - Require Node >=24.9.0 to match DeepSeek Harness 0.2.2-alpha.3.
12
+
13
+ ## 2026-11-02 — P0–P2, Apache-2.0, and attestation migration
14
+
15
+ - Renamed certificate → attestation (`dsh-attestation/1`, `DSH-ATT-*`,
16
+ `publish/attestations/`); historical docs carry a migration banner.
17
+ - Added the gap ledger (43), role governance (44), and three-purpose kits (45).
18
+ - Added `scheme/`, `spec/clauses.json`, `spec/reference-suite.json`,
19
+ `spec/schemas/report.schema.json`, `evidence/` hash chain.
20
+ - Added G4 static check, clause-map, stale-check, surveillance, dashboard.
21
+ - Added developer/official/market kits and `publish/verify.mjs` / `verify.html`.
22
+ - CI: governance checks, 73 tests, attestation verify, shell syntax, cross-platform matrix.
23
+ - License: text CC BY 4.0 with a required Change Notice; code Apache-2.0 (D-013); marks separate.
24
+ - Cross-repo: portal `f882144`, guide `e75cd9f`, kit `9897213`, catalog `a272d06`, certification `2f27666`, cert-mcp `4f0cf72`.
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ DSH standards — licensing
2
+
3
+ This repository uses two licenses, by material type.
4
+
5
+ 1. Text, specifications, checklists, documentation, and translations
6
+ License: Creative Commons Attribution 4.0 International (CC BY 4.0)
7
+ Full text: LICENSE-CC-BY
8
+ SPDX: CC-BY-4.0
9
+ Modification notice: MODIFICATION-POLICY.md (required, prominent)
10
+
11
+ 2. Code, scripts, schemas, and machine-readable checkers
12
+ License: Apache License, Version 2.0
13
+ Full text: LICENSE-APACHE
14
+ SPDX: Apache-2.0
15
+
16
+ 3. Marks and badges
17
+ The words DSH-ENTRY, DSH-FLOW, DSH-BOOST and the level badges are not
18
+ licensed by 1 or 2. Their use is governed by governance/mark-policy.md.
19
+ No trademark registration is claimed.
20
+
21
+ Contributions are accepted under governance/contribution-terms.md
22
+ (DCO 1.1 + a non-exclusive copyright licence + an RF patent commitment), not
23
+ under a copyright assignment. By contributing text you agree that it may be
24
+ distributed under CC BY 4.0 and that modifications must carry a Change Notice;
25
+ by contributing code you agree that it may be distributed under Apache-2.0.
26
+
27
+ This file is a notice, not legal advice. A lawyer should review it before the
28
+ repository is used commercially.
package/LICENSE-APACHE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 PerryLink dsh-plugin-portal contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/LICENSE-CC-BY ADDED
@@ -0,0 +1,23 @@
1
+ Creative Commons Attribution 4.0 International (CC BY 4.0)
2
+
3
+ This repository's text, specifications, checklists, documentation, and
4
+ translations are licensed under CC BY 4.0.
5
+
6
+ Full legal code:
7
+ https://creativecommons.org/licenses/by/4.0/legalcode
8
+
9
+ SPDX identifier: CC-BY-4.0
10
+
11
+ You are free to share and adapt the material for any purpose, provided you:
12
+ - give appropriate credit;
13
+ - link to the license;
14
+ - indicate if changes were made; and
15
+ - do not imply the licensor endorses you or your use.
16
+
17
+ This project asks for the "indicate changes" requirement to be met with a
18
+ prominent Change Notice. See MODIFICATION-POLICY.md for the required fields.
19
+ That policy is the project's attribution/notice format; it does not add a
20
+ license restriction beyond CC BY 4.0. If it is read as a restriction, CC BY 4.0
21
+ controls.
22
+
23
+ The license does not grant trademark rights. See governance/mark-policy.md.
package/NOTICE ADDED
@@ -0,0 +1,14 @@
1
+ DSH standards
2
+ Copyright 2026 PerryLink
3
+
4
+ Text/specifications/documentation: CC BY 4.0 (LICENSE-CC-BY).
5
+ Modifications must carry a prominent Change Notice (MODIFICATION-POLICY.md).
6
+ Code/scripts/schemas: Apache License 2.0 (LICENSE-APACHE).
7
+
8
+ Unless required by applicable law or agreed to in writing, software is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
10
+ See the applicable license for the specific language.
11
+
12
+ The words DSH-ENTRY, DSH-FLOW, DSH-BOOST and the level badges are not licensed
13
+ by either license. Their use is governed by governance/mark-policy.md.
14
+ No trademark registration is claimed.
package/NOTICE.md ADDED
@@ -0,0 +1,11 @@
1
+ # NOTICE
2
+
3
+ `dsh-standards` is a community project. It is **not** an official DeepSeek
4
+ Harness standard, certification, security audit, endorsement, or ranking.
5
+
6
+ - Text, specifications, and documentation: CC BY 4.0 (`LICENSE-CC-BY`).
7
+ - Code, scripts, and schemas: Apache-2.0 (`LICENSE-APACHE`).
8
+
9
+ Copying or modifying the specification text requires a Change Notice naming the
10
+ source commit, the changed section, what changed, why, and the date. See
11
+ `MODIFICATION-POLICY.md`.
package/README.md CHANGED
@@ -1,9 +1,152 @@
1
+ > **Execution home.** `dsh-standards` is the public execution umbrella for the
2
+ > three DSH layers: it ships the conformance checker, the level audit, and the
3
+ > canonical specification files. The prose guide is
4
+ > **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)**; the
5
+ > low-level rule text remains in
6
+ > **[dsh-plugin-spec](https://github.com/PerryLink/dsh-plugin-spec)**.
7
+ > The old npm reservation (`dsh-standards@0.0.3`) is replaced by this 1.x line.
8
+
1
9
  # dsh-standards
2
10
 
3
- Name reservation for the DSH plugin standards draft. Canonical: https://github.com/PerryLink/dsh-standards (private).
11
+ > **非官方、非认证、非安全审计。** 这是 DSH 插件规范与实践草稿(canonical: dsh-standards),不代表 DeepSeek 官方背书。
12
+ > `"DeepSeek Harness"` 是 DeepSeek 的商标;本项目只使用 `DSH` 缩写。
13
+ >
14
+ > ⚠️ **修改必须说明**:复制或修改本仓文本时,必须在显著位置给出 Change Notice(来源 commit、改了哪个章节、改了什么、为什么、日期)。见 [`MODIFICATION-POLICY.md`](MODIFICATION-POLICY.md)。
15
+
16
+ 一个项目,三层采用深度:
17
+
18
+ | 层 | 规范/实践 | 当前状态 |
19
+ |---|---|---|
20
+ | 1 | **DSH-ENTRY 入门规范** | 18/18 `recognized`;base-only 10/18 有 runtime 证据(8 clean + 2 reject);real web profile 16/18 无告警、2 个 host-gate reject(自评,无独立复核);client 15/15 loaded;18/18 clean 未达成 |
21
+ | 2 | **DSH-FLOW 顺畅规范** | draft;fixture 上 J1/J2/J4/J6 **12 PASS**;J3/J7 fixture runtime;J5/J8 static preflight;10 个真实包 **78 PASS / 4 FAIL / 2 blocked / 66 not-run** |
22
+ | 3 | **DSH-BOOST 加速实践** | draft;LEV-1–8 **8/8 measured**(loader / context / provider-capture / synthetic timer;非生产基线) |
23
+
24
+ ## 先看什么
25
+
26
+ - [START-HERE](START-HERE.md) — 新会话先读的一页入口
27
+ - [51-新会话操作手册](51-新会话操作手册.md) — 仓库地图、命令、权限、常见坑
28
+ - [00-索引](00-索引.md) — 全包路由
29
+ - [31-DSH-ENTRY 入门规范](31-DSH-ENTRY入门规范.md) — 内部条款
30
+ - [99-DSH-ENTRY 兼容性画像(对外版)](99-DSH-ENTRY兼容性画像-对外版.md) — 4–6 页对外版
31
+ - [32-DSH-FLOW 顺畅规范](32-DSH-FLOW顺畅规范.md) — J1–J8
32
+ - [33-DSH-BOOST 加速实践](33-DSH-BOOST加速实践.md) — 8 条 LEV
33
+ - [34-三层分级模型(GB/GB-T/GB-Z 类比)](34-三层分级模型-GB-GBT-GBZ类比.md) — 为什么是三层、怎么读
34
+ - [35-三层开发建议与验收清单](35-三层开发建议与验收清单.md) — 作者最短路径 / 评审清单
35
+ - [36-插件全生命周期与工具链](36-插件全生命周期与工具链.md) — 从脚手架到退役
36
+ - [37-PerryLink 插件生态三层对照](37-PerryLink插件生态-三层对照与升级清单.md) — 我的仓怎么升级
37
+ - [38-三层标准 RFC](38-RFC-三层标准-待商议问题.md) — 内测群商议的 8 个问题
38
+ - [39-五工具定位与贡献](39-五工具定位与贡献.md) — guide/doctor/cert/portal/catalog 的角色
39
+ - [40-五工具全面转向方案](40-五工具全面转向方案.md) — 以三层为主轴的迁移计划
40
+ - [42-标准体系缺口](42-标准体系缺口-认证检验认可.md) — 认证/检验/认可/监督还差什么
41
+ - [43-缺口总账与 AI 可执行方案](43-缺口总账与AI可执行方案.md) — **全部缺口、AI/Human/模板/删除裁决、90 天 P0–P3**
42
+ - [44-角色治理与贡献机制](44-角色治理与贡献机制.md) — **角色阶梯、DCO+DCT(CLA 式)、COI、申诉、AI 职员**
43
+ - [45-三用途落地](45-三用途落地-官方市场开发者.md) — **官方前沿探索 / 市场参考 / 开发者指南**
44
+ - [P0-P2 执行状态](P0-P2-STATUS.md) — 逐项 DONE / PARTIAL / REPLACED
45
+ - [46-剩余事项与执行建议](46-剩余事项与执行建议.md) — 还差什么、先做什么、什么不做
46
+ - [47-配套插件发布记录](47-配套插件发布记录-2026-11-02.md) — guide/doctor/kit/upgrade/cert-mcp 的 npm + Release
47
+ - [48-配套包命名研究](48-配套包命名研究-2026-11-02.md) — dsh-* 占用情况与命名备选
48
+ - [49-配套包改名迁移记录](49-配套包改名迁移记录-2026-11-02.md) — clinic / scaffold / primer / codemod 的新旧仓映射、指针与 deprecate
49
+ - [50-新会话交接提示词](50-新会话交接提示词.md) — 无上下文新会话的启动提示词(不依赖旧会话)
50
+ - [scheme/](scheme/SCHEME-v1.md) — A–E / A–D 评价方案与 rubric
51
+ - [evidence/](evidence/README.md) — 追加式证据链与复跑说明
52
+ - [97-采纳可行性评估](97-采纳可行性评估.md) — 官方路径、缺口、90 天
53
+ - [98-内测群与官方沟通包](98-内测群与官方沟通包.md) — 对外话术
54
+
55
+ ## 快速命令
56
+
57
+ ```bash
58
+ # Published umbrella (package `dsh-standards`)
59
+ npx dsh-standards <plugin-dir> --scope entry --entry-claim static
60
+ npx -p dsh-standards dsh-levels <dir> --format json
4
61
 
5
- This package is intentionally minimal: it does not certify, audit, or guarantee any plugin.
62
+ # From a source checkout
63
+ cd 40-checker
64
+ node --test test/*.test.mjs
6
65
 
66
+ # 只做结构识别(不声明运行)
67
+ node 40-checker/bin/dsh-plugin-verify.mjs <plugin-dir> --scope entry --entry-claim static
68
+
69
+ # 声明运行(bundle 需要 host)
70
+ node 40-checker/bin/dsh-plugin-verify.mjs <bundle-dir> --scope entry \
71
+ --host /path/to/@deepseek-ai/dsh-app-boot/lib/index.js
72
+
73
+ # 三层自检(ENTRY 自动;FLOW/BOOST 证据文件)
74
+ node bin/dsh-levels.mjs <dir> --format json
75
+
76
+ # J1 安装/卸载旅程
77
+ node scripts/journey-runtime.mjs --package <dir> --json
78
+
79
+ # 治理/贡献/评价记录检查
80
+ node scripts/governance-check.mjs
81
+ node scripts/attestation-check.mjs
82
+ node scripts/claim-check.mjs
83
+ node scripts/dco-check.mjs --range HEAD~1..HEAD
84
+ node ../publish/verify.mjs --id DSH-ATT-2026-001
85
+
86
+ # LEV-7 有界并行基准
87
+ cd ../examples/boost
88
+ node lev7-bench.mjs 64 20
7
89
  ```
8
- $ npx dsh-standards
90
+
91
+ ## 当前硬数据
92
+
93
+ - 18 包 entry static:**18/18 recognized,0 clean**;
94
+ - 18 包 DS-C static:**0 PASS / 9 WARN / 9 FAIL**;
95
+ - 18 包 base-only runtime:**18/18 有原始 JSON;10/18 G3 verified,8 partial,0 error**;host gate 后 **8 clean + 2 reject + 8 partial**;
96
+ - client runtime:**15/15 `client-module-loaded`**(真实 Chromium);web-app **4/4 loaded**;
97
+ - 不可用:**0 plugin code FAIL;2 host-gate reject(telemetry/verification)**;
98
+ - 检查器:**98/98 tests**(含治理/DCO/评价记录/声明/验真/链/漂移测试);
99
+ - J1:**6 PASS + 1 WARN**;LEV-3:volatile **0/20** vs control **20/20** remount;LEV-6:稳定 prefix **100%** vs 易变 **0%**;LEV-7:**8.24×**(合成,非生产基线)。
100
+
101
+ ## 给插件开发者:什么时候用哪个工具
102
+
103
+ | 阶段 | 命令 | 工具 | 产出 |
104
+ |---|---|---|---|
105
+ | 开始 | `dsh-dev new` / `dsh-start new` | dsh-plugin-start | 可安装骨架 |
106
+ | 静态预检 | `dsh-dev check` / `dsh-ready` | dsh-plugin-ready | static report(host `not-run`) |
107
+ | 宿主契约 | `dsh-clinic --only R,K,X` | dsh-plugin-doctor/clinic | 宿主契约 |
108
+ | 隔离安装 | `dsh-test-drive` | dsh-test-drive | C3 证据 |
109
+ | 市场提交 | `entry-validate --host-evidence` | 本仓 40-checker | C1–C8 + C3 |
110
+ | 工具管理 | `dsh-tools list/doctor/install` | dsh-plugin-tools | 版本/安装指引 |
111
+
112
+ 完整图见 [docs/DEVELOPER-JOURNEY.md](docs/DEVELOPER-JOURNEY.md);工具家族见 [dsh-plugin-devtools](https://github.com/PerryLink/dsh-plugin-devtools)。旧名项目见 [RENAMES.md](RENAMES.md)。
113
+
114
+ ## 治理与贡献
115
+
116
+ - 角色与权限:`governance/roles.json`;一页说明:`GOVERNANCE.md`
117
+ - 贡献:DCO 1.1 + DCT v1(`dsh-ct/1`,许可而非版权转让);见 `CONTRIBUTING.md`
118
+ - 标志:`governance/mark-policy.md`(自动授予、可撤销、必须带免责声明)
119
+ - 申诉:`governance/appeals.md`;AI 只受理/计时/复核,人类终裁
120
+ - 三用途采用包:`adoption/{official,market,developer}/`(按 `45` 落地)
121
+
122
+ ## 边界
123
+
124
+ - 不收费、不卖等级、不卖排名;
125
+ - 不做认证/安全审计;
126
+ - 不把 static 写成 runtime;
127
+ - 不把 10/18 base-only 写成 18/18 web/生产;不把 `client-module-loaded` 写成 UI/认证;
128
+ - 不声称官方推荐/采纳;
129
+ - 不声称认证/认可/安全审计;A–D 是质量等级,不是 ENTRY/FLOW/BOOST。
130
+
131
+ ## 许可
132
+
133
+ - 文本/规范/文档/翻译:**CC BY 4.0**(`LICENSE-CC-BY`);**修改必须按 `MODIFICATION-POLICY.md` 给出 Change Notice**;
134
+ - 代码/脚本/schema:**Apache-2.0**(`LICENSE-APACHE`,含专利授权与防御终止);
135
+ - 标志/badge:单独规则,见 `governance/mark-policy.md`,不随上述许可授权;
136
+ - 贡献:DCO 1.1 + DCT v1,不要求版权转让。
137
+
138
+ ## 目录
139
+
140
+ ```text
141
+ 00-99*.md 规范/研究/画像/沟通包
142
+ 40-checker/ 检查器、J1 旅程、bundle smoke、样本框、结果
143
+ governance/ 角色/贡献条款/标志/申诉/COI/决策日志 + 机器检查
144
+ adoption/ official / market / developer 三套采用包
145
+ spec/ levels.json + clauses.json + schemas(evidence / report / attestation)
146
+ examples/boost/ LEV-7 参考实现与基准
147
+ publish/ labels 示例 + 评价记录 JSON
9
148
  ```
149
+
150
+ ## 先行项目
151
+
152
+ `dsh-plugin-standard`(lanbaolu)是同生态的先行项目;本项目与其无隶属关系,引用/对比时将标注来源。许可见 `LICENSE`(文本 CC BY 4.0 / 代码 Apache-2.0);修改必须说明。
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ // Public umbrella entry point for the three-layer audit.
3
+ // The implementation lives in 40-checker/.
4
+ import '../40-checker/bin/dsh-levels.mjs'
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ // Public umbrella entry point for the DSH standards checker.
3
+ // The implementation lives in 40-checker/; this shim keeps the package-level
4
+ // command stable while the checker remains independently runnable from source.
5
+ import { readFileSync } from 'node:fs'
6
+ import { fileURLToPath } from 'node:url'
7
+ import { dirname, join } from 'node:path'
8
+
9
+ const here = dirname(fileURLToPath(import.meta.url))
10
+ const pkg = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8'))
11
+ const argv = process.argv.slice(2)
12
+
13
+ if (argv.includes('--version') || argv.includes('-v')) {
14
+ console.log(`dsh-standards ${pkg.version} (checker 0.1.0)`)
15
+ process.exit(0)
16
+ }
17
+
18
+ process.env.DSH_CHECKER_BRAND = `dsh-standards ${pkg.version} (checker 0.1.0)`
19
+ await import('../40-checker/bin/dsh-plugin-verify.mjs')
@@ -0,0 +1,38 @@
1
+ # BOOST fixture plan (2026-11-02)
2
+
3
+ > 非官方 · 非排名 · 环境限定. B1–B7 are fixture-level; B8 is optional and environment-scoped.
4
+
5
+ ## B1/B6 — lifecycle + uninstall
6
+
7
+ - Use `omdsh-dev/plugin-template/tests/harness.ts` shape: real `Context`, `ctx.plugin`, `fiber.dispose`.
8
+ - Fixture: timer/socket/watcher/listener registered through `ctx.effect`/`ctx.on`.
9
+ - Observe: `fiber.getEffects()` returns to baseline after dispose; `process.getActiveResourcesInfo()` has no new handles; dispose 10 times.
10
+ - Negative control: module-level timer / no disposer; must be detected.
11
+
12
+ ## B2 — inject / optional service
13
+
14
+ - Fixture: provider service + consumer with required `inject` and optional `ctx.get`.
15
+ - Required: consumer stays PENDING when provider absent; becomes active when provider mounts; replacement reloads.
16
+ - Optional: `ctx.get` returns `undefined` when absent; no crash.
17
+ - Negative control: required service fetched via `ctx.get` (should not be treated as satisfied).
18
+ - The pilot fixture syntax was not accepted by Cordis 4.0.5; do not fake a pass. Use the template harness shape or mark `blocked`.
19
+
20
+ ## B4 — events
21
+
22
+ - Fixture: waterfall observer must call `next()`; downstream receives the value.
23
+ - Serial/bail: order is deterministic; a bail stops later handlers.
24
+ - Negative control: observer does not call `next()`; downstream must not run.
25
+ - If the event API shape is not confirmed, mark `not-run`; do not invent an API.
26
+
27
+ ## B7 — patch lines
28
+
29
+ - Temporary profile `--dump-config`: each patch line is visible; disable is visible; no hidden/manual extra patch.
30
+
31
+ ## B8 — performance (optional)
32
+
33
+ - Fixed host/Cordis/Node/OS/profile; warmup 3; 20 cold starts; record boot-to-URL, RSS/heap, bundle bytes, dispose residue.
34
+ - Report raw p50/p95 + environment; no cross-plugin ranking; resolution limit must be stated (pilot polling was 250 ms).
35
+
36
+ ## Output
37
+
38
+ `boost-fixtures.jsonl` per fixture + `BOOST-REPORT.md`; failed fixture is a real finding, not a reason to change the plugin.