Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatstupidcomputer / tests/site/fixture.ts |
| Date | Not specified in source |
| Repository | Janady13/thatstupidcomputer |
| Revision | 57555cde46910102dd25d6c1c1fb2c359e9655bd |
| Branch | main |
| Path or archive member | tests/site/fixture.ts |
| Original SHA-256 | 7cfde61e02cb5afb308decf87c8aed4e7da8cd85d25793567f470d2545c4f607 |
| Git blob SHA | e43c31926bed6c813728d5ead62976a4274f40c2 |
| Reading-copy SHA-256 | 7cfde61e02cb5afb308decf87c8aed4e7da8cd85d25793567f470d2545c4f607 |
Recovered source transcript
Download complete source text ↓25 lines · 2.2 KB
import type { TruthProjection, PublicCrawlerPolicy } from '../../packages/site/truth.ts';
export const TEST_CRAWLER_POLICY: PublicCrawlerPolicy = { training: 'deny', googleExtended: 'deny', source: 'deployment-config' };
/** Synthetic unit-test data only. Not an approved business export; never copied into production. */
export function projectionFixture(): TruthProjection {
const now = Date.now();
const fixture: TruthProjection = {
schemaVersion: 'tsc-public-projection/v1', audience: 'public',
provenance: { sourceCommit: 'a'.repeat(40), exportedAt: new Date(now - 1000).toISOString() },
approval: { status: 'approved-for-publication', reviewedAt: new Date(now - 2000).toISOString(), expiresAt: new Date(now + 86400000).toISOString(), claimRefs: ['TEST-ONLY:claim-1'], approvedPaths: [] },
site: { origin: 'https://thatstupidcomputer.com', name: 'That Stupid Computer', websiteId: 'https://thatstupidcomputer.com/#website', publisherId: 'https://fixture-only.thatstupidcomputer.com/#canonical-test-organization', providerId: 'https://fixture-only.thatstupidcomputer.com/#canonical-test-organization', brandId: 'https://fixture-only.thatstupidcomputer.com/#canonical-test-brand', contactId: 'https://fixture-only.thatstupidcomputer.com/#canonical-test-organization' },
entities: [
{ id: 'https://fixture-only.thatstupidcomputer.com/#canonical-test-organization', type: 'Organization', name: 'TEST FIXTURE — NEVER PUBLISH', url: 'https://fixture-only.thatstupidcomputer.com/', email: 'test-only@fixture-only.thatstupidcomputer.com' },
{ id: 'https://fixture-only.thatstupidcomputer.com/#canonical-test-brand', type: 'Brand', name: 'TEST FIXTURE BRAND — NEVER PUBLISH', url: 'https://fixture-only.thatstupidcomputer.com/brand/' },
],
};
approveFixturePaths(fixture);
return fixture;
}
export function approveFixturePaths(fixture: TruthProjection): void {
function leaves(value: unknown, prefix: string): string[] {
return value && typeof value === 'object' ? Object.entries(value).flatMap(([key, v]) => leaves(v, `${prefix}/${key}`)) : [prefix];
}
fixture.approval.approvedPaths = [...leaves(fixture.site, '/site'), ...leaves(fixture.entities, '/entities')];
}