From d2faa4b58bf4ee4b0f2cd7530fe0b3176fba8bb0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 17:37:38 +0000 Subject: [PATCH 1/2] qa(fixtures): seed the showcase fixtures three checklist items lack - Every foreign-currency showcase invoice now carries a non-zero line (INV-1007 JPY, INV-1009 and INV-1010 EUR), so the multi-currency item can see a conversion on each of them, not only a rate choice over zero. - The showcase registers a switched-off app (showcase_archive, active: false), the fixture for "an inactive app never appears as a switch target" in the command-palette item. - The 18.0.0-next.5 fixture restore re-dates its rotation shards to the day before the run, as the upgrade harness already does, so the first boot's retention no longer drops the restored sys_activity rows. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5kWURVLmS49GR3jwxs --- examples/app-showcase/objectstack.config.ts | 4 +-- examples/app-showcase/src/data/seed/index.ts | 8 ++++++ .../src/system/translations/index.ts | 9 ++++++ examples/app-showcase/src/ui/apps/index.ts | 24 ++++++++++++++++ .../upgrade-harness/cli-prerelease-fixture.ts | 28 +++++++++++++++++-- 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/examples/app-showcase/objectstack.config.ts b/examples/app-showcase/objectstack.config.ts index 7767c074f78..132fdefb7e0 100644 --- a/examples/app-showcase/objectstack.config.ts +++ b/examples/app-showcase/objectstack.config.ts @@ -20,7 +20,7 @@ import { ExternalCustomer, ExternalOrder } from './src/data/objects/external/ind import { setupShowcaseExternalDatasource } from './src/system/datasources/external-fixture.js'; import { registerShowcaseApprovalDemo } from './src/security/seed-approval-demo.js'; import { TaskViews, ProjectViews, InquiryViews, BusinessUnitViews, ContactViews, FieldZooViews } from './src/ui/views/index.js'; -import { ShowcaseApp } from './src/ui/apps/index.js'; +import { ShowcaseApp, ShowcaseArchiveApp } from './src/ui/apps/index.js'; import { ChartGalleryDashboard, OpsDashboard, RevenuePulseDashboard } from './src/ui/dashboards/index.js'; import { ShowcaseTaskDataset, ShowcaseProjectDataset, ShowcaseInvoiceDataset, ShowcaseAccountDataset } from './src/ui/datasets/index.js'; import { allReports } from './src/ui/reports/index.js'; @@ -207,7 +207,7 @@ export default defineStack({ mappings: allMappings, // UI - apps: [ShowcaseApp], + apps: [ShowcaseApp, ShowcaseArchiveApp], views: [TaskViews, ProjectViews, InquiryViews, BusinessUnitViews, ContactViews, FieldZooViews], pages: [CapabilityMapPage, StartHerePage, ComponentGalleryPage, ProjectWorkspacePage, ProjectDetailPage, TaskWorkbenchPage, TaskTriagePage, TaskBoardPage, TaskCalendarPage, TaskGalleryPage, TaskSchedulePage, TaskTimelinePage, TaskMapPage, TaskAllViewsPage, ActiveProjectsPage, TaskDetailPage, InvoiceDocumentPage, ReviewQueuePage, NewProjectWizardPage, MyWorkPage, SettingsPage, StylingGalleryPage, CommandCenterPage, CommandCenterJsxPage, CrmWorkbenchPage, TaskDeskPage, PageVariablesPage, ContactFormPage, RenewalsPipelinePage], dashboards: [ChartGalleryDashboard, OpsDashboard, RevenuePulseDashboard], diff --git a/examples/app-showcase/src/data/seed/index.ts b/examples/app-showcase/src/data/seed/index.ts index 8b25817d08c..e6b06f6b0cc 100644 --- a/examples/app-showcase/src/data/seed/index.ts +++ b/examples/app-showcase/src/data/seed/index.ts @@ -438,6 +438,14 @@ const invoiceLines = defineSeed(InvoiceLine, { // non-zero total, converted at the newer JPY rate (it is dated 5 days ago). { description: 'INV-1008 \u00b7 Consulting hours', invoice: 'INV-1008', product: 'SERVICE-HR', position: 0, quantity: 8, unit_price: 22500, amount: 180000, service_start: '10:00' }, { description: 'INV-1008 \u00b7 Gadget X units', invoice: 'INV-1008', product: 'GADGET-X', position: 1, quantity: 3, unit_price: 14800, amount: 44400 }, + // Every other foreign invoice carries a non-zero total too, so a currency + // conversion is visible on each of them, not only the rate choice (0 at any + // rate is 0): INV-1007 is JPY at the older rate (dated 60 days ago), INV-1009 + // and INV-1010 are EUR at the older rate (dated 100 and 75 days ago). The + // records-forms.multi-currency-invoice checklist item reads these. + { description: 'INV-1007 \u00b7 Widget A units', invoice: 'INV-1007', product: 'WIDGET-A', position: 0, quantity: 20, unit_price: 4500, amount: 90000 }, + { description: 'INV-1009 \u00b7 Consulting hours', invoice: 'INV-1009', product: 'SERVICE-HR', position: 0, quantity: 12, unit_price: 140, amount: 1680, service_start: '08:30' }, + { description: 'INV-1010 \u00b7 Widget B units', invoice: 'INV-1010', product: 'WIDGET-B', position: 0, quantity: 5, unit_price: 46, amount: 230 }, ], }); diff --git a/examples/app-showcase/src/system/translations/index.ts b/examples/app-showcase/src/system/translations/index.ts index 9f53c3c3fdb..3b63cd76bb7 100644 --- a/examples/app-showcase/src/system/translations/index.ts +++ b/examples/app-showcase/src/system/translations/index.ts @@ -1221,6 +1221,15 @@ export const ShowcaseTranslationBundle = { nav_renewals_pipeline: { label: '续约管道 · 汇总与区块' }, }, }, + // The switched-off fixture app (apps/index.ts): never offered by a switcher, + // translated anyway so no surface that does name it reads half English. + showcase_archive: { + label: '展示归档', + description: '特意停用:停用应用的测试夹具,任何应用切换器都不应列出它。', + navigation: { + nav_archived_projects: { label: '归档项目' }, + }, + }, }, // See the `en` block: object-less actions resolve ONLY through // `globalActions`. Translated at birth for the same reason as diff --git a/examples/app-showcase/src/ui/apps/index.ts b/examples/app-showcase/src/ui/apps/index.ts index 31a7aad577f..cba238957b8 100644 --- a/examples/app-showcase/src/ui/apps/index.ts +++ b/examples/app-showcase/src/ui/apps/index.ts @@ -164,3 +164,27 @@ export const ShowcaseApp = App.create({ }, ], }); + +/** + * An app that is switched OFF (`active: false`) — the inactive-app fixture. + * + * The console's app switcher (the command palette's Switch-app group, and the + * app menu) lists only apps whose `active` is not false. With every stock app + * active, nothing on a stock boot can show that filter dropping an app, so the + * search.command-palette-navigation checklist item's "an inactive app never + * appears as a switch target" case had no fixture. This app is that fixture: + * it is registered with the showcase and must never be offered as a target. + * + * Its one navigation entry points at an object the showcase app already + * serves, so the app is complete on its own; it is not meant to be opened. + */ +export const ShowcaseArchiveApp = App.create({ + name: 'showcase_archive', + label: 'Showcase Archive', + description: 'Switched off on purpose: the inactive-app fixture. No app switcher should offer it.', + icon: 'archive', + active: false, + navigation: [ + { id: 'nav_archived_projects', type: 'object', objectName: 'showcase_project', label: 'Archived Projects', icon: 'folder-kanban' }, + ], +}); diff --git a/packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts b/packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts index 236d48500e8..53a1d4d4c99 100644 --- a/packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts +++ b/packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts @@ -11,7 +11,9 @@ // `restore` is what a checklist run replays: it loads the committed text dump // (`fixture-18.0.0-next.5/`) into two NEW SQLite files, the primary and the // telemetry sibling `os dev` keeps beside a file primary (`n5.db` and -// `n5.telemetry.db`, packages/cli/src/utils/telemetry-datasource.ts). No build. +// `n5.telemetry.db`, packages/cli/src/utils/telemetry-datasource.ts), its +// rotation shards re-dated to the day before the run (`fixture-as-of.ts`), so +// the first boot's retention keeps them. No build. // // `generate` remakes that dump, and is the only way it is made: // @@ -42,6 +44,7 @@ import { fileURLToPath } from 'node:url'; import { parseArgs } from 'node:util'; import { DatabaseSync } from 'node:sqlite'; import { dumpSqliteToSql, loadSqlIntoSqlite } from './sqlite-text-dump.js'; +import { renameShardTables, shardRenamesAsOf } from './fixture-as-of.js'; const HERE = dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = resolve(HERE, '../../../../..'); @@ -68,14 +71,33 @@ function siblingOf(primary: string): string { return /\.db$/i.test(primary) ? primary.replace(/\.db$/i, '.telemetry.db') : `${primary}.telemetry.db`; } +/** + * The dump `file` as of this run: its rotation shards re-dated so the newest is + * the day before today (`fixture-as-of.ts`). The telemetry sibling carries + * `sys_activity`'s day shards, and a shard older than the rotation window is + * dropped by the first boot over the copy, so a restore that loaded the dump's + * own shard names would lose those rows once the window passed the day the + * fixture was generated. + */ +function dumpAsOf(file: string): { sql: string; renames: ReadonlyMap } { + const sql = readFileSync(file, 'utf8'); + const renames = shardRenamesAsOf(sql); + return { sql: renameShardTables(sql, renames), renames }; +} + function restore(to: string, from: string): void { if (!existsSync(join(from, 'database.sql'))) fail(`${from} holds no database.sql`, 2); for (const file of [to, siblingOf(to)]) if (existsSync(file)) fail(`${file} exists; the restore writes NEW files only, so a run never upgrades the original`, 2); mkdirSync(dirname(to), { recursive: true }); - loadSqlIntoSqlite(readFileSync(join(from, 'database.sql'), 'utf8'), to); - loadSqlIntoSqlite(readFileSync(join(from, 'telemetry.sql'), 'utf8'), siblingOf(to)); + const primary = dumpAsOf(join(from, 'database.sql')); + const telemetry = dumpAsOf(join(from, 'telemetry.sql')); + loadSqlIntoSqlite(primary.sql, to); + loadSqlIntoSqlite(telemetry.sql, siblingOf(to)); const manifest = JSON.parse(readFileSync(join(from, 'manifest.json'), 'utf8')); console.log(`cli-prerelease-fixture: restored ${to} and ${siblingOf(to)} — born under ${manifest.ref} (${manifest.sha.slice(0, 12)})`); + for (const [was, now] of [...primary.renames, ...telemetry.renames]) { + console.log(`cli-prerelease-fixture: re-dated shard ${was} → ${now}`); + } } /** A port nothing listens on once this resolves. */ From 2b2bca197ee9bd5811872de568aab79c985651a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 17:43:58 +0000 Subject: [PATCH 2/2] qa(fixtures): withdraw the inactive showcase app An app package defines at most one app (defineStack single-app validation), so a switched-off second app cannot ride the showcase package; that fixture needs a module package of its own. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5kWURVLmS49GR3jwxs --- examples/app-showcase/objectstack.config.ts | 4 ++-- .../src/system/translations/index.ts | 9 ------- examples/app-showcase/src/ui/apps/index.ts | 24 ------------------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/examples/app-showcase/objectstack.config.ts b/examples/app-showcase/objectstack.config.ts index 132fdefb7e0..7767c074f78 100644 --- a/examples/app-showcase/objectstack.config.ts +++ b/examples/app-showcase/objectstack.config.ts @@ -20,7 +20,7 @@ import { ExternalCustomer, ExternalOrder } from './src/data/objects/external/ind import { setupShowcaseExternalDatasource } from './src/system/datasources/external-fixture.js'; import { registerShowcaseApprovalDemo } from './src/security/seed-approval-demo.js'; import { TaskViews, ProjectViews, InquiryViews, BusinessUnitViews, ContactViews, FieldZooViews } from './src/ui/views/index.js'; -import { ShowcaseApp, ShowcaseArchiveApp } from './src/ui/apps/index.js'; +import { ShowcaseApp } from './src/ui/apps/index.js'; import { ChartGalleryDashboard, OpsDashboard, RevenuePulseDashboard } from './src/ui/dashboards/index.js'; import { ShowcaseTaskDataset, ShowcaseProjectDataset, ShowcaseInvoiceDataset, ShowcaseAccountDataset } from './src/ui/datasets/index.js'; import { allReports } from './src/ui/reports/index.js'; @@ -207,7 +207,7 @@ export default defineStack({ mappings: allMappings, // UI - apps: [ShowcaseApp, ShowcaseArchiveApp], + apps: [ShowcaseApp], views: [TaskViews, ProjectViews, InquiryViews, BusinessUnitViews, ContactViews, FieldZooViews], pages: [CapabilityMapPage, StartHerePage, ComponentGalleryPage, ProjectWorkspacePage, ProjectDetailPage, TaskWorkbenchPage, TaskTriagePage, TaskBoardPage, TaskCalendarPage, TaskGalleryPage, TaskSchedulePage, TaskTimelinePage, TaskMapPage, TaskAllViewsPage, ActiveProjectsPage, TaskDetailPage, InvoiceDocumentPage, ReviewQueuePage, NewProjectWizardPage, MyWorkPage, SettingsPage, StylingGalleryPage, CommandCenterPage, CommandCenterJsxPage, CrmWorkbenchPage, TaskDeskPage, PageVariablesPage, ContactFormPage, RenewalsPipelinePage], dashboards: [ChartGalleryDashboard, OpsDashboard, RevenuePulseDashboard], diff --git a/examples/app-showcase/src/system/translations/index.ts b/examples/app-showcase/src/system/translations/index.ts index 3b63cd76bb7..9f53c3c3fdb 100644 --- a/examples/app-showcase/src/system/translations/index.ts +++ b/examples/app-showcase/src/system/translations/index.ts @@ -1221,15 +1221,6 @@ export const ShowcaseTranslationBundle = { nav_renewals_pipeline: { label: '续约管道 · 汇总与区块' }, }, }, - // The switched-off fixture app (apps/index.ts): never offered by a switcher, - // translated anyway so no surface that does name it reads half English. - showcase_archive: { - label: '展示归档', - description: '特意停用:停用应用的测试夹具,任何应用切换器都不应列出它。', - navigation: { - nav_archived_projects: { label: '归档项目' }, - }, - }, }, // See the `en` block: object-less actions resolve ONLY through // `globalActions`. Translated at birth for the same reason as diff --git a/examples/app-showcase/src/ui/apps/index.ts b/examples/app-showcase/src/ui/apps/index.ts index cba238957b8..31a7aad577f 100644 --- a/examples/app-showcase/src/ui/apps/index.ts +++ b/examples/app-showcase/src/ui/apps/index.ts @@ -164,27 +164,3 @@ export const ShowcaseApp = App.create({ }, ], }); - -/** - * An app that is switched OFF (`active: false`) — the inactive-app fixture. - * - * The console's app switcher (the command palette's Switch-app group, and the - * app menu) lists only apps whose `active` is not false. With every stock app - * active, nothing on a stock boot can show that filter dropping an app, so the - * search.command-palette-navigation checklist item's "an inactive app never - * appears as a switch target" case had no fixture. This app is that fixture: - * it is registered with the showcase and must never be offered as a target. - * - * Its one navigation entry points at an object the showcase app already - * serves, so the app is complete on its own; it is not meant to be opened. - */ -export const ShowcaseArchiveApp = App.create({ - name: 'showcase_archive', - label: 'Showcase Archive', - description: 'Switched off on purpose: the inactive-app fixture. No app switcher should offer it.', - icon: 'archive', - active: false, - navigation: [ - { id: 'nav_archived_projects', type: 'object', objectName: 'showcase_project', label: 'Archived Projects', icon: 'folder-kanban' }, - ], -});