@@ -17,8 +17,11 @@ const path = require('path')
1717const { spawnSync } = require ( 'child_process' )
1818const { adaptHostOutput, runHostAdapter } = require ( '../hooks/_runtime/lifecycle-host-adapters.cjs' )
1919const { buildLifecycleHookOutput } = require ( '../hooks/_runtime/lifecycle-hook-output.cjs' )
20- const { composeEntryCheckBlock } = require ( './lib/host-parity-scorecard.js' )
21- const { evaluateGrokHostParity } = require ( './lib/host-parity-scorecard.js' )
20+ const {
21+ composeEntryCheckBlock,
22+ evaluateGrokHostParity,
23+ formatGrokTurnChecklistMarkdown
24+ } = require ( './lib/host-parity-scorecard.js' )
2225
2326const hookOut = buildLifecycleHookOutput ( { env : { } , enforcementMode : 'safety-only' } )
2427
@@ -63,19 +66,33 @@ const codexOut = adaptHostOutput('codex', 'PreToolUse', {
6366} )
6467assert . strictEqual ( codexOut . hookSpecificOutput . permissionDecision , 'deny' )
6568
66- // Compose entry check + website page exists
69+ function readIfExists ( file ) {
70+ return fs . existsSync ( file ) ? fs . readFileSync ( file , 'utf8' ) : null
71+ }
72+
73+ // Compose entry check + HostParity public/source surface.
74+ // website/ is a maintainer-local optional doc site (see website/README.md);
75+ // clean GitHub Actions checkouts must validate source-contained semantics rather
76+ // than requiring untracked generated website docs to exist.
6777const block = composeEntryCheckBlock ( { project : 'demo' , status : 'PASS' } )
6878assert . match ( block , / # # # D e v C o d e x · 入 口 检 查 / )
6979const sitePage = path . join ( __dirname , '../website/docs/intro/host-parity-grok.md' )
70- assert . ok ( fs . existsSync ( sitePage ) , 'website intro host-parity-grok.md must exist' )
71- const siteText = fs . readFileSync ( sitePage , 'utf8' )
72- assert . match ( siteText , / d e v c o d e x g r o k / )
73- assert . match ( siteText , / H o s t P a r i t y / )
74- assert . match ( siteText , / G r o k T u r n C h e c k l i s t / )
75- assert . match ( siteText , / r e p a i r S t e p s / )
76- assert . match ( siteText , / S k i l l 强 制 包 | S k i l l b u n d l e | I n t e n t → S k i l l / i)
77- assert . match ( siteText , / s c a n - h y g i e n e | t t f v - f i r s t - d e l i v e r y / )
78- assert . match ( siteText , / U n a l i g n e d L e d g e r | U - A 1 | 未 对 齐 | c a n n o t C l a i m / i)
80+ const siteText = readIfExists ( sitePage )
81+ const checklistText = formatGrokTurnChecklistMarkdown ( )
82+ const hostParitySurface = siteText || checklistText
83+ assert . match ( hostParitySurface , / H o s t P a r i t y | G r o k T u r n C h e c k l i s t / )
84+ assert . match ( hostParitySurface , / G r o k T u r n C h e c k l i s t / )
85+ assert . match ( hostParitySurface , / s c a n - h y g i e n e | t t f v - f i r s t - d e l i v e r y / )
86+ if ( siteText ) {
87+ assert . match ( siteText , / d e v c o d e x g r o k / )
88+ assert . match ( siteText , / r e p a i r S t e p s / )
89+ assert . match ( siteText , / S k i l l 强 制 包 | S k i l l b u n d l e | I n t e n t → S k i l l / i)
90+ assert . match ( siteText , / U n a l i g n e d L e d g e r | U - A 1 | 未 对 齐 | c a n n o t C l a i m / i)
91+ } else {
92+ const websiteReadme = fs . readFileSync ( path . join ( __dirname , '../website/README.md' ) , 'utf8' )
93+ assert . match ( websiteReadme , / 不 进 入 公 开 G i t 默 认 跟 踪 / )
94+ assert . match ( websiteReadme , / w e b s i t e 视 为 o p t i o n a l / )
95+ }
7996assert . ok ( fs . existsSync ( path . join ( __dirname , 'fixtures/host-parity/unaligned-ledger.v1.json' ) ) )
8097
8198// Platform request semantic fixture (source-contained for clean checkout / CI)
@@ -124,13 +141,17 @@ if (fs.existsSync(path.join(workspaceRoot, 'AGENTS.md'))) {
124141 assert . ok ( [ 'full-capable' , 'partial' ] . includes ( card . tier ) )
125142}
126143
127- // philosophy Auto honesty
144+ // Optional maintainer website surfaces.
128145const philosophy = path . join ( __dirname , '../website/docs/intro/philosophy.md' )
129- assert . match ( fs . readFileSync ( philosophy , 'utf8' ) , / 宿 主 诚 实 分 列 ( A u t o ) / )
130- assert . match ( fs . readFileSync ( philosophy , 'utf8' ) , / G r o k B u i l d / )
146+ const philosophyText = readIfExists ( philosophy )
147+ if ( philosophyText ) {
148+ assert . match ( philosophyText , / 宿 主 诚 实 分 列 ( A u t o ) / )
149+ assert . match ( philosophyText , / G r o k B u i l d / )
150+ }
131151
132- // rspress sidebar link
133- const rspress = fs . readFileSync ( path . join ( __dirname , '../website/rspress.config.ts' ) , 'utf8' )
134- assert . match ( rspress , / h o s t - p a r i t y - g r o k / )
152+ const rspress = readIfExists ( path . join ( __dirname , '../website/rspress.config.ts' ) )
153+ if ( rspress ) {
154+ assert . match ( rspress , / h o s t - p a r i t y - g r o k / )
155+ }
135156
136157console . log ( 'host parity remaining deliverables smoke passed' )
0 commit comments