@t275005746/gse 0.1.0 → 0.1.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.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +42 -42
- package/.github/ISSUE_TEMPLATE/change_request.yml +50 -50
- package/.github/ISSUE_TEMPLATE/config.yml +5 -5
- package/.github/PULL_REQUEST_TEMPLATE.md +38 -38
- package/.github/workflows/validate-gse.yml +33 -33
- package/.gse/README.md +18 -18
- package/.gse/gse-development-protocol.md +50 -50
- package/.gse/project-profile.md +29 -29
- package/.gse/quality-gates.md +25 -25
- package/.gse/releases/public-registry-publication-npm.md +49 -0
- package/.gse/releases/public-release-owner-required.md +65 -65
- package/.gse/releases/public-security-contact-owner-required.md +45 -45
- package/.gse/state.json +3 -4
- package/CHANGELOG.md +24 -24
- package/CONTRIBUTING.md +64 -64
- package/LICENSE +21 -21
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/SECURITY.md +41 -41
- package/SUPPORT.md +38 -38
- package/assets/marketplace/README.md +7 -7
- package/assets/marketplace/gse-listing.json +75 -75
- package/assets/templates/acceptance-execution-packet.md +73 -73
- package/assets/templates/adr.md +14 -14
- package/assets/templates/change-brief.md +16 -16
- package/assets/templates/design.md +18 -18
- package/assets/templates/dispatch-packet.md +104 -104
- package/assets/templates/evidence.md +14 -14
- package/assets/templates/execution-quality-pack.md +65 -65
- package/assets/templates/goal-map.md +21 -21
- package/assets/templates/host-adapter.md +48 -48
- package/assets/templates/host-ui-invocation-record.md +42 -42
- package/assets/templates/incident-review.md +60 -60
- package/assets/templates/public-channel-publication-record.md +49 -49
- package/assets/templates/public-ci-run-record.md +53 -53
- package/assets/templates/public-release-record.md +65 -65
- package/assets/templates/public-repository-settings-record.md +59 -59
- package/assets/templates/public-security-contact-record.md +45 -45
- package/assets/templates/release-trust-record.md +32 -32
- package/assets/templates/review.md +18 -18
- package/assets/templates/spec.md +16 -16
- package/assets/templates/target-adoption-evidence.md +29 -29
- package/assets/templates/tasks.md +17 -17
- package/assets/templates/update-release-acceptance-record.md +58 -58
- package/examples/README.md +22 -22
- package/examples/agent-runtime-host/.claude/gse-adapter.md +6 -6
- package/examples/agent-runtime-host/.codex/gse-adapter.md +7 -7
- package/examples/agent-runtime-host/.gse/goal-map.md +7 -7
- package/examples/agent-runtime-host/.gse/project-profile.md +27 -27
- package/examples/agent-runtime-host/.gse/tooling.md +5 -5
- package/examples/agent-runtime-host/.mcp.json +9 -9
- package/examples/agent-runtime-host/AGENTS.md +5 -5
- package/examples/agent-runtime-host/README.md +10 -10
- package/examples/agent-runtime-host/docs/model-routing.md +5 -5
- package/examples/cli-tool/.gse/project-profile.md +21 -21
- package/examples/cli-tool/AGENTS.md +5 -5
- package/examples/cli-tool/README.md +12 -12
- package/examples/cli-tool/package.json +21 -21
- package/examples/small-app/.env.example +2 -2
- package/examples/small-app/.github/workflows/ci.yml +8 -8
- package/examples/small-app/AGENTS.md +5 -5
- package/examples/small-app/README.md +12 -12
- package/examples/small-app/package.json +26 -26
- package/examples/small-app/playwright.config.ts +4 -4
- package/package.json +53 -53
- package/references/adoption-recipes.md +171 -171
- package/references/agent-roles.md +49 -49
- package/references/architecture-health.md +101 -101
- package/references/benchmark-audit.md +73 -73
- package/references/community-channels.md +46 -46
- package/references/compatibility.md +70 -70
- package/references/design-basis.md +38 -38
- package/references/domain-model.md +129 -129
- package/references/domain-quality-gates.md +75 -75
- package/references/drift-audit.md +81 -81
- package/references/evidence-taxonomy.md +123 -123
- package/references/file-ownership.md +107 -107
- package/references/final-readiness.md +84 -84
- package/references/forward-test.md +133 -133
- package/references/goal-map.md +36 -36
- package/references/host-adapters.md +119 -119
- package/references/learning-system.md +35 -35
- package/references/marketplace-discovery.md +46 -46
- package/references/model-routing.md +103 -103
- package/references/open-source-defaults.md +39 -39
- package/references/operating-model.md +52 -52
- package/references/packaging.md +277 -277
- package/references/project-agent-workspace.md +89 -89
- package/references/project-bootstrap.md +122 -122
- package/references/project-profile.md +57 -57
- package/references/public-release.md +174 -174
- package/references/quality-gates.md +100 -100
- package/references/recovery.md +176 -176
- package/references/release-trust.md +43 -43
- package/references/release.md +126 -126
- package/references/review.md +141 -141
- package/references/router.md +90 -90
- package/references/spec-workflow.md +66 -66
- package/references/task-levels.md +81 -81
- package/references/tool-adapters.md +73 -73
- package/scripts/audit-acceptance-execution-packet.mjs +133 -133
- package/scripts/audit-adoption-recipes.mjs +99 -99
- package/scripts/audit-change-lifecycle.mjs +77 -77
- package/scripts/audit-change-system.mjs +134 -134
- package/scripts/audit-ci-readiness.mjs +107 -107
- package/scripts/audit-close-gate.mjs +323 -323
- package/scripts/audit-command-adapters.mjs +91 -91
- package/scripts/audit-command-execution.mjs +210 -210
- package/scripts/audit-compatibility.mjs +149 -149
- package/scripts/audit-completion-readiness.mjs +292 -292
- package/scripts/audit-distribution.mjs +251 -251
- package/scripts/audit-domain-quality-gates.mjs +108 -108
- package/scripts/audit-evidence-placeholders.mjs +126 -126
- package/scripts/audit-final-readiness-promotion.mjs +255 -255
- package/scripts/audit-final-readiness.mjs +226 -226
- package/scripts/audit-fixtures.mjs +154 -154
- package/scripts/audit-fresh-session-readiness.mjs +177 -177
- package/scripts/audit-host-runtime-evidence-handoff.mjs +159 -159
- package/scripts/audit-host-runtime-invocation-drill.mjs +240 -240
- package/scripts/audit-host-runtime-invocations.mjs +254 -254
- package/scripts/audit-host-ui-invocation.mjs +132 -132
- package/scripts/audit-marketplace-discovery.mjs +122 -122
- package/scripts/audit-npm-package-metadata.mjs +155 -155
- package/scripts/audit-npm-publish-dry-run.mjs +191 -169
- package/scripts/audit-npm-tarball-install.mjs +191 -191
- package/scripts/audit-open-source-defaults.mjs +92 -92
- package/scripts/audit-open-source-readiness.mjs +97 -97
- package/scripts/audit-project.mjs +138 -138
- package/scripts/audit-public-acceptance-command-dry-run-drill.mjs +203 -203
- package/scripts/audit-public-acceptance-readiness.mjs +224 -224
- package/scripts/audit-public-channel-publication.mjs +248 -248
- package/scripts/audit-public-ci-run.mjs +184 -184
- package/scripts/audit-public-collaboration-templates.mjs +98 -98
- package/scripts/audit-public-external-gate-probe.mjs +206 -206
- package/scripts/audit-public-release-decision.mjs +201 -201
- package/scripts/audit-public-release-metadata.mjs +176 -176
- package/scripts/audit-public-repository-settings.mjs +237 -237
- package/scripts/audit-public-security-contact.mjs +171 -171
- package/scripts/audit-readme-docs.mjs +6 -4
- package/scripts/audit-recovery-readiness.mjs +98 -98
- package/scripts/audit-release-readiness.mjs +106 -106
- package/scripts/audit-release-trust.mjs +62 -62
- package/scripts/audit-remote-distribution.mjs +266 -266
- package/scripts/audit-roadmap-consistency.mjs +235 -235
- package/scripts/audit-signing.mjs +147 -147
- package/scripts/audit-state-freshness.mjs +14 -9
- package/scripts/audit-target-adoption-evidence.mjs +117 -117
- package/scripts/audit-target-project.mjs +507 -507
- package/scripts/audit-update-release-acceptance.mjs +136 -136
- package/scripts/audit-v1-target-validation.mjs +269 -269
- package/scripts/audit-validation-profiles.mjs +125 -125
- package/scripts/close-change.mjs +116 -116
- package/scripts/discover-project-profile.mjs +307 -307
- package/scripts/generate-command-adapter.mjs +231 -231
- package/scripts/generate-final-acceptance-packet.mjs +181 -181
- package/scripts/generate-final-form-progress-report.mjs +205 -205
- package/scripts/generate-host-runtime-evidence-handoff.mjs +206 -206
- package/scripts/generate-owner-external-gate-kit.mjs +295 -295
- package/scripts/generate-public-acceptance-handoff.mjs +168 -168
- package/scripts/generate-public-release-checklist.mjs +207 -207
- package/scripts/generate-release-bundle.mjs +505 -505
- package/scripts/generate-release-owner-action-plan.mjs +172 -172
- package/scripts/generate-release-status-manifest.mjs +200 -200
- package/scripts/generate-session-prompt.mjs +188 -188
- package/scripts/gse.mjs +67 -67
- package/scripts/init-change.mjs +265 -265
- package/scripts/init-project.mjs +785 -785
- package/scripts/install-gse.mjs +234 -234
- package/scripts/lib/evidence-placeholders.mjs +28 -28
- package/scripts/package-gse.mjs +174 -174
- package/scripts/probe-public-external-gates.mjs +167 -167
- package/scripts/record-host-invocation.mjs +151 -151
- package/scripts/record-public-channel-publication.mjs +178 -178
- package/scripts/record-public-ci-run.mjs +180 -180
- package/scripts/record-public-release.mjs +175 -175
- package/scripts/record-public-repository-settings.mjs +209 -209
- package/scripts/record-public-security-contact.mjs +157 -157
- package/scripts/sign-gse-package.mjs +83 -83
- package/scripts/update-project-state.mjs +223 -223
- package/scripts/verify-gse-package.mjs +85 -85
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs'
|
|
3
|
-
import os from 'node:os'
|
|
4
|
-
import path from 'node:path'
|
|
5
|
-
import { spawnSync } from 'node:child_process'
|
|
6
|
-
|
|
7
|
-
const args = process.argv.slice(2)
|
|
8
|
-
|
|
9
|
-
function readArg(name, fallback = null) {
|
|
10
|
-
const index = args.indexOf(name)
|
|
11
|
-
if (index === -1) return fallback
|
|
12
|
-
return args[index + 1] ?? fallback
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const root = path.resolve(readArg('--root', path.join(import.meta.dirname, '..')))
|
|
16
|
-
const jsonOnly = args.includes('--json')
|
|
17
|
-
|
|
18
|
-
function run(command, commandArgs, cwd = root) {
|
|
19
|
-
const result = spawnSync(command, commandArgs, { cwd, encoding: 'utf8', windowsHide: true })
|
|
20
|
-
return {
|
|
21
|
-
command: [command, ...commandArgs].join(' '),
|
|
22
|
-
status: result.status ?? 1,
|
|
23
|
-
stdout: (result.stdout ?? '').trim(),
|
|
24
|
-
stderr: (result.stderr ?? '').trim(),
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function parseJson(text) {
|
|
29
|
-
try { return JSON.parse(text) } catch { return null }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function check(id, label, ok, evidence, risk = '') {
|
|
33
|
-
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-signing-'))
|
|
37
|
-
const packageOut = path.join(tempRoot, 'package')
|
|
38
|
-
const installTarget = path.join(tempRoot, 'installed-gse')
|
|
39
|
-
const tamperedPackage = path.join(tempRoot, 'tampered-package')
|
|
40
|
-
const tamperedTarget = path.join(tempRoot, 'tampered-installed')
|
|
41
|
-
const privateKey = path.join(tempRoot, 'gse-private.pem')
|
|
42
|
-
const publicKey = path.join(tempRoot, 'gse-public.pem')
|
|
43
|
-
|
|
44
|
-
const packageRun = run(process.execPath, [
|
|
45
|
-
path.join(root, 'scripts', 'package-gse.mjs'),
|
|
46
|
-
'--root',
|
|
47
|
-
root,
|
|
48
|
-
'--out',
|
|
49
|
-
packageOut,
|
|
50
|
-
'--label',
|
|
51
|
-
'gse-signing-audit',
|
|
52
|
-
'--json',
|
|
53
|
-
])
|
|
54
|
-
const signRun = run(process.execPath, [
|
|
55
|
-
path.join(root, 'scripts', 'sign-gse-package.mjs'),
|
|
56
|
-
'--package',
|
|
57
|
-
packageOut,
|
|
58
|
-
'--private-key',
|
|
59
|
-
privateKey,
|
|
60
|
-
'--public-key',
|
|
61
|
-
publicKey,
|
|
62
|
-
'--generate-key',
|
|
63
|
-
'--json',
|
|
64
|
-
])
|
|
65
|
-
const verifyRun = run(process.execPath, [
|
|
66
|
-
path.join(root, 'scripts', 'verify-gse-package.mjs'),
|
|
67
|
-
'--package',
|
|
68
|
-
packageOut,
|
|
69
|
-
'--public-key',
|
|
70
|
-
publicKey,
|
|
71
|
-
'--json',
|
|
72
|
-
])
|
|
73
|
-
const installRun = run(process.execPath, [
|
|
74
|
-
path.join(root, 'scripts', 'install-gse.mjs'),
|
|
75
|
-
'--source',
|
|
76
|
-
packageOut,
|
|
77
|
-
'--target',
|
|
78
|
-
installTarget,
|
|
79
|
-
'--public-key',
|
|
80
|
-
publicKey,
|
|
81
|
-
'--json',
|
|
82
|
-
])
|
|
83
|
-
|
|
84
|
-
fs.cpSync(packageOut, tamperedPackage, { recursive: true })
|
|
85
|
-
fs.appendFileSync(path.join(tamperedPackage, 'SKILL.md'), '\nTampered for signature audit.\n', 'utf8')
|
|
86
|
-
const tamperedVerify = run(process.execPath, [
|
|
87
|
-
path.join(root, 'scripts', 'verify-gse-package.mjs'),
|
|
88
|
-
'--package',
|
|
89
|
-
tamperedPackage,
|
|
90
|
-
'--public-key',
|
|
91
|
-
publicKey,
|
|
92
|
-
'--json',
|
|
93
|
-
])
|
|
94
|
-
const tamperedInstall = run(process.execPath, [
|
|
95
|
-
path.join(root, 'scripts', 'install-gse.mjs'),
|
|
96
|
-
'--source',
|
|
97
|
-
tamperedPackage,
|
|
98
|
-
'--target',
|
|
99
|
-
tamperedTarget,
|
|
100
|
-
'--public-key',
|
|
101
|
-
publicKey,
|
|
102
|
-
'--json',
|
|
103
|
-
])
|
|
104
|
-
|
|
105
|
-
const signData = parseJson(signRun.stdout)
|
|
106
|
-
const verifyData = parseJson(verifyRun.stdout)
|
|
107
|
-
const installData = parseJson(installRun.stdout)
|
|
108
|
-
const tamperedVerifyData = parseJson(tamperedVerify.stdout)
|
|
109
|
-
const tamperedInstallData = parseJson(tamperedInstall.stdout)
|
|
110
|
-
|
|
111
|
-
const checks = [
|
|
112
|
-
check('SIGN01', 'package command succeeds', packageRun.status === 0, packageRun.command),
|
|
113
|
-
check('SIGN02', 'sign command creates signature and keys', signRun.status === 0 && fs.existsSync(path.join(packageOut, 'gse-package-signature.json')) && fs.existsSync(publicKey), signRun.command),
|
|
114
|
-
check('SIGN03', 'verify command accepts signed package', verifyRun.status === 0 && verifyData?.summary?.failed === 0, verifyRun.command),
|
|
115
|
-
check('SIGN04', 'install command accepts signed package with public key', installRun.status === 0 && installData?.signature?.status === 'verified', installRun.command),
|
|
116
|
-
check('SIGN05', 'tampered package fails signature/hash verification', tamperedVerify.status === 1 && tamperedVerifyData?.summary?.failed > 0, tamperedVerify.command),
|
|
117
|
-
check('SIGN06', 'install command rejects tampered signed package', tamperedInstall.status === 1 && (tamperedInstallData?.signature?.status === 'failed' || tamperedInstallData?.summary?.integrityFailed > 0), tamperedInstall.command),
|
|
118
|
-
check('SIGN07', 'signature uses Ed25519', signData?.algorithm === 'ed25519', 'sign-gse-package output'),
|
|
119
|
-
]
|
|
120
|
-
|
|
121
|
-
const passed = checks.filter((item) => item.status === 'passed').length
|
|
122
|
-
const failed = checks.length - passed
|
|
123
|
-
const report = {
|
|
124
|
-
root,
|
|
125
|
-
generatedAt: new Date().toISOString(),
|
|
126
|
-
tempRoot,
|
|
127
|
-
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
128
|
-
workflows: {
|
|
129
|
-
packageSigning: signRun.status === 0 ? 'verified' : 'failed',
|
|
130
|
-
signatureVerification: verifyRun.status === 0 ? 'verified' : 'failed',
|
|
131
|
-
signedInstall: installRun.status === 0 ? 'verified' : 'failed',
|
|
132
|
-
tamperRejection: tamperedVerify.status === 1 && tamperedInstall.status === 1 ? 'verified' : 'failed',
|
|
133
|
-
},
|
|
134
|
-
commands: [packageRun.command, signRun.command, verifyRun.command, installRun.command, tamperedVerify.command, tamperedInstall.command],
|
|
135
|
-
limits: [
|
|
136
|
-
'This audit verifies local Ed25519 signing and verification mechanics.',
|
|
137
|
-
'It does not prove public key custody, maintainer identity, transparency logs, or marketplace trust.',
|
|
138
|
-
],
|
|
139
|
-
checks,
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
fs.rmSync(tempRoot, { recursive: true, force: true })
|
|
143
|
-
|
|
144
|
-
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
145
|
-
else console.log(JSON.stringify(report, null, 2))
|
|
146
|
-
|
|
147
|
-
if (failed > 0) process.exit(1)
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import os from 'node:os'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { spawnSync } from 'node:child_process'
|
|
6
|
+
|
|
7
|
+
const args = process.argv.slice(2)
|
|
8
|
+
|
|
9
|
+
function readArg(name, fallback = null) {
|
|
10
|
+
const index = args.indexOf(name)
|
|
11
|
+
if (index === -1) return fallback
|
|
12
|
+
return args[index + 1] ?? fallback
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const root = path.resolve(readArg('--root', path.join(import.meta.dirname, '..')))
|
|
16
|
+
const jsonOnly = args.includes('--json')
|
|
17
|
+
|
|
18
|
+
function run(command, commandArgs, cwd = root) {
|
|
19
|
+
const result = spawnSync(command, commandArgs, { cwd, encoding: 'utf8', windowsHide: true })
|
|
20
|
+
return {
|
|
21
|
+
command: [command, ...commandArgs].join(' '),
|
|
22
|
+
status: result.status ?? 1,
|
|
23
|
+
stdout: (result.stdout ?? '').trim(),
|
|
24
|
+
stderr: (result.stderr ?? '').trim(),
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function parseJson(text) {
|
|
29
|
+
try { return JSON.parse(text) } catch { return null }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function check(id, label, ok, evidence, risk = '') {
|
|
33
|
+
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-signing-'))
|
|
37
|
+
const packageOut = path.join(tempRoot, 'package')
|
|
38
|
+
const installTarget = path.join(tempRoot, 'installed-gse')
|
|
39
|
+
const tamperedPackage = path.join(tempRoot, 'tampered-package')
|
|
40
|
+
const tamperedTarget = path.join(tempRoot, 'tampered-installed')
|
|
41
|
+
const privateKey = path.join(tempRoot, 'gse-private.pem')
|
|
42
|
+
const publicKey = path.join(tempRoot, 'gse-public.pem')
|
|
43
|
+
|
|
44
|
+
const packageRun = run(process.execPath, [
|
|
45
|
+
path.join(root, 'scripts', 'package-gse.mjs'),
|
|
46
|
+
'--root',
|
|
47
|
+
root,
|
|
48
|
+
'--out',
|
|
49
|
+
packageOut,
|
|
50
|
+
'--label',
|
|
51
|
+
'gse-signing-audit',
|
|
52
|
+
'--json',
|
|
53
|
+
])
|
|
54
|
+
const signRun = run(process.execPath, [
|
|
55
|
+
path.join(root, 'scripts', 'sign-gse-package.mjs'),
|
|
56
|
+
'--package',
|
|
57
|
+
packageOut,
|
|
58
|
+
'--private-key',
|
|
59
|
+
privateKey,
|
|
60
|
+
'--public-key',
|
|
61
|
+
publicKey,
|
|
62
|
+
'--generate-key',
|
|
63
|
+
'--json',
|
|
64
|
+
])
|
|
65
|
+
const verifyRun = run(process.execPath, [
|
|
66
|
+
path.join(root, 'scripts', 'verify-gse-package.mjs'),
|
|
67
|
+
'--package',
|
|
68
|
+
packageOut,
|
|
69
|
+
'--public-key',
|
|
70
|
+
publicKey,
|
|
71
|
+
'--json',
|
|
72
|
+
])
|
|
73
|
+
const installRun = run(process.execPath, [
|
|
74
|
+
path.join(root, 'scripts', 'install-gse.mjs'),
|
|
75
|
+
'--source',
|
|
76
|
+
packageOut,
|
|
77
|
+
'--target',
|
|
78
|
+
installTarget,
|
|
79
|
+
'--public-key',
|
|
80
|
+
publicKey,
|
|
81
|
+
'--json',
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
fs.cpSync(packageOut, tamperedPackage, { recursive: true })
|
|
85
|
+
fs.appendFileSync(path.join(tamperedPackage, 'SKILL.md'), '\nTampered for signature audit.\n', 'utf8')
|
|
86
|
+
const tamperedVerify = run(process.execPath, [
|
|
87
|
+
path.join(root, 'scripts', 'verify-gse-package.mjs'),
|
|
88
|
+
'--package',
|
|
89
|
+
tamperedPackage,
|
|
90
|
+
'--public-key',
|
|
91
|
+
publicKey,
|
|
92
|
+
'--json',
|
|
93
|
+
])
|
|
94
|
+
const tamperedInstall = run(process.execPath, [
|
|
95
|
+
path.join(root, 'scripts', 'install-gse.mjs'),
|
|
96
|
+
'--source',
|
|
97
|
+
tamperedPackage,
|
|
98
|
+
'--target',
|
|
99
|
+
tamperedTarget,
|
|
100
|
+
'--public-key',
|
|
101
|
+
publicKey,
|
|
102
|
+
'--json',
|
|
103
|
+
])
|
|
104
|
+
|
|
105
|
+
const signData = parseJson(signRun.stdout)
|
|
106
|
+
const verifyData = parseJson(verifyRun.stdout)
|
|
107
|
+
const installData = parseJson(installRun.stdout)
|
|
108
|
+
const tamperedVerifyData = parseJson(tamperedVerify.stdout)
|
|
109
|
+
const tamperedInstallData = parseJson(tamperedInstall.stdout)
|
|
110
|
+
|
|
111
|
+
const checks = [
|
|
112
|
+
check('SIGN01', 'package command succeeds', packageRun.status === 0, packageRun.command),
|
|
113
|
+
check('SIGN02', 'sign command creates signature and keys', signRun.status === 0 && fs.existsSync(path.join(packageOut, 'gse-package-signature.json')) && fs.existsSync(publicKey), signRun.command),
|
|
114
|
+
check('SIGN03', 'verify command accepts signed package', verifyRun.status === 0 && verifyData?.summary?.failed === 0, verifyRun.command),
|
|
115
|
+
check('SIGN04', 'install command accepts signed package with public key', installRun.status === 0 && installData?.signature?.status === 'verified', installRun.command),
|
|
116
|
+
check('SIGN05', 'tampered package fails signature/hash verification', tamperedVerify.status === 1 && tamperedVerifyData?.summary?.failed > 0, tamperedVerify.command),
|
|
117
|
+
check('SIGN06', 'install command rejects tampered signed package', tamperedInstall.status === 1 && (tamperedInstallData?.signature?.status === 'failed' || tamperedInstallData?.summary?.integrityFailed > 0), tamperedInstall.command),
|
|
118
|
+
check('SIGN07', 'signature uses Ed25519', signData?.algorithm === 'ed25519', 'sign-gse-package output'),
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
122
|
+
const failed = checks.length - passed
|
|
123
|
+
const report = {
|
|
124
|
+
root,
|
|
125
|
+
generatedAt: new Date().toISOString(),
|
|
126
|
+
tempRoot,
|
|
127
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
128
|
+
workflows: {
|
|
129
|
+
packageSigning: signRun.status === 0 ? 'verified' : 'failed',
|
|
130
|
+
signatureVerification: verifyRun.status === 0 ? 'verified' : 'failed',
|
|
131
|
+
signedInstall: installRun.status === 0 ? 'verified' : 'failed',
|
|
132
|
+
tamperRejection: tamperedVerify.status === 1 && tamperedInstall.status === 1 ? 'verified' : 'failed',
|
|
133
|
+
},
|
|
134
|
+
commands: [packageRun.command, signRun.command, verifyRun.command, installRun.command, tamperedVerify.command, tamperedInstall.command],
|
|
135
|
+
limits: [
|
|
136
|
+
'This audit verifies local Ed25519 signing and verification mechanics.',
|
|
137
|
+
'It does not prove public key custody, maintainer identity, transparency logs, or marketplace trust.',
|
|
138
|
+
],
|
|
139
|
+
checks,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
fs.rmSync(tempRoot, { recursive: true, force: true })
|
|
143
|
+
|
|
144
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
145
|
+
else console.log(JSON.stringify(report, null, 2))
|
|
146
|
+
|
|
147
|
+
if (failed > 0) process.exit(1)
|
|
@@ -73,20 +73,25 @@ const mentionsAllPending = pendingAreas.every((area) => stateSearch.includes(are
|
|
|
73
73
|
) || (
|
|
74
74
|
area === 'Native slash command' && stateSearch.includes('Native slash-command')
|
|
75
75
|
))
|
|
76
|
+
const registryPending = pendingAreas.includes('Public registry publication')
|
|
77
|
+
const registryStateMatches = registryPending
|
|
78
|
+
? state?.currentSlice?.status === 'blocked-external-auth' &&
|
|
79
|
+
(stateSearch.includes('npm is not logged in') || stateSearch.includes('not yet published on npm'))
|
|
80
|
+
: !stateSearch.includes('not yet published on npm') &&
|
|
81
|
+
!stateSearch.includes('npm is not logged in') &&
|
|
82
|
+
!stateSearch.includes('Publish @t275005746/gse to npm with an authorized token')
|
|
76
83
|
|
|
77
84
|
const checks = [
|
|
78
85
|
check('STF01', 'state JSON exists and parses', Boolean(state), '.gse/state.json'),
|
|
79
86
|
check('STF02', 'public acceptance doctor runs before state freshness check', doctorRun.status === 0 && doctor?.summary?.status === 'passed', doctorRun.command),
|
|
80
|
-
check('STF03', 'state next action mentions every current pending final-form gate', mentionsAllPending
|
|
87
|
+
check('STF03', 'state next action mentions every current pending final-form gate', mentionsAllPending, pendingAreas.join(', ')),
|
|
81
88
|
check('STF04', 'state no longer routes users to resolved public CI/security/repository/marketplace gates', staleMatches.length === 0, staleMatches.length ? staleMatches.join('; ') : '.gse/state.json'),
|
|
82
|
-
check(
|
|
83
|
-
'STF05',
|
|
84
|
-
'state
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'.gse/state.json',
|
|
89
|
-
),
|
|
89
|
+
check(
|
|
90
|
+
'STF05',
|
|
91
|
+
'state matches current registry publication gate status',
|
|
92
|
+
registryStateMatches,
|
|
93
|
+
'.gse/state.json',
|
|
94
|
+
),
|
|
90
95
|
check('STF06', 'state points users to current doctor as source of truth', stateSearch.includes('/gse doctor') || stateSearch.includes('audit-public-acceptance-readiness.mjs'), '.gse/state.json'),
|
|
91
96
|
]
|
|
92
97
|
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs'
|
|
3
|
-
import path from 'node:path'
|
|
4
|
-
|
|
5
|
-
const args = process.argv.slice(2)
|
|
6
|
-
|
|
7
|
-
function readArg(name, fallback = null) {
|
|
8
|
-
const index = args.indexOf(name)
|
|
9
|
-
if (index === -1) return fallback
|
|
10
|
-
return args[index + 1] ?? fallback
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const root = path.resolve(readArg('--root', path.join(import.meta.dirname, '..')))
|
|
14
|
-
const jsonOnly = args.includes('--json')
|
|
15
|
-
|
|
16
|
-
function read(relativePath) {
|
|
17
|
-
const fullPath = path.join(root, relativePath)
|
|
18
|
-
return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8') : ''
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function exists(relativePath) {
|
|
22
|
-
return fs.existsSync(path.join(root, relativePath))
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function check(id, label, ok, evidence, risk = '') {
|
|
26
|
-
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const template = read('assets/templates/target-adoption-evidence.md')
|
|
30
|
-
const recipes = read('references/adoption-recipes.md')
|
|
31
|
-
const discovery = read('scripts/discover-project-profile.mjs')
|
|
32
|
-
const validate = read('scripts/validate-gse.mjs')
|
|
33
|
-
|
|
34
|
-
const fields = [
|
|
35
|
-
'Target project:',
|
|
36
|
-
'Adoption path:',
|
|
37
|
-
'Project rules read:',
|
|
38
|
-
'Files inspected:',
|
|
39
|
-
'Files changed:',
|
|
40
|
-
'Commands run:',
|
|
41
|
-
'Detected project type:',
|
|
42
|
-
'Detected package manager:',
|
|
43
|
-
'Detected scripts:',
|
|
44
|
-
'Host/tool statuses:',
|
|
45
|
-
'Evidence status:',
|
|
46
|
-
'Accepted by:',
|
|
47
|
-
'Residual risks:',
|
|
48
|
-
'Next action:',
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
const noOverclaim = [
|
|
52
|
-
'documented` until executed',
|
|
53
|
-
'unknown` unless the tool was actually checked',
|
|
54
|
-
'Do not claim arbitrary real-repo certification',
|
|
55
|
-
'host runtime support',
|
|
56
|
-
'subagent support',
|
|
57
|
-
'browser support',
|
|
58
|
-
'MCP support',
|
|
59
|
-
'CI support',
|
|
60
|
-
'release publication',
|
|
61
|
-
'owner acceptance',
|
|
62
|
-
'Accepted by: not accepted',
|
|
63
|
-
]
|
|
64
|
-
|
|
65
|
-
const checks = [
|
|
66
|
-
check('TAE01', 'target adoption evidence template exists', exists('assets/templates/target-adoption-evidence.md'), 'assets/templates/target-adoption-evidence.md'),
|
|
67
|
-
check('TAE02', 'template captures target-project evidence fields', fields.every((item) => template.includes(item)), fields.join(', ')),
|
|
68
|
-
check('TAE03', 'template prevents real-repo and host capability overclaims', noOverclaim.every((item) => template.includes(item)), 'anti-overclaim rules'),
|
|
69
|
-
check('TAE04', 'adoption recipes route real target evidence to template', recipes.includes('assets/templates/target-adoption-evidence.md') && recipes.includes('Accepted by: not accepted'), 'references/adoption-recipes.md'),
|
|
70
|
-
check('TAE05', 'discovery captures namespaced project scripts', discovery.includes('/^(smoke|evidence|replay|eval|release|deploy|publish|electron):/') && discovery.includes('package.json smoke script'), 'scripts/discover-project-profile.mjs'),
|
|
71
|
-
check('TAE06', 'consolidated validator includes this audit', validate.includes('audit-target-adoption-evidence.mjs'), 'scripts/validate-gse.mjs'),
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
const passed = checks.filter((item) => item.status === 'passed').length
|
|
75
|
-
const failed = checks.length - passed
|
|
76
|
-
const report = {
|
|
77
|
-
root,
|
|
78
|
-
generatedAt: new Date().toISOString(),
|
|
79
|
-
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
80
|
-
workflows: { targetAdoptionEvidence: failed === 0 ? 'verified' : 'failed' },
|
|
81
|
-
limits: [
|
|
82
|
-
'This audit verifies the target-project evidence template and discovery support only.',
|
|
83
|
-
'It does not certify any arbitrary repository or accept a host/runtime capability.',
|
|
84
|
-
],
|
|
85
|
-
checks,
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function renderMarkdown(data) {
|
|
89
|
-
const lines = []
|
|
90
|
-
lines.push('# GSE Target Adoption Evidence Audit')
|
|
91
|
-
lines.push('')
|
|
92
|
-
lines.push('Generated: ' + data.generatedAt)
|
|
93
|
-
lines.push('Root: ' + data.root)
|
|
94
|
-
lines.push('')
|
|
95
|
-
lines.push('## Summary')
|
|
96
|
-
lines.push('')
|
|
97
|
-
lines.push('- Status: ' + data.summary.status)
|
|
98
|
-
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
99
|
-
lines.push('- Target adoption evidence: ' + data.workflows.targetAdoptionEvidence)
|
|
100
|
-
lines.push('')
|
|
101
|
-
lines.push('## Checks')
|
|
102
|
-
lines.push('')
|
|
103
|
-
for (const item of data.checks) {
|
|
104
|
-
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
105
|
-
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
106
|
-
}
|
|
107
|
-
lines.push('')
|
|
108
|
-
lines.push('## Limits')
|
|
109
|
-
lines.push('')
|
|
110
|
-
for (const item of data.limits) lines.push('- ' + item)
|
|
111
|
-
return lines.join('\n') + '\n'
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
115
|
-
else console.log(renderMarkdown(report))
|
|
116
|
-
|
|
117
|
-
if (failed > 0) process.exit(1)
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2)
|
|
6
|
+
|
|
7
|
+
function readArg(name, fallback = null) {
|
|
8
|
+
const index = args.indexOf(name)
|
|
9
|
+
if (index === -1) return fallback
|
|
10
|
+
return args[index + 1] ?? fallback
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const root = path.resolve(readArg('--root', path.join(import.meta.dirname, '..')))
|
|
14
|
+
const jsonOnly = args.includes('--json')
|
|
15
|
+
|
|
16
|
+
function read(relativePath) {
|
|
17
|
+
const fullPath = path.join(root, relativePath)
|
|
18
|
+
return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8') : ''
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function exists(relativePath) {
|
|
22
|
+
return fs.existsSync(path.join(root, relativePath))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function check(id, label, ok, evidence, risk = '') {
|
|
26
|
+
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const template = read('assets/templates/target-adoption-evidence.md')
|
|
30
|
+
const recipes = read('references/adoption-recipes.md')
|
|
31
|
+
const discovery = read('scripts/discover-project-profile.mjs')
|
|
32
|
+
const validate = read('scripts/validate-gse.mjs')
|
|
33
|
+
|
|
34
|
+
const fields = [
|
|
35
|
+
'Target project:',
|
|
36
|
+
'Adoption path:',
|
|
37
|
+
'Project rules read:',
|
|
38
|
+
'Files inspected:',
|
|
39
|
+
'Files changed:',
|
|
40
|
+
'Commands run:',
|
|
41
|
+
'Detected project type:',
|
|
42
|
+
'Detected package manager:',
|
|
43
|
+
'Detected scripts:',
|
|
44
|
+
'Host/tool statuses:',
|
|
45
|
+
'Evidence status:',
|
|
46
|
+
'Accepted by:',
|
|
47
|
+
'Residual risks:',
|
|
48
|
+
'Next action:',
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
const noOverclaim = [
|
|
52
|
+
'documented` until executed',
|
|
53
|
+
'unknown` unless the tool was actually checked',
|
|
54
|
+
'Do not claim arbitrary real-repo certification',
|
|
55
|
+
'host runtime support',
|
|
56
|
+
'subagent support',
|
|
57
|
+
'browser support',
|
|
58
|
+
'MCP support',
|
|
59
|
+
'CI support',
|
|
60
|
+
'release publication',
|
|
61
|
+
'owner acceptance',
|
|
62
|
+
'Accepted by: not accepted',
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
const checks = [
|
|
66
|
+
check('TAE01', 'target adoption evidence template exists', exists('assets/templates/target-adoption-evidence.md'), 'assets/templates/target-adoption-evidence.md'),
|
|
67
|
+
check('TAE02', 'template captures target-project evidence fields', fields.every((item) => template.includes(item)), fields.join(', ')),
|
|
68
|
+
check('TAE03', 'template prevents real-repo and host capability overclaims', noOverclaim.every((item) => template.includes(item)), 'anti-overclaim rules'),
|
|
69
|
+
check('TAE04', 'adoption recipes route real target evidence to template', recipes.includes('assets/templates/target-adoption-evidence.md') && recipes.includes('Accepted by: not accepted'), 'references/adoption-recipes.md'),
|
|
70
|
+
check('TAE05', 'discovery captures namespaced project scripts', discovery.includes('/^(smoke|evidence|replay|eval|release|deploy|publish|electron):/') && discovery.includes('package.json smoke script'), 'scripts/discover-project-profile.mjs'),
|
|
71
|
+
check('TAE06', 'consolidated validator includes this audit', validate.includes('audit-target-adoption-evidence.mjs'), 'scripts/validate-gse.mjs'),
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
75
|
+
const failed = checks.length - passed
|
|
76
|
+
const report = {
|
|
77
|
+
root,
|
|
78
|
+
generatedAt: new Date().toISOString(),
|
|
79
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
80
|
+
workflows: { targetAdoptionEvidence: failed === 0 ? 'verified' : 'failed' },
|
|
81
|
+
limits: [
|
|
82
|
+
'This audit verifies the target-project evidence template and discovery support only.',
|
|
83
|
+
'It does not certify any arbitrary repository or accept a host/runtime capability.',
|
|
84
|
+
],
|
|
85
|
+
checks,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function renderMarkdown(data) {
|
|
89
|
+
const lines = []
|
|
90
|
+
lines.push('# GSE Target Adoption Evidence Audit')
|
|
91
|
+
lines.push('')
|
|
92
|
+
lines.push('Generated: ' + data.generatedAt)
|
|
93
|
+
lines.push('Root: ' + data.root)
|
|
94
|
+
lines.push('')
|
|
95
|
+
lines.push('## Summary')
|
|
96
|
+
lines.push('')
|
|
97
|
+
lines.push('- Status: ' + data.summary.status)
|
|
98
|
+
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
99
|
+
lines.push('- Target adoption evidence: ' + data.workflows.targetAdoptionEvidence)
|
|
100
|
+
lines.push('')
|
|
101
|
+
lines.push('## Checks')
|
|
102
|
+
lines.push('')
|
|
103
|
+
for (const item of data.checks) {
|
|
104
|
+
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
105
|
+
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
106
|
+
}
|
|
107
|
+
lines.push('')
|
|
108
|
+
lines.push('## Limits')
|
|
109
|
+
lines.push('')
|
|
110
|
+
for (const item of data.limits) lines.push('- ' + item)
|
|
111
|
+
return lines.join('\n') + '\n'
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
115
|
+
else console.log(renderMarkdown(report))
|
|
116
|
+
|
|
117
|
+
if (failed > 0) process.exit(1)
|