Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 42s
CI / OCR Service Tests (pull_request) Successful in 25s
CI / Backend Unit Tests (pull_request) Successful in 6m14s
CI / fail2ban Regex (pull_request) Successful in 48s
CI / Semgrep Security Scan (pull_request) Successful in 27s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m8s
SDD Gate / RTM Check (pull_request) Successful in 15s
SDD Gate / Contract Validate (pull_request) Successful in 27s
SDD Gate / Constitution Impact (pull_request) Successful in 19s
The grep gate fails if any lib/timeline component reaches for the raw-HTML directive (CWE-79, REQ-010). The RTM gains thirteen rows tracing every #850 requirement to its implementation file(s) and test(s), Status Done. Refs #850
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { readdirSync, readFileSync } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { dirname, join } from 'node:path';
|
|
|
|
const timelineDir = dirname(fileURLToPath(import.meta.url));
|
|
|
|
/**
|
|
* REQ-010 / CWE-79: inline event clustering renders curator event titles and import-derived
|
|
* letter titles + sender/receiver text through every component under lib/timeline (the reused
|
|
* LetterCard, the new EventCluster card, the existing pills/bands/strip). That text must always
|
|
* render through Svelte's default `{...}` escaping — never `{@html}`. This grep gate fails loudly
|
|
* the moment any timeline component reaches for the raw-HTML directive.
|
|
*/
|
|
describe('lib/timeline never uses {@html} (REQ-010)', () => {
|
|
it('no timeline component contains the raw-HTML directive', () => {
|
|
const components = readdirSync(timelineDir).filter((file) => file.endsWith('.svelte'));
|
|
expect(components.length).toBeGreaterThan(0);
|
|
const offenders = components.filter((file) =>
|
|
readFileSync(join(timelineDir, file), 'utf8').includes('{@html')
|
|
);
|
|
expect(offenders).toEqual([]);
|
|
});
|
|
});
|