Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

embedded-captions: occlusion gate records PASS when check-occlusion times out before its verdict

已关闭 适合新手
#5,485 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #5491 来自 @xiajiahang —— 已合并
  • #5496 来自 @Yi-111-a —— 已关闭,未合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, node.js, typescript

调研方向

从 skills/embedded-captions/scripts/render-and-composite.sh 中 watchdog kill 分支开始,追踪 verdict_at、OCC_RC 和 OCCLUSION_SKIP 如何影响 gate 结果。使用 issue 中描述的 harness 重现 verdict 前的超时,然后检查它是否会导致 gate 失败,同时 verdict 后 teardown 卡住时仍保持当前行为。完成标准是无法将未完成的分析记录为 PASS。

由索引模型根据 Issue 内容生成。

描述

Bug

In skills/embedded-captions/scripts/render-and-composite.sh, the occlusion + overflow gate runs check-occlusion.cjs under a watchdog. When the watchdog fires because no verdict was printed within 150 s (analysis stuck, not the known sharp/libvips teardown hang), the kill branch still sets:

if grep -q 'cap(s) FAIL' "$OCC_LOG"; then OCC_RC=2; else OCC_RC=0; fi

The incomplete log has no cap(s) FAIL line, so OCC_RC=0. The gate then appends occlusion+overflow PASS to _gates.txt and the render continues, even though the analysis never completed. It also logs the misleading "hung after verdict (sharp teardown)" message.

The verdict_at marker (set when the [v2] … word-fail≥ header appears) already distinguishes the two cases, but the kill branch does not consult it.

Reproduction

Extract the gate block (the if [[ -f "$PROJECT/plan.json" && -d "$PROJECT/frames_fg" ]] … fi section) into a harness, lower occ_t0 > 150 to > 4, and stub check-occlusion.cjs with a process that never prints, e.g. setInterval(() => {}, 1000);. On current main the harness exits 0 and _gates.txt reads occlusion+overflow PASS.

Suggested fix

Treat a pre-verdict timeout as a failed gate, keeping the post-verdict teardown tolerance and the existing OCCLUSION_SKIP=1 override:

       kill -9 "$OCC_PID" 2>/dev/null
+      if [[ -z "$verdict_at" ]]; then
+        # No verdict: the analysis never finished, so it cannot count as a pass.
+        OCC_RC=3
+        echo "[render] occlusion gate timed out before its verdict — killed; analysis incomplete (rc=3)" >&2
+        break
+      fi
       if grep -q 'cap(s) FAIL' "$OCC_LOG"; then OCC_RC=2; else OCC_RC=0; fi

Checked in the same harness with stub analyzers:

Scenario Current main With the fix
Hangs before any verdict PASS (wrong) aborts, rc 3
Verdict, no FAIL, then teardown hang PASS PASS
Verdict + cap(s) FAIL, then hang aborts, rc 2 aborts, rc 2
Pre-verdict timeout with OCCLUSION_SKIP=1 PASS (wrong) continues, recorded as OVERRIDDEN

No permanent test is included: the skill has no harness for its shell scripts, and a fast test would need the 150 s budget to be configurable. Happy to open a PR with or without that if useful.

Found by automated review while vendoring the skills into a downstream repository (related: #5482, #5483).

主要语言
TypeScript
星标
54.1k
派生
4.9k
平均合并
10 小时 45 分钟
30 天内合并 PR
654

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

heygen-com/hyperframes 的其他 Issue

查看 heygen-com/hyperframes 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。