From f44d74aa51c70bf64490d57907831ced3c8dbfc1 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 11:48:36 +0000 Subject: [PATCH 1/2] test: read the feature map from e2e instead of the verify skill --- .gitattributes | 2 +- e2e/features.json | 254 ++++++++++++++++++++++++++++++ e2e/playground/antelope.config.ts | 2 +- e2e/tab.ts | 4 +- src/test/feature-map.test.ts | 35 ++-- src/test/helpers/featureMap.ts | 96 +++++------ 6 files changed, 317 insertions(+), 76 deletions(-) create mode 100644 e2e/features.json diff --git a/.gitattributes b/.gitattributes index e5299a96..fa918db0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ * text=auto eol=lf -.agents/skills/verify-dms-database/playground/node_modules symlink=dir +e2e/playground/node_modules symlink=dir .claude/skills/* symlink=dir diff --git a/e2e/features.json b/e2e/features.json new file mode 100644 index 00000000..a5102eda --- /dev/null +++ b/e2e/features.json @@ -0,0 +1,254 @@ +{ + "userFacing": ["src/**", "frontend-vue/**", "skills/**", "package.json"], + "notUserFacing": [ + "src/test/**", + "frontend-vue/tests/**", + "frontend-vue/.*", + "frontend-vue/eslint.config.mjs", + "frontend-vue/vitest.config.ts", + "frontend-vue/pnpm-lock.yaml" + ], + "features": { + "access": { + "covers": [ + "src/module.ts", + "src/routes/index.ts", + "src/pages/index.ts", + "src/db/**", + "src/routes/health.ts", + "src/routes/data.ts" + ], + "docs": ["docs/1.introduction.md", "docs/6.faq.md", "README.md"] + }, + "config": { + "covers": ["src/config.ts", "src/service/schemaLabels.ts"], + "docs": ["docs/3.configuration.md", "docs/5.extending.md"] + }, + "data": { + "covers": [ + "src/pages/data.ts", + "src/routes/data.ts", + "src/service/browse.ts", + "src/service/declaredFields.ts", + "src/service/references.ts", + "src/service/rowFilter.ts", + "src/utils/query.ts", + "src/utils/requestValidation.ts", + "frontend-vue/app/components/DataBrowser.vue", + "frontend-vue/app/components/DataBrowserSidebar.vue", + "frontend-vue/app/components/DataBrowserTabBar.vue", + "frontend-vue/app/components/DataFilterBar.vue", + "frontend-vue/app/components/DataGrid.vue", + "frontend-vue/app/components/DataGridCell.vue", + "frontend-vue/app/components/DataGridHeaderCell.vue", + "frontend-vue/app/components/RowDrawer.vue", + "frontend-vue/app/components/InstancePicker.vue", + "frontend-vue/app/components/DrawerTabs.vue", + "frontend-vue/app/build/components/DataGridEmpty.vue", + "frontend-vue/app/build/components/DataGridFooter.vue", + "frontend-vue/app/build/components/DataGridReadOnlyBanner.vue", + "frontend-vue/app/build/components/DataGridToolbar.vue", + "frontend-vue/app/build/composables/useDataBrowserGrid.ts", + "frontend-vue/app/build/composables/useDataBrowserTabs.ts", + "frontend-vue/app/build/composables/useTableCounts.ts", + "frontend-vue/app/build/composables/useElsewhereInstances.ts", + "frontend-vue/app/build/data/gridData.ts", + "frontend-vue/app/build/data/instanceOptions.ts", + "frontend-vue/app/build/data/pickerMenus.ts", + "frontend-vue/app/build/data/recentTables.ts" + ], + "docs": [ + "docs/4.usage/4.data-browser.md", + "docs/design/redesign-v2-grill.md", + "docs/5.extending.md", + "README.md" + ] + }, + "diagram": { + "covers": [ + "src/pages/diagram.ts", + "src/routes/diagram.ts", + "src/db/models/diagram_*.ts", + "src/db/tables/diagram_*.ts", + "frontend-vue/app/components/SchemaDiagram.vue", + "frontend-vue/app/build/components/SchemaDiagramBoard.vue", + "frontend-vue/app/components/DiagramNoteNode.vue", + "frontend-vue/app/components/DiagramRelationEdge.vue", + "frontend-vue/app/components/DiagramStubNode.vue", + "frontend-vue/app/components/DiagramTableNode.vue", + "frontend-vue/app/build/components/Diagram*", + "frontend-vue/app/build/components/diagramFloat.css", + "frontend-vue/app/build/diagram/**", + "frontend-vue/app/build/composables/useCatalogReferences.ts", + "frontend-vue/app/build/composables/useDiagram*.ts" + ], + "docs": ["docs/4.usage/3.diagram.md"] + }, + "editing": { + "covers": [ + "src/service/rowEdit.ts", + "src/service/stagedSerialization.ts", + "src/routes/data.ts", + "frontend-vue/app/components/JsonCellPanel.vue", + "frontend-vue/app/build/data/stagedEdits.ts", + "frontend-vue/app/build/data/stagedWrites.ts", + "frontend-vue/app/build/data/useStagedSave.ts", + "frontend-vue/app/build/data/cellValues.ts", + "frontend-vue/app/build/utils/stagedSerialization.ts", + "frontend-vue/app/build/components/DataGridSaveStatus.vue" + ], + "docs": ["docs/4.usage/4.data-browser.md", "docs/6.faq.md", "README.md"] + }, + "extending": { + "covers": [ + "src/automation/**", + "frontend-vue/app/config/shortcuts-registry.ts", + "src/utils/guards.ts", + "src/types/**", + "src/service/introspect.ts" + ], + "docs": ["docs/5.extending.md", "docs/6.faq.md"] + }, + "external": { + "covers": [ + "src/connectionAccess.ts", + "src/routes/connections.ts", + "src/pages/externalLock.ts", + "src/service/builderRefusal.ts", + "src/service/catalog.ts", + "src/service/catalogReferences.ts", + "src/service/catalogSchemas.ts", + "src/service/connectionRefusals.ts", + "src/service/connectionState.ts", + "src/service/connections.ts", + "src/service/database.ts", + "src/utils/deadline.ts", + "frontend-vue/app/components/DatabaseSwitcher.vue", + "frontend-vue/app/build/components/DatabaseSubtitle.vue", + "frontend-vue/app/build/components/DatabaseSwitcherRow.vue", + "frontend-vue/app/build/components/DataBrowserAccessBar.vue", + "frontend-vue/app/build/components/FeatureLocked.vue", + "frontend-vue/app/build/composables/registerDatabaseSwitcher.ts", + "frontend-vue/app/build/composables/reloadForSelection.ts", + "frontend-vue/app/build/composables/useDatabaseConnections.ts", + "frontend-vue/app/build/composables/useGridAccess.ts", + "frontend-vue/app/build/data/assistantOnboarding.ts", + "frontend-vue/app/build/data/databaseOptions.ts", + "frontend-vue/app/build/data/readOnlyReason.ts", + "frontend-vue/app/build/composables/useLockedPages.ts", + "frontend-vue/app/build/composables/useSelectionRecheck.ts" + ], + "docs": [ + "docs/4.usage/6.external-databases.md", + "docs/3.configuration.md" + ] + }, + "guard": { + "covers": [ + "src/routes/query.ts", + "src/service/queryInspection.ts", + "frontend-vue/app/components/QueryConsole.vue", + "frontend-vue/app/build/components/QueryConsoleBoard.vue", + "frontend-vue/app/components/QueryResultPanel.vue" + ], + "docs": [ + "docs/4.usage/5.query-console.md", + "docs/6.faq.md", + "docs/1.introduction.md" + ] + }, + "library": { + "covers": [ + "src/db/**", + "src/routes/query.ts", + "frontend-vue/app/components/QueryLibrary.vue", + "frontend-vue/app/build/composables/useQueryStore.ts", + "frontend-vue/app/build/query/runs.ts" + ], + "docs": ["docs/4.usage/5.query-console.md", "docs/6.faq.md", "README.md"] + }, + "overview": { + "covers": [ + "src/pages/overview.ts", + "src/routes/overview.ts", + "src/routes/health.ts", + "src/service/overview.ts", + "src/service/health.ts", + "src/service/catalog.ts", + "frontend-vue/app/components/ConnectionStatus.vue", + "frontend-vue/app/build/composables/useDatabaseHealth.ts", + "frontend-vue/app/build/utils/relativeTime.ts" + ], + "docs": [ + "docs/4.usage/1.overview.md", + "docs/3.configuration.md", + "docs/6.faq.md" + ] + }, + "package": { + "covers": [ + "package.json", + "skills/**", + "frontend-vue/package.json", + "frontend-vue/tsconfig.json", + "frontend-vue/dms.frontend.ts", + "frontend-vue/dms.frontend.build.ts", + "frontend-vue/build/**", + "frontend-vue/i18n/**", + "src/frontend-module.ts", + "src/i18n/**" + ], + "docs": ["README.md", "docs/2.installation.md", "docs/5.extending.md"] + }, + "query": { + "covers": [ + "src/pages/query.ts", + "src/routes/query.ts", + "src/service/queryInspection.ts", + "src/utils/requestValidation.ts", + "frontend-vue/app/components/QueryConsole.vue", + "frontend-vue/app/build/components/QueryConsoleBoard.vue", + "frontend-vue/app/components/QueryBuilderPanel.vue", + "frontend-vue/app/components/QueryResultPanel.vue", + "frontend-vue/app/build/query/completion.ts", + "frontend-vue/app/build/query/csv.ts", + "frontend-vue/app/build/query/examples.ts", + "frontend-vue/app/build/query/failures.ts", + "frontend-vue/app/build/query/tableColumns.ts", + "frontend-vue/app/build/query/target.ts", + "frontend-vue/app/build/composables/useQueryRuntime.ts" + ], + "docs": ["docs/4.usage/5.query-console.md", "README.md"] + }, + "schemas": { + "covers": [ + "src/pages/schemas.ts", + "src/routes/tables.ts", + "src/routes/schemas.ts", + "src/service/schemaFilters.ts", + "src/service/introspect.ts", + "src/service/declaredFields.ts", + "src/service/fieldDescriptor.ts", + "src/service/schemaRegistry.ts", + "src/service/types.ts", + "src/types/**", + "src/utils/guards.ts", + "frontend-vue/app/components/SchemasFilterBar.vue", + "frontend-vue/app/components/SchemaPicker.vue", + "frontend-vue/app/components/InstancePicker.vue", + "frontend-vue/app/components/TableInspector.vue", + "frontend-vue/app/components/DrawerTabs.vue", + "frontend-vue/app/build/schemas/**", + "frontend-vue/app/build/composables/useDatabaseSchemas.ts", + "frontend-vue/app/build/composables/useTableSample.ts", + "frontend-vue/app/build/utils/fieldTypes.ts", + "frontend-vue/app/build/utils/databaseLinks.ts" + ], + "docs": ["docs/4.usage/2.schemas.md"] + }, + "smoke": { + "covers": ["src/index.ts", "src/module.ts"], + "docs": ["docs/1.introduction.md", "docs/2.installation.md"] + } + } +} diff --git a/e2e/playground/antelope.config.ts b/e2e/playground/antelope.config.ts index 4b8125a1..35a987d0 100644 --- a/e2e/playground/antelope.config.ts +++ b/e2e/playground/antelope.config.ts @@ -85,7 +85,7 @@ function externalModules(): NonNullable { /** * The repository's playground with the ports, origins, secrets and mail - * `dms-control` sets for a run, a fixture module (`app`) and the module under + * `e2e/stack.ts` sets for a run, a fixture module (`app`) and the module under * verification built from the checkout. */ export default defineConfig({ diff --git a/e2e/tab.ts b/e2e/tab.ts index 3f76eb56..cf3db1ba 100644 --- a/e2e/tab.ts +++ b/e2e/tab.ts @@ -9,7 +9,7 @@ import { import type { Check } from "./ctx.ts"; import type { Account } from "./stack.ts"; -/** The width, language and theme of every browser context a journey opens, as `dms-control` set them. */ +/** The width, language and theme of every browser context a journey opens. */ export const CONTEXT_OPTIONS: BrowserContextOptions = { viewport: { width: 1280, height: 900 }, locale: "en-US", @@ -40,7 +40,7 @@ type Role = Parameters[0]; /** * An element found by ARIA role and accessible name, as a user finds it; `within` scopes it to the first match of - * another one. `level` is accepted and ignored, as `dms-control` ignored it. + * another one. `level` is accepted and ignored. */ export interface Target { readonly role: Role; diff --git a/src/test/feature-map.test.ts b/src/test/feature-map.test.ts index 6901196c..ad42216c 100644 --- a/src/test/feature-map.test.ts +++ b/src/test/feature-map.test.ts @@ -1,10 +1,9 @@ import { strict as assert } from "node:assert"; import { matchesGlob } from "node:path"; import { - features, - journeyIds, + featureMap, + journeyFeatures, repositoryHas, - surface, trackedFiles, } from "./helpers/featureMap"; @@ -12,21 +11,22 @@ function matchesAny(file: string, globs: readonly string[]): boolean { return globs.some((glob) => matchesGlob(file, glob)); } -describe("Verify skill feature map", () => { - const map = features(); +describe("e2e feature map", () => { + const { userFacing, notUserFacing, features } = featureMap(); - it("reads a covers list from every feature file", () => { - assert.ok(map.length >= 10, `${map.length} feature files`); + it("gives every feature a covers list", () => { + assert.ok(features.length >= 10, `${features.length} features`); assert.deepEqual( - map.filter((feature) => feature.covers.length === 0).map((f) => f.file), + features + .filter((feature) => feature.covers.length === 0) + .map((f) => f.name), [], ); }); it("maps every user-facing file to a feature", () => { - const { userFacing, notUserFacing } = surface(); - assert.ok(userFacing.length > 0, "verify.config.ts names a surface"); - const covers = map.flatMap((feature) => feature.covers); + assert.ok(userFacing.length > 0, "e2e/features.json names a surface"); + const covers = features.flatMap((feature) => feature.covers); const unmapped = trackedFiles().filter( (file) => matchesAny(file, userFacing) && @@ -37,19 +37,20 @@ describe("Verify skill feature map", () => { }); it("names only docs pages that exist", () => { - const missing = map.flatMap((feature) => + const missing = features.flatMap((feature) => feature.docs .filter((page) => !repositoryHas(page)) - .map((page) => `${feature.file}: ${page}`), + .map((page) => `${feature.name}: ${page}`), ); assert.deepEqual(missing, []); }); - it("names every journey of the Playwright suite in a feature file", () => { - const ids = journeyIds(); - assert.ok(ids.length > 100, `${ids.length} journeys`); + it("names a feature for every journeys file of the Playwright suite", () => { + const journeys = journeyFeatures(); + assert.ok(journeys.length >= 10, `${journeys.length} journeys files`); + const names = new Set(features.map((feature) => feature.name)); assert.deepEqual( - ids.filter((id) => !map.some((feature) => feature.text.includes(id))), + journeys.filter((journey) => !names.has(journey)), [], ); }); diff --git a/src/test/helpers/featureMap.ts b/src/test/helpers/featureMap.ts index 52af8098..4d985c87 100644 --- a/src/test/helpers/featureMap.ts +++ b/src/test/helpers/featureMap.ts @@ -1,65 +1,58 @@ import { execFileSync } from "node:child_process"; import { existsSync, readdirSync } from "node:fs"; import { join } from "node:path"; -import { REPOSITORY, repositoryText } from "./repository"; +import { isRecord, isString } from "../../utils/guards"; +import { REPOSITORY, repositoryJson } from "./repository"; -const SKILL = ".agents/skills/verify-dms-database"; -const FEATURES = `${SKILL}/features`; +const MAP = "e2e/features.json"; const JOURNEYS = "e2e/journeys"; -/** One feature file of the verify skill: the source globs it owns, its docs pages and its text. */ +/** One feature of `e2e/features.json`: the source globs it owns and its docs pages. */ export interface Feature { - readonly file: string; + readonly name: string; readonly covers: readonly string[]; readonly docs: readonly string[]; - readonly text: string; } -/** The user-facing globs of `verify.config.ts`, and the globs it excludes from them. */ -export interface Surface { +/** `e2e/features.json`: the user-facing globs, the globs excluded from them, and the features. */ +export interface FeatureMap { readonly userFacing: readonly string[]; readonly notUserFacing: readonly string[]; + readonly features: readonly Feature[]; } -function frontmatterList(text: string, key: string): string[] { - const frontmatter = /^---\n([\s\S]*?)\n---/.exec(text)?.[1] ?? ""; - const block = new RegExp(`^${key}:\\n((?: - .*\\n?)*)`, "m").exec( - frontmatter, - )?.[1]; - return (block ?? "") - .split("\n") - .map((line) => line.replace(/^ {2}- /, "").trim()) - .filter(Boolean); +function isStringList(value: unknown): value is string[] { + return Array.isArray(value) && value.every(isString); } -/** Every feature file but the README, with its `covers:` and `docs:` lists. */ -export function features(): Feature[] { - return readdirSync(join(REPOSITORY, FEATURES)) - .filter((file) => file.endsWith(".md") && file !== "README.md") - .sort() - .map((file) => { - const text = repositoryText(`${FEATURES}/${file}`); - return { - file, - covers: frontmatterList(text, "covers"), - docs: frontmatterList(text, "docs"), - text, - }; - }); +function isFeature( + value: unknown, +): value is { covers: string[]; docs: string[] } { + return ( + isRecord(value) && + isStringList(value["covers"]) && + isStringList(value["docs"]) + ); } -/** The user-facing surface `verify.config.ts` declares. */ -export function surface(): Surface { - const config = repositoryText(`${SKILL}/verify.config.ts`); - const globs = (key: string): string[] => - [ - ...( - new RegExp(`^\\s*${key}: \\[(.*)\\],$`, "m").exec(config)?.[1] ?? "" - ).matchAll(/"([^"]+)"/g), - ].map((match) => match[1] ?? ""); +/** The parsed `e2e/features.json`; throws on a key of the wrong shape. */ +export function featureMap(): FeatureMap { + const map = repositoryJson(MAP); + if ( + !isRecord(map) || + !isStringList(map["userFacing"]) || + !isStringList(map["notUserFacing"]) || + !isRecord(map["features"]) + ) + throw new Error(`${MAP}: userFacing, notUserFacing or features is missing`); return { - userFacing: globs("userFacing"), - notUserFacing: globs("notUserFacing"), + userFacing: map["userFacing"], + notUserFacing: map["notUserFacing"], + features: Object.entries(map["features"]).map(([name, feature]) => { + if (!isFeature(feature)) + throw new Error(`${MAP}: ${name} needs covers and docs lists`); + return { name, covers: feature.covers, docs: feature.docs }; + }), }; } @@ -78,17 +71,10 @@ export function repositoryHas(path: string): boolean { return existsSync(join(REPOSITORY, path)); } -/** The id of every journey the Playwright suite registers, from `e2e/journeys` and its parts. */ -export function journeyIds(): string[] { - const files = readdirSync(join(REPOSITORY, JOURNEYS), { - recursive: true, - encoding: "utf8", - }).filter((file) => file.endsWith(".mjs")); - return files.flatMap((file) => - [ - ...repositoryText(`${JOURNEYS}/${file}`).matchAll( - /^\s+id: "([a-z0-9-]+)",$/gm, - ), - ].map((match) => match[1] ?? ""), - ); +/** The feature each `e2e/journeys/.mjs` file names, its helpers in subfolders left out. */ +export function journeyFeatures(): string[] { + return readdirSync(join(REPOSITORY, JOURNEYS)) + .filter((file) => file.endsWith(".mjs")) + .map((file) => file.replace(/\.mjs$/, "")) + .sort(); } From d8188062d01e80e775fa647fb66ad185d061a521 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 11:49:08 +0000 Subject: [PATCH 2/2] ci: start the checks on the ready pull request