chore(harness): make repository agent-ready

Add concise routed context, task-aware agent roles, focused skills, and structured learning promotion.\n\nUnify local development and workspace tooling, add layered test and E2E verification, harden MCP authentication, and gate deployment behind verification and explicit production promotion.
This commit is contained in:
jjbrunton committed 2026-08-27 20:58:48 +01:00
1 parent 5a69bbc1a5
commit 01bb8225ae
125 files changed
+5078 -24529

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import { expect, test } from '@playwright/test';
const admin = process.env.ADMIN_URL ?? 'http://127.0.0.1:3001';
test('unauthenticated admin access reaches the real login boundary', async ({ page }) => {
await page.goto(admin);
await expect(page).toHaveURL(/\/login$/);
await expect(page.getByRole('heading', { name: 'Welcome Back' })).toBeVisible();
await expect(page.getByLabel('Email Address')).toBeVisible();
await expect(page.getByLabel('Password')).toBeVisible();
});
+11
View File
@@ -0,0 +1,11 @@
import { expect, test } from '@playwright/test';
const mcp = process.env.MCP_URL ?? 'http://127.0.0.1:3002';
test('MCP health is available while tool access requires auth', async ({ request }) => {
const health = await request.get(`${mcp}/health`);
expect(health.ok()).toBe(true);
expect(await health.json()).toMatchObject({ status: 'ok', service: 'sauci-mcp' });
const tools = await request.post(`${mcp}/mcp`);
expect(tools.status()).toBe(401);
});
+43
View File
@@ -0,0 +1,43 @@
import { expect, test } from '@playwright/test';
import { createRedemptionFixture } from '../helpers/local-supabase';
const web = process.env.WEB_URL ?? 'http://127.0.0.1:3000';
test('marketing home renders the primary product journey', async ({ page }) => {
await page.goto(web);
await expect(page.getByRole('main')).toBeVisible();
await expect(page.getByRole('link', { name: /get started|download/i }).first()).toBeVisible();
});
test('redemption validates input without calling the backend', async ({ page }) => {
await page.goto(`${web}/redeem`);
await page.getByLabel('Email Address').fill('not-an-email');
await page.getByLabel('Redemption Code').fill('ANY-CODE');
await page.getByRole('button', { name: 'Redeem Code' }).click();
await expect(page.getByText('Please enter a valid email address')).toBeVisible();
});
test('redemption updates server state and visible product state', async ({ page }) => {
const fixture = await createRedemptionFixture();
try {
await page.goto(`${web}/redeem`);
await page.getByLabel('Email Address').fill(fixture.email);
await page.getByLabel('Redemption Code').fill(fixture.code);
await page.getByRole('button', { name: 'Redeem Code' }).click();
await expect(page.getByRole('heading', { name: 'Code Redeemed!' })).toBeVisible();
await expect(page.getByText(fixture.email)).toBeVisible();
const { data: profile, error: profileError } = await fixture.client
.from('profiles').select('is_premium').eq('id', fixture.userId).single();
expect(profileError).toBeNull();
expect(profile?.is_premium).toBe(true);
const { count, error: redemptionError } = await fixture.client
.from('code_redemptions').select('*', { count: 'exact', head: true })
.eq('code_id', fixture.codeId).eq('user_id', fixture.userId);
expect(redemptionError).toBeNull();
expect(count).toBe(1);
} finally {
await fixture.client.auth.admin.deleteUser(fixture.userId);
await fixture.client.from('redemption_codes').delete().eq('id', fixture.codeId);
}
});