Skip to content

test(codearts): cover IDE WAL rewrites in one tick - #1012

Merged
yetone merged 1 commit into
magpie-community:mainfrom
yetihan:fix/codearts-ide-cache-stamp
Nov 11, 2026
Merged

yetone merged 1 commit into
magpie-community:mainfrom
yetihan:fix/codearts-ide-cache-stamp

Conversation

@yetihan

@yetihan yetihan commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Contributes to #1007

Summary

  • Keep the production fix from upstream 029c628.
  • Add a direct regression for a WAL rewrite whose main database, file sizes, inode, and mtimes all stay identical.
  • Test-only change; no package bump.

Why

readIdeCredential copies and applies state.vscdb, -wal, and -journal, so a credential change can live only in a sidecar. The existing same-tick regression covers the main database; this adds the missing sidecar case.

Validation

  • HOME=$(mktemp -d) bun test packages/codearts/index.test.mjs -t 'write-ahead log rewritten in one clock tick' — 1 pass, 0 fail
  • Destructive probe: removing the sidecar digest from the stamp makes this test fail with the old credential; restoring it passes
  • HOME=$(mktemp -d) bun test packages/codearts/index.test.mjs -t 'IDE' — 9 pass, 0 fail
  • bun scripts/check.mjs codearts — pass
  • node --check packages/codearts/index.test.mjs — pass
  • git diff --check — pass

@yetihan

yetihan commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Reopened as a test-only follow-up to the direct fix in 029c628.

The production implementation now hashes both sidecars, but the existing regression changes only the main database. This replaces the earlier parallel implementation with one focused WAL case: the main database, both sizes, the inode, and both mtimes stay identical while the credential changes. Removing the sidecar digest makes this test red, so the coverage is effective.

@yetone
yetone merged commit 24a327e into magpie-community:main Nov 11, 2026
2 checks passed
yetone pushed a commit that referenced this pull request Nov 11, 2026
Gives Amp Usage's registry entry an `icon`, so the store card shows the package's own icon instead of the generic page one. It points at packages/amp-usage/page/icon.svg in this repo on main, the same way Window Warmup and 书生·端砚 do, so only this repo's maintainers can change what it serves.

Run at the reviewed head 8a8049f (on mote, temp HOME):
- `bun scripts/check.mjs`: ok. `bun test scripts`: 22 pass, 0 fail. packages/amp-usage `node --test`: 47 pass, 0 fail.
- The URL answers 200, image/svg+xml, 3391 bytes, the same bytes as the file on main (added in #1000). The SVG has no script or external reference.
- Rendered the SVG as <img> at 20, 32 and 64px in Playwright 1.62 Chromium and WebKit: decodes, no page errors, the Amp wordmark reads at 20px.
- Root `bun test` (suite lock) on origin/main a69931e merged with #1009, #1012 and #1013: 8373 pass, 0 fail (8392 tests across 590 files, 361s; the rest skipped), on Linux (Ubuntu 24.04, magpie-desktop) because both Macs' suite locks were held by hours-long runs. `bun scripts/check.mjs` on that tree: ok.

Not tried: the store card in a real magpie after it fetches the new registry.

Co-authored-by: ming jiang <jm1179356055@gmail.com>
yetone pushed a commit that referenced this pull request Nov 11, 2026
…he README (#1009)

Removes the "by" byline from the Output Strategy panel (index.html, i18n.js, style.css); the attribution stays in the README. Bumps the package to 0.2.3 so dist packs it (0.2.2 is already packed and is never packed again).

Run at the reviewed head 121f571 (on mote, temp HOME):
- `git diff 0d03f7b 121f571`: only package.json 0.2.2 -> 0.2.3 and the matching version assertion in test/page.test.mjs. Everything else was reviewed at 0d03f7b.
- packages/output-strategy `bun test`: 59 pass, 0 fail. `bun scripts/check.mjs`: ok.
- Root `bun test` (suite lock) on origin/main a69931e merged with #1009, #1012 and #1013: 8373 pass, 0 fail (8392 tests across 590 files, 361s; the rest skipped), on Linux (Ubuntu 24.04, magpie-desktop) because both Macs' suite locks were held by hours-long runs. `bun scripts/check.mjs` on that tree: ok.
- Earlier, at 0d03f7b: Playwright 1.62 Chromium and WebKit at 1200 and 420px, en and zh-CN, with a stub bridge. No byline, the conversation note shows, all 7 styles load, no horizontal overflow, no page errors.

Broken by hand (at 0d03f7b): putting main's page/index.html back, or main's page/i18n.js, makes 1 test fail ("shows conversation guidance in both languages without a panel byline").

Not tried: the panel inside a real magpie window.

Co-authored-by: manjughosa <3220325975@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants