@@ -20,6 +20,66 @@ const {
2020const {
2121 compactLifecycleStateV5
2222} = require ( './lifecycle-state-projection-v5.cjs' )
23+ const { resolveVisibleLocale } = require ( './visible-output-contract.cjs' )
24+
25+ function renderGrokS07Assist ( input = { } ) {
26+ const locale = resolveVisibleLocale ( input . languageContext )
27+ const zh = locale . renderedLanguage === 'zh-CN'
28+ const project = String ( input . project || '' ) . trim ( ) || ( zh ? '未识别' : 'unverified' )
29+ const fallback = locale . fallbackReason
30+ ? locale . catalog . localeFallback ( locale . requestedLanguage , locale . fallbackReason )
31+ : null
32+ const body = zh
33+ ? [
34+ '--- DevCodex S07 辅助(Grok 无法注入;请在用户可见回复中输出) ---' ,
35+ '### DevCodex · 入口检查' ,
36+ `\`BLOCK\` · \`${ project } \`` ,
37+ fallback ,
38+ '' ,
39+ '- PC0 [UNVERIFIED] 安装包版本、活动运行时 generation、源码候选与对齐状态' ,
40+ '- PC1 [UNVERIFIED] 语义初判 → 最终路由' ,
41+ '- PC2 [UNVERIFIED] 会话/Token/待跟进' ,
42+ '- PC3 [UNVERIFIED] 唯一项目与产物落点' ,
43+ '- PC4 [N/A] 非 dev 时 N/A' ,
44+ '- PC5 [UNVERIFIED] Grok HostParity(仅 Full launcher 可超出 Partial)' ,
45+ '- PC6 [UNVERIFIED] dirty/active task' ,
46+ '- PC7 [UNVERIFIED] resume/continuation' ,
47+ '- PC8 [UNVERIFIED] 初判/二次判断的流程仪式与方案深度差异' ,
48+ '- PC9 [UNVERIFIED] 验证级别、目标数量、CI/package/install/release 与预计时长' ,
49+ '- PC10 [UNVERIFIED] 下一阶段、是否自动继续、用户动作与修正提示' ,
50+ '' ,
51+ '下一步:先输出完整 PC0~PC10,再完成 ContextReadPlan 证据后重试工具' ,
52+ 'GrokTurnChecklist:PC0~PC10 → Intent→Skill bundle → context plan → work → report+memory → honest ceiling' ,
53+ 'Skill bundle(非 chat):intent+compliance+user-visible-output-contract+workflow+report+memory' ,
54+ 'DevCodexVisibleEnvelopeV3 · entry-check · BLOCK · s07-assist-context-incomplete' ,
55+ '--- S07 辅助结束 ---'
56+ ]
57+ : [
58+ '--- DevCodex S07 assist (Grok cannot inject this; emit it in the user-visible reply) ---' ,
59+ '### DevCodex · Entry check' ,
60+ `\`BLOCK\` · \`${ project } \`` ,
61+ fallback ,
62+ '' ,
63+ '- PC0 [UNVERIFIED] installed version, active runtime generation, source candidate, and alignment' ,
64+ '- PC1 [UNVERIFIED] initial semantic classification → final route' ,
65+ '- PC2 [UNVERIFIED] session, token, and follow-up state' ,
66+ '- PC3 [UNVERIFIED] unique project and artifact destination' ,
67+ '- PC4 [N/A] N/A outside dev mode' ,
68+ '- PC5 [UNVERIFIED] Grok HostParity (Partial unless launched through the Full launcher)' ,
69+ '- PC6 [UNVERIFIED] dirty state and active task' ,
70+ '- PC7 [UNVERIFIED] resume and continuation state' ,
71+ '- PC8 [UNVERIFIED] workflow ceremony and design-depth delta between initial and final routing' ,
72+ '- PC9 [UNVERIFIED] validation level, target count, CI/package/install/release scope, and estimated duration' ,
73+ '- PC10 [UNVERIFIED] next stage, automatic continuation, user action, and correction guidance' ,
74+ '' ,
75+ 'Next: emit the complete PC0~PC10 block, complete the ContextReadPlan evidence, and then retry the tool.' ,
76+ 'GrokTurnChecklist: PC0~PC10 → Intent→Skill bundle → context plan → work → report+memory → honest ceiling' ,
77+ 'Skill bundle (non-chat): intent+compliance+user-visible-output-contract+workflow+report+memory' ,
78+ 'DevCodexVisibleEnvelopeV3 · entry-check · BLOCK · s07-assist-context-incomplete' ,
79+ '--- end S07 assist ---'
80+ ]
81+ return body . filter ( value => value !== null && value !== undefined ) . join ( '\n' )
82+ }
2383
2484function parseContextToolIdentity ( rawName , explicitServer = '' ) {
2585 const raw = String ( rawName || '' ) . trim ( )
@@ -2096,31 +2156,8 @@ function buildLifecycleBootstrapStateUtils(ctx) {
20962156 // Grok cannot inject UserPromptSubmit context; attach S07 portable block to deny reason (W7 assist).
20972157 // Keep template inline so deployed .codex/hooks/_runtime copies do not depend on package scripts/.
20982158 if ( platform === 'grok' ) {
2099- const project = acquisition . project || state . activeProject || '未识别'
2100- detail += [
2101- '' ,
2102- '--- DevCodex S07 assist (Grok cannot inject this; emit in the user-visible reply) ---' ,
2103- '### DevCodex · 入口检查' ,
2104- `\`BLOCK\` · \`${ project } \`` ,
2105- '' ,
2106- '- PC0 [UNVERIFIED] 安装包版本、活动运行时 generation、源码候选与对齐状态' ,
2107- '- PC1 [UNVERIFIED] 语义初判 → 最终路由' ,
2108- '- PC2 [UNVERIFIED] 会话/Token/待跟进' ,
2109- '- PC3 [UNVERIFIED] 唯一项目与产物落点' ,
2110- '- PC4 [N/A] 非 dev 时 N/A' ,
2111- '- PC5 [UNVERIFIED] Grok HostParity(Partial unless Full launcher)' ,
2112- '- PC6 [UNVERIFIED] dirty/active task' ,
2113- '- PC7 [UNVERIFIED] resume/continuation' ,
2114- '- PC8 [UNVERIFIED] 初判/二次判断的流程仪式与方案深度差异' ,
2115- '- PC9 [UNVERIFIED] 验证级别、目标数量、CI/package/install/release 与预计时长' ,
2116- '- PC10 [UNVERIFIED] 下一阶段、是否自动继续、用户动作与修正提示' ,
2117- '' ,
2118- '下一步:先输出完整 PC0~PC10,再完成 ContextReadPlan 证据后重试工具' ,
2119- 'GrokTurnChecklist: PC0~PC10 → Intent→Skill bundle → context plan → work → report+memory → honest ceiling' ,
2120- 'Skill bundle (non-chat): intent+compliance+user-visible-output-contract+workflow+report+memory' ,
2121- 'DevCodexVisibleEnvelopeV3 · entry-check · BLOCK · s07-assist-context-incomplete' ,
2122- '--- end S07 assist ---'
2123- ] . join ( '\n' )
2159+ const project = acquisition . project || state . activeProject || ''
2160+ detail += `\n${ renderGrokS07Assist ( { languageContext : state . languageContext , project } ) } `
21242161 }
21252162 return buildInterceptionOutput (
21262163 state ,
@@ -2193,5 +2230,6 @@ function buildLifecycleBootstrapStateUtils(ctx) {
21932230module . exports = {
21942231 buildLifecycleBootstrapStateUtils,
21952232 parseContextToolIdentity,
2196- classifyMemoryCoverage
2233+ classifyMemoryCoverage,
2234+ renderGrokS07Assist
21972235}
0 commit comments