feat: Phase 0 workspace, spikes, and golden harness
Stand up the monorepo skeleton and land the first Phase 0 artifacts: pairing threat model, plugin catalog, builder detect, 20-prompt golden harness, and synthetic 2GB mirror timing.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { GoldenAssert, SiteFixture } from './types.ts';
|
||||
|
||||
export type AssertionResult = {
|
||||
ok: boolean;
|
||||
};
|
||||
|
||||
function pageText(site: SiteFixture, slug: string): string {
|
||||
const post = site.posts.find((item) => item.slug === slug);
|
||||
if (post === undefined) {
|
||||
return '';
|
||||
}
|
||||
return `${post.content}\n${Object.values(post.meta).join('\n')}`;
|
||||
}
|
||||
|
||||
export function checkAssertion(site: SiteFixture, assertion: GoldenAssert): AssertionResult {
|
||||
if (assertion.type === 'option') {
|
||||
return { ok: site.options[assertion.key] === assertion.value };
|
||||
}
|
||||
return { ok: pageText(site, assertion.page).includes(assertion.contains) };
|
||||
}
|
||||
Reference in New Issue
Block a user