22
33/**
44 * HostParityScorecardV1 — Grok vs Codex capability honesty for doctor/status.
5- * Full ≠ Codex API isomorphism; Full = launcher rules bind + PreTool deny path + path-observable.
5+ * Full ≠ Codex API isomorphism; Full = launcher rules bind + host-owned operation path + path-observable.
66 * PF-165: GrokTurnChecklist + Intent→Skill bundle + doctor repairSteps (no parallel system).
77 */
88
@@ -80,10 +80,10 @@ function buildCheckRepairCatalog(guidance) {
8080 command,
8181 detail : 'Reconcile stale receipts or managed configuration drift without reporting present runtime files as missing.'
8282 } ,
83- denyAdapterContract : {
84- check : 'denyAdapterContract ' ,
83+ operationAdvisoryContract : {
84+ check : 'operationAdvisoryContract ' ,
8585 command,
86- detail : 'lifecycle-host-adapters must export adaptGrokOutput and decision:deny mapping .'
86+ detail : 'lifecycle-host-adapters must export adaptGrokOutput and leave operation decisions to the host .'
8787 } ,
8888 pathObservableCapability : {
8989 check : 'pathObservableCapability' ,
@@ -327,19 +327,19 @@ function fileExists(filePath) {
327327 }
328328}
329329
330- function readAdapterDenyContract ( adapterPath ) {
330+ function readAdapterOperationContract ( adapterPath ) {
331331 if ( ! fileExists ( adapterPath ) ) {
332- return { present : false , hasAdaptGrok : false , hasDenyDecision : false }
332+ return { present : false , hasAdaptGrok : false , operationPermissionHostOwned : false }
333333 }
334334 try {
335335 const text = fs . readFileSync ( adapterPath , 'utf8' )
336336 return {
337337 present : true ,
338338 hasAdaptGrok : / f u n c t i o n a d a p t G r o k O u t p u t | a d a p t G r o k O u t p u t \s * \( / . test ( text ) ,
339- hasDenyDecision : / d e c i s i o n : \s * [ ' " ] d e n y [ ' " ] / . test ( text )
339+ operationPermissionHostOwned : / i s O p e r a t i o n P e r m i s s i o n E v e n t \( o r i g i n a l E v e n t \) \) \s * r e t u r n \s * \{ \s * \} / . test ( text )
340340 }
341341 } catch {
342- return { present : false , hasAdaptGrok : false , hasDenyDecision : false }
342+ return { present : false , hasAdaptGrok : false , operationPermissionHostOwned : false }
343343 }
344344}
345345
@@ -408,7 +408,7 @@ function evaluateGrokHostParity(input = {}) {
408408 const pluginRoot = grokTarget . files . plugin
409409 const codexAdapter = path . join ( codexRuntime , 'hooks' , '_runtime' , 'lifecycle-host-adapters.cjs' )
410410 const codexBootstrap = path . join ( codexRuntime , 'hooks' , '_runtime' , 'lifecycle-bootstrap-state.cjs' )
411- const deny = readAdapterDenyContract ( codexAdapter )
411+ const operationAdapter = readAdapterOperationContract ( codexAdapter )
412412 const bootstrap = readBootstrapCapability ( codexBootstrap )
413413
414414 const hasGlobalKernel = input . hasGlobalKernel !== undefined
@@ -440,7 +440,11 @@ function evaluateGrokHostParity(input = {}) {
440440 codexAdapterContractReady,
441441 grokAdapterContractReady,
442442 managedConfigCurrent,
443- denyAdapterContract : Boolean ( deny . present && deny . hasAdaptGrok && deny . hasDenyDecision ) ,
443+ operationAdvisoryContract : Boolean (
444+ operationAdapter . present &&
445+ operationAdapter . hasAdaptGrok &&
446+ operationAdapter . operationPermissionHostOwned
447+ ) ,
444448 pathObservableCapability : Boolean ( bootstrap . present && bootstrap . grokPathObservable ) ,
445449 globalGrokPluginInstalled : hasGlobalGrokPlugin ,
446450 globalGrokPluginConfigured : hasGlobalGrokConfig
@@ -451,7 +455,7 @@ function evaluateGrokHostParity(input = {}) {
451455 && checks . codexAdapterContractReady
452456 && checks . grokAdapterContractReady
453457 && checks . managedConfigCurrent
454- && checks . denyAdapterContract
458+ && checks . operationAdvisoryContract
455459 && checks . pathObservableCapability
456460 && checks . globalGrokPluginInstalled
457461 && checks . globalGrokPluginConfigured
@@ -500,7 +504,7 @@ function evaluateGrokHostParity(input = {}) {
500504 codexBootstrap : fileExists ( codexBootstrap ) ? codexBootstrap : null ,
501505 pluginRoot : hasGlobalGrokPlugin ? pluginRoot : null ,
502506 scope : 'user-global' ,
503- deny ,
507+ operationAdapter ,
504508 bootstrap,
505509 physicalPresence : {
506510 globalKernelFilesPresent : hasGlobalKernel ,
@@ -519,7 +523,7 @@ function evaluateGrokHostParity(input = {}) {
519523 recommendedEntry,
520524 cannotClaim,
521525 userVisibleSummary : hardReady
522- ? 'Grok HostParity: full-capable (PreTool deny + path-observable + kernel). Use `devcodex grok` for Full session evidence. Inject/Stop still Partial. Follow GrokTurnChecklist + Intent→Skill bundle.'
526+ ? 'Grok HostParity: full-capable (host-owned PreTool operations + path-observable + kernel). Use `devcodex grok` for Full session evidence. Inject/Stop still Partial. Follow GrokTurnChecklist + Intent→Skill bundle.'
523527 : `Grok HostParity: partial — failed: ${ failedChecks . join ( ', ' ) || 'unknown' } . Fix: ${ repairPreview || fallbackFix } . Then doctor --json hostParity.repairSteps.`
524528 }
525529
@@ -596,7 +600,7 @@ module.exports = {
596600 classifyGrokTurnOmissionSample,
597601 classifyWorkspaceRootScanSample,
598602 classifyTtfvOmissionSample,
599- readAdapterDenyContract ,
603+ readAdapterOperationContract ,
600604 readBootstrapCapability
601605}
602606
0 commit comments