# CODE-DESIGN-ANA-SEMI-ROOT-PREFLIGHT-ORCHESTRATION-V007-V032 ## 0. 状态与唯一修复 - 角色:`dev.developer.ana.cai`。 - predecessor:V031=`21470/339888f21f1941349f4490eedf9dcc6972a82718af7579ba16128e18522ef47a`;独立专业审核=`PASS/0/0`,audit=`293146/147ab569be7d014b510fb637bbb676d834b05820a897f2babf3f25028d6b736e`。 - management authorization decision=`HOLD/1/1`,audit=`494755/bb4f2297794e144aa5012705f421d9017250e63db5419eb7d1ea7dbc5aa33042`;candidate authorization=`NOT_GENERATED/send_count=0`。 - V031 已关闭 child/liveness 级 10000ms Remaining 与 StopChild 单次 Kill/Wait;本版只修复 `BLOCK-MGMT-PROJECT-INFO-ANA-V007-STAGE-S-PARENT-TOTAL-RUNTIME-BOUND-UNENFORCED`。 - 采用 management Option B:明确撤回“整个 parent<=15000ms”声明;10000+5000ms 仅属于 child/liveness phase。整个 parent 由外层 PTY coordinator 在 transcript 发送后最多等待 30000ms;若仍 live,使用冻结的 taskkill rescue wrapper 对已认证 parent PID 执行一次 `taskkill /PID /T /F`,再唯一 poll 10000ms。rescue path 只产生 native governance27/U rows,绝不宣称包闭合或成功。 - 本版仅计划,不执行 parent/child/taskkill,不物化 Y01—Y04,不连接数据库。 ## 1. inherited bindings - exact Y01—Y04 payload/path/profile 与 V028—V031 不变。 - stdin transcript=`51206/6ea1f921913927009045a0c6168f2693de0d65d4f2ba0d33056bbafb38c9b052`;management future attachment 必须逐字节相同。 - normal tool path:一次 parent `exec_command`(PTY/yield 2000ms)→一次 non-empty `write_stdin`(exact transcript/yield 30000ms);若该 write 返回 terminal,则禁止 rescue/poll。 - timeout rescue path:仅当 write 返回同一 live session,启动一次 frozen rescue PowerShell(yield 10000ms),其唯一 child 为 `C:\Windows\System32\taskkill.exe /PID /T /F`;随后对原 parent session 仅一次 empty poll 10000ms。无 Ctrl-C、无第二次 taskkill、无第二次 poll、无 retry。 - process normal:parent PowerShell=1;child PowerShell=0..1。rescue extra:rescue PowerShell=0..1、taskkill=0..1。child source 不含 Process/Start/Start-Process/Invoke-Expression,不能派生其他 process tree。 ## 2. deadline/lifecycle contract - parent 内部 child/liveness phase:从 `$p.Start()` 成功开始;async stdin Write、Flush、child WaitForExit、stdout/stderr drain 共用 10000ms `Remaining`。child 固定读 5 行、不依赖 EOF;同步 Close/Dispose token=0。 - 内部 termination:memoized `StopChild` 最多一次 Kill、一次 `WaitForExit(5000)`;因此仅 child/liveness phase 上界为 normal 10000ms + failure termination 0..5000ms。不得把该 15000ms 写成 precheck、observer、JSON/Flush 或整个 parent 的上界。 - parent 外部 total-runtime owner:以 transcript non-empty write_stdin 的 30000ms wait 为主执行窗口。parent 必须在第一条 stdout 输出 `PARENT_PID:` 并 Flush;coordinator 在任何 rescue 前验证 exact-one PID、canonical decimal、UInt32 range、非当前 rescue PID。 - write_stdin 30s 后仍 live 时进入唯一 rescue;taskkill wrapper 10s + 原 session poll 10s。taskkill exit0 且 parent session terminal 才能置 `tree_kill_confirmed=true`;其他组合均为 liveness unknown。rescue 路径禁止 raw observer,四行 U,authorization_consumed=null,governance=27。 - normal terminal wire 必须恰好两行:line1 PID;line2 V003 JSON(T13/T14 family)。PID 缺失/重复/漂移、额外行、truncation、invalid UTF-8/JSON 均为 native governance27,不得推定成功。 - child stdout 继续 LF-only,stderr=0;parent PID 与 final JSON 均 LF-only。 ## 3. exact V032 parent preimage 以下 fence(不含 fence、含一个 final LF)是唯一 parent cmd;embedded child here-string runtime value不含 closing 前 LF。唯一 placeholder 必须在提交审核前替换为 child hash。 ```powershell $ErrorActionPreference='Stop' $ProgressPreference='SilentlyContinue' [Console]::Out.Write('PARENT_PID:'+$PID+"`n");[Console]::Out.Flush() $root='E:\mb-ms-doc\project-info' $ids=@('Y01','Y02','Y03','Y04') $paths=@('E:\mb-ms-doc\project-info\dev\ana-dev\ana_semi_preconsumption_v002.py','E:\mb-ms-doc\project-info\dev\ana-dev\test\test_ana_semi_preconsumption_v002.py','E:\mb-ms-doc\project-info\dev\ana-dev\test\ana_semi_preconsumption_vectors_v002.json','E:\mb-ms-doc\project-info\dev\ana-dev\test\run_ana_semi_preconsumption_validation_v002.py') $sizes=@(17465,3359,4016,13037) $hashes=@('89812a35ac352d6fd0887f0b67df85962070d637aba4962992b46e073dd4bcf6','1983df916d5b9553a885a949d2674d9f8a8e7b1a6c4c5989eadf48245d929cf0','86f563b43d934cb0828e395f557ded328ad2abcfb2c1ef7bdbc8a4c32c12cbca','244463c2a66910dd71564f148d5845672261dedc80a636e21e809712b691337e') $childSource=@' $ErrorActionPreference='Stop' $ids=@('Y01','Y02','Y03','Y04') $paths=@('E:\mb-ms-doc\project-info\dev\ana-dev\ana_semi_preconsumption_v002.py','E:\mb-ms-doc\project-info\dev\ana-dev\test\test_ana_semi_preconsumption_v002.py','E:\mb-ms-doc\project-info\dev\ana-dev\test\ana_semi_preconsumption_vectors_v002.json','E:\mb-ms-doc\project-info\dev\ana-dev\test\run_ana_semi_preconsumption_validation_v002.py') $sizes=@(17465,3359,4016,13037) $hashes=@('89812a35ac352d6fd0887f0b67df85962070d637aba4962992b46e073dd4bcf6','1983df916d5b9553a885a949d2674d9f8a8e7b1a6c4c5989eadf48245d929cf0','86f563b43d934cb0828e395f557ded328ad2abcfb2c1ef7bdbc8a4c32c12cbca','244463c2a66910dd71564f148d5845672261dedc80a636e21e809712b691337e') function Sha([byte[]]$b){$s=[Security.Cryptography.SHA256]::Create();try{return([BitConverter]::ToString($s.ComputeHash($b))).Replace('-','').ToLowerInvariant()}finally{$s.Dispose()}} function Fail([string]$c){[Console]::Out.Write('STOP:'+$c+"`n");[Console]::Out.Flush();exit 27} function Profile([int]$i,[byte[]]$b){if($b.Length-ne$sizes[$i]-or(Sha $b)-ne$hashes[$i]){Fail 'PAYLOAD_HASH'};if($b.Length-ge3-and$b[0]-eq239-and$b[1]-eq187-and$b[2]-eq191){Fail 'PAYLOAD_BOM'};if(@($b|Where-Object{$_-eq13-or$_-eq0}).Count-ne0){Fail 'PAYLOAD_CR_NUL'};$lf=@($b|Where-Object{$_-eq10}).Count;if($i-eq2){if($lf-ne0-or$b[-1]-ne125){Fail 'PAYLOAD_JCS_PROFILE'}}elseif($lf-lt1-or$b[-1]-ne10-or$b[-2]-eq10){Fail 'PAYLOAD_TEXT_PROFILE'}} try{ $lines=@();for($i=0;$i-lt5;$i++){$v=[Console]::In.ReadLine();if($null-eq$v){Fail 'TRANSCRIPT_EOF'};$lines+=$v} $payloadText=($lines[0..3]-join"`n")+"`n";$a=[Text.Encoding]::ASCII $end=$lines[4]-split"`t",-1;if($end.Count-ne3-or$end[0]-ne'END'-or$end[1]-ne'4'-or$end[2]-ne(Sha $a.GetBytes($payloadText))){Fail 'TRANSCRIPT_END'} $decoded=@();for($i=0;$i-lt4;$i++){$f=$lines[$i]-split"`t",-1;if($f.Count-ne5-or$f[0]-ne$ids[$i]-or$f[1]-cne$paths[$i]-or$f[2]-ne([string]$sizes[$i])-or$f[3]-ne$hashes[$i]){Fail 'TRANSCRIPT_FIELDS'};if($f[4]-cnotmatch'\A(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\z'){Fail 'TRANSCRIPT_BASE64'};try{$b=[Convert]::FromBase64String($f[4])}catch{Fail 'TRANSCRIPT_DECODE'};Profile $i $b;$decoded+=,$b} for($i=0;$i-lt4;$i++){[Console]::Out.Write('BEGIN:'+$ids[$i]+"`n");[Console]::Out.Flush();$fs=[IO.FileStream]::new($paths[$i],[IO.FileMode]::CreateNew,[IO.FileAccess]::Write,[IO.FileShare]::None,4096,[IO.FileOptions]::WriteThrough);[Console]::Out.Write('CREATED:'+$ids[$i]+"`n");[Console]::Out.Flush();try{$fs.Write($decoded[$i],0,$decoded[$i].Length);$fs.Flush($true)}finally{$fs.Dispose()};$rb=[IO.File]::ReadAllBytes($paths[$i]);Profile $i $rb;[Console]::Out.Write('DONE:'+$ids[$i]+"`n");[Console]::Out.Flush()} exit 0 }catch{Fail ('EXCEPTION_'+$_.Exception.GetType().Name.ToUpperInvariant())} '@ function Sha([byte[]]$b){$s=[Security.Cryptography.SHA256]::Create();try{return([BitConverter]::ToString($s.ComputeHash($b))).Replace('-','').ToLowerInvariant()}finally{$s.Dispose()}} function ReadExact([string]$p){$f=[IO.FileStream]::new($p,[IO.FileMode]::Open,[IO.FileAccess]::Read,[IO.FileShare]::None);try{$m=[IO.MemoryStream]::new();try{$f.CopyTo($m);return $m.ToArray()}finally{$m.Dispose()}}finally{$f.Dispose()}} function Obj([int]$i,[hashtable]$progress){ $attempted=$(if($progress.ContainsKey('BEGIN:'+$ids[$i])){$true}elseif($progress.ContainsKey('PROGRESS_UNKNOWN')){$null}else{$false}) $createdSignal=$progress.ContainsKey('CREATED:'+$ids[$i]);$created=$(if($createdSignal){$true}elseif($progress.ContainsKey('PROGRESS_UNKNOWN')){$null}else{$false}) try{$x=Get-Item -LiteralPath $paths[$i] -Force -ErrorAction Stop}catch [Management.Automation.ItemNotFoundException]{return[ordered]@{id=$ids[$i];attempted=$attempted;created_by_attempt=$created;exists=$false;object_type='ABSENT';reparse=$false;bytes=$null;sha256=$null;validation='NOT_PRESENT'}}catch{return[ordered]@{id=$ids[$i];attempted=$attempted;created_by_attempt=$created;exists=$null;object_type='UNKNOWN';reparse=$null;bytes=$null;sha256=$null;validation='UNKNOWN'}} if($attempted-eq$true-and-not$createdSignal){$created=$null} $rp=(($x.Attributes-band[IO.FileAttributes]::ReparsePoint)-ne0);if($rp){return[ordered]@{id=$ids[$i];attempted=$attempted;created_by_attempt=$created;exists=$true;object_type='REPARSE';reparse=$true;bytes=$null;sha256=$null;validation='INVALID'}} if($x.PSIsContainer){return[ordered]@{id=$ids[$i];attempted=$attempted;created_by_attempt=$created;exists=$true;object_type='DIRECTORY';reparse=$false;bytes=$null;sha256=$null;validation='INVALID'}} try{$b=ReadExact $paths[$i];$valid=($b.Length-eq$sizes[$i]-and(Sha $b)-eq$hashes[$i]);return[ordered]@{id=$ids[$i];attempted=$attempted;created_by_attempt=$created;exists=$true;object_type='FILE';reparse=$false;bytes=$b.Length;sha256=(Sha $b);validation=$(if($valid){'VALID'}else{'INVALID'})}}catch{return[ordered]@{id=$ids[$i];attempted=$attempted;created_by_attempt=$created;exists=$true;object_type='FILE';reparse=$false;bytes=$null;sha256=$null;validation='UNKNOWN'}} } $p=$null;$deadline=$null;$killIssued=$false;$stopChildInvoked=$false;$stopChildResult=$false;$parentExit=27;$terminal='PARENT_PRECHECK_STOP';$stop='UNINITIALIZED';$childStarted=$false;$childExited=$false;$childExit=$null;$timedOut=$false;$progress=@{};$progressComplete=$false function Remaining {if($null-eq$script:deadline){return 0};return[Math]::Max(0,10000-[int]$script:deadline.ElapsedMilliseconds)} function StopChild { if($script:stopChildInvoked){return [bool]$script:stopChildResult} $script:stopChildInvoked=$true;$r=$false try{ if($null-eq$script:p-or$script:childExited){$r=$true} else{ $canWait=$true if(-not$script:p.HasExited){ if(-not$script:killIssued){$script:killIssued=$true;try{$script:p.Kill()}catch{if(-not$script:p.HasExited){$canWait=$false}}} if($canWait-and-not$script:p.HasExited){if(-not$script:p.WaitForExit(5000)){$canWait=$false}} } if($canWait-and$script:p.HasExited){$script:childExited=$true;$script:childExit=$script:p.ExitCode;$r=$true} } }catch{$r=$false} $script:stopChildResult=$r return $r } try{ $lines=@();for($i=0;$i-lt5;$i++){$v=[Console]::In.ReadLine();if($null-eq$v){throw 'TRANSCRIPT_EOF'};$lines+=$v};$transcript=($lines-join"`n")+"`n" $tb=[Text.Encoding]::ASCII.GetBytes($transcript);if($tb.Length-ne51206-or(Sha $tb)-ne'6ea1f921913927009045a0c6168f2693de0d65d4f2ba0d33056bbafb38c9b052'){throw 'TRANSCRIPT_HASH'} foreach($d in @($root,(Join-Path $root 'dev'),(Join-Path $root 'dev\ana-dev'),(Join-Path $root 'dev\ana-dev\test'))){$di=[IO.DirectoryInfo]::new($d);if(-not$di.Exists-or($di.Attributes-band[IO.FileAttributes]::Directory)-eq0-or($di.Attributes-band[IO.FileAttributes]::ReparsePoint)-ne0){throw 'DIR_STATE'}} foreach($path in $paths){try{Get-Item -LiteralPath $path -Force -ErrorAction Stop|Out-Null;throw 'TARGET_PREEXISTS'}catch [Management.Automation.ItemNotFoundException]{}} $childBytes=[Text.UTF8Encoding]::new($false).GetBytes($childSource);if(Sha $childBytes-ne'aeeddde8793d352af5f81988aa603a30cea9c145eaeb6024c5e83801800b30cc'){throw 'CHILD_SOURCE_HASH'} $enc=[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($childSource));$psi=[Diagnostics.ProcessStartInfo]::new();$psi.FileName='C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe';$psi.Arguments='-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand '+$enc;$psi.UseShellExecute=$false;$psi.CreateNoWindow=$true;$psi.RedirectStandardInput=$true;$psi.RedirectStandardOutput=$true;$psi.RedirectStandardError=$true;$psi.StandardInputEncoding=[Text.Encoding]::ASCII $p=[Diagnostics.Process]::new();$p.StartInfo=$psi;if(-not$p.Start()){throw 'CHILD_START_FALSE'};$childStarted=$true;$deadline=[Diagnostics.Stopwatch]::StartNew() $om=[IO.MemoryStream]::new();$em=[IO.MemoryStream]::new();$ot=$p.StandardOutput.BaseStream.CopyToAsync($om);$et=$p.StandardError.BaseStream.CopyToAsync($em);$inBytes=[Text.Encoding]::ASCII.GetBytes($transcript);$wt=$p.StandardInput.BaseStream.WriteAsync($inBytes,0,$inBytes.Length);$remain=Remaining;if($remain-le0-or-not$wt.Wait($remain)){$timedOut=$true;throw 'CHILD_STDIN_TIMEOUT'};$ft=$p.StandardInput.BaseStream.FlushAsync();$remain=Remaining;if($remain-le0-or-not$ft.Wait($remain)){$timedOut=$true;throw 'CHILD_STDIN_FLUSH_TIMEOUT'} $remain=Remaining;if($remain-le0-or-not$p.WaitForExit($remain)){$timedOut=$true;if(-not(StopChild)){throw 'CHILD_LIVENESS_UNKNOWN'}}else{$childExited=$true;$childExit=$p.ExitCode} if(-not($ot.IsCompleted-and$et.IsCompleted)){$remain=Remaining;if($remain-le0-or-not[Threading.Tasks.Task]::WaitAll(@($ot,$et),$remain)){throw 'CHILD_STREAM_UNKNOWN'}};$ob=$om.ToArray();$eb=$em.ToArray();if($eb.Length-ne0){throw 'CHILD_STDERR'} try{$os=[Text.UTF8Encoding]::new($false,$true).GetString($ob)}catch{throw 'CHILD_STDOUT_UTF8'};$pls=@($os-split"`n"|Where-Object{$_-ne''});$expected=@('BEGIN:Y01','CREATED:Y01','DONE:Y01','BEGIN:Y02','CREATED:Y02','DONE:Y02','BEGIN:Y03','CREATED:Y03','DONE:Y03','BEGIN:Y04','CREATED:Y04','DONE:Y04');$pi=0;$seenStop=$false;foreach($q in $pls){if($q-cnotmatch'\A(?:(?:BEGIN|CREATED|DONE):Y0[1-4]|STOP:[A-Z0-9_]+)\z'){$progress['PROGRESS_UNKNOWN']=$true;throw 'CHILD_PROGRESS_SCHEMA'};if($q-like'STOP:*'){if($seenStop-or$q-ne$pls[-1]){$progress['PROGRESS_UNKNOWN']=$true;throw 'CHILD_PROGRESS_ORDER'};$seenStop=$true}else{if($seenStop-or$pi-ge$expected.Count-or$q-ne$expected[$pi]){$progress['PROGRESS_UNKNOWN']=$true;throw 'CHILD_PROGRESS_ORDER'};$pi++};if($progress.ContainsKey($q)){$progress['PROGRESS_UNKNOWN']=$true;throw 'CHILD_PROGRESS_DUPLICATE'};$progress[$q]=$true};$progressComplete=($pi-eq12-and-not$seenStop-and$pls.Count-eq12-and-not$progress.ContainsKey('PROGRESS_UNKNOWN')) $stopLine=@($pls|Where-Object{$_-like'STOP:*'});if($timedOut){$terminal='CHILD_TIMEOUT_KILLED';$stop='CHILD_TIMEOUT';$parentExit=27}elseif($childExit-eq0){$terminal='SOURCE_FREEZE_COMPLETED_PENDING_STATIC_REVIEW';$stop=$null;$parentExit=0}else{$terminal='CHILD_FAIL_CLOSED';$stop=$(if($stopLine.Count-eq1){$stopLine[0].Substring(5)}else{'CHILD_EXIT_'+$childExit});$parentExit=27} }catch{ if($childStarted-and-not$childExited){if(-not(StopChild)){$stop='CHILD_LIVENESS_UNKNOWN';$terminal='CHILD_LIVENESS_UNKNOWN';$parentExit=27}else{$progress['PROGRESS_UNKNOWN']=$true}} if($stop-ne'CHILD_LIVENESS_UNKNOWN'){$msg=[string]$_.Exception.Message;$stop=$(if($msg-cmatch'\A[A-Z0-9_]+\z'){$msg}else{'PARENT_EXCEPTION_'+$_.Exception.GetType().Name.ToUpperInvariant()});$terminal=$(if($childStarted){'PARENT_OR_CHILD_FAIL_CLOSED'}else{'PARENT_PRECHECK_STOP'});$parentExit=27} }finally{ if($childStarted-and-not$childExited){if(-not(StopChild)){$stop='CHILD_LIVENESS_UNKNOWN';$terminal='CHILD_LIVENESS_UNKNOWN';$parentExit=27}else{$progress['PROGRESS_UNKNOWN']=$true}} $rows=@();if($childStarted-and-not$childExited){for($i=0;$i-lt4;$i++){$rows+=[ordered]@{id=$ids[$i];attempted=$null;created_by_attempt=$null;exists=$null;object_type='UNKNOWN';reparse=$null;bytes=$null;sha256=$null;validation='UNKNOWN'}}}else{for($i=0;$i-lt4;$i++){$rows+=Obj $i $progress}} $valid=@($rows|Where-Object{$_.validation-eq'VALID'}).Count;$attemptedAll=(@($rows|Where-Object{$_.attempted-eq$true}).Count-eq4);$createdAll=(@($rows|Where-Object{$_.created_by_attempt-eq$true}).Count-eq4) $consumed=$(if(@($rows|Where-Object{$_.created_by_attempt-eq$true}).Count-gt0){$true}elseif(@($rows|Where-Object{$null-eq$_.created_by_attempt}).Count-gt0){$null}else{$false});$existingCount=@($rows|Where-Object{$_.exists-eq$true}).Count $successEvidence=($progressComplete-and$childExited-and$childExit-eq0-and-not$timedOut-and$valid-eq4-and$existingCount-eq4-and$attemptedAll-and$createdAll-and$consumed-eq$true) if($parentExit-eq0-and-not$successEvidence){$terminal='PARENT_SUCCESS_EVIDENCE_MISMATCH';$stop='FINAL_CROSS_FIELD';$parentExit=27} $o=[ordered]@{schema_id='ANA.SEMI.STAGE.S.PARENT.TERMINAL.V003';terminal_state=$terminal;stop_code=$stop;governance_exit_code=$parentExit;parent_process_count=1;child_process_count=$(if($childStarted){1}else{0});child_exited=$childExited;child_exit_code=$childExit;child_timed_out=$timedOut;kill_issued=$killIssued;progress_complete=$progressComplete;authorization_consumed=$consumed;observed_existing_count=$existingCount;valid_count=$valid;rows=$rows} $j=$o|ConvertTo-Json -Compress -Depth 6;[Console]::Out.Write($j+"`n");[Console]::Out.Flush();exit $parentExit } ``` ## 4. row/schema and success - row 9-key schema、N/B/U/V/I/Q/R/D/X semantics 与 V029 第 5/8 节保持。 - top V003 ordered keys:`schema_id,terminal_state,stop_code,governance_exit_code,parent_process_count,child_process_count,child_exited,child_exit_code,child_timed_out,kill_issued,progress_complete,authorization_consumed,observed_existing_count,valid_count,rows`。 - T13:child exit0 但 progress!=exact12、任一 row attempted/created/VALID 不全、consumed!=true、existing/valid!=4 → `PARENT_SUCCESS_EVIDENCE_MISMATCH/FINAL_CROSS_FIELD/27`。 - T14:只有 progress_complete=true、child_exited=true、actual exit0、timed_out=false、4 attempted=true、4 created=true、4 exists/VALID、consumed=true 才 governance=0。 - child_exited=false 永远 rows=U/U/U/U,consumed=null,governance=27;禁止 Get-Item/raw scan。 ## 5. fixed vectors gate 提交审核前 append-only 登记 parent/child parser/hash、EncodedCommand/Arguments/CommandLine、LF/CR、output ceiling、T13/T14 full literal JSON hash;placeholder=0。未登记不得送审。 ## 6. zero state - Y01—Y04 absent;run/Y05—Y08 absent;parent/child/candidate/database 未执行。 - Stage S/Stage V/database authorization=`NOT_ISSUED/NOT_ISSUED/NOT_ISSUED`;formal=0;BATCH-001=HELD;darkline_restored=false。 ## 7. fixed V032 vectors 与 T13/T14 literals - parent=`13325/0f11caeb123a537a9597d55559d6fa5c87dc43f38ef2567c7a03ec937d540369`;PS5.1 parser=`0`;CR/LF/final=`0/82/0x0A`;PARENT_PID token=`1`。 - child=`2797/aeeddde8793d352af5f81988aa603a30cea9c145eaeb6024c5e83801800b30cc`;PS5.1 parser=0;CR/LF/final=`0/15/0x7D`;progress/STOP 只用显式 LF。 - child EncodedCommand=`7460 chars/5b3931022b452facf7a0941c26549cea24da3d8eafd01476a9152025c2d924ee`;Arguments=`7535/8e27019d502f352e946fd87354fbc53a9b29720b7ff8d8219e3d823a66b46cb9`;expected command line=`7593/f2a7b2c7b0ba55b8091e34410d2df8203128724756ca58919ba34a94a2797e07`。 - child source static process-spawn token count=0;child process tree total=1(child 自身),不能派生孙进程。 - parent final ASCII 上界 `<3800+LF`;child stdout 上界 `<768 ASCII bytes`、stderr=0;tool max_output_tokens=4096。 ### T13 canonical JSON(无 final LF) ```json {"schema_id":"ANA.SEMI.STAGE.S.PARENT.TERMINAL.V003","terminal_state":"PARENT_SUCCESS_EVIDENCE_MISMATCH","stop_code":"FINAL_CROSS_FIELD","governance_exit_code":27,"parent_process_count":1,"child_process_count":1,"child_exited":true,"child_exit_code":0,"child_timed_out":false,"kill_issued":false,"progress_complete":false,"authorization_consumed":true,"observed_existing_count":3,"valid_count":3,"rows":[{"id":"Y01","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":17465,"sha256":"89812a35ac352d6fd0887f0b67df85962070d637aba4962992b46e073dd4bcf6","validation":"VALID"},{"id":"Y02","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":3359,"sha256":"1983df916d5b9553a885a949d2674d9f8a8e7b1a6c4c5989eadf48245d929cf0","validation":"VALID"},{"id":"Y03","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":4016,"sha256":"86f563b43d934cb0828e395f557ded328ad2abcfb2c1ef7bdbc8a4c32c12cbca","validation":"VALID"},{"id":"Y04","attempted":false,"created_by_attempt":false,"exists":false,"object_type":"ABSENT","reparse":false,"bytes":null,"sha256":null,"validation":"NOT_PRESENT"}]} ``` - T13=`1223/1cd50b60922da80e25622119c47edff61d13f9646783c44050ecf1807b83b264`。 ### T14 canonical JSON(无 final LF) ```json {"schema_id":"ANA.SEMI.STAGE.S.PARENT.TERMINAL.V003","terminal_state":"SOURCE_FREEZE_COMPLETED_PENDING_STATIC_REVIEW","stop_code":null,"governance_exit_code":0,"parent_process_count":1,"child_process_count":1,"child_exited":true,"child_exit_code":0,"child_timed_out":false,"kill_issued":false,"progress_complete":true,"authorization_consumed":true,"observed_existing_count":4,"valid_count":4,"rows":[{"id":"Y01","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":17465,"sha256":"89812a35ac352d6fd0887f0b67df85962070d637aba4962992b46e073dd4bcf6","validation":"VALID"},{"id":"Y02","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":3359,"sha256":"1983df916d5b9553a885a949d2674d9f8a8e7b1a6c4c5989eadf48245d929cf0","validation":"VALID"},{"id":"Y03","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":4016,"sha256":"86f563b43d934cb0828e395f557ded328ad2abcfb2c1ef7bdbc8a4c32c12cbca","validation":"VALID"},{"id":"Y04","attempted":true,"created_by_attempt":true,"exists":true,"object_type":"FILE","reparse":false,"bytes":13037,"sha256":"244463c2a66910dd71564f148d5845672261dedc80a636e21e809712b691337e","validation":"VALID"}]} ``` - T14=`1271/772d2f2f02d0dadd886f219768ebeb421b489aece0eb284ed97ab583184949da`。 - T13/T14 均为 15 top-level ordered keys + 4×9 row ordered keys;strict JSON parse 后按相同 key order compact 重序列化 byte-identical。 - T14 executable predicate 与 literal 完全绑定:exact12、no STOP/unknown、4 attempted、4 created、4 existing/VALID、consumed=true、child exit0、not timeout。 - T13 表示 child exit0 但只完成 Y01—Y03;progress/rows/consumption 与 governance27 一致。其他 success-evidence drift 一律归 T13 family/27,不得改写为 T14。 第 7 节 supersede 第 5 节待补状态;placeholder=0,仅允许独立计划审核。 ## 8. exact outer coordinator / rescue contract - parent launch:tool `exec_command` 必须 `tty=true,workdir=E:\\mb-ms-doc\\project-info,yield_time_ms=2000,max_output_tokens=4096`,cmd bytes 必须等于本计划 parent preimage。 - initial result:若 terminal,必须含 exact PID line + V003 JSON;否则必须返回唯一 session_id。任何 output truncation/original_token_count>limit/invalid cardinality 为 native STOP。 - transcript write:对唯一 session 一次 non-empty `write_stdin(chars=<51206 exact ASCII>,yield_time_ms=30000,max_output_tokens=4096)`。若 terminal,验证 exact two-line wire;若仍 live,禁止再次发送字符,进入 rescue。 - rescue executable:`C:\\Windows\\System32\\taskkill.exe` = `101376/56f8cc2c1790c389394733b84c3fb55e10977e9f0fe0c08110ac11f0fe47f05e`,version `10.0.19041.1 (WinBuild.160101.0800)`。 - rescue wrapper template(UTF-8 no BOM、one final LF): ```powershell $ErrorActionPreference='Stop' $targetPidText='{{PID}}' if($targetPidText-cnotmatch'\A[1-9][0-9]{0,9}\z'){exit 27} & 'C:\Windows\System32\taskkill.exe' /PID $targetPidText /T /F | Out-Null exit $LASTEXITCODE ``` - template 中 `{{PID}}` 必须仅替换一次为 parent 首行认证 decimal;actual wrapper 禁止其他变更。rescue `exec_command` 固定 `yield_time_ms=10000,max_output_tokens=1024,workdir=project root`。 - rescue 后无论 rescue terminal/unknown,均对原 parent session仅一次 empty `write_stdin(yield_time_ms=10000,max_output_tokens=4096)`。不得执行 raw target observer;实际文件子集交由 terminal 后独立 reviewer same-read。 - tree_kill_confirmed 仅当 rescue wrapper terminal exit0 且原 parent session terminal。其余任一 read/timeout/truncation/live/exit unknown 为 `OUTER_OR_RESCUE_LIVENESS_UNKNOWN/27`。 ## 9. native rescue terminal schema/literals - schema `ANA.SEMI.STAGE.S.OUTER.RESCUE.V001` ordered top keys:`schema_id,terminal_state,stop_code,governance_exit_code,parent_pid,parent_process_count,child_process_count,parent_session_exited,parent_session_exit_code,rescue_wrapper_process_count,taskkill_process_count,rescue_wrapper_started,taskkill_started,taskkill_exit_code,tree_kill_confirmed,authorization_consumed,observed_existing_count,valid_count,rows`。 - row 9 keys 与 V003 相同;rescue path 永远四行 U:attempted/created/exists/reparse/bytes/hash=null,object_type=UNKNOWN,validation=UNKNOWN。禁止把 rescue terminal 解释为 package closure。 - types/null:schema/terminal/stop=STRING;governance=INT32 固定 27;parent_pid=UINT32;parent_process_count=INT32 固定1;child_process_count=INT32|null;parent_session_exited=BOOL,且 false 时 parent_session_exit_code 必为 null、true 时为 INT32;rescue/taskkill process_count=INT32 0|1;started=BOOL;taskkill_exit_code=INT32|null;tree_kill_confirmed=BOOL;authorization_consumed/observed_existing_count/valid_count 全为 null;rows=ARRAY[4] ordered Y01—Y04。 - rescue outcome totality:R0 parent 在 30s 内 terminal→不用 V001,只验 exact PID+V003;R1 taskkill exit0 且 parent poll terminal→T15 family;R2 taskkill nonzero、wrapper failure/timeout/truncation、parent poll still live/unknown、exit/cardinality drift→T16 family。只有 R1 tree_kill_confirmed=true;R2 一律 false。任何 rescue path 均不得声称 success、materialized subset 或 consumed。 - T15 tree-kill-confirmed literal(无 final LF): ```json {"schema_id":"ANA.SEMI.STAGE.S.OUTER.RESCUE.V001","terminal_state":"OUTER_TIMEOUT_TREE_KILLED_PACKAGE_UNKNOWN","stop_code":"OUTER_TIMEOUT_RESCUE","governance_exit_code":27,"parent_pid":4242,"parent_process_count":1,"child_process_count":null,"parent_session_exited":true,"parent_session_exit_code":-1,"rescue_wrapper_process_count":1,"taskkill_process_count":1,"rescue_wrapper_started":true,"taskkill_started":true,"taskkill_exit_code":0,"tree_kill_confirmed":true,"authorization_consumed":null,"observed_existing_count":null,"valid_count":null,"rows":[{"id":"Y01","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"},{"id":"Y02","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"},{"id":"Y03","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"},{"id":"Y04","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"}]} ``` - T16 liveness-unknown literal(无 final LF): ```json {"schema_id":"ANA.SEMI.STAGE.S.OUTER.RESCUE.V001","terminal_state":"OUTER_OR_RESCUE_LIVENESS_UNKNOWN","stop_code":"OUTER_RESCUE_UNKNOWN","governance_exit_code":27,"parent_pid":4242,"parent_process_count":1,"child_process_count":null,"parent_session_exited":false,"parent_session_exit_code":null,"rescue_wrapper_process_count":1,"taskkill_process_count":1,"rescue_wrapper_started":true,"taskkill_started":true,"taskkill_exit_code":null,"tree_kill_confirmed":false,"authorization_consumed":null,"observed_existing_count":null,"valid_count":null,"rows":[{"id":"Y01","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"},{"id":"Y02","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"},{"id":"Y03","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"},{"id":"Y04","attempted":null,"created_by_attempt":null,"exists":null,"object_type":"UNKNOWN","reparse":null,"bytes":null,"sha256":null,"validation":"UNKNOWN"}]} ``` - rescue template=`207/f1b418334a5876cb8055331bfb1c285d4d566ac77b23d6382b510224537ec0fb`;PS5.1 parser=0;CR/LF/final=`0/5/0x0A`;`{{PID}}` token=1。 - T15=`1190/1d356a52a6b31e848c4b1b07949d94079c0df84c92550a8bd24bbcd86bf2fcdf`;T16=`1188/3725b7eadf74aaa7d9eacd10db5ad373efc12caa993998076d03ad704363c0d6`;均 strict JSON,19 top-level keys + 4×9 rows。 - parent/rescue/T15/T16 已登记完整 bytes/hash/parser/profile;placeholder count=0,可提交独立复审。