Skip to content

Commit c6de6a8

Browse files
qa(fixtures): every foreign showcase invoice carries a total, and the 18.0 pre-release restore keeps its activity shard (#33376)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X5XzfhFryaGx3eajZAWLK24)_ domain:devx#4 · os-project-manager · session_01FEkQ5kWURVLmS49GR3jwxs Part of #33351 (section A only; this PR lands the two rows that are fixture additions on main today. Section B and the rows listed below as owed, decided or out of scope stay on the card.) Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:示例应用 showcase 给三张外币发票(INV-1007 日元、INV-1009 和 INV-1010 欧元)各补一行发票明细;18.0 预发布数据库的恢复脚本在恢复时把活动日志分片改成“昨天”的日期。 - 为什么改:多币种测试项原先只有两张外币发票金额非零,其余三张只能看到汇率选择、看不到换算;恢复出来的活动日志分片日期停在 10 月 27 日,首次启动就被 7 天保留策略删掉,测试项读不到那 66 行。 - 风险与回滚:只动示例应用种子数据和测试夹具脚本,都不发布(两个包都是 private);回滚即 revert 本 PR。 - 先看:`examples/app-showcase/src/data/seed/index.ts` 新增的三行发票明细;`packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts` 的 `restore`。 - 两分钟验证:`pnpm --filter @objectstack/dogfood exec tsx test/upgrade-harness/cli-prerelease-fixture.ts restore --to /tmp/x/n5.db`,预期多打印一行 `re-dated shard sys_activity__r20261027 → sys_activity__r<昨天>`。 - 需要你做的:无,席位落地。卡上另有三个待决问题(第 92、135、263 行,以及 90+153 合并的一问),见下文与报告评论。 ## What changes Two files, fixture space only. 1. **Row 220 · `records-forms.multi-currency-invoice`** (`examples/app-showcase/src/data/seed/index.ts`): one invoice line each under INV-1007 (JPY), INV-1009 (EUR) and INV-1010 (EUR), so all five foreign invoices carry a non-zero total and both rate rows of each currency are exercised. Measured on a stock boot of this head (a throwaway probe, deleted after the run): ``` INV-1004 EUR amount=450 home=500 rate=0.9 INV-1007 JPY amount=95400 home=629.7 rate=151.5 INV-1008 JPY amount=237864 home=1593.73 rate=149.25 INV-1009 EUR amount=2016 home=2191.3 rate=0.92 INV-1010 EUR amount=276 home=300 rate=0.92 ``` Before this PR, INV-1007, INV-1009 and INV-1010 had no lines (amount 0), as the QA record measured. 2. **Row 209 · `cli-18-prerelease-db` restore** (`packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts`): `restore` now passes both dumps through the harness's own `fixture-as-of.ts` (`shardRenamesAsOf` + `renameShardTables`), so the restored telemetry sibling's `sys_activity` shard is dated the day before the run and the first boot's rotation retention keeps it. It prints each rename. Measured: at base `d3f3f4ab` the restore writes `sys_activity__r20261027`; at this head it writes `sys_activity__r20261113` (66 rows) on 2026-11-14. Neither `manifest.json` nor the recipe names the shard, so no census read changes. ## Per-row dispositions (all 16 section A rows, re-measured on `origin/main` `d3f3f4ab`) | row | disposition | evidence | |---|---|---| | 80 | already done on main | `packages/services/service-storage/src/attachment-member-grant.ts` contributes read + create on `sys_attachment` to every member's baseline since `fd6374713` (2026-11-13 07:58Z); the QA run was at `ee9ad834` (03:17Z), which does not contain it (`merge-base --is-ancestor fd63747 ee9ad83` exit 1; `fd6374713` in HEAD exit 0; control `ee9ad834` in HEAD exit 0) | | 89 | out of scope (product) | app packages cannot author settings namespaces (spec migration `18.translation-per-app-settings-platform-only`), and no built-in manifest declares `scope: 'user'` (`packages/services/service-settings/src/manifests/*.ts`). A user-scope secret is a platform manifest change, not a fixture | | 90 | needs_decision (with 153) | the item needs one item name held by two installed packages; no stock boot carries a second package, and the showcase is one app package | | 91 | already runnable; item text owed | `identity-auth.self-signup-gate` knownGaps[0] records the env door (`OS_AUTH_AUDIENCE_POSTURE`, `OS_AUTH_AUDIENCE_ALLOWED_EMAIL_DOMAINS`, `OS_AUTH_AUDIENCE_SELF_REGISTRATION_PERMISSION_SET`) measured live; variants[1]/[2] still say blocked(fixture). `identity-auth.json` is held by batch A PR #33362, so the re-point is owed there | | 92 | premise does not hold; not changed; needs_decision | `showcase_task.assignee` is `Field.text` and the showcase stores an EMAIL in it on purpose: the seed writes persona emails (`seed/index.ts` "#7746" block), the notify flows read it as a recipient, `invoice.owner` and `private_note.owner` follow the same email convention, and `search.json` / `records-forms.json` tell runners to assign by email. The QA run had PATCHed a user id into it by hand (record 6846028996: "the run had set assignee to a user id"). Switching the rule to ids would hide every seeded task from its assignee | | 135 | needs_decision | Ada holding `showcase_finance` or `showcase_legal` also makes her a required approver of the seeded invoice dual sign-off (`showcase_invoice_signoff`, unanimous over finance + legal, `flows/index.ts`), so the stock demo changes beyond the quorum item | | 151 | out of scope (product) | `mandatoryTopics` is reachable only as a `MessagingServicePlugin` constructor option (`packages/services/service-messaging/src/messaging-service-plugin.ts`); a declarative door is product work. Carrier: #33352 | | 152 | environment-bound | the agent catalog is served only by the Cloud/Enterprise `@objectstack/service-ai`; `platform-core.keyboard-shortcut-surface` knownGaps[1] already scores that half blocked(environment). Belongs with section B | | 153 | needs_decision (with 90) | measured: a second app (`active: false`) in the showcase is refused at build, "An 'app' package must define at most one app" (defineStack single-app validation, ADR-0019). The fixture needs a module package composed beside the showcase. Tried in `d2faa4b58`, withdrawn in the next commit | | 155 | recipe text owed | the flow is runner-built from `studio-authoring.flow-edge-type-authoring` fixtures.requires[1] ("Start → Decision → two End nodes"); adding a loop is text in `studio-authoring.json`, held by batch B PR #33360 | | 208 | held | `scripts/qa/qa-fixture.mjs walled-boot` is held by #33334 | | 209 | **landed here** | see What changes 2. The recipe text in `cli.json` is routed to batch D (#33330) | | 218 | out of scope (product) | stamping environment rows with a host package is hosted-runtime behaviour, not seed data. Carrier: #33352 | | 220 | **landed here** | see What changes 1. The item text ("only INV-1004 and INV-1008") lives in `records-forms.json`, held by batch B PR #33360 | | 227 | recipe text owed | there is no committed 18.3.0 fixture: the file is runner-built (`platform-core.activation-ledger-package-key-upgrade` route (a)/(b)). Planting a connector instance and an assignment rule is recipe text in `platform-core.json` / `cli.json`, held by batch D (#33330) | | 263 | needs_decision | `records-forms.gantt-interactions`: the stock task gantt view declares no `lockField` / `dependenciesField`; either the showcase task gains them (plus a dependency field and seed), or the item keeps the documented overlay route and narrows | Totals: 16 rows · 2 landed here (209, 220) · 2 already right (80, 91) · 4 needs_decision questions over 5 rows (92; 135; 90+153; 263) · 3 owed as recipe or item text in held area files (155, 227, plus the 91 and 220 text) · 1 held by #33334 (208) · 3 out of scope as product (89, 151, 218) · 1 environment-bound (152). No `packages/**` outside `packages/qa`, no new door, no area file (every one this card would touch is held by an open batch PR or card: #33362, #33360, #33359, #33327, #33330), no RUNNER.md. ## Why The v18.4.0 sweep parked 22 fixture rows (#32908 ledger `/mnt/project-files/pm-orders/devx/32908-ledger.md`, routed to #33351 by triage). Section A is the 16 rows that looked like seed or fixture additions. Each was re-measured on main here first; two are fixture additions that hold today and land in this PR, and the rest are answered row by row in the table above. Source records: #32908 comments 6844741021, 6846028996, 6846283471, 6850382730, 6850413952, 6850460138, 6850495479 and 6852480973. ## Tests <details><summary>showcase suite + typecheck, dogfood typecheck (head 2b2bca1)</summary> ``` pnpm --filter @objectstack/example-showcase test Test Files 48 passed (48) · Tests 545 passed (545) pnpm --filter @objectstack/example-showcase typecheck exit 0 pnpm --filter @objectstack/dogfood typecheck exit 0 os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>dogfood suites that boot the showcase and read invoice lines</summary> ``` pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=2 \ test/showcase-invoice-seed-isolation.dogfood.test.ts test/showcase-invoice-cbp.dogfood.test.ts \ test/showcase-invoice-line-contributor-pair.dogfood.test.ts test/showcase-readonly-when-parent.dogfood.test.ts \ test/showcase-crud-persona-matrix.dogfood.test.ts test/master-detail-batch-atomic.dogfood.test.ts \ test/home-amount-projection.test.ts test/upgrade-harness-fixture-as-of.test.ts test/external-member-directory.dogfood.test.ts Test Files 9 passed (9) · Tests 153 passed | 15 skipped (168) os-verify-lock: VERDICT command-exit 0 ``` </details> No ablation: the diff adds seed rows and changes a fixture script, and pins no new tested behaviour. ## Acceptance notes - Rows 90 and 153 want the same thing: a second package on the stock boot (one holding a name the showcase also holds; one carrying a switched-off app). One module package composed beside the showcase would serve both; that is a choice about the example's shape, so it is a question on the card, not a change here. - Row 92's ruling rested on "`assignee` stores a user id". On main it stores an email by the showcase's own convention, so the rule was left as it is and the question goes back on the card. ## Verification Local subset at head `2b2bca197`, derived by `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (73 changed lines at derivation; 33 after the withdrawn app, same path families): - `dispatch-gates --ran`: 54 derived, 53 run with exit 0, 1 NOT MEASURED: `pnpm check:dual-build-cjs-loads` exit 3 PREREQUISITE NOT MET (reads every package's dist; studio, client-react, scenarios and others are unbuilt here). The diff changes no published package's build output; CI's Build Core runs it. - `check-plugin-teardown-shape.mjs --self-test` first answered exit 3 on the shallow clone (pinned control `621a4876` unreachable); after `git fetch --depth=1` of that commit it answered exit 0, 48 cases. - `pnpm exec eslint --no-inline-config` on both touched files: exit 0. - Changeset: none. `@objectstack/example-showcase` and `@objectstack/dogfood` are both `"private": true`, so nothing publishes (`skip-changeset`). - CI families (Test Core, lint farm, type-check lanes) are read off this PR's check runs by the seat. Full record: `/mnt/project-files/pm-orders/devx/33351-gates-ran.txt`. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (no names added) - [x] 3. No formatter ran; `pnpm lint` passes. (eslint on both touched files: exit 0) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing: both packages are private, `skip-changeset`) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (the 维护者速读 block is the seat's required Chinese summary) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5kWURVLmS49GR3jwxs)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 09da8c7 commit c6de6a8

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

‎examples/app-showcase/src/data/seed/index.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,14 @@ const invoiceLines = defineSeed(InvoiceLine, {
438438
// non-zero total, converted at the newer JPY rate (it is dated 5 days ago).
439439
{ 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' },
440440
{ description: 'INV-1008 \u00b7 Gadget X units', invoice: 'INV-1008', product: 'GADGET-X', position: 1, quantity: 3, unit_price: 14800, amount: 44400 },
441+
// Every other foreign invoice carries a non-zero total too, so a currency
442+
// conversion is visible on each of them, not only the rate choice (0 at any
443+
// rate is 0): INV-1007 is JPY at the older rate (dated 60 days ago), INV-1009
444+
// and INV-1010 are EUR at the older rate (dated 100 and 75 days ago). The
445+
// records-forms.multi-currency-invoice checklist item reads these.
446+
{ description: 'INV-1007 \u00b7 Widget A units', invoice: 'INV-1007', product: 'WIDGET-A', position: 0, quantity: 20, unit_price: 4500, amount: 90000 },
447+
{ 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' },
448+
{ description: 'INV-1010 \u00b7 Widget B units', invoice: 'INV-1010', product: 'WIDGET-B', position: 0, quantity: 5, unit_price: 46, amount: 230 },
441449
],
442450
});
443451

‎packages/qa/dogfood/test/upgrade-harness/cli-prerelease-fixture.ts‎

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
// `restore` is what a checklist run replays: it loads the committed text dump
1212
// (`fixture-18.0.0-next.5/`) into two NEW SQLite files, the primary and the
1313
// telemetry sibling `os dev` keeps beside a file primary (`n5.db` and
14-
// `n5.telemetry.db`, packages/cli/src/utils/telemetry-datasource.ts). No build.
14+
// `n5.telemetry.db`, packages/cli/src/utils/telemetry-datasource.ts), its
15+
// rotation shards re-dated to the day before the run (`fixture-as-of.ts`), so
16+
// the first boot's retention keeps them. No build.
1517
//
1618
// `generate` remakes that dump, and is the only way it is made:
1719
//
@@ -42,6 +44,7 @@ import { fileURLToPath } from 'node:url';
4244
import { parseArgs } from 'node:util';
4345
import { DatabaseSync } from 'node:sqlite';
4446
import { dumpSqliteToSql, loadSqlIntoSqlite } from './sqlite-text-dump.js';
47+
import { renameShardTables, shardRenamesAsOf } from './fixture-as-of.js';
4548

4649
const HERE = dirname(fileURLToPath(import.meta.url));
4750
const REPO_ROOT = resolve(HERE, '../../../../..');
@@ -68,14 +71,33 @@ function siblingOf(primary: string): string {
6871
return /\.db$/i.test(primary) ? primary.replace(/\.db$/i, '.telemetry.db') : `${primary}.telemetry.db`;
6972
}
7073

74+
/**
75+
* The dump `file` as of this run: its rotation shards re-dated so the newest is
76+
* the day before today (`fixture-as-of.ts`). The telemetry sibling carries
77+
* `sys_activity`'s day shards, and a shard older than the rotation window is
78+
* dropped by the first boot over the copy, so a restore that loaded the dump's
79+
* own shard names would lose those rows once the window passed the day the
80+
* fixture was generated.
81+
*/
82+
function dumpAsOf(file: string): { sql: string; renames: ReadonlyMap<string, string> } {
83+
const sql = readFileSync(file, 'utf8');
84+
const renames = shardRenamesAsOf(sql);
85+
return { sql: renameShardTables(sql, renames), renames };
86+
}
87+
7188
function restore(to: string, from: string): void {
7289
if (!existsSync(join(from, 'database.sql'))) fail(`${from} holds no database.sql`, 2);
7390
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);
7491
mkdirSync(dirname(to), { recursive: true });
75-
loadSqlIntoSqlite(readFileSync(join(from, 'database.sql'), 'utf8'), to);
76-
loadSqlIntoSqlite(readFileSync(join(from, 'telemetry.sql'), 'utf8'), siblingOf(to));
92+
const primary = dumpAsOf(join(from, 'database.sql'));
93+
const telemetry = dumpAsOf(join(from, 'telemetry.sql'));
94+
loadSqlIntoSqlite(primary.sql, to);
95+
loadSqlIntoSqlite(telemetry.sql, siblingOf(to));
7796
const manifest = JSON.parse(readFileSync(join(from, 'manifest.json'), 'utf8'));
7897
console.log(`cli-prerelease-fixture: restored ${to} and ${siblingOf(to)} — born under ${manifest.ref} (${manifest.sha.slice(0, 12)})`);
98+
for (const [was, now] of [...primary.renames, ...telemetry.renames]) {
99+
console.log(`cli-prerelease-fixture: re-dated shard ${was} → ${now}`);
100+
}
79101
}
80102

81103
/** A port nothing listens on once this resolves. */

0 commit comments

Comments
 (0)