@t275005746/gse 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +42 -0
  2. package/.github/ISSUE_TEMPLATE/change_request.yml +50 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  5. package/.github/workflows/validate-gse.yml +33 -0
  6. package/.gse/README.md +18 -0
  7. package/.gse/gse-development-protocol.md +50 -0
  8. package/.gse/project-profile.md +29 -0
  9. package/.gse/quality-gates.md +25 -0
  10. package/.gse/releases/public-channel-publication-pending.md +49 -0
  11. package/.gse/releases/public-ci-run-pending.md +53 -0
  12. package/.gse/releases/public-release-owner-required.md +65 -0
  13. package/.gse/releases/public-repository-settings-owner-required.md +59 -0
  14. package/.gse/releases/public-security-contact-owner-required.md +45 -0
  15. package/.gse/state.json +27 -0
  16. package/CHANGELOG.md +24 -0
  17. package/CONTRIBUTING.md +64 -0
  18. package/LICENSE +21 -0
  19. package/README.md +236 -0
  20. package/README.zh-CN.md +236 -0
  21. package/SECURITY.md +41 -0
  22. package/SKILL.md +148 -0
  23. package/SUPPORT.md +38 -0
  24. package/agents/openai.yaml +4 -0
  25. package/assets/marketplace/README.md +7 -0
  26. package/assets/marketplace/gse-listing.json +75 -0
  27. package/assets/templates/acceptance-execution-packet.md +73 -0
  28. package/assets/templates/adr.md +14 -0
  29. package/assets/templates/change-brief.md +16 -0
  30. package/assets/templates/design.md +18 -0
  31. package/assets/templates/dispatch-packet.md +104 -0
  32. package/assets/templates/evidence.md +14 -0
  33. package/assets/templates/execution-quality-pack.md +65 -0
  34. package/assets/templates/goal-map.md +21 -0
  35. package/assets/templates/host-adapter.md +48 -0
  36. package/assets/templates/host-ui-invocation-record.md +42 -0
  37. package/assets/templates/incident-review.md +60 -0
  38. package/assets/templates/public-channel-publication-record.md +49 -0
  39. package/assets/templates/public-ci-run-record.md +53 -0
  40. package/assets/templates/public-release-record.md +65 -0
  41. package/assets/templates/public-repository-settings-record.md +59 -0
  42. package/assets/templates/public-security-contact-record.md +45 -0
  43. package/assets/templates/release-trust-record.md +32 -0
  44. package/assets/templates/review.md +18 -0
  45. package/assets/templates/spec.md +16 -0
  46. package/assets/templates/target-adoption-evidence.md +29 -0
  47. package/assets/templates/tasks.md +17 -0
  48. package/assets/templates/update-release-acceptance-record.md +58 -0
  49. package/examples/README.md +22 -0
  50. package/examples/agent-runtime-host/.claude/gse-adapter.md +6 -0
  51. package/examples/agent-runtime-host/.codex/gse-adapter.md +7 -0
  52. package/examples/agent-runtime-host/.gse/goal-map.md +7 -0
  53. package/examples/agent-runtime-host/.gse/project-profile.md +27 -0
  54. package/examples/agent-runtime-host/.gse/tooling.md +5 -0
  55. package/examples/agent-runtime-host/.mcp.json +9 -0
  56. package/examples/agent-runtime-host/AGENTS.md +5 -0
  57. package/examples/agent-runtime-host/README.md +10 -0
  58. package/examples/agent-runtime-host/docs/model-routing.md +5 -0
  59. package/examples/cli-tool/.gse/project-profile.md +21 -0
  60. package/examples/cli-tool/AGENTS.md +5 -0
  61. package/examples/cli-tool/README.md +12 -0
  62. package/examples/cli-tool/package.json +21 -0
  63. package/examples/small-app/.env.example +2 -0
  64. package/examples/small-app/.github/workflows/ci.yml +8 -0
  65. package/examples/small-app/AGENTS.md +5 -0
  66. package/examples/small-app/README.md +12 -0
  67. package/examples/small-app/package.json +26 -0
  68. package/examples/small-app/playwright.config.ts +4 -0
  69. package/package.json +53 -0
  70. package/references/adoption-recipes.md +171 -0
  71. package/references/agent-roles.md +49 -0
  72. package/references/architecture-health.md +101 -0
  73. package/references/benchmark-audit.md +73 -0
  74. package/references/commands.md +295 -0
  75. package/references/community-channels.md +46 -0
  76. package/references/compatibility.md +70 -0
  77. package/references/design-basis.md +38 -0
  78. package/references/domain-model.md +129 -0
  79. package/references/domain-quality-gates.md +75 -0
  80. package/references/drift-audit.md +81 -0
  81. package/references/evidence-taxonomy.md +123 -0
  82. package/references/file-ownership.md +107 -0
  83. package/references/final-readiness.md +84 -0
  84. package/references/forward-test.md +133 -0
  85. package/references/goal-map.md +36 -0
  86. package/references/host-adapters.md +119 -0
  87. package/references/learning-system.md +35 -0
  88. package/references/marketplace-discovery.md +46 -0
  89. package/references/model-routing.md +103 -0
  90. package/references/open-source-defaults.md +39 -0
  91. package/references/operating-model.md +52 -0
  92. package/references/packaging.md +277 -0
  93. package/references/project-agent-workspace.md +89 -0
  94. package/references/project-bootstrap.md +122 -0
  95. package/references/project-profile.md +57 -0
  96. package/references/public-release.md +174 -0
  97. package/references/quality-gates.md +100 -0
  98. package/references/recovery.md +176 -0
  99. package/references/release-trust.md +43 -0
  100. package/references/release.md +126 -0
  101. package/references/review.md +141 -0
  102. package/references/router.md +90 -0
  103. package/references/spec-workflow.md +66 -0
  104. package/references/task-levels.md +81 -0
  105. package/references/tool-adapters.md +73 -0
  106. package/scripts/audit-acceptance-execution-packet.mjs +133 -0
  107. package/scripts/audit-adoption-recipes.mjs +99 -0
  108. package/scripts/audit-adoption.mjs +154 -0
  109. package/scripts/audit-change-lifecycle.mjs +77 -0
  110. package/scripts/audit-change-system.mjs +134 -0
  111. package/scripts/audit-ci-readiness.mjs +107 -0
  112. package/scripts/audit-close-gate.mjs +323 -0
  113. package/scripts/audit-command-adapters.mjs +91 -0
  114. package/scripts/audit-command-execution.mjs +210 -0
  115. package/scripts/audit-commands.mjs +117 -0
  116. package/scripts/audit-compatibility.mjs +149 -0
  117. package/scripts/audit-completion-readiness.mjs +292 -0
  118. package/scripts/audit-distribution.mjs +251 -0
  119. package/scripts/audit-domain-quality-gates.mjs +108 -0
  120. package/scripts/audit-evidence-placeholders.mjs +126 -0
  121. package/scripts/audit-final-acceptance-packet.mjs +148 -0
  122. package/scripts/audit-final-form-progress-report.mjs +161 -0
  123. package/scripts/audit-final-form-stale-copy.mjs +221 -0
  124. package/scripts/audit-final-readiness-promotion.mjs +255 -0
  125. package/scripts/audit-final-readiness.mjs +226 -0
  126. package/scripts/audit-fixtures.mjs +154 -0
  127. package/scripts/audit-fresh-session-readiness.mjs +177 -0
  128. package/scripts/audit-gse.mjs +275 -0
  129. package/scripts/audit-host-adapters.mjs +119 -0
  130. package/scripts/audit-host-runtime-evidence-handoff.mjs +159 -0
  131. package/scripts/audit-host-runtime-invocation-drill.mjs +240 -0
  132. package/scripts/audit-host-runtime-invocations.mjs +254 -0
  133. package/scripts/audit-host-ui-invocation.mjs +132 -0
  134. package/scripts/audit-learning-system.mjs +103 -0
  135. package/scripts/audit-local-final-form-completion.mjs +131 -0
  136. package/scripts/audit-marketplace-discovery.mjs +122 -0
  137. package/scripts/audit-npm-package-metadata.mjs +155 -0
  138. package/scripts/audit-npm-publish-dry-run.mjs +169 -0
  139. package/scripts/audit-npm-tarball-install.mjs +191 -0
  140. package/scripts/audit-open-source-defaults.mjs +92 -0
  141. package/scripts/audit-open-source-readiness.mjs +97 -0
  142. package/scripts/audit-owner-external-gate-kit.mjs +218 -0
  143. package/scripts/audit-project.mjs +323 -0
  144. package/scripts/audit-public-acceptance-command-dry-run-drill.mjs +203 -0
  145. package/scripts/audit-public-acceptance-handoff.mjs +142 -0
  146. package/scripts/audit-public-acceptance-readiness.mjs +224 -0
  147. package/scripts/audit-public-channel-publication.mjs +248 -0
  148. package/scripts/audit-public-ci-run.mjs +184 -0
  149. package/scripts/audit-public-collaboration-templates.mjs +98 -0
  150. package/scripts/audit-public-external-gate-probe.mjs +206 -0
  151. package/scripts/audit-public-release-checklist.mjs +133 -0
  152. package/scripts/audit-public-release-decision.mjs +201 -0
  153. package/scripts/audit-public-release-metadata.mjs +176 -0
  154. package/scripts/audit-public-repository-settings.mjs +237 -0
  155. package/scripts/audit-public-security-contact.mjs +171 -0
  156. package/scripts/audit-readme-docs.mjs +185 -0
  157. package/scripts/audit-recovery-readiness.mjs +98 -0
  158. package/scripts/audit-release-bundle.mjs +251 -0
  159. package/scripts/audit-release-owner-action-plan-drill.mjs +277 -0
  160. package/scripts/audit-release-owner-action-plan.mjs +164 -0
  161. package/scripts/audit-release-readiness.mjs +106 -0
  162. package/scripts/audit-release-status-manifest.mjs +165 -0
  163. package/scripts/audit-release-trust.mjs +62 -0
  164. package/scripts/audit-remote-distribution.mjs +266 -0
  165. package/scripts/audit-roadmap-consistency.mjs +235 -0
  166. package/scripts/audit-signing.mjs +147 -0
  167. package/scripts/audit-state-freshness.mjs +113 -0
  168. package/scripts/audit-target-adoption-evidence.mjs +117 -0
  169. package/scripts/audit-target-project.mjs +507 -0
  170. package/scripts/audit-update-release-acceptance.mjs +136 -0
  171. package/scripts/audit-v1-target-validation.mjs +269 -0
  172. package/scripts/audit-validation-profiles.mjs +125 -0
  173. package/scripts/close-change.mjs +116 -0
  174. package/scripts/discover-project-profile.mjs +307 -0
  175. package/scripts/forward-test-gse.mjs +146 -0
  176. package/scripts/generate-command-adapter.mjs +231 -0
  177. package/scripts/generate-final-acceptance-packet.mjs +181 -0
  178. package/scripts/generate-final-form-progress-report.mjs +205 -0
  179. package/scripts/generate-host-adapter.mjs +73 -0
  180. package/scripts/generate-host-runtime-evidence-handoff.mjs +206 -0
  181. package/scripts/generate-owner-external-gate-kit.mjs +295 -0
  182. package/scripts/generate-public-acceptance-handoff.mjs +168 -0
  183. package/scripts/generate-public-release-checklist.mjs +207 -0
  184. package/scripts/generate-release-bundle.mjs +505 -0
  185. package/scripts/generate-release-owner-action-plan.mjs +172 -0
  186. package/scripts/generate-release-status-manifest.mjs +200 -0
  187. package/scripts/generate-session-prompt.mjs +188 -0
  188. package/scripts/gse.mjs +67 -0
  189. package/scripts/init-change.mjs +265 -0
  190. package/scripts/init-project.mjs +785 -0
  191. package/scripts/install-gse.mjs +234 -0
  192. package/scripts/lib/evidence-placeholders.mjs +28 -0
  193. package/scripts/package-gse.mjs +174 -0
  194. package/scripts/probe-public-external-gates.mjs +167 -0
  195. package/scripts/record-host-invocation.mjs +151 -0
  196. package/scripts/record-learning.mjs +137 -0
  197. package/scripts/record-public-channel-publication.mjs +178 -0
  198. package/scripts/record-public-ci-run.mjs +180 -0
  199. package/scripts/record-public-release.mjs +175 -0
  200. package/scripts/record-public-repository-settings.mjs +209 -0
  201. package/scripts/record-public-security-contact.mjs +157 -0
  202. package/scripts/run-gse-command.mjs +538 -0
  203. package/scripts/run-validation-profile.mjs +146 -0
  204. package/scripts/sign-gse-package.mjs +83 -0
  205. package/scripts/update-project-state.mjs +223 -0
  206. package/scripts/validate-gse.mjs +1168 -0
  207. package/scripts/verify-gse-package.mjs +85 -0
@@ -0,0 +1,505 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs'
3
+ import path from 'node:path'
4
+ import os from 'node:os'
5
+ import crypto from 'node:crypto'
6
+ import { spawnSync } from 'node:child_process'
7
+
8
+ const args = process.argv.slice(2)
9
+
10
+ function readArg(name, fallback = null) {
11
+ const index = args.indexOf(name)
12
+ if (index === -1) return fallback
13
+ return args[index + 1] ?? fallback
14
+ }
15
+
16
+ function hasArg(name) {
17
+ return args.includes(name)
18
+ }
19
+
20
+ const root = path.resolve(readArg('--root', path.join(import.meta.dirname, '..')))
21
+ const label = readArg('--label', 'gse-release-bundle-' + new Date().toISOString().slice(0, 10))
22
+ const out = path.resolve(readArg('--out', path.join(root, '.gse', 'release-bundles', label)))
23
+ const displayRoot = readArg('--display-root', '<gse-root>')
24
+ const dryRun = hasArg('--dry-run')
25
+ const force = hasArg('--force')
26
+ const jsonOnly = hasArg('--json')
27
+
28
+ function exists(relativePath) {
29
+ return fs.existsSync(path.join(root, relativePath))
30
+ }
31
+
32
+ function read(relativePath) {
33
+ const fullPath = path.join(root, relativePath)
34
+ return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8') : ''
35
+ }
36
+
37
+ function run(command, commandArgs) {
38
+ const result = spawnSync(command, commandArgs, {
39
+ cwd: root,
40
+ encoding: 'utf8',
41
+ windowsHide: true,
42
+ })
43
+ return {
44
+ command: [command, ...commandArgs].join(' '),
45
+ status: result.status ?? 1,
46
+ stdout: (result.stdout ?? '').trim(),
47
+ stderr: (result.stderr ?? '').trim(),
48
+ }
49
+ }
50
+
51
+ function parseJson(stdout) {
52
+ try {
53
+ return JSON.parse(stdout)
54
+ } catch {
55
+ return null
56
+ }
57
+ }
58
+
59
+ function sha256File(filePath) {
60
+ return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex')
61
+ }
62
+
63
+ function collectFileHashes(baseDir) {
64
+ const rows = []
65
+ function visit(itemPath) {
66
+ if (!fs.existsSync(itemPath)) return
67
+ const stat = fs.statSync(itemPath)
68
+ if (stat.isDirectory()) {
69
+ for (const child of fs.readdirSync(itemPath)) visit(path.join(itemPath, child))
70
+ return
71
+ }
72
+ if (!stat.isFile()) return
73
+ const relativePath = path.relative(baseDir, itemPath).replace(/\\/g, '/')
74
+ rows.push({
75
+ relativePath,
76
+ sha256: sha256File(itemPath),
77
+ bytes: stat.size,
78
+ })
79
+ }
80
+ visit(baseDir)
81
+ rows.sort((a, b) => a.relativePath.localeCompare(b.relativePath))
82
+ return rows
83
+ }
84
+
85
+ function portableCommand(commandLine) {
86
+ if (!commandLine) return commandLine
87
+ const rootForward = root.replace(/\\/g, '/')
88
+ return commandLine
89
+ .replaceAll(process.execPath, 'node')
90
+ .replaceAll(root, '<gse-root>')
91
+ .replaceAll(rootForward, '<gse-root>')
92
+ .replace(/<gse-root>[\\/]/g, '<gse-root>/')
93
+ .replace(/\\/g, '/')
94
+ }
95
+
96
+ const required = [
97
+ 'SKILL.md',
98
+ 'README.md',
99
+ 'README.zh-CN.md',
100
+ 'CHANGELOG.md',
101
+ 'references/packaging.md',
102
+ 'references/public-release.md',
103
+ 'references/release-trust.md',
104
+ 'references/marketplace-discovery.md',
105
+ 'scripts/validate-gse.mjs',
106
+ 'scripts/package-gse.mjs',
107
+ 'scripts/install-gse.mjs',
108
+ 'scripts/record-public-release.mjs',
109
+ '.gse/releases/public-release-owner-required.md',
110
+ '.gse/acceptance/public-acceptance-handoff.md',
111
+ '.gse/acceptance/host-runtime-evidence-handoff.md',
112
+ ]
113
+
114
+ const errors = []
115
+ for (const item of required) {
116
+ if (!exists(item)) errors.push('missing required release-bundle input: ' + item)
117
+ }
118
+
119
+ const validation = errors.length === 0
120
+ ? run(process.execPath, [path.join(root, 'scripts', 'validate-gse.mjs'), '--root', root, '--skip-distribution', '--skip-skill-validator', '--skip-completion-readiness', '--skip-release-bundle', '--skip-final-form-stale-copy', '--skip-local-final-form-completion', '--json'])
121
+ : null
122
+ const validationData = validation ? parseJson(validation.stdout) : null
123
+ if (validation && validation.status !== 0) errors.push('validation command failed for release bundle readiness')
124
+ const validationChecks = Array.isArray(validationData?.checks)
125
+ ? validationData.checks.map((item) => ({
126
+ id: item.id,
127
+ label: item.label,
128
+ status: item.status,
129
+ command: portableCommand(item.command),
130
+ summary: item.summary ?? null,
131
+ }))
132
+ : []
133
+
134
+ const generatedAcceptanceRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-release-bundle-acceptance-'))
135
+ const freshPublicAcceptanceHandoffPath = path.join(generatedAcceptanceRoot, 'public-acceptance-handoff.md')
136
+ const freshReleaseStatusManifestPath = path.join(generatedAcceptanceRoot, 'release-status-manifest.json')
137
+ const freshReleaseOwnerActionPlanPath = path.join(generatedAcceptanceRoot, 'release-owner-action-plan.md')
138
+ const freshPublicReleaseChecklistPath = path.join(generatedAcceptanceRoot, 'public-release-checklist.md')
139
+ const freshOwnerExternalGateKitPath = path.join(generatedAcceptanceRoot, 'owner-external-gate-kit')
140
+ const freshInstallablePackagePath = path.join(generatedAcceptanceRoot, 'installable-package')
141
+
142
+ if (errors.length === 0) {
143
+ const publicAcceptanceHandoffGeneration = run(process.execPath, [
144
+ path.join(root, 'scripts', 'generate-public-acceptance-handoff.mjs'),
145
+ '--root',
146
+ root,
147
+ '--display-root',
148
+ displayRoot,
149
+ '--out',
150
+ freshPublicAcceptanceHandoffPath,
151
+ '--force',
152
+ '--json',
153
+ ])
154
+ if (publicAcceptanceHandoffGeneration.status !== 0) {
155
+ errors.push('public acceptance handoff generation failed for release bundle')
156
+ }
157
+ const manifestGeneration = run(process.execPath, [
158
+ path.join(root, 'scripts', 'generate-release-status-manifest.mjs'),
159
+ '--root',
160
+ root,
161
+ '--display-root',
162
+ displayRoot,
163
+ '--out',
164
+ freshReleaseStatusManifestPath,
165
+ '--force',
166
+ '--json',
167
+ ])
168
+ if (manifestGeneration.status !== 0) {
169
+ errors.push('release status manifest generation failed for release bundle')
170
+ }
171
+ const actionPlanGeneration = run(process.execPath, [
172
+ path.join(root, 'scripts', 'generate-release-owner-action-plan.mjs'),
173
+ '--root',
174
+ root,
175
+ '--manifest',
176
+ freshReleaseStatusManifestPath,
177
+ '--out',
178
+ freshReleaseOwnerActionPlanPath,
179
+ '--force',
180
+ '--json',
181
+ ])
182
+ if (actionPlanGeneration.status !== 0) {
183
+ errors.push('release owner action plan generation failed for release bundle')
184
+ }
185
+ const publicReleaseChecklistGeneration = run(process.execPath, [
186
+ path.join(root, 'scripts', 'generate-public-release-checklist.mjs'),
187
+ '--root',
188
+ root,
189
+ '--display-root',
190
+ displayRoot,
191
+ '--manifest',
192
+ freshReleaseStatusManifestPath,
193
+ '--out',
194
+ freshPublicReleaseChecklistPath,
195
+ '--force',
196
+ '--json',
197
+ ])
198
+ if (publicReleaseChecklistGeneration.status !== 0) {
199
+ errors.push('public release checklist generation failed for release bundle')
200
+ }
201
+ const ownerExternalGateKitGeneration = run(process.execPath, [
202
+ path.join(root, 'scripts', 'generate-owner-external-gate-kit.mjs'),
203
+ '--root',
204
+ root,
205
+ '--display-root',
206
+ displayRoot,
207
+ '--out',
208
+ freshOwnerExternalGateKitPath,
209
+ '--force',
210
+ '--json',
211
+ ])
212
+ if (ownerExternalGateKitGeneration.status !== 0) {
213
+ errors.push('owner/external gate kit generation failed for release bundle')
214
+ }
215
+ const packageGeneration = run(process.execPath, [
216
+ path.join(root, 'scripts', 'package-gse.mjs'),
217
+ '--root',
218
+ root,
219
+ '--out',
220
+ freshInstallablePackagePath,
221
+ '--label',
222
+ label + '-installable',
223
+ '--json',
224
+ ])
225
+ if (packageGeneration.status !== 0) {
226
+ errors.push('installable package generation failed for release bundle')
227
+ }
228
+ }
229
+
230
+ const publicReleaseRecord = read('.gse/releases/public-release-owner-required.md')
231
+ const publicAcceptanceHandoff = fs.existsSync(freshPublicAcceptanceHandoffPath) ? fs.readFileSync(freshPublicAcceptanceHandoffPath, 'utf8') : ''
232
+ const hostRuntimeEvidenceHandoff = read('.gse/acceptance/host-runtime-evidence-handoff.md')
233
+ const releaseStatusManifest = fs.existsSync(freshReleaseStatusManifestPath) ? fs.readFileSync(freshReleaseStatusManifestPath, 'utf8') : ''
234
+ const releaseOwnerActionPlan = fs.existsSync(freshReleaseOwnerActionPlanPath) ? fs.readFileSync(freshReleaseOwnerActionPlanPath, 'utf8') : ''
235
+ const publicReleaseChecklist = fs.existsSync(freshPublicReleaseChecklistPath) ? fs.readFileSync(freshPublicReleaseChecklistPath, 'utf8') : ''
236
+ function readFreshKit(fileName) {
237
+ const fullPath = path.join(freshOwnerExternalGateKitPath, fileName)
238
+ return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8') : ''
239
+ }
240
+ const releaseStatusData = parseJson(releaseStatusManifest)
241
+ const installablePackageManifestPath = path.join(freshInstallablePackagePath, 'gse-package-manifest.json')
242
+ const installablePackageManifest = fs.existsSync(installablePackageManifestPath)
243
+ ? parseJson(fs.readFileSync(installablePackageManifestPath, 'utf8'))
244
+ : null
245
+ const installablePackageHashes = fs.existsSync(freshInstallablePackagePath)
246
+ ? collectFileHashes(freshInstallablePackagePath)
247
+ : []
248
+ const licenseDecisionAccepted =
249
+ publicReleaseRecord.includes('License status: selected') &&
250
+ publicReleaseRecord.includes('SPDX identifier: MIT') &&
251
+ publicReleaseRecord.includes('Evidence status: accepted')
252
+ const releaseSummary = [
253
+ '# GSE Release Bundle',
254
+ '',
255
+ 'Bundle label: ' + label,
256
+ '',
257
+ 'Generated: ' + new Date().toISOString(),
258
+ '',
259
+ 'Source root: ' + displayRoot,
260
+ '',
261
+ '## Readiness',
262
+ '',
263
+ 'Status: verified for local package, URL install, signing mechanics, command semantics, public-release metadata, and release decision record.',
264
+ '',
265
+ 'Accepted public release: not accepted until public security contact, public repository settings, public CI, public channel publication, and host runtime evidence are recorded.',
266
+ '',
267
+ '## License Decision',
268
+ '',
269
+ publicReleaseRecord.includes('License status: owner-required')
270
+ ? 'License status: owner-required'
271
+ : licenseDecisionAccepted
272
+ ? 'License status: selected; SPDX identifier: MIT; Evidence status: accepted'
273
+ : 'License status: unknown',
274
+ '',
275
+ '## Install Commands',
276
+ '',
277
+ 'This bundle includes an installable package snapshot under `installable-package/`.',
278
+ '',
279
+ '```text',
280
+ 'node <skill>/scripts/install-gse.mjs --source <release-bundle>/installable-package --target <install-skill-dir>',
281
+ 'node <install-skill-dir>/scripts/validate-gse.mjs --root <install-skill-dir> --skip-skill-validator --skip-distribution --skip-completion-readiness --json',
282
+ 'node <install-skill-dir>/scripts/gse.mjs status --target <install-skill-dir> --json',
283
+ '```',
284
+ '',
285
+ '## Verification Command',
286
+ '',
287
+ '```text',
288
+ 'node <skill>/scripts/validate-gse.mjs --root <skill> --json',
289
+ '```',
290
+ '',
291
+ 'Latest local bundle precheck: ' + (validationData?.summary?.status ?? 'not-run') + ', checks ' + (validationData?.summary ? `${validationData.summary.passed}/${validationData.summary.total}` : 'unknown'),
292
+ '',
293
+ 'Validation manifest detail: `bundle-manifest.json` includes compact `validationChecks[]` entries for the checks that produced the precheck total.',
294
+ '',
295
+ '## Public Acceptance Handoff',
296
+ '',
297
+ 'Use `public-acceptance-handoff.md` before public release handoff. It lists the owner/external gates that must be backed by real accepted evidence before public acceptance can be claimed.',
298
+ '',
299
+ '## Host Runtime Evidence Handoff',
300
+ '',
301
+ 'Use `host-runtime-evidence-handoff.md` before claiming cross-host support. It lists host families, record commands, and anti-overclaim rules for native slash-command and portable command evidence.',
302
+ '',
303
+ 'Run `audit-host-runtime-invocation-drill.mjs` before cross-host release handoff to verify record/audit mechanics without treating fixture records as real host evidence.',
304
+ '',
305
+ '## Release Status Manifest',
306
+ '',
307
+ 'Use `release-status-manifest.json` when another host, CI job, marketplace checklist, or maintainer needs a machine-readable summary of verified capabilities and pending owner/external gates.',
308
+ '',
309
+ '## Release Owner Action Plan',
310
+ '',
311
+ 'Use `release-owner-action-plan.md` when a human owner or maintainer needs the remaining public-release actions grouped by responsible party with exact record commands.',
312
+ '',
313
+ '## Public Release Checklist',
314
+ '',
315
+ 'Use `public-release-checklist.md` when the owner needs a linear release runway from bundle preparation through repository, security, CI, registry, marketplace, host evidence, and final verification.',
316
+ '',
317
+ '## Owner / External Gate Kit',
318
+ '',
319
+ 'Use `owner-external-gate-kit/` as the one-directory execution packet for the remaining owner-required and external-required gates. It includes final acceptance, public handoff, host runtime evidence, record commands, verification commands, and a machine-readable kit manifest.',
320
+ '',
321
+ '## External Evidence Not Included',
322
+ '',
323
+ '- Public marketplace approval or publication.',
324
+ '- Public registry publication.',
325
+ '- Legal suitability of a selected license.',
326
+ '- Host-native slash-command runtime execution unless a host-specific invocation record exists.',
327
+ '',
328
+ ]
329
+
330
+ const files = {
331
+ 'release-summary.md': releaseSummary.join('\n'),
332
+ 'install-commands.md': [
333
+ '# Install Commands',
334
+ '',
335
+ 'This release bundle includes an installable GSE package snapshot.',
336
+ '',
337
+ '```text',
338
+ 'node <skill>/scripts/install-gse.mjs --source <release-bundle>/installable-package --target <install-skill-dir>',
339
+ 'node <install-skill-dir>/scripts/validate-gse.mjs --root <install-skill-dir> --skip-skill-validator --skip-distribution --skip-completion-readiness --json',
340
+ 'node <install-skill-dir>/scripts/gse.mjs status --target <install-skill-dir> --json',
341
+ '```',
342
+ '',
343
+ ].join('\n'),
344
+ 'validation-checklist.md': [
345
+ '# Validation Checklist',
346
+ '',
347
+ '- [ ] `validate-gse.mjs` passes in source environment.',
348
+ '- [ ] `audit-distribution.mjs` passes for local package/install.',
349
+ '- [ ] `audit-remote-distribution.mjs` passes for URL install and integrity.',
350
+ '- [ ] `audit-signing.mjs` passes for signing mechanics.',
351
+ '- [ ] `audit-public-release-metadata.mjs` passes.',
352
+ '- [ ] MIT license decision is recorded; accepted public release still requires real owner/external evidence.',
353
+ '- [ ] `public-acceptance-handoff.md` has been reviewed before public release handoff.',
354
+ '- [ ] `host-runtime-evidence-handoff.md` has been reviewed before claiming cross-host or native slash-command support.',
355
+ '- [ ] `audit-host-runtime-invocation-drill.mjs` passes before cross-host release handoff.',
356
+ '- [ ] `release-status-manifest.json` has been regenerated from current audits before handoff.',
357
+ '- [ ] `release-owner-action-plan.md` has been regenerated from current manifest before owner handoff.',
358
+ '- [ ] `public-release-checklist.md` has been regenerated from current manifest before public release execution.',
359
+ '- [ ] `owner-external-gate-kit/` has been generated and reviewed before owner/external handoff.',
360
+ '- [ ] Host-native invocation is recorded per host before claiming host-native support.',
361
+ '',
362
+ ].join('\n'),
363
+ 'public-release-record.md': publicReleaseRecord,
364
+ 'public-acceptance-handoff.md': publicAcceptanceHandoff,
365
+ 'host-runtime-evidence-handoff.md': hostRuntimeEvidenceHandoff,
366
+ 'release-status-manifest.json': releaseStatusManifest,
367
+ 'release-owner-action-plan.md': releaseOwnerActionPlan,
368
+ 'public-release-checklist.md': publicReleaseChecklist,
369
+ 'owner-external-gate-kit/README.md': readFreshKit('README.md'),
370
+ 'owner-external-gate-kit/action-packet.md': readFreshKit('action-packet.md'),
371
+ 'owner-external-gate-kit/final-acceptance-packet.md': readFreshKit('final-acceptance-packet.md'),
372
+ 'owner-external-gate-kit/public-acceptance-handoff.md': readFreshKit('public-acceptance-handoff.md'),
373
+ 'owner-external-gate-kit/host-runtime-evidence-handoff.md': readFreshKit('host-runtime-evidence-handoff.md'),
374
+ 'owner-external-gate-kit/release-status-manifest.json': readFreshKit('release-status-manifest.json'),
375
+ 'owner-external-gate-kit/release-owner-action-plan.md': readFreshKit('release-owner-action-plan.md'),
376
+ 'owner-external-gate-kit/record-commands.md': readFreshKit('record-commands.md'),
377
+ 'owner-external-gate-kit/verification-commands.md': readFreshKit('verification-commands.md'),
378
+ 'owner-external-gate-kit/kit-manifest.json': readFreshKit('kit-manifest.json'),
379
+ 'checksums.sha256': installablePackageHashes
380
+ .map((item) => `${item.sha256} installable-package/${item.relativePath}`)
381
+ .join('\n') + (installablePackageHashes.length ? '\n' : ''),
382
+ 'provenance.json': JSON.stringify({
383
+ schemaVersion: 1,
384
+ label,
385
+ generatedAt: new Date().toISOString(),
386
+ generator: 'scripts/generate-release-bundle.mjs',
387
+ source: {
388
+ displayRoot,
389
+ packageName: 'gse',
390
+ localSourcePathIncluded: false,
391
+ },
392
+ installablePackage: installablePackageManifest
393
+ ? {
394
+ path: 'installable-package/',
395
+ manifest: 'installable-package/gse-package-manifest.json',
396
+ fileCount: installablePackageManifest.fileCount,
397
+ totalBytes: installablePackageManifest.totalBytes,
398
+ packageDigest: installablePackageManifest.integrity?.packageDigest ?? null,
399
+ algorithm: installablePackageManifest.integrity?.algorithm ?? null,
400
+ cli: installablePackageManifest.entrypoints?.cli ?? null,
401
+ }
402
+ : null,
403
+ validation: validationData?.summary ?? null,
404
+ publicAcceptance: {
405
+ status: releaseStatusData?.claimBoundary?.publicAccepted ?? 'not-accepted',
406
+ pendingGates: releaseStatusData?.publicAcceptance?.pendingGates?.length ?? null,
407
+ },
408
+ claimBoundaries: [
409
+ 'This provenance is generated locally from the release bundle generator.',
410
+ 'It is not a registry attestation, Sigstore bundle, marketplace approval, public CI attestation, or host-runtime certificate.',
411
+ 'Public-final claims require accepted owner/external records and final readiness re-audit.',
412
+ ],
413
+ checksumsFile: 'checksums.sha256',
414
+ }, null, 2) + '\n',
415
+ 'bundle-manifest.json': JSON.stringify({
416
+ schemaVersion: 1,
417
+ label,
418
+ generatedAt: new Date().toISOString(),
419
+ requiredInputs: required,
420
+ validation: validationData?.summary ?? null,
421
+ validationChecks,
422
+ generatedAcceptanceInputs: {
423
+ publicAcceptanceHandoff: 'generated during bundle creation',
424
+ releaseStatusManifest: 'generated during bundle creation',
425
+ releaseOwnerActionPlan: 'generated during bundle creation',
426
+ ownerExternalGateKit: 'generated during bundle creation',
427
+ },
428
+ publicReleaseAcceptance: releaseStatusData?.claimBoundary?.publicAccepted ?? 'not-accepted',
429
+ licenseDecision: licenseDecisionAccepted ? 'accepted' : 'owner-required',
430
+ installablePackage: installablePackageManifest
431
+ ? {
432
+ path: 'installable-package/',
433
+ manifest: 'installable-package/gse-package-manifest.json',
434
+ fileCount: installablePackageManifest.fileCount,
435
+ packageDigest: installablePackageManifest.integrity?.packageDigest ?? null,
436
+ algorithm: installablePackageManifest.integrity?.algorithm ?? null,
437
+ cli: installablePackageManifest.entrypoints?.cli ?? null,
438
+ }
439
+ : null,
440
+ publicAcceptanceHandoff: 'included',
441
+ hostRuntimeEvidenceHandoff: 'included',
442
+ releaseStatusManifest: 'included',
443
+ releaseOwnerActionPlan: 'included',
444
+ ownerExternalGateKit: 'included',
445
+ provenance: 'included',
446
+ checksums: 'included',
447
+ limits: [
448
+ 'Bundle does not publish GSE.',
449
+ 'Bundle does not choose a license.',
450
+ 'Bundle does not prove marketplace approval or host-native slash-command support.',
451
+ ],
452
+ }, null, 2) + '\n',
453
+ }
454
+
455
+ function copyDirectory(sourceDir, targetDir) {
456
+ if (!fs.existsSync(sourceDir)) return
457
+ fs.mkdirSync(targetDir, { recursive: true })
458
+ for (const entry of fs.readdirSync(sourceDir, { withFileTypes: true })) {
459
+ const sourcePath = path.join(sourceDir, entry.name)
460
+ const targetPath = path.join(targetDir, entry.name)
461
+ if (entry.isDirectory()) copyDirectory(sourcePath, targetPath)
462
+ else if (entry.isFile()) fs.copyFileSync(sourcePath, targetPath)
463
+ }
464
+ }
465
+
466
+ const report = {
467
+ root,
468
+ out,
469
+ label,
470
+ dryRun,
471
+ status: errors.length > 0 ? 'failed' : dryRun ? 'ready' : 'written',
472
+ errors,
473
+ files: Object.keys(files),
474
+ validation: validationData?.summary ?? null,
475
+ }
476
+
477
+ if (errors.length === 0 && !dryRun) {
478
+ if (fs.existsSync(out) && !force) {
479
+ report.status = 'exists'
480
+ report.errors.push('output exists; use --force or choose another --out path')
481
+ } else {
482
+ if (fs.existsSync(out)) fs.rmSync(out, { recursive: true, force: true })
483
+ fs.mkdirSync(out, { recursive: true })
484
+ for (const [fileName, content] of Object.entries(files)) {
485
+ const fullPath = path.join(out, fileName)
486
+ fs.mkdirSync(path.dirname(fullPath), { recursive: true })
487
+ fs.writeFileSync(fullPath, content, 'utf8')
488
+ }
489
+ copyDirectory(freshInstallablePackagePath, path.join(out, 'installable-package'))
490
+ }
491
+ }
492
+
493
+ if (jsonOnly) console.log(JSON.stringify(report, null, 2))
494
+ else {
495
+ console.log('Release bundle status: ' + report.status)
496
+ console.log('Output: ' + report.out)
497
+ if (report.errors.length) {
498
+ console.log('Errors:')
499
+ for (const error of report.errors) console.log('- ' + error)
500
+ }
501
+ }
502
+
503
+ fs.rmSync(generatedAcceptanceRoot, { recursive: true, force: true })
504
+
505
+ if (report.status === 'failed' || report.status === 'exists') process.exit(1)
@@ -0,0 +1,172 @@
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
+ function hasArg(name) {
14
+ return args.includes(name)
15
+ }
16
+
17
+ const root = path.resolve(readArg('--root', path.join(import.meta.dirname, '..')))
18
+ const manifestPath = path.resolve(readArg('--manifest', path.join(root, '.gse', 'acceptance', 'release-status-manifest.json')))
19
+ const out = path.resolve(readArg('--out', path.join(root, '.gse', 'acceptance', 'release-owner-action-plan.md')))
20
+ const jsonOnly = hasArg('--json')
21
+ const dryRun = hasArg('--dry-run')
22
+ const force = hasArg('--force')
23
+
24
+ function readJson(filePath, label) {
25
+ if (!fs.existsSync(filePath)) throw new Error(`${label} does not exist: ${filePath}`)
26
+ try {
27
+ return JSON.parse(fs.readFileSync(filePath, 'utf8').replace(/^\uFEFF/, ''))
28
+ } catch (error) {
29
+ throw new Error(`${label} is not valid JSON: ${error.message}`)
30
+ }
31
+ }
32
+
33
+ function groupByOwner(gates) {
34
+ const order = [
35
+ 'project owner',
36
+ 'repository owner',
37
+ 'external CI',
38
+ 'external registry',
39
+ 'external marketplace',
40
+ 'host runtime',
41
+ ]
42
+ const groups = new Map()
43
+ for (const gate of gates) {
44
+ const owner = gate.owner || 'unknown owner'
45
+ if (!groups.has(owner)) groups.set(owner, [])
46
+ groups.get(owner).push(gate)
47
+ }
48
+ return [...groups.entries()].sort((a, b) => {
49
+ const ai = order.indexOf(a[0])
50
+ const bi = order.indexOf(b[0])
51
+ if (ai === -1 && bi === -1) return a[0].localeCompare(b[0])
52
+ if (ai === -1) return 1
53
+ if (bi === -1) return -1
54
+ return ai - bi
55
+ })
56
+ }
57
+
58
+ function ownerDisplay(owner) {
59
+ const labels = {
60
+ 'project owner': 'Project Owner',
61
+ 'repository owner': 'Repository Owner',
62
+ 'external CI': 'External CI',
63
+ 'external registry': 'External Registry',
64
+ 'external marketplace': 'External Marketplace',
65
+ 'host runtime': 'Host Runtime',
66
+ }
67
+ return labels[owner] ?? owner
68
+ }
69
+
70
+ function render(manifest) {
71
+ const pendingGates = manifest.publicAcceptance?.pendingGates ?? []
72
+ const groups = groupByOwner(pendingGates)
73
+ const lines = []
74
+ lines.push('# GSE Release Owner Action Plan')
75
+ lines.push('')
76
+ lines.push('Generated: ' + new Date().toISOString())
77
+ lines.push('Source manifest: `.gse/acceptance/release-status-manifest.json`')
78
+ lines.push('')
79
+ lines.push('## Current Status')
80
+ lines.push('')
81
+ lines.push('- Public accepted: ' + (manifest.publicAcceptance?.publicAccepted ?? manifest.claimBoundary?.publicAccepted ?? 'unknown'))
82
+ lines.push('- Verified rows: ' + (manifest.readiness?.verified?.length ?? 0))
83
+ lines.push('- Owner-required rows: ' + (manifest.readiness?.ownerRequired?.length ?? 0))
84
+ lines.push('- External-required rows: ' + (manifest.readiness?.externalRequired?.length ?? 0))
85
+ lines.push('- Native slash-command records: ' + (manifest.hostRuntime?.nativeSlashCommandRecords ?? 'unknown'))
86
+ lines.push('- Portable text-command records: ' + (manifest.hostRuntime?.portableTextCommandRecords ?? 'unknown'))
87
+ lines.push('')
88
+ lines.push('## Claim Boundary')
89
+ lines.push('')
90
+ lines.push('- Local validation does not mean public acceptance.')
91
+ lines.push('- Native slash-command support requires a real host invocation record.')
92
+ lines.push('- Owner and external gates must be recorded with accepted evidence before GSE can claim accepted public release readiness.')
93
+ lines.push('')
94
+ lines.push('## Action Groups')
95
+ lines.push('')
96
+ if (groups.length === 0) {
97
+ lines.push('No pending owner or external gates were reported by the manifest.')
98
+ lines.push('')
99
+ }
100
+ for (const [owner, gates] of groups) {
101
+ lines.push('### ' + ownerDisplay(owner))
102
+ lines.push('')
103
+ for (const gate of gates) {
104
+ lines.push('#### ' + gate.area)
105
+ lines.push('')
106
+ lines.push('- Status: ' + gate.status)
107
+ lines.push('- Current evidence: ' + gate.currentEvidence)
108
+ lines.push('- Required evidence: ' + gate.requiredEvidence)
109
+ lines.push('- Record command:')
110
+ lines.push('')
111
+ lines.push('```text')
112
+ lines.push(gate.recordCommand)
113
+ lines.push('```')
114
+ lines.push('')
115
+ lines.push('- Preflight command:')
116
+ lines.push('')
117
+ lines.push('```text')
118
+ lines.push(gate.preflightCommand ?? `${gate.recordCommand} --dry-run --json`)
119
+ lines.push('```')
120
+ lines.push('')
121
+ }
122
+ }
123
+ lines.push('## Verification After Actions')
124
+ lines.push('')
125
+ for (const command of manifest.verificationCommands ?? []) {
126
+ lines.push('- `' + command + '`')
127
+ }
128
+ lines.push('- `node scripts/generate-release-status-manifest.mjs --root __GSE__ --out __GSE__/.gse/acceptance/release-status-manifest.json --force --json`')
129
+ lines.push('- `node scripts/generate-release-owner-action-plan.mjs --root __GSE__ --force --json`')
130
+ lines.push('- `node scripts/audit-release-owner-action-plan.mjs --root __GSE__ --json`')
131
+ lines.push('')
132
+ lines.push('## Limits')
133
+ lines.push('')
134
+ lines.push('- This plan is generated from the current release status manifest.')
135
+ lines.push('- It does not select a license, publish a package, configure a repository, run public CI, approve a marketplace listing, or prove host-native slash-command support.')
136
+ return lines.join('\n') + '\n'
137
+ }
138
+
139
+ let manifest
140
+ let content
141
+ try {
142
+ manifest = readJson(manifestPath, 'release status manifest')
143
+ content = render(manifest)
144
+ } catch (error) {
145
+ console.error(JSON.stringify({ status: 'failed', root, manifest: manifestPath, out, error: error.message }, null, 2))
146
+ process.exit(1)
147
+ }
148
+
149
+ if (!dryRun) {
150
+ if (fs.existsSync(out) && !force) {
151
+ console.error(JSON.stringify({ status: 'exists', root, manifest: manifestPath, out, error: 'output exists; pass --force to overwrite' }, null, 2))
152
+ process.exit(1)
153
+ }
154
+ fs.mkdirSync(path.dirname(out), { recursive: true })
155
+ fs.writeFileSync(out, content, 'utf8')
156
+ }
157
+
158
+ const report = {
159
+ status: dryRun ? 'ready' : 'written',
160
+ root,
161
+ manifest: manifestPath,
162
+ out,
163
+ dryRun,
164
+ summary: {
165
+ publicAccepted: manifest.publicAcceptance?.publicAccepted ?? manifest.claimBoundary?.publicAccepted ?? 'unknown',
166
+ actionGroups: groupByOwner(manifest.publicAcceptance?.pendingGates ?? []).length,
167
+ pendingGates: manifest.publicAcceptance?.pendingGates?.length ?? 0,
168
+ },
169
+ }
170
+
171
+ if (jsonOnly) console.log(JSON.stringify(report, null, 2))
172
+ else console.log(content)