Why: establish the authorized task workspace and its initial baseline.
Evidence: preserved precheck receipt in .task/fix-svc-pipefail-early-exit-pipes.md; R0=7e19cf3e182b566bdc48a7e690e44ff11b4ab33c.
Impact: task metadata only; the feature workspace starts at 7e19cf3e18.
Refs: .task/fix-svc-pipefail-early-exit-pipes.md
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=6a7f008ed491e813d7f43fb013cb9542d849ff85.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Why: the sweep needs its authorization boundary, three agent unit receipts and
the review verdict recorded before delivery.
Evidence: /tmp/svc-pipefail-impl-r1-20261020.json (cursor, success, f87d63f),
/tmp/svc-pipefail-review-r1-20261020.json (pi-glm, PASS, 2ef67de),
/tmp/svc-pipefail-repair-r2-20261020.json (cursor, success, 5fadf85);
review report .task/reviews/2026-10-20-svc-pipefail-independent-review.md.
Impact: card metadata only; no behaviour change.
Refs: fix/svc-pipefail-early-exit-pipes
Why: close the task card inside its own PR so landing it needs no post-merge backfill or separate close PR.
Evidence: .task/fix-svc-pipefail-early-exit-pipes.md -> .task/archive/fix-svc-pipefail-early-exit-pipes.md; status 已完成(合入前闭合); PR #664https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/664.
Impact: task metadata only; the card is archived within PR #664 and lands with its merge commit.
Refs: task.sh close --self
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=1850d03563875fd848664ab9b348f6858d0fa590.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=36466b99f2fbc8e389167e01e722ece33965df2b.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
fix/svc-pipefail-early-exit-pipes 任务卡
任务主记录:<PR 链接,交付前填写>;状态:进行中;owner:weichen
权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)=
7e19cf3e18工作区:/home/weichen/projects/Agent-System-Dev-wt-fix-svc-pipefail-early-exit-pipes(worktree);分支:fix/svc-pipefail-early-exit-pipes
分支类型:standalone;root_target:main;immediate_target:main;accepting_requirements:false
需求分流:verdict=NEW;selected_initiative=无;requirement_sha256=995ae1c10a5bed201669a98755fcd9db243864384184f224d037521c25d156fb;triage_receipt=/tmp/triage-pipefail-class-20261020.json;receipt_sha256=a136d676c51767e6fc53e36b96e6d518cd235ccc9ad4a77a14449ace86136d8f
授权与交付终点:消除本仓受管 shell 脚本在
set -o pipefail下的早退读取器管道隐患,并加守护测试防复发;按现行门禁完成 Review、PR、CI、合入、任务卡闭合与安全回收。不得改动任何命令的语义与退出码契约,不得改 Makefile/CI/子模块/规范文档,不得用|| true、set +o pipefail掩盖状态,不得新增 schema/开关/通用重构。交付模式:goal-first(目标、范围和交付终点一次确认;范围内连续推进)
实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
流程依据:仓库根目录 policy/delivery.md(归档后仍按仓库根目录定位)
目标与非目标
目标:
producer | grep -q PAT、... | head -N、awk ... exit这类「读取器先退出」的管道,在set -euo pipefail下会让写满 64KiB 管道缓冲的生产者收到 SIGPIPE,管道状态变成 141 而非读取器结论,if/if !/&&的判定被静默翻转。本任务把本仓受管脚本(scripts/svc.sh、scripts/task.sh、scripts/e2e.sh、scripts/lint-boundaries.sh、docker/verify-env.sh、tests/load/collaboration/run_pgbench.sh)中的此类管道改为语义等价且读取器退出码不再经过管道形态,并新增tests/test_shell_pipe_hazard.py守护测试防止复发。受影响入口:make task-finish、make precheck、make svc系列与环境校验。非目标:不改变任何命令的行为、退出码与调用顺序;不修
runtime/下的 ignored 陈旧克隆;不改守护测试的检测范围(中段读取器、awk exit、| read、前缀化 grep 等盲区按 Review 建议保留为非阻塞);不改 Makefile、CI、子模块 pin、共享规范子模块与文档;不新增 schema、运行时开关或通用化重构。验收条件:(1) 受管脚本中不再有末级早退读取器管道,守护测试通过;(2) 变换前后行为等价(含命中/未命中/多行匹配/命令替换取值/退出码),并有对照证据;(3)
make test-governance与test_svc*.py全绿;(4) 独立 Review 无阻塞项。Agent 实施收据
路由与 fail-stop 规则见根目录 AGENT-EXECUTION.md 与 policy/delivery.md;每次尝试一行,原始日志留在源码外收据路径。
tests/test_shell_pipe_hazard.pyf87d63f)/tmp/svc-pipefail-impl-r1-20261020.json.task/reviews/2026-10-20-svc-pipefail-independent-review.md2ef67de)/tmp/svc-pipefail-review-r1-20261020.jsonscripts/svc.shauto模型不可用,零产物不导入)5fadf85)/tmp/svc-pipefail-repair-r2-20261020.json(r1:/tmp/svc-pipefail-repair-r1-20261020.json)同步记录
7e19cf3e187e19cf3e186a7f008ed4b9a0309aa4证据(Evidence)
结果与验证(完成后填写)
grep -q PAT <<<"$var")、命令生产者改进程替换(grep -q PAT < <(producer),二进制grep -qa亦走进程替换以避免 NUL 截断)、sed … | head -1改sed -n '/re/{s//x/p;q;}';另新增tests/test_shell_pipe_hazard.py(词法扫描管道末级 + 可失败的合成自检)。未使用|| true/set +o pipefail掩盖状态。/tmp/pipefail-demo-evidence-20261020.json:旧式在 >64KiB 生产者下把命中分支错误地跳过,新式正确命中,小输入语义不变;dsn 提取新旧表达式在命中/未命中/值内含伪 dsn/文件缺失/多行匹配五种输入下逐一 MATCH(/tmp/dsn-equiv-evidence-20261020.json);6 个脚本bash -n全过;最终 HEAD 上守护测试 4 项 OK、test_svc*.py213 项 OK(18 skipped)、make test-governance518 项 OK(18 skipped)。真实故障参照:PR #657 修复前 Backend 组件索引 76386 字节、旧式管道 rc=141。if判定(Review 逐处判定为修正旧判定翻转或中性等价)。非阻塞(按 Review 建议保留):守护测试仅覆盖末级读取器,中段| head、awk … exit、| read、前缀化grep为已知盲区;SCRIPTS元组硬编码,新增受管脚本需手动登记。合入与清理
.task/reviews/2026-10-20-svc-pipefail-independent-review.md;无阻塞项,4 项非阻塞建议;其点名的 svc.sh 三处残留已由 repair 单元5fadf858收干净,重放依据:host 行为对照 + dsn 等价对照 +test_svc*.py/治理套件)make task-sync,无冲突;业务差异始终限于 6 个脚本、1 个新增测试与任务记录)| 同步(记录前对象) |
6a7f008ed4|ba4917e62b| 2026-10-20T15:48:20Z |