@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.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +42 -0
- package/.github/ISSUE_TEMPLATE/change_request.yml +50 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +38 -0
- package/.github/workflows/validate-gse.yml +33 -0
- package/.gse/README.md +18 -0
- package/.gse/gse-development-protocol.md +50 -0
- package/.gse/project-profile.md +29 -0
- package/.gse/quality-gates.md +25 -0
- package/.gse/releases/public-channel-publication-pending.md +49 -0
- package/.gse/releases/public-ci-run-pending.md +53 -0
- package/.gse/releases/public-release-owner-required.md +65 -0
- package/.gse/releases/public-repository-settings-owner-required.md +59 -0
- package/.gse/releases/public-security-contact-owner-required.md +45 -0
- package/.gse/state.json +27 -0
- package/CHANGELOG.md +24 -0
- package/CONTRIBUTING.md +64 -0
- package/LICENSE +21 -0
- package/README.md +236 -0
- package/README.zh-CN.md +236 -0
- package/SECURITY.md +41 -0
- package/SKILL.md +148 -0
- package/SUPPORT.md +38 -0
- package/agents/openai.yaml +4 -0
- package/assets/marketplace/README.md +7 -0
- package/assets/marketplace/gse-listing.json +75 -0
- package/assets/templates/acceptance-execution-packet.md +73 -0
- package/assets/templates/adr.md +14 -0
- package/assets/templates/change-brief.md +16 -0
- package/assets/templates/design.md +18 -0
- package/assets/templates/dispatch-packet.md +104 -0
- package/assets/templates/evidence.md +14 -0
- package/assets/templates/execution-quality-pack.md +65 -0
- package/assets/templates/goal-map.md +21 -0
- package/assets/templates/host-adapter.md +48 -0
- package/assets/templates/host-ui-invocation-record.md +42 -0
- package/assets/templates/incident-review.md +60 -0
- package/assets/templates/public-channel-publication-record.md +49 -0
- package/assets/templates/public-ci-run-record.md +53 -0
- package/assets/templates/public-release-record.md +65 -0
- package/assets/templates/public-repository-settings-record.md +59 -0
- package/assets/templates/public-security-contact-record.md +45 -0
- package/assets/templates/release-trust-record.md +32 -0
- package/assets/templates/review.md +18 -0
- package/assets/templates/spec.md +16 -0
- package/assets/templates/target-adoption-evidence.md +29 -0
- package/assets/templates/tasks.md +17 -0
- package/assets/templates/update-release-acceptance-record.md +58 -0
- package/examples/README.md +22 -0
- package/examples/agent-runtime-host/.claude/gse-adapter.md +6 -0
- package/examples/agent-runtime-host/.codex/gse-adapter.md +7 -0
- package/examples/agent-runtime-host/.gse/goal-map.md +7 -0
- package/examples/agent-runtime-host/.gse/project-profile.md +27 -0
- package/examples/agent-runtime-host/.gse/tooling.md +5 -0
- package/examples/agent-runtime-host/.mcp.json +9 -0
- package/examples/agent-runtime-host/AGENTS.md +5 -0
- package/examples/agent-runtime-host/README.md +10 -0
- package/examples/agent-runtime-host/docs/model-routing.md +5 -0
- package/examples/cli-tool/.gse/project-profile.md +21 -0
- package/examples/cli-tool/AGENTS.md +5 -0
- package/examples/cli-tool/README.md +12 -0
- package/examples/cli-tool/package.json +21 -0
- package/examples/small-app/.env.example +2 -0
- package/examples/small-app/.github/workflows/ci.yml +8 -0
- package/examples/small-app/AGENTS.md +5 -0
- package/examples/small-app/README.md +12 -0
- package/examples/small-app/package.json +26 -0
- package/examples/small-app/playwright.config.ts +4 -0
- package/package.json +53 -0
- package/references/adoption-recipes.md +171 -0
- package/references/agent-roles.md +49 -0
- package/references/architecture-health.md +101 -0
- package/references/benchmark-audit.md +73 -0
- package/references/commands.md +295 -0
- package/references/community-channels.md +46 -0
- package/references/compatibility.md +70 -0
- package/references/design-basis.md +38 -0
- package/references/domain-model.md +129 -0
- package/references/domain-quality-gates.md +75 -0
- package/references/drift-audit.md +81 -0
- package/references/evidence-taxonomy.md +123 -0
- package/references/file-ownership.md +107 -0
- package/references/final-readiness.md +84 -0
- package/references/forward-test.md +133 -0
- package/references/goal-map.md +36 -0
- package/references/host-adapters.md +119 -0
- package/references/learning-system.md +35 -0
- package/references/marketplace-discovery.md +46 -0
- package/references/model-routing.md +103 -0
- package/references/open-source-defaults.md +39 -0
- package/references/operating-model.md +52 -0
- package/references/packaging.md +277 -0
- package/references/project-agent-workspace.md +89 -0
- package/references/project-bootstrap.md +122 -0
- package/references/project-profile.md +57 -0
- package/references/public-release.md +174 -0
- package/references/quality-gates.md +100 -0
- package/references/recovery.md +176 -0
- package/references/release-trust.md +43 -0
- package/references/release.md +126 -0
- package/references/review.md +141 -0
- package/references/router.md +90 -0
- package/references/spec-workflow.md +66 -0
- package/references/task-levels.md +81 -0
- package/references/tool-adapters.md +73 -0
- package/scripts/audit-acceptance-execution-packet.mjs +133 -0
- package/scripts/audit-adoption-recipes.mjs +99 -0
- package/scripts/audit-adoption.mjs +154 -0
- package/scripts/audit-change-lifecycle.mjs +77 -0
- package/scripts/audit-change-system.mjs +134 -0
- package/scripts/audit-ci-readiness.mjs +107 -0
- package/scripts/audit-close-gate.mjs +323 -0
- package/scripts/audit-command-adapters.mjs +91 -0
- package/scripts/audit-command-execution.mjs +210 -0
- package/scripts/audit-commands.mjs +117 -0
- package/scripts/audit-compatibility.mjs +149 -0
- package/scripts/audit-completion-readiness.mjs +292 -0
- package/scripts/audit-distribution.mjs +251 -0
- package/scripts/audit-domain-quality-gates.mjs +108 -0
- package/scripts/audit-evidence-placeholders.mjs +126 -0
- package/scripts/audit-final-acceptance-packet.mjs +148 -0
- package/scripts/audit-final-form-progress-report.mjs +161 -0
- package/scripts/audit-final-form-stale-copy.mjs +221 -0
- package/scripts/audit-final-readiness-promotion.mjs +255 -0
- package/scripts/audit-final-readiness.mjs +226 -0
- package/scripts/audit-fixtures.mjs +154 -0
- package/scripts/audit-fresh-session-readiness.mjs +177 -0
- package/scripts/audit-gse.mjs +275 -0
- package/scripts/audit-host-adapters.mjs +119 -0
- package/scripts/audit-host-runtime-evidence-handoff.mjs +159 -0
- package/scripts/audit-host-runtime-invocation-drill.mjs +240 -0
- package/scripts/audit-host-runtime-invocations.mjs +254 -0
- package/scripts/audit-host-ui-invocation.mjs +132 -0
- package/scripts/audit-learning-system.mjs +103 -0
- package/scripts/audit-local-final-form-completion.mjs +131 -0
- package/scripts/audit-marketplace-discovery.mjs +122 -0
- package/scripts/audit-npm-package-metadata.mjs +155 -0
- package/scripts/audit-npm-publish-dry-run.mjs +169 -0
- package/scripts/audit-npm-tarball-install.mjs +191 -0
- package/scripts/audit-open-source-defaults.mjs +92 -0
- package/scripts/audit-open-source-readiness.mjs +97 -0
- package/scripts/audit-owner-external-gate-kit.mjs +218 -0
- package/scripts/audit-project.mjs +323 -0
- package/scripts/audit-public-acceptance-command-dry-run-drill.mjs +203 -0
- package/scripts/audit-public-acceptance-handoff.mjs +142 -0
- package/scripts/audit-public-acceptance-readiness.mjs +224 -0
- package/scripts/audit-public-channel-publication.mjs +248 -0
- package/scripts/audit-public-ci-run.mjs +184 -0
- package/scripts/audit-public-collaboration-templates.mjs +98 -0
- package/scripts/audit-public-external-gate-probe.mjs +206 -0
- package/scripts/audit-public-release-checklist.mjs +133 -0
- package/scripts/audit-public-release-decision.mjs +201 -0
- package/scripts/audit-public-release-metadata.mjs +176 -0
- package/scripts/audit-public-repository-settings.mjs +237 -0
- package/scripts/audit-public-security-contact.mjs +171 -0
- package/scripts/audit-readme-docs.mjs +185 -0
- package/scripts/audit-recovery-readiness.mjs +98 -0
- package/scripts/audit-release-bundle.mjs +251 -0
- package/scripts/audit-release-owner-action-plan-drill.mjs +277 -0
- package/scripts/audit-release-owner-action-plan.mjs +164 -0
- package/scripts/audit-release-readiness.mjs +106 -0
- package/scripts/audit-release-status-manifest.mjs +165 -0
- package/scripts/audit-release-trust.mjs +62 -0
- package/scripts/audit-remote-distribution.mjs +266 -0
- package/scripts/audit-roadmap-consistency.mjs +235 -0
- package/scripts/audit-signing.mjs +147 -0
- package/scripts/audit-state-freshness.mjs +113 -0
- package/scripts/audit-target-adoption-evidence.mjs +117 -0
- package/scripts/audit-target-project.mjs +507 -0
- package/scripts/audit-update-release-acceptance.mjs +136 -0
- package/scripts/audit-v1-target-validation.mjs +269 -0
- package/scripts/audit-validation-profiles.mjs +125 -0
- package/scripts/close-change.mjs +116 -0
- package/scripts/discover-project-profile.mjs +307 -0
- package/scripts/forward-test-gse.mjs +146 -0
- package/scripts/generate-command-adapter.mjs +231 -0
- package/scripts/generate-final-acceptance-packet.mjs +181 -0
- package/scripts/generate-final-form-progress-report.mjs +205 -0
- package/scripts/generate-host-adapter.mjs +73 -0
- package/scripts/generate-host-runtime-evidence-handoff.mjs +206 -0
- package/scripts/generate-owner-external-gate-kit.mjs +295 -0
- package/scripts/generate-public-acceptance-handoff.mjs +168 -0
- package/scripts/generate-public-release-checklist.mjs +207 -0
- package/scripts/generate-release-bundle.mjs +505 -0
- package/scripts/generate-release-owner-action-plan.mjs +172 -0
- package/scripts/generate-release-status-manifest.mjs +200 -0
- package/scripts/generate-session-prompt.mjs +188 -0
- package/scripts/gse.mjs +67 -0
- package/scripts/init-change.mjs +265 -0
- package/scripts/init-project.mjs +785 -0
- package/scripts/install-gse.mjs +234 -0
- package/scripts/lib/evidence-placeholders.mjs +28 -0
- package/scripts/package-gse.mjs +174 -0
- package/scripts/probe-public-external-gates.mjs +167 -0
- package/scripts/record-host-invocation.mjs +151 -0
- package/scripts/record-learning.mjs +137 -0
- package/scripts/record-public-channel-publication.mjs +178 -0
- package/scripts/record-public-ci-run.mjs +180 -0
- package/scripts/record-public-release.mjs +175 -0
- package/scripts/record-public-repository-settings.mjs +209 -0
- package/scripts/record-public-security-contact.mjs +157 -0
- package/scripts/run-gse-command.mjs +538 -0
- package/scripts/run-validation-profile.mjs +146 -0
- package/scripts/sign-gse-package.mjs +83 -0
- package/scripts/update-project-state.mjs +223 -0
- package/scripts/validate-gse.mjs +1168 -0
- package/scripts/verify-gse-package.mjs +85 -0
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
function section(markdown, heading) {
|
|
30
|
+
const lines = markdown.split(/\r?\n/)
|
|
31
|
+
const start = lines.findIndex((line) => line.trim() === '## ' + heading)
|
|
32
|
+
if (start === -1) return ''
|
|
33
|
+
const body = []
|
|
34
|
+
for (let index = start + 1; index < lines.length; index += 1) {
|
|
35
|
+
const line = lines[index]
|
|
36
|
+
if (line.startsWith('## ')) break
|
|
37
|
+
body.push(line)
|
|
38
|
+
}
|
|
39
|
+
return body.join('\n').trim()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const requiredInputs = [
|
|
43
|
+
'SKILL.md',
|
|
44
|
+
'.gse/gse-design-master-plan.md',
|
|
45
|
+
'.gse/goal-map.md',
|
|
46
|
+
'.gse/current-slice.md',
|
|
47
|
+
'references/forward-test.md',
|
|
48
|
+
'references/evidence-taxonomy.md',
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
const skill = read('SKILL.md')
|
|
52
|
+
const masterPlan = read('.gse/gse-design-master-plan.md')
|
|
53
|
+
const goalMap = read('.gse/goal-map.md')
|
|
54
|
+
const currentSlice = read('.gse/current-slice.md')
|
|
55
|
+
const forwardTest = read('references/forward-test.md')
|
|
56
|
+
const taxonomy = read('references/evidence-taxonomy.md')
|
|
57
|
+
|
|
58
|
+
const outcome = section(currentSlice, 'Outcome')
|
|
59
|
+
const scope = section(currentSlice, 'Scope')
|
|
60
|
+
const acceptance = section(currentSlice, 'Acceptance')
|
|
61
|
+
const evidence = section(currentSlice, 'Evidence') || section(currentSlice, 'Evidence Plan')
|
|
62
|
+
const nextAction = section(currentSlice, 'Next Action')
|
|
63
|
+
|
|
64
|
+
const probePacketLines = [
|
|
65
|
+
'# GSE Fresh-Session Probe Packet',
|
|
66
|
+
'',
|
|
67
|
+
'Purpose: verify whether a separate session can continue GSE development without hidden conversation history.',
|
|
68
|
+
'',
|
|
69
|
+
'Read these files in order:',
|
|
70
|
+
...requiredInputs.map((item) => '- ' + item),
|
|
71
|
+
'',
|
|
72
|
+
'Task for the fresh session:',
|
|
73
|
+
'- Identify the active GSE slice from `.gse/current-slice.md`.',
|
|
74
|
+
'- State outcome, scope, acceptance, evidence, risk, and next action.',
|
|
75
|
+
'- Do not claim accepted unless a separate session actually ran the path or an explicit policy accepts it.',
|
|
76
|
+
'- Do not invent subagent, MCP, LSP, browser, model, hook, or host support.',
|
|
77
|
+
'',
|
|
78
|
+
'Expected active slice:',
|
|
79
|
+
outcome || '(missing)',
|
|
80
|
+
'',
|
|
81
|
+
'Expected next action:',
|
|
82
|
+
nextAction || '(missing)',
|
|
83
|
+
'',
|
|
84
|
+
'Required response fields:',
|
|
85
|
+
'- Forward-test level',
|
|
86
|
+
'- Scenario',
|
|
87
|
+
'- Changed behavior',
|
|
88
|
+
'- Commands or inspection',
|
|
89
|
+
'- Result evidence',
|
|
90
|
+
'- Verification evidence',
|
|
91
|
+
'- Accepted by',
|
|
92
|
+
'- Residual risk',
|
|
93
|
+
'- Next action',
|
|
94
|
+
]
|
|
95
|
+
const probePacket = probePacketLines.join('\n') + '\n'
|
|
96
|
+
|
|
97
|
+
const checks = [
|
|
98
|
+
check('FS01', 'required startup inputs exist', requiredInputs.every(exists), requiredInputs.join(', ')),
|
|
99
|
+
check('FS02', 'SKILL routes GSE changes through control and validation', skill.includes('references/router.md') && skill.includes('scripts/validate-gse.mjs') && skill.includes('references/forward-test.md'), 'SKILL.md'),
|
|
100
|
+
check('FS03', 'master plan preserves fresh-session boundary after owner acceptance', masterPlan.includes('owner-approved AION project-write acceptance is executed') && (masterPlan.includes('fresh-session acceptance remains optional future confidence evidence') || masterPlan.includes('Marketplace discovery, public key custody, and cross-host native command execution remain final-form work') || masterPlan.includes('Marketplace discovery and real host UI invocation remain final-form work') || masterPlan.includes('Public marketplace approval, public registry publication, other host runtime invocation records, and host-native slash-command execution remain final-form work') || masterPlan.includes('Remaining final-form work is real public security contact approval, real public repository settings, public CI run, real public registry publication, real public marketplace approval, host-native slash-command support, and other host runtime invocation records.')), '.gse/gse-design-master-plan.md'),
|
|
101
|
+
check('FS04', 'goal map exposes active slice and next action without hidden history', goalMap.includes('- Active slice:') && goalMap.includes('- Next action:') && goalMap.includes('scripts/audit-fresh-session-readiness.mjs'), '.gse/goal-map.md'),
|
|
102
|
+
check('FS05', 'current slice has required GSE fields', Boolean(outcome && scope && acceptance && evidence && nextAction), 'Outcome, Scope, Acceptance, Evidence or Evidence Plan, Next Action'),
|
|
103
|
+
check('FS06', 'probe packet explicitly avoids false acceptance', probePacket.includes('Do not claim accepted unless a separate session actually ran the path or an explicit policy accepts it.'), 'generated probe packet'),
|
|
104
|
+
check('FS07', 'forward-test protocol defines fresh-session acceptance rules', forwardTest.includes('Fresh-session forward test') && forwardTest.includes('accepted by: fresh-session') && forwardTest.includes('separate agent/session actually ran the path'), 'references/forward-test.md'),
|
|
105
|
+
check('FS08', 'evidence taxonomy supports result verified accepted labels', taxonomy.includes('result -> verified -> accepted') && taxonomy.includes('Not enough for `accepted`'), 'references/evidence-taxonomy.md'),
|
|
106
|
+
check('FS09', 'probe packet uses only documented inputs', requiredInputs.every((item) => probePacket.includes(item)) && probePacket.includes('without hidden conversation history'), 'generated probe packet'),
|
|
107
|
+
check('FS10', 'probe packet asks for evidence taxonomy and residual risk', probePacket.includes('Accepted by') && probePacket.includes('Residual risk') && probePacket.includes('Do not claim accepted'), 'generated probe packet fields'),
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
111
|
+
const failed = checks.length - passed
|
|
112
|
+
const report = {
|
|
113
|
+
root,
|
|
114
|
+
generatedAt: new Date().toISOString(),
|
|
115
|
+
level: 'fresh-session readiness probe',
|
|
116
|
+
scenario: 'Prepare a separate-session GSE continuation packet using documented startup inputs.',
|
|
117
|
+
changedBehavior: 'GSE now has a repeatable readiness check for fresh-session acceptance without overstating acceptance when no separate-session tool is available.',
|
|
118
|
+
evidenceStatus: failed === 0 ? 'verified' : 'result',
|
|
119
|
+
acceptedBy: 'not accepted; no separate-session tool was available to execute the probe in this run',
|
|
120
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
121
|
+
workflows: { freshSessionReadiness: failed === 0 ? 'verified' : 'failed', freshSessionAcceptance: 'not accepted' },
|
|
122
|
+
commandsOrInspection: [
|
|
123
|
+
'Read documented startup inputs: ' + requiredInputs.join(', '),
|
|
124
|
+
'Generate fresh-session probe packet from current slice and forward-test rules',
|
|
125
|
+
'Verify accepted status is not claimed without a real separate-session run',
|
|
126
|
+
],
|
|
127
|
+
probePacket,
|
|
128
|
+
residualRisk: [
|
|
129
|
+
'This readiness probe is not a true fresh-session run.',
|
|
130
|
+
'The result cannot be marked accepted until a separate session, thread, or host-specific equivalent actually follows the packet.',
|
|
131
|
+
'Host-specific thread/subagent tools must be verified before using them as acceptance evidence.',
|
|
132
|
+
],
|
|
133
|
+
nextAction: 'When a separate-session or thread tool is available, run the probe packet and record accepted or failed evidence.',
|
|
134
|
+
checks,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function renderMarkdown(data) {
|
|
138
|
+
const lines = []
|
|
139
|
+
lines.push('# GSE Fresh-Session Readiness Audit')
|
|
140
|
+
lines.push('')
|
|
141
|
+
lines.push('Generated: ' + data.generatedAt)
|
|
142
|
+
lines.push('Root: ' + data.root)
|
|
143
|
+
lines.push('')
|
|
144
|
+
lines.push('## Record')
|
|
145
|
+
lines.push('')
|
|
146
|
+
lines.push('- Forward-test level: ' + data.level)
|
|
147
|
+
lines.push('- Scenario: ' + data.scenario)
|
|
148
|
+
lines.push('- Changed behavior: ' + data.changedBehavior)
|
|
149
|
+
lines.push('- Result evidence: probe packet generated from documented inputs')
|
|
150
|
+
lines.push('- Verification evidence: ' + data.summary.passed + '/' + data.summary.total + ' checks passed')
|
|
151
|
+
lines.push('- Evidence status: ' + data.evidenceStatus)
|
|
152
|
+
lines.push('- Accepted by: ' + data.acceptedBy)
|
|
153
|
+
lines.push('- Next action: ' + data.nextAction)
|
|
154
|
+
lines.push('')
|
|
155
|
+
lines.push('## Checks')
|
|
156
|
+
lines.push('')
|
|
157
|
+
for (const item of data.checks) {
|
|
158
|
+
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
159
|
+
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
160
|
+
}
|
|
161
|
+
lines.push('')
|
|
162
|
+
lines.push('## Probe Packet')
|
|
163
|
+
lines.push('')
|
|
164
|
+
lines.push('```text')
|
|
165
|
+
lines.push(data.probePacket.trimEnd())
|
|
166
|
+
lines.push('```')
|
|
167
|
+
lines.push('')
|
|
168
|
+
lines.push('## Residual Risk')
|
|
169
|
+
lines.push('')
|
|
170
|
+
for (const item of data.residualRisk) lines.push('- ' + item)
|
|
171
|
+
return lines.join('\n') + '\n'
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
175
|
+
else console.log(renderMarkdown(report))
|
|
176
|
+
|
|
177
|
+
if (failed > 0) process.exit(1)
|
|
@@ -0,0 +1,275 @@
|
|
|
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 out = readArg('--out')
|
|
15
|
+
const jsonOnly = args.includes('--json')
|
|
16
|
+
|
|
17
|
+
function exists(relativePath) {
|
|
18
|
+
return fs.existsSync(path.join(root, relativePath))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function anyExists(relativePaths) {
|
|
22
|
+
return relativePaths.some((relativePath) => exists(relativePath))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function criterion(id, label, required, note = '') {
|
|
26
|
+
const ok = Array.isArray(required) ? anyExists(required) : exists(required)
|
|
27
|
+
return {
|
|
28
|
+
id,
|
|
29
|
+
label,
|
|
30
|
+
status: ok ? 'present' : 'missing',
|
|
31
|
+
required,
|
|
32
|
+
note,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const capabilityAreas = [
|
|
37
|
+
{
|
|
38
|
+
id: 'GSE-C01',
|
|
39
|
+
name: 'Skill Core',
|
|
40
|
+
criteria: [
|
|
41
|
+
criterion('C01-01', 'Skill entrypoint exists', 'SKILL.md'),
|
|
42
|
+
criterion('C01-02', 'English README exists', 'README.md'),
|
|
43
|
+
criterion('C01-03', 'Chinese README exists', 'README.zh-CN.md'),
|
|
44
|
+
criterion('C01-04', 'References folder exists', 'references'),
|
|
45
|
+
criterion('C01-05', 'Scripts folder exists', 'scripts'),
|
|
46
|
+
criterion('C01-06', 'Reusable templates exist', 'assets/templates'),
|
|
47
|
+
criterion('C01-07', 'OpenAI UI metadata exists', 'agents/openai.yaml', 'Recommended by skill-creator; may be added after validator path is healthy.'),
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'GSE-C02',
|
|
52
|
+
name: 'GSE Self-Development Governance',
|
|
53
|
+
criteria: [
|
|
54
|
+
criterion('C02-01', 'Development protocol exists', '.gse/gse-development-protocol.md'),
|
|
55
|
+
criterion('C02-02', 'Design master plan exists', '.gse/gse-design-master-plan.md'),
|
|
56
|
+
criterion('C02-03', 'Benchmark audit records exist', '.gse/benchmark-audits'),
|
|
57
|
+
criterion('C02-04', 'Evidence records exist', '.gse/evidence'),
|
|
58
|
+
criterion('C02-05', 'Self-audit script exists', 'scripts/audit-gse.mjs'),
|
|
59
|
+
criterion('C02-06', 'Release/version checklist exists', ['.gse/release.md', 'references/release.md', 'assets/templates/release.md']),
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'GSE-C03',
|
|
64
|
+
name: 'Project Bootstrap And Profile',
|
|
65
|
+
criteria: [
|
|
66
|
+
criterion('C03-01', 'Project init script exists', 'scripts/init-project.mjs'),
|
|
67
|
+
criterion('C03-02', 'Project profile reference exists', 'references/project-profile.md'),
|
|
68
|
+
criterion('C03-03', 'Project bootstrap reference exists', 'references/project-bootstrap.md'),
|
|
69
|
+
criterion('C03-04', 'Profile discovery script exists', 'scripts/discover-project-profile.mjs'),
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'GSE-C04',
|
|
74
|
+
name: 'Router And Workflow Selection',
|
|
75
|
+
criteria: [
|
|
76
|
+
criterion('C04-01', 'Task levels reference exists', 'references/task-levels.md'),
|
|
77
|
+
criterion('C04-02', 'Dedicated router reference exists', 'references/router.md'),
|
|
78
|
+
criterion('C04-03', 'Command semantics reference exists', 'references/commands.md'),
|
|
79
|
+
criterion('C04-04', 'Portable command runner exists', ['scripts/run-gse-command.mjs', 'scripts/audit-command-execution.mjs']),
|
|
80
|
+
criterion('C04-05', 'Machine-readable state freshness audit exists', 'scripts/audit-state-freshness.mjs'),
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'GSE-C05',
|
|
85
|
+
name: 'Goal And Spec System',
|
|
86
|
+
criteria: [
|
|
87
|
+
criterion('C05-01', 'Goal map reference exists', 'references/goal-map.md'),
|
|
88
|
+
criterion('C05-02', 'Spec workflow reference exists', 'references/spec-workflow.md'),
|
|
89
|
+
criterion('C05-03', 'Change brief template exists', 'assets/templates/change-brief.md'),
|
|
90
|
+
criterion('C05-04', 'Spec template exists', 'assets/templates/spec.md'),
|
|
91
|
+
criterion('C05-05', 'Evidence status taxonomy exists', 'references/evidence-taxonomy.md'),
|
|
92
|
+
criterion('C05-06', 'Change pack initializer exists', 'scripts/init-change.mjs'),
|
|
93
|
+
criterion('C05-07', 'Change system audit exists', 'scripts/audit-change-system.mjs'),
|
|
94
|
+
criterion('C05-08', 'Design/tasks/review templates exist', ['assets/templates/design.md', 'assets/templates/tasks.md', 'assets/templates/review.md']),
|
|
95
|
+
criterion('C05-09', 'Change close/archive lifecycle exists', ['scripts/close-change.mjs', 'scripts/audit-change-lifecycle.mjs']),
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'GSE-C06',
|
|
100
|
+
name: 'Project Knowledge And Domain Model',
|
|
101
|
+
criteria: [
|
|
102
|
+
criterion('C06-01', 'Project profile reference exists', 'references/project-profile.md'),
|
|
103
|
+
criterion('C06-02', 'ADR template exists', 'assets/templates/adr.md'),
|
|
104
|
+
criterion('C06-03', 'Domain model reference exists', 'references/domain-model.md'),
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'GSE-C07',
|
|
109
|
+
name: 'Tool And Adapter Layer',
|
|
110
|
+
criteria: [
|
|
111
|
+
criterion('C07-01', 'Tool adapters reference exists', 'references/tool-adapters.md'),
|
|
112
|
+
criterion('C07-02', 'Project agent workspace reference exists', 'references/project-agent-workspace.md'),
|
|
113
|
+
criterion('C07-03', 'Host adapter templates exist', ['assets/templates/host-adapter.md', 'references/host-adapters.md']),
|
|
114
|
+
criterion('C07-04', 'Model routing reference exists', 'references/model-routing.md'),
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'GSE-C08',
|
|
119
|
+
name: 'Multi-Agent And Role Execution',
|
|
120
|
+
criteria: [
|
|
121
|
+
criterion('C08-01', 'Agent roles reference exists', 'references/agent-roles.md'),
|
|
122
|
+
criterion('C08-02', 'Dispatch template exists', 'assets/templates/dispatch-packet.md'),
|
|
123
|
+
criterion('C08-03', 'File ownership rules exist', 'references/file-ownership.md'),
|
|
124
|
+
criterion('C08-04', 'Forward-test protocol exists', 'references/forward-test.md'),
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'GSE-C09',
|
|
129
|
+
name: 'Implementation Discipline',
|
|
130
|
+
criteria: [
|
|
131
|
+
criterion('C09-01', 'Operating model exists', 'references/operating-model.md'),
|
|
132
|
+
criterion('C09-02', 'Quality gates exist', 'references/quality-gates.md'),
|
|
133
|
+
criterion('C09-03', 'Dirty worktree or ownership policy exists', ['references/dirty-worktree.md', 'references/file-ownership.md']),
|
|
134
|
+
criterion('C09-04', 'Execution quality pack template exists', 'assets/templates/execution-quality-pack.md'),
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'GSE-C10',
|
|
139
|
+
name: 'Verification And Evidence Gate',
|
|
140
|
+
criteria: [
|
|
141
|
+
criterion('C10-01', 'Evidence template exists', 'assets/templates/evidence.md'),
|
|
142
|
+
criterion('C10-02', 'Quality gates reference exists', 'references/quality-gates.md'),
|
|
143
|
+
criterion('C10-03', 'Evidence taxonomy exists', 'references/evidence-taxonomy.md'),
|
|
144
|
+
criterion('C10-04', 'Audit script exists', 'scripts/audit-gse.mjs'),
|
|
145
|
+
criterion('C10-05', 'Validation profile runner exists', ['scripts/run-validation-profile.mjs', 'scripts/audit-validation-profiles.mjs']),
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'GSE-C11',
|
|
150
|
+
name: 'Review, Quality, And Architecture Health',
|
|
151
|
+
criteria: [
|
|
152
|
+
criterion('C11-01', 'Quality gates reference exists', 'references/quality-gates.md'),
|
|
153
|
+
criterion('C11-02', 'Review reference exists', 'references/review.md'),
|
|
154
|
+
criterion('C11-03', 'Architecture health reference exists', 'references/architecture-health.md'),
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'GSE-C12',
|
|
159
|
+
name: 'Release, Incident, And Recovery',
|
|
160
|
+
criteria: [
|
|
161
|
+
criterion('C12-01', 'Incident review template exists', 'assets/templates/incident-review.md'),
|
|
162
|
+
criterion('C12-02', 'Release reference or template exists', ['references/release.md', 'assets/templates/release.md', '.gse/release.md']),
|
|
163
|
+
criterion('C12-03', 'Recovery or handoff protocol exists', ['references/recovery.md', 'references/handoff.md']),
|
|
164
|
+
criterion('C12-04', 'Release trust and key custody policy exists', ['references/release-trust.md', 'assets/templates/release-trust-record.md', 'scripts/audit-release-trust.mjs']),
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'GSE-C13',
|
|
169
|
+
name: 'Learning And Memory',
|
|
170
|
+
criteria: [
|
|
171
|
+
criterion('C13-01', 'Learning system reference exists', 'references/learning-system.md'),
|
|
172
|
+
criterion('C13-02', 'Learning promotion rules exist', ['references/learning-system.md']),
|
|
173
|
+
criterion('C13-03', 'Drift audit exists', 'references/drift-audit.md'),
|
|
174
|
+
criterion('C13-04', 'Learning capture command exists', ['scripts/record-learning.mjs', 'scripts/audit-learning-system.mjs']),
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: 'GSE-C14',
|
|
179
|
+
name: 'Packaging, Distribution, And Maintenance',
|
|
180
|
+
criteria: [
|
|
181
|
+
criterion('C14-01', 'Validation script exists', ['scripts/audit-gse.mjs', 'scripts/validate-gse.mjs']),
|
|
182
|
+
criterion('C14-02', 'Compatibility matrix exists', ['references/compatibility.md', '.gse/gse-design-master-plan.md']),
|
|
183
|
+
criterion('C14-03', 'Example fixtures exist', ['examples', 'fixtures', 'assets/examples']),
|
|
184
|
+
criterion('C14-04', 'Release notes or changelog policy exists', ['CHANGELOG.md', 'references/release.md']),
|
|
185
|
+
criterion('C14-05', 'Command semantics audit exists', 'scripts/audit-commands.mjs'),
|
|
186
|
+
criterion('C14-06', 'README docs audit exists', 'scripts/audit-readme-docs.mjs'),
|
|
187
|
+
criterion('C14-07', 'Local package and install scripts exist', ['scripts/package-gse.mjs', 'scripts/install-gse.mjs']),
|
|
188
|
+
criterion('C14-08', 'Distribution audit exists', 'scripts/audit-distribution.mjs'),
|
|
189
|
+
criterion('C14-09', 'Host command adapter scripts exist', ['scripts/generate-command-adapter.mjs', 'scripts/audit-command-adapters.mjs']),
|
|
190
|
+
criterion('C14-10', 'Remote URL distribution and integrity audit exists', 'scripts/audit-remote-distribution.mjs'),
|
|
191
|
+
criterion('C14-11', 'Package signing and verification scripts exist', ['scripts/sign-gse-package.mjs', 'scripts/verify-gse-package.mjs', 'scripts/audit-signing.mjs']),
|
|
192
|
+
criterion('C14-12', 'Marketplace discovery metadata exists', ['assets/marketplace/gse-listing.json', 'references/marketplace-discovery.md', 'scripts/audit-marketplace-discovery.mjs']),
|
|
193
|
+
criterion('C14-13', 'Host UI invocation evidence audit exists', ['assets/templates/host-ui-invocation-record.md', 'scripts/audit-host-ui-invocation.mjs']),
|
|
194
|
+
criterion('C14-14', 'Right-sized validation profile entrypoints exist', ['scripts/run-validation-profile.mjs', 'scripts/audit-validation-profiles.mjs']),
|
|
195
|
+
criterion('C14-15', 'Open-source defaults audit exists', ['references/open-source-defaults.md', 'scripts/audit-open-source-defaults.mjs', 'LICENSE']),
|
|
196
|
+
criterion('C14-16', 'Community support channel boundaries exist', ['references/community-channels.md', 'SUPPORT.md']),
|
|
197
|
+
criterion('C14-17', 'Node package metadata and npm pack audit exist', ['package.json', 'scripts/audit-npm-package-metadata.mjs']),
|
|
198
|
+
criterion('C14-18', 'Node package tarball install audit exists', 'scripts/audit-npm-tarball-install.mjs'),
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
]
|
|
202
|
+
|
|
203
|
+
function summarizeArea(area) {
|
|
204
|
+
const present = area.criteria.filter((item) => item.status === 'present').length
|
|
205
|
+
const total = area.criteria.length
|
|
206
|
+
const score = total === 0 ? 0 : present / total
|
|
207
|
+
let status = 'missing'
|
|
208
|
+
if (score === 1) status = 'strong'
|
|
209
|
+
else if (score >= 0.67) status = 'usable'
|
|
210
|
+
else if (score > 0) status = 'thin'
|
|
211
|
+
return { ...area, present, total, score: Number(score.toFixed(2)), status }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const areas = capabilityAreas.map(summarizeArea)
|
|
215
|
+
const totals = areas.reduce(
|
|
216
|
+
(acc, area) => {
|
|
217
|
+
acc.present += area.present
|
|
218
|
+
acc.total += area.total
|
|
219
|
+
acc[area.status] += 1
|
|
220
|
+
return acc
|
|
221
|
+
},
|
|
222
|
+
{ present: 0, total: 0, strong: 0, usable: 0, thin: 0, missing: 0 },
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
const summary = {
|
|
226
|
+
root,
|
|
227
|
+
generatedAt: new Date().toISOString(),
|
|
228
|
+
totals: {
|
|
229
|
+
...totals,
|
|
230
|
+
score: totals.total === 0 ? 0 : Number((totals.present / totals.total).toFixed(2)),
|
|
231
|
+
},
|
|
232
|
+
areas,
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function renderMarkdown(report) {
|
|
236
|
+
const lines = []
|
|
237
|
+
lines.push('# GSE Self-Audit')
|
|
238
|
+
lines.push('')
|
|
239
|
+
lines.push(`Generated: ${report.generatedAt}`)
|
|
240
|
+
lines.push(`Root: ${report.root}`)
|
|
241
|
+
lines.push('')
|
|
242
|
+
lines.push('## Summary')
|
|
243
|
+
lines.push('')
|
|
244
|
+
lines.push(`- Criteria present: ${report.totals.present}/${report.totals.total}`)
|
|
245
|
+
lines.push(`- Score: ${report.totals.score}`)
|
|
246
|
+
lines.push(`- Areas: strong ${report.totals.strong}, usable ${report.totals.usable}, thin ${report.totals.thin}, missing ${report.totals.missing}`)
|
|
247
|
+
lines.push('')
|
|
248
|
+
lines.push('## Areas')
|
|
249
|
+
lines.push('')
|
|
250
|
+
for (const area of report.areas) {
|
|
251
|
+
lines.push(`### ${area.id} - ${area.name}`)
|
|
252
|
+
lines.push('')
|
|
253
|
+
lines.push(`Status: ${area.status} (${area.present}/${area.total}, score ${area.score})`)
|
|
254
|
+
lines.push('')
|
|
255
|
+
for (const item of area.criteria) {
|
|
256
|
+
const marker = item.status === 'present' ? '[x]' : '[ ]'
|
|
257
|
+
const required = Array.isArray(item.required) ? item.required.join(' or ') : item.required
|
|
258
|
+
const note = item.note ? ` - ${item.note}` : ''
|
|
259
|
+
lines.push(`- ${marker} ${item.id}: ${item.label} (${required})${note}`)
|
|
260
|
+
}
|
|
261
|
+
lines.push('')
|
|
262
|
+
}
|
|
263
|
+
return `${lines.join('\n')}\n`
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (out) {
|
|
267
|
+
fs.mkdirSync(path.dirname(path.resolve(out)), { recursive: true })
|
|
268
|
+
fs.writeFileSync(path.resolve(out), renderMarkdown(summary), 'utf8')
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (jsonOnly || !out) {
|
|
272
|
+
console.log(JSON.stringify(summary, null, 2))
|
|
273
|
+
} else {
|
|
274
|
+
console.log(`Wrote ${path.resolve(out)}`)
|
|
275
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
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 keepTemp = args.includes('--keep-temp')
|
|
18
|
+
const tempRootArg = readArg('--temp-root', null)
|
|
19
|
+
const tempRoot = tempRootArg ? path.resolve(tempRootArg) : fs.mkdtempSync(path.join(os.tmpdir(), 'gse-host-adapter-audit-'))
|
|
20
|
+
const target = path.join(tempRoot, 'project')
|
|
21
|
+
const generator = path.join(root, 'scripts', 'generate-host-adapter.mjs')
|
|
22
|
+
|
|
23
|
+
function runNode(script, commandArgs) {
|
|
24
|
+
return spawnSync(process.execPath, [script, ...commandArgs], { cwd: root, encoding: 'utf8', windowsHide: true })
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseJson(text) {
|
|
28
|
+
try { return JSON.parse(text) } catch { return null }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function check(id, label, ok, evidence, risk = '') {
|
|
32
|
+
return { id, label, status: ok ? 'passed' : 'failed', evidence, risk }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function read(relativePath) {
|
|
36
|
+
const fullPath = path.join(target, relativePath)
|
|
37
|
+
if (!fs.existsSync(fullPath)) return ''
|
|
38
|
+
return fs.readFileSync(fullPath, 'utf8')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fs.rmSync(target, { recursive: true, force: true })
|
|
42
|
+
fs.mkdirSync(path.join(target, '.gse'), { recursive: true })
|
|
43
|
+
fs.writeFileSync(path.join(target, '.gse', 'project-profile.md'), '# Project Profile\n', 'utf8')
|
|
44
|
+
fs.writeFileSync(path.join(target, '.gse', 'goal-map.md'), '# Goal Map\nSECRET_GOAL_COPY_SENTINEL\n', 'utf8')
|
|
45
|
+
fs.writeFileSync(path.join(target, '.gse', 'quality-gates.md'), '# Quality Gates\nSECRET_GATE_COPY_SENTINEL\n', 'utf8')
|
|
46
|
+
|
|
47
|
+
const first = runNode(generator, ['--target', target, '--host', 'all', '--json'])
|
|
48
|
+
const firstJson = parseJson(first.stdout)
|
|
49
|
+
const codexText = read(path.join('.codex', 'gse-adapter.md'))
|
|
50
|
+
const claudeText = read(path.join('.claude', 'gse-adapter.md'))
|
|
51
|
+
const second = runNode(generator, ['--target', target, '--host', 'all', '--json'])
|
|
52
|
+
const secondJson = parseJson(second.stdout)
|
|
53
|
+
const beforeForce = codexText
|
|
54
|
+
const force = runNode(generator, ['--target', target, '--host', 'codex', '--force', '--json'])
|
|
55
|
+
const forceJson = parseJson(force.stdout)
|
|
56
|
+
const afterForce = read(path.join('.codex', 'gse-adapter.md'))
|
|
57
|
+
|
|
58
|
+
const adapterTexts = [codexText, claudeText, afterForce]
|
|
59
|
+
const checks = [
|
|
60
|
+
check('H01', 'generator exists', fs.existsSync(generator), 'scripts/generate-host-adapter.mjs'),
|
|
61
|
+
check('H02', 'first run writes Codex and Claude adapters', first.status === 0 && firstJson?.results?.filter((item) => item.status === 'written').length === 2, 'first run written count'),
|
|
62
|
+
check('H03', 'adapters point to .gse source of truth', codexText.includes('Source of truth: `.gse/`.') && claudeText.includes('Source of truth: `.gse/`.'), '.codex and .claude adapter text'),
|
|
63
|
+
check('H04', 'adapters include status vocabulary', adapterTexts.every((text) => text.includes('`verified`, `documented`, `unknown`, `unavailable`')), 'status vocabulary'),
|
|
64
|
+
check('H05', 'adapters do not copy portable goal map or quality gates', !adapterTexts.some((text) => text.includes('SECRET_GOAL_COPY_SENTINEL') || text.includes('SECRET_GATE_COPY_SENTINEL')), 'sentinel text absent'),
|
|
65
|
+
check('H06', 'second run skips existing adapters without force', second.status === 0 && secondJson?.results?.every((item) => item.status === 'skipped'), 'second run skipped'),
|
|
66
|
+
check('H07', 'force run explicitly rewrites selected adapter', force.status === 0 && forceJson?.results?.[0]?.status === 'written' && afterForce === beforeForce, 'force rewrite stable content'),
|
|
67
|
+
check('H08', 'unsupported host fails clearly', runNode(generator, ['--target', target, '--host', 'unsupported']).status === 1, 'unsupported host exit 1'),
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
const passed = checks.filter((item) => item.status === 'passed').length
|
|
71
|
+
const failed = checks.length - passed
|
|
72
|
+
const report = {
|
|
73
|
+
root,
|
|
74
|
+
generatedAt: new Date().toISOString(),
|
|
75
|
+
tempRoot,
|
|
76
|
+
target,
|
|
77
|
+
summary: { status: failed === 0 ? 'passed' : 'failed', passed, failed, total: checks.length },
|
|
78
|
+
workflows: { hostAdapterGeneration: failed === 0 ? 'verified' : 'failed' },
|
|
79
|
+
limits: [
|
|
80
|
+
'Host adapter audit verifies generated pointer files, not host runtime capabilities.',
|
|
81
|
+
'Codex and Claude adapter shapes are covered; other host families remain compatibility-matrix guidance until project evidence exists.',
|
|
82
|
+
'Generated adapters intentionally point back to .gse/ instead of copying portable policy.',
|
|
83
|
+
],
|
|
84
|
+
checks,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!keepTemp) fs.rmSync(tempRoot, { recursive: true, force: true })
|
|
88
|
+
|
|
89
|
+
function renderMarkdown(data) {
|
|
90
|
+
const lines = []
|
|
91
|
+
lines.push('# GSE Host Adapter Audit')
|
|
92
|
+
lines.push('')
|
|
93
|
+
lines.push('Generated: ' + data.generatedAt)
|
|
94
|
+
lines.push('Root: ' + data.root)
|
|
95
|
+
lines.push('Temp root: ' + data.tempRoot)
|
|
96
|
+
lines.push('')
|
|
97
|
+
lines.push('## Summary')
|
|
98
|
+
lines.push('')
|
|
99
|
+
lines.push('- Status: ' + data.summary.status)
|
|
100
|
+
lines.push('- Checks: ' + data.summary.passed + '/' + data.summary.total)
|
|
101
|
+
lines.push('- Host adapter generation: ' + data.workflows.hostAdapterGeneration)
|
|
102
|
+
lines.push('')
|
|
103
|
+
lines.push('## Checks')
|
|
104
|
+
lines.push('')
|
|
105
|
+
for (const item of data.checks) {
|
|
106
|
+
const marker = item.status === 'passed' ? '[x]' : '[ ]'
|
|
107
|
+
lines.push('- ' + marker + ' ' + item.id + ' ' + item.label + ': ' + item.evidence)
|
|
108
|
+
}
|
|
109
|
+
lines.push('')
|
|
110
|
+
lines.push('## Limits')
|
|
111
|
+
lines.push('')
|
|
112
|
+
for (const item of data.limits) lines.push('- ' + item)
|
|
113
|
+
return lines.join('\n') + '\n'
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (jsonOnly) console.log(JSON.stringify(report, null, 2))
|
|
117
|
+
else console.log(renderMarkdown(report))
|
|
118
|
+
|
|
119
|
+
if (failed > 0) process.exit(1)
|