@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.
Files changed (180) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +42 -42
  2. package/.github/ISSUE_TEMPLATE/change_request.yml +50 -50
  3. package/.github/ISSUE_TEMPLATE/config.yml +5 -5
  4. package/.github/PULL_REQUEST_TEMPLATE.md +38 -38
  5. package/.github/workflows/validate-gse.yml +33 -33
  6. package/.gse/README.md +18 -18
  7. package/.gse/gse-development-protocol.md +50 -50
  8. package/.gse/project-profile.md +29 -29
  9. package/.gse/quality-gates.md +25 -25
  10. package/.gse/releases/public-registry-publication-npm.md +49 -0
  11. package/.gse/releases/public-release-owner-required.md +65 -65
  12. package/.gse/releases/public-security-contact-owner-required.md +45 -45
  13. package/.gse/state.json +3 -4
  14. package/CHANGELOG.md +24 -24
  15. package/CONTRIBUTING.md +64 -64
  16. package/LICENSE +21 -21
  17. package/README.md +1 -1
  18. package/README.zh-CN.md +1 -1
  19. package/SECURITY.md +41 -41
  20. package/SUPPORT.md +38 -38
  21. package/assets/marketplace/README.md +7 -7
  22. package/assets/marketplace/gse-listing.json +75 -75
  23. package/assets/templates/acceptance-execution-packet.md +73 -73
  24. package/assets/templates/adr.md +14 -14
  25. package/assets/templates/change-brief.md +16 -16
  26. package/assets/templates/design.md +18 -18
  27. package/assets/templates/dispatch-packet.md +104 -104
  28. package/assets/templates/evidence.md +14 -14
  29. package/assets/templates/execution-quality-pack.md +65 -65
  30. package/assets/templates/goal-map.md +21 -21
  31. package/assets/templates/host-adapter.md +48 -48
  32. package/assets/templates/host-ui-invocation-record.md +42 -42
  33. package/assets/templates/incident-review.md +60 -60
  34. package/assets/templates/public-channel-publication-record.md +49 -49
  35. package/assets/templates/public-ci-run-record.md +53 -53
  36. package/assets/templates/public-release-record.md +65 -65
  37. package/assets/templates/public-repository-settings-record.md +59 -59
  38. package/assets/templates/public-security-contact-record.md +45 -45
  39. package/assets/templates/release-trust-record.md +32 -32
  40. package/assets/templates/review.md +18 -18
  41. package/assets/templates/spec.md +16 -16
  42. package/assets/templates/target-adoption-evidence.md +29 -29
  43. package/assets/templates/tasks.md +17 -17
  44. package/assets/templates/update-release-acceptance-record.md +58 -58
  45. package/examples/README.md +22 -22
  46. package/examples/agent-runtime-host/.claude/gse-adapter.md +6 -6
  47. package/examples/agent-runtime-host/.codex/gse-adapter.md +7 -7
  48. package/examples/agent-runtime-host/.gse/goal-map.md +7 -7
  49. package/examples/agent-runtime-host/.gse/project-profile.md +27 -27
  50. package/examples/agent-runtime-host/.gse/tooling.md +5 -5
  51. package/examples/agent-runtime-host/.mcp.json +9 -9
  52. package/examples/agent-runtime-host/AGENTS.md +5 -5
  53. package/examples/agent-runtime-host/README.md +10 -10
  54. package/examples/agent-runtime-host/docs/model-routing.md +5 -5
  55. package/examples/cli-tool/.gse/project-profile.md +21 -21
  56. package/examples/cli-tool/AGENTS.md +5 -5
  57. package/examples/cli-tool/README.md +12 -12
  58. package/examples/cli-tool/package.json +21 -21
  59. package/examples/small-app/.env.example +2 -2
  60. package/examples/small-app/.github/workflows/ci.yml +8 -8
  61. package/examples/small-app/AGENTS.md +5 -5
  62. package/examples/small-app/README.md +12 -12
  63. package/examples/small-app/package.json +26 -26
  64. package/examples/small-app/playwright.config.ts +4 -4
  65. package/package.json +53 -53
  66. package/references/adoption-recipes.md +171 -171
  67. package/references/agent-roles.md +49 -49
  68. package/references/architecture-health.md +101 -101
  69. package/references/benchmark-audit.md +73 -73
  70. package/references/community-channels.md +46 -46
  71. package/references/compatibility.md +70 -70
  72. package/references/design-basis.md +38 -38
  73. package/references/domain-model.md +129 -129
  74. package/references/domain-quality-gates.md +75 -75
  75. package/references/drift-audit.md +81 -81
  76. package/references/evidence-taxonomy.md +123 -123
  77. package/references/file-ownership.md +107 -107
  78. package/references/final-readiness.md +84 -84
  79. package/references/forward-test.md +133 -133
  80. package/references/goal-map.md +36 -36
  81. package/references/host-adapters.md +119 -119
  82. package/references/learning-system.md +35 -35
  83. package/references/marketplace-discovery.md +46 -46
  84. package/references/model-routing.md +103 -103
  85. package/references/open-source-defaults.md +39 -39
  86. package/references/operating-model.md +52 -52
  87. package/references/packaging.md +277 -277
  88. package/references/project-agent-workspace.md +89 -89
  89. package/references/project-bootstrap.md +122 -122
  90. package/references/project-profile.md +57 -57
  91. package/references/public-release.md +174 -174
  92. package/references/quality-gates.md +100 -100
  93. package/references/recovery.md +176 -176
  94. package/references/release-trust.md +43 -43
  95. package/references/release.md +126 -126
  96. package/references/review.md +141 -141
  97. package/references/router.md +90 -90
  98. package/references/spec-workflow.md +66 -66
  99. package/references/task-levels.md +81 -81
  100. package/references/tool-adapters.md +73 -73
  101. package/scripts/audit-acceptance-execution-packet.mjs +133 -133
  102. package/scripts/audit-adoption-recipes.mjs +99 -99
  103. package/scripts/audit-change-lifecycle.mjs +77 -77
  104. package/scripts/audit-change-system.mjs +134 -134
  105. package/scripts/audit-ci-readiness.mjs +107 -107
  106. package/scripts/audit-close-gate.mjs +323 -323
  107. package/scripts/audit-command-adapters.mjs +91 -91
  108. package/scripts/audit-command-execution.mjs +210 -210
  109. package/scripts/audit-compatibility.mjs +149 -149
  110. package/scripts/audit-completion-readiness.mjs +292 -292
  111. package/scripts/audit-distribution.mjs +251 -251
  112. package/scripts/audit-domain-quality-gates.mjs +108 -108
  113. package/scripts/audit-evidence-placeholders.mjs +126 -126
  114. package/scripts/audit-final-readiness-promotion.mjs +255 -255
  115. package/scripts/audit-final-readiness.mjs +226 -226
  116. package/scripts/audit-fixtures.mjs +154 -154
  117. package/scripts/audit-fresh-session-readiness.mjs +177 -177
  118. package/scripts/audit-host-runtime-evidence-handoff.mjs +159 -159
  119. package/scripts/audit-host-runtime-invocation-drill.mjs +240 -240
  120. package/scripts/audit-host-runtime-invocations.mjs +254 -254
  121. package/scripts/audit-host-ui-invocation.mjs +132 -132
  122. package/scripts/audit-marketplace-discovery.mjs +122 -122
  123. package/scripts/audit-npm-package-metadata.mjs +155 -155
  124. package/scripts/audit-npm-publish-dry-run.mjs +191 -169
  125. package/scripts/audit-npm-tarball-install.mjs +191 -191
  126. package/scripts/audit-open-source-defaults.mjs +92 -92
  127. package/scripts/audit-open-source-readiness.mjs +97 -97
  128. package/scripts/audit-project.mjs +138 -138
  129. package/scripts/audit-public-acceptance-command-dry-run-drill.mjs +203 -203
  130. package/scripts/audit-public-acceptance-readiness.mjs +224 -224
  131. package/scripts/audit-public-channel-publication.mjs +248 -248
  132. package/scripts/audit-public-ci-run.mjs +184 -184
  133. package/scripts/audit-public-collaboration-templates.mjs +98 -98
  134. package/scripts/audit-public-external-gate-probe.mjs +206 -206
  135. package/scripts/audit-public-release-decision.mjs +201 -201
  136. package/scripts/audit-public-release-metadata.mjs +176 -176
  137. package/scripts/audit-public-repository-settings.mjs +237 -237
  138. package/scripts/audit-public-security-contact.mjs +171 -171
  139. package/scripts/audit-readme-docs.mjs +6 -4
  140. package/scripts/audit-recovery-readiness.mjs +98 -98
  141. package/scripts/audit-release-readiness.mjs +106 -106
  142. package/scripts/audit-release-trust.mjs +62 -62
  143. package/scripts/audit-remote-distribution.mjs +266 -266
  144. package/scripts/audit-roadmap-consistency.mjs +235 -235
  145. package/scripts/audit-signing.mjs +147 -147
  146. package/scripts/audit-state-freshness.mjs +14 -9
  147. package/scripts/audit-target-adoption-evidence.mjs +117 -117
  148. package/scripts/audit-target-project.mjs +507 -507
  149. package/scripts/audit-update-release-acceptance.mjs +136 -136
  150. package/scripts/audit-v1-target-validation.mjs +269 -269
  151. package/scripts/audit-validation-profiles.mjs +125 -125
  152. package/scripts/close-change.mjs +116 -116
  153. package/scripts/discover-project-profile.mjs +307 -307
  154. package/scripts/generate-command-adapter.mjs +231 -231
  155. package/scripts/generate-final-acceptance-packet.mjs +181 -181
  156. package/scripts/generate-final-form-progress-report.mjs +205 -205
  157. package/scripts/generate-host-runtime-evidence-handoff.mjs +206 -206
  158. package/scripts/generate-owner-external-gate-kit.mjs +295 -295
  159. package/scripts/generate-public-acceptance-handoff.mjs +168 -168
  160. package/scripts/generate-public-release-checklist.mjs +207 -207
  161. package/scripts/generate-release-bundle.mjs +505 -505
  162. package/scripts/generate-release-owner-action-plan.mjs +172 -172
  163. package/scripts/generate-release-status-manifest.mjs +200 -200
  164. package/scripts/generate-session-prompt.mjs +188 -188
  165. package/scripts/gse.mjs +67 -67
  166. package/scripts/init-change.mjs +265 -265
  167. package/scripts/init-project.mjs +785 -785
  168. package/scripts/install-gse.mjs +234 -234
  169. package/scripts/lib/evidence-placeholders.mjs +28 -28
  170. package/scripts/package-gse.mjs +174 -174
  171. package/scripts/probe-public-external-gates.mjs +167 -167
  172. package/scripts/record-host-invocation.mjs +151 -151
  173. package/scripts/record-public-channel-publication.mjs +178 -178
  174. package/scripts/record-public-ci-run.mjs +180 -180
  175. package/scripts/record-public-release.mjs +175 -175
  176. package/scripts/record-public-repository-settings.mjs +209 -209
  177. package/scripts/record-public-security-contact.mjs +157 -157
  178. package/scripts/sign-gse-package.mjs +83 -83
  179. package/scripts/update-project-state.mjs +223 -223
  180. package/scripts/verify-gse-package.mjs +85 -85
@@ -1,133 +1,133 @@
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/acceptance-execution-packet.md')
30
- const forwardTest = read('references/forward-test.md')
31
- const recipes = read('references/adoption-recipes.md')
32
- const validate = read('scripts/validate-gse.mjs')
33
-
34
- const fields = [
35
- 'Acceptance path:',
36
- 'Target project or session:',
37
- 'Purpose:',
38
- 'Required inputs:',
39
- 'Allowed files:',
40
- 'Forbidden files:',
41
- 'Allowed commands:',
42
- 'Forbidden commands:',
43
- 'Expected output:',
44
- 'Evidence record path:',
45
- 'Acceptance gate:',
46
- 'Accepted by:',
47
- 'Stop conditions:',
48
- 'Residual risk if incomplete:',
49
- 'Next action after completion:',
50
- ]
51
-
52
- const freshInputs = [
53
- 'SKILL.md',
54
- '.gse/gse-design-master-plan.md',
55
- '.gse/goal-map.md',
56
- '.gse/current-slice.md',
57
- 'references/forward-test.md',
58
- 'references/evidence-taxonomy.md',
59
- ]
60
-
61
- const projectInputs = [
62
- 'Project owner approval text or issue/task link.',
63
- 'references/adoption-recipes.md',
64
- 'assets/templates/target-adoption-evidence.md',
65
- 'assets/templates/update-release-acceptance-record.md',
66
- ]
67
-
68
- const antiOverclaim = [
69
- 'Do not write `Accepted by: fresh-session` unless a separate session actually ran the packet.',
70
- 'Do not write `Accepted by: owner` unless owner approval is explicit and recorded.',
71
- 'Do not treat a generated packet, local validation, fixture audit, or read-only discovery as acceptance.',
72
- 'Evidence status: not ready',
73
- 'Accepted by: not accepted',
74
- ]
75
-
76
- const checks = [
77
- check('AEP01', 'acceptance execution packet template exists', exists('assets/templates/acceptance-execution-packet.md'), 'assets/templates/acceptance-execution-packet.md'),
78
- check('AEP02', 'packet captures execution boundaries', fields.every((item) => template.includes(item)), fields.join(', ')),
79
- check('AEP03', 'fresh-session path uses documented GSE inputs', freshInputs.every((item) => template.includes(item)), freshInputs.join(', ')),
80
- check('AEP04', 'owner-approved path requires explicit owner evidence and project templates', projectInputs.every((item) => template.includes(item)), projectInputs.join(', ')),
81
- check('AEP05', 'packet limits default project writes to .gse artifacts', template.includes('.gse/project-profile.md') && template.includes('.gse/evidence/YYYY-MM-DD.md') && template.includes('Source code, lockfiles, secrets'), 'allowed and forbidden file sections'),
82
- check('AEP06', 'packet prevents fake acceptance', antiOverclaim.every((item) => template.includes(item)), 'anti-overclaim rules'),
83
- check('AEP07', 'forward-test reference supports fresh-session acceptance boundary', forwardTest.includes('Use `accepted by: fresh-session` only when a separate agent/session actually ran the path.'), 'references/forward-test.md'),
84
- check('AEP08', 'adoption recipes support target adoption evidence template', recipes.includes('assets/templates/target-adoption-evidence.md'), 'references/adoption-recipes.md'),
85
- check('AEP09', 'consolidated validator includes this audit', validate.includes('audit-acceptance-execution-packet.mjs'), 'scripts/validate-gse.mjs'),
86
- ]
87
-
88
- const passed = checks.filter((item) => item.status === 'passed').length
89
- const failed = checks.length - passed
90
- const report = {
91
- root,
92
- generatedAt: new Date().toISOString(),
93
- summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
94
- workflows: { acceptanceExecutionPacket: failed === 0 ? 'verified' : 'failed' },
95
- acceptedBy: 'not accepted; this audit verifies packet readiness only',
96
- limits: [
97
- 'This audit verifies acceptance packet readiness only.',
98
- 'It does not create a separate session, write to a target project, or record owner acceptance.',
99
- ],
100
- checks,
101
- }
102
-
103
- function renderMarkdown(data) {
104
- const lines = []
105
- lines.push('# GSE Acceptance Execution Packet Audit')
106
- lines.push('')
107
- lines.push('Generated: ' + data.generatedAt)
108
- lines.push('Root: ' + data.root)
109
- lines.push('')
110
- lines.push('## Summary')
111
- lines.push('')
112
- lines.push('- Status: ' + data.summary.status)
113
- lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
114
- lines.push('- Acceptance execution packet: ' + data.workflows.acceptanceExecutionPacket)
115
- lines.push('- Accepted by: ' + data.acceptedBy)
116
- lines.push('')
117
- lines.push('## Checks')
118
- lines.push('')
119
- for (const item of data.checks) {
120
- const marker = item.status === 'passed' ? '[x]' : '[ ]'
121
- lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
122
- }
123
- lines.push('')
124
- lines.push('## Limits')
125
- lines.push('')
126
- for (const item of data.limits) lines.push('- ' + item)
127
- return lines.join('\n') + '\n'
128
- }
129
-
130
- if (jsonOnly) console.log(JSON.stringify(report, null, 2))
131
- else console.log(renderMarkdown(report))
132
-
133
- 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/acceptance-execution-packet.md')
30
+ const forwardTest = read('references/forward-test.md')
31
+ const recipes = read('references/adoption-recipes.md')
32
+ const validate = read('scripts/validate-gse.mjs')
33
+
34
+ const fields = [
35
+ 'Acceptance path:',
36
+ 'Target project or session:',
37
+ 'Purpose:',
38
+ 'Required inputs:',
39
+ 'Allowed files:',
40
+ 'Forbidden files:',
41
+ 'Allowed commands:',
42
+ 'Forbidden commands:',
43
+ 'Expected output:',
44
+ 'Evidence record path:',
45
+ 'Acceptance gate:',
46
+ 'Accepted by:',
47
+ 'Stop conditions:',
48
+ 'Residual risk if incomplete:',
49
+ 'Next action after completion:',
50
+ ]
51
+
52
+ const freshInputs = [
53
+ 'SKILL.md',
54
+ '.gse/gse-design-master-plan.md',
55
+ '.gse/goal-map.md',
56
+ '.gse/current-slice.md',
57
+ 'references/forward-test.md',
58
+ 'references/evidence-taxonomy.md',
59
+ ]
60
+
61
+ const projectInputs = [
62
+ 'Project owner approval text or issue/task link.',
63
+ 'references/adoption-recipes.md',
64
+ 'assets/templates/target-adoption-evidence.md',
65
+ 'assets/templates/update-release-acceptance-record.md',
66
+ ]
67
+
68
+ const antiOverclaim = [
69
+ 'Do not write `Accepted by: fresh-session` unless a separate session actually ran the packet.',
70
+ 'Do not write `Accepted by: owner` unless owner approval is explicit and recorded.',
71
+ 'Do not treat a generated packet, local validation, fixture audit, or read-only discovery as acceptance.',
72
+ 'Evidence status: not ready',
73
+ 'Accepted by: not accepted',
74
+ ]
75
+
76
+ const checks = [
77
+ check('AEP01', 'acceptance execution packet template exists', exists('assets/templates/acceptance-execution-packet.md'), 'assets/templates/acceptance-execution-packet.md'),
78
+ check('AEP02', 'packet captures execution boundaries', fields.every((item) => template.includes(item)), fields.join(', ')),
79
+ check('AEP03', 'fresh-session path uses documented GSE inputs', freshInputs.every((item) => template.includes(item)), freshInputs.join(', ')),
80
+ check('AEP04', 'owner-approved path requires explicit owner evidence and project templates', projectInputs.every((item) => template.includes(item)), projectInputs.join(', ')),
81
+ check('AEP05', 'packet limits default project writes to .gse artifacts', template.includes('.gse/project-profile.md') && template.includes('.gse/evidence/YYYY-MM-DD.md') && template.includes('Source code, lockfiles, secrets'), 'allowed and forbidden file sections'),
82
+ check('AEP06', 'packet prevents fake acceptance', antiOverclaim.every((item) => template.includes(item)), 'anti-overclaim rules'),
83
+ check('AEP07', 'forward-test reference supports fresh-session acceptance boundary', forwardTest.includes('Use `accepted by: fresh-session` only when a separate agent/session actually ran the path.'), 'references/forward-test.md'),
84
+ check('AEP08', 'adoption recipes support target adoption evidence template', recipes.includes('assets/templates/target-adoption-evidence.md'), 'references/adoption-recipes.md'),
85
+ check('AEP09', 'consolidated validator includes this audit', validate.includes('audit-acceptance-execution-packet.mjs'), 'scripts/validate-gse.mjs'),
86
+ ]
87
+
88
+ const passed = checks.filter((item) => item.status === 'passed').length
89
+ const failed = checks.length - passed
90
+ const report = {
91
+ root,
92
+ generatedAt: new Date().toISOString(),
93
+ summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
94
+ workflows: { acceptanceExecutionPacket: failed === 0 ? 'verified' : 'failed' },
95
+ acceptedBy: 'not accepted; this audit verifies packet readiness only',
96
+ limits: [
97
+ 'This audit verifies acceptance packet readiness only.',
98
+ 'It does not create a separate session, write to a target project, or record owner acceptance.',
99
+ ],
100
+ checks,
101
+ }
102
+
103
+ function renderMarkdown(data) {
104
+ const lines = []
105
+ lines.push('# GSE Acceptance Execution Packet Audit')
106
+ lines.push('')
107
+ lines.push('Generated: ' + data.generatedAt)
108
+ lines.push('Root: ' + data.root)
109
+ lines.push('')
110
+ lines.push('## Summary')
111
+ lines.push('')
112
+ lines.push('- Status: ' + data.summary.status)
113
+ lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
114
+ lines.push('- Acceptance execution packet: ' + data.workflows.acceptanceExecutionPacket)
115
+ lines.push('- Accepted by: ' + data.acceptedBy)
116
+ lines.push('')
117
+ lines.push('## Checks')
118
+ lines.push('')
119
+ for (const item of data.checks) {
120
+ const marker = item.status === 'passed' ? '[x]' : '[ ]'
121
+ lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
122
+ }
123
+ lines.push('')
124
+ lines.push('## Limits')
125
+ lines.push('')
126
+ for (const item of data.limits) lines.push('- ' + item)
127
+ return lines.join('\n') + '\n'
128
+ }
129
+
130
+ if (jsonOnly) console.log(JSON.stringify(report, null, 2))
131
+ else console.log(renderMarkdown(report))
132
+
133
+ if (failed > 0) process.exit(1)
@@ -1,99 +1,99 @@
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 recipes = read('references/adoption-recipes.md')
30
- const skill = read('SKILL.md')
31
- const bootstrap = read('references/project-bootstrap.md')
32
- const packaging = read('references/packaging.md')
33
- const examples = read('examples/README.md')
34
-
35
- const recipeNames = ['Fresh Project Install', 'Existing Repo Adoption', 'Update Existing GSE', 'Host Adapter Adoption', 'CLI Or Package Project Adoption']
36
- const recordFields = ['Adoption recipe:', 'Project path:', 'Mode or host:', 'Project rules read:', 'Commands run:', 'Files created or changed:', 'Preserved project-specific rules:', 'Host/tool statuses:', 'Validation evidence:', 'Evidence status:', 'Residual risk:', 'Next action:']
37
- const commands = ['init-project.mjs', 'discover-project-profile.mjs', 'generate-command-adapter.mjs', 'audit-command-adapters.mjs', 'generate-host-adapter.mjs', 'audit-project.mjs', 'audit-adoption.mjs', 'audit-host-adapters.mjs', 'audit-fixtures.mjs', 'validate-gse.mjs']
38
- const statusTerms = ['result', 'verified', 'accepted', 'not ready', 'unknown', 'documented', 'unavailable']
39
-
40
- const checks = [
41
- check('AR01', 'adoption recipes reference exists', exists('references/adoption-recipes.md'), 'references/adoption-recipes.md'),
42
- check('AR02', 'SKILL routes adoption recipes', skill.includes('references/adoption-recipes.md'), 'SKILL.md Reference Routing'),
43
- check('AR03', 'bootstrap, packaging, and examples route to recipes', bootstrap.includes('references/adoption-recipes.md') && packaging.includes('references/adoption-recipes.md') && examples.includes('references/adoption-recipes.md'), 'project-bootstrap.md, packaging.md, examples/README.md'),
44
- check('AR04', 'core adoption recipes are present', recipeNames.every((item) => recipes.includes(item)), recipeNames.join(', ')),
45
- check('AR05', 'fresh install includes mode selection and init command', recipes.includes('--mode <mode>') && recipes.includes('node <gse-skill>/scripts/init-project.mjs --target <project-root> --mode <mode>'), 'Fresh Project Install'),
46
- check('AR06', 'existing repo adoption protects pre-existing project files', recipes.includes('Do not overwrite') && recipes.includes('--force') && recipes.includes('documented`, not `verified`'), 'Existing Repo Adoption'),
47
- check('AR07', 'update recipe preserves local decisions and validates skill package', recipes.includes('Preserve local project decisions') && recipes.includes('node <gse-skill>/scripts/validate-gse.mjs --root <gse-skill>'), 'Update Existing GSE'),
48
- check('AR08', 'host adapter recipe uses current command adapter path and keeps .gse source of truth', recipes.includes('Keep `.gse/` as the source of truth') && recipes.includes('generate-command-adapter.mjs') && recipes.includes('claude|codex|hermes|workbuddy|copilot|gemini|generic|all') && recipes.includes('legacy fixture helper') && recipes.includes('verified`, `documented`, `unknown`, or `unavailable`'), 'Host Adapter Adoption'),
49
- check('AR09', 'adoption record has required fields', recordFields.every((item) => recipes.includes(item)), recordFields.join(', ')),
50
- check('AR10', 'verification command list covers adoption scripts', commands.every((item) => recipes.includes(item)), commands.join(', ')),
51
- check('AR11', 'status vocabulary avoids overclaiming', statusTerms.every((item) => recipes.includes(item)) && recipes.includes('do not certify arbitrary production repositories'), 'status and certification boundary'),
52
- check('AR12', 'recipes are host-neutral and require project evidence', recipes.includes('host-neutral') && recipes.includes('project-specific evidence') && recipes.includes('unknown` until checked'), 'host-neutral project evidence rules'),
53
- check('AR13', 'CLI/package adoption keeps release and install claims evidence-bound', recipes.includes('CLI Or Package Project Adoption') && recipes.includes('npm pack --dry-run') && recipes.includes('registry access') && recipes.includes('global install') && recipes.includes('shell completion require project-specific evidence'), 'CLI/package adoption recipe'),
54
- ]
55
-
56
- const passed = checks.filter((item) => item.status === 'passed').length
57
- const failed = checks.length - passed
58
- const report = {
59
- root,
60
- generatedAt: new Date().toISOString(),
61
- summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
62
- workflows: { adoptionRecipes: failed === 0 ? 'verified' : 'failed' },
63
- limits: [
64
- 'Adoption recipe audit verifies reusable recipe coverage and routing; it does not install GSE into arbitrary production repositories.',
65
- 'Real adoption still needs project-specific inspection, focused smokes, and host/tool evidence.',
66
- ],
67
- checks,
68
- }
69
-
70
- function renderMarkdown(data) {
71
- const lines = []
72
- lines.push('# GSE Adoption Recipe Audit')
73
- lines.push('')
74
- lines.push('Generated: ' + data.generatedAt)
75
- lines.push('Root: ' + data.root)
76
- lines.push('')
77
- lines.push('## Summary')
78
- lines.push('')
79
- lines.push('- Status: ' + data.summary.status)
80
- lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
81
- lines.push('- Adoption recipes: ' + data.workflows.adoptionRecipes)
82
- lines.push('')
83
- lines.push('## Checks')
84
- lines.push('')
85
- for (const item of data.checks) {
86
- const marker = item.status === 'passed' ? '[x]' : '[ ]'
87
- lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
88
- }
89
- lines.push('')
90
- lines.push('## Limits')
91
- lines.push('')
92
- for (const item of data.limits) lines.push('- ' + item)
93
- return lines.join('\n') + '\n'
94
- }
95
-
96
- if (jsonOnly) console.log(JSON.stringify(report, null, 2))
97
- else console.log(renderMarkdown(report))
98
-
99
- 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 recipes = read('references/adoption-recipes.md')
30
+ const skill = read('SKILL.md')
31
+ const bootstrap = read('references/project-bootstrap.md')
32
+ const packaging = read('references/packaging.md')
33
+ const examples = read('examples/README.md')
34
+
35
+ const recipeNames = ['Fresh Project Install', 'Existing Repo Adoption', 'Update Existing GSE', 'Host Adapter Adoption', 'CLI Or Package Project Adoption']
36
+ const recordFields = ['Adoption recipe:', 'Project path:', 'Mode or host:', 'Project rules read:', 'Commands run:', 'Files created or changed:', 'Preserved project-specific rules:', 'Host/tool statuses:', 'Validation evidence:', 'Evidence status:', 'Residual risk:', 'Next action:']
37
+ const commands = ['init-project.mjs', 'discover-project-profile.mjs', 'generate-command-adapter.mjs', 'audit-command-adapters.mjs', 'generate-host-adapter.mjs', 'audit-project.mjs', 'audit-adoption.mjs', 'audit-host-adapters.mjs', 'audit-fixtures.mjs', 'validate-gse.mjs']
38
+ const statusTerms = ['result', 'verified', 'accepted', 'not ready', 'unknown', 'documented', 'unavailable']
39
+
40
+ const checks = [
41
+ check('AR01', 'adoption recipes reference exists', exists('references/adoption-recipes.md'), 'references/adoption-recipes.md'),
42
+ check('AR02', 'SKILL routes adoption recipes', skill.includes('references/adoption-recipes.md'), 'SKILL.md Reference Routing'),
43
+ check('AR03', 'bootstrap, packaging, and examples route to recipes', bootstrap.includes('references/adoption-recipes.md') && packaging.includes('references/adoption-recipes.md') && examples.includes('references/adoption-recipes.md'), 'project-bootstrap.md, packaging.md, examples/README.md'),
44
+ check('AR04', 'core adoption recipes are present', recipeNames.every((item) => recipes.includes(item)), recipeNames.join(', ')),
45
+ check('AR05', 'fresh install includes mode selection and init command', recipes.includes('--mode <mode>') && recipes.includes('node <gse-skill>/scripts/init-project.mjs --target <project-root> --mode <mode>'), 'Fresh Project Install'),
46
+ check('AR06', 'existing repo adoption protects pre-existing project files', recipes.includes('Do not overwrite') && recipes.includes('--force') && recipes.includes('documented`, not `verified`'), 'Existing Repo Adoption'),
47
+ check('AR07', 'update recipe preserves local decisions and validates skill package', recipes.includes('Preserve local project decisions') && recipes.includes('node <gse-skill>/scripts/validate-gse.mjs --root <gse-skill>'), 'Update Existing GSE'),
48
+ check('AR08', 'host adapter recipe uses current command adapter path and keeps .gse source of truth', recipes.includes('Keep `.gse/` as the source of truth') && recipes.includes('generate-command-adapter.mjs') && recipes.includes('claude|codex|hermes|workbuddy|copilot|gemini|generic|all') && recipes.includes('legacy fixture helper') && recipes.includes('verified`, `documented`, `unknown`, or `unavailable`'), 'Host Adapter Adoption'),
49
+ check('AR09', 'adoption record has required fields', recordFields.every((item) => recipes.includes(item)), recordFields.join(', ')),
50
+ check('AR10', 'verification command list covers adoption scripts', commands.every((item) => recipes.includes(item)), commands.join(', ')),
51
+ check('AR11', 'status vocabulary avoids overclaiming', statusTerms.every((item) => recipes.includes(item)) && recipes.includes('do not certify arbitrary production repositories'), 'status and certification boundary'),
52
+ check('AR12', 'recipes are host-neutral and require project evidence', recipes.includes('host-neutral') && recipes.includes('project-specific evidence') && recipes.includes('unknown` until checked'), 'host-neutral project evidence rules'),
53
+ check('AR13', 'CLI/package adoption keeps release and install claims evidence-bound', recipes.includes('CLI Or Package Project Adoption') && recipes.includes('npm pack --dry-run') && recipes.includes('registry access') && recipes.includes('global install') && recipes.includes('shell completion require project-specific evidence'), 'CLI/package adoption recipe'),
54
+ ]
55
+
56
+ const passed = checks.filter((item) => item.status === 'passed').length
57
+ const failed = checks.length - passed
58
+ const report = {
59
+ root,
60
+ generatedAt: new Date().toISOString(),
61
+ summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
62
+ workflows: { adoptionRecipes: failed === 0 ? 'verified' : 'failed' },
63
+ limits: [
64
+ 'Adoption recipe audit verifies reusable recipe coverage and routing; it does not install GSE into arbitrary production repositories.',
65
+ 'Real adoption still needs project-specific inspection, focused smokes, and host/tool evidence.',
66
+ ],
67
+ checks,
68
+ }
69
+
70
+ function renderMarkdown(data) {
71
+ const lines = []
72
+ lines.push('# GSE Adoption Recipe Audit')
73
+ lines.push('')
74
+ lines.push('Generated: ' + data.generatedAt)
75
+ lines.push('Root: ' + data.root)
76
+ lines.push('')
77
+ lines.push('## Summary')
78
+ lines.push('')
79
+ lines.push('- Status: ' + data.summary.status)
80
+ lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
81
+ lines.push('- Adoption recipes: ' + data.workflows.adoptionRecipes)
82
+ lines.push('')
83
+ lines.push('## Checks')
84
+ lines.push('')
85
+ for (const item of data.checks) {
86
+ const marker = item.status === 'passed' ? '[x]' : '[ ]'
87
+ lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
88
+ }
89
+ lines.push('')
90
+ lines.push('## Limits')
91
+ lines.push('')
92
+ for (const item of data.limits) lines.push('- ' + item)
93
+ return lines.join('\n') + '\n'
94
+ }
95
+
96
+ if (jsonOnly) console.log(JSON.stringify(report, null, 2))
97
+ else console.log(renderMarkdown(report))
98
+
99
+ if (failed > 0) process.exit(1)
@@ -1,77 +1,77 @@
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
- const target = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-change-lifecycle-'))
18
- const initScript = path.join(root, 'scripts', 'init-change.mjs')
19
- const closeScript = path.join(root, 'scripts', 'close-change.mjs')
20
-
21
- function run(script, commandArgs) {
22
- return spawnSync(process.execPath, [script, ...commandArgs], { cwd: root, encoding: 'utf8', windowsHide: true })
23
- }
24
-
25
- function parseJson(text) {
26
- try { return JSON.parse(text) } catch { return null }
27
- }
28
-
29
- function check(id, label, ok, evidence, risk = '') {
30
- return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
31
- }
32
-
33
- fs.mkdirSync(path.join(target, '.gse', 'evidence'), { recursive: true })
34
- fs.writeFileSync(path.join(target, '.gse', 'goal-map.md'), '# Goal Map\n', 'utf8')
35
- fs.writeFileSync(path.join(target, '.gse', 'quality-gates.md'), '# Quality Gates\n', 'utf8')
36
- fs.writeFileSync(path.join(target, '.gse', 'evidence', 'index.jsonl'), '', 'utf8')
37
-
38
- const init = run(initScript, ['--target', target, '--change-id', 'Archive Me', '--level', 'standard', '--json'])
39
- const dryRun = run(closeScript, ['--target', target, '--change-id', 'archive-me', '--status', 'verified', '--date', '2026-07-06', '--dry-run', '--json'])
40
- const dryRunPreservedSource = fs.existsSync(path.join(target, '.gse', 'changes', 'archive-me'))
41
- const close = run(closeScript, ['--target', target, '--change-id', 'archive-me', '--status', 'verified', '--date', '2026-07-06', '--json'])
42
- const closeJson = parseJson(close.stdout)
43
- const archiveDir = path.join(target, '.gse', 'archive', '2026-07-06-archive-me')
44
- const sourceDir = path.join(target, '.gse', 'changes', 'archive-me')
45
- const indexText = fs.readFileSync(path.join(target, '.gse', 'evidence', 'index.jsonl'), 'utf8')
46
- const archiveRecord = fs.existsSync(path.join(archiveDir, 'archive-record.md')) ? fs.readFileSync(path.join(archiveDir, 'archive-record.md'), 'utf8') : ''
47
-
48
- const checks = [
49
- check('CHGLC01', 'close-change script exists', fs.existsSync(closeScript), 'scripts/close-change.mjs'),
50
- check('CHGLC02', 'init-change creates closeable change pack', init.status === 0, 'scripts/init-change.mjs fixture run'),
51
- check('CHGLC03', 'dry-run reports pass without moving source folder', dryRun.status === 0 && dryRunPreservedSource, 'close-change --dry-run'),
52
- check('CHGLC04', 'close moves change folder into archive', close.status === 0 && fs.existsSync(archiveDir) && !fs.existsSync(sourceDir), '.gse/archive/YYYY-MM-DD-change-id'),
53
- check('CHGLC05', 'archive record captures closure metadata', archiveRecord.includes('Status: verified') && archiveRecord.includes('Source: .gse/changes/archive-me'), 'archive-record.md'),
54
- check('CHGLC06', 'evidence index receives schema-complete change-archive record', indexText.includes('"recordType":"change-archive"') && indexText.includes('"changeId":"archive-me"') && indexText.includes('"commands":') && indexText.includes('"nextAction":'), '.gse/evidence/index.jsonl'),
55
- check('CHGLC07', 'close output preserves evidence status and archive path', closeJson?.evidenceStatus === 'verified' && closeJson?.indexRecord?.archivePath === '.gse/archive/2026-07-06-archive-me', 'close-change JSON'),
56
- ]
57
-
58
- const passed = checks.filter((item) => item.status === 'passed').length
59
- const failed = checks.length - passed
60
- const report = {
61
- root,
62
- generatedAt: new Date().toISOString(),
63
- summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
64
- workflows: { changeArchiveLifecycle: failed === 0 ? 'verified' : 'failed' },
65
- limits: [
66
- 'This audit verifies local change archive mechanics in a fixture.',
67
- 'It does not certify the product correctness of a real target-project change.',
68
- ],
69
- checks,
70
- }
71
-
72
- fs.rmSync(target, { recursive: true, force: true })
73
-
74
- if (jsonOnly) console.log(JSON.stringify(report, null, 2))
75
- else console.log(JSON.stringify(report, null, 2))
76
-
77
- 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
+ const target = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-change-lifecycle-'))
18
+ const initScript = path.join(root, 'scripts', 'init-change.mjs')
19
+ const closeScript = path.join(root, 'scripts', 'close-change.mjs')
20
+
21
+ function run(script, commandArgs) {
22
+ return spawnSync(process.execPath, [script, ...commandArgs], { cwd: root, encoding: 'utf8', windowsHide: true })
23
+ }
24
+
25
+ function parseJson(text) {
26
+ try { return JSON.parse(text) } catch { return null }
27
+ }
28
+
29
+ function check(id, label, ok, evidence, risk = '') {
30
+ return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
31
+ }
32
+
33
+ fs.mkdirSync(path.join(target, '.gse', 'evidence'), { recursive: true })
34
+ fs.writeFileSync(path.join(target, '.gse', 'goal-map.md'), '# Goal Map\n', 'utf8')
35
+ fs.writeFileSync(path.join(target, '.gse', 'quality-gates.md'), '# Quality Gates\n', 'utf8')
36
+ fs.writeFileSync(path.join(target, '.gse', 'evidence', 'index.jsonl'), '', 'utf8')
37
+
38
+ const init = run(initScript, ['--target', target, '--change-id', 'Archive Me', '--level', 'standard', '--json'])
39
+ const dryRun = run(closeScript, ['--target', target, '--change-id', 'archive-me', '--status', 'verified', '--date', '2026-07-06', '--dry-run', '--json'])
40
+ const dryRunPreservedSource = fs.existsSync(path.join(target, '.gse', 'changes', 'archive-me'))
41
+ const close = run(closeScript, ['--target', target, '--change-id', 'archive-me', '--status', 'verified', '--date', '2026-07-06', '--json'])
42
+ const closeJson = parseJson(close.stdout)
43
+ const archiveDir = path.join(target, '.gse', 'archive', '2026-07-06-archive-me')
44
+ const sourceDir = path.join(target, '.gse', 'changes', 'archive-me')
45
+ const indexText = fs.readFileSync(path.join(target, '.gse', 'evidence', 'index.jsonl'), 'utf8')
46
+ const archiveRecord = fs.existsSync(path.join(archiveDir, 'archive-record.md')) ? fs.readFileSync(path.join(archiveDir, 'archive-record.md'), 'utf8') : ''
47
+
48
+ const checks = [
49
+ check('CHGLC01', 'close-change script exists', fs.existsSync(closeScript), 'scripts/close-change.mjs'),
50
+ check('CHGLC02', 'init-change creates closeable change pack', init.status === 0, 'scripts/init-change.mjs fixture run'),
51
+ check('CHGLC03', 'dry-run reports pass without moving source folder', dryRun.status === 0 && dryRunPreservedSource, 'close-change --dry-run'),
52
+ check('CHGLC04', 'close moves change folder into archive', close.status === 0 && fs.existsSync(archiveDir) && !fs.existsSync(sourceDir), '.gse/archive/YYYY-MM-DD-change-id'),
53
+ check('CHGLC05', 'archive record captures closure metadata', archiveRecord.includes('Status: verified') && archiveRecord.includes('Source: .gse/changes/archive-me'), 'archive-record.md'),
54
+ check('CHGLC06', 'evidence index receives schema-complete change-archive record', indexText.includes('"recordType":"change-archive"') && indexText.includes('"changeId":"archive-me"') && indexText.includes('"commands":') && indexText.includes('"nextAction":'), '.gse/evidence/index.jsonl'),
55
+ check('CHGLC07', 'close output preserves evidence status and archive path', closeJson?.evidenceStatus === 'verified' && closeJson?.indexRecord?.archivePath === '.gse/archive/2026-07-06-archive-me', 'close-change JSON'),
56
+ ]
57
+
58
+ const passed = checks.filter((item) => item.status === 'passed').length
59
+ const failed = checks.length - passed
60
+ const report = {
61
+ root,
62
+ generatedAt: new Date().toISOString(),
63
+ summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
64
+ workflows: { changeArchiveLifecycle: failed === 0 ? 'verified' : 'failed' },
65
+ limits: [
66
+ 'This audit verifies local change archive mechanics in a fixture.',
67
+ 'It does not certify the product correctness of a real target-project change.',
68
+ ],
69
+ checks,
70
+ }
71
+
72
+ fs.rmSync(target, { recursive: true, force: true })
73
+
74
+ if (jsonOnly) console.log(JSON.stringify(report, null, 2))
75
+ else console.log(JSON.stringify(report, null, 2))
76
+
77
+ if (failed > 0) process.exit(1)