Skip to content

PS4: route through the prompt-error containment channel - #3593

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/3542-ps4-question-error
Nov 15, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/3542-ps4-question-error

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Refs #3542

GNU expand_prompt_string (subst.c:4392-4418) runs the PS4 word pass
under no_longjmp_on_fatal_error and returns the decoded string on any
verdict, so a :? error operator REPORTS (subst.c:8216
parameter_brace_expand_error) and the xtrace prefix stays literal:
PS4='+${q:?err}' prints q: err then +${q:?err}: hi. The PS4 path
used the bare embedded-parameter walk, which substituted the message
(+err: hi) and never diagnosed; it now goes through the same
expand_prompt_string-grade channel PS1 and ${var@P} already use.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Refs #3542

GNU expand_prompt_string (subst.c:4392-4418) runs the PS4 word pass
under no_longjmp_on_fatal_error and returns the decoded string on any
verdict, so a `:?` error operator REPORTS (subst.c:8216
parameter_brace_expand_error) and the xtrace prefix stays literal:
`PS4='+${q:?err}'` prints `q: err` then `+${q:?err}: hi`. The PS4 path
used the bare embedded-parameter walk, which substituted the message
(`+err: hi`) and never diagnosed; it now goes through the same
expand_prompt_string-grade channel PS1 and `${var@P}` already use.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@caomengxuan666

Copy link
Copy Markdown
Member Author

【WIN-AGENT-AUDIT】
PR #3593 第1轮 — 建议:PASS
head: 911dbf6 base(merge-base): 96802ca 文件: 2 个 +58/-1
关联 issue: #3542(我核过的时间:2026-11-15 本机)

机制核查:

  • PS4 从 expand_embedded_parameters 改走 expand_embedded_parameters_double_quoted(embedded_parameters.rs:190)——与 PS1/${var@P} 同一 containment 通道。GNU 依据:expand_prompt_string(subst.c:4401,PR 引 4392-4418 有 ~9 行漂移)在 no_longjmp_on_fatal_error 下跑展开,verdict 后回退 decoded 原文。
  • WSL GNU 5.3.20 oracle(target/probe-3542.sh):( PS4='+${q:?err}'; set -x; : hi ) → q: err + +${q:?err}: hi + st=0;( q=ok; PS4='+${q}: '; set -x; : hi ) → +ok: : hi。两钉形状全一致。
  • 无关改动:无。

腿(逐项):

  • 钉自跑:cargo test --test issue3542_ps4_question_error --locked @911dbf69 → 2 passed / 0 failed。
  • fail-first:merge-base → 1 passed / 1 failed,红 = {ps4_question_error_reports_and_stays_literal},base 输出 +err: hi(消息被代进前缀——issue 原状);正常展开钉双边绿。
  • lib 双边(CI 代跑):红名 {issue2875} 基线双边同。
  • CI:三红任务名全 = {issue2875} 基线。
  • GNU 对照:上,WSL bash 5.3.20 全一致。

F 点:无。
续作记录:无。
未跑/VOID 的腿:-D warnings 全量(单行调用点改动)、fmt 直检。

@caomengxuan666

Copy link
Copy Markdown
Member Author

【队长终裁】PASS

核过审计报告(6886615221)+ CI 全表,并纠正批量汇总表的记录错误:汇总表把本单标 FAIL,但审计报告正文写的是 PASS,且审计内容自洽——钉 2/2,fail-first 1/1(红 = issue 形状,base 输出 +err: hi,消息被代进前缀;正常展开钉双边绿),GNU oracle 两形状全一致(:? 报告 + 前缀保持字面),无 F 点,CI 三红红名全为 issue2875 基线。汇总表的 FAIL 标注意为誊录错误,以审计报告为准,本单判 PASS。合入轮补跑 lib 双边 + RUSTFLAGS="-D warnings" 全量(agent 未跑)。合入正文 Refs #3542(合入后由队长手动关闭)。

@caomengxuan666

Copy link
Copy Markdown
Member Author

【WIN-AGENT-REWORK】
PR #3593 — 按终裁补腿(无 F 点,审计+终裁均判 PASS,批量汇总 FAIL 系誊录错误)
head: 911dbf6(与审计记录一致,无人推进)

补跑缺腿(本机,CARGO_INCREMENTAL=0,-j 2):

  • 钉自跑:cargo test --locked --test issue3542_ps4_question_error @911dbf69 → 2 passed / 0 failed(ps4_question_error_reports_and_stays_literal、ps4_normal_expansion_unchanged)。
  • fail-first:沿用审计记录(base 96802ca → 1 passed / 1 failed,红=issue 形状,base 输出 +err: hi 消息被代进前缀)。
  • lib 双边(本次实跑):base(96802ca) cargo test --lib → 1350/1/4 红={issue2084};head(911dbf6) → 1350/1/4 红={issue2084};红集一致,差集 ∅。
  • -D warnings:RUSTFLAGS="-D warnings" cargo check --locked(lib+bins)→ exit 0;本 PR 测试目标 --test issue3542_ps4_question_error 同命令 → exit 0。--all-targets 全量会撞 tests/issue566_bare_drive_root_enoent_regressions.rs:28 unused import Path——base 96802ca 即存在(#![cfg(windows)] 文件,与本 PR 无关),记为基线噪音不返工。
  • fmt:PR 两文件本 PR 未改动(911dbf69 原样),rustfmt 直检干净;本机 cargo fmt os error 206 坏损(本次无新 commit,无绕过)。
  • GNU 对照:沿用审计 WSL 5.3.20 oracle(q: err + +${q:?err}: hi + st=0;+ok: : hi)两形状全一致。
  • 备注:master 已合 fix(test): resolve the rubash bin across non-dev test profiles for respawn children (Refs #2875) #3588(issue2875 基线根因修复),本 PR 合入后 CI 三红签名应不再出现。

按终裁合入,正文 Refs #3542。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant