Files
gstack/test/cso-spec-taxonomy-alignment.test.ts
T
Garry TanandOpenAI Codex 4a3c6a8a3c v1.87.0.0 feat: add verified CSO audits and replayable repair bundles (#2852)
* feat(cso): add verified audits and replayable repair bundles

* fix(cso): harden qualification and setup boundaries

* fix(cso): assemble security canaries at runtime

* fix(cso): bound release proof and maintenance work

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cso): require complete evaluation reports

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cso): replay expired snapshots from supplied source

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test(cso): synchronize DNS cancellation assertion

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* chore(ship): exempt repository owner from liveness proof

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* test(cso): make recheck retention overlap deterministic

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* chore: bump version and changelog (v1.85.0.0)

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cso): pass native release gates

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* chore: move release to v1.86.0.0

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cso): resolve rechecks by finding

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* chore: move release to v1.87.0.0

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cso): pass macOS and Windows release gates

Normalize BSD wc output, compare Windows paths by filesystem identity, preserve portable snapshot race coverage, and narrow POSIX-only Windows fixtures.

Co-Authored-By: OpenAI Codex <noreply@openai.com>

* fix(cso): harden native verification gates

* fix(cso): refine Windows native diagnostics

* test(cso): isolate Windows Git startup failure

* test(cso): stabilize Windows native diagnostics

* fix(cso): support hardened Git on Windows

* fix(cso): close final verification gaps

* test(cso): bound cold Docker fixture setup

* fix(cso): restore cross-platform free-suite gates

---------

Co-authored-by: OpenAI Codex <noreply@openai.com>
2026-09-14 15:14:58 -07:00

49 lines
2.5 KiB
TypeScript

/** CSO uses versioned domain mappings and the shared fail-closed secret taxonomy. */
import { describe, test, expect } from 'bun:test';
import * as fs from 'fs';
import * as path from 'path';
const ROOT = path.resolve(import.meta.dir, '..');
const CSO = fs.readFileSync(path.join(ROOT, 'cso/SKILL.md'), 'utf8') + '\n'
+ fs.readFileSync(path.join(ROOT, 'cso/sections/audit-phases.md'), 'utf8');
describe('CSO domain source and redaction contracts', () => {
test('credential recognition uses the shared taxonomy without raw history commands', () => {
for (const prefix of ['AKIA', 'ghp_', 'sk-ant-', 'BEGIN']) expect(CSO).toContain(prefix);
expect(CSO).toContain('lib/redact-patterns.ts');
expect(CSO).toContain('Secrets Archaeology');
expect(CSO).toContain('Never print raw `git log -p --all`');
expect(CSO).toContain('Do not call live provider APIs');
});
test('OWASP 2025 mapping does not retain obsolete 2021 category numbers', () => {
const rows = CSO.split('\n').filter(line => /^\| A\d\d \|/.test(line));
expect(rows).toHaveLength(10);
const categories = new Map(rows.map(line => {
const [, id, name] = line.split('|').map(part => part.trim());
return [id, name];
}));
expect(categories.get('A02')).toBe('Security Misconfiguration');
expect(categories.get('A03')).toBe('Software Supply Chain Failures');
expect(categories.get('A10')).toBe('Mishandling of Exceptional Conditions');
expect(rows.find(line => line.startsWith('| A01 |'))).toContain('SSRF');
});
test('domain standards carry inspected versions and no inferred compliance', () => {
for (const version of ['OWASP Top 10:2025', 'OWASP API Security Top 10:2023', 'ASVS version: 5.0.0', 'v5.0.0-1.2.5', 'LLM Top 10 2026', 'Agentic Applications Top 10 2026', 'MCP security guidance version: 2026-07-28']) expect(CSO).toContain(version);
expect(CSO).toContain('artifact 56857');
expect(CSO).toContain('unset publication-date field');
expect(CSO).toContain('artifact 52117');
expect(CSO).toContain('Do not invent IDs');
});
test('all declared scanners retain execution and evidence boundaries', () => {
for (const scanner of ['Gitleaks', 'OSV-Scanner', 'Semgrep', 'zizmor', 'Trivy', 'Schemathesis']) expect(CSO).toContain(scanner);
expect(CSO).toContain('Import existing SARIF');
expect(CSO).toContain('public wheels');
expect(CSO).toContain('Gemfile.lock` parsed as inert data');
expect(CSO).toContain('Python `--no-build` alone');
expect(CSO).toContain('every database connection');
});
});