@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,201 +1,201 @@
|
|
|
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 read(relativePath) {
|
|
19
|
-
const fullPath = path.join(root, relativePath)
|
|
20
|
-
return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8') : ''
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function exists(relativePath) {
|
|
24
|
-
return fs.existsSync(path.join(root, relativePath))
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function check(id, label, ok, evidence, risk = '') {
|
|
28
|
-
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function run(command, commandArgs, cwd = root) {
|
|
32
|
-
const result = spawnSync(command, commandArgs, {
|
|
33
|
-
cwd,
|
|
34
|
-
encoding: 'utf8',
|
|
35
|
-
windowsHide: true,
|
|
36
|
-
})
|
|
37
|
-
return {
|
|
38
|
-
status: result.status ?? 1,
|
|
39
|
-
stdout: (result.stdout ?? '').trim(),
|
|
40
|
-
stderr: (result.stderr ?? '').trim(),
|
|
41
|
-
command: [command, ...commandArgs].join(' '),
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function parseJson(stdout) {
|
|
46
|
-
try {
|
|
47
|
-
return JSON.parse(stdout)
|
|
48
|
-
} catch {
|
|
49
|
-
return null
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function createReleaseFixture() {
|
|
54
|
-
const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-public-release-decision-'))
|
|
55
|
-
fs.mkdirSync(path.join(fixture, '.gse', 'releases'), { recursive: true })
|
|
56
|
-
fs.writeFileSync(path.join(fixture, 'CHANGELOG.md'), '# Changelog\n\n## Unreleased\n\n- Fixture release decision.\n', 'utf8')
|
|
57
|
-
fs.writeFileSync(path.join(fixture, 'LICENSE'), 'Fixture license text for audit only.\n', 'utf8')
|
|
58
|
-
return fixture
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const recordScript = path.join(root, 'scripts', 'record-public-release.mjs')
|
|
62
|
-
const publicRelease = read('references/public-release.md')
|
|
63
|
-
const validate = read('scripts/validate-gse.mjs')
|
|
64
|
-
const completion = read('scripts/audit-completion-readiness.mjs')
|
|
65
|
-
const roadmap = read('scripts/audit-roadmap-consistency.mjs')
|
|
66
|
-
|
|
67
|
-
let fixture = null
|
|
68
|
-
let ownerRequired = null
|
|
69
|
-
let selectedOk = null
|
|
70
|
-
let selectedMissing = null
|
|
71
|
-
let notPublicOk = null
|
|
72
|
-
let notPublicMissing = null
|
|
73
|
-
|
|
74
|
-
if (fs.existsSync(recordScript)) {
|
|
75
|
-
fixture = createReleaseFixture()
|
|
76
|
-
ownerRequired = run(process.execPath, [
|
|
77
|
-
recordScript,
|
|
78
|
-
'--root',
|
|
79
|
-
fixture,
|
|
80
|
-
'--license-status',
|
|
81
|
-
'owner-required',
|
|
82
|
-
'--dry-run',
|
|
83
|
-
'--json',
|
|
84
|
-
])
|
|
85
|
-
selectedOk = run(process.execPath, [
|
|
86
|
-
recordScript,
|
|
87
|
-
'--root',
|
|
88
|
-
fixture,
|
|
89
|
-
'--license-status',
|
|
90
|
-
'selected',
|
|
91
|
-
'--spdx',
|
|
92
|
-
'MIT',
|
|
93
|
-
'--license-file',
|
|
94
|
-
'LICENSE',
|
|
95
|
-
'--approved-by',
|
|
96
|
-
'fixture-owner',
|
|
97
|
-
'--decision-date',
|
|
98
|
-
'2026-07-06',
|
|
99
|
-
'--evidence-status',
|
|
100
|
-
'accepted',
|
|
101
|
-
'--dry-run',
|
|
102
|
-
'--json',
|
|
103
|
-
])
|
|
104
|
-
selectedMissing = run(process.execPath, [
|
|
105
|
-
recordScript,
|
|
106
|
-
'--root',
|
|
107
|
-
fixture,
|
|
108
|
-
'--license-status',
|
|
109
|
-
'selected',
|
|
110
|
-
'--dry-run',
|
|
111
|
-
'--json',
|
|
112
|
-
])
|
|
113
|
-
notPublicOk = run(process.execPath, [
|
|
114
|
-
recordScript,
|
|
115
|
-
'--root',
|
|
116
|
-
fixture,
|
|
117
|
-
'--license-status',
|
|
118
|
-
'not-public',
|
|
119
|
-
'--approved-by',
|
|
120
|
-
'fixture-owner',
|
|
121
|
-
'--decision-date',
|
|
122
|
-
'2026-07-06',
|
|
123
|
-
'--dry-run',
|
|
124
|
-
'--json',
|
|
125
|
-
])
|
|
126
|
-
notPublicMissing = run(process.execPath, [
|
|
127
|
-
recordScript,
|
|
128
|
-
'--root',
|
|
129
|
-
fixture,
|
|
130
|
-
'--license-status',
|
|
131
|
-
'not-public',
|
|
132
|
-
'--dry-run',
|
|
133
|
-
'--json',
|
|
134
|
-
])
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const ownerRequiredData = ownerRequired ? parseJson(ownerRequired.stdout) : null
|
|
138
|
-
const selectedOkData = selectedOk ? parseJson(selectedOk.stdout) : null
|
|
139
|
-
const selectedMissingData = selectedMissing ? parseJson(selectedMissing.stdout) : null
|
|
140
|
-
const notPublicOkData = notPublicOk ? parseJson(notPublicOk.stdout) : null
|
|
141
|
-
const notPublicMissingData = notPublicMissing ? parseJson(notPublicMissing.stdout) : null
|
|
142
|
-
|
|
143
|
-
const checks = [
|
|
144
|
-
check('PD01', 'public release decision command exists', exists('scripts/record-public-release.mjs'), 'scripts/record-public-release.mjs'),
|
|
145
|
-
check('PD02', 'owner-required decision path remains writable without approval fields', ownerRequired?.status === 0 && ownerRequiredData?.status === 'ready' && ownerRequiredData?.licenseStatus === 'owner-required' && ownerRequiredData?.evidenceStatus === 'result', 'record-public-release --license-status owner-required --dry-run'),
|
|
146
|
-
check('PD03', 'selected-license decision path accepts complete owner evidence', selectedOk?.status === 0 && selectedOkData?.status === 'ready' && selectedOkData?.licenseStatus === 'selected' && selectedOkData?.evidenceStatus === 'accepted', 'record-public-release --license-status selected fixture dry-run'),
|
|
147
|
-
check('PD04', 'selected-license decision path rejects missing owner evidence', selectedMissing?.status !== 0 && selectedMissingData?.status === 'failed' && selectedMissingData?.errors?.some((item) => item.includes('--spdx')) && selectedMissingData?.errors?.some((item) => item.includes('--approved-by')), 'record-public-release selected missing-fields dry-run'),
|
|
148
|
-
check('PD05', 'not-public decision path accepts explicit owner decision', notPublicOk?.status === 0 && notPublicOkData?.status === 'ready' && notPublicOkData?.licenseStatus === 'not-public', 'record-public-release --license-status not-public fixture dry-run'),
|
|
149
|
-
check('PD06', 'not-public decision path rejects missing owner decision', notPublicMissing?.status !== 0 && notPublicMissingData?.status === 'failed' && notPublicMissingData?.errors?.some((item) => item.includes('--approved-by')) && notPublicMissingData?.errors?.some((item) => item.includes('--decision-date')), 'record-public-release not-public missing-fields dry-run'),
|
|
150
|
-
check('PD07', 'public release docs describe all decision states', publicRelease.includes('owner-required | selected | not-public') && publicRelease.includes('For `--license-status selected`') && publicRelease.includes('not-public'), 'references/public-release.md'),
|
|
151
|
-
check('PD08', 'validator and completion audits include public decision lifecycle', validate.includes('audit-public-release-decision.mjs') && completion.includes('audit-public-release-decision.mjs') && roadmap.includes('audit-public-release-decision.mjs'), 'validate, completion, roadmap audits'),
|
|
152
|
-
]
|
|
153
|
-
|
|
154
|
-
const passed = checks.filter((item) => item.status === 'passed').length
|
|
155
|
-
const failed = checks.length - passed
|
|
156
|
-
const report = {
|
|
157
|
-
root,
|
|
158
|
-
generatedAt: new Date().toISOString(),
|
|
159
|
-
fixtureRoot: fixture,
|
|
160
|
-
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
161
|
-
workflows: {
|
|
162
|
-
publicReleaseDecisionLifecycle: failed === 0 ? 'verified' : 'failed',
|
|
163
|
-
},
|
|
164
|
-
limits: [
|
|
165
|
-
'This audit verifies decision-path mechanics for owner-required, selected-license, and not-public records.',
|
|
166
|
-
'The selected-license path is tested with a temporary fixture license; it does not select a license for GSE.',
|
|
167
|
-
'Accepted public release for GSE still requires an owner-approved real license file or explicit not-public decision record.',
|
|
168
|
-
],
|
|
169
|
-
checks,
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function renderMarkdown(data) {
|
|
173
|
-
const lines = []
|
|
174
|
-
lines.push('# GSE Public Release Decision Audit')
|
|
175
|
-
lines.push('')
|
|
176
|
-
lines.push('Generated: ' + data.generatedAt)
|
|
177
|
-
lines.push('Root: ' + data.root)
|
|
178
|
-
lines.push('')
|
|
179
|
-
lines.push('## Summary')
|
|
180
|
-
lines.push('')
|
|
181
|
-
lines.push('- Status: ' + data.summary.status)
|
|
182
|
-
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
183
|
-
lines.push('- Public release decision lifecycle: ' + data.workflows.publicReleaseDecisionLifecycle)
|
|
184
|
-
lines.push('')
|
|
185
|
-
lines.push('## Checks')
|
|
186
|
-
lines.push('')
|
|
187
|
-
for (const item of data.checks) {
|
|
188
|
-
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
189
|
-
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
190
|
-
}
|
|
191
|
-
lines.push('')
|
|
192
|
-
lines.push('## Limits')
|
|
193
|
-
lines.push('')
|
|
194
|
-
for (const item of data.limits) lines.push('- ' + item)
|
|
195
|
-
return lines.join('\n') + '\n'
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
199
|
-
else console.log(renderMarkdown(report))
|
|
200
|
-
|
|
201
|
-
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 read(relativePath) {
|
|
19
|
+
const fullPath = path.join(root, relativePath)
|
|
20
|
+
return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8') : ''
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function exists(relativePath) {
|
|
24
|
+
return fs.existsSync(path.join(root, relativePath))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function check(id, label, ok, evidence, risk = '') {
|
|
28
|
+
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function run(command, commandArgs, cwd = root) {
|
|
32
|
+
const result = spawnSync(command, commandArgs, {
|
|
33
|
+
cwd,
|
|
34
|
+
encoding: 'utf8',
|
|
35
|
+
windowsHide: true,
|
|
36
|
+
})
|
|
37
|
+
return {
|
|
38
|
+
status: result.status ?? 1,
|
|
39
|
+
stdout: (result.stdout ?? '').trim(),
|
|
40
|
+
stderr: (result.stderr ?? '').trim(),
|
|
41
|
+
command: [command, ...commandArgs].join(' '),
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function parseJson(stdout) {
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(stdout)
|
|
48
|
+
} catch {
|
|
49
|
+
return null
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function createReleaseFixture() {
|
|
54
|
+
const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-public-release-decision-'))
|
|
55
|
+
fs.mkdirSync(path.join(fixture, '.gse', 'releases'), { recursive: true })
|
|
56
|
+
fs.writeFileSync(path.join(fixture, 'CHANGELOG.md'), '# Changelog\n\n## Unreleased\n\n- Fixture release decision.\n', 'utf8')
|
|
57
|
+
fs.writeFileSync(path.join(fixture, 'LICENSE'), 'Fixture license text for audit only.\n', 'utf8')
|
|
58
|
+
return fixture
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const recordScript = path.join(root, 'scripts', 'record-public-release.mjs')
|
|
62
|
+
const publicRelease = read('references/public-release.md')
|
|
63
|
+
const validate = read('scripts/validate-gse.mjs')
|
|
64
|
+
const completion = read('scripts/audit-completion-readiness.mjs')
|
|
65
|
+
const roadmap = read('scripts/audit-roadmap-consistency.mjs')
|
|
66
|
+
|
|
67
|
+
let fixture = null
|
|
68
|
+
let ownerRequired = null
|
|
69
|
+
let selectedOk = null
|
|
70
|
+
let selectedMissing = null
|
|
71
|
+
let notPublicOk = null
|
|
72
|
+
let notPublicMissing = null
|
|
73
|
+
|
|
74
|
+
if (fs.existsSync(recordScript)) {
|
|
75
|
+
fixture = createReleaseFixture()
|
|
76
|
+
ownerRequired = run(process.execPath, [
|
|
77
|
+
recordScript,
|
|
78
|
+
'--root',
|
|
79
|
+
fixture,
|
|
80
|
+
'--license-status',
|
|
81
|
+
'owner-required',
|
|
82
|
+
'--dry-run',
|
|
83
|
+
'--json',
|
|
84
|
+
])
|
|
85
|
+
selectedOk = run(process.execPath, [
|
|
86
|
+
recordScript,
|
|
87
|
+
'--root',
|
|
88
|
+
fixture,
|
|
89
|
+
'--license-status',
|
|
90
|
+
'selected',
|
|
91
|
+
'--spdx',
|
|
92
|
+
'MIT',
|
|
93
|
+
'--license-file',
|
|
94
|
+
'LICENSE',
|
|
95
|
+
'--approved-by',
|
|
96
|
+
'fixture-owner',
|
|
97
|
+
'--decision-date',
|
|
98
|
+
'2026-07-06',
|
|
99
|
+
'--evidence-status',
|
|
100
|
+
'accepted',
|
|
101
|
+
'--dry-run',
|
|
102
|
+
'--json',
|
|
103
|
+
])
|
|
104
|
+
selectedMissing = run(process.execPath, [
|
|
105
|
+
recordScript,
|
|
106
|
+
'--root',
|
|
107
|
+
fixture,
|
|
108
|
+
'--license-status',
|
|
109
|
+
'selected',
|
|
110
|
+
'--dry-run',
|
|
111
|
+
'--json',
|
|
112
|
+
])
|
|
113
|
+
notPublicOk = run(process.execPath, [
|
|
114
|
+
recordScript,
|
|
115
|
+
'--root',
|
|
116
|
+
fixture,
|
|
117
|
+
'--license-status',
|
|
118
|
+
'not-public',
|
|
119
|
+
'--approved-by',
|
|
120
|
+
'fixture-owner',
|
|
121
|
+
'--decision-date',
|
|
122
|
+
'2026-07-06',
|
|
123
|
+
'--dry-run',
|
|
124
|
+
'--json',
|
|
125
|
+
])
|
|
126
|
+
notPublicMissing = run(process.execPath, [
|
|
127
|
+
recordScript,
|
|
128
|
+
'--root',
|
|
129
|
+
fixture,
|
|
130
|
+
'--license-status',
|
|
131
|
+
'not-public',
|
|
132
|
+
'--dry-run',
|
|
133
|
+
'--json',
|
|
134
|
+
])
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const ownerRequiredData = ownerRequired ? parseJson(ownerRequired.stdout) : null
|
|
138
|
+
const selectedOkData = selectedOk ? parseJson(selectedOk.stdout) : null
|
|
139
|
+
const selectedMissingData = selectedMissing ? parseJson(selectedMissing.stdout) : null
|
|
140
|
+
const notPublicOkData = notPublicOk ? parseJson(notPublicOk.stdout) : null
|
|
141
|
+
const notPublicMissingData = notPublicMissing ? parseJson(notPublicMissing.stdout) : null
|
|
142
|
+
|
|
143
|
+
const checks = [
|
|
144
|
+
check('PD01', 'public release decision command exists', exists('scripts/record-public-release.mjs'), 'scripts/record-public-release.mjs'),
|
|
145
|
+
check('PD02', 'owner-required decision path remains writable without approval fields', ownerRequired?.status === 0 && ownerRequiredData?.status === 'ready' && ownerRequiredData?.licenseStatus === 'owner-required' && ownerRequiredData?.evidenceStatus === 'result', 'record-public-release --license-status owner-required --dry-run'),
|
|
146
|
+
check('PD03', 'selected-license decision path accepts complete owner evidence', selectedOk?.status === 0 && selectedOkData?.status === 'ready' && selectedOkData?.licenseStatus === 'selected' && selectedOkData?.evidenceStatus === 'accepted', 'record-public-release --license-status selected fixture dry-run'),
|
|
147
|
+
check('PD04', 'selected-license decision path rejects missing owner evidence', selectedMissing?.status !== 0 && selectedMissingData?.status === 'failed' && selectedMissingData?.errors?.some((item) => item.includes('--spdx')) && selectedMissingData?.errors?.some((item) => item.includes('--approved-by')), 'record-public-release selected missing-fields dry-run'),
|
|
148
|
+
check('PD05', 'not-public decision path accepts explicit owner decision', notPublicOk?.status === 0 && notPublicOkData?.status === 'ready' && notPublicOkData?.licenseStatus === 'not-public', 'record-public-release --license-status not-public fixture dry-run'),
|
|
149
|
+
check('PD06', 'not-public decision path rejects missing owner decision', notPublicMissing?.status !== 0 && notPublicMissingData?.status === 'failed' && notPublicMissingData?.errors?.some((item) => item.includes('--approved-by')) && notPublicMissingData?.errors?.some((item) => item.includes('--decision-date')), 'record-public-release not-public missing-fields dry-run'),
|
|
150
|
+
check('PD07', 'public release docs describe all decision states', publicRelease.includes('owner-required | selected | not-public') && publicRelease.includes('For `--license-status selected`') && publicRelease.includes('not-public'), 'references/public-release.md'),
|
|
151
|
+
check('PD08', 'validator and completion audits include public decision lifecycle', validate.includes('audit-public-release-decision.mjs') && completion.includes('audit-public-release-decision.mjs') && roadmap.includes('audit-public-release-decision.mjs'), 'validate, completion, roadmap audits'),
|
|
152
|
+
]
|
|
153
|
+
|
|
154
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
155
|
+
const failed = checks.length - passed
|
|
156
|
+
const report = {
|
|
157
|
+
root,
|
|
158
|
+
generatedAt: new Date().toISOString(),
|
|
159
|
+
fixtureRoot: fixture,
|
|
160
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
161
|
+
workflows: {
|
|
162
|
+
publicReleaseDecisionLifecycle: failed === 0 ? 'verified' : 'failed',
|
|
163
|
+
},
|
|
164
|
+
limits: [
|
|
165
|
+
'This audit verifies decision-path mechanics for owner-required, selected-license, and not-public records.',
|
|
166
|
+
'The selected-license path is tested with a temporary fixture license; it does not select a license for GSE.',
|
|
167
|
+
'Accepted public release for GSE still requires an owner-approved real license file or explicit not-public decision record.',
|
|
168
|
+
],
|
|
169
|
+
checks,
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function renderMarkdown(data) {
|
|
173
|
+
const lines = []
|
|
174
|
+
lines.push('# GSE Public Release Decision Audit')
|
|
175
|
+
lines.push('')
|
|
176
|
+
lines.push('Generated: ' + data.generatedAt)
|
|
177
|
+
lines.push('Root: ' + data.root)
|
|
178
|
+
lines.push('')
|
|
179
|
+
lines.push('## Summary')
|
|
180
|
+
lines.push('')
|
|
181
|
+
lines.push('- Status: ' + data.summary.status)
|
|
182
|
+
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
183
|
+
lines.push('- Public release decision lifecycle: ' + data.workflows.publicReleaseDecisionLifecycle)
|
|
184
|
+
lines.push('')
|
|
185
|
+
lines.push('## Checks')
|
|
186
|
+
lines.push('')
|
|
187
|
+
for (const item of data.checks) {
|
|
188
|
+
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
189
|
+
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
190
|
+
}
|
|
191
|
+
lines.push('')
|
|
192
|
+
lines.push('## Limits')
|
|
193
|
+
lines.push('')
|
|
194
|
+
for (const item of data.limits) lines.push('- ' + item)
|
|
195
|
+
return lines.join('\n') + '\n'
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
199
|
+
else console.log(renderMarkdown(report))
|
|
200
|
+
|
|
201
|
+
if (failed > 0) process.exit(1)
|