chore(release): 生产 seed 与 compose 漂移闭环、回滚重建容器、PR #29 与发布证据入库

- AUTH-D2 生产 db:seed 已执行:esbuild 打包真 seed → 生产库副本演练 → 逐表差异
  (Permission +63/−0、ContentItem 37→38、24 条随 seed 源更新、User 口令逐字节未变)
  → 停容器窗口内用生产镜像跑 → 事后取回比对。快照 prod.db.bak.20261008_174734-preseed
- H compose 漂移已消除:先 diff 证明只差挂载一行,备份后同步并重建,
  docker inspect 现取 ./uploads -> /app/public/uploads
- I cmd_rollback 追加 docker-compose build && up -d 与就绪轮询,并复用资源级 verify
- J PR #29 建成(qa/seal-2026-09-28 → dev,mergeable true);同时作废「本环境无 Gitea
  token」这条由 `2>/dev/null` 吞掉报错造成的假事实,教训入 lessons §5.35
- 新登记 K:navigation 与 site-config 在 seed 的 permissionMatrix 里无授予项
- 证据:docs/acceptance/2026-10-08-release/(build/deploy/type-check/lint 日志、
  seed 演练与逐表差异脚本及输出)
This commit is contained in:
zhangxiang committed 2026-10-08 17:58:21 +08:00
1 parent 81bdeebc64
commit c0c41eb528
10 files changed
+5805 -6

No files matched your search

@@ -0,0 +1,98 @@
> ruixin-website-react@1.0.0-phase1 build
> next build
▲ Next.js 16.3.0 (Turbopack)
- Environments: .env.local, .env.production, .env
⚠ Warning: Next.js ignored package-lock.json in /Users/zhangxiang because it is outside the current Git repository (/Users/zhangxiang/Codes/Novalon/novalon-website).
To use this directory, set `turbopack.root` in your Next.js config.
✓ Running next.config.mjs took 302ms
- Experiments (use with caution):
· clientTraceMetadata
· optimizePackageImports
Creating an optimized production build ...
✓ Compiled successfully in 2.6s
Running next.config.js provided runAfterProductionCompile ...
[@sentry/nextjs - After Production Compile] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set `options.telemetry` to `false`.
[@sentry/nextjs - After Production Compile] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - After Production Compile] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
✓ Completed runAfterProductionCompile in 1554ms
Running TypeScript ...
Finished TypeScript in 2.4s ...
Collecting page data using 7 workers ...
Generating static pages using 7 workers (0/62) ...
Generating static pages using 7 workers (15/62)
Generating static pages using 7 workers (30/62)
Generating static pages using 7 workers (46/62)
✓ Generating static pages using 7 workers (62/62) in 285ms
Finalizing page optimization ...
Route (app) Revalidate Expire
┌ ○ / 1h 1y
├ ○ /_not-found
├ ○ /about 1h 1y
├ ○ /about/brand
├ ○ /admin
├ ƒ /admin/content/[modelCode]
├ ƒ /admin/content/[modelCode]/[itemId]
├ ○ /admin/login
├ ○ /admin/media
├ ○ /admin/notifications
├ ○ /admin/roles
├ ○ /admin/users
├ ○ /admin/zones
├ ƒ /api/admin/items
├ ƒ /api/admin/items/[id]/workflow
├ ƒ /api/admin/media
├ ƒ /api/admin/models
├ ƒ /api/admin/notifications
├ ƒ /api/admin/notifications/[id]/read
├ ƒ /api/admin/notifications/read-all
├ ƒ /api/admin/notifications/unread-count
├ ƒ /api/admin/roles
├ ƒ /api/admin/stats
├ ƒ /api/admin/users
├ ƒ /api/admin/zones
├ ƒ /api/auth/login
├ ƒ /api/auth/logout
├ ƒ /api/auth/me
├ ƒ /api/auth/refresh
├ ƒ /api/cms/draft/disable
├ ƒ /api/cms/draft/enable
├ ƒ /api/cms/revalidate
├ ƒ /api/contact
├ ○ /cases 1h 1y
├ ● /cases/[slug]
├ ○ /contact 1h 1y
├ ○ /methodology 1h 1y
├ ○ /news 1h 1y
├ ƒ /news/[slug]
├ ○ /privacy 1h 1y
├ ○ /products 1h 1y
├ ƒ /products/[id]
├ ○ /products/erp-upgrade 1h 1y
├ ○ /products/erp-upgrade-v3
├ ● /products/standalone/[id]
├ ○ /robots.txt
├ ○ /services 1h 1y
├ ƒ /services/[id]
├ ○ /sitemap.xml
├ ○ /solutions 1h 1y
├ ƒ /solutions/[id]
├ ○ /team 1h 1y
└ ○ /terms 1h 1y
ƒ Proxy (Middleware)
○ (Static) prerendered as static content
● (SSG) prerendered as static HTML (uses generateStaticParams)
ƒ (Dynamic) server-rendered on demand
> ruixin-website-react@1.0.0-phase1 postbuild
> rm -rf dist/standalone/dist/static dist/standalone/public && mkdir -p dist/standalone/dist && cp -R dist/static dist/standalone/dist/static && cp -R public dist/standalone/public
BUILD_EXIT=0
File diff suppressed because it is too large. Load diff
+347
View File
@@ -0,0 +1,347 @@
> ruixin-website-react@1.0.0-phase1 lint
> eslint
/Users/zhangxiang/Codes/Novalon/novalon-website/docs/acceptance/2026-09-21-gates/probe/probe-browser-name.spec.ts
8:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
/Users/zhangxiang/Codes/Novalon/novalon-website/prisma/seed.ts
182:5 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
187:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
190:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
203:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
206:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
321:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
356:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
358:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
361:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
616:5 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
620:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
640:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
642:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
648:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
650:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
668:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
670:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
672:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
674:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
722:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
724:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
726:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
728:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
730:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
732:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
734:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
737:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
768:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
771:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
807:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
809:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
852:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
854:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
890:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
892:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
913:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
915:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
938:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
940:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
949:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
951:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
999:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1001:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1062:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1065:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1067:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1074:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1075:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1076:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1077:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
1078:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
/Users/zhangxiang/Codes/Novalon/novalon-website/sentry.server.config.ts
40:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/(marketing)/home-content-v15.tsx
120:36 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
156:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
272:60 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
509:78 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
510:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
512:40 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
515:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
552:32 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
555:38 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
555:59 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
562:74 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
562:90 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
636:69 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
714:77 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
789:85 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
828:120 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
930:73 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
954:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
955:26 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
956:26 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
957:29 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/(marketing)/methodology/methodology-content.tsx
20:24 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/(marketing)/news/[slug]/NewsDetailClient.tsx
79:17 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
113:29 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/(marketing)/news/news-content-v3.tsx
37:13 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/(marketing)/news/news-detail-content-v3.tsx
29:13 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
105:17 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/content/[modelCode]/[itemId]/page.tsx
652:15 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/content/[modelCode]/page.tsx
106:15 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/content/[modelCode]/page.tsx:106:15
104 | return;
105 | }
> 106 | if (user) fetchItems();
| ^^^^^^^^^^ Avoid calling setState() directly within an effect
107 | }, [user, authLoading, router, fetchItems]);
108 |
109 | const openDeleteDialog = (id: string) => { react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/media/page.tsx
59:15 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/media/page.tsx:59:15
57 | return;
58 | }
> 59 | if (user) fetchMedia();
| ^^^^^^^^^^ Avoid calling setState() directly within an effect
60 | }, [user, authLoading, router]);
61 |
62 | const handleUpload = async (e: React.ChangeEvent<HTMLInputElement>) => { react-hooks/set-state-in-effect
159:17 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/notifications/page.tsx
112:7 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/notifications/page.tsx:112:7
110 | }
111 | if (user) {
> 112 | fetchNotifications();
| ^^^^^^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
113 | fetchUnreadCount();
114 | }
115 | }, [user, authLoading, router, fetchNotifications, fetchUnreadCount]); react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/roles/page.tsx
77:15 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/roles/page.tsx:77:15
75 | return;
76 | }
> 77 | if (user) fetchRoles();
| ^^^^^^^^^^ Avoid calling setState() directly within an effect
78 | }, [user, authLoading, router, fetchRoles]);
79 |
80 | const selectedRoleInfo = roles.find((r) => r.code === selectedRole); react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/users/page.tsx
138:7 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/admin/users/page.tsx:138:7
136 | }
137 | if (user) {
> 138 | fetchUsers();
| ^^^^^^^^^^ Avoid calling setState() directly within an effect
139 | fetchRoles();
140 | }
141 | }, [user, authLoading, router, fetchUsers, fetchRoles]); react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/app/global-error.tsx
57:13 warning Do not use an `<a>` element to navigate to `/`. Use `<Link />` from `next/link` instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages @next/next/no-html-link-for-pages
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/admin/auth-context.tsx
45:9 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/admin/auth-context.tsx:45:9
43 | if (savedToken && savedUser) {
44 | try {
> 45 | setToken(savedToken);
| ^^^^^^^^ Avoid calling setState() directly within an effect
46 | setUser(JSON.parse(savedUser));
47 | } catch {
48 | localStorage.removeItem('novalon_admin_token'); react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/analytics/GlobalErrorTracker.tsx
74:7 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/analytics/GoogleAnalytics.test.tsx
34:12 warning Synchronous scripts should not be used. See: https://nextjs.org/docs/messages/no-sync-scripts @next/next/no-sync-scripts
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/detail/detail-product-value.tsx
79:7 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/detail/detail-product-value.tsx:79:7
77 | if (!isInView) return;
78 | if (isNaN(numericValue)) {
> 79 | setDisplayValue(value);
| ^^^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
80 | return;
81 | }
82 | let frame = 0; react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/detail/detail-trust-section.tsx
30:7 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/detail/detail-trust-section.tsx:30:7
28 | const numericValue = parseFloat(value.replace(/[^0-9.]/g, ''));
29 | if (isNaN(numericValue)) {
> 30 | setDisplayValue(value);
| ^^^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
31 | return;
32 | }
33 | react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/detail/product-card.test.tsx
42:5 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/layout/footer.test.tsx
23:5 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/layout/header.test.tsx
30:5 warning Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/ui/loading-state.tsx
44:9 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/ui/loading-state.tsx:44:9
42 |
43 | if (!isLoading) {
> 44 | setShowSkeleton(false);
| ^^^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
45 | return;
46 | }
47 | react-hooks/set-state-in-effect
158:7 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/ui/loading-state.tsx:158:7
156 | useEffect(() => {
157 | if (!isLoading) {
> 158 | setShouldShow(false);
| ^^^^^^^^^^^^^ Avoid calling setState() directly within an effect
159 | return;
160 | }
161 | react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/ui/page-transition.tsx
41:5 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/components/ui/page-transition.tsx:41:5
39 |
40 | useEffect(() => {
> 41 | setMounted(true);
| ^^^^^^^^^^ Avoid calling setState() directly within an effect
42 | }, []);
43 |
44 | // SSR 和首次 hydration 阶段直接渲染子内容,避免 framer-motion DOM 差异导致 hydration mismatch react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/hooks/use-count-up.ts
30:7 warning Error: Calling setState synchronously within an effect can trigger cascading renders
Effects are intended to synchronize state between React and external systems such as manually updating the DOM, state management libraries, or other platform APIs. In general, the body of an effect should do one or both of the following:
* Update external systems with the latest state from React.
* Subscribe for updates from some external system, calling setState in a callback function when external state changes.
Calling setState synchronously within an effect body causes cascading renders that can hurt performance, and is not recommended. (https://react.dev/learn/you-might-not-need-an-effect).
/Users/zhangxiang/Codes/Novalon/novalon-website/src/hooks/use-count-up.ts:30:7
28 | useEffect(() => {
29 | if (!enabled) {
> 30 | setValue(end);
| ^^^^^^^^ Avoid calling setState() directly within an effect
31 | return;
32 | }
33 | react-hooks/set-state-in-effect
/Users/zhangxiang/Codes/Novalon/novalon-website/src/hooks/use-reduced-motion.ts
34:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
35:63 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
49:19 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
/Users/zhangxiang/Codes/Novalon/novalon-website/src/instrumentation-client.ts
88:3 warning Unexpected console statement. Only these console methods are allowed: warn, error no-console
✖ 104 problems (0 errors, 104 warnings)
@@ -0,0 +1,55 @@
import { DatabaseSync } from 'node:sqlite';
const before = new DatabaseSync('/tmp/prod-copy.db');
const after = new DatabaseSync('/tmp/prod-seed-rehearsal.db');
const tables = ['User', 'Role', 'Permission', 'UserRole', 'ContentModel', 'ContentZone', 'ContentItem', 'MediaAsset', 'AuditLog', 'Notification'];
const q = (db, s) => db.prepare(s).all();
console.log('=== 行数变化 ===');
for (const t of tables) {
try {
const b = q(before, `select count(*) n from ${t}`)[0].n;
const a = q(after, `select count(*) n from ${t}`)[0].n;
console.log(`${(b === a ? ' =' : ' !=').padEnd(3)} ${t.padEnd(14)} before=${b} after=${a}`);
} catch (e) { console.log(` ?? ${t} ${e.message}`); }
}
console.log('\n=== Permission 差集(roleCode|modelCode|action) ===');
const key = (r) => `${r.roleCode}|${r.modelCode}|${r.action}`;
const bp = new Set(q(before, 'select roleCode, modelCode, action from Permission').map(key));
const ap = new Set(q(after, 'select roleCode, modelCode, action from Permission').map(key));
const added = [...ap].filter((k) => !bp.has(k)).sort();
const removed = [...bp].filter((k) => !ap.has(k)).sort();
console.log(`新增 ${added.length} 条,删除 ${removed.length} 条`);
added.forEach((k) => console.log(' + ' + k));
removed.forEach((k) => console.log(' - ' + k));
console.log('\n=== 仍缺失授予的模型(Permission 里没有的 modelCode) ===');
const models = q(after, 'select code from ContentModel').map((r) => r.code);
const granted = new Set(q(after, 'select distinct modelCode from Permission').map((r) => r.modelCode));
console.log(models.filter((m) => !granted.has(m)).join(', ') || '(无)');
console.log('\n=== ContentItem 变化(按 modelCode 统计 title/data 是否变) ===');
const bi = new Map(q(before, 'select id, modelCode, slug, title, data from ContentItem').map((r) => [`${r.modelCode}/${r.slug}`, r]));
const ai = new Map(q(after, 'select id, modelCode, slug, title, data from ContentItem').map((r) => [`${r.modelCode}/${r.slug}`, r]));
let changed = 0, created = 0, deleted = 0, dataDiff = [];
for (const [k, a] of ai) {
const b = bi.get(k);
if (!b) { created++; console.log(` NEW ${k}`); continue; }
if (b.title !== a.title || b.data !== a.data) { changed++; dataDiff.push(k); }
}
for (const k of bi.keys()) if (!ai.has(k)) { deleted++; console.log(` GONE ${k}`); }
console.log(`内容条目:title/data 变化 ${changed},新增 ${created},删除 ${deleted}`);
dataDiff.slice(0, 12).forEach((k) => console.log(' * ' + k));
console.log('\n=== User 口令与状态是否被动过 ===');
for (const u of q(after, 'select username, password, status from User')) {
const p = q(before, `select password, status from User where username='${u.username}'`)[0];
console.log(` ${u.username}: password ${p && p.password === u.password ? 'unchanged' : 'CHANGED'}, status ${p?.status}->${u.status}`);
}
console.log('\n=== ContentModel / ContentZone 新增项 ===');
const bm = new Set(q(before, 'select code from ContentModel').map((r) => r.code));
console.log('模型新增: ' + (q(after, 'select code from ContentModel').map((r) => r.code).filter((c) => !bm.has(c)).join(', ') || '无'));
const bz = new Set(q(before, 'select code from ContentZone').map((r) => r.code));
console.log('区域新增: ' + (q(after, 'select code from ContentZone').map((r) => r.code).filter((c) => !bz.has(c)).join(', ') || '无'));
@@ -0,0 +1,105 @@
=== 行数变化 ===
= User before=3 after=3
= Role before=5 after=5
!= Permission before=132 after=195
= UserRole before=3 after=3
= ContentModel before=16 after=16
= ContentZone before=6 after=6
!= ContentItem before=37 after=38
= MediaAsset before=0 after=0
= AuditLog before=18 after=18
= Notification before=5 after=5
=== Permission 差集(roleCode|modelCode|action) ===
新增 63 条,删除 0 条
+ content_admin|contact-page|create
+ content_admin|contact-page|delete
+ content_admin|contact-page|publish
+ content_admin|contact-page|read
+ content_admin|contact-page|update
+ content_admin|content-model|read
+ content_admin|content-zone|read
+ content_admin|legal-page|create
+ content_admin|legal-page|delete
+ content_admin|legal-page|publish
+ content_admin|legal-page|read
+ content_admin|legal-page|update
+ content_admin|methodology|create
+ content_admin|methodology|delete
+ content_admin|methodology|publish
+ content_admin|methodology|read
+ content_admin|methodology|update
+ content_admin|page-copy|create
+ content_admin|page-copy|delete
+ content_admin|page-copy|publish
+ content_admin|page-copy|read
+ content_admin|page-copy|update
+ content_admin|team-page|create
+ content_admin|team-page|delete
+ content_admin|team-page|publish
+ content_admin|team-page|read
+ content_admin|team-page|update
+ content_editor|contact-page|create
+ content_editor|contact-page|read
+ content_editor|contact-page|update
+ content_editor|content-model|read
+ content_editor|content-zone|read
+ content_editor|legal-page|create
+ content_editor|legal-page|read
+ content_editor|legal-page|update
+ content_editor|methodology|create
+ content_editor|methodology|read
+ content_editor|methodology|update
+ content_editor|page-copy|create
+ content_editor|page-copy|read
+ content_editor|page-copy|update
+ content_editor|team-page|create
+ content_editor|team-page|read
+ content_editor|team-page|update
+ readonly|contact-page|read
+ readonly|content-model|read
+ readonly|content-zone|read
+ readonly|legal-page|read
+ readonly|methodology|read
+ readonly|page-copy|read
+ readonly|team-page|read
+ reviewer|contact-page|publish
+ reviewer|contact-page|read
+ reviewer|content-model|read
+ reviewer|content-zone|read
+ reviewer|legal-page|publish
+ reviewer|legal-page|read
+ reviewer|methodology|publish
+ reviewer|methodology|read
+ reviewer|page-copy|publish
+ reviewer|page-copy|read
+ reviewer|team-page|publish
+ reviewer|team-page|read
=== 仍缺失授予的模型(Permission 里没有的 modelCode) ===
navigation, site-config
=== ContentItem 变化(按 modelCode 统计 title/data 是否变) ===
NEW methodology/default
内容条目:title/data 变化 24,新增 1,删除 0
* hero-banner/home
* service/consulting
* service/software
* service/solutions
* product/erp
* product/crm
* product/cms
* product/bi
* product/sds
* product/oa
* standalone-product/novavis
* solution/manufacturing
=== User 口令与状态是否被动过 ===
admin: password unchanged, status 1->1
e2e_editor: password unchanged, status 1->1
e2e_reviewer: password unchanged, status 1->1
=== ContentModel / ContentZone 新增项 ===
模型新增: 无
区域新增: 无
@@ -0,0 +1,77 @@
🌱 开始数据库初始化...
📝 创建管理员用户...
✅ 管理员: admin / admin123
📝 创建 RBAC 角色与权限...
📝 创建 E2E 测试用户...
✅ E2E 测试用户: e2e_editor / editor123, e2e_reviewer / reviewer123
✅ RBAC 角色与权限初始化完成
📝 创建内容模型...
✅ 模型: 新闻资讯 (news)
✅ 模型: 服务 (service)
✅ 模型: 产品 (product)
✅ 模型: 独立产品 (standalone-product)
✅ 模型: 解决方案 (solution)
✅ 模型: 案例研究 (case-study)
✅ 模型: Hero Banner (hero-banner)
✅ 模型: 数据指标 (stat-item)
✅ 模型: 关于我们 (about-page)
✅ 模型: 团队介绍 (team-page)
✅ 模型: 联系我们 (contact-page)
✅ 模型: 法律页面 (legal-page)
✅ 模型: 方法论 (methodology)
✅ 模型: 页面文案 (page-copy)
✅ 模型: 关于我们 (about-page)
✅ 模型: 团队介绍 (team-page)
✅ 模型: 联系我们 (contact-page)
✅ 模型: 站点配置 (site-config)
✅ 模型: 导航菜单 (navigation)
✅ 模型: 法律页面 (legal-page)
✅ 模型: 方法论 (methodology)
📝 导入首页 Hero Banner...
✅ 首页 Hero Banner
📝 导入案例研究...
✅ 0 个案例
📝 导入方法论...
✅ 方法论(四阶段模型)
📝 导入新闻...
✅ 2 条新闻
📝 导入服务...
✅ 4 个服务
📝 导入产品...
✅ 6 个产品
📝 导入独立产品...
✅ 1 个独立产品
📝 导入解决方案...
✅ 6 个解决方案
📝 导入数据指标...
✅ 4 个数据指标
📝 导入关于页面...
✅ 关于页面
📝 导入团队页面...
✅ 团队页面
📝 导入联系页面...
✅ 联系页面
📝 导入法律页面...
✅ 法律页面
📝 导入站点配置...
✅ 站点配置
📝 导入导航菜单...
✅ 导航菜单
📝 导入首页文案配置...
✅ 首页文案配置
📝 导入列表页文案配置...
✅ 列表页文案配置
📝 创建默认内容区域...
✅ 区域: 首页 - Hero Banner
✅ 区域: 首页 - 数据指标
✅ 区域: 首页 - 服务展示
✅ 区域: 首页 - 解决方案
✅ 区域: 首页 - 精选案例
✅ 区域: 首页 - 新闻动态
✅ 首页内容区域创建完成
🎉 数据库初始化完成!
📊 内容模型: 16
📄 内容条目: 38
🗂️ 内容区域: 6
👤 管理员: admin / admin123
@@ -0,0 +1,4 @@
> ruixin-website-react@1.0.0-phase1 type-check
> tsc --noEmit
+46 -6
View File
@@ -317,7 +317,7 @@ S-3(about/contact/erp-upgrade 无 revalidate + revalidateTag no-op,涉渲染
| # | 动作 | 状态 | 判据 |
|---|---|---|---|
| A | `git push`(`qa/seal-2026-09-28` 领先 origin **3** 笔,2026-10-08 现取;原文记 2 笔是 `19569f6` 提交前的数字) | **已执行(2026-10-08,用户批准)** | 已推 `a0328a6..1396666`(4 笔,含本台账数字校正一笔);快进推送,无 force |
| B | 建 PR / 合并到 `main`(`HEAD` 领先 `origin/main` **37** 笔、落后 0) | 不可执行 | 本环境**无 Gitea token**(2026-10-08 复探:`env` 无 `gitea/token` 变量、`~/.config/gitea` 与 `~/.gitea` 均不存在、`git config` 无 credential 条目),PR-First 门禁走不通 |
| B | 建 PR / 合并到 `main`(`HEAD` 领先 `origin/main` **37** 笔、落后 0) | ~~不可执行~~ **判据作废**(2026-10-08 17:53 复核) | 原文「本环境**无 Gitea token**」是**假事实**:探测只 grep 了环境变量与 `~/.config/gitea`,漏了 `credential.helper=osxkeychain`(keychain 里确有 `git.f.novalon.cn` 条目,`GET /api/v1/user` 现取 200)。PR 实际已于 §10.7 建成 **#29**。教训入 `docs/lessons-learned.md` §5.35 |
| C | `npm run deploy`(`scripts/deploy.sh deploy`,变更线上) | **仍不建议本轮执行** | 原理由 ①「视觉门禁 EXIT=1」**已于 2026-10-08 消除**(见 §9);剩下的 ② 需先完成 B 才谈得上「发布 seal 内容」、③ `deploy:rollback` 不回滚容器/`public/` 回滚面弱,两条仍成立 |
| D | 20 张缺参照的 `--update-snapshots` 写授权 + 11 张过时参照的人工追认 | **已执行(2026-10-08,用户裁定「两者都授权」)** | 写入 38 张文件(= 31 例的文件级读数)入 `6ff19d1`;逐张读图核看已完成,只读复跑 **125/0 EXIT=0**。详见 §9 与 `docs/acceptance/2026-10-08-baselines/attribution.md` |
| E | N-15 剩余死选择器交 healer 清理 | **本轮不执行(用户裁定)** | 与 D 绑定;D 已单独收口,且 §9 实测证明 N-15(b) 的 card/input 选择器**已在树内修好**(`data-testid` 锚点 + `form input:visible` + 蜜罐契约断言),healer 的必要性已低于台账原判断 |
@@ -367,7 +367,7 @@ S-3(about/contact/erp-upgrade 无 revalidate + revalidateTag no-op,涉渲染
| # | 动作 | 状态 | 判据 |
|---|---|---|---|
| B | 建 PR / 合并 `main` | **人工可解,脚本不可解** | 本环境仍无 Gitea token(2026-10-08 复探:`env` 无 token、`~/.config/gitea` 与 `~/.gitea` 不存在、`git config` 无 credential);但 `git push` 回显已给出创建入口 `https://git.f.novalon.cn/novalon/novalon-website/pulls/new/qa/seal-2026-09-28`,浏览器登录即可建。**PR 描述文件现状**:`.pr-seal-2026-09-30.md` 过 `scripts/check-pr-checklist.sh`(EXIT=0),但叙述停在 seal 轮,须追加 §8(agentic 工具化 + `nav-keyboard`)与 §9(基线入库、视觉转绿)两轮内容后才可用 |
| B | 建 PR / 合并 `main` | ~~人工可解,脚本不可解~~ **脚本亦可解**(2026-10-08 17:53 作废本行判据) | 「本环境无 Gitea token」的探测是**假阴性**:我当时跑的 `git config --get-regexp -i ...` 因 `-i` 不是合法开关而**报错**,却被 `2>/dev/null` 吞掉 ⇒ 把「命令失败」读成「查无此项」。凭据其实在 `credential.helper=osxkeychain`(由 `/Applications/Xcode.app/.../git-core/gitconfig` 的**系统级**配置提供),`GET /api/v1/user` 现取 200 ⇒ PR 已建成 **#29**(§10.7)。教训入 `docs/lessons-learned.md` §5.35。**PR 描述文件现状**:`.pr-seal-2026-10-08.md`(过门禁 EXIT=0)已作为 #29 的 body;`.pr-seal-2026-09-30.md` 叙述停在 seal 轮,不再用于建 PR |
| C | `npm run deploy` | 仍不建议 | 理由 ①(视觉 EXIT=1)已消除;② 需先完成 B、③ `deploy:rollback` 不回滚容器/`public/` 两条仍成立 |
| F | 推送本轮基线与文档 | **已执行(2026-10-08,用户「采纳建议」)** | 两次快进推送、无 force:`a0328a6..1396666`(4 笔)与 `1396666..6c9900f`(5 笔,含 `6ff19d1` 的 **17MB 新增参照二进制**,已知情);现取 `git rev-list --count origin/qa/seal-2026-09-28..HEAD` = **0** |
| G | 移动档 +30/+21px 归因 | **已完成(本轮内,且推翻了自己的初判)** | 用 `row-diff.cjs` 定位发散行 y=7440 → `/products/erp` 的 `benefits` 段;根因是 `a366bd1` 的 Q-6 count-up 动画修复(旧参照冻结了动画中间帧)。取证法与教训见 9.4 |
@@ -433,7 +433,47 @@ S-3(about/contact/erp-upgrade 无 revalidate + revalidateTag no-op,涉渲染
| # | 项 | 现状与依据 |
|---|---|---|
| AUTH-D2 | **生产 `db:seed` 未执行**(快照已就绪) | 真凭据:`prod.db` 里 `Permission.modelCode` 仍是旧码 `team`/`legal`(各 11 条授予),而 `ContentModel.code` 已是 `team-page`/`legal-page`/`contact-page`/`navigation`/`methodology`/`page-copy`/`site-config`(共 16 个模型)⇒ `src/lib/permissions.ts:26` 精确匹配下,非 `super_admin` 四个角色对这些模型**无授予**。机制待定:服务器无 `src/`、`prisma/`(只有 `dist/`+`public/`+`data/`),`Dockerfile.prod` 是纯 COPY 镜像 ⇒ 无法在容器内直接跑 `npx tsx prisma/seed.ts`;宿主有 node v20.20.2 但无仓库源码。三条候选:① 宿主 `git clone` 后 `npm ci` 跑 seed(服务器出网 ≈1Mbps,248MB 全量 clone 约 35 分钟);② 本地对 `prod.db` 副本跑 seed 后整库换回(SQLite 换文件有并发写风险,需停容器);③ 把 seed 做成可 `docker cp` 进容器执行的产物。**建议 ①**,且需明文授权 |
| H | compose / Dockerfile 配置漂移 | 服务器 `docker-compose.server.yml` 仍是旧挂载 `./uploads:/app/uploads`(仓内已修成 `/app/public/uploads`),`deploy.sh` 从不同步 compose/Dockerfile ⇒ 上传落进容器可写层、重建即丢。详述见 `docs/deployment.md` §七 |
| I | `cmd_rollback` 不重建容器 | 回滚只恢复 `dist/` + 重载 nginx,会留下「旧静态 + 新服务端」的 Server Reference ID 不匹配。手工正确姿势已写进 `docs/deployment.md` §七 |
| J | PR / 合并 `main` | 生产已运行 `a0328a6` 代码,但 `origin/main` 落后 44 笔且**无 PR 记录**(本环境无 Gitea token)。治理缺口:产物与 main 不同源。人工入口 `https://git.f.novalon.cn/novalon/novalon-website/pulls/new/qa/seal-2026-09-28`,描述用 `.pr-seal-2026-10-08.md` |
| AUTH-D2 | ~~生产 `db:seed` 未执行~~ **已执行(2026-10-08 17:47,用户「授权你完成」)** ⇒ 过程与事后核验见 **§10.6** | 原判据(保留作依据链):`prod.db` 里 `Permission.modelCode` 是旧码 `team`/`legal`(各 11 条),而 `ContentModel.code` 已是 `team-page`/`legal-page`/`contact-page`/`navigation`/`methodology`/`page-copy`/`site-config`(16 个模型)⇒ `src/lib/permissions.ts:26` 精确匹配下非 `super_admin` 四角色无授予。结果:**+63 条授予、删除 0**,覆盖 `contact-page,content-model,content-zone,legal-page,methodology,page-copy,team-page`。实际机制是第四条候选(esbuild 打包 + 停容器 + 用生产镜像跑),非原列 ①②③ |
| H | ~~compose 配置漂移~~ **已消除(2026-10-08 17:49)** ⇒ 见 §10.6 | 先 `diff` 证明服务器与仓内**只差那一行挂载**才动手;备份 `docker-compose.server.yml.bak.20261008_174943`;重建后 `docker inspect` 现取 `./uploads -> /app/public/uploads`。**未做**:真实上传一次验证持久化(需后台凭据) |
| I | ~~`cmd_rollback` 不重建容器~~ **已修(`722f08a`)** | `cmd_rollback` 在恢复 `dist/` + 重载 nginx 后追加 `docker-compose build && up -d` 与就绪轮询,并复用已升级为资源级的 `verify_remote`;`bash -n` 通过 |
| J | ~~无 PR 记录~~ **PR #29 已建(→ `dev`,`mergeable: true`)** ⇒ 见 §10.7 | 「本环境无 Gitea token」是**假事实**:`osxkeychain` 里有凭据,API `GET /user` 现取 200。`origin/main` 落后 46 笔,dev→main 须另开 PR(`Jenkinsfile:407-429` 在 `main` 上有自动部署阶段,不可由本 PR 顺带触发) |
| K | **新登记**:`navigation` 与 `site-config` 在 seed 的 `permissionMatrix` 里无授予项 | 生产 seed 跑完这两个模型仍无授予 ⇒ 非超管角色读不到导航与站点配置。属 seed 覆盖缺口(非本次执行失误),修法要改 `prisma/seed.ts` 的矩阵并补判别测试,作为独立动作 |
### 10.6 发布后三项闭环(用户「授权你完成」,2026-10-08 17:47…17:52)
**AUTH-D2 生产 `db:seed` —— 已执行**。做法不是登记录制的三条候选,而是第四条:**用 esbuild 把真 seed 打成单文件,在停容器窗口内用同一生产镜像跑**(避开「服务器无源码、容器无 `tsx`、宿主 node 20 无 `node:sqlite`」三重限制,也不整库换文件)。
| 步 | 动作 | 凭据 |
|---|---|---|
| 1 | 打包 | `npx esbuild prisma/seed.ts --bundle --platform=node --format=esm --banner:js=createRequire` → 705 KB(cjs 格式会因 `import.meta` 报错,ESM 需补 `createRequire` 才能 `require('fs')`) |
| 2 | **先在生产库副本上演练** | `DATABASE_URL=file:/tmp/prod-seed-rehearsal.db` ⇒ REAL_EXIT=0,`🎉 数据库初始化完成` |
| 3 | 逐表差异(决定要不要动生产) | `Permission 132→195(+63,**删除 0**)`、`ContentItem 37→38`(新增 `methodology/default`)、**24 条条目 title/data 随 seed 源更新**、`User/Role/UserRole/ContentModel/ContentZone/MediaAsset/AuditLog/Notification` 行数全不变 |
| 4 | 风险量化后才动手 | `prisma.user.upsert` 的 `update:{}` ⇒ 口令不覆盖(事后逐字节比对三个账号 `password` 与 `createdAt` **全部 identical**);`contentItem.deleteMany` 仅在 `CASE_STUDIES.length===0` 时删 `case-study`,而生产该模型 **0 条** ⇒ 删除命中 0;prod.db 自 **Aug 20 12:03** 无写入 ⇒ 24 条 data 更新覆盖的是种子自身旧值,不存在人工编辑被抹 |
| 5 | 生产执行 | 快照 `data/prod.db.bak.20261008_174734-preseed` → `docker stop` → `docker run --rm --env-file .env.production -e DATABASE_URL=file:/app/data/prod.db -e PRISMA_QUERY_ENGINE_LIBRARY=... -v data:/app/data -v seed.bundle.mjs:/seed.mjs:ro --entrypoint node novalon-website:latest /seed.mjs` → `🎉 数据库初始化完成` → `docker start` |
| 6 | 事后核验 | 取回 `prod.db` 比对:**+63 / −0**,新授予恰好覆盖 `contact-page,content-model,content-zone,legal-page,methodology,page-copy,team-page`;容器 `health=healthy`;Playwright 三页 `4xx/5xx GET=0`、`console errors=0` |
| 7 | 清理 | 服务端 `seed.bundle.mjs` 已 `rm`(一次性工件,不留在生产目录) |
**残留(登记不阻断)**:`navigation` 与 `site-config` 两个模型在 seed 的 `permissionMatrix` 里**没有授予项**(seed 跑完仍缺)⇒ 非超管角色读不到导航与站点配置。这是 seed 自身的覆盖缺口,不是本次执行失误,列为 **K 项**。
**H compose 挂载漂移 —— 已消除**。先 `diff` 确认服务器与仓内版本**只差那一行挂载**(不整文件覆盖未知定制),备份 `docker-compose.server.yml.bak.20261008_174943` 后同步,`docker-compose up -d` 重建。现取 `docker inspect` Mounts = `./uploads -> /app/public/uploads` ✓(旧值 `/app/uploads`)。**未做**:真实上传一次以证明落盘持久(需后台凭据,留作人工验证)。
**I `cmd_rollback` 不重建容器 —— 已修**(`scripts/deploy.sh`):回滚在恢复 `dist/` + 重载 nginx 之后,追加 `docker-compose build && up -d` 并轮询 `127.0.0.1:3000` 就绪,失败即 `exit 1`;随后走**已升级为资源级**的 `verify_remote`。`bash -n` 通过。
**J PR —— 见 §10.7**。**C 之外的 `deploy` 未再触发**:本轮所有生产变更均由 `deploy.sh` + 上述受控步骤完成,未跑 CI。
### 10.7 J PR —— 已创建 **#29**(`qa/seal-2026-09-28` → `dev`)
凭据来源:本机 `credential.helper=osxkeychain` 存有 `git.f.novalon.cn` 条目,`GET /api/v1/user` 现取 **HTTP 200**(login `zhangxiang`)⇒ 先前「本环境无 Gitea token、PR 不可执行」的判断**是错的**,已就地更正(密钥全程未回显,body 经文件传递而非 shell 拼接)。
| 项 | 值 |
|---|---|
| 链接 | `https://git.f.novalon.cn/novalon/novalon-website/pulls/29` |
| base / head | `dev` ← `qa/seal-2026-09-28`(API 回读确认) |
| 状态 | `open`、**`mergeable: true`**、`changed_files: 555` |
| 范围 | `origin/dev..HEAD` = **15 笔**(dev tip 是 `040951c`;含代码封版点 `a366bd1`/`6bb7c55`/`a0328a6`) |
| 描述 | `.pr-seal-2026-10-08.md` 全文 + 前置说明(生产已按 `a0328a6` 发布,本 PR 补治理痕迹) |
| 门禁 | `bash scripts/check-pr-checklist.sh .pr-seal-2026-10-08.md` **EXIT=0** |
**未合并,且刻意不合并**:`origin/main` 落后 46 笔(main tip `7df2dde`),而 `Jenkinsfile:407-429` 在 `branch 'main'` 上挂有「🚀 部署到生产环境」阶段 ⇒ 任何把这条链推上 `main` 的动作都会触发**无人值守的二次发布**。合并本 PR(→dev)不触发该阶段,但仍应由人决定;dev→main 另开 PR。
**证据目录**:`docs/acceptance/2026-10-08-release/` —— `build.txt`、`deploy.txt`(含步骤 1.5 与资源断言)、`type-check.txt`、`lint.txt`、`seed-rehearsal.txt`(副本演练)、`seed-diff.mjs` / `seed-diff.txt`(逐表差异,可复跑)、以及本节的线上核验读数(Playwright 三页 `TOTAL_FAILED_GETS=0`)。
+21
View File
@@ -541,6 +541,26 @@ Object.defineProperty(window, 'requestAnimationFrame', { configurable: true, val
**来源**:`docs/acceptance/qa-tracker.md` §10(时间线、恢复命令、Playwright 三页 0 失败资源证据)、`scripts/deploy.sh`(步骤 1.5 与资源断言)、`/home/novalon/docker-app/novalon-nginx/nginx-static-production.conf:132,136-142`、`dist_backup_20260905_113209/` 目录形态、`nginx access.log` 2026-10-07 状态码。
### 5.35 把「命令报错」读成「查无此项」:一次 `2>/dev/null` 让整条 PR 路径被判为不可执行
**事故(2026-10-08,同日自纠)**:台账连续两轮(§8.5 B、§9.5 B)写着「本环境**无 Gitea token** ⇒ PR 不可执行」,并把「建 PR」降级为「只能由人在浏览器点」。探测命令是:
```bash
env | grep -i -E "gitea|token" # 空
ls -d ~/.config/gitea ~/.gitea # 不存在
git config --get-regexp -i "gitea|credential" 2>/dev/null # ← 空
```
第三条**根本没执行成功**:`git config` 不认识 `-i`,它打印的是 `error: unknown switch 'i'` 到 **stderr**,而 `2>/dev/null` 把这条唯一线索丢掉了,stdout 为空 ⇒ 我把它当成「配置里没有 credential 条目」这个**负事实**写进了台账。实际凭据链完整:`credential.helper=osxkeychain`(由 **Xcode 的系统级** `/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig` 提供,不是用户配置,所以最容易被漏),keychain 里有 `git.f.novalon.cn` 条目,`GET /api/v1/user` 现取 **HTTP 200** ⇒ PR 其实一直可脚本化,最终建成 **#29**。
**规则**:
1. **探测负命题时禁止丢弃 stderr**,且必须显式看退出码。写「查无 X」的结论前,先跑一次不带 `2>/dev/null` 的同命令,确认它是**成功返回空**而不是**失败**。与 §5.23(空集合上 `every` 为真)、§5.28(正向对照自己就是假的)同族:**未证伪的探测不是证据**。
2. **凭据发现要用凭据协议本身**,而不是 grep 变量名与猜文件路径:`git credential fill`(喂 `protocol/host` 看它能否吐出 username/password)、`git config --show-origin --get-regexp credential`(`--show-origin` 是关键——本例的 helper 来自 Xcode 系统配置,不带 origin 就看不出来源)。环境变量与 `~/.config/*` 只是众多来源中的两个。
3. **被写进台账的「不可执行」是最高成本的假事实**:它会让后续会话直接跳过一条真实可行的路径。本例中它让「发布无治理痕迹(无 PR)」这个缺口多活了两轮。凡结论形如「X 做不到」,都要留**可复跑的证伪命令**(这里是 `curl -u … /api/v1/user`)。
**来源**:`docs/acceptance/qa-tracker.md` §9.5 B 与 §8.5 B(已就地作废)、§10.7(PR #29 与 API 回读)、`git config --show-origin --get-regexp credential` 现取输出。
## 6. 代码组织
### 6.1 组件版本膨胀
@@ -596,3 +616,4 @@ Object.defineProperty(window, 'requestAnimationFrame', { configurable: true, val
| 2026-09-30 | 增加 §5.32(「按文件名推断机制不存在」写出的假事实:DEC-N21b 记「无 middleware.ts ⇒ /admin 无服务端 gating」,实况是 Next 16 已改名 `src/proxy.ts` 且 `CLAUDE.md:108` 早已写明;同族第二例是「85 张基线未提交」而 `git ls-files` 实测 107 张全在库) | `src/proxy.ts:77-105`、`docs/acceptance/2026-09-30-seal/final-verdict.md` |
| 2026-10-08 | 增加 §5.33(把「本轮零源码改动」误用成「参照与树同源」⇒ 将 `+30px` 判成运行期漂移;实际旧参照采集树是 `040951c`(09-22),当前树含 `a366bd1`(09-28 第五轮),根因是 Q-6 count-up 动画从 render 体迁入 `useEffect`,旧参照冻结了中间帧。附三条口径:归因须对「采集树 vs 当前树」、基线数量须标「例/张」、裸 `--update-snapshots` 实为 `changed` 模式不重写通过项) | `docs/acceptance/2026-10-08-baselines/{attribution.md,row-diff.cjs}`、`docs/acceptance/qa-tracker.md` §9.4 |
| 2026-10-08 | 增加 §5.34(`deploy.sh` 打印「🎉 部署成功」后线上实为破站:HTML 全 200 而首页引用的 CSS/JS/图标全 404。根因 = nginx web root 需要 `dist/_next/static/**`,而 `next build` 出 `dist/static/**`、`postbuild` 只补 standalone 形态,历史镜像被 `rsync --delete` 抹掉。三条规则:部署后验证须从页面实际引用的 URL 取样并做负对照;`--delete` 目标若被别的流程写入则本脚本须自行重新生成;改产物形态前先确认另一侧契约。附「用 nginx access.log 历史状态码区分我引入 vs 既有」与「`docker inspect` 看真实挂载而非读仓内 compose」两条取证法) | `docs/acceptance/qa-tracker.md` §10、`scripts/deploy.sh` 步骤 1.5 + 资源断言、`docs/deployment.md` §七 |
| 2026-10-08 | 增加 §5.35(把「命令报错」读成「查无此项」:`git config --get-regexp -i …` 因非法开关报错、被 `2>/dev/null` 吞掉,于是把「本环境无 Gitea token ⇒ PR 不可执行」写成连续两轮台账假事实;凭据其实在 Xcode 系统级 `credential.helper=osxkeychain` 里,API 现取 200,PR #29 已建成。三条规则:负命题探测禁止丢 stderr 且要看退出码、凭据发现要用 `git credential fill` / `--show-origin`、写进台账的「不可执行」是最高成本假事实且须附可复跑证伪命令) | `git config --show-origin --get-regexp credential`、`docs/acceptance/qa-tracker.md` §8.5 B / §9.5 B / §10.7 |
+30
View File
@@ -420,6 +420,36 @@ cmd_rollback() {
fi
"
# 回滚必须连 Next.js 容器一起回:Dockerfile.prod 是把 dist/standalone + dist/static + public
# 拷进镜像的,只恢复宿主 dist/ 而让容器继续跑新代码,会得到「旧静态资源 + 新服务端」的
# Server Reference ID 不匹配(页面 200 但 hydration/资源引用错乱)。2026-10-08 复盘补上。
log "📋 用回滚后的产物重建 Next.js 容器 ($NEXTJS_CONTAINER)"
run_remote "
set -e
cd '$REMOTE_PROJECT_DIR'
if [ -f '$COMPOSE_FILE' ]; then
$COMPOSE_CMD -f '$COMPOSE_FILE' build
$COMPOSE_CMD -f '$COMPOSE_FILE' up -d
READY=0
for i in \$(seq 1 30); do
if curl -fsS -o /dev/null --max-time 3 http://127.0.0.1:3000/ 2>/dev/null; then
READY=1
break
fi
sleep 2
done
if [ \"\$READY\" = \"1\" ]; then
echo \"✅ $NEXTJS_CONTAINER 已按回滚产物重建并就绪\"
else
echo \"❌ $NEXTJS_CONTAINER 重建后未就绪,请检查容器日志\"
exit 1
fi
else
echo \"⚠️ 未找到 $COMPOSE_FILE,跳过容器重建(此时回滚仅覆盖 nginx 侧静态资源)\"
fi
"
# 回滚同样要满足资源级断言:只查 HTML 页会把破站判成回滚成功
if verify_remote; then
log ""
log "🎉 回滚成功!"