@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,132 +1,132 @@
|
|
|
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 recordPath = readArg('--record')
|
|
17
|
-
const jsonOnly = args.includes('--json')
|
|
18
|
-
|
|
19
|
-
function read(relativePathOrFullPath) {
|
|
20
|
-
const fullPath = path.isAbsolute(relativePathOrFullPath) ? relativePathOrFullPath : path.join(root, relativePathOrFullPath)
|
|
21
|
-
return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8').replace(/^\uFEFF/, '') : ''
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function exists(relativePath) {
|
|
25
|
-
return fs.existsSync(path.join(root, relativePath))
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function run(script, commandArgs) {
|
|
29
|
-
const result = spawnSync(process.execPath, [path.join(root, 'scripts', script), ...commandArgs], {
|
|
30
|
-
cwd: root,
|
|
31
|
-
encoding: 'utf8',
|
|
32
|
-
windowsHide: true,
|
|
33
|
-
})
|
|
34
|
-
return {
|
|
35
|
-
command: [process.execPath, path.join(root, 'scripts', script), ...commandArgs].join(' '),
|
|
36
|
-
status: result.status ?? 1,
|
|
37
|
-
stdout: (result.stdout ?? '').trim(),
|
|
38
|
-
stderr: (result.stderr ?? '').trim(),
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function parseJson(text) {
|
|
43
|
-
try { return JSON.parse(text) } catch { return null }
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function check(id, label, ok, evidence, risk = '') {
|
|
47
|
-
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const target = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-host-ui-'))
|
|
51
|
-
fs.mkdirSync(target, { recursive: true })
|
|
52
|
-
fs.writeFileSync(path.join(target, 'AGENTS.md'), '# Host UI Fixture\n', 'utf8')
|
|
53
|
-
const initRun = run('init-project.mjs', ['--target', target, '--mode', 'enterprise', '--json'])
|
|
54
|
-
const adapterRun = run('generate-command-adapter.mjs', ['--target', target, '--host', 'all', '--json'])
|
|
55
|
-
const commandRun = run('run-gse-command.mjs', ['--target', target, '--command', '/gse help', '--json'])
|
|
56
|
-
const adapterData = parseJson(adapterRun.stdout)
|
|
57
|
-
const commandData = parseJson(commandRun.stdout)
|
|
58
|
-
const claudeCommand = read(path.join(target, '.claude', 'commands', 'gse.md'))
|
|
59
|
-
const codexPointer = read(path.join(target, '.codex', 'gse-command.md'))
|
|
60
|
-
const record = recordPath ? read(path.resolve(recordPath)) : ''
|
|
61
|
-
const recordHasEvidence =
|
|
62
|
-
Boolean(record) &&
|
|
63
|
-
record.includes('## Host') &&
|
|
64
|
-
record.includes('## Command') &&
|
|
65
|
-
record.includes('## Result') &&
|
|
66
|
-
record.includes('## Evidence') &&
|
|
67
|
-
/Status:\s*(verified|accepted)/i.test(record)
|
|
68
|
-
|
|
69
|
-
const checks = [
|
|
70
|
-
check('HUI01', 'host UI invocation record template exists', exists('assets/templates/host-ui-invocation-record.md'), 'assets/templates/host-ui-invocation-record.md'),
|
|
71
|
-
check('HUI02', 'portable runner can execute command semantics', commandRun.status === 0 && commandData?.route?.route === 'references/commands.md', '/gse help through run-gse-command.mjs'),
|
|
72
|
-
check('HUI03', 'Claude command adapter is generated at current native path', adapterRun.status === 0 && fs.existsSync(path.join(target, '.claude', 'commands', 'gse.md')) && claudeCommand.includes('Portable execution path'), '.claude/commands/gse.md'),
|
|
73
|
-
check('HUI04', 'Codex command pointer is generated without native claim', adapterRun.status === 0 && fs.existsSync(path.join(target, '.codex', 'gse-command.md')) && codexPointer.includes('not proof of a native project-level /gse slash-command mechanism'), '.codex/gse-command.md'),
|
|
74
|
-
check('HUI05', 'adapter generator labels native support honestly', adapterData?.results?.some((item) => item.host === 'claude' && item.nativeSlashCommand === true) && adapterData?.results?.some((item) => item.host === 'codex' && item.nativeSlashCommand === false), 'generate-command-adapter.mjs result metadata'),
|
|
75
|
-
check('HUI06', 'commands reference requires host runtime evidence', read('references/commands.md').includes('host-specific smoke') && read('references/commands.md').includes('Do not claim native slash-command support unless the current host exposes it and it was verified.'), 'references/commands.md'),
|
|
76
|
-
check('HUI07', 'optional real host invocation record is valid when supplied', recordPath ? recordHasEvidence : true, recordPath ? recordPath : 'no --record supplied; template/readiness only'),
|
|
77
|
-
check('HUI08', 'validator includes host UI invocation audit', read('scripts/validate-gse.mjs').includes('audit-host-ui-invocation.mjs'), 'scripts/validate-gse.mjs'),
|
|
78
|
-
]
|
|
79
|
-
|
|
80
|
-
fs.rmSync(target, { recursive: true, force: true })
|
|
81
|
-
|
|
82
|
-
const passed = checks.filter((item) => item.status === 'passed').length
|
|
83
|
-
const failed = checks.length - passed
|
|
84
|
-
const report = {
|
|
85
|
-
root,
|
|
86
|
-
generatedAt: new Date().toISOString(),
|
|
87
|
-
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
88
|
-
workflows: {
|
|
89
|
-
hostUiInvocationReadiness: failed === 0 ? 'verified' : 'failed',
|
|
90
|
-
realHostUiInvocation: recordHasEvidence ? 'verified-by-record' : 'not-verified',
|
|
91
|
-
},
|
|
92
|
-
acceptedBy: recordHasEvidence ? 'host invocation record' : 'not accepted; no real host UI invocation record was supplied',
|
|
93
|
-
limits: [
|
|
94
|
-
'This audit verifies portable command execution, generated host pointers, and the evidence format for real host UI invocation.',
|
|
95
|
-
'Without --record, it does not prove a real Codex, Claude Code, Hermes, WorkBuddy, or other UI invoked the command.',
|
|
96
|
-
'Generated adapters are not runtime proof by themselves.',
|
|
97
|
-
],
|
|
98
|
-
checks,
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function renderMarkdown(data) {
|
|
102
|
-
const lines = []
|
|
103
|
-
lines.push('# GSE Host UI Invocation Audit')
|
|
104
|
-
lines.push('')
|
|
105
|
-
lines.push('Generated: ' + data.generatedAt)
|
|
106
|
-
lines.push('Root: ' + data.root)
|
|
107
|
-
lines.push('')
|
|
108
|
-
lines.push('## Summary')
|
|
109
|
-
lines.push('')
|
|
110
|
-
lines.push('- Status: ' + data.summary.status)
|
|
111
|
-
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
112
|
-
lines.push('- Host UI invocation readiness: ' + data.workflows.hostUiInvocationReadiness)
|
|
113
|
-
lines.push('- Real host UI invocation: ' + data.workflows.realHostUiInvocation)
|
|
114
|
-
lines.push('- Accepted by: ' + data.acceptedBy)
|
|
115
|
-
lines.push('')
|
|
116
|
-
lines.push('## Checks')
|
|
117
|
-
lines.push('')
|
|
118
|
-
for (const item of data.checks) {
|
|
119
|
-
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
120
|
-
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
121
|
-
}
|
|
122
|
-
lines.push('')
|
|
123
|
-
lines.push('## Limits')
|
|
124
|
-
lines.push('')
|
|
125
|
-
for (const item of data.limits) lines.push('- ' + item)
|
|
126
|
-
return lines.join('\n') + '\n'
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
130
|
-
else console.log(renderMarkdown(report))
|
|
131
|
-
|
|
132
|
-
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 recordPath = readArg('--record')
|
|
17
|
+
const jsonOnly = args.includes('--json')
|
|
18
|
+
|
|
19
|
+
function read(relativePathOrFullPath) {
|
|
20
|
+
const fullPath = path.isAbsolute(relativePathOrFullPath) ? relativePathOrFullPath : path.join(root, relativePathOrFullPath)
|
|
21
|
+
return fs.existsSync(fullPath) ? fs.readFileSync(fullPath, 'utf8').replace(/^\uFEFF/, '') : ''
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function exists(relativePath) {
|
|
25
|
+
return fs.existsSync(path.join(root, relativePath))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function run(script, commandArgs) {
|
|
29
|
+
const result = spawnSync(process.execPath, [path.join(root, 'scripts', script), ...commandArgs], {
|
|
30
|
+
cwd: root,
|
|
31
|
+
encoding: 'utf8',
|
|
32
|
+
windowsHide: true,
|
|
33
|
+
})
|
|
34
|
+
return {
|
|
35
|
+
command: [process.execPath, path.join(root, 'scripts', script), ...commandArgs].join(' '),
|
|
36
|
+
status: result.status ?? 1,
|
|
37
|
+
stdout: (result.stdout ?? '').trim(),
|
|
38
|
+
stderr: (result.stderr ?? '').trim(),
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function parseJson(text) {
|
|
43
|
+
try { return JSON.parse(text) } catch { return null }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function check(id, label, ok, evidence, risk = '') {
|
|
47
|
+
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const target = fs.mkdtempSync(path.join(os.tmpdir(), 'gse-host-ui-'))
|
|
51
|
+
fs.mkdirSync(target, { recursive: true })
|
|
52
|
+
fs.writeFileSync(path.join(target, 'AGENTS.md'), '# Host UI Fixture\n', 'utf8')
|
|
53
|
+
const initRun = run('init-project.mjs', ['--target', target, '--mode', 'enterprise', '--json'])
|
|
54
|
+
const adapterRun = run('generate-command-adapter.mjs', ['--target', target, '--host', 'all', '--json'])
|
|
55
|
+
const commandRun = run('run-gse-command.mjs', ['--target', target, '--command', '/gse help', '--json'])
|
|
56
|
+
const adapterData = parseJson(adapterRun.stdout)
|
|
57
|
+
const commandData = parseJson(commandRun.stdout)
|
|
58
|
+
const claudeCommand = read(path.join(target, '.claude', 'commands', 'gse.md'))
|
|
59
|
+
const codexPointer = read(path.join(target, '.codex', 'gse-command.md'))
|
|
60
|
+
const record = recordPath ? read(path.resolve(recordPath)) : ''
|
|
61
|
+
const recordHasEvidence =
|
|
62
|
+
Boolean(record) &&
|
|
63
|
+
record.includes('## Host') &&
|
|
64
|
+
record.includes('## Command') &&
|
|
65
|
+
record.includes('## Result') &&
|
|
66
|
+
record.includes('## Evidence') &&
|
|
67
|
+
/Status:\s*(verified|accepted)/i.test(record)
|
|
68
|
+
|
|
69
|
+
const checks = [
|
|
70
|
+
check('HUI01', 'host UI invocation record template exists', exists('assets/templates/host-ui-invocation-record.md'), 'assets/templates/host-ui-invocation-record.md'),
|
|
71
|
+
check('HUI02', 'portable runner can execute command semantics', commandRun.status === 0 && commandData?.route?.route === 'references/commands.md', '/gse help through run-gse-command.mjs'),
|
|
72
|
+
check('HUI03', 'Claude command adapter is generated at current native path', adapterRun.status === 0 && fs.existsSync(path.join(target, '.claude', 'commands', 'gse.md')) && claudeCommand.includes('Portable execution path'), '.claude/commands/gse.md'),
|
|
73
|
+
check('HUI04', 'Codex command pointer is generated without native claim', adapterRun.status === 0 && fs.existsSync(path.join(target, '.codex', 'gse-command.md')) && codexPointer.includes('not proof of a native project-level /gse slash-command mechanism'), '.codex/gse-command.md'),
|
|
74
|
+
check('HUI05', 'adapter generator labels native support honestly', adapterData?.results?.some((item) => item.host === 'claude' && item.nativeSlashCommand === true) && adapterData?.results?.some((item) => item.host === 'codex' && item.nativeSlashCommand === false), 'generate-command-adapter.mjs result metadata'),
|
|
75
|
+
check('HUI06', 'commands reference requires host runtime evidence', read('references/commands.md').includes('host-specific smoke') && read('references/commands.md').includes('Do not claim native slash-command support unless the current host exposes it and it was verified.'), 'references/commands.md'),
|
|
76
|
+
check('HUI07', 'optional real host invocation record is valid when supplied', recordPath ? recordHasEvidence : true, recordPath ? recordPath : 'no --record supplied; template/readiness only'),
|
|
77
|
+
check('HUI08', 'validator includes host UI invocation audit', read('scripts/validate-gse.mjs').includes('audit-host-ui-invocation.mjs'), 'scripts/validate-gse.mjs'),
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
fs.rmSync(target, { recursive: true, force: true })
|
|
81
|
+
|
|
82
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
83
|
+
const failed = checks.length - passed
|
|
84
|
+
const report = {
|
|
85
|
+
root,
|
|
86
|
+
generatedAt: new Date().toISOString(),
|
|
87
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
88
|
+
workflows: {
|
|
89
|
+
hostUiInvocationReadiness: failed === 0 ? 'verified' : 'failed',
|
|
90
|
+
realHostUiInvocation: recordHasEvidence ? 'verified-by-record' : 'not-verified',
|
|
91
|
+
},
|
|
92
|
+
acceptedBy: recordHasEvidence ? 'host invocation record' : 'not accepted; no real host UI invocation record was supplied',
|
|
93
|
+
limits: [
|
|
94
|
+
'This audit verifies portable command execution, generated host pointers, and the evidence format for real host UI invocation.',
|
|
95
|
+
'Without --record, it does not prove a real Codex, Claude Code, Hermes, WorkBuddy, or other UI invoked the command.',
|
|
96
|
+
'Generated adapters are not runtime proof by themselves.',
|
|
97
|
+
],
|
|
98
|
+
checks,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function renderMarkdown(data) {
|
|
102
|
+
const lines = []
|
|
103
|
+
lines.push('# GSE Host UI Invocation Audit')
|
|
104
|
+
lines.push('')
|
|
105
|
+
lines.push('Generated: ' + data.generatedAt)
|
|
106
|
+
lines.push('Root: ' + data.root)
|
|
107
|
+
lines.push('')
|
|
108
|
+
lines.push('## Summary')
|
|
109
|
+
lines.push('')
|
|
110
|
+
lines.push('- Status: ' + data.summary.status)
|
|
111
|
+
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
112
|
+
lines.push('- Host UI invocation readiness: ' + data.workflows.hostUiInvocationReadiness)
|
|
113
|
+
lines.push('- Real host UI invocation: ' + data.workflows.realHostUiInvocation)
|
|
114
|
+
lines.push('- Accepted by: ' + data.acceptedBy)
|
|
115
|
+
lines.push('')
|
|
116
|
+
lines.push('## Checks')
|
|
117
|
+
lines.push('')
|
|
118
|
+
for (const item of data.checks) {
|
|
119
|
+
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
120
|
+
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
121
|
+
}
|
|
122
|
+
lines.push('')
|
|
123
|
+
lines.push('## Limits')
|
|
124
|
+
lines.push('')
|
|
125
|
+
for (const item of data.limits) lines.push('- ' + item)
|
|
126
|
+
return lines.join('\n') + '\n'
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
130
|
+
else console.log(renderMarkdown(report))
|
|
131
|
+
|
|
132
|
+
if (failed > 0) process.exit(1)
|
|
@@ -1,122 +1,122 @@
|
|
|
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').replace(/^\uFEFF/, '') : ''
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function exists(relativePath) {
|
|
22
|
-
return fs.existsSync(path.join(root, relativePath))
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function readJson(relativePath) {
|
|
26
|
-
try {
|
|
27
|
-
return JSON.parse(read(relativePath))
|
|
28
|
-
} catch {
|
|
29
|
-
return null
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function check(id, label, ok, evidence, risk = '') {
|
|
34
|
-
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const listingText = read('assets/marketplace/gse-listing.json')
|
|
38
|
-
const listing = readJson('assets/marketplace/gse-listing.json')
|
|
39
|
-
const marketplaceRef = read('references/marketplace-discovery.md')
|
|
40
|
-
const packaging = read('references/packaging.md')
|
|
41
|
-
const openai = read('agents/openai.yaml')
|
|
42
|
-
const validate = read('scripts/validate-gse.mjs')
|
|
43
|
-
|
|
44
|
-
const keywords = new Set(Array.isArray(listing?.keywords) ? listing.keywords : [])
|
|
45
|
-
const categories = new Set(Array.isArray(listing?.categories) ? listing.categories : [])
|
|
46
|
-
const entrypoints = new Set(Array.isArray(listing?.entrypoints) ? listing.entrypoints : [])
|
|
47
|
-
const verification = Array.isArray(listing?.verification) ? listing.verification : []
|
|
48
|
-
const hostSupport = Array.isArray(listing?.hostSupport) ? listing.hostSupport : []
|
|
49
|
-
const boundaries = Array.isArray(listing?.boundaries) ? listing.boundaries.join('\n') : ''
|
|
50
|
-
const privateLeakPattern = new RegExp(
|
|
51
|
-
[
|
|
52
|
-
['C:', 'Users', 'Admin'].join('[\\\\\\\\/]'),
|
|
53
|
-
['D:', 'codex'].join('[\\\\\\\\/]'),
|
|
54
|
-
['hermes', 'workspace'].join('[-_]'),
|
|
55
|
-
['node', 'banana'].join('[-_]'),
|
|
56
|
-
].join('|'),
|
|
57
|
-
'i',
|
|
58
|
-
)
|
|
59
|
-
const noPrivateOrLocalLeak =
|
|
60
|
-
!privateLeakPattern.test(listingText) &&
|
|
61
|
-
!privateLeakPattern.test(marketplaceRef)
|
|
62
|
-
|
|
63
|
-
const checks = [
|
|
64
|
-
check('MD01', 'marketplace listing metadata exists and parses', Boolean(listing), 'assets/marketplace/gse-listing.json'),
|
|
65
|
-
check('MD02', 'listing has searchable identity and summary', listing?.name === 'gse' && listing?.displayName === 'GSE' && typeof listing?.tagline === 'string' && listing.tagline.length > 20 && typeof listing?.summary === 'string' && listing.summary.includes('Goal-Spec-Evidence'), 'name, displayName, tagline, summary'),
|
|
66
|
-
check('MD03', 'listing uses natural ecosystem keywords', ['agentic engineering', 'spec-driven development', 'SDD', 'AI coding agent workflow', 'evidence gates', 'goal map'].every((item) => keywords.has(item)), 'keywords'),
|
|
67
|
-
check('MD04', 'listing classifies project category without keyword stuffing block', categories.has('agentic engineering') && categories.has('software development workflow') && marketplaceRef.includes('Do not add isolated search-term blocks'), 'categories and marketplace reference'),
|
|
68
|
-
check('MD05', 'listing exposes human and machine entrypoints', ['SKILL.md', 'README.md', 'README.zh-CN.md', 'scripts/run-gse-command.mjs', 'scripts/validate-gse.mjs'].every((item) => entrypoints.has(item)), 'entrypoints'),
|
|
69
|
-
check('MD06', 'listing exposes validation commands', verification.some((item) => item.includes('validate-gse.mjs')) && verification.some((item) => item.includes('audit-marketplace-discovery.mjs')) && verification.some((item) => item.includes('audit-host-ui-invocation.mjs')), 'verification commands'),
|
|
70
|
-
check('MD07', 'listing separates host support status from proof', hostSupport.some((item) => item.host.includes('Codex') && item.status === 'documented') && hostSupport.some((item) => item.host.includes('Claude') && item.status === 'documented') && boundaries.includes('native host UI invocation require separate evidence'), 'hostSupport and boundaries'),
|
|
71
|
-
check('MD08', 'release trust and distribution references are linked', listing?.distribution?.packageScript === 'scripts/package-gse.mjs' && listing?.distribution?.trustPolicy === 'references/release-trust.md' && packaging.includes('references/marketplace-discovery.md'), 'distribution metadata and packaging reference'),
|
|
72
|
-
check('MD09', 'OpenAI host metadata remains present', openai.includes('display_name: "GSE"') && openai.includes('default_prompt'), 'agents/openai.yaml'),
|
|
73
|
-
check('MD10', 'validator includes marketplace discovery audit', validate.includes('audit-marketplace-discovery.mjs'), 'scripts/validate-gse.mjs'),
|
|
74
|
-
check('MD11', 'metadata avoids local/private project leakage', noPrivateOrLocalLeak, 'listing and marketplace reference'),
|
|
75
|
-
]
|
|
76
|
-
|
|
77
|
-
const passed = checks.filter((item) => item.status === 'passed').length
|
|
78
|
-
const failed = checks.length - passed
|
|
79
|
-
const report = {
|
|
80
|
-
root,
|
|
81
|
-
generatedAt: new Date().toISOString(),
|
|
82
|
-
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
83
|
-
workflows: { marketplaceDiscovery: failed === 0 ? 'verified' : 'failed' },
|
|
84
|
-
acceptedBy: 'not accepted; this audit verifies metadata readiness but does not publish to or receive approval from a marketplace',
|
|
85
|
-
limits: [
|
|
86
|
-
'This audit verifies local discovery metadata, not marketplace approval.',
|
|
87
|
-
'It does not prove maintainer identity, public registry publication, ranking, search indexing, or host-native installation.',
|
|
88
|
-
],
|
|
89
|
-
checks,
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function renderMarkdown(data) {
|
|
93
|
-
const lines = []
|
|
94
|
-
lines.push('# GSE Marketplace Discovery Audit')
|
|
95
|
-
lines.push('')
|
|
96
|
-
lines.push('Generated: ' + data.generatedAt)
|
|
97
|
-
lines.push('Root: ' + data.root)
|
|
98
|
-
lines.push('')
|
|
99
|
-
lines.push('## Summary')
|
|
100
|
-
lines.push('')
|
|
101
|
-
lines.push('- Status: ' + data.summary.status)
|
|
102
|
-
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
103
|
-
lines.push('- Marketplace discovery: ' + data.workflows.marketplaceDiscovery)
|
|
104
|
-
lines.push('- Accepted by: ' + data.acceptedBy)
|
|
105
|
-
lines.push('')
|
|
106
|
-
lines.push('## Checks')
|
|
107
|
-
lines.push('')
|
|
108
|
-
for (const item of data.checks) {
|
|
109
|
-
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
110
|
-
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
111
|
-
}
|
|
112
|
-
lines.push('')
|
|
113
|
-
lines.push('## Limits')
|
|
114
|
-
lines.push('')
|
|
115
|
-
for (const item of data.limits) lines.push('- ' + item)
|
|
116
|
-
return lines.join('\n') + '\n'
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
120
|
-
else console.log(renderMarkdown(report))
|
|
121
|
-
|
|
122
|
-
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').replace(/^\uFEFF/, '') : ''
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function exists(relativePath) {
|
|
22
|
+
return fs.existsSync(path.join(root, relativePath))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function readJson(relativePath) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(read(relativePath))
|
|
28
|
+
} catch {
|
|
29
|
+
return null
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function check(id, label, ok, evidence, risk = '') {
|
|
34
|
+
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const listingText = read('assets/marketplace/gse-listing.json')
|
|
38
|
+
const listing = readJson('assets/marketplace/gse-listing.json')
|
|
39
|
+
const marketplaceRef = read('references/marketplace-discovery.md')
|
|
40
|
+
const packaging = read('references/packaging.md')
|
|
41
|
+
const openai = read('agents/openai.yaml')
|
|
42
|
+
const validate = read('scripts/validate-gse.mjs')
|
|
43
|
+
|
|
44
|
+
const keywords = new Set(Array.isArray(listing?.keywords) ? listing.keywords : [])
|
|
45
|
+
const categories = new Set(Array.isArray(listing?.categories) ? listing.categories : [])
|
|
46
|
+
const entrypoints = new Set(Array.isArray(listing?.entrypoints) ? listing.entrypoints : [])
|
|
47
|
+
const verification = Array.isArray(listing?.verification) ? listing.verification : []
|
|
48
|
+
const hostSupport = Array.isArray(listing?.hostSupport) ? listing.hostSupport : []
|
|
49
|
+
const boundaries = Array.isArray(listing?.boundaries) ? listing.boundaries.join('\n') : ''
|
|
50
|
+
const privateLeakPattern = new RegExp(
|
|
51
|
+
[
|
|
52
|
+
['C:', 'Users', 'Admin'].join('[\\\\\\\\/]'),
|
|
53
|
+
['D:', 'codex'].join('[\\\\\\\\/]'),
|
|
54
|
+
['hermes', 'workspace'].join('[-_]'),
|
|
55
|
+
['node', 'banana'].join('[-_]'),
|
|
56
|
+
].join('|'),
|
|
57
|
+
'i',
|
|
58
|
+
)
|
|
59
|
+
const noPrivateOrLocalLeak =
|
|
60
|
+
!privateLeakPattern.test(listingText) &&
|
|
61
|
+
!privateLeakPattern.test(marketplaceRef)
|
|
62
|
+
|
|
63
|
+
const checks = [
|
|
64
|
+
check('MD01', 'marketplace listing metadata exists and parses', Boolean(listing), 'assets/marketplace/gse-listing.json'),
|
|
65
|
+
check('MD02', 'listing has searchable identity and summary', listing?.name === 'gse' && listing?.displayName === 'GSE' && typeof listing?.tagline === 'string' && listing.tagline.length > 20 && typeof listing?.summary === 'string' && listing.summary.includes('Goal-Spec-Evidence'), 'name, displayName, tagline, summary'),
|
|
66
|
+
check('MD03', 'listing uses natural ecosystem keywords', ['agentic engineering', 'spec-driven development', 'SDD', 'AI coding agent workflow', 'evidence gates', 'goal map'].every((item) => keywords.has(item)), 'keywords'),
|
|
67
|
+
check('MD04', 'listing classifies project category without keyword stuffing block', categories.has('agentic engineering') && categories.has('software development workflow') && marketplaceRef.includes('Do not add isolated search-term blocks'), 'categories and marketplace reference'),
|
|
68
|
+
check('MD05', 'listing exposes human and machine entrypoints', ['SKILL.md', 'README.md', 'README.zh-CN.md', 'scripts/run-gse-command.mjs', 'scripts/validate-gse.mjs'].every((item) => entrypoints.has(item)), 'entrypoints'),
|
|
69
|
+
check('MD06', 'listing exposes validation commands', verification.some((item) => item.includes('validate-gse.mjs')) && verification.some((item) => item.includes('audit-marketplace-discovery.mjs')) && verification.some((item) => item.includes('audit-host-ui-invocation.mjs')), 'verification commands'),
|
|
70
|
+
check('MD07', 'listing separates host support status from proof', hostSupport.some((item) => item.host.includes('Codex') && item.status === 'documented') && hostSupport.some((item) => item.host.includes('Claude') && item.status === 'documented') && boundaries.includes('native host UI invocation require separate evidence'), 'hostSupport and boundaries'),
|
|
71
|
+
check('MD08', 'release trust and distribution references are linked', listing?.distribution?.packageScript === 'scripts/package-gse.mjs' && listing?.distribution?.trustPolicy === 'references/release-trust.md' && packaging.includes('references/marketplace-discovery.md'), 'distribution metadata and packaging reference'),
|
|
72
|
+
check('MD09', 'OpenAI host metadata remains present', openai.includes('display_name: "GSE"') && openai.includes('default_prompt'), 'agents/openai.yaml'),
|
|
73
|
+
check('MD10', 'validator includes marketplace discovery audit', validate.includes('audit-marketplace-discovery.mjs'), 'scripts/validate-gse.mjs'),
|
|
74
|
+
check('MD11', 'metadata avoids local/private project leakage', noPrivateOrLocalLeak, 'listing and marketplace reference'),
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
78
|
+
const failed = checks.length - passed
|
|
79
|
+
const report = {
|
|
80
|
+
root,
|
|
81
|
+
generatedAt: new Date().toISOString(),
|
|
82
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
83
|
+
workflows: { marketplaceDiscovery: failed === 0 ? 'verified' : 'failed' },
|
|
84
|
+
acceptedBy: 'not accepted; this audit verifies metadata readiness but does not publish to or receive approval from a marketplace',
|
|
85
|
+
limits: [
|
|
86
|
+
'This audit verifies local discovery metadata, not marketplace approval.',
|
|
87
|
+
'It does not prove maintainer identity, public registry publication, ranking, search indexing, or host-native installation.',
|
|
88
|
+
],
|
|
89
|
+
checks,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function renderMarkdown(data) {
|
|
93
|
+
const lines = []
|
|
94
|
+
lines.push('# GSE Marketplace Discovery Audit')
|
|
95
|
+
lines.push('')
|
|
96
|
+
lines.push('Generated: ' + data.generatedAt)
|
|
97
|
+
lines.push('Root: ' + data.root)
|
|
98
|
+
lines.push('')
|
|
99
|
+
lines.push('## Summary')
|
|
100
|
+
lines.push('')
|
|
101
|
+
lines.push('- Status: ' + data.summary.status)
|
|
102
|
+
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
103
|
+
lines.push('- Marketplace discovery: ' + data.workflows.marketplaceDiscovery)
|
|
104
|
+
lines.push('- Accepted by: ' + data.acceptedBy)
|
|
105
|
+
lines.push('')
|
|
106
|
+
lines.push('## Checks')
|
|
107
|
+
lines.push('')
|
|
108
|
+
for (const item of data.checks) {
|
|
109
|
+
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
110
|
+
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
111
|
+
}
|
|
112
|
+
lines.push('')
|
|
113
|
+
lines.push('## Limits')
|
|
114
|
+
lines.push('')
|
|
115
|
+
for (const item of data.limits) lines.push('- ' + item)
|
|
116
|
+
return lines.join('\n') + '\n'
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
120
|
+
else console.log(renderMarkdown(report))
|
|
121
|
+
|
|
122
|
+
if (failed > 0) process.exit(1)
|