Repository navigation
WIP: R6 comsub heredoc 双实现收敛(冗余清扫 D 类) - #1980
Merged
Merged
Conversation
…lan/produce pair Redundancy audit R6 (~/workspace/redundancy-hunt/rubash/REPORT.md): command_substitution_heredoc_output_mut_typed and command_substitution_heredoc_output carried two near-identical copies of the same admission whitelist (real parse, cat + stands-down, rubash#320 file-redirect refusal, rubash#1130 expansion-error refusal, multi-cat concatenation, [sort,-u] pipeline arm). They now share one admission (Executor::heredoc_comsub_plan) and one production (heredoc_comsub_produce) parameterized by the caller's stdin fetch — typed (side-effecting) for the mut entry, readback for the &self entry. Here-document warnings stay owned by the typed entry only, exactly as before. Decline chain: a typed attempt that declines records a decline-only memo (Executor::heredoc_admission_declined_source) so the readback retry of the same source inside the same expansion episode no longer re-runs the tokenize/parse + admission pass before falling through to the real executor (the general path's own parse is unchanged). The memo can never admit: a hit only routes the body to the real executor, so a stale record costs the shortcut, never semantics. timed-cat: the byte-read ladder (registry -> synthetic link -> fs) and the fd-0 FUNCTION_STDIN consumption are now shared with the word-level cat arm via comsub_cat_operand_bytes / comsub_cat_function_stdin_text. The T2 policy fork stays explicit in the arms and is NOT unified: timed keeps UTF-8-strict reads, silent skips and status 0; word-level keeps raw bytes as content, per-file diagnostics and status 1 (rubash#772). Zero observable behavior change: 33-case parity matrix (heredoc-comsub all shapes, timed/word cat fork shapes, decline shapes) byte-identical before/after on stdout/stderr/rc; lib 904/1/3 and regression 171/4/1 failure sets name-identical to the pristine fa17033 tree; diffcorpus 306 with failure set inside the known timing-flake set on both sides.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
冗余审计 R6 施工(用户 2026-10-28 裁定 A+B+C+D 全批):
command_substitution_heredoc_output_mut_typed与command_substitution_heredoc_output两份近同构实现收敛为一份准入(heredoc_comsub_plan)+ 一份生产(heredoc_comsub_produce,按调用方 fetch 参数化);decline 链加 decline-only memo,同一输入至多一次准入 parse;timed-cat 与词级 cat 臂 B 只共享读字节梯子与 fd-0 消费,T2 语义分叉原样保留、未动行为(timed 静默/恒 0/UTF-8 严格 vs 词级诊断/status=1/字节保真)。零可观察行为变更,证据:33 例平价矩阵(heredoc-comsub 全形 + 两臂分叉形 + decline 形)改前/改后 stdout/stderr/rc 逐字节同(t 形 raw stderr 仅计时数值差,过滤后同);lib 904/1/3、regression 171/4/1 失败集与 pristine fa17033 逐名同;diffcorpus 306 失败集 ⊆ 已知 flake 集(隔离复跑双 PASS);per-file rustfmt 净、CR=0。-D warnings 终检与 Windows CI 为合并门(主会话合,不自合)。
报告:~/workspace/clean-rubash-comsub/REPORT.md