@@ -1020,10 +1020,14 @@ test("scope isolation ships panel switches and provenance surfaces (A4)", () =>
10201020// 默认值),面板自判、不加后端字段;④分组与折叠键中英成对。验收口径:首屏
10211021// 可点项 = 3 总开关 + autoInject 的 2 个子开关 + scope 2 开关 + 「全部设置」
10221022// 按钮 = 8(≤ 8),由 ①② 的组成正则共同钉死,不另数 DOM。
1023+ // v0.9.0 复验修订:首屏加 group.mo(M.O. 独立组),可点项预算 8→9。这不是
1024+ // 悄悄放宽——是产品主人点名「别藏在里面」:M.O. 独立成组却仍折在「全部
1025+ // 设置」后等于换个地方继续藏。≤8 原为 #427 自设软预算,owner 豁免一项。
10231026test ( "settings card folds everything beyond the first screen behind All settings (issue #427)" , ( ) => {
1024- // ① 首屏层组成:两组都要在,且 basic 的成员是从 core/dream 移走的。
1025- assert . ok ( / c o n s t F E A T U R E _ F I R S T _ S C R E E N = \[ " g r o u p \. b a s i c " , " g r o u p \. s c o p e " \] ; / . test ( clientSource ) ,
1026- "the first screen must be exactly the basic and scope groups" ) ;
1027+ // ① 首屏层组成:三组都要在(basic 总开关 / mo 座位闸门 / scope 必答题),
1028+ // 且 basic 的成员是从 core/dream 移走的。
1029+ assert . ok ( / c o n s t F E A T U R E _ F I R S T _ S C R E E N = \[ " g r o u p \. b a s i c " , " g r o u p \. m o " , " g r o u p \. s c o p e " \] ; / . test ( clientSource ) ,
1030+ "the first screen must be exactly the basic, mo and scope groups" ) ;
10271031 assert . ok ( / k e y : " g r o u p \. b a s i c " , i t e m s : \[ " a u t o I n j e c t " , " a u t o S u m m a r i z e " , " a u t o D r e a m " \] / . test ( clientSource ) ,
10281032 "group.basic must carry exactly the three master switches" ) ;
10291033 assert . ok ( ! / k e y : " g r o u p \. c o r e " , i t e m s : \[ " a u t o I n j e c t / . test ( clientSource ) && ! / k e y : " g r o u p \. d r e a m " , i t e m s : \[ " a u t o D r e a m / . test ( clientSource ) ,
@@ -1939,3 +1943,49 @@ test("M.O. class names do not collide in the stylesheet", () => {
19391943 // 扫描量也得钉:正则一旦匹配不到东西,上面那条会静默变绿(例如样式表被整块挪走)。
19401944 assert . ok ( declared . size >= 20 , `the scan must actually see the pipeline stylesheet (saw ${ declared . size } )` ) ;
19411945} ) ;
1946+
1947+ // 回归锁(v0.9.0 复验轮沉淀):面板的两种「静默消失」假绿形状一起钉住。
1948+ // ① i18n 缺定义:既有的「每键恰好两次」锁只统计**字典里存在**的键,一个只有
1949+ // 用法、零字典行的键在计数里整个消失——本轮就查出 4 个这种键(zoom.value 自
1950+ // 基线即断)。所以这里反向查:每一处用法都必须能找到定义行。三种用法形状:
1951+ // 字面量 t("k")、模板 t(`memory.features.${g.key}`) 按 FEATURE_GROUPS 的组键
1952+ // 展开、模板 t(`memory.features.${k}`) 按各 items 旗标键展开(boolRow 的
1953+ // name/hint 各一路)。不做全量动态键解析——拼接形态的键在此设防范围外。
1954+ // ② 图标名未注册:Icon 对查不到的名字 return null(无回退、无告警),闸门照绿
1955+ // 而屏幕上图标没了。本轮 star 入口就是这么哑掉的。这里钉「每个用到的名字都在
1956+ // ICON_PATHS 注册表里」+ 提取与注册表的最低数量(防正则空转的静默绿)。
1957+ test ( "panel copy and icons must not silently vanish (missing dict lines, unregistered icon names)" , ( ) => {
1958+ const defined = ( key ) => clientSource . includes ( '"' + key + '":' ) ;
1959+
1960+ // ①-a 字面量用法(右括号紧贴字符串,排除 "前缀" + 变量 拼接形态)
1961+ const usedKeys = new Set ( ) ;
1962+ for ( const m of clientSource . matchAll ( / \b t \( " ( [ a - z A - Z 0 - 9 _ . ] + ) " \) / g) ) usedKeys . add ( m [ 1 ] ) ;
1963+ assert . ok ( usedKeys . size >= 300 , `the literal scan must actually see the panel's t() calls (saw ${ usedKeys . size } )` ) ;
1964+ // ①-b 模板展开:组键 与 旗标键(label + .hint 两路)
1965+ const groupKeys = [ ...clientSource . matchAll ( / k e y : " ( g r o u p \. [ a - z ] + ) " / g) ] . map ( ( m ) => m [ 1 ] ) ;
1966+ assert . ok ( groupKeys . length >= 5 , `FEATURE_GROUPS must be parseable (saw ${ groupKeys . length } groups)` ) ;
1967+ for ( const g of groupKeys ) usedKeys . add ( "memory.features." + g ) ;
1968+ const flagKeys = [ ...new Set ( [ ...clientSource . matchAll ( / i t e m s : \[ ( (?: [ ^ \] ] | \n ) * ) \] / g) ]
1969+ . flatMap ( ( m ) => [ ...m [ 1 ] . matchAll ( / " ( [ a - z A - Z 0 - 9 _ . ] + ) " / g) ] . map ( ( x ) => x [ 1 ] ) ) ) ] ;
1970+ assert . ok ( flagKeys . length >= 20 , `group items must be parseable (saw ${ flagKeys . length } )` ) ;
1971+ for ( const k of flagKeys ) { usedKeys . add ( "memory.features." + k ) ; usedKeys . add ( "memory.features." + k + ".hint" ) ; }
1972+
1973+ const missing = [ ...usedKeys ] . filter ( ( k ) => ! defined ( k ) ) . sort ( ) ;
1974+ assert . deepEqual ( missing , [ ] , `用而无典的 i18n 键(界面会裸奔出键名):${ missing . join ( ", " ) } ` ) ;
1975+
1976+ // ② 图标名:注册表形状(顶层对象、六空格缩进)+ Icon 表达式与 feedRow 首参的提取
1977+ const registered = new Set ( [ ...clientSource . matchAll ( / ^ \s { 6 } ( [ a - z A - Z ] + ) : \[ \[ / gm) ] . map ( ( m ) => m [ 1 ] ) ) ;
1978+ assert . ok ( registered . size >= 10 , `the ICON_PATHS registry must be parseable (saw ${ registered . size } )` ) ;
1979+ const iconNames = new Set ( ) ;
1980+ for ( const m of clientSource . matchAll ( / h \( I c o n , \{ n a m e : ( [ ^ } ] + ?) [ , } ] / g) ) {
1981+ const expr = m [ 1 ] ;
1982+ const direct = expr . match ( / ^ " ( [ a - z A - Z ] + ) " $ / ) ;
1983+ if ( direct ) { iconNames . add ( direct [ 1 ] ) ; continue ; }
1984+ // 只取三元分支的纯字母串;"===" 比较对象前面是运算符不是 ? : ,不会误伤
1985+ for ( const b of expr . matchAll ( / [ ? : ] \s * " ( [ a - z A - Z ] + ) " / g) ) iconNames . add ( b [ 1 ] ) ;
1986+ }
1987+ for ( const m of clientSource . matchAll ( / f e e d R o w \( \s * " ( [ a - z A - Z ] + ) " / g) ) iconNames . add ( m [ 1 ] ) ;
1988+ assert . ok ( iconNames . size >= 8 , `icon usage must be parseable (saw ${ iconNames . size } )` ) ;
1989+ const noIcon = [ ...iconNames ] . filter ( ( n ) => ! registered . has ( n ) ) . sort ( ) ;
1990+ assert . deepEqual ( noIcon , [ ] , `Icon 静默 return null 的未注册名:${ noIcon . join ( ", " ) } ` ) ;
1991+ } ) ;
0 commit comments