@archangel70/cosmo 1.16.1 → 1.16.3
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/CHANGELOG.md +15 -0
- package/README.md +3 -3
- package/package.json +4 -2
- package/packages/cli/bin/cosmo.mjs +1 -1
- package/packages/cli/lib/intelligence-audit.mjs +89 -12
- package/plugins/agent-skills/cosmo/.cosmo-agent.json +1 -1
- package/plugins/antigravity/cosmo.md +1 -1
- package/plugins/claude-code/cosmo/.claude-plugin/plugin.json +1 -1
- package/scripts/audit-dependencies.mjs +82 -0
- package/templates/astro-site/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable Cosmo changes are recorded here.
|
|
4
4
|
|
|
5
|
+
## 1.16.3 — Unified dependency security gate
|
|
6
|
+
|
|
7
|
+
- Upgraded `basic-ftp` to 6.2.6, resolving the published directory-listing and credential newline denial-of-service advisories in Cosmo's FTP deployment path.
|
|
8
|
+
- Made Verify and Release run the same package smoke test and dependency-security gate before publication.
|
|
9
|
+
- Pinned the trusted-publishing runner to npm 11.21.3 so npm 12 lifecycle-policy changes cannot silently bypass Cosmo's launcher installation smoke test.
|
|
10
|
+
- Added one exact, documented exception for the unpatched `picomatch` advisory, limited to its dependency chain and expiring December 17, 2026.
|
|
11
|
+
- Made the exception fail closed when it expires, when a different high-severity advisory appears, or when the upstream finding disappears and the exception should be removed.
|
|
12
|
+
|
|
13
|
+
## 1.16.2 — Native Astro intelligence resilience
|
|
14
|
+
|
|
15
|
+
- Stopped intelligence checks from parsing Astro's JavaScript and TypeScript frontmatter as YAML on adopted native sites.
|
|
16
|
+
- Preserved native route metadata for editorial and regulated checks while inspecting only the rendered template surface for copy patterns.
|
|
17
|
+
- Converted unreadable native page sources into scoped findings and isolated unexpected pack failures so one problem cannot erase the rest of the intelligence report.
|
|
18
|
+
- Added regression coverage for JavaScript-heavy Astro pages and partial intelligence reports.
|
|
19
|
+
|
|
5
20
|
## 1.16.1 — Node compatibility guard
|
|
6
21
|
|
|
7
22
|
- Raised Cosmo's declared, documented, diagnosed, and CI-tested Node.js minimum to 22.23.4, matching the secured Astro toolchain shipped with v1.16.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Cosmo helps an AI coding assistant build a complete, original Astro website for
|
|
|
4
4
|
|
|
5
5
|
You do **not** need to know how to code. Cosmo supports Claude Code, Codex, and Google Antigravity.
|
|
6
6
|
|
|
7
|
-
Current version: **1.16.
|
|
7
|
+
Current version: **1.16.3**
|
|
8
8
|
|
|
9
9
|
## Quick install
|
|
10
10
|
|
|
@@ -82,7 +82,7 @@ This is the only part of the beginner setup that uses a terminal. It is one inst
|
|
|
82
82
|
cosmo --version
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
You should see `1.16.
|
|
85
|
+
You should see `1.16.3` or a newer version. Cosmo automatically installs its Claude, Codex, and Antigravity launchers.
|
|
86
86
|
|
|
87
87
|
### On Windows
|
|
88
88
|
|
|
@@ -99,7 +99,7 @@ You should see `1.16.1` or a newer version. Cosmo automatically installs its Cla
|
|
|
99
99
|
cosmo --version
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
You should see `1.16.
|
|
102
|
+
You should see `1.16.3` or a newer version. Cosmo automatically installs its Claude, Codex, and Antigravity launchers.
|
|
103
103
|
|
|
104
104
|
## Step 4: create your website folder
|
|
105
105
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archangel70/cosmo",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.3",
|
|
4
4
|
"description": "Local-first, multi-agent Astro website builder for Claude, Codex, Antigravity, and the command line.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"docs/WORKFLOWS.md",
|
|
60
60
|
"CHANGELOG.md",
|
|
61
61
|
"SECURITY.md",
|
|
62
|
+
"scripts/audit-dependencies.mjs",
|
|
62
63
|
"scripts/postinstall.mjs"
|
|
63
64
|
],
|
|
64
65
|
"repository": {
|
|
@@ -84,13 +85,14 @@
|
|
|
84
85
|
"entity:qa": "node packages/cli/bin/cosmo.mjs entity check templates/astro-site",
|
|
85
86
|
"browser:qa": "node packages/cli/bin/cosmo.mjs browser check templates/astro-site",
|
|
86
87
|
"package:smoke": "node scripts/smoke-package.mjs",
|
|
88
|
+
"audit:dependencies": "node scripts/audit-dependencies.mjs",
|
|
87
89
|
"postinstall": "node scripts/postinstall.mjs",
|
|
88
90
|
"test": "node --test packages/cli/test/*.test.mjs",
|
|
89
91
|
"verify": "npm run test && npm run check && npm run integrity:qa && npm run entity:qa && npm run qa && npm run copy:qa && npm run content:qa && npm run intelligence:qa && npm run browser:qa"
|
|
90
92
|
},
|
|
91
93
|
"dependencies": {
|
|
92
94
|
"axe-core": "^4.13.0",
|
|
93
|
-
"basic-ftp": "^6.2.
|
|
95
|
+
"basic-ftp": "^6.2.6",
|
|
94
96
|
"chrome-launcher": "^1.2.1",
|
|
95
97
|
"gray-matter": "^4.0.3",
|
|
96
98
|
"lighthouse": "^13.4.1",
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
workflowSummary,
|
|
68
68
|
} from '../lib/workflow.mjs';
|
|
69
69
|
|
|
70
|
-
const VERSION = '1.16.
|
|
70
|
+
const VERSION = '1.16.3';
|
|
71
71
|
const cliDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
72
72
|
const templateDirectory = path.resolve(cliDirectory, '../../../templates/astro-site');
|
|
73
73
|
const [command = 'start', ...rawArgs] = process.argv.slice(2);
|
|
@@ -58,10 +58,45 @@ function nativePlan(projectDir) {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
function pageContent(projectDir, page) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
if (typeof page.contentFile !== 'string' || !page.contentFile.trim()) {
|
|
62
|
+
return { file: null, data: null, surface: '', error: 'No content source is recorded for this page.' };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const projectRoot = path.resolve(projectDir);
|
|
66
|
+
const file = path.resolve(projectRoot, page.contentFile);
|
|
67
|
+
if (file !== projectRoot && !file.startsWith(`${projectRoot}${path.sep}`)) {
|
|
68
|
+
return { file, data: null, surface: '', error: 'The content source resolves outside the project.' };
|
|
69
|
+
}
|
|
70
|
+
if (!fs.existsSync(file)) {
|
|
71
|
+
return { file, data: null, surface: '', error: 'The content source does not exist.' };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
const source = fs.readFileSync(file, 'utf8');
|
|
76
|
+
if (path.extname(file).toLowerCase() === '.astro') {
|
|
77
|
+
const surface = source.replace(/^\uFEFF?---[ \t]*\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/, '');
|
|
78
|
+
return { file, data: page.data ?? {}, surface };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const parsed = matter(source);
|
|
82
|
+
return { file, data: parsed.data, surface: `${JSON.stringify(parsed.data)}\n${parsed.content}` };
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return { file, data: null, surface: '', error: error instanceof Error ? error.message : String(error) };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function pageContentFinding(packId, page, content) {
|
|
89
|
+
return finding(
|
|
90
|
+
packId,
|
|
91
|
+
'page-content-unreadable',
|
|
92
|
+
'blocking',
|
|
93
|
+
`Page ${page.id} could not be inspected from ${page.contentFile ?? 'an unrecorded source'}: ${content.error}`,
|
|
94
|
+
'Repair the page source or update the native route inventory so Cosmo can inspect it.'
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function readPageContent(context, page) {
|
|
99
|
+
return context.pageContent ? context.pageContent(page) : pageContent(context.projectDir, page);
|
|
65
100
|
}
|
|
66
101
|
|
|
67
102
|
function artifactState(projectDir, pack) {
|
|
@@ -134,11 +169,16 @@ function localFindings(context, artifact) {
|
|
|
134
169
|
}
|
|
135
170
|
|
|
136
171
|
function editorialFindings(context) {
|
|
137
|
-
const {
|
|
172
|
+
const { plan, pack } = context;
|
|
138
173
|
const findings = [];
|
|
139
174
|
const editorialTypes = new Set(['guide', 'answer', 'standard']);
|
|
140
175
|
for (const page of plan.pages.filter((item) => item.architecture?.indexability === 'index' && editorialTypes.has(item.type))) {
|
|
141
|
-
const
|
|
176
|
+
const inspected = readPageContent(context, page);
|
|
177
|
+
if (inspected.error) {
|
|
178
|
+
findings.push(pageContentFinding(pack.id, page, inspected));
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const content = inspected.data;
|
|
142
182
|
for (const key of ['author', 'reviewedBy', 'publishedAt', 'correctionPolicy']) if (!nonEmpty(content?.editorial?.[key])) findings.push(finding(pack.id, 'editorial-metadata-missing', 'blocking', `Indexable editorial page ${page.id} is missing editorial.${key}.`, `Add approved ${key} metadata to the page.`));
|
|
143
183
|
for (const key of ['publishedAt', 'updatedAt']) if (content?.editorial?.[key] && Number.isNaN(Date.parse(content.editorial[key]))) findings.push(finding(pack.id, 'editorial-date-invalid', 'blocking', `Page ${page.id} has an invalid editorial.${key}.`, 'Use an ISO 8601 date.'));
|
|
144
184
|
}
|
|
@@ -146,8 +186,17 @@ function editorialFindings(context) {
|
|
|
146
186
|
}
|
|
147
187
|
|
|
148
188
|
function regulatedFindings(context, artifact) {
|
|
149
|
-
const {
|
|
189
|
+
const { plan, evidence, pack } = context;
|
|
150
190
|
const findings = [];
|
|
191
|
+
const unreadable = new Set();
|
|
192
|
+
const inspect = (page) => {
|
|
193
|
+
const content = readPageContent(context, page);
|
|
194
|
+
if (content.error && !unreadable.has(page.id)) {
|
|
195
|
+
findings.push(pageContentFinding(pack.id, page, content));
|
|
196
|
+
unreadable.add(page.id);
|
|
197
|
+
}
|
|
198
|
+
return content;
|
|
199
|
+
};
|
|
151
200
|
const claims = new Map(evidence.claims.map((claim) => [claim.id, claim]));
|
|
152
201
|
for (const page of plan.pages) {
|
|
153
202
|
const highRisk = (page.contract?.supportsClaims ?? []).map((id) => claims.get(id)).filter((claim) => claim?.risk === 'high');
|
|
@@ -157,7 +206,9 @@ function regulatedFindings(context, artifact) {
|
|
|
157
206
|
if (!verified) findings.push(finding(pack.id, 'regulated-claim-unverified', 'blocking', `Page ${page.id} uses high-risk claim ${claim.id} without verified proof.`, 'Obtain reviewer-approved proof or remove the claim.'));
|
|
158
207
|
}
|
|
159
208
|
if (page.architecture?.indexability === 'index') {
|
|
160
|
-
const
|
|
209
|
+
const content = inspect(page);
|
|
210
|
+
if (content.error) continue;
|
|
211
|
+
const review = content.data?.regulatoryReview;
|
|
161
212
|
for (const key of ['reviewedBy', 'reviewedAt', 'jurisdiction']) if (!nonEmpty(review?.[key])) findings.push(finding(pack.id, 'regulatory-review-missing', 'blocking', `Indexable regulated page ${page.id} is missing regulatoryReview.${key}.`, 'Record the authorized review before indexing.'));
|
|
162
213
|
if (review?.status !== 'approved') findings.push(finding(pack.id, 'regulatory-review-not-approved', 'blocking', `Indexable regulated page ${page.id} does not have approved regulatory review.`, 'Set status to approved only after the named reviewer signs off.'));
|
|
163
214
|
const suppliedDisclaimers = new Set(review?.disclaimers ?? []);
|
|
@@ -166,7 +217,9 @@ function regulatedFindings(context, artifact) {
|
|
|
166
217
|
}
|
|
167
218
|
const prohibited = Array.isArray(artifact?.prohibitedClaims) ? artifact.prohibitedClaims.filter((item) => typeof item === 'string' && item.trim()) : [];
|
|
168
219
|
for (const page of plan.pages) {
|
|
169
|
-
const
|
|
220
|
+
const content = inspect(page);
|
|
221
|
+
if (content.error) continue;
|
|
222
|
+
const surface = normalized(content.surface);
|
|
170
223
|
for (const phrase of prohibited) if (surface.includes(normalized(phrase))) findings.push(finding(pack.id, 'prohibited-regulated-claim', 'blocking', `Page ${page.id} contains prohibited claim language: “${phrase}”.`, 'Remove the language and request regulated-content review.'));
|
|
171
224
|
}
|
|
172
225
|
return findings;
|
|
@@ -332,7 +385,12 @@ function editorialNaturalnessFindings(context, artifact) {
|
|
|
332
385
|
}
|
|
333
386
|
const allowed = new Set((artifact?.allowedPatterns ?? []).map(String));
|
|
334
387
|
for (const page of plan.pages) {
|
|
335
|
-
const
|
|
388
|
+
const content = readPageContent(context, page);
|
|
389
|
+
if (content.error) {
|
|
390
|
+
findings.push(pageContentFinding(pack.id, page, content));
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
const surface = content.surface;
|
|
336
394
|
const hits = [];
|
|
337
395
|
for (const item of NATURALNESS_PATTERNS) {
|
|
338
396
|
const matches = [...surface.matchAll(new RegExp(item.pattern.source, item.pattern.flags))];
|
|
@@ -457,10 +515,29 @@ export function evaluateIntelligence(projectDir) {
|
|
|
457
515
|
? nativePlan(projectDir)
|
|
458
516
|
: readJson(path.join(projectDir, '.cosmo', 'build-plan.json')) ?? { pages: [] };
|
|
459
517
|
const evidence = readJson(path.join(projectDir, '.cosmo', 'evidence.json')) ?? { claims: [], proofs: [] };
|
|
518
|
+
const pageContentCache = new Map();
|
|
519
|
+
const cachedPageContent = (page) => {
|
|
520
|
+
const key = `${page.id ?? ''}\0${page.contentFile ?? ''}`;
|
|
521
|
+
if (!pageContentCache.has(key)) pageContentCache.set(key, pageContent(projectDir, page));
|
|
522
|
+
return pageContentCache.get(key);
|
|
523
|
+
};
|
|
460
524
|
const packs = intelligence.manifests.map((pack) => {
|
|
461
525
|
const artifact = artifactState(projectDir, pack);
|
|
462
|
-
const context = { projectDir, project, plan, evidence, pack };
|
|
463
|
-
|
|
526
|
+
const context = { projectDir, project, plan, evidence, pack, pageContent: cachedPageContent };
|
|
527
|
+
let specialized = [];
|
|
528
|
+
if (artifact.data) {
|
|
529
|
+
try {
|
|
530
|
+
specialized = EVALUATORS[pack.id]?.(context, artifact.data) ?? [];
|
|
531
|
+
} catch (error) {
|
|
532
|
+
specialized = [finding(
|
|
533
|
+
pack.id,
|
|
534
|
+
'pack-evaluation-failed',
|
|
535
|
+
'blocking',
|
|
536
|
+
`${pack.title} could not finish its evaluation: ${error instanceof Error ? error.message : String(error)}`,
|
|
537
|
+
'Repair the reported project input or pack configuration, then run the intelligence check again.'
|
|
538
|
+
)];
|
|
539
|
+
}
|
|
540
|
+
}
|
|
464
541
|
const findings = [...artifact.findings, ...declarativeFindings(pack, artifact.data), ...specialized];
|
|
465
542
|
const blocking = findings.filter((item) => item.severity === 'blocking').length;
|
|
466
543
|
const warnings = findings.filter((item) => item.severity === 'warning').length;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
|
|
4
|
+
export const AUDIT_EXCEPTIONS = [{
|
|
5
|
+
source: '1247710',
|
|
6
|
+
advisory: 'GHSA-fc5q-39xc-vjpf',
|
|
7
|
+
package: 'picomatch',
|
|
8
|
+
expiresAt: '2026-12-17T23:59:59Z',
|
|
9
|
+
rationale: 'No patched picomatch release exists. Cosmo and its Astro toolchain do not accept untrusted public glob expressions.',
|
|
10
|
+
}];
|
|
11
|
+
|
|
12
|
+
const severityRank = { info: 0, low: 1, moderate: 2, high: 3, critical: 4 };
|
|
13
|
+
|
|
14
|
+
function rootAdvisories(vulnerabilities, name, visiting = new Set()) {
|
|
15
|
+
if (visiting.has(name)) return [{ source: `cycle:${name}`, advisory: null, package: name }];
|
|
16
|
+
const vulnerability = vulnerabilities[name];
|
|
17
|
+
if (!vulnerability) return [{ source: `dependency:${name}`, advisory: null, package: name }];
|
|
18
|
+
const next = new Set(visiting);
|
|
19
|
+
next.add(name);
|
|
20
|
+
const roots = [];
|
|
21
|
+
for (const via of vulnerability.via ?? []) {
|
|
22
|
+
if (typeof via === 'string') roots.push(...rootAdvisories(vulnerabilities, via, next));
|
|
23
|
+
else roots.push({
|
|
24
|
+
source: String(via.source),
|
|
25
|
+
advisory: typeof via.url === 'string' ? via.url.split('/').pop() : null,
|
|
26
|
+
package: via.name ?? name,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return roots.length ? roots : [{ source: `dependency:${name}`, advisory: null, package: name }];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function evaluateAudit(report, { exceptions = AUDIT_EXCEPTIONS, now = new Date(), minimumSeverity = 'high' } = {}) {
|
|
33
|
+
const vulnerabilities = report?.vulnerabilities ?? {};
|
|
34
|
+
const threshold = severityRank[minimumSeverity] ?? severityRank.high;
|
|
35
|
+
const exceptionBySource = new Map(exceptions.map((item) => [String(item.source), item]));
|
|
36
|
+
const used = new Set();
|
|
37
|
+
const accepted = [];
|
|
38
|
+
const unexpected = [];
|
|
39
|
+
|
|
40
|
+
for (const [name, vulnerability] of Object.entries(vulnerabilities)) {
|
|
41
|
+
if ((severityRank[vulnerability.severity] ?? 0) < threshold) continue;
|
|
42
|
+
const roots = rootAdvisories(vulnerabilities, name);
|
|
43
|
+
const matched = roots.map((root) => ({ root, exception: exceptionBySource.get(root.source) }));
|
|
44
|
+
const allowed = matched.length > 0 && matched.every(({ exception }) => exception && Date.parse(exception.expiresAt) > now.getTime());
|
|
45
|
+
if (allowed) {
|
|
46
|
+
for (const { exception } of matched) used.add(String(exception.source));
|
|
47
|
+
accepted.push({ name, severity: vulnerability.severity, advisories: [...new Set(matched.map(({ exception }) => exception.advisory))] });
|
|
48
|
+
} else {
|
|
49
|
+
unexpected.push({ name, severity: vulnerability.severity, roots });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const expired = exceptions.filter((item) => Date.parse(item.expiresAt) <= now.getTime());
|
|
54
|
+
const stale = exceptions.filter((item) => !expired.includes(item) && !used.has(String(item.source)));
|
|
55
|
+
return { passed: unexpected.length === 0 && expired.length === 0 && stale.length === 0, accepted, unexpected, expired, stale };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function run() {
|
|
59
|
+
const audit = spawnSync('npm', ['audit', '--json'], { encoding: 'utf8', maxBuffer: 20 * 1024 * 1024 });
|
|
60
|
+
let report;
|
|
61
|
+
try {
|
|
62
|
+
report = JSON.parse(audit.stdout);
|
|
63
|
+
} catch {
|
|
64
|
+
console.error('Dependency audit failed: npm did not return a readable JSON report.');
|
|
65
|
+
if (audit.stderr) console.error(audit.stderr.trim());
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const result = evaluateAudit(report);
|
|
71
|
+
for (const item of result.accepted) console.warn(`Accepted temporary advisory exception: ${item.name} (${item.advisories.join(', ')}).`);
|
|
72
|
+
for (const item of result.unexpected) console.error(`Unaccepted ${item.severity} dependency finding: ${item.name}.`);
|
|
73
|
+
for (const item of result.expired) console.error(`Dependency-audit exception expired: ${item.advisory} on ${item.expiresAt}.`);
|
|
74
|
+
for (const item of result.stale) console.error(`Dependency-audit exception is no longer needed and must be removed: ${item.advisory}.`);
|
|
75
|
+
if (!result.passed) {
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
console.log(`Dependency audit passed with ${result.accepted.length} finding(s) covered by an explicit temporary exception.`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) run();
|