From 5d080c8e695ee42b7e4468385d521537a06f8418 Mon Sep 17 00:00:00 2001 From: Iron-Mark Date: Sat, 5 Sep 2026 17:06:13 +0800 Subject: [PATCH] fix(ci): restore regression coverage and reduce duplicate runs --- .github/workflows/codeql.yml | 5 ++++- .github/workflows/cursor-integration.yml | 14 +++++++------- AGENTS.md | 10 ++++++++++ test/api-v1-audit-e2e.test.mjs | 2 +- test/audit-flow-e2e.test.mjs | 4 ++-- test/runtime-wiring.test.mjs | 2 +- test/site-header-nav-e2e.test.mjs | 3 ++- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6604c34..22404a1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - dev pull_request: branches: - main @@ -12,6 +11,10 @@ on: schedule: - cron: '24 6 * * 1' +concurrency: + group: codeql-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: actions: read contents: read diff --git a/.github/workflows/cursor-integration.yml b/.github/workflows/cursor-integration.yml index 5e40690..ba46e1a 100644 --- a/.github/workflows/cursor-integration.yml +++ b/.github/workflows/cursor-integration.yml @@ -2,10 +2,10 @@ name: Cursor Integration on: pull_request: - push: - branches: - - main - - dev + +concurrency: + group: cursor-integration-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: lint-build-cursor-tests: @@ -26,12 +26,12 @@ jobs: - name: Lint run: npm run lint + - name: Security regression suite + run: npm run test:security + - name: Build run: npm run build - - name: Cursor integration unit tests - run: node --test test/cursor*.test.mjs - # Cursor Bugbot is enabled in the Cursor dashboard and branch protection rules. # It is not invoked from this workflow because it requires Cursor-side configuration. # After merging, require the "Cursor Bugbot" GitHub check on protected branches manually. diff --git a/AGENTS.md b/AGENTS.md index c778826..b15d777 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,3 +55,13 @@ Discord "commands" means slash commands; default to global registration so they Last guidance refresh: 2026-08-04 (branch refs verified locally; build status not re-asserted by this documentation migration). + + + +# This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + diff --git a/test/api-v1-audit-e2e.test.mjs b/test/api-v1-audit-e2e.test.mjs index 87b4c6b..09aef80 100644 --- a/test/api-v1-audit-e2e.test.mjs +++ b/test/api-v1-audit-e2e.test.mjs @@ -56,7 +56,7 @@ test('/api/v1/audit returns an explicit demo report for mode=demo', { timeout: 2 } }) -test('/api/v1/audit keeps live mode credential-backed with clear missing-key errors', { timeout: 120_000 }, async () => { +test('/api/v1/audit keeps live mode credential-backed with clear missing-key errors', { timeout: 240_000 }, async () => { const server = await ensureE2eServer('/api/health') try { diff --git a/test/audit-flow-e2e.test.mjs b/test/audit-flow-e2e.test.mjs index 4e55388..0d3e56c 100644 --- a/test/audit-flow-e2e.test.mjs +++ b/test/audit-flow-e2e.test.mjs @@ -22,7 +22,7 @@ test('demo audit path auto-fills URL and location then renders a verdict', { tim ].join('\n') await page.goto(`${BASE_URL}/audit`, { waitUntil: 'networkidle' }) - await page.getByRole('button', { name: 'Demo fixtures' }).click() + await page.getByRole('button', { name: /^Check my post\./ }).click() await page.getByTestId('demo-cost-snackbar').waitFor({ timeout: 5_000 }) assert.match(await page.getByTestId('demo-cost-snackbar').innerText(), /Live evidence is capped/i) await page.getByTestId('job-input-text').fill(sample) @@ -35,7 +35,7 @@ test('demo audit path auto-fills URL and location then renders a verdict', { tim const verdictText = await page.getByTestId('audit-result-verdict').innerText() assert.match(verdictText, /High-Risk/i) - assert.match(await page.getByRole('heading', { name: 'Evidence receipts' }).innerText(), /Evidence receipts/) + assert.match(await page.getByText('Evidence receipts', { exact: true }).first().innerText(), /Evidence receipts/i) } finally { await browser.close() await server.release() diff --git a/test/runtime-wiring.test.mjs b/test/runtime-wiring.test.mjs index a5ee0dc..30b2f57 100644 --- a/test/runtime-wiring.test.mjs +++ b/test/runtime-wiring.test.mjs @@ -507,7 +507,7 @@ test('multi-platform chat agents are wired through ChatSDK adapters', async () = assert.equal(packageJson.dependencies['@chat-adapter/slack'], chatVersion) assert.equal(packageJson.dependencies['@chat-adapter/state-redis'], chatVersion) assert.equal(packageJson.dependencies['@chat-adapter/telegram'], chatVersion) - assert.equal(packageJson.dependencies['@zernio/chat-sdk-adapter'], '^0.4.0') + assert.equal(packageJson.dependencies['@zernio/chat-sdk-adapter'], '^0.5.1') assert.match(bot, /from '@chat-adapter\/discord'/) assert.match(bot, /from '@chat-adapter\/telegram'/) assert.match(bot, /from '@zernio\/chat-sdk-adapter'/) diff --git a/test/site-header-nav-e2e.test.mjs b/test/site-header-nav-e2e.test.mjs index 8dd33ce..16ab146 100644 --- a/test/site-header-nav-e2e.test.mjs +++ b/test/site-header-nav-e2e.test.mjs @@ -16,6 +16,8 @@ test('mobile hamburger opens a full-screen navigation menu and opens pages from assert.equal(await header.getByRole('button', { name: /^Search site/ }).count(), 0) await page.getByRole('button', { name: 'Open site navigation' }).click() + const mobileMenu = page.locator('[role="menu"]').filter({ hasText: 'Start here' }) + await mobileMenu.waitFor({ state: 'visible' }) const visibleMenus = await page.locator('[role="menu"]').evaluateAll((menus) => menus .map((menu) => { @@ -37,7 +39,6 @@ test('mobile hamburger opens a full-screen navigation menu and opens pages from assert.ok(await page.getByRole('button', { name: 'Close site navigation' }).isVisible()) assert.equal(await page.evaluate(() => document.activeElement?.getAttribute('aria-label')), 'Close site navigation') - const mobileMenu = page.locator('[role="menu"]').filter({ hasText: 'Start here' }) await page.keyboard.press('Shift+Tab') assert.ok(await mobileMenu.evaluate((menu) => menu.contains(document.activeElement))) await page.keyboard.press('Tab')