清理过期共享记忆与固定文案检查

移除运维和原生壳对记忆文案的固定措辞检查,保留实际契约与权限验证
清理过期决策和踩坑流水账,保留当前兼容约束与未完成验证边界
明确共享记忆维护规则,并同步修正游戏发行计划的现行入口说明
This commit is contained in:
2026-09-29 15:04:32 +08:00
parent 16f507ac15
commit 6d8969a6fa
6 changed files with 47 additions and 1087 deletions
-98
View File
@@ -10,9 +10,6 @@ const nativeShellPlanPath =
'docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md';
const hostBridgeProtocolDocPath =
'docs/【前端架构】宿主壳能力统一协议-2026-06-17.md';
const developmentWorkflowDocPath =
'docs/project-memory/shared-memory/development-workflow.md';
const decisionLogDocPath = 'docs/project-memory/shared-memory/decision-log.md';
const rootPackageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
const mobileShellConfigCheckSource = fs.readFileSync(
'apps/mobile-shell/scripts/check-config.mjs',
@@ -3774,107 +3771,12 @@ function extractDocumentMethodTable(source) {
);
}
function assertNativeShellScaffoldScanWording(source, label) {
if (
source.includes('三端生产壳临时替身词扫描') ||
source.includes('三端壳生产源码') ||
source.includes('壳生产源码禁替身') ||
!source.includes('H5 HostBridge 真实调用链的临时替身词扫描')
) {
throw new Error(
`${label} must document production scaffold scanning for the H5 HostBridge call chain`,
);
}
}
function assertNativeShellCapabilityPlan() {
const planSource = fs.readFileSync(nativeShellPlanPath, 'utf8');
const hostBridgeProtocolDocSource = fs.readFileSync(
hostBridgeProtocolDocPath,
'utf8',
);
const developmentWorkflowDocSource = fs.readFileSync(
developmentWorkflowDocPath,
'utf8',
);
const decisionLogDocSource = fs.readFileSync(decisionLogDocPath, 'utf8');
if (
planSource.includes('permissions` 必须只包含 `core:default`') ||
planSource.includes(
'permissions=["core:default","allow-host-bridge-request"]',
)
) {
throw new Error(
'native shell plan must not document core:default as a desktop capability permission',
);
}
if (
!planSource.includes('主窗口 capability 只授予 `allow-host-bridge-request`')
) {
throw new Error(
'native shell plan must document the minimal desktop capability permission',
);
}
for (const staleShareWording of [
'深链、系统分享、即时本地通知',
'重复执行支付、登录、系统分享、文件导入导出',
'发布分享弹窗只有声明 `share.open` 时才显示“系统分享”',
'发布分享弹窗只有在宿主声明 `share.open` 时才提供“系统分享”动作',
]) {
if (
planSource.includes(staleShareWording) ||
hostBridgeProtocolDocSource.includes(staleShareWording) ||
decisionLogDocSource.includes(staleShareWording)
) {
throw new Error(
`native shell docs must describe share.open as a host-specific controlled share action: ${staleShareWording}`,
);
}
}
for (const requiredShareWording of [
'深链、受控分享动作、即时本地通知',
'重复 `id` 不得重复执行支付、登录、受控分享动作、文件导入导出',
'发布分享弹窗在 Expo 移动壳声明 `share.open` 时提供“系统分享”动作',
'发布分享弹窗在 Tauri 桌面壳中展示“复制分享文案 / 已复制 / 复制失败”',
'并按 `hostShell` 区分 Expo 系统分享面板和 Tauri 剪贴板复制表达',
]) {
if (
!planSource.includes(requiredShareWording) &&
!hostBridgeProtocolDocSource.includes(requiredShareWording) &&
!decisionLogDocSource.includes(requiredShareWording)
) {
throw new Error(
`native shell docs missing host-specific share.open wording: ${requiredShareWording}`,
);
}
}
for (const staleMobilePermissionText of [
'Android `permissions` 不手写显式权限',
'最终 Expo public config 只允许扫码能力由 `expo-camera` plugin 带入 `android.permission.CAMERA`',
'移动拍摄不请求麦克风权限',
]) {
if (
planSource.includes(staleMobilePermissionText) ||
hostBridgeProtocolDocSource.includes(staleMobilePermissionText)
) {
throw new Error(
`native shell docs must not keep stale mobile permission wording: ${staleMobilePermissionText}`,
);
}
}
assertNativeShellScaffoldScanWording(planSource, 'native shell plan');
assertNativeShellScaffoldScanWording(
hostBridgeProtocolDocSource,
'HostBridge protocol document',
);
assertNativeShellScaffoldScanWording(
developmentWorkflowDocSource,
'development workflow document',
);
assertNativeShellScaffoldScanWording(
decisionLogDocSource,
'decision log document',
);
assertShellLayerLayoutDocumented(planSource, 'native shell plan');
assertShellLayerLayoutDocumented(
hostBridgeProtocolDocSource,
-124
View File
@@ -2055,12 +2055,6 @@ const checks = [
reason:
'Pingora 试点文档必须记录 realpath canary 的 Nginx log_format 加载顺序踩坑。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: 'Pingora realpath canary include 要晚于 log_format',
reason:
'团队共享踩坑必须记录 realpath canary 独立 server 在 conf.d 中的加载顺序要求。',
},
{
file: 'scripts/jenkins-server-provision.sh',
includes: 'genarrative-health-patrol.timer',
@@ -3349,16 +3343,6 @@ const checks = [
includes: 'manifest.files` 视为闭集',
reason: '生产运维文档必须说明证据验真默认闭集归档口径。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: 'manifest.files` 视为闭集',
reason: '团队共享决策必须记录 Pingora 证据验真闭集归档口径。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: 'manifest.files` 视为闭集',
reason: '团队共享踩坑必须记录 Pingora 证据目录不能夹带未登记条目。',
},
{
file: 'docs/technical/【开发运维】Pingora独立网关试点-2026-06-11.md',
includes: 'pingora-gateway-env-shadow-switch.mjs --apply',
@@ -3371,18 +3355,6 @@ const checks = [
reason:
'生产运维文档必须记录 rollback apply 前用随包脚本恢复 Pingora shadow env。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: 'pingora-gateway-env-shadow-switch.mjs --apply',
reason:
'团队共享决策必须记录 rollback apply 前用随包脚本恢复 Pingora shadow env。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: 'pingora-gateway-env-shadow-switch.mjs --apply',
reason:
'团队共享踩坑必须记录 rollback apply 前用随包脚本恢复 Pingora shadow env。',
},
{
file: 'deploy/nginx/README.md',
includes: 'scripts/deploy/pingora-gateway-env-shadow-switch.mjs',
@@ -6772,39 +6744,6 @@ const checks = [
reason:
'Nginx README 必须说明 direct live 静态响应头摘要缺关键证据时会阻断证据包。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: 'API / WSS 检查不落原始响应头',
reason: '团队共享决策必须记录 direct live 只归档静态白名单响应头。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: 'directLiveStaticHeaders',
reason:
'团队共享决策必须记录切流 manifest 提升 direct live 静态响应头摘要。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes:
'静态头摘要缺少缓存头、校验头、Range `206 + Content-Range`、ETag 304 / Last-Modified 304 证据时整包记为 `CRITICAL`',
reason: '团队共享决策必须记录静态响应头摘要不完整会阻断证据包。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: '不要把 `direct-live.json` 当成只有状态码的摘要',
reason: '团队共享踩坑必须提醒 direct live JSON 需要可复盘静态响应头证据。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: 'manifest.summary.directLiveStaticHeaders',
reason: '团队共享踩坑必须提醒切流 manifest 需要可快速复盘静态响应头摘要。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes:
'摘要缺少缓存头、校验头、Range `206 + Content-Range`、ETag 304 或 Last-Modified 304 证据,证据包会直接记为 `CRITICAL`',
reason: '团队共享踩坑必须提醒静态响应头摘要不完整会阻断证据包。',
},
{
file: 'scripts/ops/pingora-cutover-evidence-bundle.mjs',
includes: 'directLiveAccessLog',
@@ -7032,11 +6971,6 @@ const checks = [
excludes: '补齐 Brotli 取舍',
reason: 'Pingora 试点文档不能继续把 Brotli 取舍留成待办。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: 'Pingora Brotli 不能只看 Content-Encoding',
reason: '团队共享踩坑必须记录 Pingora Brotli 端到端解压风险。',
},
{
file: 'deploy/pingora/pingora-gateway.env.example',
includes: 'GENARRATIVE_PINGORA_GATEWAY_GZIP_LEVEL=5',
@@ -7137,17 +7071,6 @@ const checks = [
'--direct-pingora-access-log /var/log/genarrative/pingora-gateway.access.log',
reason: '生产运维文档必须展示 Pingora 直连 access log 落盘校验参数。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: '直连日志证据补充',
reason: '团队共享决策必须记录 Pingora 直连 access log 证据门禁。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes:
'--direct-pingora-access-log /var/log/genarrative/pingora-gateway.access.log',
reason: '团队共享踩坑必须记录 Pingora 直连 access log 参数。',
},
{
file: 'docs/【开发运维】本地开发验证与生产运维-2026-05-15.md',
includes:
@@ -7192,26 +7115,6 @@ const checks = [
includes: '不要继续用固定 `http://127.0.0.1/healthz` 与 `"ok":true`',
reason: 'Nginx README 必须防止回退 smoke 示例回到旧 healthz 口径。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: '不再默认假定 `/healthz` 会返回 `"ok":true`',
reason: '团队共享决策必须记录回退 smoke 的真实 Nginx 入口要求。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: '启用后复核应看到端口由 Pingora 占用而不是空闲',
reason: '团队共享决策必须记录启用后 --require-direct 不再检查端口空闲。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: '不要继续用固定 `/healthz` 与 `"ok":true`',
reason: '团队共享踩坑必须提醒回退 smoke 不能沿用旧 healthz 片段。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: '启用后 `--require-direct` 复核不再要求端口空闲',
reason: '团队共享踩坑必须提醒端口空闲只属于切流前门禁。',
},
{
file: 'deploy/nginx/README.md',
excludes:
@@ -7234,12 +7137,6 @@ const checks = [
excludes: 'rollback-nginx-smoke-expect-body="ok":true',
reason: 'Pingora 试点 runbook 不应再默认展示 ok:true 作为回退响应体片段。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
excludes:
'--nginx-smoke-url http://127.0.0.1/healthz --nginx-smoke-host <域名>',
reason: '团队共享踩坑不应再把固定本机 healthz 当成可执行回退示例。',
},
{
file: 'deploy/pingora/pingora-gateway.env.example',
includes: 'GENARRATIVE_PINGORA_GATEWAY_TRUSTED_FRONT_PROXY_CONFIRMED',
@@ -7272,27 +7169,6 @@ const checks = [
reason:
'生产运维文档必须明确多实例 Pingora 与进程内保护的启动 / preflight 边界。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: 'GENARRATIVE_PINGORA_GATEWAY_INSTANCE_COUNT>1',
reason: '团队共享决策必须记录 Pingora 多实例接流保护边界。',
},
{
file: 'docs/project-memory/shared-memory/decision-log.md',
includes: '禁止继续执行部署工作区根部脚本',
reason: '团队共享决策必须记录 API Deploy 不再执行 workspace 根部脚本。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: 'API deploy 脚本本身也不能继续用部署工作区根部',
reason:
'团队共享踩坑必须记录 workspace 根部 deploy 脚本会掩盖发布包布局问题。',
},
{
file: 'docs/project-memory/shared-memory/pitfalls.md',
includes: '备份脚本、健康巡检脚本和 env 示例目录同样不能从部署工作区兜底',
reason: '团队共享踩坑必须记录备份/巡检脚本也不能使用 workspace fallback。',
},
{
file: 'deploy/nginx/README.md',
includes: 'Pingora 影子网关已通过',